@segment/action-destinations 3.83.0-alpha.1 → 3.83.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/cordial/addProductToCart/generated-types.d.ts +17 -0
- package/dist/destinations/cordial/addProductToCart/generated-types.js +3 -0
- package/dist/destinations/cordial/addProductToCart/generated-types.js.map +1 -0
- package/dist/destinations/cordial/addProductToCart/index.d.ts +5 -0
- package/dist/destinations/cordial/addProductToCart/index.js +116 -0
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -0
- package/dist/destinations/cordial/cordial-client.d.ts +6 -0
- package/dist/destinations/cordial/cordial-client.js +42 -0
- package/dist/destinations/cordial/cordial-client.js.map +1 -1
- package/dist/destinations/cordial/index.js +9 -3
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/generated-types.d.ts +7 -0
- package/dist/destinations/cordial/removeProductFromCart/generated-types.js +3 -0
- package/dist/destinations/cordial/removeProductFromCart/generated-types.js.map +1 -0
- package/dist/destinations/cordial/removeProductFromCart/index.d.ts +5 -0
- package/dist/destinations/cordial/removeProductFromCart/index.js +44 -0
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -0
- package/dist/destinations/cordial/upsertOrder/generated-types.d.ts +26 -0
- package/dist/destinations/cordial/upsertOrder/generated-types.js +3 -0
- package/dist/destinations/cordial/upsertOrder/generated-types.js.map +1 -0
- package/dist/destinations/cordial/upsertOrder/index.d.ts +5 -0
- package/dist/destinations/cordial/upsertOrder/index.js +179 -0
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -0
- package/dist/destinations/fullstory/generated-types.d.ts +3 -0
- package/dist/destinations/fullstory/generated-types.js +3 -0
- package/dist/destinations/fullstory/generated-types.js.map +1 -0
- package/dist/destinations/fullstory/identifyUser/generated-types.d.ts +9 -0
- package/dist/destinations/fullstory/identifyUser/generated-types.js +3 -0
- package/dist/destinations/fullstory/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/fullstory/identifyUser/index.d.ts +4 -0
- package/dist/destinations/fullstory/identifyUser/index.js +73 -0
- package/dist/destinations/fullstory/identifyUser/index.js.map +1 -0
- package/dist/destinations/fullstory/index.d.ts +4 -0
- package/dist/destinations/fullstory/index.js +56 -0
- package/dist/destinations/fullstory/index.js.map +1 -0
- package/dist/destinations/fullstory/request-params.d.ts +18 -0
- package/dist/destinations/fullstory/request-params.js +70 -0
- package/dist/destinations/fullstory/request-params.js.map +1 -0
- package/dist/destinations/fullstory/trackEvent/generated-types.d.ts +10 -0
- package/dist/destinations/fullstory/trackEvent/generated-types.js +3 -0
- package/dist/destinations/fullstory/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/fullstory/trackEvent/index.d.ts +5 -0
- package/dist/destinations/fullstory/trackEvent/index.js +79 -0
- package/dist/destinations/fullstory/trackEvent/index.js.map +1 -0
- package/dist/destinations/fullstory/vars.d.ts +3 -0
- package/dist/destinations/fullstory/vars.js +100 -0
- package/dist/destinations/fullstory/vars.js.map +1 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +29 -20
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addToCart/index.js +27 -18
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +27 -18
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +28 -19
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/customEvent/index.js +25 -15
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +3 -0
- package/dist/destinations/google-analytics-4/ga4-functions.js +33 -1
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +1 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js +9 -1
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js +26 -17
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/login/index.js +26 -16
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/pageView/index.js +28 -18
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/purchase/index.js +32 -23
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/refund/index.js +32 -23
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +27 -18
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/search/index.js +26 -16
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/selectItem/index.js +27 -18
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +30 -21
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/signUp/index.js +26 -16
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewCart/index.js +27 -18
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewItem/index.js +27 -18
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewItemList/index.js +27 -18
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +30 -21
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js +4 -8
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js.map +1 -1
- package/dist/destinations/talon-one/index.js +5 -1
- package/dist/destinations/talon-one/index.js.map +1 -1
- package/dist/destinations/talon-one/t1-properties.d.ts +5 -0
- package/dist/destinations/talon-one/t1-properties.js +179 -1
- package/dist/destinations/talon-one/t1-properties.js.map +1 -1
- package/dist/destinations/talon-one/trackEvent/generated-types.d.ts +4 -0
- package/dist/destinations/talon-one/trackEvent/index.js +37 -2
- package/dist/destinations/talon-one/trackEvent/index.js.map +1 -1
- package/dist/destinations/talon-one/updateCustomerProfile/generated-types.d.ts +4 -0
- package/dist/destinations/talon-one/updateCustomerProfile/index.js +38 -3
- package/dist/destinations/talon-one/updateCustomerProfile/index.js.map +1 -1
- package/dist/destinations/talon-one/updateCustomerProfileV2/generated-types.d.ts +19 -0
- package/dist/destinations/talon-one/updateCustomerProfileV2/generated-types.js +3 -0
- package/dist/destinations/talon-one/updateCustomerProfileV2/generated-types.js.map +1 -0
- package/dist/destinations/talon-one/updateCustomerProfileV2/index.d.ts +5 -0
- package/dist/destinations/talon-one/updateCustomerProfileV2/index.js +36 -0
- package/dist/destinations/talon-one/updateCustomerProfileV2/index.js.map +1 -0
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.d.ts +4 -0
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js +36 -1
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js.map +1 -1
- package/dist/destinations/talon-one/updateCustomerSession/generated-types.d.ts +47 -0
- package/dist/destinations/talon-one/updateCustomerSession/generated-types.js +3 -0
- package/dist/destinations/talon-one/updateCustomerSession/generated-types.js.map +1 -0
- package/dist/destinations/talon-one/updateCustomerSession/index.d.ts +5 -0
- package/dist/destinations/talon-one/updateCustomerSession/index.js +117 -0
- package/dist/destinations/talon-one/updateCustomerSession/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
userIdentities: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
productID: string;
|
|
6
|
+
sku: string;
|
|
7
|
+
qty: number;
|
|
8
|
+
category: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
itemPrice?: number;
|
|
12
|
+
url?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
properties?: {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addProductToCart/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
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 cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Add Product to Cart',
|
|
9
|
+
description: 'Add product to Cordial contact cart',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Product Added"',
|
|
11
|
+
fields: {
|
|
12
|
+
userIdentities: {
|
|
13
|
+
label: 'User Identities',
|
|
14
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
+
type: 'object',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultObjectUI: 'keyvalue:only'
|
|
18
|
+
},
|
|
19
|
+
productID: {
|
|
20
|
+
label: 'Product ID',
|
|
21
|
+
description: 'Internal identifier of a product',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.properties.product_id'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
sku: {
|
|
29
|
+
label: 'SKU',
|
|
30
|
+
description: 'SKU of a product',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: true,
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.properties.sku'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
qty: {
|
|
38
|
+
label: 'Quantity',
|
|
39
|
+
description: 'Quantity of a product',
|
|
40
|
+
type: 'integer',
|
|
41
|
+
required: true,
|
|
42
|
+
default: {
|
|
43
|
+
'@path': '$.properties.quantity'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
category: {
|
|
47
|
+
label: 'Category',
|
|
48
|
+
description: 'Category of a product',
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: true,
|
|
51
|
+
default: {
|
|
52
|
+
'@path': '$.properties.category'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
name: {
|
|
56
|
+
label: 'Name',
|
|
57
|
+
description: 'Name of a product',
|
|
58
|
+
type: 'string',
|
|
59
|
+
required: true,
|
|
60
|
+
default: {
|
|
61
|
+
'@path': '$.properties.name'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
description: {
|
|
65
|
+
label: 'Description',
|
|
66
|
+
description: 'Description of a product',
|
|
67
|
+
type: 'string',
|
|
68
|
+
required: false
|
|
69
|
+
},
|
|
70
|
+
itemPrice: {
|
|
71
|
+
label: 'Price',
|
|
72
|
+
description: 'Price of a product',
|
|
73
|
+
type: 'number',
|
|
74
|
+
required: false,
|
|
75
|
+
default: {
|
|
76
|
+
'@path': '$.properties.price'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
url: {
|
|
80
|
+
label: 'URL',
|
|
81
|
+
description: 'URL of a product',
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: false,
|
|
84
|
+
default: {
|
|
85
|
+
'@path': '$.properties.url'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
imageUrl: {
|
|
89
|
+
label: 'Image URL',
|
|
90
|
+
description: 'Image of a product',
|
|
91
|
+
type: 'string',
|
|
92
|
+
required: false,
|
|
93
|
+
default: {
|
|
94
|
+
'@path': '$.properties.image_url'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
properties: {
|
|
98
|
+
label: 'Properties',
|
|
99
|
+
description: 'Properties of a product (e.g brand, color, size)',
|
|
100
|
+
type: 'object',
|
|
101
|
+
required: false,
|
|
102
|
+
default: {
|
|
103
|
+
brand: { '@path': '$.properties.brand' },
|
|
104
|
+
variant: { '@path': '$.properties.variant' },
|
|
105
|
+
coupon: { '@path': '$.properties.coupon' }
|
|
106
|
+
},
|
|
107
|
+
defaultObjectUI: 'keyvalue:only'
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
perform: (request, { settings, payload }) => {
|
|
111
|
+
const client = new cordial_client_1.default(settings, request);
|
|
112
|
+
return client.addProductToCart(payload);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
exports.default = action;
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addProductToCart/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,qCAAqC;IAClD,mBAAmB,EAAE,4CAA4C;IACjE,MAAM,EAAE;QACN,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,oTAAoT;YACtT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,QA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AAO,EAAE,qBAAqB,EAAE;aAC3C;YACD,eAAe,EAAE,eAAe;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,6 +4,9 @@ import { Payload as AddContactToListPayload } from './addContactToList/generated
|
|
|
4
4
|
import { Payload as CreateContactactivityPayload } from './createContactactivity/generated-types';
|
|
5
5
|
import { Payload as RemoveContactFromListPayload } from './removeContactFromList/generated-types';
|
|
6
6
|
import { Payload as UpsertContactPayload } from './upsertContact/generated-types';
|
|
7
|
+
import { Payload as AddProductToCartPayload } from './addProductToCart/generated-types';
|
|
8
|
+
import { Payload as RemoveProductFromCartPayload } from './removeProductFromCart/generated-types';
|
|
9
|
+
import { Payload as UpsertOrder } from './upsertOrder/generated-types';
|
|
7
10
|
declare class CordialClient {
|
|
8
11
|
private readonly apiUrl;
|
|
9
12
|
private readonly request;
|
|
@@ -12,5 +15,8 @@ declare class CordialClient {
|
|
|
12
15
|
upsertContact(payload: UpsertContactPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
13
16
|
addContactToList(payload: AddContactToListPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
14
17
|
removeContactFromList(payload: RemoveContactFromListPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
18
|
+
addProductToCart(payload: AddProductToCartPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
19
|
+
removeProductFromCart(payload: RemoveProductFromCartPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
20
|
+
upsertOrder(payload: UpsertOrder): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
15
21
|
}
|
|
16
22
|
export default CordialClient;
|
|
@@ -45,6 +45,48 @@ class CordialClient {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
async addProductToCart(payload) {
|
|
49
|
+
return this.request(`${this.apiUrl}/addProductToCart`, {
|
|
50
|
+
method: 'post',
|
|
51
|
+
json: {
|
|
52
|
+
userIdentities: payload.userIdentities,
|
|
53
|
+
productID: payload.productID,
|
|
54
|
+
sku: payload.sku,
|
|
55
|
+
qty: payload.qty,
|
|
56
|
+
category: payload.category,
|
|
57
|
+
name: payload.name,
|
|
58
|
+
description: payload.description,
|
|
59
|
+
itemPrice: payload.itemPrice,
|
|
60
|
+
url: payload.url,
|
|
61
|
+
imageUrl: payload.imageUrl,
|
|
62
|
+
properties: payload.properties
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async removeProductFromCart(payload) {
|
|
67
|
+
return this.request(`${this.apiUrl}/removeProductFromCart`, {
|
|
68
|
+
method: 'post',
|
|
69
|
+
json: {
|
|
70
|
+
userIdentities: payload.userIdentities,
|
|
71
|
+
productID: payload.productID,
|
|
72
|
+
qty: payload.qty
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async upsertOrder(payload) {
|
|
77
|
+
return this.request(`${this.apiUrl}/upsertOrder`, {
|
|
78
|
+
method: 'post',
|
|
79
|
+
json: {
|
|
80
|
+
userIdentities: payload.userIdentities,
|
|
81
|
+
orderID: payload.orderID,
|
|
82
|
+
purchaseDate: payload.purchaseDate,
|
|
83
|
+
status: payload.status,
|
|
84
|
+
totalAmount: payload.totalAmount,
|
|
85
|
+
properties: payload.properties,
|
|
86
|
+
items: payload.items
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
48
90
|
}
|
|
49
91
|
exports.default = CordialClient;
|
|
50
92
|
//# sourceMappingURL=cordial-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;AAUA,MAAM,aAAa;IAIjB,YAAY,QAAkB,EAAE,OAAsB;QACpD,IAAI,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,cAAc,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,kBAAkB,CAAC,OAAqC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,wBAAwB,EAAE;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,gBAAgB,EAAE;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAAgC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,mBAAmB,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAA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;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAoB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,cAAc,EAAE;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -7,6 +7,9 @@ const createContactactivity_1 = __importDefault(require("./createContactactivity
|
|
|
7
7
|
const upsertContact_1 = __importDefault(require("./upsertContact"));
|
|
8
8
|
const addContactToList_1 = __importDefault(require("./addContactToList"));
|
|
9
9
|
const removeContactFromList_1 = __importDefault(require("./removeContactFromList"));
|
|
10
|
+
const addProductToCart_1 = __importDefault(require("./addProductToCart"));
|
|
11
|
+
const removeProductFromCart_1 = __importDefault(require("./removeProductFromCart"));
|
|
12
|
+
const upsertOrder_1 = __importDefault(require("./upsertOrder"));
|
|
10
13
|
const destination = {
|
|
11
14
|
name: 'Cordial (Actions)',
|
|
12
15
|
description: 'Sync Segment Users, Groups and Events to Cordial',
|
|
@@ -31,19 +34,22 @@ const destination = {
|
|
|
31
34
|
}
|
|
32
35
|
},
|
|
33
36
|
testAuthentication: (request, { settings }) => {
|
|
34
|
-
return request(settings.endpoint + '/api/checkAuth');
|
|
37
|
+
return request(settings.endpoint + '/api/checkAuth', { headers: { 'Content-Type': 'application/json' } });
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
extendRequest({ settings }) {
|
|
38
41
|
return {
|
|
39
|
-
headers: { 'x-api-key': `${settings.apiKey}`, 'Accept': 'application/json' }
|
|
42
|
+
headers: { 'x-api-key': `${settings.apiKey}`, 'Accept': 'application/json' }
|
|
40
43
|
};
|
|
41
44
|
},
|
|
42
45
|
actions: {
|
|
43
46
|
createContactactivity: createContactactivity_1.default,
|
|
44
47
|
upsertContact: upsertContact_1.default,
|
|
45
48
|
addContactToList: addContactToList_1.default,
|
|
46
|
-
removeContactFromList: removeContactFromList_1.default
|
|
49
|
+
removeContactFromList: removeContactFromList_1.default,
|
|
50
|
+
addProductToCart: addProductToCart_1.default,
|
|
51
|
+
removeProductFromCart: removeProductFromCart_1.default,
|
|
52
|
+
upsertOrder: upsertOrder_1.default
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
55
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/cordial/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAC3D,oEAA2C;AAC3C,0EAAiD;AACjD,oFAA2D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/cordial/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAC3D,oEAA2C;AAC3C,0EAAiD;AACjD,oFAA2D;AAC3D,0EAAiD;AACjD,oFAA2D;AAC3D,gEAAuC;AAEvC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EACT,mMAAmM;gBACrM,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,kDAAkD;aAC5D;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAC,CAAC,CAAC;QAC3G,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAC;SAC5E,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;QACrB,aAAa,EAAb,uBAAa;QACb,gBAAgB,EAAhB,0BAAgB;QAChB,qBAAqB,EAArB,+BAAqB;QACrB,gBAAgB,EAAhB,0BAAgB;QAChB,qBAAqB,EAArB,+BAAqB;QACrB,WAAW,EAAX,qBAAW;KACZ;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeProductFromCart/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Remove Product from Cart',
|
|
9
|
+
description: 'Removes product from Cordial contact cart',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Product Removed"',
|
|
11
|
+
fields: {
|
|
12
|
+
userIdentities: {
|
|
13
|
+
label: 'User Identities',
|
|
14
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
+
type: 'object',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultObjectUI: 'keyvalue:only'
|
|
18
|
+
},
|
|
19
|
+
productID: {
|
|
20
|
+
label: 'Product ID',
|
|
21
|
+
description: 'Internal identifier of a product',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.properties.product_id'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
qty: {
|
|
29
|
+
label: 'Quantity',
|
|
30
|
+
description: 'Quantity of a product',
|
|
31
|
+
type: 'integer',
|
|
32
|
+
required: true,
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.properties.quantity'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
perform: (request, { settings, payload }) => {
|
|
39
|
+
const client = new cordial_client_1.default(settings, request);
|
|
40
|
+
return client.removeProductFromCart(payload);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.default = action;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeProductFromCart/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,2CAA2C;IACxD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,oTAAoT;YACtT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
userIdentities: {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
orderID: string;
|
|
6
|
+
purchaseDate: string | number;
|
|
7
|
+
status: string;
|
|
8
|
+
totalAmount: number;
|
|
9
|
+
properties?: {
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
items: {
|
|
13
|
+
productID: string;
|
|
14
|
+
sku: string;
|
|
15
|
+
category?: string;
|
|
16
|
+
name: string;
|
|
17
|
+
manufacturerName?: string;
|
|
18
|
+
itemPrice?: number;
|
|
19
|
+
qty?: number;
|
|
20
|
+
url?: string;
|
|
21
|
+
imageUrl?: string;
|
|
22
|
+
properties?: {
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertOrder/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,179 @@
|
|
|
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 cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Upsert Order',
|
|
9
|
+
description: 'Upserts order to Cordial',
|
|
10
|
+
defaultSubscription: 'event = "Order Completed" or event = "Order Updated" or event = "Order Refunded" or event = "Order Cancelled"',
|
|
11
|
+
fields: {
|
|
12
|
+
userIdentities: {
|
|
13
|
+
label: 'User Identities',
|
|
14
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
+
type: 'object',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultObjectUI: 'keyvalue:only'
|
|
18
|
+
},
|
|
19
|
+
orderID: {
|
|
20
|
+
label: 'Order ID',
|
|
21
|
+
description: 'Internal identifier of an order',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.properties.order_id'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
purchaseDate: {
|
|
29
|
+
label: 'Order purchase date',
|
|
30
|
+
description: 'Order purchase date',
|
|
31
|
+
type: 'datetime',
|
|
32
|
+
required: true,
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.timestamp'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
status: {
|
|
38
|
+
label: 'Order status',
|
|
39
|
+
description: 'Order status (e.g. completed/cancelled/returned)',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true,
|
|
42
|
+
default: {
|
|
43
|
+
'@path': '$.event'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
totalAmount: {
|
|
47
|
+
label: 'Order total',
|
|
48
|
+
description: 'Order total amount',
|
|
49
|
+
type: 'number',
|
|
50
|
+
required: true,
|
|
51
|
+
default: {
|
|
52
|
+
'@path': '$.properties.total'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
properties: {
|
|
56
|
+
label: 'Order properties',
|
|
57
|
+
description: 'Additional order properties (e.g. affiliation/tax/revenue)',
|
|
58
|
+
type: 'object',
|
|
59
|
+
required: false,
|
|
60
|
+
default: {
|
|
61
|
+
affiliation: { '@path': '$.properties.affiliation' },
|
|
62
|
+
revenue: { '@path': '$.properties.revenue' },
|
|
63
|
+
shipping: { '@path': '$.properties.shipping' },
|
|
64
|
+
tax: { '@path': '$.properties.tax' },
|
|
65
|
+
discount: { '@path': '$.properties.discount' },
|
|
66
|
+
coupon: { '@path': '$.properties.coupon' },
|
|
67
|
+
currency: { '@path': '$.properties.currency' }
|
|
68
|
+
},
|
|
69
|
+
defaultObjectUI: 'keyvalue:only'
|
|
70
|
+
},
|
|
71
|
+
items: {
|
|
72
|
+
label: 'Order items',
|
|
73
|
+
description: 'Order items',
|
|
74
|
+
type: 'object',
|
|
75
|
+
required: true,
|
|
76
|
+
multiple: true,
|
|
77
|
+
properties: {
|
|
78
|
+
productID: {
|
|
79
|
+
label: 'ID',
|
|
80
|
+
description: 'ID of the purchased item.',
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: true
|
|
83
|
+
},
|
|
84
|
+
sku: {
|
|
85
|
+
label: 'SKU',
|
|
86
|
+
description: 'SKU of the purchased item.',
|
|
87
|
+
type: 'string',
|
|
88
|
+
required: true
|
|
89
|
+
},
|
|
90
|
+
category: {
|
|
91
|
+
label: 'Category',
|
|
92
|
+
description: 'Category of the purchased item.',
|
|
93
|
+
type: 'string'
|
|
94
|
+
},
|
|
95
|
+
name: {
|
|
96
|
+
label: 'Name',
|
|
97
|
+
description: 'Name of the purchased item.',
|
|
98
|
+
type: 'string',
|
|
99
|
+
required: true
|
|
100
|
+
},
|
|
101
|
+
manufacturerName: {
|
|
102
|
+
label: 'Manufacturer name',
|
|
103
|
+
description: 'Manufacturer name of the purchased item.',
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
|
+
itemPrice: {
|
|
107
|
+
label: 'Price',
|
|
108
|
+
description: 'Price of the purchased item.',
|
|
109
|
+
type: 'number',
|
|
110
|
+
},
|
|
111
|
+
qty: {
|
|
112
|
+
label: 'Quantity',
|
|
113
|
+
description: 'Quantity of the purchased item.',
|
|
114
|
+
type: 'integer',
|
|
115
|
+
},
|
|
116
|
+
url: {
|
|
117
|
+
label: 'URL',
|
|
118
|
+
description: 'URL of the purchased item.',
|
|
119
|
+
type: 'string',
|
|
120
|
+
},
|
|
121
|
+
imageUrl: {
|
|
122
|
+
label: 'Image URL',
|
|
123
|
+
description: 'Image URL of the purchased item.',
|
|
124
|
+
type: 'string',
|
|
125
|
+
},
|
|
126
|
+
properties: {
|
|
127
|
+
label: 'Properties',
|
|
128
|
+
description: 'Additional properties of the purchased item.',
|
|
129
|
+
type: 'object',
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
default: {
|
|
133
|
+
'@arrayPath': [
|
|
134
|
+
'$.properties.products',
|
|
135
|
+
{
|
|
136
|
+
productID: {
|
|
137
|
+
'@path': '$.product_id'
|
|
138
|
+
},
|
|
139
|
+
sku: {
|
|
140
|
+
'@path': '$.sku'
|
|
141
|
+
},
|
|
142
|
+
category: {
|
|
143
|
+
'@path': '$.category'
|
|
144
|
+
},
|
|
145
|
+
name: {
|
|
146
|
+
'@path': '$.name'
|
|
147
|
+
},
|
|
148
|
+
manufacturerNname: {
|
|
149
|
+
'@path': '$.brand'
|
|
150
|
+
},
|
|
151
|
+
itemPrice: {
|
|
152
|
+
'@path': '$.price'
|
|
153
|
+
},
|
|
154
|
+
qty: {
|
|
155
|
+
'@path': '$.quantity'
|
|
156
|
+
},
|
|
157
|
+
url: {
|
|
158
|
+
'@path': '$.url'
|
|
159
|
+
},
|
|
160
|
+
imageUrl: {
|
|
161
|
+
'@path': '$.image_url'
|
|
162
|
+
},
|
|
163
|
+
properties: {
|
|
164
|
+
variant: { '@path': '$.variant' },
|
|
165
|
+
coupon: { '@path': '$.coupon' }
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
defaultObjectUI: 'keyvalue:only'
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
perform: (request, { settings, payload }) => {
|
|
174
|
+
const client = new cordial_client_1.default(settings, request);
|
|
175
|
+
return client.upsertOrder(payload);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
exports.default = action;
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertOrder/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,+GAA+G;IACpI,MAAM,EAAE;QACN,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,oTAAoT;YACtT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IA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B;wBACD,iBAAiB,EAAE;4BACjB,OAAO,EAAE,SAAS;yBACnB;wBACD,SAAS,EAAE;4BACT,OAAO,EAAE,SAAS;yBACnB;wBACD,GAAG,EAAE;4BACH,OAAO,EAAE,YAAY;yBACtB;wBACD,GAAG,EAAE;4BACH,OAAO,EAAE,OAAO;yBACjB;wBACD,QAAQ,EAAE;4BACR,OAAO,EAAE,aAAa;yBACvB;wBACD,UAAU,EAAE;4BACV,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;4BACjC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;yBAChC;qBACF;iBACF;aACF;YACD,eAAe,EAAE,eAAe;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/fullstory/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/fullstory/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|