@rokt/dcui-orchestrator 0.3.1-rc.5 → 0.3.1-rc.7
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 +26 -26
- package/dist/index.js +28 -28
- package/dist/libraries/domain/src/models/signals.d.ts +2 -0
- package/dist/modules/instant-purchase/src/actions/device-pay.d.ts +9 -0
- package/dist/modules/instant-purchase/src/sagas/device-pay/sagas.d.ts +40 -2
- package/dist/modules/instant-purchase/src/sagas/error-codes.d.ts +5 -0
- package/dist/modules/instant-purchase/src/sagas/instant-purchase-signals.d.ts +2 -2
- package/package.json +1 -1
|
@@ -67,6 +67,7 @@ export interface CartItemInstantPurchase {
|
|
|
67
67
|
catalogItemId: string;
|
|
68
68
|
quantity: number;
|
|
69
69
|
initiatedBy: InitiatedBy;
|
|
70
|
+
purchaseId?: string;
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
export interface CartItemInstantPurchaseFailure {
|
|
@@ -77,6 +78,7 @@ export interface CartItemInstantPurchaseFailure {
|
|
|
77
78
|
quantity: number;
|
|
78
79
|
failureReason: string;
|
|
79
80
|
providerId: string;
|
|
81
|
+
purchaseId?: string;
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
84
|
export interface CartItemQuantitySelected {
|
|
@@ -24,6 +24,14 @@ export type DevicePayResponsePayload = {
|
|
|
24
24
|
};
|
|
25
25
|
cancelled?: boolean;
|
|
26
26
|
retryable?: boolean;
|
|
27
|
+
purchaseId?: string;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
export type DevicePayInteractionPayload = {
|
|
31
|
+
success: true;
|
|
32
|
+
interaction: string;
|
|
33
|
+
timestamp: string;
|
|
34
|
+
sessionId: string;
|
|
27
35
|
[key: string]: unknown;
|
|
28
36
|
};
|
|
29
37
|
/**
|
|
@@ -36,6 +44,7 @@ export type DevicePayPurchaseContext = {
|
|
|
36
44
|
catalogItem: PluginCatalogItem;
|
|
37
45
|
quantity: number;
|
|
38
46
|
providerId: string;
|
|
47
|
+
paymentProvider: PaymentProvider;
|
|
39
48
|
};
|
|
40
49
|
export type DevicePayResponse = {
|
|
41
50
|
type: typeof DEVICE_PAY_RESPONSE;
|
|
@@ -3,10 +3,20 @@ import { EventChannel } from 'redux-saga';
|
|
|
3
3
|
import { Log, PaymentMethodType, PluginCatalogItem, ShippingAttributes } from '../../../../../libraries/domain/src/models';
|
|
4
4
|
import { GlobalGateway } from '../../../../../libraries/module-connector/src/main';
|
|
5
5
|
import { OfferLifecycle } from '../../../../../libraries/domain/src/behaviors';
|
|
6
|
-
import { DevicePayPurchaseContext, InitiateDevicePayAction, DevicePayResponsePayload, DevicePayResponse, DevicePayAvailableAction, DevicePayAvailablePayload } from '../../actions';
|
|
6
|
+
import { DevicePayPurchaseContext, DevicePayInteractionPayload, InitiateDevicePayAction, DevicePayResponsePayload, DevicePayResponse, DevicePayAvailableAction, DevicePayAvailablePayload } from '../../actions';
|
|
7
7
|
import { AppState } from '../../reducers';
|
|
8
8
|
import { OfferLifecycleEventState } from '../../models';
|
|
9
9
|
import { PrepareDevicePayEventPayload } from '../../../../../libraries/domain/src/models';
|
|
10
|
+
export declare function isDevicePayInteraction(data: unknown): data is DevicePayInteractionPayload;
|
|
11
|
+
export declare function listenForDevicePayInteraction(channel: EventChannel<DevicePayInteractionPayload>, context: DevicePayPurchaseContext): Generator<PutEffect<{
|
|
12
|
+
type: string;
|
|
13
|
+
payload: {
|
|
14
|
+
name: string;
|
|
15
|
+
parentGuid: string;
|
|
16
|
+
action: string;
|
|
17
|
+
context: string;
|
|
18
|
+
};
|
|
19
|
+
}> | ChannelTakeEffect<DevicePayInteractionPayload>, void, DevicePayInteractionPayload>;
|
|
10
20
|
export declare function isDevicePayResponse(obj: unknown): obj is DevicePayResponsePayload;
|
|
11
21
|
/**
|
|
12
22
|
* Strict guard: requires at least one known provider key in `response`, AND
|
|
@@ -32,7 +42,27 @@ export declare function processDevicePayAvailable(logger: (log: Log) => void, ac
|
|
|
32
42
|
}>, void, (boolean & ({
|
|
33
43
|
type: PaymentMethodType;
|
|
34
44
|
}[] & OfferLifecycleEventState)) | undefined>;
|
|
35
|
-
export declare function listenForDevicePayResponse(channel: EventChannel<DevicePayResponsePayload>, logger: (log: Log) => void, context: DevicePayPurchaseContext): Generator<
|
|
45
|
+
export declare function listenForDevicePayResponse(channel: EventChannel<DevicePayResponsePayload>, logger: (log: Log) => void, context: DevicePayPurchaseContext, interactionChannel?: EventChannel<DevicePayInteractionPayload>): Generator<CallEffect<void> | import("redux-saga/effects").ForkEffect<void> | import("redux-saga/effects").RaceEffect<import("redux-saga/effects").TakeEffect | CallEffect<true> | ChannelTakeEffect<DevicePayResponsePayload>> | PutEffect<{
|
|
46
|
+
type: string;
|
|
47
|
+
payload: DevicePayResponsePayload;
|
|
48
|
+
context: DevicePayPurchaseContext;
|
|
49
|
+
}> | PutEffect<{
|
|
50
|
+
type: string;
|
|
51
|
+
payload: {
|
|
52
|
+
success: boolean;
|
|
53
|
+
timestamp: string;
|
|
54
|
+
sessionId: string;
|
|
55
|
+
error: {
|
|
56
|
+
code: string;
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
context: DevicePayPurchaseContext;
|
|
61
|
+
}>, void, {
|
|
62
|
+
response?: DevicePayResponsePayload;
|
|
63
|
+
timeout?: true;
|
|
64
|
+
dismissal?: OfferLifecycle;
|
|
65
|
+
}>;
|
|
36
66
|
export declare function processDevicePayCartItem(gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateDevicePayAction): Generator<CallEffect<void> | import("redux-saga/effects").SelectEffect | import("redux-saga/effects").ForkEffect<void> | PutEffect<{
|
|
37
67
|
type: string;
|
|
38
68
|
payload: {
|
|
@@ -95,6 +125,14 @@ export declare function prepareDevicePay(gateway: GlobalGateway, logger: (log: L
|
|
|
95
125
|
};
|
|
96
126
|
}>, void, AppState | undefined>;
|
|
97
127
|
export declare function processDevicePayResponse(logger: (log: Log) => void, action: DevicePayResponse): Generator<CallEffect<void> | PutEffect<{
|
|
128
|
+
type: string;
|
|
129
|
+
payload: {
|
|
130
|
+
name: string;
|
|
131
|
+
parentGuid: string;
|
|
132
|
+
action: string;
|
|
133
|
+
context: string;
|
|
134
|
+
};
|
|
135
|
+
}> | PutEffect<{
|
|
98
136
|
type: string;
|
|
99
137
|
payload: import("../../../../../libraries/domain/src/models").CartItemInstantPurchaseFailure;
|
|
100
138
|
}> | PutEffect<{
|
|
@@ -12,6 +12,11 @@ export declare const INSTANT_PURCHASE_WSDK_CHANNEL_ERROR = "INSTANT_PURCHASE_WSD
|
|
|
12
12
|
export declare const CHECKOUT_BUTTON_INVALID_OFFERLIFECYCLE = "CHECKOUT_BUTTON_INVALID_OFFERLIFECYCLE";
|
|
13
13
|
export declare const CHECKOUT_BUTTON_UNKNOWN_EVENT = "CHECKOUT_BUTTON_UNKNOWN_EVENT";
|
|
14
14
|
export declare const DEVICE_PAY_CHANNEL_ERROR = "DEVICE_PAY_CHANNEL_ERROR";
|
|
15
|
+
export declare const DEVICE_PAY_RESPONSE_TIMEOUT = "DEVICE_PAY_RESPONSE_TIMEOUT";
|
|
16
|
+
export declare const DEVICE_PAY_CANCELLED = "DEVICE_PAY_CANCELLED";
|
|
17
|
+
export declare const DEVICE_PAY_RETRYABLE_DECLINE = "DEVICE_PAY_RETRYABLE_DECLINE";
|
|
18
|
+
export declare const DEVICE_PAY_UNKNOWN_FAILURE = "DEVICE_PAY_UNKNOWN_FAILURE";
|
|
19
|
+
export declare const DEVICE_PAY_INVALID_CART_ITEM_MAPPING = "DEVICE_PAY_INVALID_CART_ITEM_MAPPING";
|
|
15
20
|
export declare const MALFORMED_DEVICE_PAY_DATA = "MALFORMED_DEVICE_PAY_DATA";
|
|
16
21
|
export declare const MISSING_DEVICE_PAY_PROVIDER_DATA = "MISSING_DEVICE_PAY_PROVIDER_DATA";
|
|
17
22
|
export declare const DEVICE_PAY_NOT_AVAILABLE = "DEVICE_PAY_NOT_AVAILABLE";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CartItemInstantPurchase, CartItemInstantPurchaseFailure, PluginCatalogItem } from '../../../../libraries/domain/src/models';
|
|
2
2
|
export declare const UNKNOWN_FAILURE_REASON = "Unknown failure reason";
|
|
3
|
-
export declare function createInstantPurchaseSuccessSignal(catalogItem: PluginCatalogItem, quantity: number): CartItemInstantPurchase;
|
|
4
|
-
export declare function createInstantPurchaseFailureSignal(catalogItem: PluginCatalogItem, quantity: number, providerId: string, failureReason: string): CartItemInstantPurchaseFailure;
|
|
3
|
+
export declare function createInstantPurchaseSuccessSignal(catalogItem: PluginCatalogItem, quantity: number, purchaseId?: string): CartItemInstantPurchase;
|
|
4
|
+
export declare function createInstantPurchaseFailureSignal(catalogItem: PluginCatalogItem, quantity: number, providerId: string, failureReason: string, purchaseId?: string): CartItemInstantPurchaseFailure;
|