@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,79 @@
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 identifyUser = {
6
+ title: 'Identify User',
7
+ description: '“Creates or updates a user profile, and adds or updates trait values on the user profile that you can use for segmentation within the Launchpad platform.',
8
+ defaultSubscription: 'type = "identify"',
9
+ fields: {
10
+ ip: {
11
+ label: 'IP Address',
12
+ type: 'string',
13
+ description: "The IP address of the user. This is only used for geolocation and won't be stored.",
14
+ default: {
15
+ '@path': '$.context.ip'
16
+ }
17
+ },
18
+ userId: {
19
+ label: 'User ID',
20
+ type: 'string',
21
+ description: 'A unique ID for a known user. This will be used as the Distinct ID. This field is required if the Anonymous ID field is empty',
22
+ default: {
23
+ '@path': '$.userId'
24
+ }
25
+ },
26
+ anonymousId: {
27
+ label: 'Anonymous ID',
28
+ type: 'string',
29
+ description: 'A unique ID for an anonymous user. This will be used as the Distinct ID if the User ID field is empty. This field is required if the User ID field is empty',
30
+ default: {
31
+ '@path': '$.anonymousId'
32
+ }
33
+ },
34
+ traits: {
35
+ label: 'User Properties',
36
+ type: 'object',
37
+ required: true,
38
+ description: 'Properties that you want to set on the user profile and you would want to segment by later.',
39
+ default: {
40
+ '@path': '$.traits'
41
+ }
42
+ }
43
+ },
44
+ perform: async (request, { payload, settings }) => {
45
+ const apiServerUrl = utils_1.getApiServerUrl(settings.apiRegion);
46
+ let traits;
47
+ if (payload.traits && Object.keys(payload.traits).length > 0) {
48
+ const concatenatedName = utils_1.getConcatenatedName(payload.traits.firstName, payload.traits.lastName, payload.traits.name);
49
+ traits = {
50
+ ...actions_core_1.omit(payload.traits, ['created', 'email', 'firstName', 'lastName', 'name', 'username', 'phone']),
51
+ $created: payload.traits.created,
52
+ $email: payload.traits.email,
53
+ $first_name: payload.traits.firstName,
54
+ $last_name: payload.traits.lastName,
55
+ $name: concatenatedName,
56
+ $username: payload.traits.username,
57
+ $phone: payload.traits.phone,
58
+ ...payload.traits
59
+ };
60
+ }
61
+ const data = {
62
+ distinct_id: payload.userId ? payload.userId : payload.anonymousId,
63
+ user_id: payload.userId,
64
+ anonymous_id: payload.anonymousId,
65
+ $ip: payload.ip,
66
+ $set: traits ? traits : {},
67
+ event: '$identify',
68
+ type: 'screen',
69
+ api_key: settings.apiSecret
70
+ };
71
+ const identifyResponse = request(`${apiServerUrl}capture`, {
72
+ method: 'post',
73
+ json: data
74
+ });
75
+ return identifyResponse;
76
+ }
77
+ };
78
+ exports.default = identifyUser;
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/identifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA8D;AAI9D,oCAA+D;AAE/D,MAAM,YAAY,GAAwC;IACxD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,2JAA2J;IAC7J,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oFAAoF;YACjG,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+HAA+H;YACjI,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,WAAW,EAAE;YAC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AC,KAAK;gBAC5B,GAAG,OAAO,CAAC,MAAM;aAClB,CAAA;SACF;QAED,MAAM,IAAI,GAAG;YACX,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW;YAClE,OAAO,EAAE,OAAO,CAAC,MAAM;YACvB,YAAY,EAAE,OAAO,CAAC,WAAW;YACjC,GAAG,EAAE,OAAO,CAAC,EAAE;YACf,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YAC1B,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,QAAQ,CAAC,SAAS;SAC5B,CAAA;QACD,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,YAAY,SAAS,EAAE;YACzD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QACF,OAAO,gBAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,YAAY,CAAA"}
@@ -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,96 @@
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 actions_core_1 = require("@segment/actions-core");
7
+ const trackEvent_1 = __importDefault(require("./trackEvent"));
8
+ const identifyUser_1 = __importDefault(require("./identifyUser"));
9
+ const groupIdentifyUser_1 = __importDefault(require("./groupIdentifyUser"));
10
+ const utils_1 = require("./utils");
11
+ const presets = [
12
+ {
13
+ name: 'Track Calls',
14
+ subscribe: 'type = "track" and event != "Order Completed"',
15
+ partnerAction: 'trackEvent',
16
+ mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
17
+ },
18
+ {
19
+ name: 'Page Calls',
20
+ subscribe: 'type = "page"',
21
+ partnerAction: 'trackEvent',
22
+ mapping: {
23
+ ...actions_core_1.defaultValues(trackEvent_1.default.fields),
24
+ event: {
25
+ '@template': 'Viewed {{name}}'
26
+ }
27
+ }
28
+ },
29
+ {
30
+ name: 'Screen Calls',
31
+ subscribe: 'type = "screen"',
32
+ partnerAction: 'trackEvent',
33
+ mapping: {
34
+ ...actions_core_1.defaultValues(trackEvent_1.default.fields),
35
+ event: {
36
+ '@template': 'Viewed {{name}}'
37
+ }
38
+ }
39
+ },
40
+ {
41
+ name: 'Identify Calls',
42
+ subscribe: 'type = "identify"',
43
+ partnerAction: 'identifyUser',
44
+ mapping: actions_core_1.defaultValues(identifyUser_1.default.fields)
45
+ },
46
+ {
47
+ name: 'Group Calls',
48
+ subscribe: 'type = "group"',
49
+ partnerAction: 'groupIdentifyUser',
50
+ mapping: actions_core_1.defaultValues(groupIdentifyUser_1.default.fields)
51
+ }
52
+ ];
53
+ const destination = {
54
+ name: 'Launchpad (Actions)',
55
+ slug: 'actions-launchpad',
56
+ mode: 'cloud',
57
+ authentication: {
58
+ scheme: 'custom',
59
+ fields: {
60
+ apiSecret: {
61
+ label: 'Secret Key',
62
+ description: 'Launchpad project secret. You can find that in the settings in your Launchpad.pm account.',
63
+ type: 'password',
64
+ required: true
65
+ },
66
+ apiRegion: {
67
+ label: 'Data Residency',
68
+ description: 'Learn about [EU data residency](https://help.launchpad.pm).',
69
+ type: 'string',
70
+ choices: Object.values(utils_1.ApiRegions).map((apiRegion) => ({ label: apiRegion, value: apiRegion })),
71
+ default: utils_1.ApiRegions.US
72
+ },
73
+ sourceName: {
74
+ label: 'Source Name',
75
+ description: "This value, if it's not blank, will be sent as segment_source_name to Launchpad for every event/page/screen call.",
76
+ type: 'string'
77
+ }
78
+ },
79
+ testAuthentication: (request, { settings }) => {
80
+ return request(`https://backend.launchpad.pm/api/data/validate-project-credentials/`, {
81
+ method: 'post',
82
+ body: JSON.stringify({
83
+ api_secret: settings.apiSecret
84
+ })
85
+ });
86
+ }
87
+ },
88
+ presets,
89
+ actions: {
90
+ trackEvent: trackEvent_1.default,
91
+ identifyUser: identifyUser_1.default,
92
+ groupIdentifyUser: groupIdentifyUser_1.default
93
+ }
94
+ };
95
+ exports.default = destination;
96
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,8DAAqC;AACrC,kEAAyC;AACzC,4EAAmD;AAEnD,mCAAoC;AAGpC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,+CAA+C;QAC1D,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,KAAK,EAAE;gBACL,WAAW,EAAE,iBAAiB;aAC/B;SACF;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,KAAK,EAAE;gBACL,WAAW,EAAE,iBAAiB;aAC/B;SACF;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;KAC5C;IACD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,mBAAmB;QAClC,OAAO,E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+ anonymous_id?: string;
3
+ browser_version?: string;
4
+ browser?: string;
5
+ current_url?: string;
6
+ device?: string;
7
+ group_id?: string;
8
+ identified_id?: string;
9
+ messageId?: string;
10
+ ip?: string | unknown;
11
+ os_version?: string;
12
+ os?: string;
13
+ referrer?: string;
14
+ user_id?: string;
15
+ source: string;
16
+ distinct_id: string | undefined;
17
+ id?: string | null;
18
+ segment_source_name?: string;
19
+ time?: string | number | undefined;
20
+ properties?: [k: string] | unknown;
21
+ traits?: [k: string] | unknown;
22
+ context?: [k: string] | unknown;
23
+ };
24
+ export declare type LaunchpadEvent = {
25
+ event?: string;
26
+ properties?: LaunchpadEventProperties;
27
+ api_key: string;
28
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=launchpad-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launchpad-types.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/launchpad-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export interface Payload {
2
+ event: string;
3
+ userId?: string;
4
+ anonymousId?: string;
5
+ groupId?: string;
6
+ messageId: string;
7
+ timestamp: string | number;
8
+ properties?: {
9
+ [k: string]: unknown;
10
+ };
11
+ traits?: {
12
+ [k: string]: unknown;
13
+ };
14
+ context?: {
15
+ [k: string]: unknown;
16
+ };
17
+ enable_batching?: boolean;
18
+ }
@@ -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/launchpad/trackEvent/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 trackEvent: ActionDefinition<Settings, Payload>;
5
+ export default trackEvent;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const launchpad_properties_1 = require("./launchpad-properties");
5
+ function getEventProperties(payload, settings) {
6
+ const integration = payload.context?.integration;
7
+ return {
8
+ time: payload.timestamp,
9
+ ip: payload.context?.ip,
10
+ anonymous_id: payload.anonymousId,
11
+ distinct_id: payload.userId ? payload.userId : payload.anonymousId,
12
+ context: payload.context,
13
+ group_id: payload.groupId,
14
+ properties: payload.properties,
15
+ traits: payload.traits ? payload.traits : payload.context?.traits,
16
+ messageId: payload.messageId,
17
+ source: integration?.name != 'Segment' ? integration?.name : 'Segment',
18
+ user_id: payload.userId,
19
+ segment_source_name: settings.sourceName
20
+ };
21
+ }
22
+ const getEventFromPayload = (payload, settings) => {
23
+ const event = {
24
+ event: payload.event,
25
+ properties: {
26
+ ...getEventProperties(payload, settings)
27
+ },
28
+ api_key: settings.apiSecret
29
+ };
30
+ return event;
31
+ };
32
+ const processData = async (request, settings, payload) => {
33
+ const event = getEventFromPayload(payload, settings);
34
+ const urlAddendum = 'capture';
35
+ const requestURL = `${utils_1.getApiServerUrl(settings.apiRegion)}` + urlAddendum;
36
+ return request(requestURL, {
37
+ method: 'post',
38
+ json: event
39
+ });
40
+ };
41
+ const trackEvent = {
42
+ title: 'Track Event',
43
+ description: 'Send an event to Launchpad. [Learn more about Events in Launchpad](https://help.launchpad.pm)',
44
+ defaultSubscription: 'type = "track"',
45
+ fields: {
46
+ event: {
47
+ label: 'Event Name',
48
+ type: 'string',
49
+ description: 'The name of the action being performed.',
50
+ required: true,
51
+ default: {
52
+ '@path': '$.event'
53
+ }
54
+ },
55
+ ...launchpad_properties_1.eventProperties
56
+ },
57
+ perform: async (request, { settings, payload }) => {
58
+ return processData(request, settings, payload);
59
+ }
60
+ };
61
+ exports.default = trackEvent;
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","s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AAK,EAAE,OAAsB,EAAE,QAAkB,EAAE,OAAgB,EAAE,EAAE;IACzF,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,WAAW,GAAG,SAAS,CAAA;IAE7B,MAAM,UAAU,GAAW,GAAG,uBAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,CAAA;IAEjF,OAAO,OAAO,CAAC,UAAU,EAAE;QACzB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK;KACZ,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,UAAU,GAAwC;IACtD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+FAA+F;IAC5G,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,GAAG,sCAAe;KACnB;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { InputField } from '@segment/actions-core';
2
+ export declare const eventProperties: Record<string, InputField>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eventProperties = void 0;
4
+ exports.eventProperties = {
5
+ userId: {
6
+ label: 'User ID',
7
+ type: 'string',
8
+ description: 'A unique ID for a known user. This will be used as the Distinct ID. This field is required if the Anonymous ID field is empty',
9
+ default: {
10
+ '@path': '$.userId'
11
+ }
12
+ },
13
+ anonymousId: {
14
+ label: 'Anonymous ID',
15
+ type: 'string',
16
+ description: 'A unique ID for an anonymous user. This will be used as the Distinct ID if the User ID field is empty. This field is required if the User ID field is empty',
17
+ default: {
18
+ '@path': '$.anonymousId'
19
+ }
20
+ },
21
+ groupId: {
22
+ label: 'Group ID',
23
+ type: 'string',
24
+ required: false,
25
+ description: 'The unique identifier of the group that performed this event.',
26
+ default: {
27
+ '@path': '$.context.groupId'
28
+ }
29
+ },
30
+ messageId: {
31
+ label: 'Insert ID',
32
+ type: 'string',
33
+ required: true,
34
+ description: 'A random id that is unique to an event. Launchpad uses $insert_id to deduplicate events.',
35
+ default: {
36
+ '@path': '$.messageId'
37
+ }
38
+ },
39
+ timestamp: {
40
+ label: 'Timestamp',
41
+ type: 'datetime',
42
+ required: true,
43
+ description: 'The timestamp of the event. Launchpad expects epoch timestamp in millisecond or second. Please note, Launchpad only accepts this field as the timestamp. If the field is empty, it will be set to the time Launchpad servers receive it.',
44
+ default: {
45
+ '@path': '$.timestamp'
46
+ }
47
+ },
48
+ properties: {
49
+ required: false,
50
+ label: 'Event Properties',
51
+ type: 'object',
52
+ description: 'An object of key-value pairs that represent additional data to be sent along with the event.',
53
+ default: {
54
+ '@path': '$.properties'
55
+ }
56
+ },
57
+ traits: {
58
+ required: false,
59
+ label: 'User Properties',
60
+ type: 'object',
61
+ description: 'An object of key-value pairs that represent additional data tied to the user. This is used for segmentation within the platform.',
62
+ default: {
63
+ '@if': {
64
+ exists: { '@path': '$.traits' },
65
+ then: { '@path': '$.traits' },
66
+ else: { '@path': '$.context.traits' }
67
+ }
68
+ }
69
+ },
70
+ context: {
71
+ label: 'Event context',
72
+ required: false,
73
+ description: 'An object of key-value pairs that provides useful context about the event.',
74
+ type: 'object',
75
+ default: {
76
+ '@path': '$.context'
77
+ }
78
+ },
79
+ enable_batching: {
80
+ required: false,
81
+ type: 'boolean',
82
+ label: 'Batch Data to Launchpad',
83
+ description: 'Set as true to ensure Segment sends data to Launchpad in batches.',
84
+ default: true
85
+ }
86
+ };
87
+ //# sourceMappingURL=launchpad-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launchpad-properties.js","sourceRoot":"","sources":["../../../../src/destinations/launchpad/trackEvent/launchpad-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAA+B;IACzD,MAAM,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,+HAA+H;QACjI,OAAO,EAAE;YACP,OAAO,EAAE,UAAU;SACpB;KACF;IACD,WAAW,EAAE;QACX,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,6JAA6J;QAC/J,OAAO,EAAE;YACP,OAAO,EAAE,eAAe;SACzB;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,+DAA+D;QAC5E,OAAO,EAAE;YACP,OAAO,EAAE,mBAAmB;SAC7B;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,0FAA0F;QACvG,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,0OAA0O;QAC5O,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,8FAA8F;QAC3G,OAAO,EAAE;YACP,OAAO,EAAE,cAAc;SACxB;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,kIAAkI;QACpI,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;aACtC;SACF;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,4EAA4E;QACzF,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE;YACP,OAAO,EAAE,WAAW;SACrB;KACF;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,mEAAmE;QAChF,OAAO,EAAE,IAAI;KACd;CACF,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare enum ApiRegions {
2
+ US = "US \uD83C\uDDFA\uD83C\uDDF8",
3
+ EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
4
+ }
5
+ export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
6
+ export declare function getApiServerUrl(apiRegion: string | unknown): string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getApiServerUrl = exports.getConcatenatedName = exports.ApiRegions = void 0;
4
+ var ApiRegions;
5
+ (function (ApiRegions) {
6
+ ApiRegions["US"] = "US \uD83C\uDDFA\uD83C\uDDF8";
7
+ ApiRegions["EU"] = "EU \uD83C\uDDEA\uD83C\uDDFA";
8
+ })(ApiRegions = exports.ApiRegions || (exports.ApiRegions = {}));
9
+ function getConcatenatedName(firstName, lastName, name) {
10
+ return name ?? (firstName && lastName ? `${firstName} ${lastName}` : undefined);
11
+ }
12
+ exports.getConcatenatedName = getConcatenatedName;
13
+ function getApiServerUrl(apiRegion) {
14
+ if (apiRegion == ApiRegions.EU) {
15
+ return 'https://data.launchpad.pm/';
16
+ }
17
+ return 'https://data.launchpad.pm/';
18
+ }
19
+ exports.getApiServerUrl = getApiServerUrl;
20
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/launchpad/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,gDAAc,CAAA;IACd,gDAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAOD,SAAgB,mBAAmB,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IACtF,OAAO,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACjF,CAAC;AAFD,kDAEC;AAED,SAAgB,eAAe,CAAC,SAA2B;IACzD,IAAI,SAAS,IAAI,UAAU,CAAC,EAAE,EAAE;QAC9B,OAAO,4BAA4B,CAAA;KACpC;IACD,OAAO,4BAA4B,CAAA;AACrC,CAAC;AALD,0CAKC"}
@@ -0,0 +1,4 @@
1
+ export interface Settings {
2
+ clientId: string;
3
+ producerToken: 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/livelike-cloud/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { 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,84 @@
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 actions_core_1 = require("@segment/actions-core");
7
+ const properties_1 = require("./properties");
8
+ const trackEvent_1 = __importDefault(require("./trackEvent"));
9
+ const presets = [
10
+ {
11
+ name: 'Track User Actions',
12
+ subscribe: 'type = "track"',
13
+ partnerAction: 'trackEvent',
14
+ mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
15
+ },
16
+ {
17
+ name: 'Page Calls',
18
+ subscribe: 'type = "page"',
19
+ partnerAction: 'trackEvent',
20
+ mapping: {
21
+ ...actions_core_1.defaultValues(trackEvent_1.default.fields),
22
+ action_name: {
23
+ '@if': {
24
+ exists: { '@path': '$.properties.action_name' },
25
+ then: { '@path': '$.properties.action_name' },
26
+ else: { '@path': '$.properties.title' }
27
+ }
28
+ }
29
+ }
30
+ },
31
+ {
32
+ name: 'Screen Calls',
33
+ subscribe: 'type = "screen"',
34
+ partnerAction: 'trackEvent',
35
+ mapping: {
36
+ ...actions_core_1.defaultValues(trackEvent_1.default.fields),
37
+ action_name: {
38
+ '@if': {
39
+ exists: { '@path': '$.properties.action_name' },
40
+ then: { '@path': '$.properties.action_name' },
41
+ else: { '@path': '$.properties.title' }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ];
47
+ const destination = {
48
+ name: 'LiveLike',
49
+ slug: 'actions-livelike-cloud',
50
+ mode: 'cloud',
51
+ authentication: {
52
+ scheme: 'custom',
53
+ fields: {
54
+ clientId: {
55
+ label: 'Client ID',
56
+ description: 'Your LiveLike Application Client ID.',
57
+ type: 'string',
58
+ required: true
59
+ },
60
+ producerToken: {
61
+ label: 'Producer Token',
62
+ description: 'Your LiveLike Producer token.',
63
+ type: 'password',
64
+ required: true
65
+ }
66
+ },
67
+ testAuthentication: async (request, { settings }) => {
68
+ return request(`${properties_1.apiBaseUrl}/applications/${settings.clientId}/validate-app/`, {
69
+ method: 'get'
70
+ });
71
+ }
72
+ },
73
+ extendRequest: ({ settings }) => {
74
+ return {
75
+ headers: { Authorization: `Bearer ${settings.producerToken}` }
76
+ };
77
+ },
78
+ presets,
79
+ actions: {
80
+ trackEvent: trackEvent_1.default
81
+ }
82
+ };
83
+ exports.default = destination;
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/livelike-cloud/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,6CAAyC;AAEzC,8DAAqC;AAErC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC/C,IAAI,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;YACnC,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC/C,IAAI,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;oBAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;KACF;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,sCAAsC;gBACnD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,OAAO,OAAO,CAAC,GAAG,uBAAU,iBAAiB,QAAQ,CAAC,QAAQ,gBAAgB,EAAE;gBAC9E,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,aAAa,EAAE,EAAE;SAC/D,CAAA;IACH,CAAC;IACD,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const apiBaseUrl = "https://cf-blast-iconic.livelikecdn.com/api/v1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiBaseUrl = void 0;
4
+ exports.apiBaseUrl = 'https://cf-blast-iconic.livelikecdn.com/api/v1';
5
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/livelike-cloud/properties.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,gDAAgD,CAAA"}
@@ -0,0 +1,11 @@
1
+ export interface Payload {
2
+ action_key: string;
3
+ action_name?: string;
4
+ action_description?: string;
5
+ user_id?: string;
6
+ livelike_profile_id?: string;
7
+ timestamp: string | number;
8
+ properties?: {
9
+ [k: string]: unknown;
10
+ };
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/destinations/livelike-cloud/trackEvent/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;