@segment/action-destinations 3.288.0-staging-437f9f88e → 3.289.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.
- package/dist/destinations/angler-ai/fields/addressFields.d.ts +3 -0
- package/dist/destinations/angler-ai/fields/addressFields.js +164 -0
- package/dist/destinations/angler-ai/fields/addressFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/cartFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/cartFields.js +42 -0
- package/dist/destinations/angler-ai/fields/cartFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/cartLineFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/cartLineFields.js +31 -0
- package/dist/destinations/angler-ai/fields/cartLineFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/checkoutFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/checkoutFields.js +102 -0
- package/dist/destinations/angler-ai/fields/checkoutFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/collectionFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/collectionFields.js +38 -0
- package/dist/destinations/angler-ai/fields/collectionFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/commonFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/commonFields.js +115 -0
- package/dist/destinations/angler-ai/fields/commonFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/customerFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/customerFields.js +75 -0
- package/dist/destinations/angler-ai/fields/customerFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/formFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/formFields.js +61 -0
- package/dist/destinations/angler-ai/fields/formFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/productFields.d.ts +47 -0
- package/dist/destinations/angler-ai/fields/productFields.js +101 -0
- package/dist/destinations/angler-ai/fields/productFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/productVariantFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/productVariantFields.js +12 -0
- package/dist/destinations/angler-ai/fields/productVariantFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/productsFields.d.ts +37 -0
- package/dist/destinations/angler-ai/fields/productsFields.js +100 -0
- package/dist/destinations/angler-ai/fields/productsFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/searchFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/searchFields.js +20 -0
- package/dist/destinations/angler-ai/fields/searchFields.js.map +1 -0
- package/dist/destinations/angler-ai/fields/userFields.d.ts +2 -0
- package/dist/destinations/angler-ai/fields/userFields.js +293 -0
- package/dist/destinations/angler-ai/fields/userFields.js.map +1 -0
- package/dist/destinations/angler-ai/generated-types.d.ts +4 -0
- package/dist/destinations/angler-ai/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/index.d.ts +12 -0
- package/dist/destinations/angler-ai/index.js +82 -0
- package/dist/destinations/angler-ai/index.js.map +1 -0
- package/dist/destinations/angler-ai/presets.d.ts +2 -0
- package/dist/destinations/angler-ai/presets.js +165 -0
- package/dist/destinations/angler-ai/presets.js.map +1 -0
- package/dist/destinations/angler-ai/routes.d.ts +8 -0
- package/dist/destinations/angler-ai/routes.js +33 -0
- package/dist/destinations/angler-ai/routes.js.map +1 -0
- package/dist/destinations/angler-ai/saveBaseEvent/generated-types.d.ts +48 -0
- package/dist/destinations/angler-ai/saveBaseEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveBaseEvent/index.js +39 -0
- package/dist/destinations/angler-ai/saveBaseEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveBaseEvent/transform-payload.d.ts +68 -0
- package/dist/destinations/angler-ai/saveBaseEvent/transform-payload.js +20 -0
- package/dist/destinations/angler-ai/saveBaseEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveCartEvent/generated-types.d.ts +43 -0
- package/dist/destinations/angler-ai/saveCartEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveCartEvent/index.js +39 -0
- package/dist/destinations/angler-ai/saveCartEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveCartEvent/transform-payload.d.ts +59 -0
- package/dist/destinations/angler-ai/saveCartEvent/transform-payload.js +20 -0
- package/dist/destinations/angler-ai/saveCartEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/generated-types.d.ts +53 -0
- package/dist/destinations/{klaviyo/orderCompleted/types.js → angler-ai/saveCheckoutEvent/generated-types.js} +1 -1
- package/dist/destinations/angler-ai/saveCheckoutEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/index.js +42 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/transform-payload.d.ts +124 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/transform-payload.js +22 -0
- package/dist/destinations/angler-ai/saveCheckoutEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/generated-types.d.ts +64 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/index.js +40 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/transform-payload.d.ts +92 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/transform-payload.js +22 -0
- package/dist/destinations/angler-ai/saveCollectionEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveCustomEvent/generated-types.d.ts +135 -0
- package/dist/destinations/angler-ai/saveCustomEvent/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveCustomEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveCustomEvent/index.js +84 -0
- package/dist/destinations/angler-ai/saveCustomEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveCustomEvent/transform-payload.d.ts +229 -0
- package/dist/destinations/angler-ai/saveCustomEvent/transform-payload.js +32 -0
- package/dist/destinations/angler-ai/saveCustomEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveFormEvent/generated-types.d.ts +57 -0
- package/dist/destinations/angler-ai/saveFormEvent/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveFormEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveFormEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveFormEvent/index.js +40 -0
- package/dist/destinations/angler-ai/saveFormEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveFormEvent/transform-payload.d.ts +79 -0
- package/dist/destinations/angler-ai/saveFormEvent/transform-payload.js +22 -0
- package/dist/destinations/angler-ai/saveFormEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveOrder/generated-types.d.ts +119 -0
- package/dist/destinations/angler-ai/saveOrder/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveOrder/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveOrder/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveOrder/index.js +523 -0
- package/dist/destinations/angler-ai/saveOrder/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveProductEvent/generated-types.d.ts +60 -0
- package/dist/destinations/angler-ai/saveProductEvent/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveProductEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveProductEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveProductEvent/index.js +40 -0
- package/dist/destinations/angler-ai/saveProductEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveProductEvent/transform-payload.d.ts +88 -0
- package/dist/destinations/angler-ai/saveProductEvent/transform-payload.js +22 -0
- package/dist/destinations/angler-ai/saveProductEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveSearchEvent/generated-types.d.ts +61 -0
- package/dist/destinations/angler-ai/saveSearchEvent/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveSearchEvent/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveSearchEvent/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveSearchEvent/index.js +40 -0
- package/dist/destinations/angler-ai/saveSearchEvent/index.js.map +1 -0
- package/dist/destinations/angler-ai/saveSearchEvent/transform-payload.d.ts +91 -0
- package/dist/destinations/angler-ai/saveSearchEvent/transform-payload.js +22 -0
- package/dist/destinations/angler-ai/saveSearchEvent/transform-payload.js.map +1 -0
- package/dist/destinations/angler-ai/saveUser/generated-types.d.ts +99 -0
- package/dist/destinations/angler-ai/saveUser/generated-types.js +3 -0
- package/dist/destinations/angler-ai/saveUser/generated-types.js.map +1 -0
- package/dist/destinations/angler-ai/saveUser/index.d.ts +5 -0
- package/dist/destinations/angler-ai/saveUser/index.js +23 -0
- package/dist/destinations/angler-ai/saveUser/index.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCart.d.ts +39 -0
- package/dist/destinations/angler-ai/transformFields/transformCart.js +45 -0
- package/dist/destinations/angler-ai/transformFields/transformCart.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCartLine.d.ts +30 -0
- package/dist/destinations/angler-ai/transformFields/transformCartLine.js +36 -0
- package/dist/destinations/angler-ai/transformFields/transformCartLine.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCheckout.d.ts +59 -0
- package/dist/destinations/angler-ai/transformFields/transformCheckout.js +67 -0
- package/dist/destinations/angler-ai/transformFields/transformCheckout.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCollection.d.ts +27 -0
- package/dist/destinations/angler-ai/transformFields/transformCollection.js +33 -0
- package/dist/destinations/angler-ai/transformFields/transformCollection.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCommonFields.d.ts +24 -0
- package/dist/destinations/angler-ai/transformFields/transformCommonFields.js +33 -0
- package/dist/destinations/angler-ai/transformFields/transformCommonFields.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformCustomer.d.ts +11 -0
- package/dist/destinations/angler-ai/transformFields/transformCustomer.js +17 -0
- package/dist/destinations/angler-ai/transformFields/transformCustomer.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformForm.d.ts +14 -0
- package/dist/destinations/angler-ai/transformFields/transformForm.js +20 -0
- package/dist/destinations/angler-ai/transformFields/transformForm.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformProductVariant.d.ts +23 -0
- package/dist/destinations/angler-ai/transformFields/transformProductVariant.js +29 -0
- package/dist/destinations/angler-ai/transformFields/transformProductVariant.js.map +1 -0
- package/dist/destinations/angler-ai/transformFields/transformSearch.d.ts +26 -0
- package/dist/destinations/angler-ai/transformFields/transformSearch.js +32 -0
- package/dist/destinations/angler-ai/transformFields/transformSearch.js.map +1 -0
- package/dist/destinations/app-fit/track/generated-types.d.ts +6 -0
- package/dist/destinations/app-fit/track/index.js +65 -5
- package/dist/destinations/app-fit/track/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdateObject/index.js +3 -0
- package/dist/destinations/customerio/createUpdateObject/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js +2 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/customerio/deleteDevice/index.js +1 -1
- package/dist/destinations/customerio/deleteDevice/index.js.map +1 -1
- package/dist/destinations/customerio/deleteObject/index.js +1 -1
- package/dist/destinations/customerio/deleteObject/index.js.map +1 -1
- package/dist/destinations/customerio/deleteRelationship/index.js +1 -1
- package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +1 -0
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/index.js +0 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/request-client.d.ts +2 -1
- package/dist/destinations/moloco-rmp/common/request-client.js +5 -3
- package/dist/destinations/moloco-rmp/common/request-client.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/settings.d.ts +1 -0
- package/dist/destinations/moloco-rmp/generated-types.d.ts +1 -0
- package/dist/destinations/moloco-rmp/index.js +7 -0
- package/dist/destinations/moloco-rmp/index.js.map +1 -1
- package/dist/destinations/salesforce/account/index.js +32 -16
- package/dist/destinations/salesforce/account/index.js.map +1 -1
- package/dist/destinations/salesforce/cases/index.js +2 -1
- package/dist/destinations/salesforce/cases/index.js.map +1 -1
- package/dist/destinations/salesforce/contact/index.js +18 -9
- package/dist/destinations/salesforce/contact/index.js.map +1 -1
- package/dist/destinations/salesforce/lead/index.js +18 -9
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/destinations/salesforce/opportunity/index.js +10 -5
- package/dist/destinations/salesforce/opportunity/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.d.ts +2 -0
- package/dist/destinations/salesforce/sf-properties.js +16 -4
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/klaviyo/orderCompleted/formatters.d.ts +0 -26
- package/dist/destinations/klaviyo/orderCompleted/formatters.js +0 -62
- package/dist/destinations/klaviyo/orderCompleted/formatters.js.map +0 -1
- package/dist/destinations/klaviyo/orderCompleted/types.d.ts +0 -2
- package/dist/destinations/klaviyo/orderCompleted/types.js.map +0 -1
- package/dist/destinations/mappings-two-test/generated-types.d.ts +0 -3
- package/dist/destinations/mappings-two-test/generated-types.js.map +0 -1
- package/dist/destinations/mappings-two-test/index.d.ts +0 -4
- package/dist/destinations/mappings-two-test/index.js +0 -32
- package/dist/destinations/mappings-two-test/index.js.map +0 -1
- package/dist/destinations/mappings-two-test/kitchenSink/generated-types.d.ts +0 -42
- package/dist/destinations/mappings-two-test/kitchenSink/generated-types.js.map +0 -1
- package/dist/destinations/mappings-two-test/kitchenSink/index.js +0 -246
- package/dist/destinations/mappings-two-test/kitchenSink/index.js.map +0 -1
- package/dist/destinations/mappings-two-test/sendEvent/generated-types.d.ts +0 -6
- package/dist/destinations/mappings-two-test/sendEvent/generated-types.js.map +0 -1
- package/dist/destinations/mappings-two-test/sendEvent/index.js +0 -110
- package/dist/destinations/mappings-two-test/sendEvent/index.js.map +0 -1
- /package/dist/destinations/{mappings-two-test → angler-ai}/generated-types.js +0 -0
- /package/dist/destinations/{mappings-two-test/kitchenSink → angler-ai/saveBaseEvent}/generated-types.js +0 -0
- /package/dist/destinations/{mappings-two-test/kitchenSink → angler-ai/saveBaseEvent}/index.d.ts +0 -0
- /package/dist/destinations/{mappings-two-test/sendEvent → angler-ai/saveCartEvent}/generated-types.js +0 -0
- /package/dist/destinations/{mappings-two-test/sendEvent → angler-ai/saveCartEvent}/index.d.ts +0 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const addressFields_1 = require("../fields/addressFields");
|
|
4
|
+
const routes_1 = require("../routes");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Save Order',
|
|
7
|
+
description: 'Send an order to Angler. Use this Mapping for transactions which may not originate from the browser. E.g. recurring subscriptions.',
|
|
8
|
+
fields: {
|
|
9
|
+
billing_address: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
label: 'Billing Address',
|
|
12
|
+
description: 'The mailing address associated with the payment method.',
|
|
13
|
+
properties: addressFields_1.addressProperties,
|
|
14
|
+
default: addressFields_1.addressDefaultFields('$.properties.billing_address')
|
|
15
|
+
},
|
|
16
|
+
browser_ip: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
label: 'Browser IP',
|
|
19
|
+
description: 'The IP address of the browser used by the customer when they placed the order. Both IPv4 and IPv6 are supported.',
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.context.ip'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
buyer_accepts_marketing: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
label: 'Buyer Accepts Marketing',
|
|
27
|
+
description: 'Whether the customer consented to receive email updates from the shop.',
|
|
28
|
+
default: {
|
|
29
|
+
'@if': {
|
|
30
|
+
exists: { '@path': '$.properties.buyer_accepts_marketing' },
|
|
31
|
+
then: { '@path': '$.properties.buyer_accepts_marketing' },
|
|
32
|
+
else: { '@path': '$.traits.accepts_marketing' }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
checkout_id: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
label: 'Checkout ID',
|
|
39
|
+
description: 'The ID of the checkout.',
|
|
40
|
+
default: {
|
|
41
|
+
'@path': '$.properties.checkout_id'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
client_details: {
|
|
45
|
+
type: 'object',
|
|
46
|
+
label: 'Client Details',
|
|
47
|
+
description: 'Information about the browser that the customer used when they placed their order.',
|
|
48
|
+
properties: {
|
|
49
|
+
browser_ip: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'Browser IP',
|
|
52
|
+
description: 'The browser IP address.'
|
|
53
|
+
},
|
|
54
|
+
user_agent: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
label: 'User Agent',
|
|
57
|
+
description: 'Details of the browsing client, including software and operating versions.'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
default: {
|
|
61
|
+
accept_language: { '@path': '$.context.locale' },
|
|
62
|
+
browser_height: { '@path': '$.context.screen.height' },
|
|
63
|
+
browser_ip: { '@path': '$.context.ip' },
|
|
64
|
+
browser_width: { '@path': '$.context.screen.width' },
|
|
65
|
+
session_hash: { '@path': '$.properties.session_hash' },
|
|
66
|
+
user_agent: { '@path': '$.context.userAgent' }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
confirmed: {
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
label: 'Confirmed',
|
|
72
|
+
description: '',
|
|
73
|
+
default: {
|
|
74
|
+
'@path': '$.properties.confirmed'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
contact_email: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
label: 'Contact Email',
|
|
80
|
+
description: '',
|
|
81
|
+
default: {
|
|
82
|
+
'@if': {
|
|
83
|
+
exists: { '@path': '$.properties.contact_email' },
|
|
84
|
+
then: { '@path': '$.properties.contact_email' },
|
|
85
|
+
else: { '@path': '$.traits.email' }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
created_at: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
label: 'Created At',
|
|
92
|
+
description: 'The autogenerated date and time (ISO 8601 format) when the order was created.',
|
|
93
|
+
default: {
|
|
94
|
+
'@path': '$.properties.created_at'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
currency: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
label: 'Currency',
|
|
100
|
+
description: 'The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order.',
|
|
101
|
+
default: {
|
|
102
|
+
'@path': '$.properties.currency'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
current_subtotal_price: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
label: 'Current Subtotal Price',
|
|
108
|
+
description: 'The current subtotal price of the order in the shop currency. The value of this field reflects order edits, returns, and refunds.',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.properties.current_subtotal_price'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
current_total_discounts: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
label: 'Current Total Discounts',
|
|
116
|
+
description: 'The current total discounts on the order in the shop currency. The value of this field reflects order edits, returns, and refunds.',
|
|
117
|
+
default: {
|
|
118
|
+
'@path': '$.properties.current_total_discounts'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
current_total_price: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
label: 'Current Total Price',
|
|
124
|
+
description: 'The current total price of the order in the shop currency. The value of this field reflects order edits, returns, and refunds.',
|
|
125
|
+
default: {
|
|
126
|
+
'@path': '$.properties.current_total_price'
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
current_total_tax: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
label: 'Current Total Tax',
|
|
132
|
+
description: 'The current total taxes charged on the order in the shop currency. The value of this field reflects order edits, returns, or refunds.',
|
|
133
|
+
default: {
|
|
134
|
+
'@path': '$.properties.current_total_tax'
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
customer_id: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
label: 'Customer ID',
|
|
140
|
+
description: 'A unique identifier for the customer.',
|
|
141
|
+
default: {
|
|
142
|
+
'@if': {
|
|
143
|
+
exists: { '@path': '$.userId' },
|
|
144
|
+
then: { '@path': '$.userId' },
|
|
145
|
+
else: { '@path': '$.traits.id' }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
discount_applications: {
|
|
150
|
+
type: 'object',
|
|
151
|
+
multiple: true,
|
|
152
|
+
label: 'Discount Applications',
|
|
153
|
+
description: 'An ordered list of stacked discount applications. The discount_applications property includes 3 types: discount_code, manual, and script. All 3 types share a common structure and have some type specific attributes.',
|
|
154
|
+
properties: {
|
|
155
|
+
target_type: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
label: 'Target Type',
|
|
158
|
+
description: 'The type of line on the order that the discount is applicable on.'
|
|
159
|
+
},
|
|
160
|
+
type: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
label: 'Type',
|
|
163
|
+
description: 'The discount application type.'
|
|
164
|
+
},
|
|
165
|
+
value: {
|
|
166
|
+
type: 'string',
|
|
167
|
+
label: 'Value',
|
|
168
|
+
description: 'The value of the discount application as a decimal. This represents the intention of the discount application.'
|
|
169
|
+
},
|
|
170
|
+
value_type: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
label: 'Value Type',
|
|
173
|
+
description: 'The type of the value.'
|
|
174
|
+
},
|
|
175
|
+
allocation_method: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
label: 'Allocation Method',
|
|
178
|
+
description: 'The method by which the discount application value has been allocated to entitled lines.'
|
|
179
|
+
},
|
|
180
|
+
target_selection: {
|
|
181
|
+
type: 'string',
|
|
182
|
+
label: 'Target Selection',
|
|
183
|
+
description: 'The lines on the order, of the type defined by target_type, that the discount is allocated over.'
|
|
184
|
+
},
|
|
185
|
+
code: {
|
|
186
|
+
type: 'string',
|
|
187
|
+
label: 'Code',
|
|
188
|
+
description: 'The discount code that was used to apply the discount. Available only for discount code applications.'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
default: {
|
|
192
|
+
'@arrayPath': [
|
|
193
|
+
'$.properties.discount_applications',
|
|
194
|
+
{
|
|
195
|
+
target_type: { '@path': '$.target_type' },
|
|
196
|
+
type: { '@path': '$.type' },
|
|
197
|
+
value: { '@path': '$.value' },
|
|
198
|
+
value_type: { '@path': '$.value_type' },
|
|
199
|
+
allocation_method: { '@path': '$.allocation_method' },
|
|
200
|
+
target_selection: { '@path': '$.target_selection' },
|
|
201
|
+
code: { '@path': '$.code' }
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
discount_codes: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
multiple: true,
|
|
209
|
+
label: 'Discount Codes',
|
|
210
|
+
description: 'A list of discounts applied to the order.',
|
|
211
|
+
properties: {
|
|
212
|
+
code: {
|
|
213
|
+
type: 'string',
|
|
214
|
+
label: 'Code',
|
|
215
|
+
description: 'When the associated discount application is of type code, this property returns the discount code that was entered at checkout. Otherwise this property returns the title of the discount that was applied.'
|
|
216
|
+
},
|
|
217
|
+
amount: {
|
|
218
|
+
type: 'string',
|
|
219
|
+
label: 'Amount',
|
|
220
|
+
description: "The amount that's deducted from the order total. When you create an order, this value is the percentage or monetary amount to deduct. After the order is created, this property returns the calculated amount."
|
|
221
|
+
},
|
|
222
|
+
type: {
|
|
223
|
+
type: 'string',
|
|
224
|
+
label: 'Type',
|
|
225
|
+
description: 'The type of discount.'
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
default: {
|
|
229
|
+
'@arrayPath': [
|
|
230
|
+
'$.properties.discount_codes',
|
|
231
|
+
{
|
|
232
|
+
code: { '@path': '$.code' },
|
|
233
|
+
amount: { '@path': '$.amount' },
|
|
234
|
+
type: { '@path': '$.type' }
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
email: {
|
|
240
|
+
type: 'string',
|
|
241
|
+
label: 'Email',
|
|
242
|
+
description: "The customer's email address.",
|
|
243
|
+
default: {
|
|
244
|
+
'@if': {
|
|
245
|
+
exists: { '@path': '$.properties.email' },
|
|
246
|
+
then: { '@path': '$.properties.email' },
|
|
247
|
+
else: { '@path': '$.traits.email' }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
estimated_taxes: {
|
|
252
|
+
type: 'boolean',
|
|
253
|
+
label: 'Estimated Taxes',
|
|
254
|
+
description: 'Whether taxes on the order are estimated. Many factors can change between the time a customer places an order and the time the order is shipped, which could affect the calculation of taxes.',
|
|
255
|
+
default: {
|
|
256
|
+
'@path': '$.properties.estimated_taxes'
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
financial_status: {
|
|
260
|
+
type: 'string',
|
|
261
|
+
label: 'Financial Status',
|
|
262
|
+
description: 'The status of payments associated with the order.',
|
|
263
|
+
default: {
|
|
264
|
+
'@path': '$.properties.financial_status'
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
fulfillment_status: {
|
|
268
|
+
type: 'string',
|
|
269
|
+
label: 'Fulfillment Status',
|
|
270
|
+
description: "The order's status in terms of fulfilled line items.",
|
|
271
|
+
default: {
|
|
272
|
+
'@path': '$.properties.fulfillment_status'
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
gateway: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
label: 'Gateway',
|
|
278
|
+
description: 'The payment gateway used.',
|
|
279
|
+
default: {
|
|
280
|
+
'@path': '$.properties.gateway'
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
id: {
|
|
284
|
+
required: true,
|
|
285
|
+
type: 'string',
|
|
286
|
+
label: 'ID',
|
|
287
|
+
description: 'The ID of the order, used for API purposes.',
|
|
288
|
+
default: {
|
|
289
|
+
'@path': '$.properties.id'
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
landing_site: {
|
|
293
|
+
type: 'string',
|
|
294
|
+
label: 'Landing Site',
|
|
295
|
+
description: 'The URL for the page where the buyer landed when they entered the shop.',
|
|
296
|
+
default: {
|
|
297
|
+
'@path': '$.properties.landing_site'
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
landing_site_ref: {
|
|
301
|
+
type: 'string',
|
|
302
|
+
label: 'Landing Site Ref',
|
|
303
|
+
description: '',
|
|
304
|
+
default: {
|
|
305
|
+
'@path': '$.properties.landing_site_ref'
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
name: {
|
|
309
|
+
type: 'string',
|
|
310
|
+
label: 'Name',
|
|
311
|
+
description: 'The order name.',
|
|
312
|
+
default: {
|
|
313
|
+
'@path': '$.properties.name'
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
order_number: {
|
|
317
|
+
type: 'integer',
|
|
318
|
+
label: 'Order Number',
|
|
319
|
+
description: 'The order position in the shop count of orders starting at 1001. Order numbers are sequential and start at 1001.',
|
|
320
|
+
default: {
|
|
321
|
+
'@path': '$.properties.order_number'
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
phone: {
|
|
325
|
+
type: 'string',
|
|
326
|
+
label: 'Phone',
|
|
327
|
+
description: "The customer's phone number for receiving SMS notifications.",
|
|
328
|
+
default: {
|
|
329
|
+
'@path': '$.properties.phone'
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
processed_at: {
|
|
333
|
+
type: 'string',
|
|
334
|
+
label: 'Processed At',
|
|
335
|
+
description: 'The date and time (ISO 8601 format) when an order was processed.',
|
|
336
|
+
default: {
|
|
337
|
+
'@path': '$.properties.processed_at'
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
processing_method: {
|
|
341
|
+
type: 'string',
|
|
342
|
+
label: 'Processing Method',
|
|
343
|
+
description: 'How the payment was processed.',
|
|
344
|
+
default: {
|
|
345
|
+
'@path': '$.properties.processing_method'
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
reference: {
|
|
349
|
+
type: 'string',
|
|
350
|
+
label: 'Reference',
|
|
351
|
+
description: '',
|
|
352
|
+
default: {
|
|
353
|
+
'@path': '$.properties.reference'
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
referring_site: {
|
|
357
|
+
type: 'string',
|
|
358
|
+
label: 'Referring Site',
|
|
359
|
+
description: 'The website where the customer clicked a link to the shop.',
|
|
360
|
+
default: {
|
|
361
|
+
'@path': '$.properties.referring_site'
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
shipping_address: {
|
|
365
|
+
type: 'object',
|
|
366
|
+
label: 'Shipping Address',
|
|
367
|
+
description: 'The mailing address associated with the payment method.',
|
|
368
|
+
properties: addressFields_1.addressProperties,
|
|
369
|
+
default: addressFields_1.addressDefaultFields('$.properties.shipping_address')
|
|
370
|
+
},
|
|
371
|
+
source_identifier: {
|
|
372
|
+
type: 'string',
|
|
373
|
+
label: 'Source Identifier',
|
|
374
|
+
description: 'The ID of the order placed on the originating platform.',
|
|
375
|
+
default: {
|
|
376
|
+
'@path': '$.properties.source_identifier'
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
source_name: {
|
|
380
|
+
type: 'string',
|
|
381
|
+
label: 'Source Name',
|
|
382
|
+
description: 'The source of the checkout.',
|
|
383
|
+
default: {
|
|
384
|
+
'@path': '$.properties.source_name'
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
source_url: {
|
|
388
|
+
type: 'string',
|
|
389
|
+
label: 'Source URL',
|
|
390
|
+
description: 'A valid URL to the original order on the originating surface.',
|
|
391
|
+
default: {
|
|
392
|
+
'@path': '$.properties.source_url'
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
subtotal_price: {
|
|
396
|
+
type: 'string',
|
|
397
|
+
label: 'Subtotal Price',
|
|
398
|
+
description: 'The price of the order in the shop currency after discounts but before shipping, duties, taxes, and tips.',
|
|
399
|
+
default: {
|
|
400
|
+
'@path': '$.properties.subtotal_price'
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
tags: {
|
|
404
|
+
type: 'string',
|
|
405
|
+
label: 'Tags',
|
|
406
|
+
description: 'Tags attached to the order, formatted as a string of comma-separated values. Tags are additional short descriptors, commonly used for filtering and searching. Each individual tag is limited to 40 characters in length.',
|
|
407
|
+
default: {
|
|
408
|
+
'@path': '$.properties.tags'
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
taxes_included: {
|
|
412
|
+
type: 'boolean',
|
|
413
|
+
label: 'Taxes Included',
|
|
414
|
+
description: 'Whether taxes are included in the order subtotal.',
|
|
415
|
+
default: {
|
|
416
|
+
'@path': '$.properties.taxes_included'
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
total_discounts: {
|
|
420
|
+
type: 'string',
|
|
421
|
+
label: 'Total Discounts',
|
|
422
|
+
description: 'The total discounts applied to the price of the order in the shop currency.',
|
|
423
|
+
default: {
|
|
424
|
+
'@path': '$.properties.total_discounts'
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
total_line_items_price: {
|
|
428
|
+
type: 'string',
|
|
429
|
+
label: 'Total Line Items Price',
|
|
430
|
+
description: 'The sum of all line item prices in the shop currency.',
|
|
431
|
+
default: {
|
|
432
|
+
'@path': '$.properties.total_line_items_price'
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
total_outstanding: {
|
|
436
|
+
type: 'string',
|
|
437
|
+
label: 'Total Outstanding',
|
|
438
|
+
description: 'The total outstanding amount of the order in the shop currency.',
|
|
439
|
+
default: {
|
|
440
|
+
'@path': '$.properties.total_outstanding'
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
total_price: {
|
|
444
|
+
type: 'string',
|
|
445
|
+
label: 'Total Price',
|
|
446
|
+
description: 'The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.',
|
|
447
|
+
default: {
|
|
448
|
+
'@path': '$.properties.total_price'
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
total_price_usd: {
|
|
452
|
+
type: 'string',
|
|
453
|
+
label: 'Total Price USD',
|
|
454
|
+
description: 'The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency in USD',
|
|
455
|
+
default: {
|
|
456
|
+
'@path': '$.properties.total_price_usd'
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
total_tax: {
|
|
460
|
+
type: 'string',
|
|
461
|
+
label: 'Total Tax',
|
|
462
|
+
description: 'The sum of all the taxes applied to the order in the shop currency. Must be positive.',
|
|
463
|
+
default: {
|
|
464
|
+
'@path': '$.properties.total_tax'
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
user_id: {
|
|
468
|
+
type: 'string',
|
|
469
|
+
label: 'User ID',
|
|
470
|
+
description: 'The ID of the user logged into Shopify POS who processed the order, if applicable.',
|
|
471
|
+
default: {
|
|
472
|
+
'@path': '$.properties.user_id'
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
updated_at: {
|
|
476
|
+
type: 'string',
|
|
477
|
+
label: 'Updated At',
|
|
478
|
+
description: 'The date and time (ISO 8601 format) when the order was last modified.',
|
|
479
|
+
default: {
|
|
480
|
+
'@path': '$.properties.updated_at'
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
additional_fields: {
|
|
484
|
+
type: 'object',
|
|
485
|
+
multiple: true,
|
|
486
|
+
label: 'Additional Fields',
|
|
487
|
+
description: 'Extra properties.',
|
|
488
|
+
properties: {
|
|
489
|
+
name: {
|
|
490
|
+
type: 'string',
|
|
491
|
+
label: 'Name',
|
|
492
|
+
description: 'Extra property name.'
|
|
493
|
+
},
|
|
494
|
+
value: {
|
|
495
|
+
type: 'string',
|
|
496
|
+
label: 'String',
|
|
497
|
+
description: 'Extra property value.'
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
default: {
|
|
501
|
+
'@arrayPath': [
|
|
502
|
+
'$.properties.additional_fields',
|
|
503
|
+
{
|
|
504
|
+
name: { '@path': '$.name' },
|
|
505
|
+
value: { '@path': '$.value' }
|
|
506
|
+
}
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
perform: (request, data) => {
|
|
512
|
+
const payload = {
|
|
513
|
+
src: 'SEGMENT',
|
|
514
|
+
data: [data.payload]
|
|
515
|
+
};
|
|
516
|
+
return request(routes_1.baseURL + routes_1.ordersEndpoint(data.settings.workspaceId), {
|
|
517
|
+
method: 'post',
|
|
518
|
+
json: payload
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
exports.default = action;
|
|
523
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/angler-ai/saveOrder/index.ts"],"names":[],"mappings":";;AACA,2DAAiF;AAEjF,sCAAmD;AAGnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EACT,oIAAoI;IACtI,MAAM,EAAE;QACN,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yDAAyD;YACtE,UAAU,EAAE,iCAAiB;Y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d,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,uBAAuB;iBACrC;aACF;YACD,OAAO,EAAE;gBACP,YAAY,EAAE;oBACZ,gCAAgC;oBAChC;wBACE,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;wBAC3B,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;qBAC9B;iBACF;aACF;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;SACrB,CAAA;QACD,OAAO,OAAO,CAAC,gBAAO,GAAG,uBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;YAClE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
eventId: string;
|
|
3
|
+
ipAddress?: string;
|
|
4
|
+
userAgent?: string;
|
|
5
|
+
timestamp?: string;
|
|
6
|
+
identifiers: {
|
|
7
|
+
userId?: string;
|
|
8
|
+
anonymousId?: string;
|
|
9
|
+
clientId: string;
|
|
10
|
+
fbp?: string;
|
|
11
|
+
fbc?: string;
|
|
12
|
+
ga?: string;
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
page?: {
|
|
16
|
+
url?: string;
|
|
17
|
+
referrer?: string;
|
|
18
|
+
};
|
|
19
|
+
customAttributes?: {
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
customer?: {
|
|
23
|
+
email?: string;
|
|
24
|
+
firstName?: string;
|
|
25
|
+
lastName?: string;
|
|
26
|
+
phone?: string;
|
|
27
|
+
dob?: string;
|
|
28
|
+
};
|
|
29
|
+
cart?: {
|
|
30
|
+
id?: string;
|
|
31
|
+
totalAmount?: number;
|
|
32
|
+
currencyCode?: string;
|
|
33
|
+
};
|
|
34
|
+
cartLines?: {
|
|
35
|
+
id?: string;
|
|
36
|
+
variantId?: string;
|
|
37
|
+
imageSrc?: string;
|
|
38
|
+
priceAmount?: number;
|
|
39
|
+
sku?: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
untranslatedTitle?: string;
|
|
42
|
+
vendor?: string;
|
|
43
|
+
type?: string;
|
|
44
|
+
url?: string;
|
|
45
|
+
quantity?: number;
|
|
46
|
+
}[];
|
|
47
|
+
productVariant?: {
|
|
48
|
+
id?: string;
|
|
49
|
+
variantId?: string;
|
|
50
|
+
imageSrc?: string;
|
|
51
|
+
priceAmount?: number;
|
|
52
|
+
sku?: string;
|
|
53
|
+
title?: string;
|
|
54
|
+
untranslatedTitle?: string;
|
|
55
|
+
vendor?: string;
|
|
56
|
+
type?: string;
|
|
57
|
+
url?: string;
|
|
58
|
+
};
|
|
59
|
+
eventName: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/angler-ai/saveProductEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cartFields_1 = require("../fields/cartFields");
|
|
4
|
+
const commonFields_1 = require("../fields/commonFields");
|
|
5
|
+
const customerFields_1 = require("../fields/customerFields");
|
|
6
|
+
const productVariantFields_1 = require("../fields/productVariantFields");
|
|
7
|
+
const routes_1 = require("../routes");
|
|
8
|
+
const transform_payload_1 = require("./transform-payload");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Save Product Event',
|
|
11
|
+
description: 'Save a product event.',
|
|
12
|
+
fields: {
|
|
13
|
+
...commonFields_1.commonFields,
|
|
14
|
+
...customerFields_1.customerFields,
|
|
15
|
+
...cartFields_1.cartFields,
|
|
16
|
+
...productVariantFields_1.productVariantFields,
|
|
17
|
+
eventName: {
|
|
18
|
+
label: 'Product Event Name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'The name of the Product event to track.',
|
|
21
|
+
required: true,
|
|
22
|
+
readOnly: true,
|
|
23
|
+
choices: [{ label: 'product_viewed', value: 'product_viewed' }],
|
|
24
|
+
default: 'product_viewed'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
perform: (request, data) => {
|
|
28
|
+
const transformedPayload = transform_payload_1.transformPayload(data.payload);
|
|
29
|
+
const payload = {
|
|
30
|
+
src: 'SEGMENT',
|
|
31
|
+
data: [transformedPayload]
|
|
32
|
+
};
|
|
33
|
+
return request(routes_1.baseURL + routes_1.eventsEndpoint(data.settings.workspaceId), {
|
|
34
|
+
method: 'post',
|
|
35
|
+
json: payload
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.default = action;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/angler-ai/saveProductEvent/index.ts"],"names":[],"mappings":";;AACA,qDAAiD;AACjD,yDAAqD;AACrD,6DAAyD;AACzD,yEAAqE;AAErE,sCAAmD;AAEnD,2DAAsD;AAEtD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,uBAAuB;IACpC,MAAM,EAAE;QACN,GAAG,2BAAY;QACf,GAAG,+BAAc;QACjB,GAAG,uBAAU;QACb,GAAG,2CAAoB;QACvB,SAAS,EAAE;YACT,KAAK,EAAE,oBAAoB;YAC3B,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;YAC/D,OAAO,EAAE,gBAAgB;SAC1B;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,kBAAkB,GAAG,oCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAEzD,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,CAAC,kBAAkB,CAAC;SAC3B,CAAA;QACD,OAAO,OAAO,CAAC,gBAAO,GAAG,uBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;YAClE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|