@segment/action-destinations 3.457.1-staging-2bbab8979.0 → 3.459.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/airship/utilities.d.ts +1 -1
- package/dist/destinations/airship/utilities.js +12 -4
- package/dist/destinations/airship/utilities.js.map +1 -1
- package/dist/destinations/altertable/event/generated-types.d.ts +27 -0
- package/dist/destinations/altertable/event/generated-types.js.map +1 -0
- package/dist/destinations/altertable/event/index.js +64 -0
- package/dist/destinations/altertable/event/index.js.map +1 -0
- package/dist/destinations/altertable/fields.d.ts +2 -0
- package/dist/destinations/altertable/fields.js +165 -0
- package/dist/destinations/altertable/fields.js.map +1 -0
- package/dist/destinations/altertable/generated-types.d.ts +5 -0
- package/dist/destinations/altertable/generated-types.js.map +1 -0
- package/dist/destinations/altertable/identify/generated-types.d.ts +26 -0
- package/dist/destinations/altertable/identify/generated-types.js.map +1 -0
- package/dist/destinations/altertable/identify/index.js +35 -0
- package/dist/destinations/altertable/identify/index.js.map +1 -0
- package/dist/destinations/altertable/index.d.ts +4 -0
- package/dist/destinations/altertable/index.js +96 -0
- package/dist/destinations/altertable/index.js.map +1 -0
- package/dist/destinations/altertable/types.d.ts +29 -0
- package/dist/destinations/altertable/types.js.map +1 -0
- package/dist/destinations/altertable/utils.d.ts +5 -0
- package/dist/destinations/altertable/utils.js +63 -0
- package/dist/destinations/altertable/utils.js.map +1 -0
- package/dist/destinations/amazon-amc/function.d.ts +2 -4
- package/dist/destinations/amazon-amc/function.js +18 -44
- package/dist/destinations/amazon-amc/function.js.map +1 -1
- package/dist/destinations/amazon-amc/generated-types.d.ts +1 -5
- package/dist/destinations/amazon-amc/index.js +34 -89
- package/dist/destinations/amazon-amc/index.js.map +1 -1
- package/dist/destinations/amazon-amc/syncAudiencesToDSP/index.js +1 -1
- package/dist/destinations/amazon-amc/syncAudiencesToDSP/index.js.map +1 -1
- package/dist/destinations/amazon-amc/types.d.ts +0 -44
- package/dist/destinations/amazon-amc/types.js +1 -4
- package/dist/destinations/amazon-amc/types.js.map +1 -1
- package/dist/destinations/amazon-amc/utils.d.ts +49 -3
- package/dist/destinations/amazon-amc/utils.js +24 -10
- package/dist/destinations/amazon-amc/utils.js.map +1 -1
- package/dist/destinations/amplitude/event-schema.js +3 -30
- package/dist/destinations/amplitude/event-schema.js.map +1 -1
- package/dist/destinations/amplitude/logEvent/generated-types.d.ts +0 -4
- package/dist/destinations/amplitude/logEvent/index.js +3 -11
- package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
- package/dist/destinations/amplitude/logEventV2/generated-types.d.ts +0 -4
- package/dist/destinations/amplitude/logEventV2/index.js +5 -10
- package/dist/destinations/amplitude/logEventV2/index.js.map +1 -1
- package/dist/destinations/amplitude/logPurchase/generated-types.d.ts +0 -4
- package/dist/destinations/amplitude/logPurchase/index.js +6 -11
- package/dist/destinations/amplitude/logPurchase/index.js.map +1 -1
- package/dist/destinations/aws-kinesis/utils.js +0 -3
- package/dist/destinations/aws-kinesis/utils.js.map +1 -1
- package/dist/destinations/braze/index.js +5 -65
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/collab-travel-crm/generated-types.d.ts +3 -0
- package/dist/destinations/collab-travel-crm/generated-types.js.map +1 -0
- package/dist/destinations/collab-travel-crm/identifyUser/generated-types.d.ts +10 -0
- package/dist/destinations/collab-travel-crm/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/{salesforce-marketing-cloud/asyncDataExtension → collab-travel-crm/identifyUser}/index.d.ts +1 -1
- package/dist/destinations/collab-travel-crm/identifyUser/index.js +82 -0
- package/dist/destinations/collab-travel-crm/identifyUser/index.js.map +1 -0
- package/dist/destinations/collab-travel-crm/index.d.ts +4 -0
- package/dist/destinations/collab-travel-crm/index.js +73 -0
- package/dist/destinations/collab-travel-crm/index.js.map +1 -0
- package/dist/destinations/collab-travel-crm/trackEvent/generated-types.d.ts +9 -0
- package/dist/destinations/collab-travel-crm/trackEvent/generated-types.js +3 -0
- package/dist/destinations/collab-travel-crm/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/collab-travel-crm/trackEvent/index.js +67 -0
- package/dist/destinations/collab-travel-crm/trackEvent/index.js.map +1 -0
- package/dist/destinations/customerio/index.js +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.js +6 -2
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/index.js +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/index.js.map +1 -1
- package/dist/destinations/index.js +3 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable-lists/syncAudience/iterable-client.d.ts +2 -3
- package/dist/destinations/iterable-lists/syncAudience/iterable-client.js +5 -5
- package/dist/destinations/iterable-lists/syncAudience/iterable-client.js.map +1 -1
- package/dist/destinations/kafka/generated-types.d.ts +3 -0
- package/dist/destinations/kafka/index.js +21 -0
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/send/generated-types.d.ts +0 -1
- package/dist/destinations/kafka/send/index.js +0 -7
- package/dist/destinations/kafka/send/index.js.map +1 -1
- package/dist/destinations/kafka/utils.js +13 -0
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/lark/createUsageEvent/generated-types.d.ts +9 -0
- package/dist/destinations/lark/createUsageEvent/generated-types.js +3 -0
- package/dist/destinations/lark/createUsageEvent/generated-types.js.map +1 -0
- package/dist/destinations/lark/createUsageEvent/index.d.ts +5 -0
- package/dist/destinations/lark/createUsageEvent/index.js +72 -0
- package/dist/destinations/lark/createUsageEvent/index.js.map +1 -0
- package/dist/destinations/lark/generated-types.d.ts +3 -0
- package/dist/destinations/lark/generated-types.js +3 -0
- package/dist/destinations/lark/generated-types.js.map +1 -0
- package/dist/destinations/{memora → lark}/index.d.ts +0 -2
- package/dist/destinations/lark/index.js +54 -0
- package/dist/destinations/lark/index.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateAudience/fields.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +2 -6
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/generated-types.d.ts +4 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js +23 -0
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/optimizely-client.js +5 -2
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/optimizely-client.js.map +1 -1
- package/dist/destinations/salesforce-marketing-cloud/index.d.ts +1 -1
- package/dist/destinations/salesforce-marketing-cloud/index.js +1 -3
- package/dist/destinations/salesforce-marketing-cloud/index.js.map +1 -1
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.d.ts +0 -1
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js +0 -25
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js.map +1 -1
- package/dist/destinations/snap-audiences/index.js.map +1 -1
- package/dist/destinations/snap-audiences/syncAudience/fields.js +2 -2
- package/dist/destinations/snap-audiences/syncAudience/fields.js.map +1 -1
- package/dist/destinations/snap-audiences/syncAudience/functions.js +6 -27
- package/dist/destinations/snap-audiences/syncAudience/functions.js.map +1 -1
- package/dist/destinations/snap-audiences/syncAudience/types.d.ts +1 -1
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/constants.js +11 -11
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js +3 -9
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js +2 -2
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js.map +1 -1
- package/dist/destinations/taguchi/syncUserProfile/utils.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/functions.d.ts +2 -2
- package/dist/destinations/the-trade-desk-crm/functions.js +18 -76
- package/dist/destinations/the-trade-desk-crm/functions.js.map +1 -1
- package/dist/destinations/tiktok-app-events/index.js +1 -1
- package/dist/destinations/tiktok-app-events/index.js.map +1 -1
- package/dist/destinations/tiktok-app-events/reportAppEvent/constants.js.map +1 -1
- package/dist/destinations/tiktok-app-events/reportAppEvent/fields/common_fields.js +29 -29
- package/dist/destinations/tiktok-app-events/reportAppEvent/fields/common_fields.js.map +1 -1
- package/dist/destinations/tiktok-app-events/reportAppEvent/utils.js +3 -4
- package/dist/destinations/tiktok-app-events/reportAppEvent/utils.js.map +1 -1
- package/dist/destinations/twilio-messaging/sendMessage/constants.d.ts +3 -3
- package/dist/destinations/twilio-messaging/sendMessage/constants.js +3 -3
- package/dist/destinations/twilio-messaging/sendMessage/constants.js.map +1 -1
- package/dist/destinations/twilio-messaging/sendMessage/fields.js.map +1 -1
- package/dist/destinations/twilio-messaging/sendMessage/utils.js.map +1 -1
- package/dist/destinations/yonoma/trackEvent/index.js +1 -1
- package/dist/destinations/yonoma/trackEvent/index.js.map +1 -1
- package/dist/destinations/yonoma/trackPageView/index.js +1 -1
- package/dist/destinations/yonoma/trackPageView/index.js.map +1 -1
- package/dist/destinations/yonoma/upsertContact/index.js +3 -3
- package/dist/destinations/yonoma/upsertContact/index.js.map +1 -1
- package/dist/destinations/zapier/send/index.d.ts +1 -1
- package/dist/destinations/zapier/send/index.js +6 -0
- package/dist/destinations/zapier/send/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/amazon-amc/constants.d.ts +0 -17
- package/dist/destinations/amazon-amc/constants.js +0 -25
- package/dist/destinations/amazon-amc/constants.js.map +0 -1
- package/dist/destinations/braze/ecommerce/constants.d.ts +0 -8
- package/dist/destinations/braze/ecommerce/constants.js +0 -12
- package/dist/destinations/braze/ecommerce/constants.js.map +0 -1
- package/dist/destinations/braze/ecommerce/fields.d.ts +0 -25
- package/dist/destinations/braze/ecommerce/fields.js +0 -555
- package/dist/destinations/braze/ecommerce/fields.js.map +0 -1
- package/dist/destinations/braze/ecommerce/functions.d.ts +0 -10
- package/dist/destinations/braze/ecommerce/functions.js +0 -502
- package/dist/destinations/braze/ecommerce/functions.js.map +0 -1
- package/dist/destinations/braze/ecommerce/generated-types.d.ts +0 -40
- package/dist/destinations/braze/ecommerce/generated-types.js.map +0 -1
- package/dist/destinations/braze/ecommerce/index.js +0 -20
- package/dist/destinations/braze/ecommerce/index.js.map +0 -1
- package/dist/destinations/braze/ecommerce/types.d.ts +0 -123
- package/dist/destinations/braze/ecommerce/types.js.map +0 -1
- package/dist/destinations/braze/ecommerceSingleProduct/generated-types.d.ts +0 -38
- package/dist/destinations/braze/ecommerceSingleProduct/generated-types.js.map +0 -1
- package/dist/destinations/braze/ecommerceSingleProduct/index.js +0 -20
- package/dist/destinations/braze/ecommerceSingleProduct/index.js.map +0 -1
- package/dist/destinations/memora/generated-types.d.ts +0 -5
- package/dist/destinations/memora/generated-types.js.map +0 -1
- package/dist/destinations/memora/index.js +0 -69
- package/dist/destinations/memora/index.js.map +0 -1
- package/dist/destinations/memora/upsertProfile/generated-types.d.ts +0 -12
- package/dist/destinations/memora/upsertProfile/generated-types.js.map +0 -1
- package/dist/destinations/memora/upsertProfile/index.js +0 -297
- package/dist/destinations/memora/upsertProfile/index.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/_tests_/asyncDataExtension.test.d.ts +0 -1
- package/dist/destinations/salesforce-marketing-cloud/_tests_/asyncDataExtension.test.js +0 -96
- package/dist/destinations/salesforce-marketing-cloud/_tests_/asyncDataExtension.test.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/asyncDataExtension/generated-types.d.ts +0 -59
- package/dist/destinations/salesforce-marketing-cloud/asyncDataExtension/generated-types.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/asyncDataExtension/index.js +0 -82
- package/dist/destinations/salesforce-marketing-cloud/asyncDataExtension/index.js.map +0 -1
- package/dist/destinations/zapier/send/constants.d.ts +0 -1
- package/dist/destinations/zapier/send/constants.js +0 -5
- package/dist/destinations/zapier/send/constants.js.map +0 -1
- /package/dist/destinations/{braze/ecommerce → altertable/event}/generated-types.js +0 -0
- /package/dist/destinations/{braze/ecommerce → altertable/event}/index.d.ts +0 -0
- /package/dist/destinations/{braze/ecommerceSingleProduct → altertable}/generated-types.js +0 -0
- /package/dist/destinations/{memora → altertable/identify}/generated-types.js +0 -0
- /package/dist/destinations/{braze/ecommerceSingleProduct → altertable/identify}/index.d.ts +0 -0
- /package/dist/destinations/{braze/ecommerce → altertable}/types.js +0 -0
- /package/dist/destinations/{memora/upsertProfile → collab-travel-crm}/generated-types.js +0 -0
- /package/dist/destinations/{salesforce-marketing-cloud/asyncDataExtension → collab-travel-crm/identifyUser}/generated-types.js +0 -0
- /package/dist/destinations/{memora/upsertProfile → collab-travel-crm/trackEvent}/index.d.ts +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { EVENT_NAMES } from './constants';
|
|
2
|
-
import { Payload } from './generated-types';
|
|
3
|
-
import { Payload as SingleProductPayload } from '../ecommerceSingleProduct/generated-types';
|
|
4
|
-
export type PayloadWithIndex = (Payload | SingleProductPayload) & {
|
|
5
|
-
index?: number;
|
|
6
|
-
};
|
|
7
|
-
export type ProductViewedEventName = typeof EVENT_NAMES.PRODUCT_VIEWED;
|
|
8
|
-
export type CheckoutStartedEventName = typeof EVENT_NAMES.CHECKOUT_STARTED;
|
|
9
|
-
export type CartUpdatedEventName = typeof EVENT_NAMES.CART_UPDATED;
|
|
10
|
-
export type OrderPlacedEventName = typeof EVENT_NAMES.ORDER_PLACED;
|
|
11
|
-
export type OrderCancelledEventName = typeof EVENT_NAMES.ORDER_CANCELLED;
|
|
12
|
-
export type OrderRefundedEventName = typeof EVENT_NAMES.ORDER_REFUNDED;
|
|
13
|
-
export type MultiPropertyEventName = CheckoutStartedEventName | CartUpdatedEventName | OrderPlacedEventName | OrderCancelledEventName | OrderRefundedEventName;
|
|
14
|
-
export interface EcommerceEvents {
|
|
15
|
-
events: Array<EcommerceEvent>;
|
|
16
|
-
}
|
|
17
|
-
export type EcommerceEvent = ProductViewedEvent | CartUpdatedEvent | CheckoutStartedEvent | OrderPlacedEvent | OrderRefundedEvent | OrderCancelledEvent;
|
|
18
|
-
export interface BaseEvent {
|
|
19
|
-
external_id?: string;
|
|
20
|
-
braze_id?: string;
|
|
21
|
-
email?: string;
|
|
22
|
-
phone?: string;
|
|
23
|
-
user_alias?: {
|
|
24
|
-
alias_name: string;
|
|
25
|
-
alias_label: string;
|
|
26
|
-
};
|
|
27
|
-
app_id?: string;
|
|
28
|
-
name: ProductViewedEventName | MultiPropertyEventName;
|
|
29
|
-
time: string;
|
|
30
|
-
properties: {
|
|
31
|
-
currency: string;
|
|
32
|
-
source: string;
|
|
33
|
-
metadata?: {
|
|
34
|
-
[key: string]: unknown;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
_update_existing_only?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface ProductViewedEvent extends BaseEvent {
|
|
40
|
-
name: ProductViewedEventName;
|
|
41
|
-
properties: BaseEvent['properties'] & BaseProduct;
|
|
42
|
-
}
|
|
43
|
-
export interface MultiProductBaseEvent extends BaseEvent {
|
|
44
|
-
name: MultiPropertyEventName;
|
|
45
|
-
properties: BaseEvent['properties'] & {
|
|
46
|
-
total_value: number;
|
|
47
|
-
products: Array<Product>;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export interface Product extends BaseProduct {
|
|
51
|
-
quantity: number;
|
|
52
|
-
metadata?: {
|
|
53
|
-
[key: string]: unknown;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export interface BaseProduct {
|
|
57
|
-
product_id: string;
|
|
58
|
-
product_name: string;
|
|
59
|
-
variant_id: string;
|
|
60
|
-
price: number;
|
|
61
|
-
image_url?: string;
|
|
62
|
-
product_url?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface CartUpdatedEvent extends MultiProductBaseEvent {
|
|
65
|
-
name: CartUpdatedEventName;
|
|
66
|
-
properties: MultiProductBaseEvent['properties'] & {
|
|
67
|
-
cart_id: string;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
export interface CheckoutStartedEvent extends MultiProductBaseEvent {
|
|
71
|
-
name: CheckoutStartedEventName;
|
|
72
|
-
properties: MultiProductBaseEvent['properties'] & {
|
|
73
|
-
checkout_id: string;
|
|
74
|
-
cart_id?: string;
|
|
75
|
-
metadata?: BaseEvent['properties']['metadata'] & {
|
|
76
|
-
checkout_url?: string;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export interface OrderPlacedEvent extends MultiProductBaseEvent {
|
|
81
|
-
name: OrderPlacedEventName;
|
|
82
|
-
properties: MultiProductBaseEvent['properties'] & {
|
|
83
|
-
order_id: string;
|
|
84
|
-
cart_id?: string;
|
|
85
|
-
total_discounts?: number;
|
|
86
|
-
discounts?: Array<{
|
|
87
|
-
code: string;
|
|
88
|
-
amount: number;
|
|
89
|
-
}>;
|
|
90
|
-
metadata?: BaseEvent['properties']['metadata'] & {
|
|
91
|
-
order_status_url?: string;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export interface OrderRefundedEvent extends MultiProductBaseEvent {
|
|
96
|
-
name: OrderRefundedEventName;
|
|
97
|
-
properties: MultiProductBaseEvent['properties'] & {
|
|
98
|
-
order_id: string;
|
|
99
|
-
total_discounts?: number;
|
|
100
|
-
discounts?: Array<{
|
|
101
|
-
code: string;
|
|
102
|
-
amount: number;
|
|
103
|
-
}>;
|
|
104
|
-
metadata?: BaseEvent['properties']['metadata'] & {
|
|
105
|
-
order_status_url?: string;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export interface OrderCancelledEvent extends MultiProductBaseEvent {
|
|
110
|
-
name: OrderCancelledEventName;
|
|
111
|
-
properties: MultiProductBaseEvent['properties'] & {
|
|
112
|
-
order_id: string;
|
|
113
|
-
cancel_reason: string;
|
|
114
|
-
total_discounts?: number;
|
|
115
|
-
discounts?: Array<{
|
|
116
|
-
code: string;
|
|
117
|
-
amount: number;
|
|
118
|
-
}>;
|
|
119
|
-
metadata?: BaseEvent['properties']['metadata'] & {
|
|
120
|
-
order_status_url?: string;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/braze/ecommerce/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
name: string;
|
|
3
|
-
external_id?: string;
|
|
4
|
-
user_alias?: {
|
|
5
|
-
alias_name: string;
|
|
6
|
-
alias_label: string;
|
|
7
|
-
};
|
|
8
|
-
_update_existing_only?: boolean;
|
|
9
|
-
email?: string;
|
|
10
|
-
phone?: string | null;
|
|
11
|
-
braze_id?: string | null;
|
|
12
|
-
cancel_reason?: string;
|
|
13
|
-
time: string;
|
|
14
|
-
checkout_id?: string;
|
|
15
|
-
order_id?: string;
|
|
16
|
-
cart_id?: string;
|
|
17
|
-
total_value?: number;
|
|
18
|
-
total_discounts?: number;
|
|
19
|
-
discounts?: {
|
|
20
|
-
code: string;
|
|
21
|
-
amount: number;
|
|
22
|
-
}[];
|
|
23
|
-
currency: string;
|
|
24
|
-
source: string;
|
|
25
|
-
metadata?: {
|
|
26
|
-
[k: string]: unknown;
|
|
27
|
-
};
|
|
28
|
-
enable_batching: boolean;
|
|
29
|
-
batch_size: number;
|
|
30
|
-
product: {
|
|
31
|
-
product_id: string;
|
|
32
|
-
product_name: string;
|
|
33
|
-
variant_id: string;
|
|
34
|
-
image_url?: string;
|
|
35
|
-
product_url?: string;
|
|
36
|
-
price: number;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/braze/ecommerceSingleProduct/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fields_1 = require("../ecommerce/fields");
|
|
4
|
-
const functions_1 = require("../ecommerce/functions");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Ecommerce Event (single product)',
|
|
7
|
-
description: 'Send a single product ecommerce event to Braze',
|
|
8
|
-
fields: {
|
|
9
|
-
...fields_1.commonFields,
|
|
10
|
-
product: fields_1.product
|
|
11
|
-
},
|
|
12
|
-
perform: async (request, { payload, settings }) => {
|
|
13
|
-
return await (0, functions_1.send)(request, [payload], settings, false);
|
|
14
|
-
},
|
|
15
|
-
performBatch: async (request, { payload, settings }) => {
|
|
16
|
-
return await (0, functions_1.send)(request, payload, settings, true);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.default = action;
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze/ecommerceSingleProduct/index.ts"],"names":[],"mappings":";;AAGA,gDAG4B;AAC5B,sDAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kCAAkC;IACzC,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE;QACN,GAAG,qBAAY;QACf,OAAO,EAAP,gBAAO;KACR;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QAC9C,OAAO,MAAM,IAAA,gBAAI,EAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IACxD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;QACnD,OAAO,MAAM,IAAA,gBAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IACrD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/memora/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
exports.BASE_URL = exports.API_VERSION = void 0;
|
|
7
|
-
const upsertProfile_1 = __importDefault(require("./upsertProfile"));
|
|
8
|
-
exports.API_VERSION = 'v1';
|
|
9
|
-
exports.BASE_URL = 'https://memory.dev.twilio.com';
|
|
10
|
-
const destination = {
|
|
11
|
-
name: 'Memora',
|
|
12
|
-
slug: 'actions-memora',
|
|
13
|
-
mode: 'cloud',
|
|
14
|
-
authentication: {
|
|
15
|
-
scheme: 'basic',
|
|
16
|
-
fields: {
|
|
17
|
-
username: {
|
|
18
|
-
label: 'API Key',
|
|
19
|
-
description: 'API Key for Basic Authentication',
|
|
20
|
-
type: 'string',
|
|
21
|
-
required: true
|
|
22
|
-
},
|
|
23
|
-
password: {
|
|
24
|
-
label: 'API Secret',
|
|
25
|
-
description: 'API Secret for Basic Authentication',
|
|
26
|
-
type: 'string',
|
|
27
|
-
required: true
|
|
28
|
-
},
|
|
29
|
-
twilioAccount: {
|
|
30
|
-
label: 'Twilio Account ID',
|
|
31
|
-
description: 'Twilio Account ID for X-Pre-Auth-Context header (optional)',
|
|
32
|
-
type: 'string',
|
|
33
|
-
required: false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
testAuthentication: async (request, { settings }) => {
|
|
37
|
-
try {
|
|
38
|
-
await request(`${exports.BASE_URL}/${exports.API_VERSION}/ControlPlane/Stores?pageSize=1`, {
|
|
39
|
-
method: 'GET',
|
|
40
|
-
headers: {
|
|
41
|
-
...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
const httpError = error;
|
|
48
|
-
if (httpError.response?.status && httpError.response.status < 500) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
extendRequest({ settings }) {
|
|
56
|
-
return {
|
|
57
|
-
username: settings.username,
|
|
58
|
-
password: settings.password
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
onDelete: async (_request, { settings: _settings, payload: _payload }) => {
|
|
62
|
-
return true;
|
|
63
|
-
},
|
|
64
|
-
actions: {
|
|
65
|
-
upsertProfile: upsertProfile_1.default
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
exports.default = destination;
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/memora/index.ts"],"names":[],"mappings":";;;;;;AAGA,oEAA2C;AAE9B,QAAA,WAAW,GAAG,IAAI,CAAA;AAClB,QAAA,QAAQ,GAAG,+BAA+B,CAAA;AAEvD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,E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AAE,EAAE;QAIvE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/memora/upsertProfile/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const index_1 = require("../index");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Upsert Profile',
|
|
7
|
-
description: 'Create or update Memora profiles using the bulk upsert API. If a profile already exists, its traits are merged (new keys added, existing keys overwritten). Supports batching up to 1000 profiles.',
|
|
8
|
-
defaultSubscription: 'type = "identify"',
|
|
9
|
-
fields: {
|
|
10
|
-
enable_batching: {
|
|
11
|
-
label: 'Enable Batching',
|
|
12
|
-
description: 'Enable batching of requests to Memora. Batches can contain up to 1000 profiles.',
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
default: true,
|
|
15
|
-
unsafe_hidden: true
|
|
16
|
-
},
|
|
17
|
-
batch_size: {
|
|
18
|
-
label: 'Batch Size',
|
|
19
|
-
description: 'Maximum number of profiles to include in each batch. Actual batch sizes may be lower.',
|
|
20
|
-
type: 'number',
|
|
21
|
-
default: 1000,
|
|
22
|
-
unsafe_hidden: true
|
|
23
|
-
},
|
|
24
|
-
memora_store: {
|
|
25
|
-
label: 'Memora Store',
|
|
26
|
-
description: 'The Memora Store ID to use for this profile. This should be a valid Memora Store associated with your Twilio account.',
|
|
27
|
-
type: 'string',
|
|
28
|
-
required: false,
|
|
29
|
-
dynamic: true
|
|
30
|
-
},
|
|
31
|
-
contact: {
|
|
32
|
-
label: 'Contact Information',
|
|
33
|
-
description: 'Contact information object containing email, firstName, lastName, and phone fields that will be placed in the Contact trait group in the Memora API call.',
|
|
34
|
-
type: 'object',
|
|
35
|
-
required: false,
|
|
36
|
-
additionalProperties: true,
|
|
37
|
-
properties: {
|
|
38
|
-
email: {
|
|
39
|
-
label: 'Email',
|
|
40
|
-
description: 'User email address',
|
|
41
|
-
type: 'string',
|
|
42
|
-
format: 'email'
|
|
43
|
-
},
|
|
44
|
-
firstName: {
|
|
45
|
-
label: 'First Name',
|
|
46
|
-
description: 'User first name',
|
|
47
|
-
type: 'string'
|
|
48
|
-
},
|
|
49
|
-
lastName: {
|
|
50
|
-
label: 'Last Name',
|
|
51
|
-
description: 'User last name',
|
|
52
|
-
type: 'string'
|
|
53
|
-
},
|
|
54
|
-
phone: {
|
|
55
|
-
label: 'Phone',
|
|
56
|
-
description: 'User phone number',
|
|
57
|
-
type: 'string'
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
default: {
|
|
61
|
-
email: { '@path': '$.properties.email' },
|
|
62
|
-
firstName: { '@path': '$.traits.first_name' },
|
|
63
|
-
lastName: { '@path': '$.traits.last_name' },
|
|
64
|
-
phone: {
|
|
65
|
-
'@path': '$.traits.phone'
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
dynamicFields: {
|
|
71
|
-
memora_store: async (request, { settings }) => {
|
|
72
|
-
return fetchMemoryStores(request, settings);
|
|
73
|
-
},
|
|
74
|
-
contact: {
|
|
75
|
-
__keys__: async (request, { settings, payload }) => {
|
|
76
|
-
return fetchTraitFields(request, settings, payload, 'Contact');
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
perform: async (request, { payload, settings }) => {
|
|
81
|
-
const storeId = payload.memora_store;
|
|
82
|
-
if (!storeId) {
|
|
83
|
-
throw new actions_core_1.IntegrationError('Memora Store is required', 'MISSING_REQUIRED_FIELD', 400);
|
|
84
|
-
}
|
|
85
|
-
const traitGroups = buildTraitGroups(payload);
|
|
86
|
-
if (Object.keys(traitGroups).length === 0) {
|
|
87
|
-
throw new actions_core_1.IntegrationError('Profile must contain at least one trait group or contact field', 'EMPTY_PROFILE', 400);
|
|
88
|
-
}
|
|
89
|
-
try {
|
|
90
|
-
const response = await request(`${index_1.BASE_URL}/${index_1.API_VERSION}/Stores/${storeId}/Profiles/Bulk`, {
|
|
91
|
-
method: 'PUT',
|
|
92
|
-
headers: {
|
|
93
|
-
'Content-Type': 'application/json',
|
|
94
|
-
...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
|
|
95
|
-
},
|
|
96
|
-
json: {
|
|
97
|
-
profiles: [
|
|
98
|
-
{
|
|
99
|
-
traits: traitGroups
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
if (response.status !== 202) {
|
|
105
|
-
throw new actions_core_1.IntegrationError(`Unexpected response status: ${response.status}`, 'API_ERROR', response.status);
|
|
106
|
-
}
|
|
107
|
-
return response;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
if (error instanceof actions_core_1.IntegrationError) {
|
|
111
|
-
throw error;
|
|
112
|
-
}
|
|
113
|
-
handleMemoraApiError(error);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
performBatch: async (request, { payload: payloads, settings }) => {
|
|
117
|
-
const storeId = payloads[0]?.memora_store;
|
|
118
|
-
if (!storeId) {
|
|
119
|
-
throw new actions_core_1.IntegrationError('Memora Store is required', 'MISSING_REQUIRED_FIELD', 400);
|
|
120
|
-
}
|
|
121
|
-
if (!payloads || payloads.length === 0) {
|
|
122
|
-
throw new actions_core_1.IntegrationError('No profiles provided for batch sync', 'EMPTY_BATCH', 400);
|
|
123
|
-
}
|
|
124
|
-
if (payloads.length > 1000) {
|
|
125
|
-
throw new actions_core_1.IntegrationError('Batch size cannot exceed 1000 profiles', 'BATCH_SIZE_EXCEEDED', 400);
|
|
126
|
-
}
|
|
127
|
-
const profiles = payloads.map((payload, index) => {
|
|
128
|
-
const traitGroups = buildTraitGroups(payload);
|
|
129
|
-
if (Object.keys(traitGroups).length === 0) {
|
|
130
|
-
throw new actions_core_1.IntegrationError(`Profile at index ${index} must contain at least one trait group or contact field`, 'EMPTY_PROFILE', 400);
|
|
131
|
-
}
|
|
132
|
-
return { traits: traitGroups };
|
|
133
|
-
});
|
|
134
|
-
try {
|
|
135
|
-
const response = await request(`${index_1.BASE_URL}/${index_1.API_VERSION}/Stores/${storeId}/Profiles/Bulk`, {
|
|
136
|
-
method: 'PUT',
|
|
137
|
-
headers: {
|
|
138
|
-
'Content-Type': 'application/json',
|
|
139
|
-
...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
|
|
140
|
-
},
|
|
141
|
-
json: {
|
|
142
|
-
profiles
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
if (response.status !== 202) {
|
|
146
|
-
throw new actions_core_1.IntegrationError(`Unexpected response status: ${response.status}`, 'API_ERROR', response.status);
|
|
147
|
-
}
|
|
148
|
-
return response;
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
if (error instanceof actions_core_1.IntegrationError) {
|
|
152
|
-
throw error;
|
|
153
|
-
}
|
|
154
|
-
handleMemoraApiError(error);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
function buildTraitGroups(payload) {
|
|
159
|
-
const traitGroups = {};
|
|
160
|
-
if (payload.contact && typeof payload.contact === 'object') {
|
|
161
|
-
const contact = cleanObject(payload.contact);
|
|
162
|
-
if (Object.keys(contact).length > 0) {
|
|
163
|
-
traitGroups.Contact = {
|
|
164
|
-
...(traitGroups.Contact ?? {}),
|
|
165
|
-
...contact
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return traitGroups;
|
|
170
|
-
}
|
|
171
|
-
function cleanObject(input) {
|
|
172
|
-
if (!input || typeof input !== 'object') {
|
|
173
|
-
return {};
|
|
174
|
-
}
|
|
175
|
-
const value = input;
|
|
176
|
-
const cleaned = {};
|
|
177
|
-
for (const [key, fieldValue] of Object.entries(value)) {
|
|
178
|
-
if (fieldValue === undefined || fieldValue === null) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
if (Array.isArray(fieldValue)) {
|
|
182
|
-
if (fieldValue.length > 0) {
|
|
183
|
-
cleaned[key] = fieldValue;
|
|
184
|
-
}
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
if (typeof fieldValue === 'object') {
|
|
188
|
-
const nested = cleanObject(fieldValue);
|
|
189
|
-
if (Object.keys(nested).length > 0) {
|
|
190
|
-
cleaned[key] = nested;
|
|
191
|
-
}
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
cleaned[key] = fieldValue;
|
|
195
|
-
}
|
|
196
|
-
return cleaned;
|
|
197
|
-
}
|
|
198
|
-
function handleMemoraApiError(error) {
|
|
199
|
-
const httpError = error;
|
|
200
|
-
if (httpError.response) {
|
|
201
|
-
const status = httpError.response.status;
|
|
202
|
-
const data = httpError.response.data;
|
|
203
|
-
switch (status) {
|
|
204
|
-
case 400:
|
|
205
|
-
throw new actions_core_1.IntegrationError(data?.message || 'Bad Request - Invalid request data', 'INVALID_REQUEST_DATA', 400);
|
|
206
|
-
case 404:
|
|
207
|
-
throw new actions_core_1.IntegrationError(data?.message || 'Profile or service not found', 'SERVICE_NOT_FOUND', 404);
|
|
208
|
-
case 429: {
|
|
209
|
-
const retryAfter = httpError.response.headers?.['retry-after'];
|
|
210
|
-
const message = retryAfter ? `Rate limit exceeded. Retry after ${retryAfter} seconds` : 'Rate limit exceeded';
|
|
211
|
-
throw new actions_core_1.RetryableError(data?.message || message);
|
|
212
|
-
}
|
|
213
|
-
case 500:
|
|
214
|
-
throw new actions_core_1.RetryableError(data?.message || 'Internal server error');
|
|
215
|
-
case 503:
|
|
216
|
-
throw new actions_core_1.RetryableError(data?.message || 'Service unavailable');
|
|
217
|
-
default:
|
|
218
|
-
throw new actions_core_1.IntegrationError(data?.message || `HTTP ${status} error`, 'API_ERROR', status);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
throw new actions_core_1.RetryableError(httpError.message || 'Network error occurred');
|
|
222
|
-
}
|
|
223
|
-
async function fetchMemoryStores(request, settings) {
|
|
224
|
-
try {
|
|
225
|
-
const response = await request(`${index_1.BASE_URL}/${index_1.API_VERSION}/ControlPlane/Stores?pageSize=100&orderBy=ASC`, {
|
|
226
|
-
method: 'GET',
|
|
227
|
-
headers: {
|
|
228
|
-
...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
|
|
229
|
-
},
|
|
230
|
-
skipResponseCloning: true
|
|
231
|
-
});
|
|
232
|
-
const services = response?.data?.services || [];
|
|
233
|
-
const choices = services.map((serviceId) => ({
|
|
234
|
-
label: serviceId,
|
|
235
|
-
value: serviceId
|
|
236
|
-
}));
|
|
237
|
-
return {
|
|
238
|
-
choices,
|
|
239
|
-
nextPage: response?.data?.meta?.nextToken
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
catch (error) {
|
|
243
|
-
return {
|
|
244
|
-
choices: [],
|
|
245
|
-
error: {
|
|
246
|
-
message: 'Unable to fetch memory stores. You can still manually enter a memory store ID.',
|
|
247
|
-
code: 'FETCH_ERROR'
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
async function fetchTraitFields(request, settings, payload, traitGroup) {
|
|
253
|
-
try {
|
|
254
|
-
const storeId = payload.memora_store;
|
|
255
|
-
if (!storeId) {
|
|
256
|
-
return {
|
|
257
|
-
choices: [],
|
|
258
|
-
error: {
|
|
259
|
-
message: `Please select a Memora Store first to fetch available ${traitGroup} trait fields.`,
|
|
260
|
-
code: 'STORE_ID_REQUIRED'
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
const response = await request(`${index_1.BASE_URL}/${index_1.API_VERSION}/ControlPlane/Stores/${storeId}/TraitGroups/${traitGroup}`, {
|
|
265
|
-
method: 'GET',
|
|
266
|
-
headers: {
|
|
267
|
-
...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
|
|
268
|
-
},
|
|
269
|
-
searchParams: {
|
|
270
|
-
includeTraits: 'true',
|
|
271
|
-
pageSize: '100',
|
|
272
|
-
orderBy: 'ASC'
|
|
273
|
-
},
|
|
274
|
-
skipResponseCloning: true
|
|
275
|
-
});
|
|
276
|
-
const traits = response?.data?.traitGroup?.traits || [];
|
|
277
|
-
const choices = traits.map((trait) => ({
|
|
278
|
-
label: trait.name || trait.key,
|
|
279
|
-
value: trait.key
|
|
280
|
-
}));
|
|
281
|
-
return {
|
|
282
|
-
choices,
|
|
283
|
-
nextPage: response?.data?.meta?.pageToken
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
return {
|
|
288
|
-
choices: [],
|
|
289
|
-
error: {
|
|
290
|
-
message: 'Unable to fetch trait fields. You can still manually enter trait names.',
|
|
291
|
-
code: 'FETCH_ERROR'
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
exports.default = action;
|
|
297
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/memora/upsertProfile/index.ts"],"names":[],"mappings":";;AAGA,wDAAwE;AACxE,oCAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,oMAAoM;IACtM,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,IAAI;SACpB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,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