@segment/action-destinations 3.131.1-gads-test.2 → 3.131.1-gads-test.19

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 (144) hide show
  1. package/dist/destinations/algolia-insights/algolia-insight-api.d.ts +26 -0
  2. package/dist/destinations/algolia-insights/algolia-insight-api.js +8 -0
  3. package/dist/destinations/algolia-insights/algolia-insight-api.js.map +1 -0
  4. package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +9 -0
  5. package/dist/destinations/algolia-insights/conversionEvents/generated-types.js +3 -0
  6. package/dist/destinations/algolia-insights/conversionEvents/generated-types.js.map +1 -0
  7. package/dist/destinations/algolia-insights/conversionEvents/index.d.ts +6 -0
  8. package/dist/destinations/algolia-insights/conversionEvents/index.js +83 -0
  9. package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -0
  10. package/dist/destinations/algolia-insights/generated-types.d.ts +4 -0
  11. package/dist/destinations/algolia-insights/generated-types.js +3 -0
  12. package/dist/destinations/algolia-insights/generated-types.js.map +1 -0
  13. package/dist/destinations/algolia-insights/index.d.ts +5 -0
  14. package/dist/destinations/algolia-insights/index.js +54 -0
  15. package/dist/destinations/algolia-insights/index.js.map +1 -0
  16. package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +8 -0
  17. package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js +3 -0
  18. package/dist/destinations/algolia-insights/productClickedEvents/generated-types.js.map +1 -0
  19. package/dist/destinations/algolia-insights/productClickedEvents/index.d.ts +6 -0
  20. package/dist/destinations/algolia-insights/productClickedEvents/index.js +91 -0
  21. package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -0
  22. package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +7 -0
  23. package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js +3 -0
  24. package/dist/destinations/algolia-insights/productViewedEvents/generated-types.js.map +1 -0
  25. package/dist/destinations/algolia-insights/productViewedEvents/index.d.ts +6 -0
  26. package/dist/destinations/algolia-insights/productViewedEvents/index.js +81 -0
  27. package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -0
  28. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.d.ts +20 -0
  29. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js +133 -0
  30. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js.map +1 -0
  31. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.d.ts +2 -0
  32. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js +6 -0
  33. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js.map +1 -0
  34. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.d.ts +80 -0
  35. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js +151 -0
  36. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js.map +1 -0
  37. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.d.ts +35 -0
  38. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js +3 -0
  39. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.js.map +1 -0
  40. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.d.ts +5 -0
  41. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js +619 -0
  42. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js.map +1 -0
  43. package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.d.ts +3 -0
  44. package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js +3 -0
  45. package/dist/destinations/blackbaud-raisers-edge-nxt/generated-types.js.map +1 -0
  46. package/dist/destinations/blackbaud-raisers-edge-nxt/index.d.ts +4 -0
  47. package/dist/destinations/blackbaud-raisers-edge-nxt/index.js +53 -0
  48. package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -0
  49. package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +67 -0
  50. package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js +3 -0
  51. package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.js.map +1 -0
  52. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +8 -0
  53. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js +44 -0
  54. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js.map +1 -0
  55. package/dist/destinations/google-enhanced-conversions/types.js +1 -1
  56. package/dist/destinations/google-enhanced-conversions/types.js.map +1 -1
  57. package/dist/destinations/heap/flat.d.ts +1 -2
  58. package/dist/destinations/heap/flat.js +11 -1
  59. package/dist/destinations/heap/flat.js.map +1 -1
  60. package/dist/destinations/heap/heapUtils.d.ts +8 -0
  61. package/dist/destinations/heap/heapUtils.js +41 -0
  62. package/dist/destinations/heap/heapUtils.js.map +1 -0
  63. package/dist/destinations/heap/trackEvent/generated-types.d.ts +0 -1
  64. package/dist/destinations/heap/trackEvent/index.js +18 -54
  65. package/dist/destinations/heap/trackEvent/index.js.map +1 -1
  66. package/dist/destinations/launchpad/generated-types.d.ts +5 -0
  67. package/dist/destinations/launchpad/generated-types.js +3 -0
  68. package/dist/destinations/launchpad/generated-types.js.map +1 -0
  69. package/dist/destinations/launchpad/groupIdentifyUser/generated-types.d.ts +9 -0
  70. package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js +3 -0
  71. package/dist/destinations/launchpad/groupIdentifyUser/generated-types.js.map +1 -0
  72. package/dist/destinations/launchpad/groupIdentifyUser/index.d.ts +5 -0
  73. package/dist/destinations/launchpad/groupIdentifyUser/index.js +79 -0
  74. package/dist/destinations/launchpad/groupIdentifyUser/index.js.map +1 -0
  75. package/dist/destinations/launchpad/identifyUser/generated-types.d.ts +8 -0
  76. package/dist/destinations/launchpad/identifyUser/generated-types.js +3 -0
  77. package/dist/destinations/launchpad/identifyUser/generated-types.js.map +1 -0
  78. package/dist/destinations/launchpad/identifyUser/index.d.ts +5 -0
  79. package/dist/destinations/launchpad/identifyUser/index.js +79 -0
  80. package/dist/destinations/launchpad/identifyUser/index.js.map +1 -0
  81. package/dist/destinations/launchpad/index.d.ts +4 -0
  82. package/dist/destinations/launchpad/index.js +96 -0
  83. package/dist/destinations/launchpad/index.js.map +1 -0
  84. package/dist/destinations/launchpad/launchpad-types.d.ts +28 -0
  85. package/dist/destinations/launchpad/launchpad-types.js +3 -0
  86. package/dist/destinations/launchpad/launchpad-types.js.map +1 -0
  87. package/dist/destinations/launchpad/trackEvent/generated-types.d.ts +18 -0
  88. package/dist/destinations/launchpad/trackEvent/generated-types.js +3 -0
  89. package/dist/destinations/launchpad/trackEvent/generated-types.js.map +1 -0
  90. package/dist/destinations/launchpad/trackEvent/index.d.ts +5 -0
  91. package/dist/destinations/launchpad/trackEvent/index.js +62 -0
  92. package/dist/destinations/launchpad/trackEvent/index.js.map +1 -0
  93. package/dist/destinations/launchpad/trackEvent/launchpad-properties.d.ts +2 -0
  94. package/dist/destinations/launchpad/trackEvent/launchpad-properties.js +87 -0
  95. package/dist/destinations/launchpad/trackEvent/launchpad-properties.js.map +1 -0
  96. package/dist/destinations/launchpad/utils.d.ts +6 -0
  97. package/dist/destinations/launchpad/utils.js +20 -0
  98. package/dist/destinations/launchpad/utils.js.map +1 -0
  99. package/dist/destinations/livelike-cloud/generated-types.d.ts +4 -0
  100. package/dist/destinations/livelike-cloud/generated-types.js +3 -0
  101. package/dist/destinations/livelike-cloud/generated-types.js.map +1 -0
  102. package/dist/destinations/livelike-cloud/index.d.ts +4 -0
  103. package/dist/destinations/livelike-cloud/index.js +84 -0
  104. package/dist/destinations/livelike-cloud/index.js.map +1 -0
  105. package/dist/destinations/livelike-cloud/properties.d.ts +1 -0
  106. package/dist/destinations/livelike-cloud/properties.js +5 -0
  107. package/dist/destinations/livelike-cloud/properties.js.map +1 -0
  108. package/dist/destinations/livelike-cloud/trackEvent/generated-types.d.ts +11 -0
  109. package/dist/destinations/livelike-cloud/trackEvent/generated-types.js +3 -0
  110. package/dist/destinations/livelike-cloud/trackEvent/generated-types.js.map +1 -0
  111. package/dist/destinations/livelike-cloud/trackEvent/index.d.ts +5 -0
  112. package/dist/destinations/livelike-cloud/trackEvent/index.js +101 -0
  113. package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -0
  114. package/dist/destinations/pinterest-conversions/generated-types.d.ts +4 -0
  115. package/dist/destinations/pinterest-conversions/generated-types.js +3 -0
  116. package/dist/destinations/pinterest-conversions/generated-types.js.map +1 -0
  117. package/dist/destinations/pinterest-conversions/index.d.ts +4 -0
  118. package/dist/destinations/pinterest-conversions/index.js +29 -0
  119. package/dist/destinations/pinterest-conversions/index.js.map +1 -0
  120. package/dist/destinations/twilio-studio/generated-types.d.ts +6 -0
  121. package/dist/destinations/twilio-studio/generated-types.js +3 -0
  122. package/dist/destinations/twilio-studio/generated-types.js.map +1 -0
  123. package/dist/destinations/twilio-studio/index.d.ts +4 -0
  124. package/dist/destinations/twilio-studio/index.js +55 -0
  125. package/dist/destinations/twilio-studio/index.js.map +1 -0
  126. package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.d.ts +8 -0
  127. package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js +3 -0
  128. package/dist/destinations/twilio-studio/triggerStudioFlow/generated-types.js.map +1 -0
  129. package/dist/destinations/twilio-studio/triggerStudioFlow/index.d.ts +5 -0
  130. package/dist/destinations/twilio-studio/triggerStudioFlow/index.js +84 -0
  131. package/dist/destinations/twilio-studio/triggerStudioFlow/index.js.map +1 -0
  132. package/dist/destinations/twilio-studio/utils.d.ts +29 -0
  133. package/dist/destinations/twilio-studio/utils.js +43 -0
  134. package/dist/destinations/twilio-studio/utils.js.map +1 -0
  135. package/dist/destinations/vwo/identifyUser/index.js +6 -6
  136. package/dist/destinations/vwo/identifyUser/index.js.map +1 -1
  137. package/dist/destinations/vwo/index.js +1 -1
  138. package/dist/destinations/vwo/index.js.map +1 -1
  139. package/dist/destinations/vwo/pageVisit/index.js +6 -6
  140. package/dist/destinations/vwo/pageVisit/index.js.map +1 -1
  141. package/dist/destinations/vwo/trackEvent/index.js +7 -7
  142. package/dist/destinations/vwo/trackEvent/index.js.map +1 -1
  143. package/dist/destinations/vwo/utility.js +2 -2
  144. package/package.json +2 -2
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const properties_1 = require("../properties");
5
+ const processData = async (request, settings, payloads) => {
6
+ const events = payloads.map((payload) => {
7
+ if (!payload.livelike_profile_id && !payload.user_id) {
8
+ throw new actions_core_1.IntegrationError('`livelike_profile_id` or `user_id` is required.', 'Missing required fields', 400);
9
+ }
10
+ return payload;
11
+ });
12
+ return request(`${properties_1.apiBaseUrl}/applications/${settings.clientId}/segment-events/`, {
13
+ method: 'post',
14
+ json: {
15
+ events
16
+ }
17
+ });
18
+ };
19
+ const action = {
20
+ title: 'Track Event',
21
+ description: 'Send an event to LiveLike.',
22
+ defaultSubscription: 'type = "track"',
23
+ fields: {
24
+ action_key: {
25
+ label: 'Action Key',
26
+ description: 'The unique key of Action. LiveLike will uniquely identify any event by this key.',
27
+ type: 'string',
28
+ required: true,
29
+ default: {
30
+ '@path': '$.properties.action_key'
31
+ }
32
+ },
33
+ action_name: {
34
+ label: 'Action Name',
35
+ description: 'The name of the action being performed.',
36
+ type: 'string',
37
+ default: {
38
+ '@if': {
39
+ exists: { '@path': '$.properties.action_name' },
40
+ then: { '@path': '$.properties.action_name' },
41
+ else: { '@path': '$.event' }
42
+ }
43
+ }
44
+ },
45
+ action_description: {
46
+ label: 'Action Description',
47
+ description: 'The description of the Action.',
48
+ type: 'string',
49
+ default: {
50
+ '@path': '$.properties.action_description'
51
+ }
52
+ },
53
+ user_id: {
54
+ label: 'User ID',
55
+ type: 'string',
56
+ description: 'A unique identifier for a user. At least one of `User ID` or `LiveLike User Profile ID` is mandatory.',
57
+ default: {
58
+ '@path': '$.userId'
59
+ }
60
+ },
61
+ livelike_profile_id: {
62
+ label: 'LiveLike User Profile ID',
63
+ description: 'The unique LiveLike user identifier. Atleast one of `LiveLike User Profile ID` or `User ID` is mandatory.',
64
+ type: 'string',
65
+ default: {
66
+ '@path': '$.properties.livelike_profile_id'
67
+ }
68
+ },
69
+ timestamp: {
70
+ label: 'Timestamp',
71
+ description: 'The timestamp of the event.',
72
+ type: 'datetime',
73
+ required: true,
74
+ default: {
75
+ '@path': '$.timestamp'
76
+ }
77
+ },
78
+ properties: {
79
+ label: 'Event Properties',
80
+ description: 'Properties of the event.',
81
+ type: 'object',
82
+ default: {
83
+ '@path': '$.properties'
84
+ }
85
+ }
86
+ },
87
+ perform: (request, { payload, settings }) => {
88
+ if (!settings.clientId || !settings.producerToken) {
89
+ throw new actions_core_1.IntegrationError('Missing client ID or producer token.');
90
+ }
91
+ return processData(request, settings, [payload]);
92
+ },
93
+ performBatch: async (request, { settings, payload }) => {
94
+ if (!settings.clientId || !settings.producerToken) {
95
+ throw new actions_core_1.IntegrationError('Missing client ID or producer token.');
96
+ }
97
+ return processData(request, settings, payload);
98
+ }
99
+ };
100
+ exports.default = action;
101
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/livelike-cloud/trackEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAAyF;AAEzF,8CAA0C;AAG1C,MAAM,WAAW,GAAG,KAAK,EAAE,OAAsB,EAAE,QAAkB,EAAE,QAAmB,EAAE,EAAE;IAC5F,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACtC,IAAI,CAAC,OAAO,CAAC,mBAAmB,IAAI,CAAC,OAAO,CAAC,OA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AK,EAAE,0BAA0B;YACjC,WAAW,EACT,2GAA2G;YAC7G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,kCAAkC;aAC5C;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;YACjD,MAAM,IAAI,+BAAgB,CAAC,sCAAsC,CAAC,CAAA;SACnE;QACD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrD,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;YACjD,MAAM,IAAI,+BAAgB,CAAC,sCAAsC,CAAC,CAAA;SACnE;QACD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,4 @@
1
+ export interface Settings {
2
+ ad_account_id: string;
3
+ conversion_token: string;
4
+ }
@@ -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/destinations/pinterest-conversions/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const destination = {
4
+ name: 'Pinterest Conversions API',
5
+ slug: 'actions-pinterest-conversions-api',
6
+ mode: 'cloud',
7
+ authentication: {
8
+ scheme: 'custom',
9
+ fields: {
10
+ ad_account_id: {
11
+ label: 'Ad Account ID',
12
+ description: 'Unique identifier of an ad account. This can be found in the Pinterest UI by following the steps mentioned [here](https://developers.pinterest.com/docs/conversions/conversion-management/#Finding%20your%20%2Cad_account_id).',
13
+ type: 'string',
14
+ required: true
15
+ },
16
+ conversion_token: {
17
+ label: 'Conversion Token',
18
+ description: 'The conversion token for your Pinterest account. This can be found in the Pinterest UI by following the steps mentioned [here](https://developers.pinterest.com/docs/conversions/conversion-management/#Authenticating%20for%20the%20send%20conversion%20events%20endpoint).',
19
+ type: 'password',
20
+ required: true
21
+ }
22
+ },
23
+ testAuthentication: (_request) => {
24
+ }
25
+ },
26
+ actions: {}
27
+ };
28
+ exports.default = destination;
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/pinterest-conversions/index.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,mCAAmC;IACzC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EACT,gOAAgO;gBAClO,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,8QAA8Q;gBAChR,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,EAAE;QAIjC,CAAC;KACF;IAED,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Settings {
2
+ accountSid: string;
3
+ authToken: string;
4
+ spaceId: string;
5
+ profileApiAccessToken: string;
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/destinations/twilio-studio/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const triggerStudioFlow_1 = __importDefault(require("./triggerStudioFlow"));
7
+ const destination = {
8
+ name: 'Twilio Studio',
9
+ slug: 'actions-twilio-studio',
10
+ mode: 'cloud',
11
+ authentication: {
12
+ scheme: 'basic',
13
+ fields: {
14
+ accountSid: {
15
+ label: 'Account SID',
16
+ description: 'Your Twilio Account SID, starting with AC. You can find this in the Account Info section of your dashboard in the [Twilio Console](https://www.twilio.com/console).',
17
+ type: 'string',
18
+ required: true
19
+ },
20
+ authToken: {
21
+ label: 'Auth Token',
22
+ description: 'Your Twilio Auth Token. You can find this in the Account Info section of your dashboard in the [Twilio Console](https://www.twilio.com/console).',
23
+ type: 'password',
24
+ required: true
25
+ },
26
+ spaceId: {
27
+ label: 'Space ID',
28
+ description: 'Your Segment Space ID.',
29
+ type: 'string',
30
+ required: true
31
+ },
32
+ profileApiAccessToken: {
33
+ label: 'Profile API Access Token',
34
+ description: 'Your Segment Profile API Access Token.',
35
+ type: 'password',
36
+ required: true
37
+ }
38
+ },
39
+ testAuthentication: (request) => {
40
+ return request('https://api.twilio.com/2010-04-01/Accounts');
41
+ }
42
+ },
43
+ extendRequest({ settings }) {
44
+ return {
45
+ headers: {
46
+ authorization: `Basic ${Buffer.from(`${settings.accountSid}:${settings.authToken}`).toString('base64')}`
47
+ }
48
+ };
49
+ },
50
+ actions: {
51
+ triggerStudioFlow: triggerStudioFlow_1.default
52
+ }
53
+ };
54
+ exports.default = destination;
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/twilio-studio/index.ts"],"names":[],"mappings":";;;;;AAGA,4EAAmD;AAEnD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,qKAAqK;gBACvK,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EACT,kJAAkJ;gBACpJ,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,wCAAwC;gBACrD,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,4CAA4C,CAAC,CAAA;QAC9D,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aACzG;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;KAClB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,8 @@
1
+ export interface Payload {
2
+ flowSid: string;
3
+ from: string;
4
+ coolingOffPeriod?: number;
5
+ userId?: string;
6
+ anonymousId?: string;
7
+ eventType: string;
8
+ }
@@ -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/destinations/twilio-studio/triggerStudioFlow/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const utils_1 = require("../utils");
5
+ const action = {
6
+ title: 'Trigger Studio Flow',
7
+ description: 'Trigger a Flow in Twilio Studio to initiate an outbound call or message. The Flow will execute via the REST API trigger.',
8
+ fields: {
9
+ flowSid: {
10
+ label: 'Flow SID',
11
+ description: 'The Flow SID, starting with FW, for the Studio Flow to trigger.',
12
+ type: 'string',
13
+ required: true
14
+ },
15
+ from: {
16
+ label: 'From Phone Number',
17
+ description: 'The Twilio phone number to initiate calls or messages from during the Flow Execution. Use [E.164](https://www.twilio.com/docs/glossary/what-e164) format (+1xxxxxxxxxx).',
18
+ type: 'string',
19
+ required: true
20
+ },
21
+ coolingOffPeriod: {
22
+ label: 'Cooling-off Period (in seconds)',
23
+ description: 'The amount of time during which the Flow can only be triggered once per Flow SID - User ID combination. Default is 60 seconds.',
24
+ type: 'number',
25
+ default: 60
26
+ },
27
+ userId: {
28
+ label: 'User ID',
29
+ description: 'A Distinct User ID',
30
+ type: 'hidden',
31
+ default: { '@path': '$.userId' }
32
+ },
33
+ anonymousId: {
34
+ label: 'Anonymous ID',
35
+ description: 'A Distinct External ID',
36
+ type: 'hidden',
37
+ default: { '@path': '$.anonymousId' }
38
+ },
39
+ eventType: {
40
+ label: 'Event type',
41
+ type: 'hidden',
42
+ description: 'The type of the event being performed.',
43
+ required: true,
44
+ default: {
45
+ '@path': '$.type'
46
+ }
47
+ }
48
+ },
49
+ perform: async (request, { settings, payload, stateContext }) => {
50
+ if (payload.eventType !== 'identify') {
51
+ throw new actions_core_1.IntegrationError('Unable to trigger Studio Flow. Only Identify Events are allowed!', `Incompatible Event Type: ${payload.eventType}`, 400);
52
+ }
53
+ if (!payload.userId && !payload.anonymousId) {
54
+ throw new actions_core_1.IntegrationError('Unable to trigger Studio Flow. No User identifier found for this Segment profile!', `No userId found in the Segment Event`, 400);
55
+ }
56
+ if (stateContext &&
57
+ !utils_1.shouldSendToStudio(`${payload.flowSid}_${payload.userId || payload.anonymousId}`, stateContext, payload.coolingOffPeriod)) {
58
+ throw new actions_core_1.IntegrationError(`Unable to trigger Studio Flow. Only 1 request allowed per Flow SID - User ID combination in ${payload.coolingOffPeriod || utils_1.DEFAULT_COOLING_OFF_PERIOD} seconds`, 'Cooling off Period', 400);
59
+ }
60
+ const toAddress = await utils_1.getToAddressField(request, settings, payload);
61
+ if (!toAddress) {
62
+ throw new actions_core_1.IntegrationError('Unable to trigger Studio Flow. No Contact Address Found!', 'Trigger Studio Flow no contact address found failure', 400);
63
+ }
64
+ const url = `${utils_1.STUDIO_BASE_URL}/v2/Flows/${payload.flowSid}/Executions`;
65
+ const parametersMap = JSON.stringify({ source: 'studio_segment_destination' });
66
+ try {
67
+ await request(url, {
68
+ method: 'post',
69
+ body: new URLSearchParams({
70
+ From: payload.from,
71
+ To: toAddress,
72
+ Parameters: parametersMap
73
+ })
74
+ });
75
+ }
76
+ catch (err) {
77
+ const error = err;
78
+ const errData = error.response.data;
79
+ throw new actions_core_1.IntegrationError(`Unable to trigger Studio Flow. ${errData?.message}`, `Twilio Error Code: ${errData?.code}`, errData?.status);
80
+ }
81
+ }
82
+ };
83
+ exports.default = action;
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/twilio-studio/triggerStudioFlow/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,oCAMiB;AAEjB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,0HAA0H;IAC5H,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,iEAAiE;YAC9E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,0KAA0K;YAC5K,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,iCAAiC;YACxC,WAAW,EACT,gIAAgI;YAClI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,MAAM,EAAE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AAA;QACrE,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,+BAAgB,CACxB,0DAA0D,EAC1D,sDAAsD,EACtD,GAAG,CACJ,CAAA;SACF;QACD,MAAM,GAAG,GAAG,GAAG,uBAAe,aAAa,OAAO,CAAC,OAAO,aAAa,CAAA;QACvE,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC,CAAA;QAC9E,IAAI;YACF,MAAM,OAAO,CAAC,GAAG,EAAE;gBACjB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,EAAE,EAAE,SAAS;oBACb,UAAU,EAAE,aAAa;iBAC1B,CAAC;aACH,CAAC,CAAA;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,KAAK,GAAG,GAAkB,CAAA;YAChC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAA;YACnC,MAAM,IAAI,+BAAgB,CACxB,kCAAkC,OAAO,EAAE,OAAO,EAAE,EACpD,sBAAsB,OAAO,EAAE,IAAI,EAAE,EACrC,OAAO,EAAE,MAAM,CAChB,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { RequestOptions, HTTPError } from '@segment/actions-core';
2
+ import { StateContext } from '@segment/actions-core/src/destination-kit';
3
+ import type { Settings } from './generated-types';
4
+ import type { Payload } from './triggerStudioFlow/generated-types';
5
+ interface ExternalId {
6
+ id: string;
7
+ type: string;
8
+ source_id: string;
9
+ collection: string;
10
+ created_at: string;
11
+ encoding: string;
12
+ }
13
+ declare type RequestFn = (url: string, options?: RequestOptions) => Promise<Response>;
14
+ export interface TwilioError extends HTTPError {
15
+ response: Response & {
16
+ data: {
17
+ status: number;
18
+ message: string;
19
+ code: string;
20
+ };
21
+ };
22
+ }
23
+ export declare const STUDIO_BASE_URL = "https://studio.twilio.com";
24
+ export declare const PROFILE_API_BASE_URL = "https://profiles.segment.com";
25
+ export declare const DEFAULT_COOLING_OFF_PERIOD = 60;
26
+ export declare const getToAddressField: (request: RequestFn, settings: Settings, payload: Payload) => Promise<string | false>;
27
+ export declare const fetchProfileExternalIds: (request: RequestFn, settings: Settings, userId: string, anonymousId: string) => Promise<ExternalId[]>;
28
+ export declare const shouldSendToStudio: (cacheKey: string, stateContext: StateContext, coolingOffPeriod: number) => boolean;
29
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldSendToStudio = exports.fetchProfileExternalIds = exports.getToAddressField = exports.DEFAULT_COOLING_OFF_PERIOD = exports.PROFILE_API_BASE_URL = exports.STUDIO_BASE_URL = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ exports.STUDIO_BASE_URL = 'https://studio.twilio.com';
6
+ exports.PROFILE_API_BASE_URL = 'https://profiles.segment.com';
7
+ exports.DEFAULT_COOLING_OFF_PERIOD = 60;
8
+ const getToAddressField = async (request, settings, payload) => {
9
+ const externalIds = await exports.fetchProfileExternalIds(request, settings, payload.userId, payload.anonymousId);
10
+ if (externalIds.length <= 0) {
11
+ return false;
12
+ }
13
+ const latestId = externalIds.reduce((acc, current) => {
14
+ return new Date(acc.created_at) > new Date(current.created_at) ? acc : current;
15
+ });
16
+ return latestId?.id;
17
+ };
18
+ exports.getToAddressField = getToAddressField;
19
+ const fetchProfileExternalIds = async (request, settings, userId, anonymousId) => {
20
+ try {
21
+ const identifier = userId ? `user_id:${userId}` : `anonymous_id:${anonymousId}`;
22
+ const response = await request(`${exports.PROFILE_API_BASE_URL}/v1/spaces/${settings.spaceId}/collections/users/profiles/${identifier}/external_ids?include=phone`, {
23
+ headers: {
24
+ authorization: `Basic ${Buffer.from(settings.profileApiAccessToken + ':').toString('base64')}`,
25
+ 'content-type': 'application/json'
26
+ }
27
+ });
28
+ const body = await response.json();
29
+ return body.data;
30
+ }
31
+ catch (error) {
32
+ throw new actions_core_1.IntegrationError('Unable to trigger Studio Flow. Fetching phone external Id failed.', 'Profile fetch API failure', 500);
33
+ }
34
+ };
35
+ exports.fetchProfileExternalIds = fetchProfileExternalIds;
36
+ const shouldSendToStudio = (cacheKey, stateContext, coolingOffPeriod) => {
37
+ if (stateContext?.getRequestContext?.(cacheKey))
38
+ return false;
39
+ stateContext?.setResponseContext?.(cacheKey, cacheKey, { second: coolingOffPeriod || exports.DEFAULT_COOLING_OFF_PERIOD });
40
+ return true;
41
+ };
42
+ exports.shouldSendToStudio = shouldSendToStudio;
43
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/twilio-studio/utils.ts"],"names":[],"mappings":";;;AAAA,wDAAmF;AAwBtE,QAAA,eAAe,GAAG,2BAA2B,CAAA;AAC7C,QAAA,oBAAoB,GAAG,8BAA8B,CAAA;AAGrD,QAAA,0BAA0B,GAAG,EAAE,CAAA;AAGrC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAkB,EAAE,QAAkB,EAAE,OAAgB,EAAE,EAAE;IAClG,MAAM,WAAW,GAAG,MAAM,+BAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAO,EAAE,OAAO,CAAC,WAAY,CAAC,CAAA;IAC3G,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;QAC3B,OAAO,KAAK,CAAA;KACb;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAA;IAChF,CAAC,CAAC,CAAA;IACF,OAAO,QA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 Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utility_1 = require("../utility");
4
4
  const action = {
5
5
  title: 'Identify User',
6
- description: "Maps segment's visitor traits to VWO visitors' attributes",
6
+ description: "Maps Segment's visitor traits to the visitor attributes in VWO",
7
7
  defaultSubscription: 'type = "identify"',
8
8
  fields: {
9
9
  attributes: {
10
- description: 'A JSON object containing additional attributes that will be associated with the event.',
10
+ description: `Visitor's attributes to be mapped`,
11
11
  label: 'attributes',
12
12
  required: true,
13
13
  type: 'object',
@@ -25,7 +25,7 @@ const action = {
25
25
  }
26
26
  },
27
27
  page: {
28
- description: 'Page Context',
28
+ description: 'Contains context information regarding a webpage',
29
29
  label: 'Page',
30
30
  required: true,
31
31
  type: 'object',
@@ -34,7 +34,7 @@ const action = {
34
34
  }
35
35
  },
36
36
  ip: {
37
- description: 'IP Address',
37
+ description: 'IP address of the user',
38
38
  label: 'IP Address',
39
39
  required: false,
40
40
  type: 'string',
@@ -43,7 +43,7 @@ const action = {
43
43
  }
44
44
  },
45
45
  userAgent: {
46
- description: 'User Agent',
46
+ description: 'User-Agent of the user',
47
47
  label: 'User Agent',
48
48
  required: true,
49
49
  type: 'string',
@@ -52,7 +52,7 @@ const action = {
52
52
  }
53
53
  },
54
54
  timestamp: {
55
- description: 'Timestamp',
55
+ description: 'Timestamp on the event',
56
56
  label: 'Timestamp',
57
57
  required: true,
58
58
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/vwo/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,wCAA4D;AAE5D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,2DAA2D;IACxE,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,WAAW,EAAE,wFAAwF;YACrG,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EA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,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QAC9E,iBAAiB,CAAC,CAAC,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,CAAA;QACnF,MAAM,QAAQ,GAAG,sDAAsD,SAAS,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAA;QAC7G,OAAO,OAAO,CAAC,QAAQ,EAAE;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iBAAiB;YACvB,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/vwo/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,wCAA4D;AAE5D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,gEAAgE;IAC7E,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,WAAW,EAAE,mCAAmC;YAChD,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,OAAO,EAAE;YACP,WAAW,EAAE,UAAU;YACvB,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,kDAAkD;YAC/D,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,EAAE,EAAE;YACF,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,KAA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
36
  fields: {
37
37
  vwoAccountId: {
38
- label: 'Your VWO account ID, used for fetching your VWO async smart code. ',
38
+ label: 'Your VWO account ID',
39
39
  description: 'Enter your VWO Account ID',
40
40
  type: 'number',
41
41
  required: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/vwo/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAqD;AAErD,8DAAqC;AACrC,kEAAyC;AACzC,4DAAmC;AAEnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,OAAO;IACb,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;SAC1C;QACD;YACE,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,cAAc;YAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;SAC5C;QACD;YACE,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,eAAe;YAC1B,aAAa,EAAE,WAAW;YAC1B,OAAO,EAAE,4BAAa,CAAC,mBAAS,CAAC,MAAM,CAAC;SACzC;KACF;IACD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ,KAAK,EAAE,oEAAoE;gBAC3E,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC7C,IAAI,QAAQ,CAAC,YAAY,GAAG,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBA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G,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC5E,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;aAClE;iBAAM;gBACL,OAAO,IAAI,CAAA;aACZ;QACH,CAAC;KACF;IAED,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;QACZ,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utility_1 = require("../utility");
4
4
  const action = {
5
5
  title: 'Page Visit',
6
- description: 'Sends page visit information to VWO',
6
+ description: `Sends Segment's page event to VWO`,
7
7
  fields: {
8
8
  url: {
9
- description: 'The URL of the page',
9
+ description: 'URL of the webpage',
10
10
  label: 'Page URL',
11
11
  required: true,
12
12
  type: 'string',
@@ -24,7 +24,7 @@ const action = {
24
24
  }
25
25
  },
26
26
  page: {
27
- description: 'Page Context',
27
+ description: 'Contains context information regarding a webpage',
28
28
  label: 'Page',
29
29
  required: true,
30
30
  type: 'object',
@@ -33,7 +33,7 @@ const action = {
33
33
  }
34
34
  },
35
35
  ip: {
36
- description: 'IP Address',
36
+ description: 'IP address of the user',
37
37
  label: 'IP Address',
38
38
  required: false,
39
39
  type: 'string',
@@ -42,7 +42,7 @@ const action = {
42
42
  }
43
43
  },
44
44
  userAgent: {
45
- description: 'User Agent',
45
+ description: 'User-Agent of the user',
46
46
  label: 'User Agent',
47
47
  required: true,
48
48
  type: 'string',
@@ -51,7 +51,7 @@ const action = {
51
51
  }
52
52
  },
53
53
  timestamp: {
54
- description: 'Timestamp',
54
+ description: 'Timestamp on the event',
55
55
  label: 'Timestamp',
56
56
  required: true,
57
57
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/vwo/pageVisit/index.ts"],"names":[],"mappings":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