@segment/action-destinations 2.337.2-staging.0 → 2.338.1-staging.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 (73) hide show
  1. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
  2. package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
  3. package/dist/destinations/{aggregations-io/send/generated-types.js → engage/sendgrid/Profile.js} +1 -1
  4. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  5. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +21 -0
  6. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +174 -0
  7. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  8. package/dist/destinations/google-enhanced-conversions/functions.d.ts +2 -2
  9. package/dist/destinations/google-enhanced-conversions/functions.js +4 -4
  10. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
  11. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +7 -3
  12. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
  13. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +7 -3
  14. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  15. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +2 -2
  16. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  17. package/dist/destinations/mixpanel/utils.d.ts +13 -0
  18. package/dist/destinations/mixpanel/utils.js +117 -0
  19. package/dist/destinations/mixpanel/utils.js.map +1 -0
  20. package/package.json +1 -1
  21. package/dist/destinations/aggregations-io/generated-types.d.ts +0 -4
  22. package/dist/destinations/aggregations-io/generated-types.js +0 -3
  23. package/dist/destinations/aggregations-io/generated-types.js.map +0 -1
  24. package/dist/destinations/aggregations-io/index.d.ts +0 -4
  25. package/dist/destinations/aggregations-io/index.js +0 -48
  26. package/dist/destinations/aggregations-io/index.js.map +0 -1
  27. package/dist/destinations/aggregations-io/send/generated-types.d.ts +0 -7
  28. package/dist/destinations/aggregations-io/send/generated-types.js.map +0 -1
  29. package/dist/destinations/aggregations-io/send/index.d.ts +0 -5
  30. package/dist/destinations/aggregations-io/send/index.js +0 -44
  31. package/dist/destinations/aggregations-io/send/index.js.map +0 -1
  32. package/dist/destinations/equals/generated-types.d.ts +0 -3
  33. package/dist/destinations/equals/generated-types.js +0 -3
  34. package/dist/destinations/equals/generated-types.js.map +0 -1
  35. package/dist/destinations/equals/index.d.ts +0 -4
  36. package/dist/destinations/equals/index.js +0 -38
  37. package/dist/destinations/equals/index.js.map +0 -1
  38. package/dist/destinations/equals/send/generated-types.d.ts +0 -5
  39. package/dist/destinations/equals/send/generated-types.js +0 -3
  40. package/dist/destinations/equals/send/generated-types.js.map +0 -1
  41. package/dist/destinations/equals/send/index.d.ts +0 -5
  42. package/dist/destinations/equals/send/index.js +0 -38
  43. package/dist/destinations/equals/send/index.js.map +0 -1
  44. package/dist/destinations/kevel/generated-types.d.ts +0 -4
  45. package/dist/destinations/kevel/generated-types.js +0 -3
  46. package/dist/destinations/kevel/generated-types.js.map +0 -1
  47. package/dist/destinations/kevel/index.d.ts +0 -4
  48. package/dist/destinations/kevel/index.js +0 -45
  49. package/dist/destinations/kevel/index.js.map +0 -1
  50. package/dist/destinations/kevel/syncAudience/generated-types.d.ts +0 -8
  51. package/dist/destinations/kevel/syncAudience/generated-types.js +0 -3
  52. package/dist/destinations/kevel/syncAudience/generated-types.js.map +0 -1
  53. package/dist/destinations/kevel/syncAudience/index.d.ts +0 -5
  54. package/dist/destinations/kevel/syncAudience/index.js +0 -64
  55. package/dist/destinations/kevel/syncAudience/index.js.map +0 -1
  56. package/dist/destinations/kevel/syncTraits/generated-types.d.ts +0 -6
  57. package/dist/destinations/kevel/syncTraits/generated-types.js +0 -3
  58. package/dist/destinations/kevel/syncTraits/generated-types.js.map +0 -1
  59. package/dist/destinations/kevel/syncTraits/index.d.ts +0 -5
  60. package/dist/destinations/kevel/syncTraits/index.js +0 -39
  61. package/dist/destinations/kevel/syncTraits/index.js.map +0 -1
  62. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.d.ts +0 -1
  63. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js +0 -129
  64. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js.map +0 -1
  65. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.d.ts +0 -1
  66. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js +0 -69
  67. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js.map +0 -1
  68. package/dist/destinations/mixpanel/incrementProperties/generated-types.d.ts +0 -8
  69. package/dist/destinations/mixpanel/incrementProperties/generated-types.js +0 -3
  70. package/dist/destinations/mixpanel/incrementProperties/generated-types.js.map +0 -1
  71. package/dist/destinations/mixpanel/incrementProperties/index.d.ts +0 -5
  72. package/dist/destinations/mixpanel/incrementProperties/index.js +0 -84
  73. package/dist/destinations/mixpanel/incrementProperties/index.js.map +0 -1
@@ -1,69 +0,0 @@
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 test_data_1 = require("../../../../lib/test-data");
8
- const index_1 = __importDefault(require("../../index"));
9
- const nock_1 = __importDefault(require("nock"));
10
- const testDestination = actions_core_1.createTestIntegration(index_1.default);
11
- const actionSlug = 'identifyUser';
12
- const destinationSlug = 'Mixpanel';
13
- const seedName = `${destinationSlug}#${actionSlug}`;
14
- describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
15
- it('required fields', async () => {
16
- const action = index_1.default.actions[actionSlug];
17
- const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
18
- nock_1.default(/.*/).persist().get(/.*/).reply(200);
19
- nock_1.default(/.*/).persist().post(/.*/).reply(200);
20
- nock_1.default(/.*/).persist().put(/.*/).reply(200);
21
- const event = actions_core_1.createTestEvent({
22
- properties: eventData
23
- });
24
- const responses = await testDestination.testAction(actionSlug, {
25
- event: event,
26
- mapping: event.properties,
27
- settings: settingsData,
28
- auth: undefined
29
- });
30
- const request = responses[0].request;
31
- const rawBody = await request.text();
32
- try {
33
- const json = JSON.parse(rawBody);
34
- expect(json).toMatchSnapshot();
35
- return;
36
- }
37
- catch (err) {
38
- expect(rawBody).toMatchSnapshot();
39
- }
40
- expect(request.headers).toMatchSnapshot();
41
- });
42
- it('all fields', async () => {
43
- const action = index_1.default.actions[actionSlug];
44
- const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
45
- nock_1.default(/.*/).persist().get(/.*/).reply(200);
46
- nock_1.default(/.*/).persist().post(/.*/).reply(200);
47
- nock_1.default(/.*/).persist().put(/.*/).reply(200);
48
- const event = actions_core_1.createTestEvent({
49
- properties: eventData
50
- });
51
- const responses = await testDestination.testAction(actionSlug, {
52
- event: event,
53
- mapping: event.properties,
54
- settings: settingsData,
55
- auth: undefined
56
- });
57
- const request = responses[0].request;
58
- const rawBody = await request.text();
59
- try {
60
- const json = JSON.parse(rawBody);
61
- expect(json).toMatchSnapshot();
62
- return;
63
- }
64
- catch (err) {
65
- expect(rawBody).toMatchSnapshot();
66
- }
67
- });
68
- });
69
- //# sourceMappingURL=snapshot.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/mixpanel/incrementProperties/__test__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA8E;AAC9E,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,cAAc,CAAA;AACjC,MAAM,eAAe,GAAG,UA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AI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAChC,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;YAC9B,OAAM;SACP;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAA;SAClC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- export interface Payload {
2
- ip?: string;
3
- user_id?: string | null;
4
- anonymous_id?: string | null;
5
- increment: {
6
- [k: string]: unknown;
7
- };
8
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/incrementProperties/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
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;
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
4
- const utils_1 = require("../common/utils");
5
- const action = {
6
- title: 'Increment Properties',
7
- description: 'Increment the value of a user profile property. [Learn More](https://developer.mixpanel.com/reference/profile-numerical-add).',
8
- defaultSubscription: 'type = "track"',
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
- user_id: {
19
- label: 'User ID',
20
- type: 'string',
21
- allowNull: true,
22
- description: 'The unique user identifier set by you',
23
- default: {
24
- '@path': '$.userId'
25
- }
26
- },
27
- anonymous_id: {
28
- label: 'Anonymous ID',
29
- type: 'string',
30
- allowNull: true,
31
- description: 'The generated anonymous ID for the user',
32
- default: {
33
- '@path': '$.anonymousId'
34
- }
35
- },
36
- increment: {
37
- label: 'Increment Numerical Properties',
38
- type: 'object',
39
- description: 'Object of properties and the values to increment or decrement. For example: `{"purchases": 1, "items": 6}}.',
40
- multiple: false,
41
- required: true,
42
- defaultObjectUI: 'keyvalue',
43
- default: {
44
- '@path': '$.properties.increment'
45
- }
46
- }
47
- },
48
- perform: async (request, { payload, settings }) => {
49
- if (!settings.projectToken) {
50
- throw new actions_core_1.IntegrationError('Missing project token', 'Missing required field', 400);
51
- }
52
- const apiServerUrl = utils_1.getApiServerUrl(settings.apiRegion);
53
- const responses = [];
54
- if (payload.increment && Object.keys(payload.increment).length > 0) {
55
- const keys = Object.keys(payload.increment);
56
- if (keys.length > 20) {
57
- throw new actions_core_1.PayloadValidationError('Exceeded maximum of 20 properties for increment call');
58
- }
59
- const data = {
60
- $token: settings.projectToken,
61
- $distinct_id: payload.user_id ?? payload.anonymous_id,
62
- $ip: payload.ip
63
- };
64
- data.$add = {};
65
- for (const key of keys) {
66
- const value = payload.increment[key];
67
- if (typeof value === 'string' || typeof value === 'number') {
68
- if (isNaN(+value)) {
69
- throw new actions_core_1.IntegrationError(`The key "${key}" was not numeric`, 'Non numeric increment value', 400);
70
- }
71
- data.$add[key] = +value;
72
- }
73
- }
74
- const response = request(`${apiServerUrl}/engage`, {
75
- method: 'post',
76
- body: new URLSearchParams({ data: JSON.stringify(data) })
77
- });
78
- responses.push(response);
79
- }
80
- return Promise.all(responses);
81
- }
82
- };
83
- exports.default = action;
84
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/mixpanel/incrementProperties/index.ts"],"names":[],"mappings":";;AAAA,wDAAkG;AAGlG,2CAAiD;AAGjD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,+HAA+H;IACjI,mBAAmB,EAAE,gBA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