@segment/analytics-browser-actions-ripe 1.0.0 → 1.3.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 (75) hide show
  1. package/.eslintcache +1 -0
  2. package/dist/cjs/generated-types.d.ts +5 -0
  3. package/dist/cjs/generated-types.js +3 -0
  4. package/dist/cjs/generated-types.js.map +1 -0
  5. package/dist/cjs/group/generated-types.d.ts +9 -0
  6. package/dist/cjs/group/generated-types.js +3 -0
  7. package/dist/cjs/group/generated-types.js.map +1 -0
  8. package/dist/cjs/group/index.d.ts +6 -0
  9. package/dist/cjs/group/index.js +58 -0
  10. package/dist/cjs/group/index.js.map +1 -0
  11. package/dist/cjs/identify/generated-types.d.ts +9 -0
  12. package/dist/cjs/identify/generated-types.js +3 -0
  13. package/dist/cjs/identify/generated-types.js.map +1 -0
  14. package/dist/cjs/identify/index.d.ts +6 -0
  15. package/dist/cjs/identify/index.js +58 -0
  16. package/dist/cjs/identify/index.js.map +1 -0
  17. package/dist/cjs/index.d.ts +11 -0
  18. package/dist/cjs/index.js +91 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/cjs/init-script.d.ts +1 -0
  21. package/dist/cjs/init-script.js +19 -0
  22. package/dist/cjs/init-script.js.map +1 -0
  23. package/dist/cjs/page/generated-types.d.ts +11 -0
  24. package/dist/cjs/page/generated-types.js +3 -0
  25. package/dist/cjs/page/generated-types.js.map +1 -0
  26. package/dist/cjs/page/index.d.ts +6 -0
  27. package/dist/cjs/page/index.js +86 -0
  28. package/dist/cjs/page/index.js.map +1 -0
  29. package/dist/cjs/track/generated-types.d.ts +10 -0
  30. package/dist/cjs/track/generated-types.js +3 -0
  31. package/dist/cjs/track/generated-types.js.map +1 -0
  32. package/dist/cjs/track/index.d.ts +6 -0
  33. package/dist/cjs/track/index.js +68 -0
  34. package/dist/cjs/track/index.js.map +1 -0
  35. package/dist/cjs/types.d.ts +34 -0
  36. package/dist/cjs/types.js +3 -0
  37. package/dist/cjs/types.js.map +1 -0
  38. package/dist/esm/generated-types.d.ts +5 -0
  39. package/dist/esm/generated-types.js +2 -0
  40. package/dist/esm/generated-types.js.map +1 -0
  41. package/dist/esm/group/generated-types.d.ts +9 -0
  42. package/dist/esm/group/generated-types.js +2 -0
  43. package/dist/esm/group/generated-types.js.map +1 -0
  44. package/dist/esm/group/index.d.ts +6 -0
  45. package/dist/esm/group/index.js +56 -0
  46. package/dist/esm/group/index.js.map +1 -0
  47. package/dist/esm/identify/generated-types.d.ts +9 -0
  48. package/dist/esm/identify/generated-types.js +2 -0
  49. package/dist/esm/identify/generated-types.js.map +1 -0
  50. package/dist/esm/identify/index.d.ts +6 -0
  51. package/dist/esm/identify/index.js +56 -0
  52. package/dist/esm/identify/index.js.map +1 -0
  53. package/dist/esm/index.d.ts +11 -0
  54. package/dist/esm/index.js +87 -0
  55. package/dist/esm/index.js.map +1 -0
  56. package/dist/esm/init-script.d.ts +1 -0
  57. package/dist/esm/init-script.js +15 -0
  58. package/dist/esm/init-script.js.map +1 -0
  59. package/dist/esm/page/generated-types.d.ts +11 -0
  60. package/dist/esm/page/generated-types.js +2 -0
  61. package/dist/esm/page/generated-types.js.map +1 -0
  62. package/dist/esm/page/index.d.ts +6 -0
  63. package/dist/esm/page/index.js +84 -0
  64. package/dist/esm/page/index.js.map +1 -0
  65. package/dist/esm/track/generated-types.d.ts +10 -0
  66. package/dist/esm/track/generated-types.js +2 -0
  67. package/dist/esm/track/generated-types.js.map +1 -0
  68. package/dist/esm/track/index.d.ts +6 -0
  69. package/dist/esm/track/index.js +66 -0
  70. package/dist/esm/track/index.js.map +1 -0
  71. package/dist/esm/types.d.ts +34 -0
  72. package/dist/esm/types.js +2 -0
  73. package/dist/esm/types.js.map +1 -0
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/package.json +5 -4
package/.eslintcache ADDED
@@ -0,0 +1 @@
1
+ [{"/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/generated-types.ts":"1","/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/index.ts":"2","/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/init-script.ts":"3","/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/types.ts":"4"},{"size":344,"mtime":1686339431100,"results":"5","hashOfConfig":"6"},{"size":2693,"mtime":1686339475060,"results":"7","hashOfConfig":"6"},{"size":374,"mtime":1686339431100,"results":"8","hashOfConfig":"6"},{"size":1173,"mtime":1686339431100,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"t5ozeh",{"filePath":"12","messages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/generated-types.ts",[],"/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/index.ts",[],"/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/init-script.ts",[],"/home/kaari/action-destinations/packages/browser-destinations/destinations/ripe/src/types.ts",[]]
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ sdkVersion?: string;
3
+ apiKey: string;
4
+ endpoint?: string;
5
+ }
@@ -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/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ anonymousId: string;
3
+ userId?: string | null;
4
+ groupId: string | null;
5
+ traits?: {
6
+ [k: string]: unknown;
7
+ };
8
+ messageId?: string;
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/group/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 { RipeSDK } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, RipeSDK, Payload>;
6
+ export default action;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Group',
5
+ description: 'Group user in Ripe',
6
+ defaultSubscription: 'type = "group"',
7
+ platform: 'web',
8
+ fields: {
9
+ anonymousId: {
10
+ type: 'string',
11
+ required: true,
12
+ description: 'The anonymous id',
13
+ label: 'Anonymous ID',
14
+ default: { '@path': '$.anonymousId' }
15
+ },
16
+ userId: {
17
+ type: 'string',
18
+ required: false,
19
+ allowNull: true,
20
+ description: 'The ID associated with the user',
21
+ label: 'User ID',
22
+ default: { '@path': '$.userId' }
23
+ },
24
+ groupId: {
25
+ type: 'string',
26
+ required: true,
27
+ allowNull: true,
28
+ description: 'The ID associated groupId',
29
+ label: 'Group ID',
30
+ default: { '@path': '$.groupId' }
31
+ },
32
+ traits: {
33
+ type: 'object',
34
+ label: 'Traits',
35
+ description: 'Traits to associate with the group',
36
+ required: false,
37
+ default: { '@path': '$.traits' }
38
+ },
39
+ messageId: {
40
+ type: 'string',
41
+ required: false,
42
+ description: 'The Segment messageId',
43
+ label: 'MessageId',
44
+ default: { '@path': '$.messageId' }
45
+ }
46
+ },
47
+ perform: async (ripe, { payload }) => {
48
+ return ripe.group({
49
+ messageId: payload.messageId,
50
+ anonymousId: payload.anonymousId,
51
+ userId: payload.userId,
52
+ groupId: payload.groupId,
53
+ traits: payload.traits
54
+ });
55
+ }
56
+ };
57
+ exports.default = action;
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/group/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwD;IAClE,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,oBAAoB;IACjC,mBAAmB,EAAE,gBAAgB;IACrC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,2BAA2B;YACxC,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;SAClC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC;YAChB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ anonymousId: string;
3
+ userId?: string | null;
4
+ groupId?: string | null;
5
+ traits?: {
6
+ [k: string]: unknown;
7
+ };
8
+ messageId?: string;
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/identify/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 { RipeSDK } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, RipeSDK, Payload>;
6
+ export default action;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Identify',
5
+ description: 'Identify user in Ripe',
6
+ defaultSubscription: 'type = "identify"',
7
+ platform: 'web',
8
+ fields: {
9
+ anonymousId: {
10
+ type: 'string',
11
+ required: true,
12
+ description: 'The anonymous id',
13
+ label: 'Anonymous ID',
14
+ default: { '@path': '$.anonymousId' }
15
+ },
16
+ userId: {
17
+ type: 'string',
18
+ required: false,
19
+ allowNull: true,
20
+ description: 'The ID associated with the user',
21
+ label: 'User ID',
22
+ default: { '@path': '$.userId' }
23
+ },
24
+ groupId: {
25
+ type: 'string',
26
+ required: false,
27
+ allowNull: true,
28
+ description: 'The ID associated groupId',
29
+ label: 'Group ID',
30
+ default: { '@path': '$.context.groupId' }
31
+ },
32
+ traits: {
33
+ type: 'object',
34
+ label: 'Traits',
35
+ description: 'Traits to associate with the user',
36
+ required: false,
37
+ default: { '@path': '$.traits' }
38
+ },
39
+ messageId: {
40
+ type: 'string',
41
+ required: false,
42
+ description: 'The Segment messageId',
43
+ label: 'MessageId',
44
+ default: { '@path': '$.messageId' }
45
+ }
46
+ },
47
+ perform: async (ripe, { payload }) => {
48
+ return ripe.identify({
49
+ messageId: payload.messageId,
50
+ anonymousId: payload.anonymousId,
51
+ userId: payload.userId,
52
+ groupId: payload.groupId,
53
+ traits: payload.traits
54
+ });
55
+ }
56
+ };
57
+ exports.default = action;
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identify/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwD;IAClE,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,uBAAuB;IACpC,mBAAmB,EAAE,mBAAmB;IACxC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,2BAA2B;YACxC,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;SAC1C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,OAAO,IAAI,CAAC,QAAQ,CAAC;YACnB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { Settings } from './generated-types';
2
+ import type { BrowserDestinationDefinition } from '@segment/browser-destination-runtime/types';
3
+ import { RipeSDK } from './types';
4
+ declare global {
5
+ interface Window {
6
+ Ripe: RipeSDK;
7
+ }
8
+ }
9
+ export declare const destination: BrowserDestinationDefinition<Settings, RipeSDK>;
10
+ declare const _default: import("@segment/browser-destination-runtime/types").PluginFactory;
11
+ export default _default;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.destination = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const shim_1 = require("@segment/browser-destination-runtime/shim");
6
+ const group_1 = tslib_1.__importDefault(require("./group"));
7
+ const identify_1 = tslib_1.__importDefault(require("./identify"));
8
+ const track_1 = tslib_1.__importDefault(require("./track"));
9
+ const actions_core_1 = require("@segment/actions-core");
10
+ const init_script_1 = require("./init-script");
11
+ const page_1 = tslib_1.__importDefault(require("./page"));
12
+ const defaultVersion = 'latest';
13
+ exports.destination = {
14
+ name: 'Ripe Device Mode (Actions)',
15
+ slug: 'actions-ripe',
16
+ mode: 'device',
17
+ settings: {
18
+ sdkVersion: {
19
+ description: 'The version of the Ripe Widget SDK to use',
20
+ label: 'SDK Version',
21
+ type: 'string',
22
+ choices: [
23
+ {
24
+ value: 'latest',
25
+ label: 'latest'
26
+ }
27
+ ],
28
+ default: defaultVersion,
29
+ required: false
30
+ },
31
+ apiKey: {
32
+ description: 'The Ripe API key found in the Ripe App',
33
+ label: 'API Key',
34
+ type: 'string',
35
+ required: true
36
+ },
37
+ endpoint: {
38
+ label: 'API Endpoint',
39
+ description: `The Ripe API endpoint (do not change this unless you know what you're doing)`,
40
+ type: 'string',
41
+ format: 'uri',
42
+ default: 'https://storage.getripe.com'
43
+ }
44
+ },
45
+ initialize: async ({ settings }, deps) => {
46
+ init_script_1.initScript();
47
+ const { sdkVersion, apiKey } = settings;
48
+ const version = sdkVersion ?? defaultVersion;
49
+ const endpoint = settings.endpoint || 'https://storage.getripe.com';
50
+ await deps
51
+ .loadScript(`${endpoint}/sdk/${version}/sdk.umd.js`)
52
+ .catch((err) => console.error('Unable to load Ripe SDK script', err));
53
+ await deps.resolveWhen(() => Object.prototype.hasOwnProperty.call(window, 'Ripe'), 100);
54
+ await window.Ripe.init(apiKey);
55
+ return window.Ripe;
56
+ },
57
+ actions: {
58
+ group: group_1.default,
59
+ identify: identify_1.default,
60
+ page: page_1.default,
61
+ track: track_1.default
62
+ },
63
+ presets: [
64
+ {
65
+ name: 'Group user',
66
+ subscribe: 'type = "group"',
67
+ partnerAction: 'group',
68
+ mapping: actions_core_1.defaultValues(group_1.default.fields)
69
+ },
70
+ {
71
+ name: 'Identify user',
72
+ subscribe: 'type = "identify"',
73
+ partnerAction: 'identify',
74
+ mapping: actions_core_1.defaultValues(identify_1.default.fields)
75
+ },
76
+ {
77
+ name: 'Page view',
78
+ subscribe: 'type = "page"',
79
+ partnerAction: 'page',
80
+ mapping: actions_core_1.defaultValues(page_1.default.fields)
81
+ },
82
+ {
83
+ name: 'Track event',
84
+ subscribe: 'type = "track"',
85
+ partnerAction: 'track',
86
+ mapping: actions_core_1.defaultValues(track_1.default.fields)
87
+ }
88
+ ]
89
+ };
90
+ exports.default = shim_1.browserDestination(exports.destination);
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAEA,oEAA8E;AAG9E,4DAA2B;AAC3B,kEAAiC;AACjC,4DAA2B;AAE3B,wDAAqD;AACrD,+CAA0C;AAE1C,0DAAyB;AAEzB,MAAM,cAAc,GAAG,QAAQ,CAAA;AAQlB,QAAA,WAAW,GAAoD;IAC1E,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,QAAQ;IAEd,QAAQ,EAAE;QACR,UAAU,EAAE;YACV,WAAW,EAAE,2CAA2C;YACxD,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP;oBACE,KAAK,EAAE,QAAQ;oBACf,KAAK,EAAE,QAAQ;iBAChB;aACF;YACD,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE,KAAK;SAChB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,wCAAwC;YACrD,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,QAAQ;YACd,MAAM,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AS,EAAE,eAAe;YAC1B,aAAa,EAAE,MAAM;YACrB,OAAO,EAAE,4BAAa,CAAC,cAAI,CAAC,MAAM,CAAC;SACpC;QACD;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,OAAO;YACtB,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;SACrC;KACF;CACF,CAAA;AAED,kBAAe,yBAAkB,CAAC,mBAAW,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare function initScript(): void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initScript = void 0;
4
+ function initScript() {
5
+ if (window.Ripe) {
6
+ return;
7
+ }
8
+ window.Ripe = [];
9
+ ['group', 'identify', 'init', 'page', 'track'].forEach(function (method) {
10
+ window.Ripe[method] = function () {
11
+ let args = Array.from(arguments);
12
+ args.unshift(method);
13
+ window.Ripe.push(args);
14
+ return window.Ripe;
15
+ };
16
+ });
17
+ }
18
+ exports.initScript = initScript;
19
+ //# sourceMappingURL=init-script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-script.js","sourceRoot":"","sources":["../../src/init-script.ts"],"names":[],"mappings":";;;AAEA,SAAgB,UAAU;IACxB,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAM;KACP;IAED,MAAM,CAAC,IAAI,GAAG,EAAE,CACf;IAAA,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,MAAM;QACtE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;YACpB,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACtB,OAAO,MAAM,CAAC,IAAI,CAAA;QACpB,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAdD,gCAcC"}
@@ -0,0 +1,11 @@
1
+ export interface Payload {
2
+ anonymousId: string;
3
+ userId?: string | null;
4
+ groupId?: string | null;
5
+ category?: string;
6
+ name?: string;
7
+ properties?: {
8
+ [k: string]: unknown;
9
+ };
10
+ messageId?: string;
11
+ }
@@ -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/page/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 { RipeSDK } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, RipeSDK, Payload>;
6
+ export default action;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Page',
5
+ description: 'Register page view in Ripe',
6
+ defaultSubscription: 'type = "page"',
7
+ platform: 'web',
8
+ fields: {
9
+ anonymousId: {
10
+ type: 'string',
11
+ required: true,
12
+ description: 'The anonymous id',
13
+ label: 'Anonymous ID',
14
+ default: { '@path': '$.anonymousId' }
15
+ },
16
+ userId: {
17
+ type: 'string',
18
+ required: false,
19
+ allowNull: true,
20
+ description: 'The ID associated with the user',
21
+ label: 'User ID',
22
+ default: { '@path': '$.userId' }
23
+ },
24
+ groupId: {
25
+ type: 'string',
26
+ required: false,
27
+ allowNull: true,
28
+ description: 'The ID associated groupId',
29
+ label: 'Group ID',
30
+ default: { '@path': '$.context.groupId' }
31
+ },
32
+ category: {
33
+ type: 'string',
34
+ required: false,
35
+ description: 'The category of the page',
36
+ label: 'Category',
37
+ default: {
38
+ '@if': {
39
+ exists: { '@path': '$.category' },
40
+ then: { '@path': '$.category' },
41
+ else: { '@path': '$.context.category' }
42
+ }
43
+ }
44
+ },
45
+ name: {
46
+ type: 'string',
47
+ required: false,
48
+ description: 'The name of the page',
49
+ label: 'Name',
50
+ default: {
51
+ '@if': {
52
+ exists: { '@path': '$.name' },
53
+ then: { '@path': '$.name' },
54
+ else: { '@path': '$.context.name' }
55
+ }
56
+ }
57
+ },
58
+ properties: {
59
+ type: 'object',
60
+ required: false,
61
+ description: 'Page properties',
62
+ label: 'Properties',
63
+ default: { '@path': '$.properties' }
64
+ },
65
+ messageId: {
66
+ type: 'string',
67
+ required: false,
68
+ description: 'The Segment messageId',
69
+ label: 'MessageId',
70
+ default: { '@path': '$.messageId' }
71
+ }
72
+ },
73
+ perform: async (ripe, { payload }) => {
74
+ return ripe.page({
75
+ messageId: payload.messageId,
76
+ anonymousId: payload.anonymousId,
77
+ userId: payload.userId,
78
+ groupId: payload.groupId,
79
+ category: payload.category,
80
+ name: payload.name,
81
+ properties: payload.properties
82
+ });
83
+ }
84
+ };
85
+ exports.default = action;
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/page/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwD;IAClE,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,eAAe;IACpC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE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C;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC;YACf,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ anonymousId: string;
3
+ userId?: string | null;
4
+ groupId?: string | null;
5
+ event: string;
6
+ properties?: {
7
+ [k: string]: unknown;
8
+ };
9
+ messageId?: string;
10
+ }
@@ -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/track/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 { RipeSDK } from '../types';
5
+ declare const action: BrowserActionDefinition<Settings, RipeSDK, Payload>;
6
+ export default action;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Track',
5
+ description: 'Send user events to Ripe',
6
+ defaultSubscription: 'type = "track"',
7
+ platform: 'web',
8
+ fields: {
9
+ anonymousId: {
10
+ type: 'string',
11
+ required: true,
12
+ description: 'The anonymous id',
13
+ label: 'Anonymous ID',
14
+ default: { '@path': '$.anonymousId' }
15
+ },
16
+ userId: {
17
+ type: 'string',
18
+ required: false,
19
+ allowNull: true,
20
+ description: 'The ID associated with the user',
21
+ label: 'User ID',
22
+ default: { '@path': '$.userId' }
23
+ },
24
+ groupId: {
25
+ type: 'string',
26
+ required: false,
27
+ allowNull: true,
28
+ description: 'The ID associated groupId',
29
+ label: 'Group ID',
30
+ default: { '@path': '$.context.groupId' }
31
+ },
32
+ event: {
33
+ type: 'string',
34
+ required: true,
35
+ description: 'The event name',
36
+ label: 'Event Name',
37
+ default: { '@path': '$.event' }
38
+ },
39
+ properties: {
40
+ type: 'object',
41
+ required: false,
42
+ description: 'Properties to send with the event',
43
+ label: 'Event properties',
44
+ default: { '@path': '$.properties' }
45
+ },
46
+ messageId: {
47
+ type: 'string',
48
+ required: false,
49
+ description: 'The Segment messageId',
50
+ label: 'MessageId',
51
+ default: { '@path': '$.messageId' }
52
+ }
53
+ },
54
+ perform: async (ripe, { payload }) => {
55
+ if (payload?.event) {
56
+ return ripe.track({
57
+ messageId: payload.messageId,
58
+ anonymousId: payload.anonymousId,
59
+ userId: payload.userId,
60
+ groupId: payload.groupId,
61
+ event: payload.event,
62
+ properties: payload.properties
63
+ });
64
+ }
65
+ }
66
+ };
67
+ exports.default = action;
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/track/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwD;IAClE,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,gBAAgB;IACrC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ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AC/B,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,34 @@
1
+ export interface RipeSDK {
2
+ group: ({ anonymousId, userId, messageId, groupId, traits }: {
3
+ messageId?: string;
4
+ anonymousId: string;
5
+ userId?: string | null;
6
+ groupId: string | null;
7
+ traits?: Record<string, unknown>;
8
+ }) => Promise<void>;
9
+ identify: ({ messageId, anonymousId, userId, groupId, traits }: {
10
+ messageId?: string;
11
+ anonymousId: string;
12
+ userId?: string | null;
13
+ groupId?: string | null;
14
+ traits?: Record<string, unknown>;
15
+ }) => Promise<void>;
16
+ init: (apiKey: string) => Promise<void>;
17
+ page: ({ messageId, anonymousId, userId, groupId, category, name, properties }: {
18
+ messageId?: string;
19
+ anonymousId: string;
20
+ userId?: string | null;
21
+ groupId?: string | null;
22
+ category?: string;
23
+ name?: string;
24
+ properties?: Record<string, unknown>;
25
+ }) => Promise<void>;
26
+ track: ({ messageId, anonymousId, userId, groupId, event, properties }: {
27
+ messageId?: string;
28
+ anonymousId: string;
29
+ userId?: string | null;
30
+ groupId?: string | null;
31
+ event: string;
32
+ properties?: Record<string, unknown>;
33
+ }) => Promise<void>;
34
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ sdkVersion?: string;
3
+ apiKey: string;
4
+ endpoint?: string;
5
+ }
@@ -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/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ anonymousId: string;
3
+ userId?: string | null;
4
+ groupId: string | null;
5
+ traits?: {
6
+ [k: string]: unknown;
7
+ };
8
+ messageId?: string;
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/group/generated-types.ts"],"names":[],"mappings":""}