@rokt/dcui-orchestrator 0.2.1-rc.34 → 0.2.1-rc.36
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/index.cjs +23 -23
- package/dist/index.js +23 -23
- package/dist/libraries/domain/src/behaviors/cart-item-event.d.ts +49 -0
- package/dist/libraries/domain/src/behaviors/global-actions.d.ts +2 -0
- package/dist/libraries/domain/src/behaviors/index.d.ts +1 -0
- package/dist/libraries/domain/src/behaviors/send-partner.d.ts +7 -3
- package/dist/libraries/domain/src/models/index.d.ts +1 -0
- package/dist/libraries/domain/src/models/partner-event.d.ts +1 -1
- package/dist/libraries/domain/src/models/shipping.d.ts +25 -0
- package/dist/libraries/layout-renderer-utils/src/sagas/error/error-codes.d.ts +1 -0
- package/dist/libraries/orchestrator/src/sagas/cart-service/sagas.d.ts +15 -0
- package/dist/modules/add-to-cart/src/sagas/index.d.ts +2 -0
- package/dist/modules/instant-purchase/src/components/inline-container/inline-container.d.ts +17 -2
- package/dist/modules/instant-purchase/src/sagas/index.d.ts +2 -0
- package/dist/modules/layouts-xp-sandbox/src/sagas/index.d.ts +2 -0
- package/dist/modules/standard-marketing/src/sagas/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CartItemPayload } from '../models';
|
|
2
|
+
export declare const INITIATE_CART_ITEM_EVENT = "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
3
|
+
export type InitiateCartItemEvent = {
|
|
4
|
+
type: typeof INITIATE_CART_ITEM_EVENT;
|
|
5
|
+
payload: CartItemPayload;
|
|
6
|
+
};
|
|
7
|
+
export type CartItemSuccessData = {
|
|
8
|
+
cartItemId: string;
|
|
9
|
+
totalPrice: number;
|
|
10
|
+
currencyCode: string;
|
|
11
|
+
providerData: string;
|
|
12
|
+
shipping: {
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string;
|
|
15
|
+
address1: string;
|
|
16
|
+
address2: string;
|
|
17
|
+
city: string;
|
|
18
|
+
state: string;
|
|
19
|
+
postalCode: string;
|
|
20
|
+
phoneNumber: string;
|
|
21
|
+
};
|
|
22
|
+
success: true;
|
|
23
|
+
};
|
|
24
|
+
export type CartItemValidationError = {
|
|
25
|
+
code: string;
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
28
|
+
export type CartItemFailureData = {
|
|
29
|
+
description?: string;
|
|
30
|
+
success: false;
|
|
31
|
+
errors: CartItemValidationError[];
|
|
32
|
+
};
|
|
33
|
+
export type CartItemResponseData = CartItemSuccessData | CartItemFailureData;
|
|
34
|
+
export type CartItemResponsePayload = {
|
|
35
|
+
success: boolean;
|
|
36
|
+
error?: string;
|
|
37
|
+
timestamp: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
response?: CartItemResponseData;
|
|
40
|
+
};
|
|
41
|
+
export declare const CART_ITEM_RESPONSE = "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
42
|
+
export type CartItemResponse = {
|
|
43
|
+
type: typeof CART_ITEM_RESPONSE;
|
|
44
|
+
payload: CartItemResponsePayload;
|
|
45
|
+
};
|
|
46
|
+
export declare const INITIALIZE_CART_SERVICE = "GLOBAL/CART_SERVICE/INITIALIZE";
|
|
47
|
+
export type InitializeCartService = {
|
|
48
|
+
type: typeof INITIALIZE_CART_SERVICE;
|
|
49
|
+
};
|
|
@@ -25,5 +25,7 @@ export declare const GlobalActionTypes: {
|
|
|
25
25
|
readonly SET_PARTNER_VALIDATION_STATUS: "GLOBAL/SET_PARTNER_VALIDATION_STATUS";
|
|
26
26
|
readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
|
|
27
27
|
readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
|
|
28
|
+
readonly INITIATE_CART_ITEM_EVENT: "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
29
|
+
readonly CART_ITEM_RESPONSE: "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
28
30
|
};
|
|
29
31
|
export type GlobalActionType = GlobalActions['type'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutboundPartnerEvent, PluginCartItem, InstantPurchaseWsdkPayload } from '../models';
|
|
1
|
+
import { OutboundPartnerEvent, PluginCartItem, InstantPurchaseWsdkPayload, CartItemPayload } from '../models';
|
|
2
2
|
export declare const SEND_PARTNER = "GLOBAL/SEND_PARTNER";
|
|
3
3
|
export type OutboundInstantPurchaseEventPayload = {
|
|
4
4
|
name: 'CART_ITEM_INSTANT_PURCHASE';
|
|
@@ -41,10 +41,14 @@ export type OutboundInstantPurchaseWsdkEventPayload = {
|
|
|
41
41
|
name: 'INITIATE_INSTANT_PURCHASE_EVENT';
|
|
42
42
|
body: InstantPurchaseWsdkPayload;
|
|
43
43
|
};
|
|
44
|
-
export type
|
|
44
|
+
export type OutboundCartItemEventPayload = {
|
|
45
|
+
name: 'INITIATE_CART_ITEM_EVENT';
|
|
46
|
+
body: CartItemPayload;
|
|
47
|
+
};
|
|
48
|
+
export type OutboundPartnerEventPayload<EventType extends OutboundPartnerEvent> = EventType extends 'REALTIME_OFFER_FULFILLMENT_REFERRAL' ? OutboundRealtimeOfferFulfillmentReferralEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_CONVERSION' ? OutboundRealtimeOfferFulfillmentConversionEventPayload : EventType extends 'REALTIME_OFFER_FULFILLMENT_SUCCESS' ? OutboundRealtimeOfferFulfillmentSuccessEventPayload : EventType extends 'V2_CART_ITEM_UPDATED' | 'CART_ITEM_INSTANT_PURCHASE' | 'UPSELL_CREATIVE_SENT' | 'INITIATE_INSTANT_PURCHASE_EVENT' | 'INITIATE_CART_ITEM_EVENT' ? never : {
|
|
45
49
|
name: EventType;
|
|
46
50
|
};
|
|
47
51
|
export type SendPartner<EventType extends OutboundPartnerEvent> = {
|
|
48
52
|
type: typeof SEND_PARTNER;
|
|
49
|
-
payload: OutboundPartnerEventPayload<EventType> | OutboundUpdateCartEventPayload | OutboundInstantPurchaseEventPayload | OutboundUpsellCreativeSentEventPayload | OutboundInstantPurchaseWsdkEventPayload;
|
|
53
|
+
payload: OutboundPartnerEventPayload<EventType> | OutboundUpdateCartEventPayload | OutboundInstantPurchaseEventPayload | OutboundUpsellCreativeSentEventPayload | OutboundInstantPurchaseWsdkEventPayload | OutboundCartItemEventPayload;
|
|
50
54
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type CatalogOutboundPartnerEvent = 'V2_CART_ITEM_UPDATED' | 'CART_ITEM_INSTANT_PURCHASE';
|
|
2
|
-
export type OfferOutboundPartnerEvent = CatalogOutboundPartnerEvent | 'OFFER_ENGAGEMENT' | 'POSITIVE_ENGAGEMENT' | 'UPSELL_CREATIVE_SENT' | 'REALTIME_OFFER_FULFILLMENT_REFERRAL' | 'REALTIME_OFFER_FULFILLMENT_CONVERSION' | 'REALTIME_OFFER_FULFILLMENT_SUCCESS' | 'INITIATE_INSTANT_PURCHASE_EVENT';
|
|
2
|
+
export type OfferOutboundPartnerEvent = CatalogOutboundPartnerEvent | 'OFFER_ENGAGEMENT' | 'POSITIVE_ENGAGEMENT' | 'UPSELL_CREATIVE_SENT' | 'REALTIME_OFFER_FULFILLMENT_REFERRAL' | 'REALTIME_OFFER_FULFILLMENT_CONVERSION' | 'REALTIME_OFFER_FULFILLMENT_SUCCESS' | 'INITIATE_INSTANT_PURCHASE_EVENT' | 'INITIATE_CART_ITEM_EVENT';
|
|
3
3
|
export type OutboundPartnerEvent = OfferOutboundPartnerEvent | 'PLACEMENT_CLOSED' | 'PLACEMENT_COMPLETED' | 'PLACEMENT_INTERACTIVE' | 'PLACEMENT_FAILURE';
|
|
4
4
|
export declare function isOutboundPartnerEvent(value: unknown): value is OutboundPartnerEvent;
|
|
5
5
|
export declare function isOfferOutboundPartnerEvent(value: unknown): value is OfferOutboundPartnerEvent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CartItemPayload {
|
|
2
|
+
cartItemId: string;
|
|
3
|
+
lineItems: Array<LineItem>;
|
|
4
|
+
shipping: Shipping | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface LineItem {
|
|
7
|
+
cartItemId: string;
|
|
8
|
+
quantity: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Shipping {
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
address1: string;
|
|
14
|
+
address2?: string;
|
|
15
|
+
city: string;
|
|
16
|
+
state: string;
|
|
17
|
+
postalCode: string;
|
|
18
|
+
phoneNumber: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ItemDetail {
|
|
21
|
+
cartItemId: string;
|
|
22
|
+
currency: string;
|
|
23
|
+
totalPrice: number;
|
|
24
|
+
providerData: string;
|
|
25
|
+
}
|
|
@@ -15,3 +15,4 @@ export declare const INCORRECTLY_HANDLE_EXTERNAL_ACTION = "INCORRECTLY_HANDLE_EX
|
|
|
15
15
|
export declare const FAILED_TO_LOAD_FONT = "FAILED_TO_LOAD_FONT";
|
|
16
16
|
export declare const FAILED_TO_ESTABLISH_PARTNER_VALIDATION = "FAILED_TO_ESTABLISH_PARTNER_VALIDATION";
|
|
17
17
|
export declare const PARTNER_VALIDATION_UPDATE_FAILED = "PARTNER_VALIDATION_UPDATE_FAILED";
|
|
18
|
+
export declare const CART_SERVICE_RESPONSE_ERROR = "CART_SERVICE_RESPONSE_ERROR";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InitiateCartItemEvent, CartItemResponse } from '../../../../domain/src/behaviors';
|
|
2
|
+
import { CartItemPayload } from '../../../../domain/src/models';
|
|
3
|
+
import { EventChannel } from 'redux-saga';
|
|
4
|
+
import { PartnerInteractionService } from '../../../../plugin-utils/src/index';
|
|
5
|
+
export declare function initializeCartService(partnerInteractionService: PartnerInteractionService): Generator<import("redux-saga/effects").ForkEffect<void>, void, unknown>;
|
|
6
|
+
export declare function processCartServiceEvent(partnerInteractionService: PartnerInteractionService, action: InitiateCartItemEvent): Generator<import("redux-saga/effects").PutEffect<{
|
|
7
|
+
type: string;
|
|
8
|
+
payload: {
|
|
9
|
+
name: string;
|
|
10
|
+
body: CartItemPayload;
|
|
11
|
+
};
|
|
12
|
+
}>, void, unknown>;
|
|
13
|
+
export declare function handleCartServiceResponse(action: CartItemResponse): Generator<never, void, unknown>;
|
|
14
|
+
export declare function createCartServiceResponseChannel(partnerInteractionService: PartnerInteractionService): EventChannel<CartItemResponse['payload']>;
|
|
15
|
+
export declare function listenForCartServiceResponse(partnerInteractionService: PartnerInteractionService): Generator<any, void, any>;
|
|
@@ -14,5 +14,7 @@ export declare const sagaActionTypes: {
|
|
|
14
14
|
readonly SET_PARTNER_VALIDATION_STATUS: "GLOBAL/SET_PARTNER_VALIDATION_STATUS";
|
|
15
15
|
readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
|
|
16
16
|
readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
|
|
17
|
+
readonly INITIATE_CART_ITEM_EVENT: "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
18
|
+
readonly CART_ITEM_RESPONSE: "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
17
19
|
};
|
|
18
20
|
export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<void>>, void, unknown>;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BasicStateStylingBlock, LayoutSchemaModel, LayoutStyle, ConditionalStyleTransition, TextStylingProperties, WhenPredicate } from '@rokt/dcui-layout-schema';
|
|
2
|
+
import { InlineContainerStyles } from '@rokt/dcui-layout-schema';
|
|
3
|
+
interface InlineContainerTextStyles extends InlineContainerStyles {
|
|
4
|
+
text?: TextStylingProperties;
|
|
5
|
+
}
|
|
6
|
+
export interface InlineContainerTextElements {
|
|
7
|
+
own: BasicStateStylingBlock<InlineContainerTextStyles>[];
|
|
8
|
+
}
|
|
9
|
+
export interface InlineContainerTextTransitions {
|
|
10
|
+
own?: null | InlineContainerTextStyles;
|
|
11
|
+
}
|
|
12
|
+
export interface InlineContainerTextModel<Children, Predicates> {
|
|
13
|
+
a11yLabel?: null | string;
|
|
14
|
+
styles?: null | LayoutStyle<InlineContainerTextElements, ConditionalStyleTransition<InlineContainerTextTransitions, Predicates>>;
|
|
15
|
+
children: Children[];
|
|
16
|
+
}
|
|
2
17
|
interface InlineContainerProps<Children extends LayoutSchemaModel> {
|
|
3
18
|
/**
|
|
4
19
|
* - `a11yLabel`: define a custom accessibility label for the screen reader
|
|
@@ -29,7 +44,7 @@ interface InlineContainerProps<Children extends LayoutSchemaModel> {
|
|
|
29
44
|
* * `background`
|
|
30
45
|
* * `border`
|
|
31
46
|
*/
|
|
32
|
-
schema:
|
|
47
|
+
schema: InlineContainerTextModel<Children, WhenPredicate>;
|
|
33
48
|
testId?: string;
|
|
34
49
|
}
|
|
35
50
|
/** The Inline Container is a layout node that organises and aligns content horizontally,
|
|
@@ -16,5 +16,7 @@ export declare const sagaActionTypes: {
|
|
|
16
16
|
readonly SET_PARTNER_VALIDATION_STATUS: "GLOBAL/SET_PARTNER_VALIDATION_STATUS";
|
|
17
17
|
readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
|
|
18
18
|
readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
|
|
19
|
+
readonly INITIATE_CART_ITEM_EVENT: "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
20
|
+
readonly CART_ITEM_RESPONSE: "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
19
21
|
};
|
|
20
22
|
export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<void>>, void, unknown>;
|
|
@@ -13,5 +13,7 @@ export declare const sagaActionTypes: {
|
|
|
13
13
|
readonly SET_PARTNER_VALIDATION_STATUS: "GLOBAL/SET_PARTNER_VALIDATION_STATUS";
|
|
14
14
|
readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
|
|
15
15
|
readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
|
|
16
|
+
readonly INITIATE_CART_ITEM_EVENT: "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
17
|
+
readonly CART_ITEM_RESPONSE: "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
16
18
|
};
|
|
17
19
|
export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<never>>, void, unknown>;
|
|
@@ -13,5 +13,7 @@ export declare const sagaActionTypes: {
|
|
|
13
13
|
readonly SET_PARTNER_VALIDATION_STATUS: "GLOBAL/SET_PARTNER_VALIDATION_STATUS";
|
|
14
14
|
readonly SET_GLOBAL_OFFER_DATA_CART: "GLOBAL/SET_GLOBAL_OFFER_DATA_CART";
|
|
15
15
|
readonly LAUNCH_CHILD_LAYOUT: "GLOBAL/LAUNCH_CHILD_LAYOUT";
|
|
16
|
+
readonly INITIATE_CART_ITEM_EVENT: "GLOBAL/CART_ITEM_EVENT/INITIATE";
|
|
17
|
+
readonly CART_ITEM_RESPONSE: "GLOBAL/CART_ITEM_EVENT/RESPONSE";
|
|
16
18
|
};
|
|
17
19
|
export declare function appSagas(gateway: GlobalGateway, logger: (log: Log) => void): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<never>>, void, unknown>;
|