@01.software/sdk 0.51.0 → 0.56.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/CHANGELOG.md +127 -0
- package/README.md +54 -11
- package/dist/client.cjs +420 -53
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +420 -53
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-hYvVfHIm.d.ts → collection-client-Bmr53saa.d.ts} +4 -4
- package/dist/{collection-client-CWAeuzV4.d.cts → collection-client-DxuBDso_.d.cts} +4 -4
- package/dist/{const-D8LixhAJ.d.cts → const-BKUqg96Q.d.ts} +2 -2
- package/dist/{const-JD8obaKg.d.ts → const-Cv1DCsp6.d.cts} +2 -2
- package/dist/{index-Bu0kCc6o.d.cts → index-CGsT4AQ8.d.cts} +24 -7
- package/dist/{index-B0Hjh3Ey.d.ts → index-DFHLLqYu.d.ts} +24 -7
- package/dist/index.cjs +434 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +434 -55
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BOsckg8B.d.cts → payload-types-Bk-duc5k.d.cts} +295 -100
- package/dist/{payload-types-BOsckg8B.d.ts → payload-types-Bk-duc5k.d.ts} +295 -100
- package/dist/query.cjs +14 -1
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +14 -1
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +98 -13
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +9 -8
- package/dist/server.d.ts +9 -8
- package/dist/server.js +98 -13
- package/dist/server.js.map +1 -1
- package/dist/{types-Bj8j7VHU.d.ts → types-CEK8uTvU.d.ts} +212 -11
- package/dist/{types-B14sEt1z.d.cts → types-CNdpj2fI.d.cts} +2 -2
- package/dist/{types-5ZlcAFuU.d.ts → types-D4mjGFj4.d.ts} +2 -2
- package/dist/{types-CM5qiR2k.d.cts → types-Dhk5NX7Z.d.cts} +212 -11
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +13 -2
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +5 -5
- package/dist/webhook.d.ts +5 -5
- package/dist/webhook.js +13 -2
- package/dist/webhook.js.map +1 -1
- package/package.json +6 -5
package/dist/server.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as ServerCollectionClient } from './collection-client-
|
|
2
|
-
export { C as CollectionClient } from './collection-client-
|
|
3
|
-
import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient,
|
|
4
|
-
export { A as AddItemParams,
|
|
5
|
-
import './payload-types-
|
|
1
|
+
import { S as ServerCollectionClient } from './collection-client-DxuBDso_.cjs';
|
|
2
|
+
export { C as CollectionClient } from './collection-client-DxuBDso_.cjs';
|
|
3
|
+
import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, aK as CustomerGroupApi, a as CommunityClient, aL as BanCustomerParams, aM as CommunityBan, aN as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aO as ClientServerConfig, E as EventsClient, aP as RootServerClientWithEvents } from './types-Dhk5NX7Z.cjs';
|
|
4
|
+
export { A as AddItemParams, aQ as CancelServerPaymentSessionParams, aR as CartApi, aS as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aT as CheckoutApi, aU as CheckoutApiOptions, aV as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aW as CheckoutQueryParams, aX as CheckoutQueryResult, s as CheckoutShippingAddress, aY as CheckoutStatus, t as ClearCartParams, aZ as CollectionCustomFieldDefinition, a_ as CollectionCustomFields, a$ as CollectionFieldSchema, b0 as CollectionSchemaResponse, b1 as ConfirmCustomPaymentSessionOptions, b2 as ConfirmCustomPaymentSessionParams, b3 as ConfirmCustomPaymentSessionResponse, b4 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b5 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b6 as CreateServerCheckoutParams, b7 as CreateServerCheckoutResult, b8 as CustomPaymentSession, b9 as CustomPaymentSessionProof, ba as CustomerGroupApiOptions, bb as CustomerGroupManualSource, bc as CustomerGroupMember, bd as CustomerGroupMemberCommandResponse, be as CustomerGroupMemberSource, bf as CustomerGroupMembershipSource, bg as CustomerGroupMembershipState, d as CustomerMembershipView, F as CustomerSnapshot, bh as EventAdmissionAvailabilityParams, bi as EventAdmissionAvailabilityResponse, bj as EventAdmissionAvailabilityType, bk as EventAdmissionPricePresentment, bl as EventGuestCancelParams, bm as EventGuestRegistration, bn as EventGuestRegistrationResponse, bo as EventRegistrationAnswerInput, bp as EventRegistrationAttendeeInput, bq as EventRegistrationPublic, br as EventRegistrationRegisterParams, bs as EventRegistrationRegisterResponse, bt as EventsCalendarItem, bu as EventsClientOptions, bv as EventsDateParam, bw as EventsExternalSource, bx as EventsLocation, by as EventsOccurrenceLocation, bz as EventsRangeEvent, bA as EventsRangeOccurrence, bB as EventsRangeParams, bC as EventsRangeResponse, bD as EventsTaxonomyItem, bE as FindPortOnePaymentParams, bF as FindPortOnePaymentResult, bG as GrantCustomerGroupMemberParams, bH as ListCustomerGroupMembersParams, bI as ListCustomerGroupMembersResponse, J as MembershipStatus, bJ as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bK as PaymentSessionApi, bL as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, bM as PortOnePaymentCurrentState, V as PortOnePaymentNextAction, bN as PortOnePaymentReconciliationApi, bO as PortOnePaymentSelector, W as PortOnePublicPaymentSession, bP as PortOneReconciliationDisposition, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bQ as ReconcilePortOnePaymentParams, bR as ReconcilePortOnePaymentResult, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bS as RetrieveCustomPaymentSessionParams, bT as RetrieveServerCheckoutParams, bU as RetrieveServerPaymentSessionParams, bV as RetrievedCustomPaymentSession, bW as RevokeCustomerGroupMemberParams, bX as RootServerClient, bY as ServerCartMergeParams, bZ as ServerCartMineParams, b_ as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, b$ as TENANT_CONTEXT_PATH, c0 as TenantContextInput, c1 as TenantContextResponse, c2 as TenantCustomFieldType, c3 as TenantFeatureProgressEvidenceValue, c4 as TenantFeatureProgressFeature, c5 as TenantFeatureProgressGroup, c6 as TenantFeatureProgressInput, c7 as TenantFeatureProgressItem, c8 as TenantFeatureProgressItemState, c9 as TenantFeatureProgressResponse, ca as TenantFeatureProgressSeverity, cb as TenantFeatureProgressStatus, cc as TenantFieldConfigState, cd as TenantIntrospectionApi, ce as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-Dhk5NX7Z.cjs';
|
|
5
|
+
import './payload-types-Bk-duc5k.cjs';
|
|
6
6
|
export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
|
|
7
7
|
import './metadata.cjs';
|
|
8
|
-
import './const-
|
|
9
|
-
import './types-
|
|
8
|
+
import './const-Cv1DCsp6.cjs';
|
|
9
|
+
import './types-CNdpj2fI.cjs';
|
|
10
10
|
|
|
11
11
|
type PreviewDetailParams = {
|
|
12
12
|
collection: string;
|
|
@@ -36,6 +36,7 @@ declare class ServerClient {
|
|
|
36
36
|
subscribe: (params: SubscribeMembershipParams) => Promise<SubscribeMembershipResponse>;
|
|
37
37
|
cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
|
|
38
38
|
};
|
|
39
|
+
customerGroups: CustomerGroupApi;
|
|
39
40
|
private _events?;
|
|
40
41
|
community: CommunityClient & {
|
|
41
42
|
moderation: {
|
|
@@ -65,4 +66,4 @@ declare class ServerClient {
|
|
|
65
66
|
*/
|
|
66
67
|
declare function createServerClient(options: ClientServerConfig): RootServerClientWithEvents;
|
|
67
68
|
|
|
68
|
-
export { CancelMembershipParams, CancelMembershipResponse, ClientServerConfig, CommunityClient, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, SubscribeMembershipParams, SubscribeMembershipResponse, TenantIntrospectionClient, createServerClient };
|
|
69
|
+
export { CancelMembershipParams, CancelMembershipResponse, ClientServerConfig, CommunityClient, CustomerGroupApi, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, SubscribeMembershipParams, SubscribeMembershipResponse, TenantIntrospectionClient, createServerClient };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as ServerCollectionClient } from './collection-client-
|
|
2
|
-
export { C as CollectionClient } from './collection-client-
|
|
3
|
-
import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient,
|
|
4
|
-
export { A as AddItemParams,
|
|
5
|
-
import './payload-types-
|
|
1
|
+
import { S as ServerCollectionClient } from './collection-client-Bmr53saa.js';
|
|
2
|
+
export { C as CollectionClient } from './collection-client-Bmr53saa.js';
|
|
3
|
+
import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, aK as CustomerGroupApi, a as CommunityClient, aL as BanCustomerParams, aM as CommunityBan, aN as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aO as ClientServerConfig, E as EventsClient, aP as RootServerClientWithEvents } from './types-CEK8uTvU.js';
|
|
4
|
+
export { A as AddItemParams, aQ as CancelServerPaymentSessionParams, aR as CartApi, aS as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aT as CheckoutApi, aU as CheckoutApiOptions, aV as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aW as CheckoutQueryParams, aX as CheckoutQueryResult, s as CheckoutShippingAddress, aY as CheckoutStatus, t as ClearCartParams, aZ as CollectionCustomFieldDefinition, a_ as CollectionCustomFields, a$ as CollectionFieldSchema, b0 as CollectionSchemaResponse, b1 as ConfirmCustomPaymentSessionOptions, b2 as ConfirmCustomPaymentSessionParams, b3 as ConfirmCustomPaymentSessionResponse, b4 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b5 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b6 as CreateServerCheckoutParams, b7 as CreateServerCheckoutResult, b8 as CustomPaymentSession, b9 as CustomPaymentSessionProof, ba as CustomerGroupApiOptions, bb as CustomerGroupManualSource, bc as CustomerGroupMember, bd as CustomerGroupMemberCommandResponse, be as CustomerGroupMemberSource, bf as CustomerGroupMembershipSource, bg as CustomerGroupMembershipState, d as CustomerMembershipView, F as CustomerSnapshot, bh as EventAdmissionAvailabilityParams, bi as EventAdmissionAvailabilityResponse, bj as EventAdmissionAvailabilityType, bk as EventAdmissionPricePresentment, bl as EventGuestCancelParams, bm as EventGuestRegistration, bn as EventGuestRegistrationResponse, bo as EventRegistrationAnswerInput, bp as EventRegistrationAttendeeInput, bq as EventRegistrationPublic, br as EventRegistrationRegisterParams, bs as EventRegistrationRegisterResponse, bt as EventsCalendarItem, bu as EventsClientOptions, bv as EventsDateParam, bw as EventsExternalSource, bx as EventsLocation, by as EventsOccurrenceLocation, bz as EventsRangeEvent, bA as EventsRangeOccurrence, bB as EventsRangeParams, bC as EventsRangeResponse, bD as EventsTaxonomyItem, bE as FindPortOnePaymentParams, bF as FindPortOnePaymentResult, bG as GrantCustomerGroupMemberParams, bH as ListCustomerGroupMembersParams, bI as ListCustomerGroupMembersResponse, J as MembershipStatus, bJ as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bK as PaymentSessionApi, bL as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, bM as PortOnePaymentCurrentState, V as PortOnePaymentNextAction, bN as PortOnePaymentReconciliationApi, bO as PortOnePaymentSelector, W as PortOnePublicPaymentSession, bP as PortOneReconciliationDisposition, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bQ as ReconcilePortOnePaymentParams, bR as ReconcilePortOnePaymentResult, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bS as RetrieveCustomPaymentSessionParams, bT as RetrieveServerCheckoutParams, bU as RetrieveServerPaymentSessionParams, bV as RetrievedCustomPaymentSession, bW as RevokeCustomerGroupMemberParams, bX as RootServerClient, bY as ServerCartMergeParams, bZ as ServerCartMineParams, b_ as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, b$ as TENANT_CONTEXT_PATH, c0 as TenantContextInput, c1 as TenantContextResponse, c2 as TenantCustomFieldType, c3 as TenantFeatureProgressEvidenceValue, c4 as TenantFeatureProgressFeature, c5 as TenantFeatureProgressGroup, c6 as TenantFeatureProgressInput, c7 as TenantFeatureProgressItem, c8 as TenantFeatureProgressItemState, c9 as TenantFeatureProgressResponse, ca as TenantFeatureProgressSeverity, cb as TenantFeatureProgressStatus, cc as TenantFieldConfigState, cd as TenantIntrospectionApi, ce as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-CEK8uTvU.js';
|
|
5
|
+
import './payload-types-Bk-duc5k.js';
|
|
6
6
|
export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
|
|
7
7
|
import './metadata.js';
|
|
8
|
-
import './const-
|
|
9
|
-
import './types-
|
|
8
|
+
import './const-BKUqg96Q.js';
|
|
9
|
+
import './types-D4mjGFj4.js';
|
|
10
10
|
|
|
11
11
|
type PreviewDetailParams = {
|
|
12
12
|
collection: string;
|
|
@@ -36,6 +36,7 @@ declare class ServerClient {
|
|
|
36
36
|
subscribe: (params: SubscribeMembershipParams) => Promise<SubscribeMembershipResponse>;
|
|
37
37
|
cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
|
|
38
38
|
};
|
|
39
|
+
customerGroups: CustomerGroupApi;
|
|
39
40
|
private _events?;
|
|
40
41
|
community: CommunityClient & {
|
|
41
42
|
moderation: {
|
|
@@ -65,4 +66,4 @@ declare class ServerClient {
|
|
|
65
66
|
*/
|
|
66
67
|
declare function createServerClient(options: ClientServerConfig): RootServerClientWithEvents;
|
|
67
68
|
|
|
68
|
-
export { CancelMembershipParams, CancelMembershipResponse, ClientServerConfig, CommunityClient, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, SubscribeMembershipParams, SubscribeMembershipResponse, TenantIntrospectionClient, createServerClient };
|
|
69
|
+
export { CancelMembershipParams, CancelMembershipResponse, ClientServerConfig, CommunityClient, CustomerGroupApi, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, SubscribeMembershipParams, SubscribeMembershipResponse, TenantIntrospectionClient, createServerClient };
|
package/dist/server.js
CHANGED
|
@@ -1628,6 +1628,11 @@ var COMMERCE_ENDPOINT_OPERATIONS = {
|
|
|
1628
1628
|
detail: strictCommerceOperation("checkouts", "post", "/detail"),
|
|
1629
1629
|
query: strictCommerceOperation("checkouts", "post", "/query")
|
|
1630
1630
|
},
|
|
1631
|
+
draftOrders: {
|
|
1632
|
+
calculate: operation("draft-orders", "post", "/:id/calculate"),
|
|
1633
|
+
complete: operation("draft-orders", "post", "/:id/complete"),
|
|
1634
|
+
finalize: operation("draft-orders", "post", "/:id/finalize")
|
|
1635
|
+
},
|
|
1631
1636
|
transactions: {
|
|
1632
1637
|
update: operation("transactions", "post", "/update")
|
|
1633
1638
|
},
|
|
@@ -1728,7 +1733,15 @@ var portOneStandardActionCapabilityOperations = /* @__PURE__ */ new Set([
|
|
|
1728
1733
|
var MEMBERSHIP_ENDPOINT_OPERATIONS = {
|
|
1729
1734
|
subscribe: operation(null, "post", "/memberships/subscribe"),
|
|
1730
1735
|
cancel: operation(null, "post", "/memberships/:id/cancel"),
|
|
1731
|
-
me: operation(null, "get", "/memberships/me")
|
|
1736
|
+
me: operation(null, "get", "/memberships/me"),
|
|
1737
|
+
chargeResult: operation(null, "post", "/memberships/:id/charge-result"),
|
|
1738
|
+
refundResult: operation(null, "post", "/memberships/:id/refund-result"),
|
|
1739
|
+
revoke: operation(null, "post", "/memberships/:id/revoke")
|
|
1740
|
+
};
|
|
1741
|
+
var CUSTOMER_GROUP_ENDPOINT_OPERATIONS = {
|
|
1742
|
+
members: operation("customer-groups", "get", "/:id/members"),
|
|
1743
|
+
grant: operation("customer-groups", "post", "/:id/members/grant"),
|
|
1744
|
+
revoke: operation("customer-groups", "post", "/:id/members/revoke")
|
|
1732
1745
|
};
|
|
1733
1746
|
var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
|
|
1734
1747
|
show: operation("tenants", "get", "/embedded-admin-app"),
|
|
@@ -2450,7 +2463,10 @@ var MAX_COMMERCE_CAPABILITY_LENGTH = 512;
|
|
|
2450
2463
|
var MAX_CART_DISCOUNT_CODE_LENGTH = 128;
|
|
2451
2464
|
var CHECKOUT_STATUSES = ["open", "placed", "abandoned"];
|
|
2452
2465
|
var ABANDONED_REASONS = ["expired", "customer", "operator"];
|
|
2453
|
-
|
|
2466
|
+
function managedPaymentProviders(providers) {
|
|
2467
|
+
return providers;
|
|
2468
|
+
}
|
|
2469
|
+
var PAYMENT_PROVIDERS = managedPaymentProviders(["toss", "portone"]);
|
|
2454
2470
|
var PAYMENT_PROVIDER_STATUSES = [
|
|
2455
2471
|
"requires_payment_method",
|
|
2456
2472
|
"requires_action",
|
|
@@ -2510,6 +2526,26 @@ function invalidCanonicalResponse(resource, details) {
|
|
|
2510
2526
|
function fail(resource, path, expected) {
|
|
2511
2527
|
invalidCanonicalResponse(resource, { path, expected });
|
|
2512
2528
|
}
|
|
2529
|
+
function providerMismatch(resource, expected, actual, operation2) {
|
|
2530
|
+
if (operation2 === "cancel") {
|
|
2531
|
+
const method = {
|
|
2532
|
+
toss: "cancel()",
|
|
2533
|
+
portone: "cancelPortOne()"
|
|
2534
|
+
}[actual];
|
|
2535
|
+
throw createApiError(
|
|
2536
|
+
`Canonical ${resource} response provider mismatch: expected ${expected}, received ${actual}.`,
|
|
2537
|
+
502,
|
|
2538
|
+
{ resource, path: "$.provider", expected, actual },
|
|
2539
|
+
`The server applied the cancellation to a ${actual} PaymentSession, but this SDK method expects ${expected}.`,
|
|
2540
|
+
`Re-invoke ${method} with the same idempotencyKey; do not create a new key.`
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2543
|
+
invalidCanonicalResponse(resource, {
|
|
2544
|
+
path: "$.provider",
|
|
2545
|
+
expected,
|
|
2546
|
+
actual
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2513
2549
|
function record(value, resource, path) {
|
|
2514
2550
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
2515
2551
|
fail(resource, path, "object");
|
|
@@ -3786,7 +3822,7 @@ function validateNextAction(value, provider, resource, path) {
|
|
|
3786
3822
|
if (action.customerEmail !== void 0)
|
|
3787
3823
|
validateCustomer({ email: action.customerEmail }, resource, path);
|
|
3788
3824
|
}
|
|
3789
|
-
function validatePublicPaymentSession(value, expectedProvider) {
|
|
3825
|
+
function validatePublicPaymentSession(value, expectedProvider, operation2) {
|
|
3790
3826
|
const resource = "PaymentSession";
|
|
3791
3827
|
const session = record(value, resource, "$");
|
|
3792
3828
|
const provider = enumValue(
|
|
@@ -3795,9 +3831,6 @@ function validatePublicPaymentSession(value, expectedProvider) {
|
|
|
3795
3831
|
resource,
|
|
3796
3832
|
"$.provider"
|
|
3797
3833
|
);
|
|
3798
|
-
if (expectedProvider !== void 0 && provider !== expectedProvider) {
|
|
3799
|
-
fail(resource, "$.provider", expectedProvider);
|
|
3800
|
-
}
|
|
3801
3834
|
const status = enumValue(
|
|
3802
3835
|
session.providerStatus,
|
|
3803
3836
|
PAYMENT_PROVIDER_STATUSES,
|
|
@@ -4001,6 +4034,16 @@ function validatePublicPaymentSession(value, expectedProvider) {
|
|
|
4001
4034
|
"$.cancellationReason"
|
|
4002
4035
|
);
|
|
4003
4036
|
}
|
|
4037
|
+
if (expectedProvider !== void 0 && provider !== expectedProvider) {
|
|
4038
|
+
if (operation2 === "cancel" && status !== "canceling" && status !== "canceled") {
|
|
4039
|
+
fail(
|
|
4040
|
+
resource,
|
|
4041
|
+
"$.providerStatus",
|
|
4042
|
+
"canceling or canceled after a successful cancellation"
|
|
4043
|
+
);
|
|
4044
|
+
}
|
|
4045
|
+
providerMismatch(resource, expectedProvider, provider, operation2);
|
|
4046
|
+
}
|
|
4004
4047
|
return value;
|
|
4005
4048
|
}
|
|
4006
4049
|
|
|
@@ -5552,8 +5595,12 @@ var PaymentSessionApi = class extends CustomerScopedApi {
|
|
|
5552
5595
|
...Object.keys(headers).length > 0 && { headers }
|
|
5553
5596
|
});
|
|
5554
5597
|
}
|
|
5555
|
-
async paymentSession(result, expectedProvider) {
|
|
5556
|
-
return validatePublicPaymentSession(
|
|
5598
|
+
async paymentSession(result, expectedProvider, operation2) {
|
|
5599
|
+
return validatePublicPaymentSession(
|
|
5600
|
+
await result,
|
|
5601
|
+
expectedProvider,
|
|
5602
|
+
operation2
|
|
5603
|
+
);
|
|
5557
5604
|
}
|
|
5558
5605
|
create(params) {
|
|
5559
5606
|
const { idempotencyKey, ...body } = params;
|
|
@@ -5600,7 +5647,8 @@ var PaymentSessionApi = class extends CustomerScopedApi {
|
|
|
5600
5647
|
const endpoint = this.serverTransport ? COMMERCE_ENDPOINTS.paymentSessions.server.cancel : COMMERCE_ENDPOINTS.paymentSessions.cancel;
|
|
5601
5648
|
return this.paymentSession(
|
|
5602
5649
|
this.post(endpoint, body, idempotencyKey),
|
|
5603
|
-
"toss"
|
|
5650
|
+
"toss",
|
|
5651
|
+
"cancel"
|
|
5604
5652
|
);
|
|
5605
5653
|
}
|
|
5606
5654
|
cancelPortOne(params) {
|
|
@@ -5609,7 +5657,8 @@ var PaymentSessionApi = class extends CustomerScopedApi {
|
|
|
5609
5657
|
const endpoint = this.serverTransport ? COMMERCE_ENDPOINTS.paymentSessions.server.cancel : COMMERCE_ENDPOINTS.paymentSessions.cancel;
|
|
5610
5658
|
return this.paymentSession(
|
|
5611
5659
|
this.post(endpoint, body, idempotencyKey),
|
|
5612
|
-
"portone"
|
|
5660
|
+
"portone",
|
|
5661
|
+
"cancel"
|
|
5613
5662
|
);
|
|
5614
5663
|
}
|
|
5615
5664
|
confirm(params) {
|
|
@@ -6070,9 +6119,10 @@ var MembershipApi = class extends BaseApi {
|
|
|
6070
6119
|
super("MembershipApi", options);
|
|
6071
6120
|
}
|
|
6072
6121
|
/**
|
|
6073
|
-
*
|
|
6074
|
-
*
|
|
6075
|
-
* `
|
|
6122
|
+
* Prepare a delegated first charge for a paid Membership, or immediately
|
|
6123
|
+
* start a trial. For a paid response, charge through the tenant PSP with
|
|
6124
|
+
* `firstCharge.idempotencyKey`, then post the existing signed charge result
|
|
6125
|
+
* to activate the membership.
|
|
6076
6126
|
*
|
|
6077
6127
|
* `subscribeIntentKey` is used as the HTTP idempotency key so the call is
|
|
6078
6128
|
* safely retryable.
|
|
@@ -6101,6 +6151,39 @@ var MembershipApi = class extends BaseApi {
|
|
|
6101
6151
|
}
|
|
6102
6152
|
};
|
|
6103
6153
|
|
|
6154
|
+
// src/core/api/customer-group-api.ts
|
|
6155
|
+
var CustomerGroupApi = class extends BaseApi {
|
|
6156
|
+
constructor(options) {
|
|
6157
|
+
super("CustomerGroupApi", options);
|
|
6158
|
+
}
|
|
6159
|
+
listMembers(params) {
|
|
6160
|
+
const query = new URLSearchParams();
|
|
6161
|
+
if (params.page !== void 0) query.set("page", String(params.page));
|
|
6162
|
+
if (params.limit !== void 0) query.set("limit", String(params.limit));
|
|
6163
|
+
return this.requestEndpoint(
|
|
6164
|
+
CUSTOMER_GROUP_ENDPOINT_OPERATIONS.members,
|
|
6165
|
+
void 0,
|
|
6166
|
+
{ pathParams: { id: params.groupId }, query }
|
|
6167
|
+
);
|
|
6168
|
+
}
|
|
6169
|
+
grantMember(params) {
|
|
6170
|
+
const { groupId, ...body } = params;
|
|
6171
|
+
return this.requestEndpoint(
|
|
6172
|
+
CUSTOMER_GROUP_ENDPOINT_OPERATIONS.grant,
|
|
6173
|
+
body,
|
|
6174
|
+
{ pathParams: { id: groupId } }
|
|
6175
|
+
);
|
|
6176
|
+
}
|
|
6177
|
+
revokeMember(params) {
|
|
6178
|
+
const { groupId, ...body } = params;
|
|
6179
|
+
return this.requestEndpoint(
|
|
6180
|
+
CUSTOMER_GROUP_ENDPOINT_OPERATIONS.revoke,
|
|
6181
|
+
body,
|
|
6182
|
+
{ pathParams: { id: groupId } }
|
|
6183
|
+
);
|
|
6184
|
+
}
|
|
6185
|
+
};
|
|
6186
|
+
|
|
6104
6187
|
// src/core/client/client.server.ts
|
|
6105
6188
|
var ServerClient = class _ServerClient {
|
|
6106
6189
|
constructor(options) {
|
|
@@ -6140,6 +6223,7 @@ var ServerClient = class _ServerClient {
|
|
|
6140
6223
|
subscribe: membershipApi.subscribe.bind(membershipApi),
|
|
6141
6224
|
cancel: membershipApi.cancel.bind(membershipApi)
|
|
6142
6225
|
};
|
|
6226
|
+
this.customerGroups = new CustomerGroupApi(serverOptions);
|
|
6143
6227
|
const tenantIntrospectionApi = new TenantIntrospectionApi(serverOptions);
|
|
6144
6228
|
this.tenant = {
|
|
6145
6229
|
context: tenantIntrospectionApi.context.bind(tenantIntrospectionApi),
|
|
@@ -6208,6 +6292,7 @@ function createServerClient(options) {
|
|
|
6208
6292
|
export {
|
|
6209
6293
|
CollectionClient,
|
|
6210
6294
|
CommunityClient,
|
|
6295
|
+
CustomerGroupApi,
|
|
6211
6296
|
EventsClient,
|
|
6212
6297
|
ModerationApi,
|
|
6213
6298
|
ServerClient,
|