@01.software/sdk 0.29.0 → 0.30.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/README.md +273 -73
- package/dist/analytics/react.cjs +4 -1
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js +4 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs +4 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js +4 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +1476 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +28 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.js +1453 -0
- package/dist/client.js.map +1 -0
- package/dist/collection-client-B9d9kr1d.d.ts +218 -0
- package/dist/collection-client-QPbwimkU.d.cts +218 -0
- package/dist/{const-DAjQYNuM.d.ts → const-B75IFDRi.d.ts} +2 -4
- package/dist/{const-Dsixdi6z.d.cts → const-VZuk2tWc.d.cts} +2 -4
- package/dist/index-B2WbhEgT.d.cts +106 -0
- package/dist/index-B2WbhEgT.d.ts +106 -0
- package/dist/index.cjs +784 -1530
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -115
- package/dist/index.d.ts +11 -115
- package/dist/index.js +784 -1548
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs +91 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +58 -0
- package/dist/metadata.d.ts +58 -0
- package/dist/metadata.js +68 -0
- package/dist/metadata.js.map +1 -0
- package/dist/{payload-types-Ci-ZA7aM.d.cts → payload-types-DPjO_IbQ.d.cts} +9 -3
- package/dist/{payload-types-Ci-ZA7aM.d.ts → payload-types-DPjO_IbQ.d.ts} +9 -3
- package/dist/query.cjs +1791 -0
- package/dist/query.cjs.map +1 -0
- package/dist/query.d.cts +244 -0
- package/dist/query.d.ts +244 -0
- package/dist/query.js +1786 -0
- package/dist/query.js.map +1 -0
- package/dist/realtime.cjs +4 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +4 -1
- package/dist/realtime.js.map +1 -1
- package/dist/{server-BINWywT8.d.cts → server-CrsPyqEc.d.cts} +14 -31
- package/dist/{server-BINWywT8.d.ts → server-CrsPyqEc.d.ts} +14 -31
- package/dist/server.cjs +299 -840
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +112 -7
- package/dist/server.d.ts +112 -7
- package/dist/server.js +299 -858
- package/dist/server.js.map +1 -1
- package/dist/{types-BWq_WlbB.d.ts → types-1fBLrYU7.d.ts} +1 -1
- package/dist/{types-zKjATmDK.d.cts → types-BwT0eeaz.d.cts} +1 -1
- package/dist/{server-Cv0Q4dPQ.d.ts → types-Dlb2mwpX.d.cts} +228 -741
- package/dist/{server-C0C8dtms.d.cts → types-DuSKPiY5.d.ts} +228 -741
- package/dist/ui/canvas/server.cjs +7 -6
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +1 -3
- package/dist/ui/canvas/server.d.ts +1 -3
- package/dist/ui/canvas/server.js +7 -6
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +11 -10
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +29 -6
- package/dist/ui/canvas.d.ts +29 -6
- package/dist/ui/canvas.js +11 -10
- package/dist/ui/canvas.js.map +1 -1
- 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.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +84 -15
package/dist/index.d.cts
CHANGED
|
@@ -1,121 +1,15 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
export { A as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
export { C as CollectionType } from './types-zKjATmDK.cjs';
|
|
7
|
-
import { P as PublicCollection } from './const-Dsixdi6z.cjs';
|
|
8
|
-
export { C as COLLECTIONS, a as Collection, I as INTERNAL_COLLECTIONS, b as InternalCollection, S as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS, d as ServerCollection, e as ServerOnlyCollection } from './const-Dsixdi6z.cjs';
|
|
9
|
-
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
1
|
+
import { d as ClientConfig, h as RootClient } from './types-Dlb2mwpX.cjs';
|
|
2
|
+
export { k as AddItemParams, A as ApiQueryOptions, l as ApplyDiscountParams, B as BaseApi, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, o as CalculateShippingParams, p as CalculateShippingResult, q as CartApi, r as CartApiOptions, s as CheckoutParams, t as ClearCartParams, e as ClientMetadata, c as ClientState, C as CommerceClient, u as CommerceClientOptions, a as CommunityClient, v as CommunityClientOptions, w as CommunityPost, x as CompatibilityProductSelectionParamEvent, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, G as CreateOrderParams, H as CreateReturnParams, I as CustomerAuth, J as CustomerAuthOptions, K as CustomerAuthResponse, L as CustomerLoginData, b as CustomerNamespace, M as CustomerProfile, N as CustomerRefreshResponse, O as CustomerRegisterData, Q as CustomerRegisterResponse, T as CustomerSnapshot, D as DebugConfig, f as DeepPartial, U as DiscountApi, V as DiscountApiOptions, E as ExtractArrayType, X as LegacyProductSelectionParamEvent, Y as ListingGroupsParams, Z as NormalizedProductSelection, _ as OrderApi, $ as OrderApiOptions, P as PayloadFindResponse, g as PayloadMutationResponse, a0 as ProductApi, a1 as ProductApiOptions, a2 as ProductDetail, a3 as ProductDetailBrand, a4 as ProductDetailCategory, a5 as ProductDetailImage, a6 as ProductDetailImageMedia, a7 as ProductDetailListing, a8 as ProductDetailMedia, a9 as ProductDetailOption, aa as ProductDetailOptionValue, ab as ProductDetailParams, ac as ProductDetailTag, ad as ProductDetailVariant, ae as ProductDetailVariantOptionValue, af as ProductDetailVideo, ag as ProductHrefGroup, ah as ProductHrefOptions, ai as ProductHrefProduct, aj as ProductListingGroup, ak as ProductListingGroupSummary, al as ProductListingGroupsItem, am as ProductListingGroupsResponse, an as ProductListingProductShape, ao as ProductListingProjection, ap as ProductOptionMatrix, aq as ProductOptionMatrixOption, ar as ProductOptionMatrixValue, as as ProductOptionMatrixVariant, at as ProductOptionShape, au as ProductOptionValueShape, av as ProductSelectionAvailableValue, aw as ProductSelectionByOptionValue, ax as ProductSelectionCodecError, ay as ProductSelectionCodecOptions, az as ProductSelectionInput, aA as ProductSelectionResolution, aB as ProductSelectionResolutionContext, aC as ProductVariantShape, aD as RemoveDiscountParams, aE as RemoveItemParams, aF as RequestOptions, R as RetryConfig, aG as ReturnItem, aH as ReturnReason, aI as ReturnWithRefundParams, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, aJ as ServerApiOptions, aK as ShippingApi, aL as ShippingApiOptions, S as Sort, aM as StockCheckParams, aN as StockCheckResponse, aO as StockCheckResult, aP as UpdateFulfillmentParams, aQ as UpdateItemParams, aR as UpdateOrderParams, aS as UpdateProfileData, aT as UpdateReturnParams, aU as UpdateTransactionParams, aV as ValidateDiscountParams, aW as ValidateDiscountResult, W as Where, aX as buildProductHref, aY as buildProductListingGroupsByOption, aZ as buildProductListingProjection, a_ as buildProductOptionMatrix, a$ as buildProductOptionMatrixFromDetail, b0 as createProductSelectionCodec, b1 as getAvailableOptionValues, b2 as getProductSelectionImages, b3 as getSelectedValueByOptionId, b4 as normalizeProductSelection, b5 as normalizeProductSelectionFromMatrix, b6 as normalizeSelectedValueIds, b7 as parseProductSelection, b8 as resolveProductSelection, b9 as resolveProductSelectionFromMatrix, ba as resolveVariantForSelection, bb as stringifyProductSelection } from './types-Dlb2mwpX.cjs';
|
|
3
|
+
import { d as Product } from './payload-types-DPjO_IbQ.cjs';
|
|
4
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, P as Post, j as PostCategory, k as ProductVariant, T as Tenant, V as Video } from './payload-types-DPjO_IbQ.cjs';
|
|
5
|
+
export { C as CollectionType } from './types-BwT0eeaz.cjs';
|
|
10
6
|
export { CUSTOMER_PASSWORD_RESET_OPERATION, CustomerAuthWebhookEvent, CustomerAuthWebhookHandlers, CustomerPasswordResetWebhookData, CustomerPasswordResetWebhookEvent, WebhookEvent, WebhookHandler, WebhookOperation, WebhookOptions, createCustomerAuthWebhookHandler, createTypedWebhookHandler, handleWebhook, isCustomerPasswordResetWebhookEvent, isValidWebhookEvent } from './webhook.cjs';
|
|
7
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, S as SERVER_COLLECTIONS, b as SERVER_ONLY_COLLECTIONS } from './const-VZuk2tWc.cjs';
|
|
8
|
+
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
11
9
|
export { a as IMAGE_SIZES, I as ImageData, b as ImagePalette, c as ImagePlaceholderOptions, g as getImageLqip, d as getImagePalette, e as getImagePlaceholderStyle, f as getImageSrcSet, h as getImageUrl } from './image-BDz2-AaO.cjs';
|
|
12
10
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from './video-WR_TFO9a.cjs';
|
|
13
11
|
export { Analytics, AnalyticsConfig, createAnalytics } from './analytics.cjs';
|
|
14
|
-
|
|
15
|
-
import 'next';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Customer namespace. Currently exposes .auth; reserved for future customer-
|
|
19
|
-
* scoped capabilities (addresses, preferences, etc.).
|
|
20
|
-
*/
|
|
21
|
-
declare class CustomerNamespace {
|
|
22
|
-
readonly auth: CustomerAuth;
|
|
23
|
-
constructor(publishableKey: string, options?: CustomerAuthOptions);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface CommerceClientOptions {
|
|
27
|
-
publishableKey: string;
|
|
28
|
-
customerToken: () => string | null;
|
|
29
|
-
onUnauthorized?: () => Promise<string | null>;
|
|
30
|
-
onRequestId?: (id: string | null) => void;
|
|
31
|
-
customerAuth: CustomerAuth;
|
|
32
|
-
}
|
|
33
|
-
declare class CommerceClient {
|
|
34
|
-
readonly product: {
|
|
35
|
-
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
36
|
-
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
37
|
-
detail: (params: ProductDetailParams) => Promise<ProductDetail | null>;
|
|
38
|
-
};
|
|
39
|
-
readonly cart: {
|
|
40
|
-
get: (cartId: string) => Promise<Cart>;
|
|
41
|
-
addItem: (params: AddItemParams) => Promise<CartItem>;
|
|
42
|
-
updateItem: (params: UpdateItemParams) => Promise<CartItem>;
|
|
43
|
-
removeItem: (params: RemoveItemParams) => Promise<{
|
|
44
|
-
success: boolean;
|
|
45
|
-
}>;
|
|
46
|
-
applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
|
|
47
|
-
removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
|
|
48
|
-
clear: (params: ClearCartParams) => Promise<{
|
|
49
|
-
success: boolean;
|
|
50
|
-
}>;
|
|
51
|
-
};
|
|
52
|
-
readonly orders: {
|
|
53
|
-
checkout: (params: CheckoutParams) => Promise<Order>;
|
|
54
|
-
listMine: (options?: {
|
|
55
|
-
page?: number;
|
|
56
|
-
limit?: number;
|
|
57
|
-
status?: string;
|
|
58
|
-
}) => Promise<PayloadFindResponse<Order>>;
|
|
59
|
-
};
|
|
60
|
-
readonly discounts: {
|
|
61
|
-
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
62
|
-
};
|
|
63
|
-
readonly shipping: {
|
|
64
|
-
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
65
|
-
};
|
|
66
|
-
constructor(options: CommerceClientOptions);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
declare function collectionKeys<T extends PublicCollection>(collection: T): {
|
|
70
|
-
all: readonly [T];
|
|
71
|
-
lists: () => readonly [T, "list"];
|
|
72
|
-
list: (options?: ApiQueryOptions) => readonly [T, "list", ApiQueryOptions | undefined];
|
|
73
|
-
details: () => readonly [T, "detail"];
|
|
74
|
-
detail: (id: string, options?: ApiQueryOptions) => readonly [T, "detail", string, ApiQueryOptions | undefined];
|
|
75
|
-
infinites: () => readonly [T, "infinite"];
|
|
76
|
-
infinite: (options?: Omit<ApiQueryOptions, "page">) => readonly [T, "infinite", Omit<ApiQueryOptions, "page"> | undefined];
|
|
77
|
-
};
|
|
78
|
-
declare const customerKeys: {
|
|
79
|
-
all: readonly ["customer"];
|
|
80
|
-
me: () => readonly ["customer", "me"];
|
|
81
|
-
};
|
|
82
|
-
declare const productKeys: {
|
|
83
|
-
listingGroups: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "list", ProductListingGroupsQueryOptions | undefined];
|
|
84
|
-
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">) => readonly ["products", "listing-groups", "infinite", Omit<ProductListingGroupsQueryOptions, "limit" | "page"> | undefined];
|
|
85
|
-
detail: (params: {
|
|
86
|
-
slug: string;
|
|
87
|
-
} | {
|
|
88
|
-
id: string;
|
|
89
|
-
}) => readonly ["products", "detail", {
|
|
90
|
-
slug: string;
|
|
91
|
-
} | {
|
|
92
|
-
id: string;
|
|
93
|
-
}];
|
|
94
|
-
detailAll: () => readonly ["products", "detail"];
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
declare class Client {
|
|
98
|
-
commerce: CommerceClient;
|
|
99
|
-
community: CommunityClient;
|
|
100
|
-
customer: CustomerNamespace;
|
|
101
|
-
query: ReadOnlyQueryHooks;
|
|
102
|
-
collections: ReadOnlyCollectionClient;
|
|
103
|
-
queryClient: QueryClient;
|
|
104
|
-
lastRequestId: string | null;
|
|
105
|
-
protected state: ClientState;
|
|
106
|
-
protected config: ClientConfig;
|
|
107
|
-
constructor(options: ClientConfig);
|
|
108
|
-
getState(): ClientState;
|
|
109
|
-
getConfig(): ClientConfig;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Create an SDK client. Works in both browser and server environments.
|
|
113
|
-
* Read-only collection queries + customer auth (cart, login, profile).
|
|
114
|
-
* Use `createServerClient()` when you need full CRUD with secretKey.
|
|
115
|
-
*/
|
|
116
|
-
declare function createClient(options: ClientConfig): Client;
|
|
117
|
-
|
|
118
|
-
declare function getQueryClient(): QueryClient;
|
|
12
|
+
export { A as ApiError, a as AuthError, C as ConfigError, b as ConflictError, G as GoneError, N as NetworkError, c as NotFoundError, P as PermissionError, R as RateLimitError, S as SDKError, d as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, e as createAuthError, f as createConflictError, g as createNotFoundError, h as createPermissionError, i as createRateLimitError, j as isApiError, k as isAuthError, l as isConfigError, m as isConflictError, n as isGoneError, o as isNetworkError, p as isNotFoundError, q as isPermissionError, r as isRateLimitError, s as isSDKError, t as isServiceUnavailableError, u as isTimeoutError, v as isUsageLimitError, w as isValidationError } from './index-B2WbhEgT.cjs';
|
|
119
13
|
|
|
120
14
|
declare const generateOrderNumber: () => string;
|
|
121
15
|
|
|
@@ -135,4 +29,6 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
135
29
|
*/
|
|
136
30
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
137
31
|
|
|
138
|
-
|
|
32
|
+
declare function createClient(options: ClientConfig): RootClient;
|
|
33
|
+
|
|
34
|
+
export { RootClient as Client, ClientConfig, RootClient as ClientType, Product, RootClient, createClient, formatOrderName, generateOrderNumber, resolveRelation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,121 +1,15 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
export { A as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
export { C as CollectionType } from './types-BWq_WlbB.js';
|
|
7
|
-
import { P as PublicCollection } from './const-DAjQYNuM.js';
|
|
8
|
-
export { C as COLLECTIONS, a as Collection, I as INTERNAL_COLLECTIONS, b as InternalCollection, S as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS, d as ServerCollection, e as ServerOnlyCollection } from './const-DAjQYNuM.js';
|
|
9
|
-
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
1
|
+
import { d as ClientConfig, h as RootClient } from './types-DuSKPiY5.js';
|
|
2
|
+
export { k as AddItemParams, A as ApiQueryOptions, l as ApplyDiscountParams, B as BaseApi, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, o as CalculateShippingParams, p as CalculateShippingResult, q as CartApi, r as CartApiOptions, s as CheckoutParams, t as ClearCartParams, e as ClientMetadata, c as ClientState, C as CommerceClient, u as CommerceClientOptions, a as CommunityClient, v as CommunityClientOptions, w as CommunityPost, x as CompatibilityProductSelectionParamEvent, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, G as CreateOrderParams, H as CreateReturnParams, I as CustomerAuth, J as CustomerAuthOptions, K as CustomerAuthResponse, L as CustomerLoginData, b as CustomerNamespace, M as CustomerProfile, N as CustomerRefreshResponse, O as CustomerRegisterData, Q as CustomerRegisterResponse, T as CustomerSnapshot, D as DebugConfig, f as DeepPartial, U as DiscountApi, V as DiscountApiOptions, E as ExtractArrayType, X as LegacyProductSelectionParamEvent, Y as ListingGroupsParams, Z as NormalizedProductSelection, _ as OrderApi, $ as OrderApiOptions, P as PayloadFindResponse, g as PayloadMutationResponse, a0 as ProductApi, a1 as ProductApiOptions, a2 as ProductDetail, a3 as ProductDetailBrand, a4 as ProductDetailCategory, a5 as ProductDetailImage, a6 as ProductDetailImageMedia, a7 as ProductDetailListing, a8 as ProductDetailMedia, a9 as ProductDetailOption, aa as ProductDetailOptionValue, ab as ProductDetailParams, ac as ProductDetailTag, ad as ProductDetailVariant, ae as ProductDetailVariantOptionValue, af as ProductDetailVideo, ag as ProductHrefGroup, ah as ProductHrefOptions, ai as ProductHrefProduct, aj as ProductListingGroup, ak as ProductListingGroupSummary, al as ProductListingGroupsItem, am as ProductListingGroupsResponse, an as ProductListingProductShape, ao as ProductListingProjection, ap as ProductOptionMatrix, aq as ProductOptionMatrixOption, ar as ProductOptionMatrixValue, as as ProductOptionMatrixVariant, at as ProductOptionShape, au as ProductOptionValueShape, av as ProductSelectionAvailableValue, aw as ProductSelectionByOptionValue, ax as ProductSelectionCodecError, ay as ProductSelectionCodecOptions, az as ProductSelectionInput, aA as ProductSelectionResolution, aB as ProductSelectionResolutionContext, aC as ProductVariantShape, aD as RemoveDiscountParams, aE as RemoveItemParams, aF as RequestOptions, R as RetryConfig, aG as ReturnItem, aH as ReturnReason, aI as ReturnWithRefundParams, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, aJ as ServerApiOptions, aK as ShippingApi, aL as ShippingApiOptions, S as Sort, aM as StockCheckParams, aN as StockCheckResponse, aO as StockCheckResult, aP as UpdateFulfillmentParams, aQ as UpdateItemParams, aR as UpdateOrderParams, aS as UpdateProfileData, aT as UpdateReturnParams, aU as UpdateTransactionParams, aV as ValidateDiscountParams, aW as ValidateDiscountResult, W as Where, aX as buildProductHref, aY as buildProductListingGroupsByOption, aZ as buildProductListingProjection, a_ as buildProductOptionMatrix, a$ as buildProductOptionMatrixFromDetail, b0 as createProductSelectionCodec, b1 as getAvailableOptionValues, b2 as getProductSelectionImages, b3 as getSelectedValueByOptionId, b4 as normalizeProductSelection, b5 as normalizeProductSelectionFromMatrix, b6 as normalizeSelectedValueIds, b7 as parseProductSelection, b8 as resolveProductSelection, b9 as resolveProductSelectionFromMatrix, ba as resolveVariantForSelection, bb as stringifyProductSelection } from './types-DuSKPiY5.js';
|
|
3
|
+
import { d as Product } from './payload-types-DPjO_IbQ.js';
|
|
4
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, P as Post, j as PostCategory, k as ProductVariant, T as Tenant, V as Video } from './payload-types-DPjO_IbQ.js';
|
|
5
|
+
export { C as CollectionType } from './types-1fBLrYU7.js';
|
|
10
6
|
export { CUSTOMER_PASSWORD_RESET_OPERATION, CustomerAuthWebhookEvent, CustomerAuthWebhookHandlers, CustomerPasswordResetWebhookData, CustomerPasswordResetWebhookEvent, WebhookEvent, WebhookHandler, WebhookOperation, WebhookOptions, createCustomerAuthWebhookHandler, createTypedWebhookHandler, handleWebhook, isCustomerPasswordResetWebhookEvent, isValidWebhookEvent } from './webhook.js';
|
|
7
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, S as SERVER_COLLECTIONS, b as SERVER_ONLY_COLLECTIONS } from './const-B75IFDRi.js';
|
|
8
|
+
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
11
9
|
export { a as IMAGE_SIZES, I as ImageData, b as ImagePalette, c as ImagePlaceholderOptions, g as getImageLqip, d as getImagePalette, e as getImagePlaceholderStyle, f as getImageSrcSet, h as getImageUrl } from './image-BDz2-AaO.js';
|
|
12
10
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from './video-WR_TFO9a.js';
|
|
13
11
|
export { Analytics, AnalyticsConfig, createAnalytics } from './analytics.js';
|
|
14
|
-
|
|
15
|
-
import 'next';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Customer namespace. Currently exposes .auth; reserved for future customer-
|
|
19
|
-
* scoped capabilities (addresses, preferences, etc.).
|
|
20
|
-
*/
|
|
21
|
-
declare class CustomerNamespace {
|
|
22
|
-
readonly auth: CustomerAuth;
|
|
23
|
-
constructor(publishableKey: string, options?: CustomerAuthOptions);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface CommerceClientOptions {
|
|
27
|
-
publishableKey: string;
|
|
28
|
-
customerToken: () => string | null;
|
|
29
|
-
onUnauthorized?: () => Promise<string | null>;
|
|
30
|
-
onRequestId?: (id: string | null) => void;
|
|
31
|
-
customerAuth: CustomerAuth;
|
|
32
|
-
}
|
|
33
|
-
declare class CommerceClient {
|
|
34
|
-
readonly product: {
|
|
35
|
-
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
36
|
-
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
37
|
-
detail: (params: ProductDetailParams) => Promise<ProductDetail | null>;
|
|
38
|
-
};
|
|
39
|
-
readonly cart: {
|
|
40
|
-
get: (cartId: string) => Promise<Cart>;
|
|
41
|
-
addItem: (params: AddItemParams) => Promise<CartItem>;
|
|
42
|
-
updateItem: (params: UpdateItemParams) => Promise<CartItem>;
|
|
43
|
-
removeItem: (params: RemoveItemParams) => Promise<{
|
|
44
|
-
success: boolean;
|
|
45
|
-
}>;
|
|
46
|
-
applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
|
|
47
|
-
removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
|
|
48
|
-
clear: (params: ClearCartParams) => Promise<{
|
|
49
|
-
success: boolean;
|
|
50
|
-
}>;
|
|
51
|
-
};
|
|
52
|
-
readonly orders: {
|
|
53
|
-
checkout: (params: CheckoutParams) => Promise<Order>;
|
|
54
|
-
listMine: (options?: {
|
|
55
|
-
page?: number;
|
|
56
|
-
limit?: number;
|
|
57
|
-
status?: string;
|
|
58
|
-
}) => Promise<PayloadFindResponse<Order>>;
|
|
59
|
-
};
|
|
60
|
-
readonly discounts: {
|
|
61
|
-
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
62
|
-
};
|
|
63
|
-
readonly shipping: {
|
|
64
|
-
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
65
|
-
};
|
|
66
|
-
constructor(options: CommerceClientOptions);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
declare function collectionKeys<T extends PublicCollection>(collection: T): {
|
|
70
|
-
all: readonly [T];
|
|
71
|
-
lists: () => readonly [T, "list"];
|
|
72
|
-
list: (options?: ApiQueryOptions) => readonly [T, "list", ApiQueryOptions | undefined];
|
|
73
|
-
details: () => readonly [T, "detail"];
|
|
74
|
-
detail: (id: string, options?: ApiQueryOptions) => readonly [T, "detail", string, ApiQueryOptions | undefined];
|
|
75
|
-
infinites: () => readonly [T, "infinite"];
|
|
76
|
-
infinite: (options?: Omit<ApiQueryOptions, "page">) => readonly [T, "infinite", Omit<ApiQueryOptions, "page"> | undefined];
|
|
77
|
-
};
|
|
78
|
-
declare const customerKeys: {
|
|
79
|
-
all: readonly ["customer"];
|
|
80
|
-
me: () => readonly ["customer", "me"];
|
|
81
|
-
};
|
|
82
|
-
declare const productKeys: {
|
|
83
|
-
listingGroups: (options?: ProductListingGroupsQueryOptions) => readonly ["products", "listing-groups", "list", ProductListingGroupsQueryOptions | undefined];
|
|
84
|
-
listingGroupsInfinite: (options?: Omit<ProductListingGroupsQueryOptions, "page" | "limit">) => readonly ["products", "listing-groups", "infinite", Omit<ProductListingGroupsQueryOptions, "limit" | "page"> | undefined];
|
|
85
|
-
detail: (params: {
|
|
86
|
-
slug: string;
|
|
87
|
-
} | {
|
|
88
|
-
id: string;
|
|
89
|
-
}) => readonly ["products", "detail", {
|
|
90
|
-
slug: string;
|
|
91
|
-
} | {
|
|
92
|
-
id: string;
|
|
93
|
-
}];
|
|
94
|
-
detailAll: () => readonly ["products", "detail"];
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
declare class Client {
|
|
98
|
-
commerce: CommerceClient;
|
|
99
|
-
community: CommunityClient;
|
|
100
|
-
customer: CustomerNamespace;
|
|
101
|
-
query: ReadOnlyQueryHooks;
|
|
102
|
-
collections: ReadOnlyCollectionClient;
|
|
103
|
-
queryClient: QueryClient;
|
|
104
|
-
lastRequestId: string | null;
|
|
105
|
-
protected state: ClientState;
|
|
106
|
-
protected config: ClientConfig;
|
|
107
|
-
constructor(options: ClientConfig);
|
|
108
|
-
getState(): ClientState;
|
|
109
|
-
getConfig(): ClientConfig;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Create an SDK client. Works in both browser and server environments.
|
|
113
|
-
* Read-only collection queries + customer auth (cart, login, profile).
|
|
114
|
-
* Use `createServerClient()` when you need full CRUD with secretKey.
|
|
115
|
-
*/
|
|
116
|
-
declare function createClient(options: ClientConfig): Client;
|
|
117
|
-
|
|
118
|
-
declare function getQueryClient(): QueryClient;
|
|
12
|
+
export { A as ApiError, a as AuthError, C as ConfigError, b as ConflictError, G as GoneError, N as NetworkError, c as NotFoundError, P as PermissionError, R as RateLimitError, S as SDKError, d as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, e as createAuthError, f as createConflictError, g as createNotFoundError, h as createPermissionError, i as createRateLimitError, j as isApiError, k as isAuthError, l as isConfigError, m as isConflictError, n as isGoneError, o as isNetworkError, p as isNotFoundError, q as isPermissionError, r as isRateLimitError, s as isSDKError, t as isServiceUnavailableError, u as isTimeoutError, v as isUsageLimitError, w as isValidationError } from './index-B2WbhEgT.js';
|
|
119
13
|
|
|
120
14
|
declare const generateOrderNumber: () => string;
|
|
121
15
|
|
|
@@ -135,4 +29,6 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
135
29
|
*/
|
|
136
30
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
137
31
|
|
|
138
|
-
|
|
32
|
+
declare function createClient(options: ClientConfig): RootClient;
|
|
33
|
+
|
|
34
|
+
export { RootClient as Client, ClientConfig, RootClient as ClientType, Product, RootClient, createClient, formatOrderName, generateOrderNumber, resolveRelation };
|