@01.software/sdk 0.25.0 → 0.27.0
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/README.md +28 -3
- package/dist/analytics/react.cjs +249 -0
- package/dist/analytics/react.cjs.map +1 -0
- package/dist/analytics/react.d.cts +8 -0
- package/dist/analytics/react.d.ts +8 -0
- package/dist/analytics/react.js +228 -0
- package/dist/analytics/react.js.map +1 -0
- package/dist/{const-C8UhtzLn.d.cts → const-C0GlmeJ_.d.cts} +6 -6
- package/dist/{const-Bs-QcTj0.d.ts → const-D-xucnw4.d.ts} +6 -6
- package/dist/{image-TT8lTsk5.d.cts → image-BDz2-AaO.d.cts} +1 -1
- package/dist/{image-TT8lTsk5.d.ts → image-BDz2-AaO.d.ts} +1 -1
- package/dist/index.cjs +32 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BaK4zCQ8.d.cts → payload-types-BPvUmPAq.d.cts} +803 -709
- package/dist/{payload-types-BaK4zCQ8.d.ts → payload-types-BPvUmPAq.d.ts} +803 -709
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/{server-DLdbWJVv.d.cts → server-BINWywT8.d.cts} +1 -1
- package/dist/{server-DLdbWJVv.d.ts → server-BINWywT8.d.ts} +1 -1
- package/dist/{server-CkGfBnSx.d.cts → server-_zvihptw.d.ts} +27 -4
- package/dist/{server-DQYWLnkt.d.ts → server-n3xK4Nks.d.cts} +27 -4
- package/dist/server.cjs +25 -4
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +25 -4
- package/dist/server.js.map +1 -1
- package/dist/{types-DjaaBExv.d.ts → types-BLdthWiW.d.ts} +1 -1
- package/dist/{types-BH-YBrFs.d.cts → types-DzWNu9pw.d.cts} +1 -1
- package/dist/ui/canvas/server.d.cts +1 -1
- package/dist/ui/canvas/server.d.ts +1 -1
- package/dist/ui/canvas.d.cts +3 -3
- package/dist/ui/canvas.d.ts +3 -3
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/image.d.cts +1 -1
- package/dist/ui/image.d.ts +1 -1
- package/dist/ui/rich-text.cjs +138 -0
- package/dist/ui/rich-text.cjs.map +1 -1
- package/dist/ui/rich-text.d.cts +23 -1
- package/dist/ui/rich-text.d.ts +23 -1
- package/dist/ui/rich-text.js +138 -0
- package/dist/ui/rich-text.js.map +1 -1
- package/dist/ui/video.d.cts +2 -2
- package/dist/ui/video.d.ts +2 -2
- package/dist/{video-DbLL8yuc.d.cts → video-WR_TFO9a.d.cts} +1 -1
- package/dist/{video-DbLL8yuc.d.ts → video-WR_TFO9a.d.ts} +1 -1
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +41 -24
package/dist/realtime.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RealtimeEvent } from './realtime-D7HtUpqt.cjs';
|
|
2
2
|
export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
3
|
-
import { P as PublicCollection } from './const-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-C0GlmeJ_.cjs';
|
|
4
|
+
import './payload-types-BPvUmPAq.cjs';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
package/dist/realtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RealtimeEvent } from './realtime-D7HtUpqt.js';
|
|
2
2
|
export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
3
|
-
import { P as PublicCollection } from './const-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-D-xucnw4.js';
|
|
4
|
+
import './payload-types-BPvUmPAq.js';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
|
@@ -243,4 +243,4 @@ interface FrameData {
|
|
|
243
243
|
*/
|
|
244
244
|
declare function getFrameData(data: CanvasData, frameId: string): FrameData | undefined;
|
|
245
245
|
|
|
246
|
-
export {
|
|
246
|
+
export { BUILT_IN_EDGE_TYPES as B, type CanvasData as C, type DynamicNodeSlotProps as D, type EdgeTypeDef as E, type FrameNodeSlotProps as F, type NodeTypeDef as N, type PrefetchCanvasOptions as P, type SDKClient as S, type UseCanvasOptions as U, type CanvasNode as a, type NodeTypeFieldDef as b, type CanvasEdge as c, type EdgeSlotProps as d, type NodeWrapperSlotProps as e, type CanvasViewport as f, type CanvasBounds as g, type FrameData as h, BUILT_IN_NODE_TYPES as i, type CanvasNodeData as j, type CanvasNodePosition as k, type DynamicNodeData as l, type FrameNodeData as m, type UseCanvasResult as n, getFrameData as o, getFrames as p, getNodeBounds as q, isDynamicNode as r, isFrameNode as s, prefetchCanvas as t, useCanvas as u };
|
|
@@ -243,4 +243,4 @@ interface FrameData {
|
|
|
243
243
|
*/
|
|
244
244
|
declare function getFrameData(data: CanvasData, frameId: string): FrameData | undefined;
|
|
245
245
|
|
|
246
|
-
export {
|
|
246
|
+
export { BUILT_IN_EDGE_TYPES as B, type CanvasData as C, type DynamicNodeSlotProps as D, type EdgeTypeDef as E, type FrameNodeSlotProps as F, type NodeTypeDef as N, type PrefetchCanvasOptions as P, type SDKClient as S, type UseCanvasOptions as U, type CanvasNode as a, type NodeTypeFieldDef as b, type CanvasEdge as c, type EdgeSlotProps as d, type NodeWrapperSlotProps as e, type CanvasViewport as f, type CanvasBounds as g, type FrameData as h, BUILT_IN_NODE_TYPES as i, type CanvasNodeData as j, type CanvasNodePosition as k, type DynamicNodeData as l, type FrameNodeData as m, type UseCanvasResult as n, getFrameData as o, getFrames as p, getNodeBounds as q, isDynamicNode as r, isFrameNode as s, prefetchCanvas as t, useCanvas as u };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BPvUmPAq.js';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection,
|
|
6
|
+
import { C as CollectionType } from './types-BLdthWiW.js';
|
|
7
|
+
import { P as PublicCollection, d as ServerCollection } from './const-D-xucnw4.js';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
|
@@ -1082,6 +1082,27 @@ type UpdateTransactionParams = {
|
|
|
1082
1082
|
paymentKey?: string;
|
|
1083
1083
|
amount?: number;
|
|
1084
1084
|
};
|
|
1085
|
+
type ConfirmPaymentParams = {
|
|
1086
|
+
orderNumber?: string;
|
|
1087
|
+
pgPaymentId: string;
|
|
1088
|
+
pgProvider: string;
|
|
1089
|
+
pgOrderId?: string;
|
|
1090
|
+
amount: number;
|
|
1091
|
+
currency?: string;
|
|
1092
|
+
paymentMethod?: string;
|
|
1093
|
+
receiptUrl?: string;
|
|
1094
|
+
approvedAt?: string;
|
|
1095
|
+
providerStatus?: string;
|
|
1096
|
+
providerEventId?: string;
|
|
1097
|
+
confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
|
|
1098
|
+
metadata?: Record<string, unknown>;
|
|
1099
|
+
};
|
|
1100
|
+
type ConfirmPaymentResponse = {
|
|
1101
|
+
orderId: string;
|
|
1102
|
+
transactionId: string;
|
|
1103
|
+
status: 'paid';
|
|
1104
|
+
alreadyConfirmed?: boolean;
|
|
1105
|
+
};
|
|
1085
1106
|
type RestockAction = 'return_to_stock' | 'discard';
|
|
1086
1107
|
type ReturnWithRefundItem = {
|
|
1087
1108
|
orderItem: string | number;
|
|
@@ -1153,6 +1174,7 @@ declare class OrderApi extends BaseApi {
|
|
|
1153
1174
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
1154
1175
|
updateOrder(params: UpdateOrderParams): Promise<Order>;
|
|
1155
1176
|
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
1177
|
+
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
1156
1178
|
checkout(params: CheckoutParams): Promise<Order>;
|
|
1157
1179
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
1158
1180
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
@@ -1193,6 +1215,7 @@ declare class ServerCommerceClient {
|
|
|
1193
1215
|
create: (params: CreateOrderParams) => Promise<Order>;
|
|
1194
1216
|
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
1195
1217
|
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
1218
|
+
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
1196
1219
|
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
1197
1220
|
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
1198
1221
|
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
@@ -1417,4 +1440,4 @@ declare class ServerClient {
|
|
|
1417
1440
|
*/
|
|
1418
1441
|
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
1419
1442
|
|
|
1420
|
-
export {
|
|
1443
|
+
export { type CustomerLoginData as $, type AddItemParams as A, type BanCustomerParams as B, CustomerAuth as C, CollectionClient as D, type CollectionDetailQueryParams as E, CollectionHooks as F, type CollectionInfiniteQueryParams as G, CollectionQueryBuilder as H, type CollectionQueryParams as I, type CommunityBan as J, type CommunityClientOptions as K, type ListingGroupsParams as L, type CommunityPost as M, ConfigError as N, type ConfirmPaymentParams as O, type ProductListingGroupsResponse as P, type ConfirmPaymentResponse as Q, type RemoveItemParams as R, type StockCheckParams as S, ConflictError as T, type UpdateItemParams as U, type ValidateDiscountParams as V, type CreateFulfillmentParams as W, type CreateOrderParams as X, type CreateReturnParams as Y, type CustomerAuthResponse as Z, CustomerHooks as _, type CustomerAuthOptions as a, type UpdateReturnParams as a$, type CustomerProfile as a0, type CustomerRefreshResponse as a1, type CustomerRegisterData as a2, type CustomerRegisterResponse as a3, type CustomerSnapshot as a4, type DebugConfig as a5, type DeepPartial as a6, DiscountApi as a7, type DiscountApiOptions as a8, type ExtractArrayType as a9, QueryHooks as aA, type QueryOptions as aB, RateLimitError as aC, type ReadOnlyQueryBuilder as aD, type RequestOptions as aE, type RetryConfig as aF, type ReturnItem as aG, type ReturnReason as aH, type ReturnWithRefundParams as aI, SDKError as aJ, type ServerApiOptions as aK, ServerClient as aL, ServerCollectionClient as aM, ServerCollectionQueryBuilder as aN, ServerCommerceClient as aO, type ServerCommerceClientOptions as aP, ServiceUnavailableError as aQ, ShippingApi as aR, type ShippingApiOptions as aS, type StockCheckResult as aT, type SuspenseInfiniteQueryOptions as aU, type SuspenseQueryOptions as aV, TimeoutError as aW, type UnbanCustomerParams as aX, type UpdateFulfillmentParams as aY, type UpdateOrderParams as aZ, type UpdateProfileData as a_, type GenerateMetadataOptions as aa, GoneError as ab, type InfiniteQueryOptions as ac, ModerationApi as ad, type ModerationApiOptions as ae, NetworkError as af, NotFoundError as ag, OrderApi as ah, type OrderApiOptions as ai, type PaginationMeta as aj, type PayloadMutationResponse as ak, PermissionError as al, ProductApi as am, type ProductApiOptions as an, type ProductListingGroup as ao, type ProductListingGroupSummary as ap, type ProductListingGroupsItem as aq, type ProductListingProductShape as ar, type ProductListingProjection as as, type ProductOptionMatrix as at, type ProductOptionMatrixOption as au, type ProductOptionMatrixValue as av, type ProductOptionMatrixVariant as aw, type ProductOptionShape as ax, type ProductOptionValueShape as ay, type ProductVariantShape as az, type StockCheckResponse as b, type UpdateTransactionParams as b0, UsageLimitError as b1, ValidationError as b2, buildProductListingGroupsByOption as b3, buildProductListingProjection as b4, buildProductOptionMatrix as b5, createAuthError as b6, createConflictError as b7, createNotFoundError as b8, createPermissionError as b9, createRateLimitError as ba, createServerClient as bb, getAvailableOptionValues as bc, getSelectedValueByOptionId as bd, isApiError as be, isAuthError as bf, isConfigError as bg, isConflictError as bh, isGoneError as bi, isNetworkError as bj, isNotFoundError as bk, isPermissionError as bl, isRateLimitError as bm, isSDKError as bn, isServiceUnavailableError as bo, isTimeoutError as bp, isUsageLimitError as bq, isValidationError as br, normalizeSelectedValueIds as bs, resolveApiUrl as bt, resolveVariantForSelection as bu, type ApplyDiscountParams as c, type RemoveDiscountParams as d, type ClearCartParams as e, type CheckoutParams as f, type PayloadFindResponse as g, type ValidateDiscountResult as h, type CalculateShippingParams as i, type CalculateShippingResult as j, type ApiQueryOptions as k, type ProductListingGroupsQueryOptions as l, CommunityClient as m, type ReadOnlyQueryHooks as n, ReadOnlyCollectionClient as o, type ClientState as p, type ClientConfig as q, ApiError as r, AuthError as s, BaseApi as t, type BulkImportFulfillmentsParams as u, type BulkImportFulfillmentsResponse as v, CartApi as w, type CartApiOptions as x, type ClientMetadata as y, type ClientServerConfig as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BPvUmPAq.cjs';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection,
|
|
6
|
+
import { C as CollectionType } from './types-DzWNu9pw.cjs';
|
|
7
|
+
import { P as PublicCollection, d as ServerCollection } from './const-C0GlmeJ_.cjs';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
|
@@ -1082,6 +1082,27 @@ type UpdateTransactionParams = {
|
|
|
1082
1082
|
paymentKey?: string;
|
|
1083
1083
|
amount?: number;
|
|
1084
1084
|
};
|
|
1085
|
+
type ConfirmPaymentParams = {
|
|
1086
|
+
orderNumber?: string;
|
|
1087
|
+
pgPaymentId: string;
|
|
1088
|
+
pgProvider: string;
|
|
1089
|
+
pgOrderId?: string;
|
|
1090
|
+
amount: number;
|
|
1091
|
+
currency?: string;
|
|
1092
|
+
paymentMethod?: string;
|
|
1093
|
+
receiptUrl?: string;
|
|
1094
|
+
approvedAt?: string;
|
|
1095
|
+
providerStatus?: string;
|
|
1096
|
+
providerEventId?: string;
|
|
1097
|
+
confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
|
|
1098
|
+
metadata?: Record<string, unknown>;
|
|
1099
|
+
};
|
|
1100
|
+
type ConfirmPaymentResponse = {
|
|
1101
|
+
orderId: string;
|
|
1102
|
+
transactionId: string;
|
|
1103
|
+
status: 'paid';
|
|
1104
|
+
alreadyConfirmed?: boolean;
|
|
1105
|
+
};
|
|
1085
1106
|
type RestockAction = 'return_to_stock' | 'discard';
|
|
1086
1107
|
type ReturnWithRefundItem = {
|
|
1087
1108
|
orderItem: string | number;
|
|
@@ -1153,6 +1174,7 @@ declare class OrderApi extends BaseApi {
|
|
|
1153
1174
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
1154
1175
|
updateOrder(params: UpdateOrderParams): Promise<Order>;
|
|
1155
1176
|
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
1177
|
+
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
1156
1178
|
checkout(params: CheckoutParams): Promise<Order>;
|
|
1157
1179
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
1158
1180
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
@@ -1193,6 +1215,7 @@ declare class ServerCommerceClient {
|
|
|
1193
1215
|
create: (params: CreateOrderParams) => Promise<Order>;
|
|
1194
1216
|
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
1195
1217
|
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
1218
|
+
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
1196
1219
|
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
1197
1220
|
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
1198
1221
|
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
@@ -1417,4 +1440,4 @@ declare class ServerClient {
|
|
|
1417
1440
|
*/
|
|
1418
1441
|
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
1419
1442
|
|
|
1420
|
-
export {
|
|
1443
|
+
export { type CustomerLoginData as $, type AddItemParams as A, type BanCustomerParams as B, CustomerAuth as C, CollectionClient as D, type CollectionDetailQueryParams as E, CollectionHooks as F, type CollectionInfiniteQueryParams as G, CollectionQueryBuilder as H, type CollectionQueryParams as I, type CommunityBan as J, type CommunityClientOptions as K, type ListingGroupsParams as L, type CommunityPost as M, ConfigError as N, type ConfirmPaymentParams as O, type ProductListingGroupsResponse as P, type ConfirmPaymentResponse as Q, type RemoveItemParams as R, type StockCheckParams as S, ConflictError as T, type UpdateItemParams as U, type ValidateDiscountParams as V, type CreateFulfillmentParams as W, type CreateOrderParams as X, type CreateReturnParams as Y, type CustomerAuthResponse as Z, CustomerHooks as _, type CustomerAuthOptions as a, type UpdateReturnParams as a$, type CustomerProfile as a0, type CustomerRefreshResponse as a1, type CustomerRegisterData as a2, type CustomerRegisterResponse as a3, type CustomerSnapshot as a4, type DebugConfig as a5, type DeepPartial as a6, DiscountApi as a7, type DiscountApiOptions as a8, type ExtractArrayType as a9, QueryHooks as aA, type QueryOptions as aB, RateLimitError as aC, type ReadOnlyQueryBuilder as aD, type RequestOptions as aE, type RetryConfig as aF, type ReturnItem as aG, type ReturnReason as aH, type ReturnWithRefundParams as aI, SDKError as aJ, type ServerApiOptions as aK, ServerClient as aL, ServerCollectionClient as aM, ServerCollectionQueryBuilder as aN, ServerCommerceClient as aO, type ServerCommerceClientOptions as aP, ServiceUnavailableError as aQ, ShippingApi as aR, type ShippingApiOptions as aS, type StockCheckResult as aT, type SuspenseInfiniteQueryOptions as aU, type SuspenseQueryOptions as aV, TimeoutError as aW, type UnbanCustomerParams as aX, type UpdateFulfillmentParams as aY, type UpdateOrderParams as aZ, type UpdateProfileData as a_, type GenerateMetadataOptions as aa, GoneError as ab, type InfiniteQueryOptions as ac, ModerationApi as ad, type ModerationApiOptions as ae, NetworkError as af, NotFoundError as ag, OrderApi as ah, type OrderApiOptions as ai, type PaginationMeta as aj, type PayloadMutationResponse as ak, PermissionError as al, ProductApi as am, type ProductApiOptions as an, type ProductListingGroup as ao, type ProductListingGroupSummary as ap, type ProductListingGroupsItem as aq, type ProductListingProductShape as ar, type ProductListingProjection as as, type ProductOptionMatrix as at, type ProductOptionMatrixOption as au, type ProductOptionMatrixValue as av, type ProductOptionMatrixVariant as aw, type ProductOptionShape as ax, type ProductOptionValueShape as ay, type ProductVariantShape as az, type StockCheckResponse as b, type UpdateTransactionParams as b0, UsageLimitError as b1, ValidationError as b2, buildProductListingGroupsByOption as b3, buildProductListingProjection as b4, buildProductOptionMatrix as b5, createAuthError as b6, createConflictError as b7, createNotFoundError as b8, createPermissionError as b9, createRateLimitError as ba, createServerClient as bb, getAvailableOptionValues as bc, getSelectedValueByOptionId as bd, isApiError as be, isAuthError as bf, isConfigError as bg, isConflictError as bh, isGoneError as bi, isNetworkError as bj, isNotFoundError as bk, isPermissionError as bl, isRateLimitError as bm, isSDKError as bn, isServiceUnavailableError as bo, isTimeoutError as bp, isUsageLimitError as bq, isValidationError as br, normalizeSelectedValueIds as bs, resolveApiUrl as bt, resolveVariantForSelection as bu, type ApplyDiscountParams as c, type RemoveDiscountParams as d, type ClearCartParams as e, type CheckoutParams as f, type PayloadFindResponse as g, type ValidateDiscountResult as h, type CalculateShippingParams as i, type CalculateShippingResult as j, type ApiQueryOptions as k, type ProductListingGroupsQueryOptions as l, CommunityClient as m, type ReadOnlyQueryHooks as n, ReadOnlyCollectionClient as o, type ClientState as p, type ClientConfig as q, ApiError as r, AuthError as s, BaseApi as t, type BulkImportFulfillmentsParams as u, type BulkImportFulfillmentsResponse as v, CartApi as w, type CartApiOptions as x, type ClientMetadata as y, type ClientServerConfig as z };
|
package/dist/server.cjs
CHANGED
|
@@ -385,14 +385,23 @@ function debugLog(debug, type, message, data) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
function getErrorSuggestion(status) {
|
|
388
|
-
if (status === 400)
|
|
388
|
+
if (status === 400)
|
|
389
|
+
return "The request data failed validation. Check field values and types.";
|
|
389
390
|
if (status === 401) return "Please check your authentication credentials.";
|
|
390
|
-
if (status === 403)
|
|
391
|
+
if (status === 403)
|
|
392
|
+
return "Access denied. Check your credentials or permissions.";
|
|
391
393
|
if (status === 404) return "The requested resource was not found.";
|
|
392
394
|
if (status === 422) return "The request data failed validation.";
|
|
393
395
|
if (status >= 500) return "A server error occurred. Please try again later.";
|
|
394
396
|
return void 0;
|
|
395
397
|
}
|
|
398
|
+
function isUsageLimitExceededResponse(response) {
|
|
399
|
+
if (response.status !== 429) return false;
|
|
400
|
+
const limit = parseInt(response.headers.get("X-Usage-Limit") || "", 10);
|
|
401
|
+
const current = parseInt(response.headers.get("X-Usage-Current") || "", 10);
|
|
402
|
+
if (!Number.isFinite(limit) || !Number.isFinite(current)) return false;
|
|
403
|
+
return response.headers.get("X-Usage-Exceeded") === "true" || current > limit;
|
|
404
|
+
}
|
|
396
405
|
async function parseErrorBody(response) {
|
|
397
406
|
const fallback = {
|
|
398
407
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
@@ -592,7 +601,7 @@ async function httpFetch(url, options) {
|
|
|
592
601
|
headers: Object.fromEntries(response.headers.entries())
|
|
593
602
|
});
|
|
594
603
|
if (!response.ok) {
|
|
595
|
-
if (response
|
|
604
|
+
if (isUsageLimitExceededResponse(response)) {
|
|
596
605
|
const limit = parseInt(
|
|
597
606
|
response.headers.get("X-Usage-Limit") || "0",
|
|
598
607
|
10
|
|
@@ -609,7 +618,11 @@ async function httpFetch(url, options) {
|
|
|
609
618
|
createUsageLimitError(
|
|
610
619
|
`Monthly API usage limit exceeded (${current.toLocaleString()}/${limit.toLocaleString()})`,
|
|
611
620
|
{ limit, current, remaining },
|
|
612
|
-
{
|
|
621
|
+
{
|
|
622
|
+
url,
|
|
623
|
+
method: requestInit.method || "GET",
|
|
624
|
+
attempt: attempt + 1
|
|
625
|
+
},
|
|
613
626
|
"Monthly API call limit exceeded. Please upgrade your plan.",
|
|
614
627
|
"Upgrade your tenant plan to increase the monthly API call limit."
|
|
615
628
|
),
|
|
@@ -1397,6 +1410,13 @@ var OrderApi = class extends BaseApi {
|
|
|
1397
1410
|
updateTransaction(params) {
|
|
1398
1411
|
return this.request("/api/transactions/update", params);
|
|
1399
1412
|
}
|
|
1413
|
+
confirmPayment(params) {
|
|
1414
|
+
return this.request(
|
|
1415
|
+
"/api/orders/confirm-payment",
|
|
1416
|
+
params,
|
|
1417
|
+
params.providerEventId ? { headers: { "X-Idempotency-Key": params.providerEventId } } : void 0
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1400
1420
|
checkout(params) {
|
|
1401
1421
|
return this.request("/api/orders/checkout", params);
|
|
1402
1422
|
}
|
|
@@ -1462,6 +1482,7 @@ var ServerCommerceClient = class {
|
|
|
1462
1482
|
create: orderApi.createOrder.bind(orderApi),
|
|
1463
1483
|
update: orderApi.updateOrder.bind(orderApi),
|
|
1464
1484
|
updateTransaction: orderApi.updateTransaction.bind(orderApi),
|
|
1485
|
+
confirmPayment: orderApi.confirmPayment.bind(orderApi),
|
|
1465
1486
|
createFulfillment: orderApi.createFulfillment.bind(orderApi),
|
|
1466
1487
|
updateFulfillment: orderApi.updateFulfillment.bind(orderApi),
|
|
1467
1488
|
bulkImportFulfillments: orderApi.bulkImportFulfillments.bind(orderApi),
|