@rokt/dcui-orchestrator 1.2.1-rc.21 → 1.2.1-rc.23

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.
@@ -43,6 +43,7 @@ export interface PushTaxAndShippingPayload {
43
43
  export interface MarkTaxAndShippingPendingPayload {
44
44
  cacheKey: string;
45
45
  requestId: string;
46
+ preserveEstimate?: boolean;
46
47
  }
47
48
  export declare const INITIATE_INSTANT_PURCHASE = "INSTANT_PURCHASE/INITIATE";
48
49
  export type InitiateInstantPurchase = {
@@ -93,6 +94,8 @@ export type SetActiveTaxAndShippingKey = {
93
94
  };
94
95
  export type InitiateTaxAndShippingPayload = {
95
96
  catalogItem: PluginCatalogItem;
97
+ force?: boolean;
98
+ requestId?: string;
96
99
  };
97
100
  export declare const INITIATE_TAX_AND_SHIPPING = "INSTANT_PURCHASE/INITIATE_TAX_AND_SHIPPING";
98
101
  export type InitiateTaxAndShipping = {
@@ -25,6 +25,7 @@ export interface TaxAndShippingData {
25
25
  export interface TaxAndShippingEntry {
26
26
  isPending: boolean;
27
27
  requestId?: string;
28
+ purchaseId?: string;
28
29
  taxAndShippingData?: TaxAndShippingData;
29
30
  }
30
31
  export interface TaxAndShippingState {
@@ -35,6 +36,7 @@ export declare const INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT = "INSTANT
35
36
  export declare const INSTANT_PURCHASE_TAX_AND_SHIPPING_RESPONSE = "INSTANT_PURCHASE_TAX_AND_SHIPPING_RESPONSE";
36
37
  export interface InstantPurchaseInitiateTaxAndShippingEventPayload {
37
38
  cacheKey: string;
39
+ requestId?: string;
38
40
  totalUpsellPrice: number;
39
41
  currency: string;
40
42
  upsellItems: UpsellItem[];
@@ -66,6 +68,7 @@ export interface InstantPurchaseTaxAndShippingResponseEnvelope {
66
68
  }
67
69
  export interface InstantPurchaseTaxAndShippingResponsePayload {
68
70
  cacheKey: string;
71
+ requestId?: string;
69
72
  timestamp: string;
70
73
  sessionId: string;
71
74
  response?: InstantPurchaseTaxAndShippingResponseEnvelope;
@@ -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;
@@ -5,21 +5,36 @@ 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>;
14
+ export declare function initiateTaxAndShippingRequest(_gateway: GlobalGateway, logger: (log: Log) => void, action: InitiateTaxAndShipping): Generator<SelectEffect | CallEffect | PutEffect | ForkEffect, void, AppState['fulfillmentDetails'] | boolean | string | null>;
13
15
  export declare function processTaxAndShippingResponse(payload: InstantPurchaseTaxAndShippingResponsePayload): Generator<SelectEffect | PutEffect, void, unknown>;
14
16
  export declare function timeoutPendingCacheEntry(cacheKey: string, requestId: string, logger: (log: Log) => void): Generator<CallEffect<void> | SelectEffect | CallEffect<true> | PutEffect<{
15
17
  type: string;
16
18
  payload: {
17
19
  cacheKey: string;
18
20
  taxAndShippingEntry: {
19
- isPending: false;
20
21
  taxAndShippingData: {
21
22
  error: TaxAndShippingErrors;
22
23
  };
24
+ requestId?: string | undefined;
25
+ isPending: false;
23
26
  };
24
27
  };
28
+ }> | PutEffect<{
29
+ type: string;
30
+ payload: {
31
+ event: string;
32
+ completionReason: string;
33
+ };
34
+ }> | PutEffect<{
35
+ type: string;
36
+ payload: {
37
+ key: "offerComplete";
38
+ value: number;
39
+ };
25
40
  }>, void, TaxAndShippingState>;
@@ -2,5 +2,6 @@ import { PluginCatalogItem } from '../../../../../libraries/domain/src/models';
2
2
  import { TaxAndShippingEntry } from '../../models';
3
3
  import { AppState } from '../../reducers';
4
4
  export declare function getActiveTaxAndShipping(state: AppState): TaxAndShippingEntry;
5
- export declare function getTaxAndShippingForCatalogItem(state: AppState, catalogItem: Pick<PluginCatalogItem, 'catalogItemId'>): TaxAndShippingEntry | undefined;
6
- export declare function isCatalogItemTaxAndShippingReady(state: AppState, catalogItem: Pick<PluginCatalogItem, 'catalogItemId' | 'copy'>): boolean;
5
+ export declare function isTaxAndShippingDisplayPending(entry: TaxAndShippingEntry): boolean;
6
+ export declare function getTaxAndShippingForCatalogItem(state: AppState, catalogItem: Pick<PluginCatalogItem, 'catalogItemId'> & Partial<Pick<PluginCatalogItem, 'copy'>> & Partial<Pick<PluginCatalogItem, 'price' | 'preSelectedQuantity' | 'currency'>>): TaxAndShippingEntry | undefined;
7
+ 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "1.2.1-rc.21",
3
+ "version": "1.2.1-rc.23",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",