@picked/analytics 0.0.116-next.2 → 0.0.116-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/interactions/document.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/interactions/document.js +61 -62
- package/dist/esm/plugins/analytics/index.js +66 -64
- package/dist/src-BHrYsJFl.cjs +1 -0
- package/dist/src-DiJ_Kes-.js +1078 -0
- package/dist/{text-BfR9q1WW.js → text-CkKXwGpF.js} +72 -54
- package/dist/text-x3eAnxxc.cjs +1 -0
- package/dist/types/events/app_close.d.ts.map +1 -1
- package/dist/types/events/app_initialize.d.ts.map +1 -1
- package/dist/types/events/app_load.d.ts.map +1 -1
- package/dist/types/events/app_open.d.ts.map +1 -1
- package/dist/types/events/cart_add.d.ts +8 -0
- package/dist/types/events/cart_add.d.ts.map +1 -1
- package/dist/types/events/cart_remove.d.ts +8 -0
- package/dist/types/events/cart_remove.d.ts.map +1 -1
- package/dist/types/events/checkout_complete.d.ts +8 -0
- package/dist/types/events/checkout_complete.d.ts.map +1 -1
- package/dist/types/events/checkout_start.d.ts +8 -0
- package/dist/types/events/checkout_start.d.ts.map +1 -1
- package/dist/types/events/custom.d.ts +8 -6
- package/dist/types/events/custom.d.ts.map +1 -1
- package/dist/types/events/experience_load.d.ts.map +1 -1
- package/dist/types/events/feature_decide.d.ts.map +1 -1
- package/dist/types/events/field_validation_error.d.ts.map +1 -1
- package/dist/types/events/form_submit.d.ts.map +1 -1
- package/dist/types/events/form_submit_error.d.ts.map +1 -1
- package/dist/types/events/form_submit_success.d.ts.map +1 -1
- package/dist/types/events/identify.d.ts +8 -0
- package/dist/types/events/identify.d.ts.map +1 -1
- package/dist/types/events/interaction/back.d.ts.map +1 -1
- package/dist/types/events/interaction/backspace.d.ts.map +1 -1
- package/dist/types/events/interaction/click.d.ts.map +1 -1
- package/dist/types/events/interaction/copy.d.ts.map +1 -1
- package/dist/types/events/interaction/drag.d.ts.map +1 -1
- package/dist/types/events/interaction/forward.d.ts.map +1 -1
- package/dist/types/events/interaction/mouse_shake.d.ts.map +1 -1
- package/dist/types/events/interaction/offline.d.ts.map +1 -1
- package/dist/types/events/interaction/online.d.ts.map +1 -1
- package/dist/types/events/interaction/page_hidden.d.ts.map +1 -1
- package/dist/types/events/interaction/page_hide.d.ts.map +1 -1
- package/dist/types/events/interaction/page_show.d.ts.map +1 -1
- package/dist/types/events/interaction/page_visible.d.ts.map +1 -1
- package/dist/types/events/interaction/paste.d.ts.map +1 -1
- package/dist/types/events/interaction/rapid_click.d.ts.map +1 -1
- package/dist/types/events/interaction/rapid_scroll.d.ts.map +1 -1
- package/dist/types/events/interaction/resize.d.ts.map +1 -1
- package/dist/types/events/interaction/right_click.d.ts.map +1 -1
- package/dist/types/events/interaction/scroll.d.ts.map +1 -1
- package/dist/types/events/interaction/unload.d.ts.map +1 -1
- package/dist/types/events/lead_capture.d.ts.map +1 -1
- package/dist/types/events/lead_created.d.ts.map +1 -1
- package/dist/types/events/lead_updated.d.ts.map +1 -1
- package/dist/types/events/modal_close.d.ts.map +1 -1
- package/dist/types/events/modal_open.d.ts.map +1 -1
- package/dist/types/events/order_create.d.ts +8 -0
- package/dist/types/events/order_create.d.ts.map +1 -1
- package/dist/types/events/page_view.d.ts +8 -0
- package/dist/types/events/page_view.d.ts.map +1 -1
- package/dist/types/events/product_list_view.d.ts +8 -0
- package/dist/types/events/product_list_view.d.ts.map +1 -1
- package/dist/types/events/product_select.d.ts.map +1 -1
- package/dist/types/events/product_view_details.d.ts +8 -0
- package/dist/types/events/product_view_details.d.ts.map +1 -1
- package/dist/types/events/recommendation_present.d.ts.map +1 -1
- package/dist/types/events/search_results_list_view.d.ts.map +1 -1
- package/dist/types/events/step_complete.d.ts.map +1 -1
- package/dist/types/events/step_enter.d.ts.map +1 -1
- package/dist/types/events/step_submit.d.ts.map +1 -1
- package/dist/types/events/step_submit_error.d.ts.map +1 -1
- package/dist/types/events/step_submit_success.d.ts.map +1 -1
- package/dist/types/events/waitlist_join.d.ts.map +1 -1
- package/dist/types/events/wishlist_add.d.ts.map +1 -1
- package/dist/types/interactions/document.d.ts +1 -1
- package/dist/types/interactions/document.d.ts.map +1 -1
- package/dist/types/plugins/analytics/plugin.d.ts.map +1 -1
- package/dist/types/schemas/experience/1-0-1.d.ts +1 -3
- package/dist/types/schemas/experience/1-0-1.d.ts.map +1 -1
- package/dist/types/schemas/experience/1-0-2.d.ts +46 -0
- package/dist/types/schemas/experience/1-0-2.d.ts.map +1 -0
- package/dist/types/schemas/experience/index.d.ts +45 -3
- package/dist/types/schemas/experience/index.d.ts.map +1 -1
- package/dist/types/schemas/index.d.ts +3 -0
- package/dist/types/schemas/index.d.ts.map +1 -1
- package/dist/types/schemas/workspace/1-0-0.d.ts +35 -0
- package/dist/types/schemas/workspace/1-0-0.d.ts.map +1 -0
- package/dist/types/schemas/workspace/index.d.ts +40 -0
- package/dist/types/schemas/workspace/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +12 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +21 -3
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src-B2RJ6I_p.js +0 -1008
- package/dist/src-CPlfXbxx.cjs +0 -1
- package/dist/text-CGbjivo-.cjs +0 -1
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExperienceInstance } from '@picked/client';
|
|
2
|
+
import type { AnalyticsContext, AnalyticsExperience, AppContext, Context, ContextArray, ExceptionContext, ExperienceContext, FeatureListContext, FieldListContext, FormContext, ModalContext, OrderContext, ProductListContext, ResponseListContext, SchemaUrl, SessionContext, SnowplowEventWithContext, SnowplowSelfDescribingEvent, StepContext, WorkspaceContext } from './types';
|
|
2
3
|
import type { EventSchema } from './schemas';
|
|
3
4
|
/**
|
|
4
5
|
* Builds the Iglu URI that identifies a Snowplow schema and version.
|
|
@@ -125,6 +126,14 @@ export declare function formatFeatureListContextData(event: AnalyticsContext): F
|
|
|
125
126
|
* @example formatAppContextData({ projectId: 'proj1' }) // { project_id: 'proj1' }
|
|
126
127
|
*/
|
|
127
128
|
export declare function formatAppContextData(event: AnalyticsContext): AppContext['data'];
|
|
129
|
+
/**
|
|
130
|
+
* Builds the Snowplow `workspace` context from the workspace that served the project config.
|
|
131
|
+
*
|
|
132
|
+
* @param {AnalyticsContext} event - Analytics context carrying the workspace.
|
|
133
|
+
* @returns {WorkspaceContext['data'] | undefined} The workspace context data, or `undefined` when the context carries no workspace.
|
|
134
|
+
* @example formatWorkspaceContextData({ projectId: 'p', workspace: { id: 'wsp_1', versionId: 'wspv_1', status: 'live' } }) // { id: 'wsp_1', version_id: 'wspv_1', status: 'live' }
|
|
135
|
+
*/
|
|
136
|
+
export declare function formatWorkspaceContextData(event: AnalyticsContext): WorkspaceContext['data'] | undefined;
|
|
128
137
|
/**
|
|
129
138
|
* Builds the Snowplow `session` context, folding in the session identifiers, the Google
|
|
130
139
|
* Analytics client id read from the `_ga` cookie, and any Shopify session tokens.
|
|
@@ -195,8 +204,9 @@ export declare function formatProductListContextData(event: AnalyticsContext, re
|
|
|
195
204
|
export declare function formatOrderContextData(event: AnalyticsContext, required: true): OrderContext['data'];
|
|
196
205
|
export declare function formatOrderContextData(event: AnalyticsContext, required?: false): OrderContext['data'] | undefined;
|
|
197
206
|
/**
|
|
198
|
-
* Builds the Snowplow `experience` context
|
|
199
|
-
*
|
|
207
|
+
* Builds the Snowplow `experience` context, emitting the stable `key` alongside the id
|
|
208
|
+
* and title. When the experience is absent and
|
|
209
|
+
* `required` is set, the absence is reported and an `unknown` placeholder is returned.
|
|
200
210
|
*
|
|
201
211
|
* @param {AnalyticsContext} event - Analytics context carrying the experience.
|
|
202
212
|
* @param {boolean} [required] - When `true`, returns a placeholder instead of `undefined`.
|
|
@@ -205,6 +215,14 @@ export declare function formatOrderContextData(event: AnalyticsContext, required
|
|
|
205
215
|
*/
|
|
206
216
|
export declare function formatExperienceContextData(event: AnalyticsContext, required: true): ExperienceContext['data'];
|
|
207
217
|
export declare function formatExperienceContextData(event: AnalyticsContext, required?: false): ExperienceContext['data'] | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Reads the analytics view of an experience instance: its id, title and key.
|
|
220
|
+
*
|
|
221
|
+
* @param {Pick<ExperienceInstance, 'experienceId' | 'experienceName' | 'experienceKey'>} instance - The experience instance.
|
|
222
|
+
* @returns {AnalyticsExperience} The experience as the analytics context carries it.
|
|
223
|
+
* @example toAnalyticsExperience(instance) // { id: 'exp-1', title: 'Exp 1', key: 'exp-key' }
|
|
224
|
+
*/
|
|
225
|
+
export declare const toAnalyticsExperience: (instance: Pick<ExperienceInstance, 'experienceId' | 'experienceName' | 'experienceKey'>) => AnalyticsExperience;
|
|
208
226
|
/**
|
|
209
227
|
* Builds the Snowplow `exception` context from either a bare reason string or a field
|
|
210
228
|
* validation error. When the exception is absent and `required` is set, the absence is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,wBAAwB,EACxB,2BAA2B,EAC3B,WAAW,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU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B,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;AAyBvC;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,CAgBlF;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAgBpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAM,aAGhE,UAAU,CAAC,EAAE,CAAC,UAIhC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/analytics",
|
|
3
3
|
"description": "Picked Analytics",
|
|
4
|
-
"version": "0.0.116-next.
|
|
4
|
+
"version": "0.0.116-next.4",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@snowplow/browser-plugin-button-click-tracking": "^4.10.0",
|
|
7
7
|
"@snowplow/browser-plugin-error-tracking": "^4.10.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"main": "./dist/cjs/index.js",
|
|
75
75
|
"module": "./dist/esm/index.js",
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@picked/client": "0.0.116-next.
|
|
77
|
+
"@picked/client": "0.0.116-next.4",
|
|
78
78
|
"effector": "^23.4.4"
|
|
79
79
|
},
|
|
80
80
|
"private": false,
|