@rokt/dcui-orchestrator 1.2.1-rc.6 → 1.2.1-rc.60

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.
Files changed (123) hide show
  1. package/dist/index.cjs +47 -38
  2. package/dist/index.js +59 -50
  3. package/dist/libraries/dcui-components/src/components/index.d.ts +3 -0
  4. package/dist/libraries/dcui-components/src/components/paypal-button/index.d.ts +1 -0
  5. package/dist/libraries/dcui-components/src/components/paypal-button/paypal-button.d.ts +78 -0
  6. package/dist/libraries/dcui-components/src/components/paypal-button/paypal-wordmark.d.ts +10 -0
  7. package/dist/libraries/dcui-components/src/components/progress-control/index.d.ts +1 -0
  8. package/dist/libraries/dcui-components/src/components/progress-control/progress-control.d.ts +49 -0
  9. package/dist/libraries/dcui-components/src/components/progress-indicator/get-progress-indicator-state.d.ts +3 -0
  10. package/dist/libraries/dcui-components/src/components/progress-indicator/index.d.ts +3 -0
  11. package/dist/libraries/dcui-components/src/components/progress-indicator/progress-indicator.d.ts +8 -0
  12. package/dist/libraries/dcui-components/src/components/progress-indicator/types.d.ts +88 -0
  13. package/dist/libraries/dcui-components/src/components/style-mapper/combiners/escape-css-string.d.ts +19 -0
  14. package/dist/libraries/dcui-components/src/components/style-mapper/combiners/index.d.ts +1 -0
  15. package/dist/libraries/dcui-components/src/contexts/index.d.ts +1 -0
  16. package/dist/libraries/dcui-components/src/contexts/lead-capture-offer-context.d.ts +5 -0
  17. package/dist/libraries/dcui-components/src/contexts/validators/validator-provider.d.ts +5 -3
  18. package/dist/libraries/dcui-components/src/failure-codes.d.ts +2 -0
  19. package/dist/libraries/dcui-components/src/utils/index.d.ts +1 -0
  20. package/dist/libraries/dcui-components/src/utils/link-schemes.d.ts +35 -0
  21. package/dist/libraries/dcui-components/src/utils/responsive-css.d.ts +9 -0
  22. package/dist/libraries/domain/src/behaviors/continuous-child.d.ts +62 -0
  23. package/dist/libraries/domain/src/behaviors/custom-states.d.ts +8 -1
  24. package/dist/libraries/domain/src/behaviors/index.d.ts +1 -0
  25. package/dist/libraries/domain/src/behaviors/offer-engagement.d.ts +11 -0
  26. package/dist/libraries/domain/src/behaviors/send-partner.d.ts +14 -2
  27. package/dist/libraries/domain/src/behaviors/trigger-action.d.ts +3 -3
  28. package/dist/libraries/domain/src/models/child-layout-response.d.ts +6 -0
  29. package/dist/libraries/domain/src/models/form-state.d.ts +85 -0
  30. package/dist/libraries/domain/src/models/global-state.d.ts +15 -1
  31. package/dist/libraries/domain/src/models/index.d.ts +1 -0
  32. package/dist/libraries/domain/src/models/layout/layout-offer.d.ts +2 -0
  33. package/dist/libraries/domain/src/models/partner-event.d.ts +1 -1
  34. package/dist/libraries/domain/src/models/plugin/plugin-child-layout-model.d.ts +1 -0
  35. package/dist/libraries/domain/src/models/plugin/plugin-offer.d.ts +2 -0
  36. package/dist/libraries/domain/src/models/purchase.d.ts +3 -0
  37. package/dist/libraries/layout-renderer-utils/src/reducers/breakpoint/coerce-breakpoints.d.ts +19 -0
  38. package/dist/libraries/layout-renderer-utils/src/reducers/breakpoint/index.d.ts +1 -0
  39. package/dist/libraries/layout-renderer-utils/src/sagas/error/error-codes.d.ts +3 -0
  40. package/dist/libraries/layout-renderer-utils/src/sagas/plugin/display.d.ts +3 -0
  41. package/dist/libraries/layout-renderer-utils/src/sagas/plugin/sagas.d.ts +4 -1
  42. package/dist/libraries/layout-renderer-utils/src/sagas/utils/index.d.ts +8 -1
  43. package/dist/libraries/layout-renderer-utils/src/sagas/utils/links.d.ts +28 -1
  44. package/dist/libraries/module-connector/src/main.d.ts +1 -1
  45. package/dist/libraries/module-connector/src/models/gateway.d.ts +19 -3
  46. package/dist/libraries/module-connector/src/models/module-attributes.d.ts +3 -0
  47. package/dist/libraries/module-connector/src/models/module-connector-builder.d.ts +1 -0
  48. package/dist/libraries/module-utils/src/sagas/child-layouts/sagas.d.ts +14 -4
  49. package/dist/libraries/orchestrator/src/actions/global-offer-data-state.d.ts +11 -1
  50. package/dist/libraries/orchestrator/src/actions/index.d.ts +2 -0
  51. package/dist/libraries/orchestrator/src/actions/module.d.ts +9 -1
  52. package/dist/libraries/orchestrator/src/cart-listener-gateway.d.ts +7 -0
  53. package/dist/libraries/orchestrator/src/components/progress-control/progress-control.d.ts +2 -45
  54. package/dist/libraries/orchestrator/src/components/progress-indicator/progress-indicator.d.ts +1 -9
  55. package/dist/libraries/orchestrator/src/components/progress-indicator/types.d.ts +1 -87
  56. package/dist/libraries/orchestrator/src/measurement/creative-measurement.d.ts +54 -0
  57. package/dist/libraries/orchestrator/src/models/state/global-offer-data-state.d.ts +6 -0
  58. package/dist/libraries/orchestrator/src/models/state/module.d.ts +1 -0
  59. package/dist/libraries/orchestrator/src/reducers/progression/reducer.d.ts +8 -0
  60. package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child-host.d.ts +15 -0
  61. package/dist/libraries/orchestrator/src/sagas/child-layouts/continuous-child.d.ts +52 -0
  62. package/dist/libraries/orchestrator/src/sagas/index.d.ts +1 -1
  63. package/dist/libraries/orchestrator/src/sagas/offer-engagement/sagas.d.ts +3 -3
  64. package/dist/libraries/orchestrator/src/sagas/partner-cart-sync/sagas.d.ts +2 -2
  65. package/dist/libraries/orchestrator/src/sagas/progression/sagas.d.ts +8 -2
  66. package/dist/libraries/orchestrator/src/sagas/utils/distribution.d.ts +21 -0
  67. package/dist/libraries/orchestrator/src/sagas/utils/index.d.ts +3 -0
  68. package/dist/libraries/orchestrator/src/selectors/global-offer-data-state/selectors.d.ts +8 -1
  69. package/dist/libraries/plugin-utils/src/plugin-service/display.d.ts +1 -0
  70. package/dist/libraries/saga-utils/src/utils/index.d.ts +1 -0
  71. package/dist/libraries/saga-utils/src/utils/quantity-rules.d.ts +184 -0
  72. package/dist/modules/add-to-cart/src/actions/cart.d.ts +7 -1
  73. package/dist/modules/add-to-cart/src/actions/catalog-item.d.ts +15 -1
  74. package/dist/modules/add-to-cart/src/components/when-catalog-quantity/when-catalog-quantity.d.ts +2 -1
  75. package/dist/modules/add-to-cart/src/reducers/cart/reducer.d.ts +2 -1
  76. package/dist/modules/add-to-cart/src/sagas/index.d.ts +2 -1
  77. package/dist/modules/add-to-cart/src/sagas/update-cart-item/sagas.d.ts +6 -3
  78. package/dist/modules/add-to-cart/src/selectors/cart/selectors.d.ts +31 -0
  79. package/dist/modules/add-to-cart/src/selectors/catalogItems/selectors.d.ts +8 -0
  80. package/dist/modules/instant-purchase/src/actions/instant-purchase.d.ts +4 -0
  81. package/dist/modules/instant-purchase/src/components/catalog-device-pay-button/catalog-device-pay-button.d.ts +8 -0
  82. package/dist/modules/instant-purchase/src/components/catalog-selectors-stacked/catalog-selectors-stacked.d.ts +30 -0
  83. package/dist/modules/instant-purchase/src/constants/device-pay-error.d.ts +1 -1
  84. package/dist/modules/instant-purchase/src/models/state/device-pay-availability.d.ts +2 -0
  85. package/dist/modules/instant-purchase/src/models/state/instant-purchase.d.ts +4 -0
  86. package/dist/modules/instant-purchase/src/sagas/device-pay/sagas.d.ts +2 -7
  87. package/dist/modules/instant-purchase/src/sagas/instant-purchase/sagas.d.ts +17 -3
  88. package/dist/modules/instant-purchase/src/sagas/paypal/sagas.d.ts +2 -0
  89. package/dist/modules/instant-purchase/src/sagas/tax-and-shipping/sagas.d.ts +10 -20
  90. package/dist/modules/instant-purchase/src/selectors/catalog-selection/index.d.ts +1 -0
  91. package/dist/modules/instant-purchase/src/selectors/catalog-selection/selectors.d.ts +7 -0
  92. package/dist/modules/instant-purchase/src/selectors/device-pay-availability/selectors.d.ts +2 -0
  93. package/dist/modules/instant-purchase/src/selectors/index.d.ts +1 -0
  94. package/dist/modules/instant-purchase/src/selectors/tax-and-shipping/selectors.d.ts +8 -0
  95. package/dist/modules/instant-purchase/src/utils/compute-selections-for-item.d.ts +7 -0
  96. package/dist/modules/instant-purchase/src/utils/create-tax-and-shipping-cache-key.d.ts +4 -0
  97. package/dist/modules/instant-purchase/src/utils/parse-non-negative-monetary-amount.d.ts +1 -0
  98. package/dist/modules/instant-purchase/src/utils/requires-tax-and-shipping-initialization.d.ts +2 -0
  99. package/dist/modules/standard-marketing/src/sagas/offer-engagement/sagas.d.ts +2 -1
  100. package/node_modules/@rokt/dcui-layout-schema/dist/schema.d.ts +583 -21
  101. package/node_modules/@rokt/dcui-layout-schema/dist/tsconfig.tsbuildinfo +1 -1
  102. package/node_modules/@rokt/dcui-layout-schema/package.json +1 -1
  103. package/node_modules/@rokt/dcui-layout-schema/v1.21/index.d.ts +7105 -0
  104. package/node_modules/@rokt/dcui-layout-schema/v1.21/index.js +4 -0
  105. package/node_modules/@rokt/dcui-layout-schema/v1.22/index.d.ts +7121 -0
  106. package/node_modules/@rokt/dcui-layout-schema/v1.22/index.js +4 -0
  107. package/node_modules/@rokt/dcui-layout-schema/v1.23/index.d.ts +7126 -0
  108. package/node_modules/@rokt/dcui-layout-schema/v1.23/index.js +4 -0
  109. package/node_modules/@rokt/dcui-layout-schema/v1.24/index.d.ts +7492 -0
  110. package/node_modules/@rokt/dcui-layout-schema/v1.24/index.js +4 -0
  111. package/node_modules/@rokt/dcui-layout-schema/v1.25/index.d.ts +7510 -0
  112. package/node_modules/@rokt/dcui-layout-schema/v1.25/index.js +4 -0
  113. package/node_modules/@rokt/dcui-layout-schema/v1.26/index.d.ts +7516 -0
  114. package/node_modules/@rokt/dcui-layout-schema/v1.26/index.js +4 -0
  115. package/node_modules/@rokt/dcui-layout-schema/v1.27/index.d.ts +7577 -0
  116. package/node_modules/@rokt/dcui-layout-schema/v1.27/index.js +4 -0
  117. package/node_modules/@rokt/dcui-layout-schema/v1.28/index.d.ts +7628 -0
  118. package/node_modules/@rokt/dcui-layout-schema/v1.28/index.js +4 -0
  119. package/node_modules/@rokt/dcui-layout-schema/v1.29/index.d.ts +7643 -0
  120. package/node_modules/@rokt/dcui-layout-schema/v1.29/index.js +4 -0
  121. package/node_modules/@rokt/dcui-layout-schema/v1.30/index.d.ts +7659 -0
  122. package/node_modules/@rokt/dcui-layout-schema/v1.30/index.js +4 -0
  123. package/package.json +2 -2
@@ -9,4 +9,35 @@ export declare function getCartItem(state: {
9
9
  }, cartItemId: string): PluginCartItem | null;
10
10
  export declare function getOfferCartItems(state: AppState): Array<PluginCartItem>;
11
11
  export declare function getOfferCartItemsQuantity(state: AppState): number;
12
+ /**
13
+ * The offer limit the offer's catalog items carry: the cap on the total
14
+ * quantity across all the offer's cart items, read as the first positive
15
+ * whole number across the items, the given item's own attributes first
16
+ * (readOfferQuantityLimit). Undefined when no item carries one, so 0 and an
17
+ * absent key mean no additional offer limit.
18
+ */
19
+ export declare function getOfferQuantityLimit(state: AppState, catalogItem?: Pick<PluginCatalogItem, 'copy'>): number | undefined;
20
+ /**
21
+ * The cap on the total quantity across the offer's cart items: the smaller
22
+ * of the offer's existing maxTotalItemsQtyInOffer and the offer limit its
23
+ * items carry (getOfferQuantityLimit), or Infinity when neither is set. Both
24
+ * apply, in every path that adds to the offer.
25
+ */
26
+ export declare function getOfferTotalCap(state: AppState, catalogItem?: Pick<PluginCatalogItem, 'copy'>): number;
27
+ /**
28
+ * The quantity the ordinary update can still add to this item: the cap the
29
+ * update keeps (getUpdateCap: the offer capacity left by the other items
30
+ * under the offer cap, the item's own cap and its existing per-item cap)
31
+ * less the quantity held. An exact item's own rules do not cap it, so the
32
+ * ordinary update keeps its existing cap alone for it, as before; the exact
33
+ * path bypasses that cap and the offer capacity bounds it
34
+ * (getCartItemApplicableCap).
35
+ */
12
36
  export declare function getCartItemMaxAddableQuantity(state: AppState, catalogItem: PluginCatalogItem): number;
37
+ /**
38
+ * The cap this item's quantity can reach under its quantity rules beside the
39
+ * existing item and offer caps, the offer limit the items carry among them.
40
+ * With no static data the offer's existing cap is unbounded, so the item's
41
+ * own limit and cap, and an offer limit on the item itself, still apply.
42
+ */
43
+ export declare function getCartItemApplicableCap(state: AppState, catalogItem: PluginCatalogItem): number;
@@ -4,6 +4,14 @@ export declare function getCatalogItems(state: AppState): Array<PluginCatalogIte
4
4
  export declare function getCatalogItem(state: AppState, catalogItemId: string): PluginCatalogItem | null;
5
5
  export declare function getCatalogItemByCartItemId(state: AppState, cartItemId: string): PluginCatalogItem | null;
6
6
  export declare function getPreselectedCatalogItems(state: AppState): Array<PluginCatalogItem> | null;
7
+ /**
8
+ * The preselected catalog items the cart does not know yet. An id already in
9
+ * the cart, as an item or as a null, came from the orchestrator's copy of this
10
+ * position's cart at mount: what the module published before it was unmounted,
11
+ * or a partner update retained while it was. Both are newer than the payload,
12
+ * so the payload's preselection applies to the rest alone.
13
+ */
14
+ export declare function getPendingPreselectedCatalogItems(state: AppState): Array<PluginCatalogItem> | null;
7
15
  export declare function getTotalPreselectedQuantity(state: AppState): number;
8
16
  export declare function isCatalogItemForcedUpsell(state: AppState, catalogItemId: string): boolean;
9
17
  export declare function isDeliveryDetailsRequired(state: AppState, catalogItemId?: string): boolean;
@@ -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
  }
@@ -1,2 +1,2 @@
1
- export { DEVICE_PAY_ERROR_STATE_KEY, DEVICE_PAY_ERROR_HIDDEN, DEVICE_PAY_ERROR_RETRYABLE_DECLINE, } from '../../../../libraries/domain/src/behaviors';
1
+ export { DEVICE_PAY_ERROR_STATE_KEY, DEVICE_PAY_PAYPAL_ERROR_STATE_KEY, DEVICE_PAY_ERROR_HIDDEN, DEVICE_PAY_ERROR_RETRYABLE_DECLINE, } from '../../../../libraries/domain/src/behaviors';
2
2
  export { RETRYABLE_DEVICE_PAY_ERROR_MESSAGE } from '../../../../libraries/dcui-components/src/index';
@@ -1,5 +1,7 @@
1
1
  export type DevicePayAvailabilityResponse = {
2
2
  applePay?: boolean;
3
3
  afterpay?: boolean;
4
+ paypal?: boolean;
5
+ googlePay?: boolean;
4
6
  };
5
7
  export type DevicePayAvailabilityState = DevicePayAvailabilityResponse | null;
@@ -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,6 +1,6 @@
1
1
  import { CallEffect, PutEffect, ChannelTakeEffect } from 'redux-saga/effects';
2
2
  import { EventChannel } from 'redux-saga';
3
- import { Log, PaymentMethodType, PluginCatalogItem, ShippingAttributes } from '../../../../../libraries/domain/src/models';
3
+ import { Log, PaymentMethodType, PluginCatalogItem, PrepareDevicePayEventPayload, 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
6
  import { DevicePayPurchaseContext, DevicePayInteractionPayload, InitiateDevicePayAction, DevicePayResponsePayload, DevicePayResponse, DevicePayAvailableAction, DevicePayAvailablePayload } from '../../actions';
@@ -120,12 +120,7 @@ export declare function prepareDevicePay(gateway: GlobalGateway, logger: (log: L
120
120
  type: string;
121
121
  payload: {
122
122
  name: string;
123
- body: {
124
- stripeAccountId: string | undefined;
125
- merchantName: string | undefined;
126
- countryCode: string | undefined;
127
- currency: string | undefined;
128
- };
123
+ body: PrepareDevicePayEventPayload;
129
124
  };
130
125
  }>, void, AppState | undefined>;
131
126
  export declare function processDevicePayResponse(logger: (log: Log) => void, action: DevicePayResponse): Generator<CallEffect<void> | PutEffect<{
@@ -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, TaxAndShippingErrors, TaxAndShippingPricing } from '../../models';
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.REQUEST_FAILED;
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
- }> | PutEffect<{
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>;
@@ -0,0 +1 @@
1
+ export * from './selectors';
@@ -0,0 +1,7 @@
1
+ import { SyncedCatalogSelection } from '../../../../../libraries/domain/src/models';
2
+ import { AppState } from '../../reducers';
3
+ /**
4
+ * The selection a child layout mirrors. A full-item choice (a dropdown or the
5
+ * default item) has no recorded attribute choices, so they are derived from it.
6
+ */
7
+ export declare function getSyncedCatalogSelection(state: AppState): SyncedCatalogSelection;
@@ -2,7 +2,9 @@ import { DevicePayAvailabilityState } from '../../models';
2
2
  import { AppState } from '../../reducers';
3
3
  export declare function getDevicePayAvailability(state: AppState): DevicePayAvailabilityState;
4
4
  export declare function isApplePayAvailable(state: AppState): boolean;
5
+ export declare function isGooglePayAvailable(state: AppState): boolean;
5
6
  export declare function isAfterpayAvailable(state: AppState): boolean;
7
+ export declare function isPayPalAvailable(state: AppState): boolean;
6
8
  /**
7
9
  * Gate for the "no remaining usable payment option" branch in
8
10
  * processDevicePayAvailable. True when every entry in supportedPaymentMethods
@@ -1,3 +1,4 @@
1
+ export * from './catalog-selection';
1
2
  export * from './creative';
2
3
  export * from './device-pay-availability';
3
4
  export * from './paypal-transaction-details';
@@ -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;
@@ -0,0 +1,7 @@
1
+ import { CatalogItemGroupAttribute } from '../../../../libraries/domain/src/models';
2
+ /**
3
+ * Derives the per-attribute option labels that resolve to a catalog item: for
4
+ * each attribute, the option whose catalogItemIds contains the item. Used to
5
+ * pre-fill stacked dropdowns and to describe a full-item selection.
6
+ */
7
+ export declare function computeSelectionsForItem(attributes: CatalogItemGroupAttribute[], catalogItemId: string): Record<string, string>;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { PluginCatalogItem } from '../../../../libraries/domain/src/models';
2
+ export declare function requiresTaxAndShippingInitialization(catalogItem: Pick<PluginCatalogItem, 'copy'>): boolean;
@@ -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;