@rokt/dcui-orchestrator 1.2.1-rc.3 → 1.2.1-rc.30
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 +43 -37
- package/dist/index.js +54 -48
- package/dist/libraries/dcui-components/src/components/data-mapper/data-mapper.d.ts +4 -0
- package/dist/libraries/dcui-components/src/components/index.d.ts +1 -0
- package/dist/libraries/dcui-components/src/components/paypal-button/index.d.ts +1 -0
- package/dist/libraries/dcui-components/src/components/paypal-button/paypal-button.d.ts +78 -0
- package/dist/libraries/dcui-components/src/components/paypal-button/paypal-wordmark.d.ts +8 -0
- package/dist/libraries/dcui-components/src/contexts/data-mapper-context.d.ts +4 -0
- package/dist/libraries/dcui-components/src/contexts/index.d.ts +1 -0
- package/dist/libraries/dcui-components/src/contexts/lead-capture-offer-context.d.ts +5 -0
- package/dist/libraries/dcui-components/src/contexts/validators/validator-provider.d.ts +5 -3
- package/dist/libraries/dcui-components/src/failure-codes.d.ts +1 -0
- package/dist/libraries/domain/src/behaviors/continuous-child.d.ts +59 -0
- package/dist/libraries/domain/src/behaviors/custom-states.d.ts +1 -1
- package/dist/libraries/domain/src/behaviors/index.d.ts +1 -0
- package/dist/libraries/domain/src/behaviors/offer-engagement.d.ts +11 -0
- package/dist/libraries/domain/src/behaviors/send-partner.d.ts +14 -2
- package/dist/libraries/domain/src/behaviors/trigger-action.d.ts +3 -3
- package/dist/libraries/domain/src/models/child-layout-response.d.ts +4 -0
- package/dist/libraries/domain/src/models/index.d.ts +1 -0
- package/dist/libraries/domain/src/models/layout/layout-offer.d.ts +2 -0
- package/dist/libraries/domain/src/models/partner-event.d.ts +1 -1
- package/dist/libraries/domain/src/models/plugin/plugin-child-layout-model.d.ts +1 -0
- package/dist/libraries/domain/src/models/plugin/plugin-offer.d.ts +2 -0
- package/dist/libraries/layout-renderer-utils/src/actions/attributes.d.ts +7 -0
- package/dist/libraries/layout-renderer-utils/src/actions/index.d.ts +4 -1
- package/dist/libraries/layout-renderer-utils/src/models/state/attributes.d.ts +2 -0
- package/dist/libraries/layout-renderer-utils/src/models/state/index.d.ts +3 -0
- package/dist/libraries/layout-renderer-utils/src/reducers/attributes/index.d.ts +1 -0
- package/dist/libraries/layout-renderer-utils/src/reducers/attributes/reducer.d.ts +4 -0
- package/dist/libraries/layout-renderer-utils/src/reducers/index.d.ts +3 -0
- package/dist/libraries/layout-renderer-utils/src/sagas/plugin/channels.d.ts +3 -3
- package/dist/libraries/layout-renderer-utils/src/sagas/plugin/display.d.ts +3 -0
- package/dist/libraries/layout-renderer-utils/src/sagas/plugin/sagas.d.ts +5 -2
- package/dist/libraries/module-connector/src/main.d.ts +1 -1
- package/dist/libraries/module-connector/src/models/gateway.d.ts +14 -3
- package/dist/libraries/module-utils/src/sagas/child-layouts/sagas.d.ts +2 -0
- package/dist/libraries/orchestrator/src/actions/index.d.ts +1 -0
- package/dist/libraries/orchestrator/src/reducers/index.d.ts +1 -0
- package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child-host.d.ts +15 -0
- package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child.d.ts +52 -0
- package/dist/libraries/orchestrator/src/sagas/index.d.ts +1 -1
- package/dist/libraries/plugin-utils/src/plugin-service/attributes.d.ts +7 -0
- package/dist/libraries/plugin-utils/src/plugin-service/display.d.ts +1 -0
- package/dist/libraries/plugin-utils/src/plugin-service/index.d.ts +3 -1
- package/dist/modules/instant-purchase/src/actions/catalog-selection.d.ts +8 -1
- package/dist/modules/instant-purchase/src/actions/instant-purchase.d.ts +4 -0
- package/dist/modules/instant-purchase/src/components/catalog-device-pay-button/catalog-device-pay-button.d.ts +8 -0
- package/dist/modules/instant-purchase/src/components/catalog-selectors-stacked/catalog-selectors-stacked.d.ts +30 -0
- package/dist/modules/instant-purchase/src/models/state/device-pay-availability.d.ts +1 -0
- package/dist/modules/instant-purchase/src/models/state/instant-purchase.d.ts +4 -0
- package/dist/modules/instant-purchase/src/reducers/catalog-selection/reducer.d.ts +2 -0
- package/dist/modules/instant-purchase/src/reducers/index.d.ts +3 -0
- package/dist/modules/instant-purchase/src/sagas/instant-purchase/sagas.d.ts +17 -3
- package/dist/modules/instant-purchase/src/sagas/paypal/sagas.d.ts +2 -0
- package/dist/modules/instant-purchase/src/sagas/tax-and-shipping/sagas.d.ts +10 -20
- package/dist/modules/instant-purchase/src/selectors/device-pay-availability/selectors.d.ts +1 -0
- package/dist/modules/instant-purchase/src/selectors/tax-and-shipping/selectors.d.ts +8 -0
- package/dist/modules/instant-purchase/src/utils/create-tax-and-shipping-cache-key.d.ts +4 -0
- package/dist/modules/instant-purchase/src/utils/parse-non-negative-monetary-amount.d.ts +1 -0
- package/dist/modules/instant-purchase/src/utils/requires-tax-and-shipping-initialization.d.ts +2 -0
- package/dist/modules/standard-marketing/src/sagas/offer-engagement/sagas.d.ts +2 -1
- package/node_modules/@rokt/dcui-layout-schema/dist/schema.d.ts +490 -18
- package/node_modules/@rokt/dcui-layout-schema/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@rokt/dcui-layout-schema/package.json +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.21/index.d.ts +7105 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.21/index.js +4 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.22/index.d.ts +7121 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.22/index.js +4 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.23/index.d.ts +7126 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.23/index.js +4 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.24/index.d.ts +7492 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.24/index.js +4 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.25/index.d.ts +7510 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.25/index.js +4 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.26/index.d.ts +7516 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.26/index.js +4 -0
- package/package.json +2 -2
|
@@ -36,6 +36,7 @@ export declare const stateActionTypes: {
|
|
|
36
36
|
readonly INITIALISE_BREAKPOINT: "BREAKPOINT/INITIALISE";
|
|
37
37
|
readonly ACTIVE_ADD: "ACTIVE/ADD";
|
|
38
38
|
readonly ACTIVE_DELETE: "ACTIVE/DELETE";
|
|
39
|
+
readonly SET_ATTRIBUTES: "ATTRIBUTES/SET";
|
|
39
40
|
readonly SET_FONTS: "FONTS/SET";
|
|
40
41
|
readonly QUEUE_SIGNAL: "SIGNAL/QUEUE";
|
|
41
42
|
readonly SIGNAL_PROCESSED: "SIGNAL/PROCESSED";
|
|
@@ -14,6 +14,7 @@ export declare const appReducers: {
|
|
|
14
14
|
layout: typeof import("../../../layout-renderer-utils/src/index").layoutReducer;
|
|
15
15
|
breakpoint: typeof import("../../../layout-renderer-utils/src/index").breakpointReducer;
|
|
16
16
|
active: typeof import("../../../layout-renderer-utils/src/index").activeReducer;
|
|
17
|
+
attributes: typeof import("../../../layout-renderer-utils/src/index").attributesReducer;
|
|
17
18
|
fonts: typeof import("../../../layout-renderer-utils/src/index").fontsReducer;
|
|
18
19
|
signal: typeof import("../../../layout-renderer-utils/src/index").signalReducer;
|
|
19
20
|
serializableCache: typeof import("../../../layout-renderer-utils/src/index").serializableCacheReducer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContinuousPresentationInput } from '../../../../domain/src/behaviors';
|
|
2
|
+
import { ContinuousGatewayService } from '../../../../module-connector/src/main';
|
|
3
|
+
import type { AppStore } from '../../store';
|
|
4
|
+
import { PluginService } from '../../plugin-service';
|
|
5
|
+
import { ContinuousChildCoordinator } from './continuous-child';
|
|
6
|
+
export declare function isContinuousEngagement(action: unknown): boolean;
|
|
7
|
+
/** Connect the coordinator to trusted selected slots and the existing module response path. */
|
|
8
|
+
export declare function makeContinuousChildHost(store: Pick<AppStore, 'getState' | 'dispatch' | 'subscribe'>, service: PluginService, enabled?: boolean): {
|
|
9
|
+
gateway: ContinuousGatewayService | undefined;
|
|
10
|
+
coordinator: ContinuousChildCoordinator;
|
|
11
|
+
getSequence: (key: string) => ContinuousPresentationInput[] | undefined;
|
|
12
|
+
transformAction(action: unknown): unknown;
|
|
13
|
+
observeAction(action: unknown): void;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LinkOpenTarget } from '@rokt/dcui-layout-schema';
|
|
2
|
+
import { ContinuousExposure, ContinuousPresentation, ContinuousPresentationInput } from '../../../../domain/src/behaviors';
|
|
3
|
+
export interface ContinuousChildTransport {
|
|
4
|
+
send(name: string, payload: object): Promise<void>;
|
|
5
|
+
onEvent(name: string): {
|
|
6
|
+
subscribe(callback: (value: unknown) => void): {
|
|
7
|
+
unsubscribe(): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
onClose(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface ContinuousChildDependencies {
|
|
14
|
+
createChild(presentation: ContinuousPresentation): Promise<ContinuousChildTransport>;
|
|
15
|
+
getSequence(key: string): ContinuousPresentationInput[] | undefined;
|
|
16
|
+
getActivePosition(): number;
|
|
17
|
+
navigate(position: number): void;
|
|
18
|
+
respond(position: number, key: 'positive' | 'negative', openLinks?: LinkOpenTarget): Promise<void>;
|
|
19
|
+
dismiss(position: number): Promise<void>;
|
|
20
|
+
onApplied?(presentation: ContinuousPresentation): void;
|
|
21
|
+
onExposure?(presentation: ContinuousPresentation, report: ContinuousExposure): void;
|
|
22
|
+
onOcclusion?(occluded: boolean): void;
|
|
23
|
+
onError?(error: Error): void;
|
|
24
|
+
}
|
|
25
|
+
export declare function compatibleContinuousSequence(sequence: ContinuousPresentationInput[]): boolean;
|
|
26
|
+
/** One parent-owned session. Never rebinds the launching module's gateway. */
|
|
27
|
+
export declare class ContinuousChildCoordinator {
|
|
28
|
+
private readonly dependencies;
|
|
29
|
+
private child?;
|
|
30
|
+
private sequence;
|
|
31
|
+
private current?;
|
|
32
|
+
private applied?;
|
|
33
|
+
private acknowledged;
|
|
34
|
+
private subscriptions;
|
|
35
|
+
private actionIds;
|
|
36
|
+
private busy;
|
|
37
|
+
private opening;
|
|
38
|
+
private ready;
|
|
39
|
+
private epoch;
|
|
40
|
+
private acknowledgementTimer?;
|
|
41
|
+
private key;
|
|
42
|
+
constructor(dependencies: ContinuousChildDependencies);
|
|
43
|
+
open(position: number, key: string): Promise<boolean>;
|
|
44
|
+
/** Called on authoritative parent progression changes. */
|
|
45
|
+
sync(): void;
|
|
46
|
+
private makePresentation;
|
|
47
|
+
private push;
|
|
48
|
+
private request;
|
|
49
|
+
private awaitAcknowledgement;
|
|
50
|
+
private reset;
|
|
51
|
+
close(): Promise<void>;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GlobalGatewayFactory } from '../../../module-connector/src/main';
|
|
2
2
|
import { PluginService } from '../plugin-service';
|
|
3
3
|
export * from './plugin';
|
|
4
|
-
export declare function appSagas(pluginService: PluginService, gatewayFactory: GlobalGatewayFactory): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<void> | Generator<import("redux-saga/effects").CallEffect | import("redux-saga/effects").TakeEffect, void, import("redux-saga").TakeableChannel<unknown> | undefined> | Generator<import("redux-saga/effects").CallEffect | import("redux-saga/effects").ActionChannelEffect | import("redux-saga/effects").ChannelTakeEffect<unknown>, void, import("redux-saga").TakeableChannel<unknown> | undefined>>, void, unknown>;
|
|
4
|
+
export declare function appSagas(pluginService: PluginService, gatewayFactory: GlobalGatewayFactory, closeContinuous?: () => Promise<void>): Generator<import("redux-saga/effects").AllEffect<import("redux-saga/effects").ForkEffect<void> | Generator<import("redux-saga/effects").CallEffect | import("redux-saga/effects").TakeEffect, void, import("redux-saga").TakeableChannel<unknown> | undefined> | Generator<import("redux-saga/effects").CallEffect | import("redux-saga/effects").ActionChannelEffect | import("redux-saga/effects").ChannelTakeEffect<unknown>, void, import("redux-saga").TakeableChannel<unknown> | undefined>>, void, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginInterface } from '@rokt/plugin';
|
|
2
|
+
import { NormalizedAttributes } from '@rokt/plugin/interface/attributes';
|
|
3
|
+
import { Callback, Unsubscriber } from '@rokt/plugin/interface/subscriber';
|
|
4
|
+
export type AttributesService = {
|
|
5
|
+
subscribe(value?: Callback<[NormalizedAttributes]>, error?: Callback, complete?: Callback): Unsubscriber;
|
|
6
|
+
};
|
|
7
|
+
export declare const makeAttributesService: (pluginInterface: Pick<PluginInterface, "attributes">) => AttributesService;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DisplayInterface, PluginInterface } from '@rokt/plugin';
|
|
2
2
|
import { EventChannel } from 'redux-saga';
|
|
3
3
|
export type DisplayService = Pick<DisplayInterface, 'setDisplaySettings'> & {
|
|
4
|
+
scrollHostToViewportOffset?(viewportOffsetY: number): Promise<void>;
|
|
4
5
|
activeBreakpointEventChannel?(breakpoints: Record<string, number>): EventChannel<string>;
|
|
5
6
|
};
|
|
6
7
|
export declare const makeDisplayService: (pluginInterface: Pick<PluginInterface, 'display'>) => DisplayService;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ErrorInterface, PluginInterface, RDNInterface, ThemeInterface } from '@rokt/plugin';
|
|
2
|
+
import { AttributesService } from './attributes';
|
|
2
3
|
import { ContextService } from './context';
|
|
3
4
|
import { MetricsService } from './metrics';
|
|
4
5
|
import { DisplayService } from './display';
|
|
@@ -6,8 +7,9 @@ import { PartnerInteractionService } from './partner-interaction';
|
|
|
6
7
|
import { ParentInteractionService } from './parent-interaction';
|
|
7
8
|
import { ConfigService } from './config';
|
|
8
9
|
import { ChildPluginService } from './child-plugin';
|
|
9
|
-
export { ContextService, MetricsService, DisplayService, PartnerInteractionService, ParentInteractionService, ConfigService, ChildPluginService, };
|
|
10
|
+
export { AttributesService, ContextService, MetricsService, DisplayService, PartnerInteractionService, ParentInteractionService, ConfigService, ChildPluginService, };
|
|
10
11
|
export interface PluginService<T> {
|
|
12
|
+
attributesService: AttributesService;
|
|
11
13
|
contextService: ContextService;
|
|
12
14
|
configService: ConfigService<T>;
|
|
13
15
|
partnerInteractionService: PartnerInteractionService;
|
|
@@ -6,10 +6,17 @@ export declare const TRIGGER_SELECT_ITEM = "CATALOG/TRIGGER_SELECT_ITEM";
|
|
|
6
6
|
export type TriggerSelectItemAction = {
|
|
7
7
|
type: typeof TRIGGER_SELECT_ITEM;
|
|
8
8
|
payload: SetSelectedItemPayload;
|
|
9
|
+
preserveAttributeSelections?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const SET_SELECTED_ITEM = "CATALOG/SET_SELECTED_ITEM";
|
|
11
12
|
export type SetSelectedItemAction = {
|
|
12
13
|
type: typeof SET_SELECTED_ITEM;
|
|
13
14
|
payload: SetSelectedItemPayload;
|
|
15
|
+
preserveAttributeSelections?: boolean;
|
|
14
16
|
};
|
|
15
|
-
export
|
|
17
|
+
export declare const SET_CATALOG_ATTRIBUTE_SELECTIONS = "CATALOG/SET_ATTRIBUTE_SELECTIONS";
|
|
18
|
+
export type SetCatalogAttributeSelectionsAction = {
|
|
19
|
+
type: typeof SET_CATALOG_ATTRIBUTE_SELECTIONS;
|
|
20
|
+
payload: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
export type CatalogSelectionActions = SetCatalogAttributeSelectionsAction | SetSelectedItemAction | TriggerSelectItemAction;
|
|
@@ -42,6 +42,8 @@ export interface PushTaxAndShippingPayload {
|
|
|
42
42
|
}
|
|
43
43
|
export interface MarkTaxAndShippingPendingPayload {
|
|
44
44
|
cacheKey: string;
|
|
45
|
+
requestId: string;
|
|
46
|
+
preserveEstimate?: boolean;
|
|
45
47
|
}
|
|
46
48
|
export declare const INITIATE_INSTANT_PURCHASE = "INSTANT_PURCHASE/INITIATE";
|
|
47
49
|
export type InitiateInstantPurchase = {
|
|
@@ -92,6 +94,8 @@ export type SetActiveTaxAndShippingKey = {
|
|
|
92
94
|
};
|
|
93
95
|
export type InitiateTaxAndShippingPayload = {
|
|
94
96
|
catalogItem: PluginCatalogItem;
|
|
97
|
+
force?: boolean;
|
|
98
|
+
requestId?: string;
|
|
95
99
|
};
|
|
96
100
|
export declare const INITIATE_TAX_AND_SHIPPING = "INSTANT_PURCHASE/INITIATE_TAX_AND_SHIPPING";
|
|
97
101
|
export type InitiateTaxAndShipping = {
|
|
@@ -112,7 +112,15 @@ export interface CatalogDevicePayButtonProps {
|
|
|
112
112
|
testId?: string;
|
|
113
113
|
}
|
|
114
114
|
type CatalogDevicePayButtonStyles = NonNullable<CatalogDevicePayButtonProps['schema']['styles']>;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the backend marked this catalog item as purchasable with PayPal. The
|
|
117
|
+
* flag rides in the item's `providerData` JSON and is omitted when false, so
|
|
118
|
+
* anything other than an explicit `true` (absent, malformed, wrong type) means
|
|
119
|
+
* the item is not PayPal-enabled.
|
|
120
|
+
*/
|
|
121
|
+
export declare function isPayPalEnabled(providerData: string | undefined): boolean;
|
|
115
122
|
export declare function getCatalogDevicePayButtonStyles(styles: CatalogDevicePayButtonProps['schema']['styles']): CatalogDevicePayButtonStyles;
|
|
123
|
+
export declare function getPayPalButtonStyles(styles: CatalogDevicePayButtonProps['schema']['styles']): CatalogDevicePayButtonStyles;
|
|
116
124
|
/**The CatalogDevicePayButton is a button node that generates a Call-to-Action button
|
|
117
125
|
* for initiating a device payment transaction using the associated payment provider.
|
|
118
126
|
* *Where can we use this: __layout variant__*
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CatalogSelectorsStackedModel, LayoutSchemaModel, WhenPredicate } from '@rokt/dcui-layout-schema';
|
|
3
3
|
export interface CatalogSelectorsStackedProps<Template extends LayoutSchemaModel> {
|
|
4
|
+
/**
|
|
5
|
+
* - `default`: the template rendered once per variant dimension.
|
|
6
|
+
* `CatalogDropdown` includes its own visible dimension label. Do not add a
|
|
7
|
+
* separate label node. Each render also exposes tokens for custom content:
|
|
8
|
+
* * `%^DATA.variantAttribute.attributeId^%`: the dimension id, e.g.
|
|
9
|
+
* `color`. It comes from the merchant's variant option key and is
|
|
10
|
+
* neither normalised nor guaranteed lowercase or single-word, so
|
|
11
|
+
* `shoe_size` reaches the shopper verbatim. Apply casing with the node's
|
|
12
|
+
* `text.textTransform` rather than transforming the value, so `When`
|
|
13
|
+
* comparisons stay stable.
|
|
14
|
+
* * `%^DATA.variantAttribute.hasMultipleOptions^%`: `"true"` or `"false"`.
|
|
15
|
+
* `CatalogDropdown` renders neither label nor control for a single option,
|
|
16
|
+
* and the whole template for that dimension is hidden, so it takes no
|
|
17
|
+
* space in the stack.
|
|
18
|
+
* Tokens from the enclosing scope stay resolvable alongside these.
|
|
19
|
+
*
|
|
20
|
+
* Keep the dropdown mounted. A `When` that encloses it would stop it mounting, and
|
|
21
|
+
* a dropdown that never mounts never registers its validator field key —
|
|
22
|
+
* a trigger that then resolves zero keys fails closed, blocking the CTA
|
|
23
|
+
* with nothing on screen to explain it.
|
|
24
|
+
*
|
|
25
|
+
* Bind custom text with `BasicText`. `RichText` sends the value through the
|
|
26
|
+
* HTML sanitiser, which throws on markup-shaped input; the node is then
|
|
27
|
+
* dropped by its error boundary.
|
|
28
|
+
* - `dropdown`: accepted by the layout schema, currently ignored — this
|
|
29
|
+
* component only ever renders `default`.
|
|
30
|
+
* - `styles`:
|
|
31
|
+
* * `elements`:
|
|
32
|
+
* - `own`
|
|
33
|
+
*/
|
|
4
34
|
schema: CatalogSelectorsStackedModel<Template, WhenPredicate>;
|
|
5
35
|
testId?: string;
|
|
6
36
|
}
|
|
@@ -24,6 +24,8 @@ export interface TaxAndShippingData {
|
|
|
24
24
|
}
|
|
25
25
|
export interface TaxAndShippingEntry {
|
|
26
26
|
isPending: boolean;
|
|
27
|
+
requestId?: string;
|
|
28
|
+
purchaseId?: string;
|
|
27
29
|
taxAndShippingData?: TaxAndShippingData;
|
|
28
30
|
}
|
|
29
31
|
export interface TaxAndShippingState {
|
|
@@ -34,6 +36,7 @@ export declare const INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT = "INSTANT
|
|
|
34
36
|
export declare const INSTANT_PURCHASE_TAX_AND_SHIPPING_RESPONSE = "INSTANT_PURCHASE_TAX_AND_SHIPPING_RESPONSE";
|
|
35
37
|
export interface InstantPurchaseInitiateTaxAndShippingEventPayload {
|
|
36
38
|
cacheKey: string;
|
|
39
|
+
requestId?: string;
|
|
37
40
|
totalUpsellPrice: number;
|
|
38
41
|
currency: string;
|
|
39
42
|
upsellItems: UpsellItem[];
|
|
@@ -65,6 +68,7 @@ export interface InstantPurchaseTaxAndShippingResponseEnvelope {
|
|
|
65
68
|
}
|
|
66
69
|
export interface InstantPurchaseTaxAndShippingResponsePayload {
|
|
67
70
|
cacheKey: string;
|
|
71
|
+
requestId?: string;
|
|
68
72
|
timestamp: string;
|
|
69
73
|
sessionId: string;
|
|
70
74
|
response?: InstantPurchaseTaxAndShippingResponseEnvelope;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AnyAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { CatalogSelectionState } from '../../models/state/catalog-selection';
|
|
3
|
+
export type CatalogAttributeSelectionsState = Record<string, string> | null;
|
|
4
|
+
export declare const catalogAttributeSelectionsReducer: (state: CatalogAttributeSelectionsState | undefined, action: AnyAction) => CatalogAttributeSelectionsState;
|
|
3
5
|
export declare function makeInitialCatalogSelectionState(): CatalogSelectionState;
|
|
4
6
|
export declare const catalogReducer: (state: CatalogSelectionState | undefined, action: AnyAction) => CatalogSelectionState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GlobalActions } from '../../../../libraries/domain/src/behaviors';
|
|
2
2
|
import { ChildLayoutActions, childLayoutsReducer, ChildLayoutsState, StaticData, staticDataReducer, DynamicData, dynamicDataReducer } from '../../../../libraries/module-utils/src/index';
|
|
3
3
|
import { CatalogSelectionState, DevicePayAvailabilityState, FulfillmentDetailsState, OfferLifecycleEventState, TaxAndShippingState } from '../models';
|
|
4
|
+
import { CatalogAttributeSelectionsState } from './catalog-selection/reducer';
|
|
4
5
|
import { DevicePayRequestsState } from './device-pay-requests';
|
|
5
6
|
import { PurchaseIdState } from './instant-purchase';
|
|
6
7
|
import { PayPalTransactionDetailsState } from './paypal-transaction-details';
|
|
@@ -8,6 +9,7 @@ import { PayPalPurchaseContextState } from './paypal-purchase-context';
|
|
|
8
9
|
export type AppState = {
|
|
9
10
|
staticData: StaticData;
|
|
10
11
|
selectedItem: CatalogSelectionState;
|
|
12
|
+
catalogAttributeSelections: CatalogAttributeSelectionsState;
|
|
11
13
|
dynamicData: DynamicData;
|
|
12
14
|
childLayouts: ChildLayoutsState;
|
|
13
15
|
fulfillmentDetails: FulfillmentDetailsState;
|
|
@@ -23,6 +25,7 @@ export type StateActions = GlobalActions | ChildLayoutActions;
|
|
|
23
25
|
export declare const appReducers: {
|
|
24
26
|
staticData: typeof staticDataReducer;
|
|
25
27
|
selectedItem: (state: CatalogSelectionState | undefined, action: import("redux").AnyAction) => CatalogSelectionState;
|
|
28
|
+
catalogAttributeSelections: (state: CatalogAttributeSelectionsState | undefined, action: import("redux").AnyAction) => CatalogAttributeSelectionsState;
|
|
26
29
|
dynamicData: typeof dynamicDataReducer;
|
|
27
30
|
childLayouts: typeof childLayoutsReducer;
|
|
28
31
|
fulfillmentDetails: (state: FulfillmentDetailsState | undefined, action: import("redux").AnyAction) => FulfillmentDetailsState;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { CallEffect, ForkEffect, PutEffect, RaceEffect, SelectEffect } from 'redux-saga/effects';
|
|
2
|
-
import { Log } from '../../../../../libraries/domain/src/models';
|
|
2
|
+
import { Log, PluginCatalogItem, ShippingAttributes } from '../../../../../libraries/domain/src/models';
|
|
3
3
|
import { GlobalGateway } from '../../../../../libraries/module-connector/src/main';
|
|
4
4
|
import { StaticData } from '../../../../../libraries/module-utils/src/index';
|
|
5
|
-
import { InitiateInstantPurchase, InstantPurchasePartnerResponse } from '../../actions/instant-purchase';
|
|
5
|
+
import { InitiateInstantPurchase, InstantPurchasePartnerResponse, PushTaxAndShipping } from '../../actions/instant-purchase';
|
|
6
6
|
import { AppState } from '../../reducers';
|
|
7
7
|
import { TriggerSelectItemAction, InstantPurchaseWsdkResponse, UpsellItemInstantPurchasePartnerResponse } from '../../actions';
|
|
8
8
|
export declare const INSTANT_PURCHASE_RESPONSE_TTL = 60000;
|
|
9
9
|
export declare function processSelectDefaultOrOnlyCatalogItem(): Generator<SelectEffect | PutEffect | CallEffect, void, AppState | undefined>;
|
|
10
10
|
export declare function processSelectCatalogItem(action: TriggerSelectItemAction): Generator<SelectEffect | PutEffect | CallEffect, void, never>;
|
|
11
|
-
export declare function processInstantPurchaseCartItem(gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateInstantPurchase): Generator<SelectEffect | CallEffect | PutEffect | ForkEffect, void, AppState | undefined
|
|
11
|
+
export declare function processInstantPurchaseCartItem(gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateInstantPurchase): Generator<SelectEffect | CallEffect | PutEffect | ForkEffect, void, AppState | undefined | {
|
|
12
|
+
result?: PushTaxAndShipping;
|
|
13
|
+
selectionChanged?: unknown;
|
|
14
|
+
offerEnd?: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
/** Visible for testing the cancellation conditions while a quote is pending. */
|
|
17
|
+
export declare function waitForPurchaseTaxRetry(cacheKey: string, requestId: string, catalogItem: PluginCatalogItem, shippingAttributes: Partial<ShippingAttributes>): Generator<RaceEffect<import("redux-saga/effects").TakeEffect>, {
|
|
18
|
+
result?: PushTaxAndShipping;
|
|
19
|
+
selectionChanged?: unknown;
|
|
20
|
+
offerEnd?: unknown;
|
|
21
|
+
}, {
|
|
22
|
+
result?: PushTaxAndShipping;
|
|
23
|
+
selectionChanged?: unknown;
|
|
24
|
+
offerEnd?: unknown;
|
|
25
|
+
}>;
|
|
12
26
|
export declare function handleInstantPurchasePartnerResponse(logger: (log: Log) => void, action: InstantPurchasePartnerResponse): Generator<SelectEffect | CallEffect | PutEffect, void, StaticData | undefined>;
|
|
13
27
|
export declare function handleUpsellItemInstantPurchasePartnerResponse(logger: (log: Log) => void, action: UpsellItemInstantPurchasePartnerResponse): Generator<SelectEffect | CallEffect | PutEffect, void, StaticData | undefined>;
|
|
14
28
|
export declare function handleInstantPurchaseWsdkResponse(action: InstantPurchaseWsdkResponse): Generator<PutEffect, void, never>;
|
|
@@ -14,9 +14,11 @@ type PayPalEventPayload = {
|
|
|
14
14
|
} | {
|
|
15
15
|
type: 'DEVICE_PAY_FAILURE';
|
|
16
16
|
reason?: string;
|
|
17
|
+
retryable?: boolean;
|
|
17
18
|
} | {
|
|
18
19
|
type: 'DEVICE_PAY_CANCEL';
|
|
19
20
|
};
|
|
21
|
+
export declare function createPayPalEventChannel(gateway: GlobalGateway, logger: (log: Log) => void): EventChannel<PayPalEventPayload>;
|
|
20
22
|
export declare function listenForPayPalEvents(channel: EventChannel<PayPalEventPayload>, logger: (log: Log) => void, offerPositionIndex: number): Generator<ChannelTakeEffect<PayPalEventPayload> | CallEffect<void> | PutEffect | SelectEffect, void, PayPalEventPayload | (PayPalPurchaseContext | null)>;
|
|
21
23
|
export declare function preparePayPal(gateway: GlobalGateway, logger: (log: Log) => void): Generator<CallEffect<void> | SelectEffect | PutEffect<{
|
|
22
24
|
type: string;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { CallEffect, PutEffect, RaceEffect, SelectEffect, ForkEffect } from 'redux-saga/effects';
|
|
2
|
-
import { InstantPurchaseTaxAndShippingResponsePayload,
|
|
2
|
+
import { InstantPurchaseTaxAndShippingResponsePayload, TaxAndShippingState, TaxAndShippingErrors } from '../../models';
|
|
3
3
|
import { GlobalGateway } from '../../../../../libraries/module-connector/src/main';
|
|
4
4
|
import { Log } from '../../../../../libraries/domain/src/models';
|
|
5
5
|
import { AppState } from '../../reducers';
|
|
6
6
|
import { InitiateTaxAndShipping } from '../../actions';
|
|
7
7
|
export declare const pendingRequestKeys: Set<string>;
|
|
8
|
+
export declare function resetTaxAndShippingRequestTrackingForTest(): void;
|
|
9
|
+
export declare function createTaxAndShippingRequestId(): string;
|
|
8
10
|
export declare function watchTaxAndShippingChannel(gateway: GlobalGateway, logger: (log: Log) => void): Generator<RaceEffect<unknown> | CallEffect, void, {
|
|
9
11
|
response: InstantPurchaseTaxAndShippingResponsePayload | undefined;
|
|
10
12
|
offerEnd: unknown;
|
|
11
13
|
} | undefined>;
|
|
12
|
-
export declare function initiateTaxAndShippingRequest(_gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateTaxAndShipping): Generator<SelectEffect | CallEffect | PutEffect | ForkEffect, void, AppState['fulfillmentDetails'] | boolean>;
|
|
13
|
-
export declare function processTaxAndShippingResponse(payload: InstantPurchaseTaxAndShippingResponsePayload): Generator<PutEffect
|
|
14
|
+
export declare function initiateTaxAndShippingRequest(_gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateTaxAndShipping): Generator<SelectEffect | CallEffect | PutEffect | ForkEffect, void, AppState['fulfillmentDetails'] | boolean | string | null>;
|
|
15
|
+
export declare function processTaxAndShippingResponse(payload: InstantPurchaseTaxAndShippingResponsePayload): Generator<SelectEffect | PutEffect, void, unknown>;
|
|
16
|
+
export declare function timeoutPendingCacheEntry(cacheKey: string, requestId: string, logger: (log: Log) => void): Generator<CallEffect<void> | SelectEffect | CallEffect<true> | PutEffect<{
|
|
14
17
|
type: string;
|
|
15
18
|
payload: {
|
|
16
19
|
cacheKey: string;
|
|
17
20
|
taxAndShippingEntry: {
|
|
18
|
-
isPending: false;
|
|
19
21
|
taxAndShippingData: {
|
|
20
|
-
error: TaxAndShippingErrors
|
|
22
|
+
error: TaxAndShippingErrors;
|
|
21
23
|
};
|
|
24
|
+
requestId?: string | undefined;
|
|
25
|
+
isPending: false;
|
|
22
26
|
};
|
|
23
27
|
};
|
|
24
28
|
}> | PutEffect<{
|
|
@@ -33,18 +37,4 @@ export declare function processTaxAndShippingResponse(payload: InstantPurchaseTa
|
|
|
33
37
|
key: "offerComplete";
|
|
34
38
|
value: number;
|
|
35
39
|
};
|
|
36
|
-
}
|
|
37
|
-
type: string;
|
|
38
|
-
payload: {
|
|
39
|
-
cacheKey: string;
|
|
40
|
-
taxAndShippingEntry: {
|
|
41
|
-
isPending: false;
|
|
42
|
-
taxAndShippingData: {
|
|
43
|
-
taxAndShippingPricing: TaxAndShippingPricing;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}> | PutEffect<{
|
|
48
|
-
type: string;
|
|
49
|
-
payload: string | null;
|
|
50
|
-
}>, void, unknown>;
|
|
40
|
+
}>, void, TaxAndShippingState>;
|
|
@@ -3,6 +3,7 @@ import { AppState } from '../../reducers';
|
|
|
3
3
|
export declare function getDevicePayAvailability(state: AppState): DevicePayAvailabilityState;
|
|
4
4
|
export declare function isApplePayAvailable(state: AppState): boolean;
|
|
5
5
|
export declare function isAfterpayAvailable(state: AppState): boolean;
|
|
6
|
+
export declare function isPayPalAvailable(state: AppState): boolean;
|
|
6
7
|
/**
|
|
7
8
|
* Gate for the "no remaining usable payment option" branch in
|
|
8
9
|
* processDevicePayAvailable. True when every entry in supportedPaymentMethods
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { PluginCatalogItem } from '../../../../../libraries/domain/src/models';
|
|
1
2
|
import { TaxAndShippingEntry } from '../../models';
|
|
2
3
|
import { AppState } from '../../reducers';
|
|
4
|
+
export type TaxAndShippingDisplayState = 'waitingForSelection' | 'idle' | 'loading' | 'ready' | 'error';
|
|
5
|
+
/** A stacked selector can set a preview item before all visible choices are made. */
|
|
6
|
+
export declare function isCatalogSelectionIncomplete(state: AppState): boolean;
|
|
7
|
+
export declare function getTaxAndShippingDisplayState(state: AppState): TaxAndShippingDisplayState;
|
|
3
8
|
export declare function getActiveTaxAndShipping(state: AppState): TaxAndShippingEntry;
|
|
9
|
+
export declare function isTaxAndShippingDisplayPending(entry: TaxAndShippingEntry): boolean;
|
|
10
|
+
export declare function getTaxAndShippingForCatalogItem(state: AppState, catalogItem: Pick<PluginCatalogItem, 'catalogItemId'> & Partial<Pick<PluginCatalogItem, 'copy'>> & Partial<Pick<PluginCatalogItem, 'price' | 'preSelectedQuantity' | 'currency'>>): TaxAndShippingEntry | undefined;
|
|
11
|
+
export declare function isCatalogItemTaxAndShippingReady(state: AppState, catalogItem: Pick<PluginCatalogItem, 'catalogItemId' | 'copy'> & Partial<Pick<PluginCatalogItem, 'price' | 'preSelectedQuantity' | 'currency'>>): boolean;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ShippingAttributes } from '../../../../libraries/domain/src/models';
|
|
2
2
|
export declare function createTaxAndShippingCacheKey(shippingAttributes: Partial<ShippingAttributes>, catalogItems: {
|
|
3
3
|
catalogItemId: string;
|
|
4
|
+
price?: number;
|
|
5
|
+
preSelectedQuantity?: number;
|
|
6
|
+
currency?: string;
|
|
7
|
+
copy?: Record<string, string>;
|
|
4
8
|
}[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseNonNegativeMonetaryAmount(value: unknown): number | null;
|
|
@@ -12,10 +12,11 @@ export declare function getRealtimeFulfillmentSuccessCallback(gateway: GlobalGat
|
|
|
12
12
|
payload: {
|
|
13
13
|
name: string;
|
|
14
14
|
body: {
|
|
15
|
+
rewardHandoff: boolean | undefined;
|
|
16
|
+
adID?: string;
|
|
15
17
|
rclid: string | undefined;
|
|
16
18
|
accountID: string;
|
|
17
19
|
referralCreativeID: string | undefined;
|
|
18
|
-
rewardHandoff: boolean | undefined;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
}>, void, unknown>) | undefined;
|