@cimplify/sdk 0.106.2 → 0.107.1
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/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{catalogue-CVKH9faR.d.mts → catalogue-AmW4XjaN.d.ts} +45 -38
- package/dist/{catalogue-ChBjPPME.d.ts → catalogue-rWd71Xi-.d.mts} +45 -38
- package/dist/{chunk-AVXA4F6G.js → chunk-ANT574FD.js} +29 -0
- package/dist/{chunk-BCLGREHS.js → chunk-CEML2737.js} +245 -219
- package/dist/{chunk-NYDVVNZI.mjs → chunk-JRGK3NXR.mjs} +1 -1
- package/dist/{chunk-NJYR6GGM.mjs → chunk-KG3WT4PR.mjs} +29 -1
- package/dist/{chunk-4VTFTLH7.mjs → chunk-NZMU7UUA.mjs} +3 -3
- package/dist/{chunk-B7JH5D3J.js → chunk-ONII7K3T.js} +262 -303
- package/dist/{chunk-T3MXI7JD.mjs → chunk-OTPLI3JY.mjs} +87 -128
- package/dist/{chunk-LJAZ7H4I.mjs → chunk-T4OU77DM.mjs} +108 -83
- package/dist/{chunk-7O2BBPDM.js → chunk-THSYGWUA.js} +70 -70
- package/dist/{chunk-NJK3THWT.js → chunk-UVRPC2P7.js} +90 -62
- package/dist/{chunk-UYFTOIFW.js → chunk-V32BCG7M.js} +6 -6
- package/dist/{chunk-L4XKIMUO.mjs → chunk-XBL3TMPC.mjs} +31 -3
- package/dist/{client-BfKFK7cn.d.mts → client-DlTJ2hUM.d.mts} +2 -2
- package/dist/{client-DoczTJbs.d.ts → client-ni-CfOSO.d.ts} +2 -2
- package/dist/{checkout-XoV4HNg2.d.mts → elements-BF1Y4aOi.d.mts} +575 -502
- package/dist/{checkout-XoV4HNg2.d.ts → elements-BF1Y4aOi.d.ts} +575 -502
- package/dist/{index-DweR60Cv.d.ts → index-CZ0bJm6k.d.ts} +2 -2
- package/dist/{index-DRMBo26v.d.mts → index-DML_W635.d.mts} +2 -2
- package/dist/{index-Dn6xCpDe.d.ts → index-DU7vffby.d.ts} +2 -2
- package/dist/{index-DEUorPUO.d.mts → index-DopYJKDL.d.mts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +159 -151
- package/dist/index.mjs +5 -5
- package/dist/mock/cli.mjs +33 -2
- package/dist/mock/library.js +33 -2
- package/dist/mock/library.mjs +33 -2
- package/dist/mock/msw.js +33 -2
- package/dist/mock/msw.mjs +33 -2
- package/dist/{price-De-sxcuj.d.ts → price-B5t2mpsE.d.ts} +1 -1
- package/dist/{price-CUGIYRtD.d.mts → price-DI_U5oXU.d.mts} +1 -1
- package/dist/react.d.mts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +154 -154
- package/dist/react.mjs +7 -7
- package/dist/{server-7soMMUgP.d.ts → server-BItJAUTD.d.ts} +1 -1
- package/dist/{server-DDEJ7e9s.d.mts → server-Dq70vD7z.d.mts} +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +5 -5
- package/dist/testing/suite.d.ts +5 -5
- package/dist/testing/suite.js +26 -26
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +118 -118
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +32 -32
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { BOUNDARY_KIND, CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, chatMessageCards, displaysGrossPrices, getVariantDisplayName, isCimplifyAsset, isMultiDayService, priceBasisLabel, resolveGallery, serviceBillingMultiplier, stayLength, stayPeriods } from './chunk-3V4DVXV3.mjs';
|
|
2
2
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
|
|
3
|
-
export { ActivityService, CimplifyClient, DeliveryService, HostedPurchaseIntentService, PURCHASE_INTENT_ROUTE, PlacesService, PurchaseIntentResolver, PurchaseIntentService, SESSION_CHANGE_SOURCE, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-
|
|
3
|
+
export { ActivityService, CimplifyClient, DeliveryService, HostedPurchaseIntentService, PURCHASE_INTENT_ROUTE, PlacesService, PurchaseIntentResolver, PurchaseIntentService, SESSION_CHANGE_SOURCE, SessionService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-T4OU77DM.mjs';
|
|
4
4
|
import './chunk-U4MW6PYU.mjs';
|
|
5
|
-
import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-
|
|
6
|
-
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, PAYMENT_AUTHORIZATION_OUTCOME_STATUS, PAYMENT_AUTHORIZATION_PROVIDER, PaymentAuthorizationAdapterRegistry, PaystackAuthorizationAdapter, SchedulingService, StripeAuthorizationAdapter, clearIntentIdempotencyKey as clearPurchaseIntentIdempotencyKey, combine, combineObject, createDefaultPaymentAuthorizationAdapterRegistry, createElements, createPurchaseIntentConfirmation, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, intentIdempotencyKey as purchaseIntentIdempotencyKey, purchaseIntentRequiresPaymentOption, selectPurchaseIntentPaymentOption, startSignIn, toNullable, tryCatch, unwrap } from './chunk-
|
|
5
|
+
import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-OTPLI3JY.mjs';
|
|
6
|
+
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, PAYMENT_AUTHORIZATION_OUTCOME_STATUS, PAYMENT_AUTHORIZATION_PROVIDER, PaymentAuthorizationAdapterRegistry, PaystackAuthorizationAdapter, SchedulingService, StripeAuthorizationAdapter, clearIntentIdempotencyKey as clearPurchaseIntentIdempotencyKey, combine, combineObject, createDefaultPaymentAuthorizationAdapterRegistry, createElements, createPurchaseIntentConfirmation, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, intentIdempotencyKey as purchaseIntentIdempotencyKey, purchaseIntentRequiresPaymentOption, selectPurchaseIntentPaymentOption, startSignIn, toNullable, tryCatch, unwrap } from './chunk-OTPLI3JY.mjs';
|
|
7
7
|
export { AUTHORIZATION_TYPE, AUTH_MUTATION, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_NEXT_ACTION, CHECKOUT_ORDER_RESULT_STATUS, CHECKOUT_STATUS, CHECKOUT_STEP, CONTACT_TYPE, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, LINK_MUTATION, LINK_QUERY, MAX_PAYMENT_AUTHORIZATION_STEPS, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE } from './chunk-33VCYWVL.mjs';
|
|
8
|
-
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PAYMENT_TERMINAL_FAILURE_STATUSES, canonicalMobileMoneyProvider, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-
|
|
9
|
-
export { CHECKOUT_COMPLIANCE_LANE, CHECKOUT_COMPLIANCE_REASON, CHECKOUT_INVALIDATION_REASON, CHECKOUT_MATERIAL_TERMS_COMPONENT, CHECKOUT_PROTECTION_STATUS, CHECKOUT_PURCHASE_SURFACE, CHECKOUT_TERMS_COMPONENT, CHECKOUT_TERMS_DELTA_KIND, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS, LEGACY_CHECKOUT_PAYMENT_STATUS, MOBILE_MONEY_TENDER_AUTHORITY_KIND, NATIVE_PURCHASE_PLATFORM, PAYMENT_COLLECTION_MODE, PAYMENT_INSTRUMENT_DISPLAY_KIND, PAYMENT_OPTION_NEXT_ACTION, PAYMENT_OPTION_STATUS, PURCHASE_DISPOSITION, PURCHASE_INTENT_ACTION_DECISION, PURCHASE_INTENT_CONFIRM_STATUS, PURCHASE_INTENT_ERROR_CODE, PURCHASE_INTENT_LINE_CONFIGURATION_KIND, PURCHASE_INTENT_MOBILE_MONEY_NETWORK, PURCHASE_INTENT_OFFER_KIND, PURCHASE_INTENT_PAYMENT_METHOD, PURCHASE_INTENT_PAYMENT_PROVIDER, PURCHASE_INTENT_RESOLUTION_KIND, PURCHASE_INTENT_RESOLVE_STATUS, PURCHASE_INTENT_SELLABLE_KIND, PURCHASE_INTENT_SOURCE_KIND, PURCHASE_INTENT_STATUS, PURCHASE_SURFACE, PURCHASING_PRINCIPAL_KIND, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-
|
|
8
|
+
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PAYMENT_TERMINAL_FAILURE_STATUSES, canonicalMobileMoneyProvider, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-JRGK3NXR.mjs';
|
|
9
|
+
export { CHECKOUT_COMPLIANCE_LANE, CHECKOUT_COMPLIANCE_REASON, CHECKOUT_INVALIDATION_REASON, CHECKOUT_MATERIAL_TERMS_COMPONENT, CHECKOUT_PROTECTION_STATUS, CHECKOUT_PURCHASE_SURFACE, CHECKOUT_TERMS_COMPONENT, CHECKOUT_TERMS_DELTA_KIND, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS, LEGACY_CHECKOUT_PAYMENT_STATUS, MOBILE_MONEY_TENDER_AUTHORITY_KIND, NATIVE_PURCHASE_PLATFORM, PAYMENT_COLLECTION_MODE, PAYMENT_INSTRUMENT_DISPLAY_KIND, PAYMENT_OPTION_NEXT_ACTION, PAYMENT_OPTION_STATUS, PURCHASE_DISPOSITION, PURCHASE_INTENT_ACTION_DECISION, PURCHASE_INTENT_CONFIRM_STATUS, PURCHASE_INTENT_ERROR_CODE, PURCHASE_INTENT_LINE_CONFIGURATION_KIND, PURCHASE_INTENT_MOBILE_MONEY_NETWORK, PURCHASE_INTENT_OFFER_KIND, PURCHASE_INTENT_PAYMENT_METHOD, PURCHASE_INTENT_PAYMENT_PROVIDER, PURCHASE_INTENT_RESOLUTION_KIND, PURCHASE_INTENT_RESOLVE_STATUS, PURCHASE_INTENT_SELLABLE_KIND, PURCHASE_INTENT_SOURCE_KIND, PURCHASE_INTENT_STATUS, PURCHASE_SURFACE, PURCHASING_PRINCIPAL_KIND, SOURCE_REFUSAL, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-KG3WT4PR.mjs';
|
|
10
10
|
import './chunk-3G6RQLXK.mjs';
|
|
11
11
|
|
|
12
12
|
// src/silent-sign-in.ts
|
package/dist/mock/cli.mjs
CHANGED
|
@@ -3602,6 +3602,9 @@ var PURCHASE_INTENT_CONFIRM_STATUS = {
|
|
|
3602
3602
|
SELECTION_UNAVAILABLE: "selection_unavailable",
|
|
3603
3603
|
SOURCE_UNAVAILABLE: "source_unavailable"
|
|
3604
3604
|
};
|
|
3605
|
+
var SOURCE_REFUSAL = {
|
|
3606
|
+
CART_NOT_ACTIVE: "cart_not_active",
|
|
3607
|
+
SOURCE_NOT_FOUND: "source_not_found"};
|
|
3605
3608
|
|
|
3606
3609
|
// src/mock/routes/v1.ts
|
|
3607
3610
|
var PURCHASE_INTENT_ROUTE = {
|
|
@@ -4314,6 +4317,23 @@ function buildV1(deps) {
|
|
|
4314
4317
|
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
4315
4318
|
});
|
|
4316
4319
|
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
4320
|
+
app.post("/auth/session/claim", async (c) => {
|
|
4321
|
+
const body = await c.req.json().catch(() => ({}));
|
|
4322
|
+
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
4323
|
+
const session = c.var.session;
|
|
4324
|
+
return c.json({
|
|
4325
|
+
data: {
|
|
4326
|
+
session_token: session.token,
|
|
4327
|
+
customer: {
|
|
4328
|
+
id: session.customer_id ?? "cus_test",
|
|
4329
|
+
name: session.customer_name ?? "Test User",
|
|
4330
|
+
email: null,
|
|
4331
|
+
phone: null
|
|
4332
|
+
},
|
|
4333
|
+
cart: null
|
|
4334
|
+
}
|
|
4335
|
+
});
|
|
4336
|
+
});
|
|
4317
4337
|
app.post("/support/conversation/claim", async (c) => {
|
|
4318
4338
|
const body = await c.req.json().catch(() => ({}));
|
|
4319
4339
|
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
@@ -7356,8 +7376,19 @@ function createPurchaseIntentMockService(options) {
|
|
|
7356
7376
|
const checkoutInput = intent.mint_request.checkout;
|
|
7357
7377
|
if (!checkoutInput) throw validation("Cart checkout input is required");
|
|
7358
7378
|
const cart = registry.carts.get(intent.mint_request.source.cart_id);
|
|
7359
|
-
if (!cart
|
|
7360
|
-
return {
|
|
7379
|
+
if (!cart) {
|
|
7380
|
+
return {
|
|
7381
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
7382
|
+
intent_id: intent.id,
|
|
7383
|
+
reason: SOURCE_REFUSAL.SOURCE_NOT_FOUND
|
|
7384
|
+
};
|
|
7385
|
+
}
|
|
7386
|
+
if (cart.status !== MOCK_PURCHASE_INTENT.CART_STATUS.ACTIVE) {
|
|
7387
|
+
return {
|
|
7388
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
7389
|
+
intent_id: intent.id,
|
|
7390
|
+
reason: SOURCE_REFUSAL.CART_NOT_ACTIVE
|
|
7391
|
+
};
|
|
7361
7392
|
}
|
|
7362
7393
|
const attemptId = ids.raw(MOCK_PURCHASE_INTENT.ID_PREFIX.ATTEMPT);
|
|
7363
7394
|
const orderId = ids.order();
|
package/dist/mock/library.js
CHANGED
|
@@ -2424,6 +2424,9 @@ var PURCHASE_INTENT_CONFIRM_STATUS = {
|
|
|
2424
2424
|
SELECTION_UNAVAILABLE: "selection_unavailable",
|
|
2425
2425
|
SOURCE_UNAVAILABLE: "source_unavailable"
|
|
2426
2426
|
};
|
|
2427
|
+
var SOURCE_REFUSAL = {
|
|
2428
|
+
CART_NOT_ACTIVE: "cart_not_active",
|
|
2429
|
+
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2427
2430
|
|
|
2428
2431
|
// src/mock/routes/v1.ts
|
|
2429
2432
|
var PURCHASE_INTENT_ROUTE = {
|
|
@@ -3136,6 +3139,23 @@ function buildV1(deps) {
|
|
|
3136
3139
|
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
3137
3140
|
});
|
|
3138
3141
|
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
3142
|
+
app.post("/auth/session/claim", async (c) => {
|
|
3143
|
+
const body = await c.req.json().catch(() => ({}));
|
|
3144
|
+
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
3145
|
+
const session = c.var.session;
|
|
3146
|
+
return c.json({
|
|
3147
|
+
data: {
|
|
3148
|
+
session_token: session.token,
|
|
3149
|
+
customer: {
|
|
3150
|
+
id: session.customer_id ?? "cus_test",
|
|
3151
|
+
name: session.customer_name ?? "Test User",
|
|
3152
|
+
email: null,
|
|
3153
|
+
phone: null
|
|
3154
|
+
},
|
|
3155
|
+
cart: null
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
});
|
|
3139
3159
|
app.post("/support/conversation/claim", async (c) => {
|
|
3140
3160
|
const body = await c.req.json().catch(() => ({}));
|
|
3141
3161
|
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
@@ -6178,8 +6198,19 @@ function createPurchaseIntentMockService(options) {
|
|
|
6178
6198
|
const checkoutInput = intent.mint_request.checkout;
|
|
6179
6199
|
if (!checkoutInput) throw validation("Cart checkout input is required");
|
|
6180
6200
|
const cart = registry.carts.get(intent.mint_request.source.cart_id);
|
|
6181
|
-
if (!cart
|
|
6182
|
-
return {
|
|
6201
|
+
if (!cart) {
|
|
6202
|
+
return {
|
|
6203
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6204
|
+
intent_id: intent.id,
|
|
6205
|
+
reason: SOURCE_REFUSAL.SOURCE_NOT_FOUND
|
|
6206
|
+
};
|
|
6207
|
+
}
|
|
6208
|
+
if (cart.status !== MOCK_PURCHASE_INTENT.CART_STATUS.ACTIVE) {
|
|
6209
|
+
return {
|
|
6210
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6211
|
+
intent_id: intent.id,
|
|
6212
|
+
reason: SOURCE_REFUSAL.CART_NOT_ACTIVE
|
|
6213
|
+
};
|
|
6183
6214
|
}
|
|
6184
6215
|
const attemptId = ids.raw(MOCK_PURCHASE_INTENT.ID_PREFIX.ATTEMPT);
|
|
6185
6216
|
const orderId = ids.order();
|
package/dist/mock/library.mjs
CHANGED
|
@@ -2422,6 +2422,9 @@ var PURCHASE_INTENT_CONFIRM_STATUS = {
|
|
|
2422
2422
|
SELECTION_UNAVAILABLE: "selection_unavailable",
|
|
2423
2423
|
SOURCE_UNAVAILABLE: "source_unavailable"
|
|
2424
2424
|
};
|
|
2425
|
+
var SOURCE_REFUSAL = {
|
|
2426
|
+
CART_NOT_ACTIVE: "cart_not_active",
|
|
2427
|
+
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2425
2428
|
|
|
2426
2429
|
// src/mock/routes/v1.ts
|
|
2427
2430
|
var PURCHASE_INTENT_ROUTE = {
|
|
@@ -3134,6 +3137,23 @@ function buildV1(deps) {
|
|
|
3134
3137
|
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
3135
3138
|
});
|
|
3136
3139
|
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
3140
|
+
app.post("/auth/session/claim", async (c) => {
|
|
3141
|
+
const body = await c.req.json().catch(() => ({}));
|
|
3142
|
+
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
3143
|
+
const session = c.var.session;
|
|
3144
|
+
return c.json({
|
|
3145
|
+
data: {
|
|
3146
|
+
session_token: session.token,
|
|
3147
|
+
customer: {
|
|
3148
|
+
id: session.customer_id ?? "cus_test",
|
|
3149
|
+
name: session.customer_name ?? "Test User",
|
|
3150
|
+
email: null,
|
|
3151
|
+
phone: null
|
|
3152
|
+
},
|
|
3153
|
+
cart: null
|
|
3154
|
+
}
|
|
3155
|
+
});
|
|
3156
|
+
});
|
|
3137
3157
|
app.post("/support/conversation/claim", async (c) => {
|
|
3138
3158
|
const body = await c.req.json().catch(() => ({}));
|
|
3139
3159
|
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
@@ -6176,8 +6196,19 @@ function createPurchaseIntentMockService(options) {
|
|
|
6176
6196
|
const checkoutInput = intent.mint_request.checkout;
|
|
6177
6197
|
if (!checkoutInput) throw validation("Cart checkout input is required");
|
|
6178
6198
|
const cart = registry.carts.get(intent.mint_request.source.cart_id);
|
|
6179
|
-
if (!cart
|
|
6180
|
-
return {
|
|
6199
|
+
if (!cart) {
|
|
6200
|
+
return {
|
|
6201
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6202
|
+
intent_id: intent.id,
|
|
6203
|
+
reason: SOURCE_REFUSAL.SOURCE_NOT_FOUND
|
|
6204
|
+
};
|
|
6205
|
+
}
|
|
6206
|
+
if (cart.status !== MOCK_PURCHASE_INTENT.CART_STATUS.ACTIVE) {
|
|
6207
|
+
return {
|
|
6208
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6209
|
+
intent_id: intent.id,
|
|
6210
|
+
reason: SOURCE_REFUSAL.CART_NOT_ACTIVE
|
|
6211
|
+
};
|
|
6181
6212
|
}
|
|
6182
6213
|
const attemptId = ids.raw(MOCK_PURCHASE_INTENT.ID_PREFIX.ATTEMPT);
|
|
6183
6214
|
const orderId = ids.order();
|
package/dist/mock/msw.js
CHANGED
|
@@ -2422,6 +2422,9 @@ var PURCHASE_INTENT_CONFIRM_STATUS = {
|
|
|
2422
2422
|
SELECTION_UNAVAILABLE: "selection_unavailable",
|
|
2423
2423
|
SOURCE_UNAVAILABLE: "source_unavailable"
|
|
2424
2424
|
};
|
|
2425
|
+
var SOURCE_REFUSAL = {
|
|
2426
|
+
CART_NOT_ACTIVE: "cart_not_active",
|
|
2427
|
+
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2425
2428
|
|
|
2426
2429
|
// src/mock/routes/v1.ts
|
|
2427
2430
|
var PURCHASE_INTENT_ROUTE = {
|
|
@@ -3134,6 +3137,23 @@ function buildV1(deps) {
|
|
|
3134
3137
|
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
3135
3138
|
});
|
|
3136
3139
|
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
3140
|
+
app.post("/auth/session/claim", async (c) => {
|
|
3141
|
+
const body = await c.req.json().catch(() => ({}));
|
|
3142
|
+
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
3143
|
+
const session = c.var.session;
|
|
3144
|
+
return c.json({
|
|
3145
|
+
data: {
|
|
3146
|
+
session_token: session.token,
|
|
3147
|
+
customer: {
|
|
3148
|
+
id: session.customer_id ?? "cus_test",
|
|
3149
|
+
name: session.customer_name ?? "Test User",
|
|
3150
|
+
email: null,
|
|
3151
|
+
phone: null
|
|
3152
|
+
},
|
|
3153
|
+
cart: null
|
|
3154
|
+
}
|
|
3155
|
+
});
|
|
3156
|
+
});
|
|
3137
3157
|
app.post("/support/conversation/claim", async (c) => {
|
|
3138
3158
|
const body = await c.req.json().catch(() => ({}));
|
|
3139
3159
|
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
@@ -6176,8 +6196,19 @@ function createPurchaseIntentMockService(options) {
|
|
|
6176
6196
|
const checkoutInput = intent.mint_request.checkout;
|
|
6177
6197
|
if (!checkoutInput) throw validation("Cart checkout input is required");
|
|
6178
6198
|
const cart = registry.carts.get(intent.mint_request.source.cart_id);
|
|
6179
|
-
if (!cart
|
|
6180
|
-
return {
|
|
6199
|
+
if (!cart) {
|
|
6200
|
+
return {
|
|
6201
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6202
|
+
intent_id: intent.id,
|
|
6203
|
+
reason: SOURCE_REFUSAL.SOURCE_NOT_FOUND
|
|
6204
|
+
};
|
|
6205
|
+
}
|
|
6206
|
+
if (cart.status !== MOCK_PURCHASE_INTENT.CART_STATUS.ACTIVE) {
|
|
6207
|
+
return {
|
|
6208
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6209
|
+
intent_id: intent.id,
|
|
6210
|
+
reason: SOURCE_REFUSAL.CART_NOT_ACTIVE
|
|
6211
|
+
};
|
|
6181
6212
|
}
|
|
6182
6213
|
const attemptId = ids.raw(MOCK_PURCHASE_INTENT.ID_PREFIX.ATTEMPT);
|
|
6183
6214
|
const orderId = ids.order();
|
package/dist/mock/msw.mjs
CHANGED
|
@@ -2420,6 +2420,9 @@ var PURCHASE_INTENT_CONFIRM_STATUS = {
|
|
|
2420
2420
|
SELECTION_UNAVAILABLE: "selection_unavailable",
|
|
2421
2421
|
SOURCE_UNAVAILABLE: "source_unavailable"
|
|
2422
2422
|
};
|
|
2423
|
+
var SOURCE_REFUSAL = {
|
|
2424
|
+
CART_NOT_ACTIVE: "cart_not_active",
|
|
2425
|
+
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2423
2426
|
|
|
2424
2427
|
// src/mock/routes/v1.ts
|
|
2425
2428
|
var PURCHASE_INTENT_ROUTE = {
|
|
@@ -3132,6 +3135,23 @@ function buildV1(deps) {
|
|
|
3132
3135
|
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
3133
3136
|
});
|
|
3134
3137
|
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
3138
|
+
app.post("/auth/session/claim", async (c) => {
|
|
3139
|
+
const body = await c.req.json().catch(() => ({}));
|
|
3140
|
+
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
3141
|
+
const session = c.var.session;
|
|
3142
|
+
return c.json({
|
|
3143
|
+
data: {
|
|
3144
|
+
session_token: session.token,
|
|
3145
|
+
customer: {
|
|
3146
|
+
id: session.customer_id ?? "cus_test",
|
|
3147
|
+
name: session.customer_name ?? "Test User",
|
|
3148
|
+
email: null,
|
|
3149
|
+
phone: null
|
|
3150
|
+
},
|
|
3151
|
+
cart: null
|
|
3152
|
+
}
|
|
3153
|
+
});
|
|
3154
|
+
});
|
|
3135
3155
|
app.post("/support/conversation/claim", async (c) => {
|
|
3136
3156
|
const body = await c.req.json().catch(() => ({}));
|
|
3137
3157
|
if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
|
|
@@ -6174,8 +6194,19 @@ function createPurchaseIntentMockService(options) {
|
|
|
6174
6194
|
const checkoutInput = intent.mint_request.checkout;
|
|
6175
6195
|
if (!checkoutInput) throw validation("Cart checkout input is required");
|
|
6176
6196
|
const cart = registry.carts.get(intent.mint_request.source.cart_id);
|
|
6177
|
-
if (!cart
|
|
6178
|
-
return {
|
|
6197
|
+
if (!cart) {
|
|
6198
|
+
return {
|
|
6199
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6200
|
+
intent_id: intent.id,
|
|
6201
|
+
reason: SOURCE_REFUSAL.SOURCE_NOT_FOUND
|
|
6202
|
+
};
|
|
6203
|
+
}
|
|
6204
|
+
if (cart.status !== MOCK_PURCHASE_INTENT.CART_STATUS.ACTIVE) {
|
|
6205
|
+
return {
|
|
6206
|
+
status: PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE,
|
|
6207
|
+
intent_id: intent.id,
|
|
6208
|
+
reason: SOURCE_REFUSAL.CART_NOT_ACTIVE
|
|
6209
|
+
};
|
|
6179
6210
|
}
|
|
6180
6211
|
const attemptId = ids.raw(MOCK_PURCHASE_INTENT.ID_PREFIX.ATTEMPT);
|
|
6181
6212
|
const orderId = ids.order();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CurrencyCode, a as ChosenPrice, S as SaleInfo, U as UpcomingSale } from './
|
|
1
|
+
import { C as CurrencyCode, a as ChosenPrice, S as SaleInfo, U as UpcomingSale } from './elements-BF1Y4aOi.js';
|
|
2
2
|
|
|
3
3
|
interface ProductWithPrice {
|
|
4
4
|
price_info?: ChosenPrice;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CurrencyCode, a as ChosenPrice, S as SaleInfo, U as UpcomingSale } from './
|
|
1
|
+
import { C as CurrencyCode, a as ChosenPrice, S as SaleInfo, U as UpcomingSale } from './elements-BF1Y4aOi.mjs';
|
|
2
2
|
|
|
3
3
|
interface ProductWithPrice {
|
|
4
4
|
price_info?: ChosenPrice;
|
package/dist/react.d.mts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
3
|
import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.mjs';
|
|
4
4
|
export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.mjs';
|
|
5
|
-
import { C as CimplifyClient, aj as EnrichedOrderItem, ai as EnrichedOrder, u as Business, aN as Location, bQ as ReorderResult, be as OrderStatus, aV as Order, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bs as PriceQuote, bG as QuoteUiMessage, c8 as Service, p as AvailableSlot, a8 as DayAvailability, a5 as CustomerBooking, F as CancelBookingResult, h as ActivityStateResponse, ci as SessionMessage, A as ActivityRecommendation, aa as DeliveryFeeResponse, ae as DeliveryOptionsResponse, aw as FxRateResponse,
|
|
6
|
-
import { g as CheckoutTermsView,
|
|
5
|
+
import { C as CimplifyClient, aj as EnrichedOrderItem, ai as EnrichedOrder, u as Business, aN as Location, bQ as ReorderResult, be as OrderStatus, aV as Order, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bs as PriceQuote, bG as QuoteUiMessage, c8 as Service, p as AvailableSlot, a8 as DayAvailability, a5 as CustomerBooking, F as CancelBookingResult, h as ActivityStateResponse, ci as SessionMessage, A as ActivityRecommendation, aa as DeliveryFeeResponse, ae as DeliveryOptionsResponse, aw as FxRateResponse, cs as StoreCreditBalance, cu as StorefrontBootstrap, W as ChatWidgetStarter, T as ChatMessage, V as ChatUploadAttachment, a1 as CimplifyElements, O as ChatAttachment, aG as LineItem, cm as Staff, c2 as Room, U as ChatReplyContext } from './catalogue-rWd71Xi-.mjs';
|
|
6
|
+
import { g as CheckoutTermsView, cQ as OrderType, dL as ProcessCheckoutResult, aW as CheckoutStatus, aX as CheckoutStatusContext, C as CurrencyCode, P as Product, de as Pagination, c as CimplifyError, e as ProductWithDetails, b as Category, cI as Money, a as ChosenPrice, a1 as BundleSelectionInput, b6 as ComponentSelectionInput, a0 as BundleSelectionData, bf as CompositeSelectionData, d as Collection, dU as ProductTaxonomy, eL as TaxonomyWithChildren, dV as ProductTimeProfile, by as Deal, dQ as ProductDealInfo, bI as DiscountValidation, a3 as BundleSummary, bd as CompositePriceResult, eG as SubscriptionWithDetails, eF as SubscriptionStatus, eC as Subscription, bm as CustomAttributeDefinition, dZ as PropertyFacet, dP as ProductBillingPlan, f3 as VariantView, eZ as VariantAxisWithValues, w as AddressInfo, J as AuthenticatedData, c4 as ElementsOptions, dp as PaymentMethodInfo, c2 as ElementsCheckoutResult, dK as ProcessCheckoutOptions, s as AddOnWithOptions, Z as BundleComponentView, _ as BundlePriceType, bb as CompositeGroupView, bL as DisplayCart, dR as ProductInputField, x as AddressValue, S as SaleInfo, U as UpcomingSale, D as DurationUnit, R as BoundaryKind, et as SchedulingMode, bA as DepositType, bn as CustomAttributeValue, dS as ProductProperty, ei as QuantityPricingTier } from './elements-BF1Y4aOi.mjs';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
-
import { P as ProductWithPrice } from './price-
|
|
8
|
+
import { P as ProductWithPrice } from './price-DI_U5oXU.mjs';
|
|
9
9
|
import { ClassValue } from 'clsx';
|
|
10
10
|
import { Matcher } from 'react-day-picker';
|
|
11
11
|
|
package/dist/react.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
3
|
import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.js';
|
|
4
4
|
export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.js';
|
|
5
|
-
import { C as CimplifyClient, aj as EnrichedOrderItem, ai as EnrichedOrder, u as Business, aN as Location, bQ as ReorderResult, be as OrderStatus, aV as Order, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bs as PriceQuote, bG as QuoteUiMessage, c8 as Service, p as AvailableSlot, a8 as DayAvailability, a5 as CustomerBooking, F as CancelBookingResult, h as ActivityStateResponse, ci as SessionMessage, A as ActivityRecommendation, aa as DeliveryFeeResponse, ae as DeliveryOptionsResponse, aw as FxRateResponse,
|
|
6
|
-
import { g as CheckoutTermsView,
|
|
5
|
+
import { C as CimplifyClient, aj as EnrichedOrderItem, ai as EnrichedOrder, u as Business, aN as Location, bQ as ReorderResult, be as OrderStatus, aV as Order, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bs as PriceQuote, bG as QuoteUiMessage, c8 as Service, p as AvailableSlot, a8 as DayAvailability, a5 as CustomerBooking, F as CancelBookingResult, h as ActivityStateResponse, ci as SessionMessage, A as ActivityRecommendation, aa as DeliveryFeeResponse, ae as DeliveryOptionsResponse, aw as FxRateResponse, cs as StoreCreditBalance, cu as StorefrontBootstrap, W as ChatWidgetStarter, T as ChatMessage, V as ChatUploadAttachment, a1 as CimplifyElements, O as ChatAttachment, aG as LineItem, cm as Staff, c2 as Room, U as ChatReplyContext } from './catalogue-AmW4XjaN.js';
|
|
6
|
+
import { g as CheckoutTermsView, cQ as OrderType, dL as ProcessCheckoutResult, aW as CheckoutStatus, aX as CheckoutStatusContext, C as CurrencyCode, P as Product, de as Pagination, c as CimplifyError, e as ProductWithDetails, b as Category, cI as Money, a as ChosenPrice, a1 as BundleSelectionInput, b6 as ComponentSelectionInput, a0 as BundleSelectionData, bf as CompositeSelectionData, d as Collection, dU as ProductTaxonomy, eL as TaxonomyWithChildren, dV as ProductTimeProfile, by as Deal, dQ as ProductDealInfo, bI as DiscountValidation, a3 as BundleSummary, bd as CompositePriceResult, eG as SubscriptionWithDetails, eF as SubscriptionStatus, eC as Subscription, bm as CustomAttributeDefinition, dZ as PropertyFacet, dP as ProductBillingPlan, f3 as VariantView, eZ as VariantAxisWithValues, w as AddressInfo, J as AuthenticatedData, c4 as ElementsOptions, dp as PaymentMethodInfo, c2 as ElementsCheckoutResult, dK as ProcessCheckoutOptions, s as AddOnWithOptions, Z as BundleComponentView, _ as BundlePriceType, bb as CompositeGroupView, bL as DisplayCart, dR as ProductInputField, x as AddressValue, S as SaleInfo, U as UpcomingSale, D as DurationUnit, R as BoundaryKind, et as SchedulingMode, bA as DepositType, bn as CustomAttributeValue, dS as ProductProperty, ei as QuantityPricingTier } from './elements-BF1Y4aOi.js';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
-
import { P as ProductWithPrice } from './price-
|
|
8
|
+
import { P as ProductWithPrice } from './price-B5t2mpsE.js';
|
|
9
9
|
import { ClassValue } from 'clsx';
|
|
10
10
|
import { Matcher } from 'react-day-picker';
|
|
11
11
|
|