@segment/action-destinations 3.50.2-alpha.1 → 3.51.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 (55) hide show
  1. package/dist/destinations/adobe-target/adobeTarget_operations.js +1 -2
  2. package/dist/destinations/adobe-target/adobeTarget_operations.js.map +1 -1
  3. package/dist/destinations/close/createUpdateContactAndLead/generated-types.d.ts +4 -0
  4. package/dist/destinations/close/createUpdateContactAndLead/index.js +31 -8
  5. package/dist/destinations/close/createUpdateContactAndLead/index.js.map +1 -1
  6. package/dist/destinations/close/generated-types.d.ts +1 -0
  7. package/dist/destinations/close/index.js +13 -0
  8. package/dist/destinations/close/index.js.map +1 -1
  9. package/dist/destinations/index.js +1 -0
  10. package/dist/destinations/index.js.map +1 -1
  11. package/dist/destinations/moengage/generated-types.d.ts +5 -0
  12. package/dist/destinations/moengage/generated-types.js +3 -0
  13. package/dist/destinations/moengage/generated-types.js.map +1 -0
  14. package/dist/destinations/moengage/identifyUser/generated-types.d.ts +12 -0
  15. package/dist/destinations/moengage/identifyUser/generated-types.js +3 -0
  16. package/dist/destinations/moengage/identifyUser/generated-types.js.map +1 -0
  17. package/dist/destinations/moengage/identifyUser/index.d.ts +5 -0
  18. package/dist/destinations/moengage/identifyUser/index.js +105 -0
  19. package/dist/destinations/moengage/identifyUser/index.js.map +1 -0
  20. package/dist/destinations/moengage/index.d.ts +4 -0
  21. package/dist/destinations/moengage/index.js +67 -0
  22. package/dist/destinations/moengage/index.js.map +1 -0
  23. package/dist/destinations/moengage/regional-endpoints.d.ts +7 -0
  24. package/dist/destinations/moengage/regional-endpoints.js +14 -0
  25. package/dist/destinations/moengage/regional-endpoints.js.map +1 -0
  26. package/dist/destinations/moengage/trackEvent/generated-types.d.ts +13 -0
  27. package/dist/destinations/moengage/trackEvent/generated-types.js +3 -0
  28. package/dist/destinations/moengage/trackEvent/generated-types.js.map +1 -0
  29. package/dist/destinations/moengage/trackEvent/index.d.ts +5 -0
  30. package/dist/destinations/moengage/trackEvent/index.js +113 -0
  31. package/dist/destinations/moengage/trackEvent/index.js.map +1 -0
  32. package/dist/destinations/salesforce/case/generated-types.d.ts +10 -0
  33. package/dist/destinations/salesforce/case/generated-types.js +3 -0
  34. package/dist/destinations/salesforce/case/generated-types.js.map +1 -0
  35. package/dist/destinations/salesforce/case/index.d.ts +5 -0
  36. package/dist/destinations/salesforce/case/index.js +36 -0
  37. package/dist/destinations/salesforce/case/index.js.map +1 -0
  38. package/dist/destinations/salesforce/cases.types.d.ts +10 -0
  39. package/dist/destinations/salesforce/cases.types.js +3 -0
  40. package/dist/destinations/salesforce/cases.types.js.map +1 -0
  41. package/dist/destinations/salesforce/index.js +3 -1
  42. package/dist/destinations/salesforce/index.js.map +1 -1
  43. package/dist/destinations/salesforce/sf-object-to-shape.js +9 -1
  44. package/dist/destinations/salesforce/sf-object-to-shape.js.map +1 -1
  45. package/dist/destinations/salesforce/sf-types.d.ts +6 -2
  46. package/dist/destinations/tiktok-conversions/generated-types.d.ts +1 -1
  47. package/dist/destinations/tiktok-conversions/index.js +75 -21
  48. package/dist/destinations/tiktok-conversions/index.js.map +1 -1
  49. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
  50. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +9 -3
  51. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
  52. package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +17 -6
  53. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +123 -28
  54. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
  55. package/package.json +2 -2
@@ -32,9 +32,8 @@ class AdobeTarget {
32
32
  }
33
33
  };
34
34
  this.lookupProfile = async (userId, clientCode) => {
35
- const requestUrl = `https://${clientCode}.tt.omtrdc.net/rest/v1/profiles/thirdPartyId/${userId}?client=${clientCode}`;
36
35
  try {
37
- await this.request(requestUrl, { method: 'get' });
36
+ await this.request(`https://${clientCode}.tt.omtrdc.net/rest/v1/profiles/thirdPartyId/${userId}?client=${clientCode}`, { method: 'get' });
38
37
  }
39
38
  catch (error) {
40
39
  return new actions_core_1.IntegrationError('No profile found in Adobe Target with this mbox3rdPartyId', 'Profile not found', 404);
@@ -1 +1 @@
1
- {"version":3,"file":"adobeTarget_operations.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/adobeTarget_operations.ts"],"names":[],"mappings":";;AAAA,wDAAuE;AAEvE,SAAS,gBAAgB,CAAC,GAAyB,EAAE,UAAU,GAAG,EAAE,EAAE,aAAsC,EAAE;IAC5G,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAChE,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;YAC5C,UAAU,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;SACjD;aAAM;YACL,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,CAAA;SACvD;IACH,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC;AACD,MAAM,mBAAmB,GAAG,CAAC,MAAmD,EAAE,EAAE,CAClF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;KAChB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;KACxD,IAAI,CAAC,GAAG,CAAC,CAAA;AAEd,MAAqB,WAAW;IAM9B,YAAY,MAAc,EAAE,UAAkB,EAAE,MAAc,EAAE,O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,CAAA;gBAC5C,MAAM,UAAU,GAAG,WAAW,IAAI,CAAC,UAAU,qBAC3C,IAAI,CAAC,UACP,kCAAkC,IAAI,CAAC,MAAM,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAA;gBAE9E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;oBAC9B,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;QACH,CAAC,CAAA;QAEO,kBAAa,GAAG,KAAK,EAAE,MAAc,EAAE,UAAkB,EAAyC,EAAE;YAC1G,IAAI;gBACF,MAAM,IAAI,CAAC,OAAO,CAChB,WAAW,UAAU,gDAAgD,MAAM,WAAW,UAAU,EAAE,EAClG,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,IAAI,+BAAgB,CAAC,2DAA2D,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;aACnH;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA;QAjCC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CA8BF;AAzCD,8BAyCC"}
@@ -1,5 +1,9 @@
1
1
  export interface Payload {
2
2
  lead_name?: string;
3
+ lead_external_id?: string;
4
+ lead_custom_fields?: {
5
+ [k: string]: unknown;
6
+ };
3
7
  contact_name?: string;
4
8
  contact_email?: string;
5
9
  contact_phone?: string;
@@ -2,21 +2,43 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const action = {
4
4
  title: 'Create or Update Contact and Lead',
5
- description: '',
5
+ description: 'Create or Update Contact and/or Lead. At first Close will try to find ' +
6
+ 'Lead via Lead Company ID. If Lead is not found, Close will try to find ' +
7
+ 'a Contact either via Contact User ID or via Contact Email. If Contact is ' +
8
+ 'not found, Close will create a new Lead and Contact. It will also create ' +
9
+ 'a new Lead and Contact if Contact is found but exists under a Lead with ' +
10
+ 'different Lead Company ID. In case that Close finds find multiple ' +
11
+ 'Contacts with the same Contact User ID or Contact Email, Close will ' +
12
+ 'update up to 10 Contacts, ordered by creation date.',
6
13
  defaultSubscription: 'type = "identify"',
7
14
  fields: {
8
15
  lead_name: {
9
16
  label: 'Lead Name',
10
- description: '',
17
+ description: 'The name of the Lead.',
11
18
  type: 'string',
12
19
  required: false,
13
20
  default: {
14
21
  '@path': '$.traits.company.name'
15
22
  }
16
23
  },
24
+ lead_external_id: {
25
+ label: 'Lead Company ID',
26
+ description: 'Your ID that identifies the Lead. Lead Custom Field ID for Company must be defined in the global integration settings.',
27
+ type: 'string',
28
+ required: false,
29
+ default: {
30
+ '@path': '$.traits.company.id'
31
+ }
32
+ },
33
+ lead_custom_fields: {
34
+ label: 'Lead Custom Fields',
35
+ description: 'Custom Fields to set on the Lead. Key should be Custom Field ID (`cf_xxxx`).',
36
+ type: 'object',
37
+ required: false
38
+ },
17
39
  contact_name: {
18
40
  label: 'Contact Name',
19
- description: '',
41
+ description: 'The name of the Contact.',
20
42
  type: 'string',
21
43
  required: false,
22
44
  default: {
@@ -25,7 +47,7 @@ const action = {
25
47
  },
26
48
  contact_email: {
27
49
  label: 'Contact Email',
28
- description: '',
50
+ description: 'Can be used for looking up the Contact. If the Contact already has different email address, this value will be appended.',
29
51
  type: 'string',
30
52
  required: false,
31
53
  default: {
@@ -34,7 +56,7 @@ const action = {
34
56
  },
35
57
  contact_phone: {
36
58
  label: 'Contact Phone',
37
- description: '',
59
+ description: 'If the Contact already has different phone number, this value will be appended.',
38
60
  type: 'string',
39
61
  required: false,
40
62
  default: {
@@ -43,7 +65,7 @@ const action = {
43
65
  },
44
66
  contact_url: {
45
67
  label: 'Contact URL',
46
- description: '',
68
+ description: 'If the Contact already has different URL, this value will be appended.',
47
69
  type: 'string',
48
70
  required: false,
49
71
  default: {
@@ -52,7 +74,7 @@ const action = {
52
74
  },
53
75
  contact_title: {
54
76
  label: 'Contact Title',
55
- description: '',
77
+ description: 'The title of the Contact.',
56
78
  type: 'string',
57
79
  required: false,
58
80
  default: {
@@ -77,7 +99,8 @@ const action = {
77
99
  },
78
100
  perform: (request, data) => {
79
101
  const settings = {
80
- contact_custom_field_id_for_user_id: data.settings.contact_custom_field_id_for_user_id
102
+ contact_custom_field_id_for_user_id: data.settings.contact_custom_field_id_for_user_id,
103
+ lead_custom_field_id_for_company_id: data.settings.lead_custom_field_id_for_company_id
81
104
  };
82
105
  return request('https://services.close.com/webhooks/segment/actions/create-update-contact-and-lead/', {
83
106
  method: 'post',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/close/createUpdateContactAndLead/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EAAE,EAAE;IACf,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,8HAA8H;YAChI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,QAAQ,GAAG;YACf,mCAAmC,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAmC;SACvF,CAAA;QACD,OAAO,OAAO,CAAC,qFAAqF,EAAE;YACpG,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;SACjD,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/close/createUpdateContactAndLead/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,wEAAwE;Q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d,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,8HAA8H;YAChI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,QAAQ,GAAG;YACf,mCAAmC,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAmC;YACtF,mCAAmC,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAmC;SACvF,CAAA;QACD,OAAO,OAAO,CAAC,qFAAqF,EAAE;YACpG,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;SACjD,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export interface Settings {
2
2
  api_key: string;
3
+ lead_custom_field_id_for_company_id?: string;
3
4
  contact_custom_field_id_for_user_id?: string;
4
5
  }
@@ -17,6 +17,19 @@ const destination = {
17
17
  type: 'string',
18
18
  required: true
19
19
  },
20
+ lead_custom_field_id_for_company_id: {
21
+ label: 'Lead Custom Field ID for Company ID',
22
+ description: "Enter the ID of a Lead Custom Field that'll be " +
23
+ "used to store Company ID. You'll need to create this Lead " +
24
+ 'Custom Field in Close first, and then the integration will use ' +
25
+ 'this field to store the Company ID when creating new contacts, ' +
26
+ 'and/or will be used as a lookup key when updating existing ' +
27
+ 'Lead. If this field is not filled out, it will only ' +
28
+ "lookup and de-dupe based on Contact's email.",
29
+ type: 'string',
30
+ default: '',
31
+ required: false
32
+ },
20
33
  contact_custom_field_id_for_user_id: {
21
34
  label: 'Contact Custom Field ID for User ID',
22
35
  description: "Enter the ID of a Contact Custom Field that'll be " +
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/close/index.ts"],"names":[],"mappings":";;;;;AAGA,8FAAqE;AAErE,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,oDAAoD;oBACpD,4DAA4D;oBAC5D,iEAAiE;oBACjE,8DAA8D;oBAC9D,6DAA6D;oBAC7D,0DAA0D;oBAC1D,oCAAoC;gBACtC,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,kCAAkC,CAAC,CAAA;QACpD,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,QAAQ,EAAE,EAAE;SACb,CAAA;IACH,CAAC;IAQD,OAAO,EAAE;QACP,0BAA0B,EAA1B,oCAA0B;KAC3B;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/close/index.ts"],"names":[],"mappings":";;;;;AAGA,8FAAqE;AAErE,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,iDAAiD;oBACjD,4DAA4D;oBAC5D,iEAAiE;oBACjE,iEAAiE;oBACjE,6DAA6D;oBAC7D,sDAAsD;oBACtD,8CAA8C;gBAChD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;aAChB;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,oDAAoD;oBACpD,4DAA4D;oBAC5D,iEAAiE;oBACjE,8DAA8D;oBAC9D,6DAA6D;oBAC7D,0DAA0D;oBAC1D,oCAAoC;gBACtC,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,kCAAkC,CAAC,CAAA;QACpD,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,QAAQ,EAAE,EAAE;SACb,CAAA;IACH,CAAC;IAQD,OAAO,EAAE;QACP,0BAA0B,EAA1B,oCAA0B;KAC3B;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -42,6 +42,7 @@ register('60ad61f9ff47a16b8fb7b5d9', './google-analytics-4');
42
42
  register('60ae8b97dcb6cc52d5d0d5ab', './google-enhanced-conversions');
43
43
  register('615c7438d93d9b61b1e9e192', './mixpanel');
44
44
  register('61a8032ea5f157ee37a720be', './metronome');
45
+ register('620feaa207e70f6c6a765ff7', './moengage');
45
46
  register('6101bf0e15772f7e12407fa9', './personas-messaging-sendgrid');
46
47
  register('6116a41e2e8fc680d8daf821', './personas-messaging-twilio');
47
48
  register('5f7dd8191ad74f868ab1fc48', './pipedrive');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAAmD;AACnD,gDAAuB;AAWV,QAAA,YAAY,GAA0C,EAAE,CAAA;AACxD,QAAA,QAAQ,GAAsC,EAAE,CAAA;AAU7D,QAAQ,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;AAChD,QAAQ,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAA;AACtD,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAA;AACjD,QAAQ,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAA;AACpD,QAAQ,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAAA;AAClE,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,CAAA;AACnE,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA;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AEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ api_id: string;
3
+ api_key: string;
4
+ region: 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/destinations/moengage/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export interface Payload {
2
+ type: string;
3
+ user_id?: string | null;
4
+ anonymous_id?: string | null;
5
+ os_name?: string;
6
+ app_version?: string;
7
+ library_version?: string;
8
+ timestamp?: string | number;
9
+ traits?: {
10
+ [k: string]: unknown;
11
+ };
12
+ }
@@ -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/moengage/identifyUser/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,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const regional_endpoints_1 = require("../regional-endpoints");
5
+ const action = {
6
+ title: 'Identify User',
7
+ description: 'Set the user ID for a particular device ID or update user properties.',
8
+ defaultSubscription: 'type = "identify"',
9
+ fields: {
10
+ type: {
11
+ label: 'Event type',
12
+ type: 'string',
13
+ description: 'The type of the event being performed.',
14
+ required: true,
15
+ default: {
16
+ '@path': '$.type'
17
+ }
18
+ },
19
+ user_id: {
20
+ label: 'User ID',
21
+ type: 'string',
22
+ allowNull: true,
23
+ description: 'The unique user identifier set by you',
24
+ default: {
25
+ '@path': '$.userId'
26
+ }
27
+ },
28
+ anonymous_id: {
29
+ label: 'Anonymous ID',
30
+ type: 'string',
31
+ allowNull: true,
32
+ description: 'The generated anonymous ID for the user',
33
+ default: {
34
+ '@path': '$.anonymousId'
35
+ }
36
+ },
37
+ os_name: {
38
+ label: 'OS Name',
39
+ type: 'string',
40
+ description: 'The name of the mobile operating system or browser that the user is using.',
41
+ default: {
42
+ '@path': '$.context.os.name'
43
+ }
44
+ },
45
+ app_version: {
46
+ label: 'APP Version',
47
+ type: 'string',
48
+ description: 'The version of the mobile operating system or browser the user is using.',
49
+ default: {
50
+ '@path': '$.context.app.version'
51
+ }
52
+ },
53
+ library_version: {
54
+ label: 'Library Version',
55
+ type: 'string',
56
+ description: 'The version of the mobile operating system or browser the user is using.',
57
+ default: {
58
+ '@path': '$.context.library.version'
59
+ }
60
+ },
61
+ timestamp: {
62
+ label: 'Timestamp',
63
+ type: 'datetime',
64
+ description: 'The timestamp of the event. If time is not sent with the event, it will be set to the time our servers receive it.',
65
+ default: {
66
+ '@path': '$.timestamp'
67
+ }
68
+ },
69
+ traits: {
70
+ label: 'User Properties',
71
+ type: 'object',
72
+ description: 'Properties to set on the user profile',
73
+ default: {
74
+ '@path': '$.traits'
75
+ }
76
+ }
77
+ },
78
+ perform: async (request, { payload, settings }) => {
79
+ if (!settings.api_id || !settings.api_key) {
80
+ throw new actions_core_1.IntegrationError('Missing API ID or API KEY', 'Missing required field', 400);
81
+ }
82
+ const event = {
83
+ type: payload.type,
84
+ user_id: payload.user_id,
85
+ traits: payload.traits,
86
+ context: {
87
+ app: { version: payload.app_version },
88
+ os: { name: payload.os_name },
89
+ library: { version: payload.library_version }
90
+ },
91
+ anonymous_id: payload.anonymous_id,
92
+ timestamp: payload.timestamp
93
+ };
94
+ const endpoint = regional_endpoints_1.getEndpointByRegion(settings.region);
95
+ return request(`${endpoint}/v1/integrations/segment?appId=${settings.api_id}`, {
96
+ method: 'post',
97
+ json: event,
98
+ headers: {
99
+ authorization: `Basic ${Buffer.from(`${settings.api_id}:${settings.api_key}`).toString('base64')}`
100
+ }
101
+ });
102
+ }
103
+ };
104
+ exports.default = action;
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moengage/identifyUser/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAE1E,8DAA2D;AAG3D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,uEAAuE;IACpF,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;aAClB;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4EAA4E;YACzF,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,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AC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAErD,OAAO,OAAO,CAAC,GAAG,QAAQ,kCAAkC,QAAQ,CAAC,MAAM,EAAE,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aACnG;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,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,67 @@
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 trackEvent_1 = __importDefault(require("./trackEvent"));
7
+ const identifyUser_1 = __importDefault(require("./identifyUser"));
8
+ const regional_endpoints_1 = require("./regional-endpoints");
9
+ const destination = {
10
+ name: 'Moengage (Actions)',
11
+ slug: 'actions-moengage',
12
+ mode: 'cloud',
13
+ authentication: {
14
+ scheme: 'custom',
15
+ fields: {
16
+ api_id: {
17
+ label: 'Api Id',
18
+ description: 'Your Moengage API Id',
19
+ type: 'string',
20
+ required: true
21
+ },
22
+ api_key: {
23
+ label: 'Api Key',
24
+ description: 'Your Moengage API Key',
25
+ type: 'string',
26
+ required: true
27
+ },
28
+ region: {
29
+ label: 'Endpoint Region',
30
+ description: 'The region to send your data.',
31
+ type: 'string',
32
+ format: 'text',
33
+ required: true,
34
+ choices: [
35
+ {
36
+ label: 'DataCenter-01',
37
+ value: 'DC_01'
38
+ },
39
+ {
40
+ label: 'DataCenter-02',
41
+ value: 'DC_02'
42
+ },
43
+ {
44
+ label: 'DataCenter-03',
45
+ value: 'DC_03'
46
+ }
47
+ ],
48
+ default: 'DC_01'
49
+ }
50
+ },
51
+ testAuthentication: (request, { settings }) => {
52
+ const endpoint = regional_endpoints_1.getEndpointByRegion(settings.region);
53
+ return request(`${endpoint}/v1/integrations/segment/auth?appId=${settings.api_id}`, {
54
+ method: 'get',
55
+ headers: {
56
+ authorization: `Basic ${Buffer.from(`${settings.api_id}:${settings.api_key}`).toString('base64')}`
57
+ }
58
+ });
59
+ }
60
+ },
61
+ actions: {
62
+ trackEvent: trackEvent_1.default,
63
+ identifyUser: identifyUser_1.default
64
+ }
65
+ };
66
+ exports.default = destination;
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/moengage/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqC;AACrC,kEAAyC;AACzC,6DAA0D;AAE1D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,OAAO;qBACf;iBACF;gBACD,OAAO,EAAE,OAAO;aACjB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,MAAM,QAAQ,GAAG,wCAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACrD,OAAO,OAAO,CAAC,GAAG,QAAQ,uCAAuC,QAAQ,CAAC,MAAM,EAAE,EAAE;gBAClF,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACnG;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IAED,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,7 @@
1
+ export declare const endpoints: {
2
+ DC_01: string;
3
+ DC_02: string;
4
+ DC_03: string;
5
+ };
6
+ export declare function getEndpointByRegion(region?: string): string;
7
+ export default endpoints;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEndpointByRegion = exports.endpoints = void 0;
4
+ exports.endpoints = {
5
+ DC_01: 'https://api-01.moengage.com',
6
+ DC_02: 'https://api-02.moengage.com',
7
+ DC_03: 'https://api-03.moengage.com'
8
+ };
9
+ function getEndpointByRegion(region) {
10
+ return exports.endpoints[region] ?? exports.endpoints['DC_01'];
11
+ }
12
+ exports.getEndpointByRegion = getEndpointByRegion;
13
+ exports.default = exports.endpoints;
14
+ //# sourceMappingURL=regional-endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regional-endpoints.js","sourceRoot":"","sources":["../../../src/destinations/moengage/regional-endpoints.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,6BAA6B;IACpC,KAAK,EAAE,6BAA6B;IACpC,KAAK,EAAE,6BAA6B;CACrC,CAAA;AAWD,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO,iBAAS,CAAC,MAAgB,CAAC,IAAI,iBAAS,CAAC,OAAO,CAAC,CAAA;AAC1D,CAAC;AAFD,kDAEC;AAED,kBAAe,iBAAS,CAAA"}
@@ -0,0 +1,13 @@
1
+ export interface Payload {
2
+ type: string;
3
+ event: string;
4
+ user_id?: string;
5
+ anonymous_id?: string;
6
+ os_name?: string;
7
+ app_version?: string;
8
+ library_version?: string;
9
+ timestamp?: string | number;
10
+ properties?: {
11
+ [k: string]: unknown;
12
+ };
13
+ }
@@ -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/moengage/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;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const regional_endpoints_1 = require("../regional-endpoints");
5
+ const action = {
6
+ title: 'Track Event',
7
+ description: 'Send an event to Moengage.',
8
+ defaultSubscription: 'type = "track"',
9
+ fields: {
10
+ type: {
11
+ label: 'Event type',
12
+ type: 'string',
13
+ description: 'The type of the event being performed.',
14
+ required: true,
15
+ default: {
16
+ '@path': '$.type'
17
+ }
18
+ },
19
+ event: {
20
+ label: 'Event Name',
21
+ type: 'string',
22
+ description: 'The name of the event being performed.',
23
+ required: true,
24
+ default: {
25
+ '@path': '$.event'
26
+ }
27
+ },
28
+ user_id: {
29
+ label: 'User ID',
30
+ type: 'string',
31
+ description: 'The unique identifier of the user.',
32
+ default: {
33
+ '@path': '$.user_id'
34
+ }
35
+ },
36
+ anonymous_id: {
37
+ label: 'Anonymous ID',
38
+ type: 'string',
39
+ description: 'The unique identifier of the anonymous user.',
40
+ default: {
41
+ '@path': '$.anonymous_id'
42
+ }
43
+ },
44
+ os_name: {
45
+ label: 'OS Name',
46
+ type: 'string',
47
+ description: 'The name of the mobile operating system or browser that the user is using.',
48
+ default: {
49
+ '@path': '$.context.os.name'
50
+ }
51
+ },
52
+ app_version: {
53
+ label: 'APP Version',
54
+ type: 'string',
55
+ description: 'The version of the mobile operating system or browser the user is using.',
56
+ default: {
57
+ '@path': '$.context.app.version'
58
+ }
59
+ },
60
+ library_version: {
61
+ label: 'Library Version',
62
+ type: 'string',
63
+ description: 'The version of the mobile operating system or browser the user is using.',
64
+ default: {
65
+ '@path': '$.context.library.version'
66
+ }
67
+ },
68
+ timestamp: {
69
+ label: 'Timestamp',
70
+ type: 'datetime',
71
+ description: 'The timestamp of the event. If time is not sent with the event, it will be set to the time our servers receive it.',
72
+ default: {
73
+ '@path': '$.timestamp'
74
+ }
75
+ },
76
+ properties: {
77
+ label: 'Event Properties',
78
+ type: 'object',
79
+ description: 'An object of key-value pairs that represent event properties to be sent along with the event.',
80
+ default: {
81
+ '@path': '$.properties'
82
+ }
83
+ }
84
+ },
85
+ perform: async (request, { payload, settings }) => {
86
+ if (!settings.api_id || !settings.api_key) {
87
+ throw new actions_core_1.IntegrationError('Missing API ID or API KEY', 'Missing required field', 400);
88
+ }
89
+ const event = {
90
+ type: payload.type,
91
+ user_id: payload.user_id,
92
+ anonymous_id: payload.anonymous_id,
93
+ event: payload.event,
94
+ context: {
95
+ app: { version: payload.app_version },
96
+ os: { name: payload.os_name },
97
+ library: { version: payload.library_version }
98
+ },
99
+ properties: payload.properties,
100
+ timestamp: payload.timestamp
101
+ };
102
+ const endpoint = regional_endpoints_1.getEndpointByRegion(settings.region);
103
+ return request(`${endpoint}/v1/integrations/segment?appId=${settings.api_id}`, {
104
+ method: 'post',
105
+ json: event,
106
+ headers: {
107
+ authorization: `Basic ${Buffer.from(`${settings.api_id}:${settings.api_key}`).toString('base64')}`
108
+ }
109
+ });
110
+ }
111
+ };
112
+ exports.default = action;
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moengage/trackEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,8DAA2D;AAE3D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;aAClB;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oCAAoC;YACjD,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8CAA8C;YAC3D,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1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BACrC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE;gBAC7B,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,EAAE;aAC9C;YACD,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAA;QAED,MAAM,QAAQ,GAAG,wCAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAErD,OAAO,OAAO,CAAC,GAAG,QAAQ,kCAAkC,QAAQ,CAAC,MAAM,EAAE,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aACnG;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ operation: string;
3
+ traits?: {
4
+ [k: string]: unknown;
5
+ };
6
+ description?: string;
7
+ customFields?: {
8
+ [k: string]: unknown;
9
+ };
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/destinations/salesforce/case/generated-types.ts"],"names":[],"mappings":""}