-
Notifications
You must be signed in to change notification settings - Fork 3
Update Serving API - from backend PR #5294 #315
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ export type ConfigAudience = { | |
| */ | ||
| name?: string; | ||
| type?: ConfigAudienceTypes; | ||
| rules?: ((RuleObject) | null); | ||
| rules?: ((RuleObjectAudience) | null); | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -359,7 +359,7 @@ export type BaseMatch = { | |
| negated?: boolean; | ||
| }; | ||
|
|
||
| export type TextMatchRulesTypes = 'url' | 'url_with_query' | 'query_string' | 'campaign' | 'keyword' | 'medium' | 'source_name' | 'city' | 'region' | 'browser_version' | 'user_agent' | 'page_tag_page_type' | 'page_tag_category_id' | 'page_tag_category_name' | 'page_tag_product_sku' | 'page_tag_product_name' | 'page_tag_customer_id' | 'page_tag_custom_1' | 'page_tag_custom_2' | 'page_tag_custom_3' | 'page_tag_custom_4'; | ||
| export type TextMatchRulesTypes = 'url' | 'url_with_query' | 'query_string' | 'campaign' | 'keyword' | 'medium' | 'source_name' | 'city' | 'region' | 'browser_version' | 'user_agent' | 'page_tag_page_type' | 'page_tag_category_id' | 'page_tag_category_name' | 'page_tag_product_sku' | 'page_tag_product_name' | 'page_tag_customer_id' | 'page_tag_custom_1' | 'page_tag_custom_2' | 'page_tag_custom_3' | 'page_tag_custom_4' | 'visitor_id'; | ||
|
|
||
| export const TextMatchRulesTypes = { | ||
| URL: 'url', | ||
|
|
@@ -382,7 +382,8 @@ export const TextMatchRulesTypes = { | |
| PAGE_TAG_CUSTOM_1: 'page_tag_custom_1', | ||
| PAGE_TAG_CUSTOM_2: 'page_tag_custom_2', | ||
| PAGE_TAG_CUSTOM_3: 'page_tag_custom_3', | ||
| PAGE_TAG_CUSTOM_4: 'page_tag_custom_4' | ||
| PAGE_TAG_CUSTOM_4: 'page_tag_custom_4', | ||
| VISITOR_ID: 'visitor_id' | ||
| } as const; | ||
|
|
||
| export type NumericMatchRulesTypes = 'avg_time_page' | 'days_since_last_visit' | 'pages_visited_count' | 'visit_duration' | 'visits_count' | 'page_tag_product_price'; | ||
|
|
@@ -423,6 +424,12 @@ export const GenericBoolKeyValueMatchRulesTypes = { | |
| GENERIC_BOOL_KEY_VALUE: 'generic_bool_key_value' | ||
| } as const; | ||
|
|
||
| export type VisitorDataExistsMatchRulesTypes = 'visitor_data_exists'; | ||
|
|
||
| export const VisitorDataExistsMatchRulesTypes = { | ||
| VISITOR_DATA_EXISTS: 'visitor_data_exists' | ||
| } as const; | ||
|
|
||
| export type JsConditionMatchRulesTypes = 'js_condition'; | ||
|
|
||
| export const JsConditionMatchRulesTypes = { | ||
|
|
@@ -506,7 +513,7 @@ export const WeatherConditionMatchRulesTypes = { | |
| WEATHER_CONDITION: 'weather_condition' | ||
| } as const; | ||
|
|
||
| export type RulesTypes = TextMatchRulesTypes & NumericMatchRulesTypes & BoolMatchRulesTypes & KeyValueMatchRulesTypes & CookieMatchRulesTypes & CountryMatchRulesTypes & VisitorTypeMatchRulesTypes & LanguageMatchRulesTypes & GoalTriggeredMatchRulesTypes & SegmentBucketedMatchRulesTypes & DayOfWeekMatchRulesTypes & HourOfDayMatchRulesTypes & MinuteOfHourMatchRulesTypes & BrowserNameMatchRulesTypes & OsMatchRulesTypes & WeatherConditionMatchRulesTypes; | ||
| export type RulesTypes = TextMatchRulesTypes & NumericMatchRulesTypes & BoolMatchRulesTypes & KeyValueMatchRulesTypes & VisitorDataExistsMatchRulesTypes & CookieMatchRulesTypes & CountryMatchRulesTypes & VisitorTypeMatchRulesTypes & LanguageMatchRulesTypes & GoalTriggeredMatchRulesTypes & SegmentBucketedMatchRulesTypes & DayOfWeekMatchRulesTypes & HourOfDayMatchRulesTypes & MinuteOfHourMatchRulesTypes & BrowserNameMatchRulesTypes & OsMatchRulesTypes & WeatherConditionMatchRulesTypes; | ||
|
|
||
| export type GenericTextMatchRule = BaseRuleWithStringValue & { | ||
| rule_type: TextMatchRulesTypes; | ||
|
|
@@ -564,6 +571,13 @@ export type GenericBoolKeyValueMatchRule = BaseRuleWithBooleanValue & { | |
| }); | ||
| } & GenericKey; | ||
|
|
||
| export type VisitorDataExistsMatchRule = BaseRuleWithBooleanValue & { | ||
| rule_type: VisitorDataExistsMatchRulesTypes; | ||
| matching?: (BaseMatch & { | ||
| match_type?: ChoiceMatchingOptions; | ||
| }); | ||
| }; | ||
|
|
||
| export type CookieMatchRule = BaseRuleWithStringValue & { | ||
| rule_type: CookieMatchRulesTypes; | ||
| matching?: (BaseMatch & { | ||
|
|
@@ -666,10 +680,12 @@ export type WeatherConditionMatchRule = BaseRuleWithWeatherConditionValue & { | |
| }); | ||
| }; | ||
|
|
||
| export type RuleElementNoUrl = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | CookieMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule; | ||
| export type RuleElementNoUrl = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | CookieMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule | VisitorDataExistsMatchRule; | ||
|
|
||
| export type RuleElement = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CookieMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule; | ||
|
|
||
| export type RuleElementAudience = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CookieMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule | VisitorDataExistsMatchRule; | ||
|
|
||
| export type TextMatchingOptions = 'matches' | 'regexMatches' | 'contains' | 'endsWith' | 'startsWith'; | ||
|
|
||
| export const TextMatchingOptions = { | ||
|
|
@@ -753,6 +769,26 @@ export type RuleObjectNoUrl = { | |
| }>; | ||
| } | null; | ||
|
|
||
| /** | ||
| * This one describes a logical rule that is being used inside the app for triggering goals, matching audiences etc | ||
| */ | ||
| export type RuleObjectAudience = { | ||
| /** | ||
| * This describes an outer set of blocks which are evaluated using OR's between them | ||
| */ | ||
| OR?: Array<{ | ||
| /** | ||
| * An array of OR_WHEN-blocks. | ||
| */ | ||
| AND?: Array<{ | ||
| /** | ||
| * An array of individual rule elements that do not involve URL matching. | ||
| */ | ||
| OR_WHEN?: Array<RuleElementAudience>; | ||
| }>; | ||
| }>; | ||
| } | null; | ||
|
|
||
| export type Base64Image = { | ||
| /** | ||
| * The base64 encoded string representation of the image's binary data. | ||
|
|
@@ -2445,6 +2481,10 @@ export type ConfigProject = { | |
| */ | ||
| products_ordered_count?: (NumericOutlier); | ||
| }; | ||
| /** | ||
| * List of active placeholders which are used in experiences for the project | ||
| */ | ||
| placeholders?: Array<(string)>; | ||
| } & ConfigProjectMinimalSettings); | ||
| }; | ||
|
|
||
|
|
@@ -2778,6 +2818,28 @@ export const visitorType = { | |
| RETURNING: 'returning' | ||
| } as const; | ||
|
|
||
| /** | ||
| * Response containing project's visitor data | ||
| */ | ||
| export type VisitorDataResponse = { | ||
| [key: string]: (string); | ||
| }; | ||
|
|
||
| /** | ||
| * Response containing project's visitor data with default values | ||
| */ | ||
| export type VisitorDataDefaultResponse = { | ||
| [key: string]: (string); | ||
| }; | ||
|
|
||
| /** | ||
| * Response containing project's visitor data | ||
| */ | ||
| export type VisitorDataResponseData = { | ||
| data?: VisitorDataResponse; | ||
| default?: VisitorDataDefaultResponse; | ||
| }; | ||
|
|
||
| export type GetProjectConfigData = { | ||
| /** | ||
| * ID of the account that owns the retrieved/saved data | ||
|
|
@@ -2864,6 +2926,36 @@ export type SendTrackingEventsData = { | |
|
|
||
| export type SendTrackingEventsResponse = (SuccessData); | ||
|
|
||
| export type GetVisitorDataData = { | ||
| /** | ||
| * ID of the account that owns the retrieved/saved data | ||
| */ | ||
| accountId: number; | ||
| /** | ||
| * ID of the project to be retrieved | ||
| */ | ||
| projectId: number; | ||
| /** | ||
| * ID of the visitor to be retrieved | ||
| */ | ||
| visitorId: string; | ||
| }; | ||
|
|
||
| export type GetVisitorDataResponse = (VisitorDataResponseData); | ||
|
|
||
| export type GetVisitorDataBySdkKeyData = { | ||
| /** | ||
| * The SDK key used to retrieve the project's visitor data | ||
| */ | ||
| sdkKey: string; | ||
| /** | ||
| * ID of the visitor to be retrieved | ||
| */ | ||
| visitorId: string; | ||
| }; | ||
|
|
||
| export type GetVisitorDataBySdkKeyResponse = (VisitorDataResponseData); | ||
|
|
||
| export type $OpenApiTs = { | ||
| '/config/{account_id}/{project_id}': { | ||
| get: { | ||
|
|
@@ -2959,4 +3051,36 @@ export type $OpenApiTs = { | |
| }; | ||
| }; | ||
| }; | ||
| '/visitor-data/{account_id}/{project_id}/{visitor_id}': { | ||
| get: { | ||
| req: GetVisitorDataData; | ||
| res: { | ||
| /** | ||
| * Object consumed by SDKs | ||
| * | ||
| */ | ||
| 200: VisitorDataResponseData; | ||
| /** | ||
| * A response signaling an error | ||
| */ | ||
| default: ErrorData; | ||
| }; | ||
| }; | ||
| }; | ||
| '/visitor-data/{sdk_key}/{visitor_id}': { | ||
| get: { | ||
| req: GetVisitorDataBySdkKeyData; | ||
| res: { | ||
| /** | ||
| * Object consumed by SDKs | ||
| * | ||
| */ | ||
|
Comment on lines
+3074
to
+3077
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 200: VisitorDataResponseData; | ||
| /** | ||
| * A response signaling an error | ||
| */ | ||
| default: ErrorData; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSDoc comment "Object consumed by SDKs" is a bit generic. Make it more specific to the response for better documentation.