@segment/analytics-browser-actions-fullstory 1.28.0 → 1.30.0

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.
Files changed (59) hide show
  1. package/dist/cjs/identifyUserV2/generated-types.d.ts +9 -0
  2. package/dist/cjs/identifyUserV2/generated-types.js +3 -0
  3. package/dist/cjs/identifyUserV2/generated-types.js.map +1 -0
  4. package/dist/cjs/identifyUserV2/index.d.ts +6 -0
  5. package/dist/cjs/identifyUserV2/index.js +81 -0
  6. package/dist/cjs/identifyUserV2/index.js.map +1 -0
  7. package/dist/cjs/index.js +19 -6
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/trackEventV2/generated-types.d.ts +6 -0
  10. package/dist/cjs/trackEventV2/generated-types.js +3 -0
  11. package/dist/cjs/trackEventV2/generated-types.js.map +1 -0
  12. package/dist/cjs/trackEventV2/index.d.ts +6 -0
  13. package/dist/cjs/trackEventV2/index.js +37 -0
  14. package/dist/cjs/trackEventV2/index.js.map +1 -0
  15. package/dist/cjs/types.d.ts +3 -10
  16. package/dist/cjs/types.js +4 -4
  17. package/dist/cjs/types.js.map +1 -1
  18. package/dist/cjs/viewedPageV2/generated-types.d.ts +6 -0
  19. package/dist/cjs/viewedPageV2/generated-types.js +3 -0
  20. package/dist/cjs/viewedPageV2/generated-types.js.map +1 -0
  21. package/dist/cjs/viewedPageV2/index.d.ts +6 -0
  22. package/dist/cjs/viewedPageV2/index.js +44 -0
  23. package/dist/cjs/viewedPageV2/index.js.map +1 -0
  24. package/dist/esm/identifyUserV2/generated-types.d.ts +9 -0
  25. package/dist/esm/identifyUserV2/generated-types.js +2 -0
  26. package/dist/esm/identifyUserV2/generated-types.js.map +1 -0
  27. package/dist/esm/identifyUserV2/index.d.ts +6 -0
  28. package/dist/esm/identifyUserV2/index.js +79 -0
  29. package/dist/esm/identifyUserV2/index.js.map +1 -0
  30. package/dist/esm/index.js +20 -7
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/esm/trackEventV2/generated-types.d.ts +6 -0
  33. package/dist/esm/trackEventV2/generated-types.js +2 -0
  34. package/dist/esm/trackEventV2/generated-types.js.map +1 -0
  35. package/dist/esm/trackEventV2/index.d.ts +6 -0
  36. package/dist/esm/trackEventV2/index.js +35 -0
  37. package/dist/esm/trackEventV2/index.js.map +1 -0
  38. package/dist/esm/types.d.ts +3 -10
  39. package/dist/esm/types.js +2 -2
  40. package/dist/esm/types.js.map +1 -1
  41. package/dist/esm/viewedPageV2/generated-types.d.ts +6 -0
  42. package/dist/esm/viewedPageV2/generated-types.js +2 -0
  43. package/dist/esm/viewedPageV2/generated-types.js.map +1 -0
  44. package/dist/esm/viewedPageV2/index.d.ts +6 -0
  45. package/dist/esm/viewedPageV2/index.js +42 -0
  46. package/dist/esm/viewedPageV2/index.js.map +1 -0
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +5 -5
  49. package/src/__tests__/fullstory.test.ts +131 -81
  50. package/src/__tests__/fullstoryV2.test.ts +277 -0
  51. package/src/__tests__/initialization.test.ts +81 -0
  52. package/src/identifyUserV2/generated-types.ts +26 -0
  53. package/src/identifyUserV2/index.ts +95 -0
  54. package/src/index.ts +20 -7
  55. package/src/trackEventV2/generated-types.ts +14 -0
  56. package/src/trackEventV2/index.ts +44 -0
  57. package/src/types.ts +3 -9
  58. package/src/viewedPageV2/generated-types.ts +14 -0
  59. package/src/viewedPageV2/index.ts +52 -0
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ userId?: string;
3
+ anonymousId?: string;
4
+ displayName?: string;
5
+ email?: string;
6
+ traits?: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/identifyUserV2/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import type { FS } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, FS, Payload>;
6
+ export default action;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __1 = require("..");
4
+ const action = {
5
+ title: 'Identify User V2',
6
+ description: 'Sets user identity properties',
7
+ platform: 'web',
8
+ defaultSubscription: 'type = "identify"',
9
+ fields: {
10
+ userId: {
11
+ type: 'string',
12
+ required: false,
13
+ description: "The user's id",
14
+ label: 'User ID',
15
+ default: {
16
+ '@path': '$.userId'
17
+ }
18
+ },
19
+ anonymousId: {
20
+ type: 'string',
21
+ required: false,
22
+ description: "The user's anonymous id",
23
+ label: 'Anonymous ID',
24
+ default: {
25
+ '@path': '$.anonymousId'
26
+ }
27
+ },
28
+ displayName: {
29
+ type: 'string',
30
+ required: false,
31
+ description: "The user's display name",
32
+ label: 'Display Name',
33
+ default: {
34
+ '@path': '$.traits.name'
35
+ }
36
+ },
37
+ email: {
38
+ type: 'string',
39
+ required: false,
40
+ description: "The user's email",
41
+ label: 'Email',
42
+ default: {
43
+ '@path': '$.traits.email'
44
+ }
45
+ },
46
+ traits: {
47
+ type: 'object',
48
+ required: false,
49
+ description: 'The Segment traits to be forwarded to FullStory',
50
+ label: 'Traits',
51
+ default: {
52
+ '@path': '$.traits'
53
+ }
54
+ }
55
+ },
56
+ perform: (FS, event) => {
57
+ const newTraits = event.payload.traits || {};
58
+ if (event.payload.anonymousId) {
59
+ newTraits.segmentAnonymousId = event.payload.anonymousId;
60
+ }
61
+ const userProperties = {
62
+ ...newTraits,
63
+ ...(event.payload.email !== undefined && { email: event.payload.email }),
64
+ ...(event.payload.displayName !== undefined && { displayName: event.payload.displayName })
65
+ };
66
+ if (event.payload.userId) {
67
+ FS('setIdentity', {
68
+ uid: event.payload.userId,
69
+ properties: userProperties
70
+ }, __1.segmentEventSource);
71
+ }
72
+ else {
73
+ FS('setProperties', {
74
+ type: 'user',
75
+ properties: userProperties
76
+ }, __1.segmentEventSource);
77
+ }
78
+ }
79
+ };
80
+ exports.default = action;
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identifyUserV2/index.ts"],"names":[],"mappings":";;AAIA,0BAAuC;AAGvC,MAAM,MAAM,GAAmD;IAC7D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,eAAe;YAC5B,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,yBAAyB;YACtC,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,yBAAyB;YACtC,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,OAAO;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,iDAAiD;YAC9D,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IACD,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,SAAS,GAA4B,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAA;QAErE,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE;YAC7B,SAAS,CAAC,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAA;SACzD;QAED,MAAM,cAAc,GAAG;YACrB,GAAG,SAAS;YACZ,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACxE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;SAC3F,CAAA;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;YACxB,EAAE,CACA,aAAa,EACb;gBACE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;gBACzB,UAAU,EAAE,cAAc;aAC3B,EACD,sBAAkB,CACnB,CAAA;SACF;aAAM;YACL,EAAE,CACA,eAAe,EACf;gBACE,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,cAAc;aAC3B,EACD,sBAAkB,CACnB,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -5,8 +5,11 @@ const tslib_1 = require("tslib");
5
5
  const types_1 = require("./types");
6
6
  const shim_1 = require("@segment/browser-destination-runtime/shim");
7
7
  const trackEvent_1 = tslib_1.__importDefault(require("./trackEvent"));
8
+ const trackEventV2_1 = tslib_1.__importDefault(require("./trackEventV2"));
8
9
  const identifyUser_1 = tslib_1.__importDefault(require("./identifyUser"));
10
+ const identifyUserV2_1 = tslib_1.__importDefault(require("./identifyUserV2"));
9
11
  const viewedPage_1 = tslib_1.__importDefault(require("./viewedPage"));
12
+ const viewedPageV2_1 = tslib_1.__importDefault(require("./viewedPageV2"));
10
13
  const actions_core_1 = require("@segment/actions-core");
11
14
  exports.segmentEventSource = 'segment-browser-actions';
12
15
  exports.destination = {
@@ -17,15 +20,22 @@ exports.destination = {
17
20
  {
18
21
  name: 'Track Event',
19
22
  subscribe: 'type = "track"',
20
- partnerAction: 'trackEvent',
21
- mapping: actions_core_1.defaultValues(trackEvent_1.default.fields),
23
+ partnerAction: 'trackEventV2',
24
+ mapping: actions_core_1.defaultValues(trackEventV2_1.default.fields),
22
25
  type: 'automatic'
23
26
  },
24
27
  {
25
28
  name: 'Identify User',
26
29
  subscribe: 'type = "identify"',
27
- partnerAction: 'identifyUser',
28
- mapping: actions_core_1.defaultValues(identifyUser_1.default.fields),
30
+ partnerAction: 'identifyUserV2',
31
+ mapping: actions_core_1.defaultValues(identifyUserV2_1.default.fields),
32
+ type: 'automatic'
33
+ },
34
+ {
35
+ name: 'Viewed Page',
36
+ subscribe: 'type = "page"',
37
+ partnerAction: 'viewedPageV2',
38
+ mapping: actions_core_1.defaultValues(viewedPageV2_1.default.fields),
29
39
  type: 'automatic'
30
40
  }
31
41
  ],
@@ -53,11 +63,14 @@ exports.destination = {
53
63
  },
54
64
  actions: {
55
65
  trackEvent: trackEvent_1.default,
66
+ trackEventV2: trackEventV2_1.default,
56
67
  identifyUser: identifyUser_1.default,
57
- viewedPage: viewedPage_1.default
68
+ identifyUserV2: identifyUserV2_1.default,
69
+ viewedPage: viewedPage_1.default,
70
+ viewedPageV2: viewedPageV2_1.default
58
71
  },
59
72
  initialize: async ({ settings }, dependencies) => {
60
- types_1.FSPackage.init(settings);
73
+ types_1.initFullStory(settings);
61
74
  await dependencies.resolveWhen(() => Object.prototype.hasOwnProperty.call(window, 'FS'), 100);
62
75
  return window.FS;
63
76
  }
@@ -1 +1 @@
1
- {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AAK,EAAE;YACL,WAAW,EAAE,oCAAoC;YACjD,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,WAAW,EAAE,+BAA+B;YAC5C,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;QACD,oBAAoB,EAAE;YACpB,WAAW,EAAE,qCAAqC;YAClD,KAAK,EAAE,0BAA0B;YACjC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;QACZ,YAAY,EAAZ,sBAAY;QACZ,cAAc,EAAd,wBAAc;QACd,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;KACb;IACD,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE;QAC/C,qBAAa,CAAC,QAAQ,CAAC,CAAA;QACvB,MAAM,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;QAC7F,OAAO,MAAM,CAAC,EAAE,CAAA;IAClB,CAAC;CACF,CAAA;AAED,kBAAe,yBAAkB,CAAC,mBAAW,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Payload {
2
+ name: string;
3
+ properties?: {
4
+ [k: string]: unknown;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/trackEventV2/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import type { FS } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, FS, Payload>;
6
+ export default action;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __1 = require("..");
4
+ const action = {
5
+ title: 'Track Event V2',
6
+ description: 'Track events',
7
+ platform: 'web',
8
+ defaultSubscription: 'type = "track"',
9
+ fields: {
10
+ name: {
11
+ description: 'The name of the event.',
12
+ label: 'Name',
13
+ required: true,
14
+ type: 'string',
15
+ default: {
16
+ '@path': '$.event'
17
+ }
18
+ },
19
+ properties: {
20
+ description: 'A JSON object containing additional information about the event that will be indexed by FullStory.',
21
+ label: 'Properties',
22
+ required: false,
23
+ type: 'object',
24
+ default: {
25
+ '@path': '$.properties'
26
+ }
27
+ }
28
+ },
29
+ perform: (FS, event) => {
30
+ FS('trackEvent', {
31
+ name: event.payload.name,
32
+ properties: event.payload.properties ?? {}
33
+ }, __1.segmentEventSource);
34
+ }
35
+ };
36
+ exports.default = action;
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/trackEventV2/index.ts"],"names":[],"mappings":";;AAIA,0BAAuC;AAEvC,MAAM,MAAM,GAAmD;IAC7D,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,UAAU,EAAE;YACV,WAAW,EAAE,oGAAoG;YACjH,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACrB,EAAE,CACA,YAAY,EACZ;YACE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;YACxB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;SAC3C,EACD,sBAAkB,CACnB,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,10 +1,3 @@
1
- import * as FullStory from '@fullstory/browser';
2
- export declare const FSPackage: typeof FullStory;
3
- export declare type FS = typeof FullStory & {
4
- setVars: (eventName: string, eventProperties: object, source: string) => {};
5
- setUserVars: (eventProperties: object, source: string) => void;
6
- event: (eventName: string, eventProperties: {
7
- [key: string]: unknown;
8
- }, source: string) => void;
9
- identify: (uid: string, customVars: FullStory.UserVars, source: string) => void;
10
- };
1
+ import { FullStory, init as initFullStory } from '@fullstory/browser';
2
+ export declare type FS = typeof FullStory;
3
+ export { FullStory, initFullStory };
package/dist/cjs/types.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FSPackage = void 0;
4
- const tslib_1 = require("tslib");
5
- const FullStory = tslib_1.__importStar(require("@fullstory/browser"));
6
- exports.FSPackage = FullStory;
3
+ exports.initFullStory = exports.FullStory = void 0;
4
+ const browser_1 = require("@fullstory/browser");
5
+ Object.defineProperty(exports, "FullStory", { enumerable: true, get: function () { return browser_1.FullStory; } });
6
+ Object.defineProperty(exports, "initFullStory", { enumerable: true, get: function () { return browser_1.init; } });
7
7
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;AAAA,sEAA+C;AAElC,QAAA,SAAS,GAAG,SAAS,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA,gDAAqE;AAG5D,0FAHA,mBAAS,OAGA;AAAE,8FAHQ,cAAa,OAGR"}
@@ -0,0 +1,6 @@
1
+ export interface Payload {
2
+ pageName?: string;
3
+ properties?: {
4
+ [k: string]: unknown;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/viewedPageV2/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import type { FS } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, FS, Payload>;
6
+ export default action;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __1 = require("..");
4
+ const action = {
5
+ title: 'Viewed Page V2',
6
+ description: 'Sets page properties',
7
+ defaultSubscription: 'type = "page"',
8
+ platform: 'web',
9
+ fields: {
10
+ pageName: {
11
+ type: 'string',
12
+ required: false,
13
+ description: 'The name of the page that was viewed.',
14
+ label: 'Page Name',
15
+ default: {
16
+ '@if': {
17
+ exists: { '@path': '$.category' },
18
+ then: { '@path': '$.category' },
19
+ else: { '@path': '$.name' }
20
+ }
21
+ }
22
+ },
23
+ properties: {
24
+ type: 'object',
25
+ required: false,
26
+ description: 'The properties of the page that was viewed.',
27
+ label: 'Properties',
28
+ default: {
29
+ '@path': '$.properties'
30
+ }
31
+ }
32
+ },
33
+ perform: (FS, event) => {
34
+ const properties = event.payload.pageName
35
+ ? { pageName: event.payload.pageName, ...event.payload.properties }
36
+ : { ...event.payload.properties };
37
+ FS('setProperties', {
38
+ type: 'page',
39
+ properties
40
+ }, __1.segmentEventSource);
41
+ }
42
+ };
43
+ exports.default = action;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viewedPageV2/index.ts"],"names":[],"mappings":";;AAIA,0BAAuC;AAEvC,MAAM,MAAM,GAAmD;IAC7D,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,sBAAsB;IACnC,mBAAmB,EAAE,eAAe;IACpC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uCAAuC;YACpD,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;oBACjC,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAC5B;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,6CAA6C;YAC1D,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,UAAU,GAAW,KAAK,CAAC,OAAO,CAAC,QAAQ;YAC/C,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE;YACnE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAEnC,EAAE,CACA,eAAe,EACf;YACE,IAAI,EAAE,MAAM;YACZ,UAAU;SACX,EACD,sBAAkB,CACnB,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ userId?: string;
3
+ anonymousId?: string;
4
+ displayName?: string;
5
+ email?: string;
6
+ traits?: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/identifyUserV2/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import type { FS } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, FS, Payload>;
6
+ export default action;
@@ -0,0 +1,79 @@
1
+ import { segmentEventSource } from '..';
2
+ const action = {
3
+ title: 'Identify User V2',
4
+ description: 'Sets user identity properties',
5
+ platform: 'web',
6
+ defaultSubscription: 'type = "identify"',
7
+ fields: {
8
+ userId: {
9
+ type: 'string',
10
+ required: false,
11
+ description: "The user's id",
12
+ label: 'User ID',
13
+ default: {
14
+ '@path': '$.userId'
15
+ }
16
+ },
17
+ anonymousId: {
18
+ type: 'string',
19
+ required: false,
20
+ description: "The user's anonymous id",
21
+ label: 'Anonymous ID',
22
+ default: {
23
+ '@path': '$.anonymousId'
24
+ }
25
+ },
26
+ displayName: {
27
+ type: 'string',
28
+ required: false,
29
+ description: "The user's display name",
30
+ label: 'Display Name',
31
+ default: {
32
+ '@path': '$.traits.name'
33
+ }
34
+ },
35
+ email: {
36
+ type: 'string',
37
+ required: false,
38
+ description: "The user's email",
39
+ label: 'Email',
40
+ default: {
41
+ '@path': '$.traits.email'
42
+ }
43
+ },
44
+ traits: {
45
+ type: 'object',
46
+ required: false,
47
+ description: 'The Segment traits to be forwarded to FullStory',
48
+ label: 'Traits',
49
+ default: {
50
+ '@path': '$.traits'
51
+ }
52
+ }
53
+ },
54
+ perform: (FS, event) => {
55
+ const newTraits = event.payload.traits || {};
56
+ if (event.payload.anonymousId) {
57
+ newTraits.segmentAnonymousId = event.payload.anonymousId;
58
+ }
59
+ const userProperties = {
60
+ ...newTraits,
61
+ ...(event.payload.email !== undefined && { email: event.payload.email }),
62
+ ...(event.payload.displayName !== undefined && { displayName: event.payload.displayName })
63
+ };
64
+ if (event.payload.userId) {
65
+ FS('setIdentity', {
66
+ uid: event.payload.userId,
67
+ properties: userProperties
68
+ }, segmentEventSource);
69
+ }
70
+ else {
71
+ FS('setProperties', {
72
+ type: 'user',
73
+ properties: userProperties
74
+ }, segmentEventSource);
75
+ }
76
+ }
77
+ };
78
+ export default action;
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identifyUserV2/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;AAGvC,MAAM,MAAM,GAAmD;IAC7D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,eAAe;YAC5B,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,yBAAyB;YACtC,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,yBAAyB;YACtC,KAA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Ac;aAC3B,EACD,kBAAkB,CACnB,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/esm/index.js CHANGED
@@ -1,8 +1,11 @@
1
- import { FSPackage } from './types';
1
+ import { initFullStory } from './types';
2
2
  import { browserDestination } from '@segment/browser-destination-runtime/shim';
3
3
  import trackEvent from './trackEvent';
4
+ import trackEventV2 from './trackEventV2';
4
5
  import identifyUser from './identifyUser';
6
+ import identifyUserV2 from './identifyUserV2';
5
7
  import viewedPage from './viewedPage';
8
+ import viewedPageV2 from './viewedPageV2';
6
9
  import { defaultValues } from '@segment/actions-core';
7
10
  export const segmentEventSource = 'segment-browser-actions';
8
11
  export const destination = {
@@ -13,15 +16,22 @@ export const destination = {
13
16
  {
14
17
  name: 'Track Event',
15
18
  subscribe: 'type = "track"',
16
- partnerAction: 'trackEvent',
17
- mapping: defaultValues(trackEvent.fields),
19
+ partnerAction: 'trackEventV2',
20
+ mapping: defaultValues(trackEventV2.fields),
18
21
  type: 'automatic'
19
22
  },
20
23
  {
21
24
  name: 'Identify User',
22
25
  subscribe: 'type = "identify"',
23
- partnerAction: 'identifyUser',
24
- mapping: defaultValues(identifyUser.fields),
26
+ partnerAction: 'identifyUserV2',
27
+ mapping: defaultValues(identifyUserV2.fields),
28
+ type: 'automatic'
29
+ },
30
+ {
31
+ name: 'Viewed Page',
32
+ subscribe: 'type = "page"',
33
+ partnerAction: 'viewedPageV2',
34
+ mapping: defaultValues(viewedPageV2.fields),
25
35
  type: 'automatic'
26
36
  }
27
37
  ],
@@ -49,11 +59,14 @@ export const destination = {
49
59
  },
50
60
  actions: {
51
61
  trackEvent,
62
+ trackEventV2,
52
63
  identifyUser,
53
- viewedPage
64
+ identifyUserV2,
65
+ viewedPage,
66
+ viewedPageV2
54
67
  },
55
68
  initialize: async ({ settings }, dependencies) => {
56
- FSPackage.init(settings);
69
+ initFullStory(settings);
57
70
  await dependencies.resolveWhen(() => Object.prototype.hasOwnProperty.call(window, 'FS'), 100);
58
71
  return window.FS;
59
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAE9E,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAQrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAA;AAE3D,MAAM,CAAC,MAAM,WAAW,GAA+C;IACrE,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,cAAc;YAC7B,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC;YAC3C,IAAI,EAAE,WAAW;SAClB;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,WAAW,EAAE,oCAAoC;YACjD,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,WAAW,EAAE,+BAA+B;YAC5C,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;QACD,oBAAoB,EAAE;YACpB,WAAW,EAAE,qCAAqC;YAClD,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AO,MAAM,CAAC,EAAE,CAAA;IAClB,CAAC;CACF,CAAA;AAED,eAAe,kBAAkB,CAAC,WAAW,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Payload {
2
+ name: string;
3
+ properties?: {
4
+ [k: string]: unknown;
5
+ };
6
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/trackEventV2/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import type { FS } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, FS, Payload>;
6
+ export default action;
@@ -0,0 +1,35 @@
1
+ import { segmentEventSource } from '..';
2
+ const action = {
3
+ title: 'Track Event V2',
4
+ description: 'Track events',
5
+ platform: 'web',
6
+ defaultSubscription: 'type = "track"',
7
+ fields: {
8
+ name: {
9
+ description: 'The name of the event.',
10
+ label: 'Name',
11
+ required: true,
12
+ type: 'string',
13
+ default: {
14
+ '@path': '$.event'
15
+ }
16
+ },
17
+ properties: {
18
+ description: 'A JSON object containing additional information about the event that will be indexed by FullStory.',
19
+ label: 'Properties',
20
+ required: false,
21
+ type: 'object',
22
+ default: {
23
+ '@path': '$.properties'
24
+ }
25
+ }
26
+ },
27
+ perform: (FS, event) => {
28
+ FS('trackEvent', {
29
+ name: event.payload.name,
30
+ properties: event.payload.properties ?? {}
31
+ }, segmentEventSource);
32
+ }
33
+ };
34
+ export default action;
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/trackEventV2/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;AAEvC,MAAM,MAAM,GAAmD;IAC7D,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,UAAU,EAAE;YACV,WAAW,EAAE,oGAAoG;YACjH,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACrB,EAAE,CACA,YAAY,EACZ;YACE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;YACxB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;SAC3C,EACD,kBAAkB,CACnB,CAAA;IACH,CAAC;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,10 +1,3 @@
1
- import * as FullStory from '@fullstory/browser';
2
- export declare const FSPackage: typeof FullStory;
3
- export declare type FS = typeof FullStory & {
4
- setVars: (eventName: string, eventProperties: object, source: string) => {};
5
- setUserVars: (eventProperties: object, source: string) => void;
6
- event: (eventName: string, eventProperties: {
7
- [key: string]: unknown;
8
- }, source: string) => void;
9
- identify: (uid: string, customVars: FullStory.UserVars, source: string) => void;
10
- };
1
+ import { FullStory, init as initFullStory } from '@fullstory/browser';
2
+ export declare type FS = typeof FullStory;
3
+ export { FullStory, initFullStory };
package/dist/esm/types.js CHANGED
@@ -1,3 +1,3 @@
1
- import * as FullStory from '@fullstory/browser';
2
- export const FSPackage = FullStory;
1
+ import { FullStory, init as initFullStory } from '@fullstory/browser';
2
+ export { FullStory, initFullStory };
3
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGrE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Payload {
2
+ pageName?: string;
3
+ properties?: {
4
+ [k: string]: unknown;
5
+ };
6
+ }