@segment/action-destinations 3.251.0 → 3.252.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/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/insider/cartViewedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/cartViewedEvent/index.js +1 -0
- package/dist/destinations/insider/cartViewedEvent/index.js.map +1 -1
- package/dist/destinations/insider/checkoutEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/checkoutEvent/index.js +1 -0
- package/dist/destinations/insider/checkoutEvent/index.js.map +1 -1
- package/dist/destinations/insider/insider-helpers.js +20 -1
- package/dist/destinations/insider/insider-helpers.js.map +1 -1
- package/dist/destinations/insider/insider-properties.d.ts +1 -0
- package/dist/destinations/insider/insider-properties.js +8 -1
- package/dist/destinations/insider/insider-properties.js.map +1 -1
- package/dist/destinations/insider/orderCompletedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/orderCompletedEvent/index.js +1 -0
- package/dist/destinations/insider/orderCompletedEvent/index.js.map +1 -1
- package/dist/destinations/insider/productAddedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/productAddedEvent/index.js +1 -0
- package/dist/destinations/insider/productAddedEvent/index.js.map +1 -1
- package/dist/destinations/insider/productListViewedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/productListViewedEvent/index.js +1 -0
- package/dist/destinations/insider/productListViewedEvent/index.js.map +1 -1
- package/dist/destinations/insider/productRemovedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/productRemovedEvent/index.js +1 -0
- package/dist/destinations/insider/productRemovedEvent/index.js.map +1 -1
- package/dist/destinations/insider/productViewedEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/productViewedEvent/index.js +1 -0
- package/dist/destinations/insider/productViewedEvent/index.js.map +1 -1
- package/dist/destinations/insider/trackEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/trackEvent/index.js +1 -0
- package/dist/destinations/insider/trackEvent/index.js.map +1 -1
- package/dist/destinations/insider/updateUserProfile/generated-types.d.ts +3 -0
- package/dist/destinations/insider/updateUserProfile/index.js +6 -0
- package/dist/destinations/insider/updateUserProfile/index.js.map +1 -1
- package/dist/destinations/insider/userRegisteredEvent/generated-types.d.ts +3 -0
- package/dist/destinations/insider/userRegisteredEvent/index.js +1 -0
- package/dist/destinations/insider/userRegisteredEvent/index.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +7 -1
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/api.test.js +27 -10
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +25 -7
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/constants.d.ts +9 -0
- package/dist/destinations/linkedin-conversions/constants.js +47 -1
- package/dist/destinations/linkedin-conversions/constants.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +4 -0
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +27 -10
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/types.d.ts +5 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToCart/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/addToCart/index.js +44 -0
- package/dist/destinations/moloco-rmp/addToCart/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.d.ts +32 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.js +45 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/convert.d.ts +9 -0
- package/dist/destinations/moloco-rmp/common/convert.js +71 -0
- package/dist/destinations/moloco-rmp/common/convert.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/event.d.ts +10 -0
- package/dist/destinations/moloco-rmp/common/event.js +15 -0
- package/dist/destinations/moloco-rmp/common/event.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/fields.d.ts +14 -0
- package/dist/destinations/moloco-rmp/common/fields.js +348 -0
- package/dist/destinations/moloco-rmp/common/fields.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.d.ts +35 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.js +3 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.d.ts +40 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.js +3 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/request-client.d.ts +11 -0
- package/dist/destinations/moloco-rmp/common/request-client.js +28 -0
- package/dist/destinations/moloco-rmp/common/request-client.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/settings.d.ts +4 -0
- package/dist/destinations/moloco-rmp/common/settings.js +3 -0
- package/dist/destinations/moloco-rmp/common/settings.js.map +1 -0
- package/dist/destinations/moloco-rmp/generated-types.d.ts +5 -0
- package/dist/destinations/moloco-rmp/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/home/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/home/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/home/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/home/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/home/index.js +29 -0
- package/dist/destinations/moloco-rmp/home/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/index.d.ts +4 -0
- package/dist/destinations/moloco-rmp/index.js +117 -0
- package/dist/destinations/moloco-rmp/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.js +44 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/land/generated-types.d.ts +29 -0
- package/dist/destinations/moloco-rmp/land/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/land/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/land/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/land/index.js +33 -0
- package/dist/destinations/moloco-rmp/land/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.d.ts +29 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/pageView/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/pageView/index.js +36 -0
- package/dist/destinations/moloco-rmp/pageView/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.d.ts +36 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/purchase/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/purchase/index.js +37 -0
- package/dist/destinations/moloco-rmp/purchase/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/search/generated-types.d.ts +30 -0
- package/dist/destinations/moloco-rmp/search/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/search/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/search/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/search/index.js +34 -0
- package/dist/destinations/moloco-rmp/search/index.js.map +1 -0
- package/dist/destinations/responsys/index.d.ts +1 -1
- package/dist/destinations/responsys/index.js +12 -2
- package/dist/destinations/responsys/index.js.map +1 -1
- package/dist/destinations/responsys/sendAudience/generated-types.d.ts +1 -0
- package/dist/destinations/responsys/sendAudience/index.js +17 -5
- package/dist/destinations/responsys/sendAudience/index.js.map +1 -1
- package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +1 -0
- package/dist/destinations/responsys/sendCustomTraits/index.js +17 -5
- package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -1
- package/dist/destinations/responsys/utils.d.ts +3 -1
- package/dist/destinations/responsys/utils.js +11 -3
- package/dist/destinations/responsys/utils.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +81 -4
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +12 -9
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +16 -2
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MolocoAPIClient = void 0;
|
|
4
|
+
class MolocoAPIClient {
|
|
5
|
+
constructor(request, settings) {
|
|
6
|
+
this.platform = settings.platformId;
|
|
7
|
+
this.apiKey = settings.apiKey;
|
|
8
|
+
this.request = request;
|
|
9
|
+
this.url = this.getEndpoint();
|
|
10
|
+
}
|
|
11
|
+
getEndpoint() {
|
|
12
|
+
return `https://${this.platform.replace(/_/g, '-')}-evt.rmp-api.moloco.com/cdp/SEGMENT`;
|
|
13
|
+
}
|
|
14
|
+
async sendEvent(body) {
|
|
15
|
+
const headers = {
|
|
16
|
+
'x-api-key': this.apiKey,
|
|
17
|
+
'x-platform-id': this.platform,
|
|
18
|
+
'Content-Type': 'application/json'
|
|
19
|
+
};
|
|
20
|
+
return await this.request(this.url, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
headers,
|
|
23
|
+
json: body
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.MolocoAPIClient = MolocoAPIClient;
|
|
28
|
+
//# sourceMappingURL=request-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-client.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/common/request-client.ts"],"names":[],"mappings":";;;AAMA,MAAa,eAAe;IAOxB,YAAY,OAAsB,EAAE,QAAkB;QAClD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;IACjC,CAAC;IAEO,WAAW;QACf,OAAO,WAAW,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,qCAAqC,CAAA;IAC3F,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAyB;QACrC,MAAM,OAAO,GAAG;YACZ,WAAW,EAAE,IAAI,CAAC,MAAM;YACxB,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,cAAc,EAAE,kBAAkB;SACrC,CAAA;QAED,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI,EAAE,IAAI;SACb,CAAC,CAAA;IACN,CAAC;CACJ;AAhCD,0CAgCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/common/settings.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/moloco-rmp/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items?: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
page_id?: string;
|
|
25
|
+
page_identifier_tokens?: {
|
|
26
|
+
[k: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/home/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Home',
|
|
9
|
+
defaultSubscription: 'type = "page" and properties.name = "Home"',
|
|
10
|
+
description: 'Represents a user visiting a home page',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: fields_1.items,
|
|
19
|
+
page_id: fields_1.page_id,
|
|
20
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
21
|
+
},
|
|
22
|
+
perform: (request, { payload, settings }) => {
|
|
23
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
24
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.Home, payload, settings });
|
|
25
|
+
return client.sendEvent(body);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.default = action;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/home/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAUyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,MAAM;IACb,mBAAmB,EAAE,4CAA4C;IACjE,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAL,cAAK;QACL,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;KACvB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC3E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const home_1 = __importDefault(require("./home"));
|
|
8
|
+
const search_1 = __importDefault(require("./search"));
|
|
9
|
+
const addToWishlist_1 = __importDefault(require("./addToWishlist"));
|
|
10
|
+
const itemPageView_1 = __importDefault(require("./itemPageView"));
|
|
11
|
+
const pageView_1 = __importDefault(require("./pageView"));
|
|
12
|
+
const land_1 = __importDefault(require("./land"));
|
|
13
|
+
const purchase_1 = __importDefault(require("./purchase"));
|
|
14
|
+
const addToCart_1 = __importDefault(require("./addToCart"));
|
|
15
|
+
const destination = {
|
|
16
|
+
name: 'Moloco Rmp',
|
|
17
|
+
slug: 'actions-moloco-rmp',
|
|
18
|
+
mode: 'cloud',
|
|
19
|
+
description: 'This destination sends user events to Moloco RMP for machine learning and ad attribution.',
|
|
20
|
+
authentication: {
|
|
21
|
+
scheme: 'custom',
|
|
22
|
+
fields: {
|
|
23
|
+
platformId: {
|
|
24
|
+
label: 'Platform ID',
|
|
25
|
+
description: 'ID of the platform',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
apiKey: {
|
|
30
|
+
label: 'API Key',
|
|
31
|
+
description: 'The API key for the platform',
|
|
32
|
+
type: 'password',
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
channel_type: {
|
|
36
|
+
label: 'Channel Type',
|
|
37
|
+
description: 'Type of channel, either APP or SITE. Defaults to SITE.',
|
|
38
|
+
type: 'string',
|
|
39
|
+
required: true,
|
|
40
|
+
choices: [
|
|
41
|
+
{ label: 'App', value: 'APP' },
|
|
42
|
+
{ label: 'Site', value: 'SITE' }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
presets: [
|
|
48
|
+
{
|
|
49
|
+
name: 'Search',
|
|
50
|
+
subscribe: 'type = "track" and event = "Products Searched"',
|
|
51
|
+
partnerAction: 'search',
|
|
52
|
+
mapping: actions_core_1.defaultValues(search_1.default.fields),
|
|
53
|
+
type: 'automatic'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Purchase',
|
|
57
|
+
subscribe: 'type = "track" and event = "Order Completed"',
|
|
58
|
+
partnerAction: 'purchase',
|
|
59
|
+
mapping: actions_core_1.defaultValues(purchase_1.default.fields),
|
|
60
|
+
type: 'automatic'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Page View',
|
|
64
|
+
subscribe: 'type = "page" and properties.name != "Home" and properties.name != "Land"',
|
|
65
|
+
partnerAction: 'pageView',
|
|
66
|
+
mapping: actions_core_1.defaultValues(pageView_1.default.fields),
|
|
67
|
+
type: 'automatic'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Land',
|
|
71
|
+
subscribe: 'type = "page" and properties.name = "Land"',
|
|
72
|
+
partnerAction: 'land',
|
|
73
|
+
mapping: actions_core_1.defaultValues(land_1.default.fields),
|
|
74
|
+
type: 'automatic'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Item Page View',
|
|
78
|
+
subscribe: 'type = "track" and event = "Product Viewed"',
|
|
79
|
+
partnerAction: 'itemPageView',
|
|
80
|
+
mapping: actions_core_1.defaultValues(itemPageView_1.default.fields),
|
|
81
|
+
type: 'automatic'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Home',
|
|
85
|
+
subscribe: 'type = "page" and properties.name = "Home"',
|
|
86
|
+
partnerAction: 'home',
|
|
87
|
+
mapping: actions_core_1.defaultValues(home_1.default.fields),
|
|
88
|
+
type: 'automatic'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'Add to Wishlist',
|
|
92
|
+
subscribe: 'type = "track" and event = "Product Added to Wishlist"',
|
|
93
|
+
partnerAction: 'addToWishlist',
|
|
94
|
+
mapping: actions_core_1.defaultValues(addToWishlist_1.default.fields),
|
|
95
|
+
type: 'automatic'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Add to Cart',
|
|
99
|
+
subscribe: 'type = "track" and event = "Product Added"',
|
|
100
|
+
partnerAction: 'addToCart',
|
|
101
|
+
mapping: actions_core_1.defaultValues(addToCart_1.default.fields),
|
|
102
|
+
type: 'automatic'
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
actions: {
|
|
106
|
+
home: home_1.default,
|
|
107
|
+
search: search_1.default,
|
|
108
|
+
addToWishlist: addToWishlist_1.default,
|
|
109
|
+
itemPageView: itemPageView_1.default,
|
|
110
|
+
pageView: pageView_1.default,
|
|
111
|
+
land: land_1.default,
|
|
112
|
+
purchase: purchase_1.default,
|
|
113
|
+
addToCart: addToCart_1.default
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.default = destination;
|
|
117
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/moloco-rmp/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
page_id?: string;
|
|
25
|
+
page_identifier_tokens?: {
|
|
26
|
+
[k: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/itemPageView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Item Page View',
|
|
9
|
+
description: 'Represents a user viewing an item page',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Product Viewed"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: {
|
|
19
|
+
...fields_1.items,
|
|
20
|
+
required: true,
|
|
21
|
+
default: {
|
|
22
|
+
'@arrayPath': [
|
|
23
|
+
'$.properties',
|
|
24
|
+
{
|
|
25
|
+
id: { '@path': '$.product_id' },
|
|
26
|
+
price: { '@path': '$.price' },
|
|
27
|
+
currency: { '@path': '$.currency' },
|
|
28
|
+
quantity: { '@path': '$.quantity' },
|
|
29
|
+
seller_id: { '@path': '$.seller_id' }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
page_id: fields_1.page_id,
|
|
35
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
36
|
+
},
|
|
37
|
+
perform: (request, { payload, settings }) => {
|
|
38
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
39
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.ItemPageView, payload, settings });
|
|
40
|
+
return client.sendEvent(body);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.default = action;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/itemPageView/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAUyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,6CAA6C;IAClE,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAE;YACL,GAAG,cAAK;YACR,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,YAAY,EAAE;oBACZ,cAAc;oBACd;wBACE,EAAE,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;wBAC/B,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;wBAC7B,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;wBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;wBACnC,SAAS,EAAE,EAAE,OAAO,EAAE,aAAa,EAAC;qBACrC;iBACF;aACF;SACF;QACD,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;KACvB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QACnF,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items?: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
page_id?: string;
|
|
25
|
+
page_identifier_tokens?: {
|
|
26
|
+
[k: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
referrer_page_id: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/land/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Land',
|
|
9
|
+
description: 'Represents a user visiting the client’s website from an external source (ex. Google Shopping)',
|
|
10
|
+
defaultSubscription: 'type = "page" and properties.name = "Land"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: fields_1.items,
|
|
19
|
+
page_id: fields_1.page_id,
|
|
20
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
21
|
+
referrer_page_id: {
|
|
22
|
+
...fields_1.referrer_page_id,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
perform: (request, { payload, settings }) => {
|
|
27
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
28
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.Land, payload, settings });
|
|
29
|
+
return client.sendEvent(body);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.default = action;
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/land/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAWyB;AACzB,6DAA0D;AAG1D,+CAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,+FAA+F;IAC5G,mBAAmB,EAAE,4CAA4C;IACjE,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAL,cAAK;QACL,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;QACtB,gBAAgB,EAAE;YAChB,GAAG,yBAAgB;YACnB,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC3E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items?: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
page_id?: string;
|
|
25
|
+
page_identifier_tokens?: {
|
|
26
|
+
[k: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
referrer_page_id?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/pageView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Page View',
|
|
9
|
+
description: 'Represents a user viewing a certain page that is pertinent to sequence-based ML model training (Ex. a user browsing sneakers)',
|
|
10
|
+
defaultSubscription: 'type = "page" and properties.name != "Home" and properties.name != "Land"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: fields_1.items,
|
|
19
|
+
page_id: {
|
|
20
|
+
...fields_1.page_id,
|
|
21
|
+
description: fields_1.page_id.description + ' Either page_id or page_identifier_tokens is required.'
|
|
22
|
+
},
|
|
23
|
+
page_identifier_tokens: {
|
|
24
|
+
...fields_1.page_identifier_tokens,
|
|
25
|
+
description: fields_1.page_identifier_tokens.description + ' Either page_id or page_identifier_tokens is required.'
|
|
26
|
+
},
|
|
27
|
+
referrer_page_id: fields_1.referrer_page_id
|
|
28
|
+
},
|
|
29
|
+
perform: (request, { payload, settings }) => {
|
|
30
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
31
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.PageView, payload, settings });
|
|
32
|
+
return client.sendEvent(body);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = action;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/pageView/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAWyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EACT,+HAA+H;IACjI,mBAAmB,EAAE,2EAA2E;IAChG,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAL,cAAK;QACL,OAAO,EAAE;YACP,GAAG,gBAAO;YACV,WAAW,EAAE,gBAAO,CAAC,WAAW,GAAG,wDAAwD;SAC5F;QACD,sBAAsB,EAAE;YACtB,GAAG,+BAAsB;YACzB,WAAW,EAAE,+BAAsB,CAAC,WAAW,GAAG,wDAAwD;SAE3G;QACD,gBAAgB,EAAhB,yBAAgB;KACjB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC/E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
revenue: {
|
|
25
|
+
price: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
};
|
|
28
|
+
page_id?: string;
|
|
29
|
+
page_identifier_tokens?: {
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
shipping_charge?: {
|
|
33
|
+
price: number;
|
|
34
|
+
currency: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/purchase/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Purchase',
|
|
9
|
+
description: 'Represents a user purchasing an item',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: {
|
|
19
|
+
...fields_1.items,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
revenue: {
|
|
23
|
+
...fields_1.revenue,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
page_id: fields_1.page_id,
|
|
27
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
28
|
+
shipping_charge: fields_1.shipping_charge
|
|
29
|
+
},
|
|
30
|
+
perform: (request, { payload, settings }) => {
|
|
31
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
32
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.Purchase, payload, settings });
|
|
33
|
+
return client.sendEvent(body);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.default = action;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/purchase/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAYyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAE;YACL,GAAG,cAAK;YACR,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAE;YACP,GAAG,gBAAO;YACV,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;QACtB,eAAe,EAAf,wBAAe;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,CAAC,CAAA;QAC9E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|