@segment/action-destinations 3.162.1-staging.64 → 3.163.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 (96) hide show
  1. package/dist/destinations/engage-messaging-twilio/index.js +1 -3
  2. package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
  3. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
  4. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +1 -1
  5. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
  6. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -1
  7. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
  8. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +16 -18
  9. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +1 -1
  10. package/dist/destinations/facebook-conversions-api/addToCart/index.js +46 -2
  11. package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +1 -1
  12. package/dist/destinations/facebook-conversions-api/index.js +1 -1
  13. package/dist/destinations/facebook-conversions-api/index.js.map +1 -1
  14. package/dist/destinations/google-enhanced-conversions/functions.d.ts +1 -1
  15. package/dist/destinations/google-enhanced-conversions/functions.js +2 -3
  16. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
  17. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +2 -2
  18. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  19. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +5 -5
  20. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  21. package/dist/destinations/google-sheets-dev/index.js +3 -10
  22. package/dist/destinations/google-sheets-dev/index.js.map +1 -1
  23. package/dist/destinations/index.js +2 -0
  24. package/dist/destinations/index.js.map +1 -1
  25. package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +9 -0
  26. package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +1 -0
  27. package/dist/destinations/liveramp-audiences/audienceEntered/index.js +54 -0
  28. package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -0
  29. package/dist/destinations/liveramp-audiences/audienceEntered/operations.d.ts +6 -0
  30. package/dist/destinations/liveramp-audiences/audienceEntered/operations.js +42 -0
  31. package/dist/destinations/liveramp-audiences/audienceEntered/operations.js.map +1 -0
  32. package/dist/destinations/liveramp-audiences/generated-types.d.ts +10 -0
  33. package/dist/destinations/{engage-messaging-twilio/utils/types.js → liveramp-audiences/generated-types.js} +1 -1
  34. package/dist/destinations/liveramp-audiences/generated-types.js.map +1 -0
  35. package/dist/destinations/liveramp-audiences/index.d.ts +4 -0
  36. package/dist/destinations/liveramp-audiences/index.js +69 -0
  37. package/dist/destinations/liveramp-audiences/index.js.map +1 -0
  38. package/dist/destinations/liveramp-audiences/s3.d.ts +5 -0
  39. package/dist/destinations/liveramp-audiences/s3.js +37 -0
  40. package/dist/destinations/liveramp-audiences/s3.js.map +1 -0
  41. package/dist/destinations/revx/generated-types.d.ts +3 -0
  42. package/dist/destinations/revx/generated-types.js +3 -0
  43. package/dist/destinations/revx/generated-types.js.map +1 -0
  44. package/dist/destinations/revx/index.d.ts +4 -0
  45. package/dist/destinations/revx/index.js +36 -0
  46. package/dist/destinations/revx/index.js.map +1 -0
  47. package/dist/destinations/revx/sendRevxPing/generated-types.d.ts +41 -0
  48. package/dist/destinations/revx/sendRevxPing/generated-types.js +3 -0
  49. package/dist/destinations/revx/sendRevxPing/generated-types.js.map +1 -0
  50. package/dist/destinations/revx/sendRevxPing/index.d.ts +5 -0
  51. package/dist/destinations/revx/sendRevxPing/index.js +268 -0
  52. package/dist/destinations/revx/sendRevxPing/index.js.map +1 -0
  53. package/dist/destinations/segment-profiles/generated-types.d.ts +0 -1
  54. package/dist/destinations/segment-profiles/helperFunctions.d.ts +0 -7
  55. package/dist/destinations/segment-profiles/helperFunctions.js +1 -45
  56. package/dist/destinations/segment-profiles/helperFunctions.js.map +1 -1
  57. package/dist/destinations/segment-profiles/index.js +0 -14
  58. package/dist/destinations/segment-profiles/index.js.map +1 -1
  59. package/dist/destinations/segment-profiles/properties.js +10 -1
  60. package/dist/destinations/segment-profiles/properties.js.map +1 -1
  61. package/dist/destinations/segment-profiles/sendGroup/index.js +0 -8
  62. package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
  63. package/dist/destinations/segment-profiles/sendIdentify/index.js +0 -8
  64. package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
  65. package/dist/destinations/usermaven/common-definitions.js +1 -1
  66. package/dist/destinations/usermaven/group/generated-types.d.ts +1 -1
  67. package/dist/destinations/usermaven/identify/generated-types.d.ts +1 -1
  68. package/dist/destinations/usermaven/index.js +9 -1
  69. package/dist/destinations/usermaven/index.js.map +1 -1
  70. package/dist/destinations/usermaven/page/generated-types.d.ts +31 -0
  71. package/dist/destinations/usermaven/page/generated-types.js +3 -0
  72. package/dist/destinations/usermaven/page/generated-types.js.map +1 -0
  73. package/dist/destinations/usermaven/page/index.d.ts +5 -0
  74. package/dist/destinations/usermaven/page/index.js +58 -0
  75. package/dist/destinations/usermaven/page/index.js.map +1 -0
  76. package/dist/destinations/usermaven/request-params.js +12 -8
  77. package/dist/destinations/usermaven/request-params.js.map +1 -1
  78. package/dist/destinations/usermaven/track/generated-types.d.ts +1 -1
  79. package/dist/lib/AWS/s3.d.ts +4 -0
  80. package/dist/lib/AWS/s3.js +21 -0
  81. package/dist/lib/AWS/s3.js.map +1 -0
  82. package/package.json +4 -4
  83. package/dist/destinations/engage-messaging-twilio/sendPush/generated-types.d.ts +0 -20
  84. package/dist/destinations/engage-messaging-twilio/sendPush/generated-types.js.map +0 -1
  85. package/dist/destinations/engage-messaging-twilio/sendPush/index.js +0 -125
  86. package/dist/destinations/engage-messaging-twilio/sendPush/index.js.map +0 -1
  87. package/dist/destinations/engage-messaging-twilio/sendPush/push-sender.d.ts +0 -17
  88. package/dist/destinations/engage-messaging-twilio/sendPush/push-sender.js +0 -147
  89. package/dist/destinations/engage-messaging-twilio/sendPush/push-sender.js.map +0 -1
  90. package/dist/destinations/engage-messaging-twilio/utils/content.d.ts +0 -2
  91. package/dist/destinations/engage-messaging-twilio/utils/content.js +0 -15
  92. package/dist/destinations/engage-messaging-twilio/utils/content.js.map +0 -1
  93. package/dist/destinations/engage-messaging-twilio/utils/types.d.ts +0 -10
  94. package/dist/destinations/engage-messaging-twilio/utils/types.js.map +0 -1
  95. /package/dist/destinations/{engage-messaging-twilio/sendPush → liveramp-audiences/audienceEntered}/generated-types.js +0 -0
  96. /package/dist/destinations/{engage-messaging-twilio/sendPush → liveramp-audiences/audienceEntered}/index.d.ts +0 -0
@@ -62,6 +62,7 @@ const resolveRequestPayload = (settings, payload) => {
62
62
  email: payload?.user_email,
63
63
  first_name: payload?.user_first_name,
64
64
  last_name: payload?.user_last_name,
65
+ created_at: payload?.user_created_at,
65
66
  custom: payload?.user_custom_attributes
66
67
  };
67
68
  delete properties.user_id;
@@ -70,12 +71,15 @@ const resolveRequestPayload = (settings, payload) => {
70
71
  delete properties.user_first_name;
71
72
  delete properties.user_last_name;
72
73
  delete properties.user_custom_attributes;
73
- properties.company = {
74
- id: payload?.company_id,
75
- name: payload?.company_name,
76
- created_at: payload?.company_created_at,
77
- custom: payload?.company_custom_attributes
78
- };
74
+ delete properties.user_created_at;
75
+ if (payload?.company_id) {
76
+ properties.company = {
77
+ id: payload?.company_id,
78
+ name: payload?.company_name,
79
+ created_at: payload?.company_created_at,
80
+ custom: payload?.company_custom_attributes
81
+ };
82
+ }
79
83
  delete properties.company_id;
80
84
  delete properties.company_name;
81
85
  delete properties.company_created_at;
@@ -88,8 +92,8 @@ const resolveRequestPayload = (settings, payload) => {
88
92
  const { email, created_at, ...eventAttributes } = payload.event_attributes;
89
93
  properties.event_attributes = eventAttributes;
90
94
  }
91
- if (payload?.company_custom_attributes) {
92
- const { name, created_at, ...customAttributes } = payload.company_custom_attributes;
95
+ if (payload?.company && payload?.company_custom_attributes) {
96
+ const { name, created_at, company_id, ...customAttributes } = payload.company_custom_attributes;
93
97
  properties.company.custom = customAttributes;
94
98
  }
95
99
  return properties;
@@ -1 +1 @@
1
- {"version":3,"file":"request-params.js","sourceRoot":"","sources":["../../../src/destinations/usermaven/request-params.ts"],"names":[],"mappings":";;;AAEA,iCAAmC;AAEnC,MAAM,UAAU,GAAG,8BAA8B,CAAA;AAgBjD,MAAM,oBAAoB,GAAG,CAAC,QAAkB,EAAE,WAAmB,EAAiB,EAAE;IACtF,OAAO;QACL,GAAG,EAAE,GAAG,UAAU,IAAI,WAAW,UAAU,QAAQ,CAAC,OAAO,EAAE;QAC7D,OAAO,EAAE;YACP,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAQM,MAAM,kBAAkB,GAAG,CAChC,QAAkB,EAClB,OAAiC,EACjC,SAAkB,EACH,EAAE;IACjB,MAAM,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;IAErE,OAAO;QACL,GAAG,cAAc;QACjB,OAAO,EAAE;YACP,GAAG,cAAc,CAAC,OAAO;YACzB,IAAI,EAAE;gBACJ,GAAG,OAAO;gBACV,UAAU,EAAE,SAAS,IAAI,OAAO,EAAE,UAAU;aAC7C;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAjBY,QAAA,kBAAkB,sBAiB9B;AAOM,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAE,OAA4B,EAAO,EAAE;IAC7F,MAAM,UAAU,GAAQ;QACtB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,EAAE,EAAE;QACP,YAAY,EAAE,OAAO;QACrB,GAAG,EAAE,mBAAmB;QACxB,GAAG,OAAO;KACX,CAAA;IAGD,IAAI,OAAO,CAAC,GAAG,EAAE;QACf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7FY,QAAA,qBAAqB,yBA6FjC"}
1
+ {"version":3,"file":"request-params.js","sourceRoot":"","sources":["../../../src/destinations/usermaven/request-params.ts"],"names":[],"mappings":";;;AAEA,iCAAmC;AAEnC,MAAM,UAAU,GAAG,8BAA8B,CAAA;AAgBjD,MAAM,oBAAoB,GAAG,CAAC,QAAkB,EAAE,WAAmB,EAAiB,EAAE;IACtF,OAAO;QACL,GAAG,EAAE,GAAG,UAAU,IAAI,WAAW,UAAU,QAAQ,CAAC,OAAO,EAAE;QAC7D,OAAO,EAAE;YACP,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAQM,MAAM,kBAAkB,GAAG,CAChC,QAAkB,EAClB,OAAiC,EACjC,SAAkB,EACH,EAAE;IACjB,MAAM,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;IAErE,OAAO;QACL,GAAG,cAAc;QACjB,OAAO,EAAE;YACP,GAAG,cAAc,CAAC,OAAO;YACzB,IAAI,EAAE;gBACJ,GAAG,OAAO;gBACV,UAAU,EAAE,SAAS,IAAI,OAAO,EAAE,UAAU;aAC7C;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAjBY,QAAA,kBAAkB,sBAiB9B;AAOM,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAE,OAA4B,EAAO,EAAE;IAC7F,MAAM,UAAU,GAAQ;QACtB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,EAAE,EAAE;QACP,YAAY,EAAE,OAAO;QACrB,GAAG,EAAE,mBAAmB;QACxB,GAAG,OAAO;KACX,CAAA;IAGD,IAAI,OAAO,CAAC,GAAG,EAAE;QACf,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAa,CAAC,CAAA;QAC1C,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAA;KAC/B;IAGD,I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AC,CAAA;AAlGY,QAAA,qBAAqB,yBAkGjC"}
@@ -6,7 +6,7 @@ export interface Payload {
6
6
  user_id?: string;
7
7
  user_email?: string;
8
8
  user_created_at?: string;
9
- user_anonymous_Id?: string | null;
9
+ user_anonymous_id?: string | null;
10
10
  event_id?: string;
11
11
  doc_path?: string;
12
12
  doc_search?: string;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import aws4 from 'aws4';
3
+ declare function generateS3RequestOptions(bucketName: string, region: string, path: string, method: string, body: string | Buffer, accessKeyId: string, secretAccessKey: string): Promise<aws4.Request>;
4
+ export default generateS3RequestOptions;
@@ -0,0 +1,21 @@
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 aws4_1 = __importDefault(require("aws4"));
7
+ async function generateS3RequestOptions(bucketName, region, path, method, body, accessKeyId, secretAccessKey) {
8
+ const opts = {
9
+ host: `${bucketName}.s3.amazonaws.com`,
10
+ path,
11
+ body,
12
+ method,
13
+ region
14
+ };
15
+ return aws4_1.default.sign(opts, {
16
+ accessKeyId,
17
+ secretAccessKey
18
+ });
19
+ }
20
+ exports.default = generateS3RequestOptions;
21
+ //# sourceMappingURL=s3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../src/lib/AWS/s3.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AAEvB,KAAK,UAAU,wBAAwB,CACrC,UAAkB,EAClB,MAAc,EACd,IAAY,EACZ,MAAc,EACd,IAAqB,EACrB,WAAmB,EACnB,eAAuB;IAEvB,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,GAAG,UAAU,mBAAmB;QACtC,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,MAAM;KACP,CAAA;IACD,OAAO,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACrB,WAAW;QACX,eAAe;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,wBAAwB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@segment/action-destinations",
3
3
  "description": "Destination Actions engine and definitions.",
4
- "version": "3.162.1-staging.64+3f200454",
4
+ "version": "3.163.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -39,8 +39,8 @@
39
39
  "dependencies": {
40
40
  "@amplitude/ua-parser-js": "^0.7.25",
41
41
  "@segment/a1-notation": "^2.1.4",
42
- "@segment/actions-core": "^3.63.1-staging.64+3f200454",
43
- "@segment/actions-shared": "^1.45.1-staging.64+3f200454",
42
+ "@segment/actions-core": "^3.63.0",
43
+ "@segment/actions-shared": "^1.45.0",
44
44
  "@types/node": "^18.11.15",
45
45
  "cheerio": "^1.0.0-rc.10",
46
46
  "dayjs": "^1.10.7",
@@ -68,5 +68,5 @@
68
68
  "lcov"
69
69
  ]
70
70
  },
71
- "gitHead": "3f2004543c0e16747855a55b640e84d42549d72d"
71
+ "gitHead": "48e8b11782937a5a0391e074c7b6a1128a966746"
72
72
  }
@@ -1,20 +0,0 @@
1
- export interface Payload {
2
- contentSid: string;
3
- from: string;
4
- title?: string;
5
- customArgs?: {
6
- [k: string]: unknown;
7
- };
8
- connectionOverrides?: string;
9
- send?: boolean;
10
- externalIds?: {
11
- id?: string;
12
- type?: string;
13
- channelType?: string;
14
- subscriptionStatus?: string;
15
- }[];
16
- traits?: {
17
- [k: string]: unknown;
18
- };
19
- eventOccurredTS?: string;
20
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendPush/generated-types.ts"],"names":[],"mappings":""}
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const push_sender_1 = require("./push-sender");
4
- const action = {
5
- title: 'Send Push Notification',
6
- description: 'Send a push notification using Twilio',
7
- defaultSubscription: 'type = "track" and event = "Audience Entered"',
8
- fields: {
9
- contentSid: {
10
- label: 'Content template Sid',
11
- description: 'The template you sending',
12
- type: 'string',
13
- required: true
14
- },
15
- from: {
16
- label: 'From',
17
- description: 'The Push Service Sid to send the push noitification from.',
18
- type: 'string',
19
- required: true
20
- },
21
- title: {
22
- label: 'Notification title',
23
- description: 'The title to be displayed for your notification',
24
- type: 'string',
25
- required: false
26
- },
27
- customArgs: {
28
- label: 'Custom Arguments',
29
- description: 'Additional custom arguments that will be opaquely sent back on webhook events',
30
- type: 'object',
31
- required: false
32
- },
33
- connectionOverrides: {
34
- label: 'Connection Overrides',
35
- description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
36
- type: 'string',
37
- required: false
38
- },
39
- send: {
40
- label: 'Send Notification',
41
- description: 'Whether or not the notification should actually get sent.',
42
- type: 'boolean',
43
- required: false,
44
- default: false
45
- },
46
- externalIds: {
47
- label: 'External IDs',
48
- description: 'An array of user profile identity information.',
49
- type: 'object',
50
- multiple: true,
51
- properties: {
52
- id: {
53
- label: 'ID',
54
- description: 'A unique identifier for the collection.',
55
- type: 'string'
56
- },
57
- type: {
58
- label: 'type',
59
- description: 'The external ID contact type.',
60
- type: 'string'
61
- },
62
- channelType: {
63
- label: 'type',
64
- description: 'The external ID contact channel type (SMS, WHATSAPP, etc).',
65
- type: 'string'
66
- },
67
- subscriptionStatus: {
68
- label: 'ID',
69
- description: 'The subscription status for the identity.',
70
- type: 'string'
71
- }
72
- },
73
- default: {
74
- '@arrayPath': [
75
- '$.external_ids',
76
- {
77
- id: {
78
- '@path': '$.id'
79
- },
80
- type: {
81
- '@path': '$.type'
82
- },
83
- channelType: {
84
- '@path': '$.channelType'
85
- },
86
- subscriptionStatus: {
87
- '@path': '$.isSubscribed'
88
- }
89
- }
90
- ]
91
- }
92
- },
93
- traits: {
94
- label: 'Traits',
95
- description: "A user profile's traits",
96
- type: 'object',
97
- required: false,
98
- default: { '@path': '$.properties' }
99
- },
100
- eventOccurredTS: {
101
- label: 'Event Timestamp',
102
- description: 'Time of when the actual event happened.',
103
- type: 'string',
104
- required: false,
105
- default: {
106
- '@path': '$.timestamp'
107
- }
108
- }
109
- },
110
- perform: async (request, { settings, payload, statsContext, logger }) => {
111
- const statsClient = statsContext?.statsClient;
112
- const tags = statsContext?.tags || [];
113
- if (!settings.region) {
114
- settings.region = 'us-west-1';
115
- }
116
- tags.push(`space_id:${settings.spaceId}`, `projectid:${settings.sourceId}`, `region:${settings.region}`);
117
- if (!payload.send) {
118
- statsClient?.incr('actions-personas-messaging-twilio.send-disabled', 1, tags);
119
- return;
120
- }
121
- return new push_sender_1.PushSender(request, payload, settings, statsClient, tags, logger).send();
122
- }
123
- };
124
- exports.default = action;
125
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendPush/index.ts"],"names":[],"mappings":";;AAIA,+CAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,uCAAuC;IACpD,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,2DAA2D;YACxE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,+EAA+E;YAC5F,IAAI,EAAE,QAAQ;Y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d,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE;QACtE,MAAM,WAAW,GAAG,YAAY,EAAE,WAAW,CAAA;QAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,IAAI,IAAI,EAAE,CAAA;QACrC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,QAAQ,CAAC,MAAM,GAAG,WAAW,CAAA;SAC9B;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,QAAQ,CAAC,OAAO,EAAE,EAAE,aAAa,QAAQ,CAAC,QAAQ,EAAE,EAAE,UAAU,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;QACxG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACjB,WAAW,EAAE,IAAI,CAAC,iDAAiD,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;YAC7E,OAAM;SACP;QACD,OAAO,IAAI,wBAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IACrF,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,17 +0,0 @@
1
- import type { Settings } from '../generated-types';
2
- import type { Payload } from './generated-types';
3
- import { Logger, StatsClient, StatsContext } from '@segment/actions-core/src/destination-kit';
4
- import { RequestFn } from '../utils/types';
5
- export declare class PushSender {
6
- readonly request: RequestFn;
7
- readonly payload: Payload;
8
- readonly settings: Settings;
9
- readonly statsClient: StatsClient | undefined;
10
- readonly tags: StatsContext['tags'];
11
- readonly logger: Logger | undefined;
12
- constructor(request: RequestFn, payload: Payload, settings: Settings, statsClient: StatsClient | undefined, tags: StatsContext['tags'], logger: Logger | undefined);
13
- send: () => Promise<Response | undefined>;
14
- private getBody;
15
- private parseContent;
16
- private getWebhookUrlWithParams;
17
- }
@@ -1,147 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PushSender = void 0;
4
- const liquidjs_1 = require("liquidjs");
5
- const actions_core_1 = require("@segment/actions-core");
6
- const content_1 = require("../utils/content");
7
- const Liquid = new liquidjs_1.Liquid();
8
- class PushSender {
9
- constructor(request, payload, settings, statsClient, tags, logger) {
10
- this.request = request;
11
- this.payload = payload;
12
- this.settings = settings;
13
- this.statsClient = statsClient;
14
- this.tags = tags;
15
- this.logger = logger;
16
- this.send = async () => {
17
- const recipients = this.payload.externalIds?.filter((extId) => extId.subscriptionStatus?.toLowerCase() === 'subscribed' &&
18
- ['ios.push_token', 'android.push_token'].includes(extId.type?.toLowerCase() || ''));
19
- if (!recipients?.length) {
20
- this.statsClient?.incr('actions-personas-messaging-twilio.notsubscribed', 1, this.tags);
21
- return;
22
- }
23
- const { requestBody, customData } = await this.getBody();
24
- const twilioToken = Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
25
- for (const recipient of recipients) {
26
- const webhookUrl = this.getWebhookUrlWithParams(recipient.type, recipient.id);
27
- try {
28
- const body = new URLSearchParams(requestBody);
29
- if (/ios.push_token/i.test(recipient?.type || '')) {
30
- body.append('Recipients', JSON.stringify({
31
- apn: [{ addr: recipient.id }]
32
- }));
33
- }
34
- else {
35
- body.append('Recipients', JSON.stringify({
36
- fcm: [{ addr: recipient.id }]
37
- }));
38
- }
39
- body.append('CustomData', JSON.stringify({
40
- ...customData,
41
- __segment_internal_external_id_key__: recipient.type,
42
- __segment_internal_external_id_value__: recipient.id
43
- }));
44
- body.append('Recipients', JSON.stringify(recipient));
45
- if (webhookUrl) {
46
- body.append('DeliveryCallbackUrl', webhookUrl);
47
- }
48
- const response = await this.request(`https://push.ashburn.us1.twilio.com/v1/Services/${this.payload.from}/Notifications`, {
49
- method: 'POST',
50
- headers: {
51
- authorization: `Basic ${twilioToken}`
52
- },
53
- body
54
- });
55
- this.tags.push(`twilio_status_code:${response.status}`);
56
- this.statsClient?.incr('actions-personas-messaging-twilio.response', 1, this.tags);
57
- return response;
58
- }
59
- catch (error) {
60
- this.logger?.error(`TE Messaging: Push failed to send - ${error.message}`);
61
- this.statsClient?.incr('actions-personas-messaging-twilio.error', 1, this.tags);
62
- }
63
- }
64
- if (this.payload.eventOccurredTS != undefined) {
65
- this.statsClient?.histogram('actions-personas-messaging-twilio.eventDeliveryTS', Date.now() - new Date(this.payload.eventOccurredTS).getTime(), this.tags);
66
- }
67
- };
68
- this.getBody = async () => {
69
- let content;
70
- try {
71
- const template = await content_1.getTwilioContentTemplate(this.payload.contentSid, this.settings.twilioApiKeySID, this.settings.twilioApiKeySecret, this.request);
72
- const type = Object.keys(template.types)[0];
73
- if (type !== 'twilio/text' && type !== 'twilio/media') {
74
- this.logger?.error(`TE Messaging: Push unsupported content template type '${type}' - ${this.settings.spaceId}`);
75
- throw new actions_core_1.IntegrationError(`Sending templates with '${type}' content type is not supported by Push`, 'Unsupported content type', 400);
76
- }
77
- content = template.types[type];
78
- }
79
- catch (error) {
80
- this.tags.push('reason:get_content_template');
81
- this.statsClient?.incr('actions-personas-messaging-twilio.error', 1, this.tags);
82
- this.logger?.error(`TE Messaging: Push failed request to fetch content template from Twilio Content API - ${this.settings.spaceId} - [${error}]`);
83
- throw new actions_core_1.IntegrationError('Unable to fetch content template', 'Twilio Content API request failure', 500);
84
- }
85
- const parsedContent = await this.parseContent({
86
- ...content,
87
- title: this.payload.title
88
- });
89
- try {
90
- const customData = {
91
- ...this.payload.customArgs,
92
- space_id: this.settings.spaceId
93
- };
94
- const requestBody = new URLSearchParams({
95
- Body: parsedContent.body
96
- });
97
- if (parsedContent.title?.length) {
98
- requestBody.append('Title', parsedContent.title);
99
- }
100
- if (parsedContent.media?.length) {
101
- customData['images'] = parsedContent.media;
102
- }
103
- return { requestBody, customData };
104
- }
105
- catch (error) {
106
- this.statsClient?.incr('actions-personas-messaging-twilio.error', 1, this.tags);
107
- this.logger?.error(`TE Messaging: Push failed to construct request body - [${error}]`);
108
- throw new actions_core_1.IntegrationError('Unable to construct request body', 'Twilio Request Body Failure', 400);
109
- }
110
- };
111
- }
112
- async parseContent(content) {
113
- const profile = { profile: { traits: this.payload.traits } };
114
- try {
115
- return {
116
- title: await Liquid.parseAndRender(content.title || '', profile),
117
- body: await Liquid.parseAndRender(content.body, profile),
118
- media: await Promise.all(content.media?.map((media) => Liquid.parseAndRender(media, profile)) || [])
119
- };
120
- }
121
- catch (error) {
122
- this.logger?.error(`TE Messaging: Push templating parse failure - ${this.settings.spaceId} - [${error}]`);
123
- throw new actions_core_1.IntegrationError(`Unable to parse templating in Push`, `Push templating parse failure`, 400);
124
- }
125
- }
126
- getWebhookUrlWithParams(externalIdType, externalIdValue) {
127
- const webhookUrl = this.settings.webhookUrl;
128
- const connectionOverrides = this.settings.connectionOverrides;
129
- const customArgs = {
130
- ...this.payload.customArgs,
131
- space_id: this.settings.spaceId,
132
- __segment_internal_external_id_key__: externalIdType,
133
- __segment_internal_external_id_value__: externalIdValue
134
- };
135
- if (webhookUrl && customArgs) {
136
- const webhookUrlWithParams = new URL(webhookUrl);
137
- for (const key of Object.keys(customArgs)) {
138
- webhookUrlWithParams.searchParams.append(key, String(customArgs[key]));
139
- }
140
- webhookUrlWithParams.hash = connectionOverrides || 'rp=all&rc=5';
141
- return webhookUrlWithParams.toString();
142
- }
143
- return null;
144
- }
145
- }
146
- exports.PushSender = PushSender;
147
- //# sourceMappingURL=push-sender.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-sender.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-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G,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAA;QAC7D,MAAM,UAAU,GAAuC;YACrD,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;YAC/B,oCAAoC,EAAE,cAAc;YACpD,sCAAsC,EAAE,eAAe;SACxD,CAAA;QAED,IAAI,UAAU,IAAI,UAAU,EAAE;YAI5B,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;YAChD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBACzC,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACvE;YAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,aAAa,CAAA;YAEhE,OAAO,oBAAoB,CAAC,QAAQ,EAAE,CAAA;SACvC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA3MD,gCA2MC"}
@@ -1,2 +0,0 @@
1
- import { RequestFn, ContentTemplateResponse } from './types';
2
- export declare function getTwilioContentTemplate(contentSid: string, twilioKey: string, twilioSecret: string, request: RequestFn): Promise<ContentTemplateResponse>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTwilioContentTemplate = void 0;
4
- async function getTwilioContentTemplate(contentSid, twilioKey, twilioSecret, request) {
5
- const twilioToken = Buffer.from(`${twilioKey}:${twilioSecret}`).toString('base64');
6
- const response = await request(`https://content.twilio.com/v1/Content/${contentSid}`, {
7
- method: 'GET',
8
- headers: {
9
- authorization: `Basic ${twilioToken}`
10
- }
11
- });
12
- return response.json();
13
- }
14
- exports.getTwilioContentTemplate = getTwilioContentTemplate;
15
- //# sourceMappingURL=content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/content.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,wBAAwB,CAC5C,UAAkB,EAClB,SAAiB,EACjB,YAAoB,EACpB,OAAkB;IAElB,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,IAAI,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAElF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,yCAAyC,UAAU,EAAE,EAAE;QACpF,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,WAAW,EAAE;SACtC;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC;AAhBD,4DAgBC"}
@@ -1,10 +0,0 @@
1
- import type { RequestOptions } from '@segment/actions-core';
2
- export declare type RequestFn = (url: string, options?: RequestOptions) => Promise<Response>;
3
- export interface ContentTemplateResponse {
4
- types: {
5
- [type: string]: {
6
- body: string;
7
- media?: string[];
8
- };
9
- };
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/types.ts"],"names":[],"mappings":""}