Skip to content

fix(javascript): update Predict models error spec #980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.cache_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.13
0.0.14
110 changes: 0 additions & 110 deletions specs/predict/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,113 +5,3 @@ userID:
schema:
type: string
description: User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors).

userProfile:
type: object
required:
- user
properties:
user:
type: string
predictions:
type: object
title: predictions
properties:
funnel_stage:
type: object
description: Prediction for the **funnel_stage** model.
properties:
value:
type: array
items:
title: funnel_stage
type: object
properties:
name:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
required:
- name
- probability
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt
order_value:
type: object
description: Prediction for the **order_value** model.
properties:
value:
type: number
format: double
minimum: 0
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt
affinities:
type: object
description: Prediction for the **affinities** model.
properties:
value:
type: array
items:
title: affinity
type: object
properties:
name:
type: string
value:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
required:
- name
- value
- probability
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt
properties:
type: object
title: properties
description: Properties for the user profile.
properties:
raw:
type: object
description: Raw user properties (key-value pairs).
computed:
type: object
description: Computed user properties (key-value pairs).
custom:
type: object
description: Custom user properties (key-value pairs).
segments:
type: object
title: segments
required:
- computed
- custom
description: Segments that the user belongs to.
properties:
computed:
type: array
description: List of computed segments IDs.
items:
type: string
custom:
type: array
description: List of custom segments IDs.
items:
type: string
2 changes: 1 addition & 1 deletion specs/predict/paths/users/fetch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ post:
application/json:
schema:
title: fetchUserProfileResponse
$ref: '../../common/parameters.yml#/userProfile'
$ref: '../../responses/UserProfile.yml#/userProfile'
'404':
$ref: '../../responses/UserNotFound.yml'
'405':
Expand Down
2 changes: 1 addition & 1 deletion specs/predict/paths/users/fetchAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ post:
users:
type: array
items:
$ref: '../../common/parameters.yml#/userProfile'
$ref: '../../responses/UserProfile.yml#/userProfile'
previousPageToken:
$ref: '../../common/schemas/Params.yml#/previousPageToken'
nextPageToken:
Expand Down
142 changes: 142 additions & 0 deletions specs/predict/responses/UserProfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
userProfile:
type: object
required:
- user
properties:
user:
type: string
predictions:
type: object
title: predictions
properties:
funnel_stage:
$ref: '#/predictionsfunnelStage'
order_value:
$ref: '#/predictionsOrderValue'
affinities:
$ref: '#/predictionsAffinities'
properties:
type: object
title: properties
description: Properties for the user profile.
properties:
raw:
type: object
description: Raw user properties (key-value pairs).
computed:
type: object
description: Computed user properties (key-value pairs).
custom:
type: object
description: Custom user properties (key-value pairs).
segments:
type: object
title: segments
required:
- computed
- custom
description: Segments that the user belongs to.
properties:
computed:
type: array
description: List of computed segments IDs.
items:
type: string
custom:
type: array
description: List of custom segments IDs.
items:
type: string

error:
type: object
description: The error when the model is not available.
properties:
error:
type: string
required:
- error

predictionsfunnelStage:
oneOf:
- $ref: '#/funnelStageSuccess'
- $ref: '#/error'

funnelStageSuccess:
type: object
description: Prediction for the **funnel_stage** model.
properties:
value:
type: array
items:
title: funnel_stage
type: object
properties:
name:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
required:
- name
- probability
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt

predictionsOrderValue:
oneOf:
- $ref: '#/orderValueSuccess'
- $ref: '#/error'

orderValueSuccess:
type: object
description: Prediction for the **order_value** model.
properties:
value:
type: number
format: double
minimum: 0
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt

predictionsAffinities:
oneOf:
- $ref: '#/affinitiesSuccess'
- $ref: '#/error'

affinitiesSuccess:
type: object
description: Prediction for the **affinities** model.
properties:
value:
type: array
items:
title: affinity
type: object
properties:
name:
type: string
value:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
required:
- name
- value
- probability
lastUpdatedAt:
type: string
required:
- value
- lastUpdatedAt