@01.software/sdk 0.4.3 → 0.5.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 +13 -13
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/{const-C3GC2SxR.d.cts → const-BO4SPN7f.d.ts} +2 -2
- package/dist/{const-ikSyKVND.d.ts → const-hqVXNZoy.d.cts} +2 -2
- package/dist/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -18
- package/dist/index.d.ts +27 -18
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DPka7hJu.d.cts → payload-types-mZpmjJBz.d.cts} +102 -4
- package/dist/{payload-types-DPka7hJu.d.ts → payload-types-mZpmjJBz.d.ts} +102 -4
- 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.map +1 -1
- package/dist/server-B80o7igg.d.cts +242 -0
- package/dist/server-B80o7igg.d.ts +242 -0
- package/dist/ui/flow/server.cjs +233 -0
- package/dist/ui/flow/server.cjs.map +1 -0
- package/dist/ui/flow/server.d.cts +3 -0
- package/dist/ui/flow/server.d.ts +3 -0
- package/dist/ui/flow/server.js +213 -0
- package/dist/ui/flow/server.js.map +1 -0
- package/dist/ui/flow.cjs +540 -127
- package/dist/ui/flow.cjs.map +1 -1
- package/dist/ui/flow.d.cts +39 -189
- package/dist/ui/flow.d.ts +39 -189
- package/dist/ui/flow.js +544 -135
- package/dist/ui/flow.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-CvNTdBWV.d.ts → webhook-CMi4JRCp.d.ts} +3 -3
- package/dist/{webhook-B8BfJ_Ka.d.cts → webhook-D65mzWt2.d.cts} +3 -3
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +19 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export { o as ApiUsage,
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-mZpmjJBz.cjs';
|
|
2
|
+
export { o as ApiUsage, au as ApiUsageSelect, A as Audience, aq as AudiencesSelect, bs as Auth, q as BillingHistory, aw as BillingHistorySelect, y as Brand, B as BrandLogo, aF as BrandLogosSelect, aE as BrandsSelect, aV as CartItemsSelect, aU as CartsSelect, g as CodeBlock, br as CollectionsWidget, C as Config, G as Customer, J as CustomerAddress, aS as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, aT as CustomerGroupsSelect, aR as CustomersSelect, W as Discount, aW as DiscountsSelect, $ as Document, b0 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, b1 as DocumentTypesSelect, a$ as DocumentsSelect, m as EmailLog, ar as EmailLogsSelect, N as ExchangeProduct, aP as ExchangeProductsSelect, aO as ExchangesSelect, j as FieldConfig, an as FieldConfigsSelect, ac as Flow, bf as FlowCategoriesSelect, ad as FlowCategory, ag as FlowEdgeType, be as FlowEdgeTypesSelect, af as FlowNodeType, bd as FlowNodeTypesSelect, ae as FlowTag, bg as FlowTagsSelect, bc as FlowsSelect, F as Form, ah as FormSubmission, bm as FormSubmissionsSelect, bl as FormsSelect, K as FulfillmentItem, aL as FulfillmentItemsSelect, aK as FulfillmentsSelect, b8 as GalleriesSelect, a8 as Gallery, b9 as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bb as GalleryItemsSelect, aa as GalleryTag, ba as GalleryTagsSelect, I as IframeBlock, k as Image, ao as ImagesSelect, L as LiveStream, bk as LiveStreamsSelect, a5 as Music, b6 as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, b7 as MusicTagsSelect, b5 as MusicsSelect, aH as OrderProductsSelect, Q as OrderStatusLog, aJ as OrderStatusLogsSelect, aG as OrdersSelect, ai as PayloadKv, bn as PayloadKvSelect, aj as PayloadLockedDocument, bo as PayloadLockedDocumentsSelect, al as PayloadMigration, bq as PayloadMigrationsSelect, ak as PayloadPreference, bp as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, b3 as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, b4 as PlaylistTagsSelect, b2 as PlaylistsSelect, X as Post, Y as PostAuthor, aY as PostAuthorsSelect, aZ as PostCategoriesSelect, Z as PostCategory, _ as PostTag, a_ as PostTagsSelect, aX as PostsSelect, aB as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aD as ProductCollectionsSelect, v as ProductOption, aA as ProductOptionsSelect, x as ProductTag, aC as ProductTagsSelect, u as ProductVariant, az as ProductVariantsSelect, ay as ProductsSelect, M as ReturnProduct, aN as ReturnProductsSelect, aM as ReturnsSelect, aQ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, av as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, ap as SystemMediaSelect, i as Tenant, r as TenantLogo, ax as TenantLogosSelect, at as TenantMetadataSelect, n as TenantMetadatum, as as TenantsSelect, aI as TransactionsSelect, h as User, U as UserAuthOperations, am as UsersSelect, V as Video, bi as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bj as VideoTagsSelect, bh as VideosSelect } from './payload-types-mZpmjJBz.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as PublicCollection } from './const-C3GC2SxR.cjs';
|
|
7
|
-
export { a as COLLECTIONS, C as Collection } from './const-C3GC2SxR.cjs';
|
|
8
6
|
import { Metadata } from 'next';
|
|
9
|
-
import {
|
|
10
|
-
export { a as
|
|
7
|
+
import { P as PublicCollection } from './const-hqVXNZoy.cjs';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-hqVXNZoy.cjs';
|
|
9
|
+
import { C as CollectionType } from './webhook-D65mzWt2.cjs';
|
|
10
|
+
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-D65mzWt2.cjs';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-DupPIYx-.cjs';
|
|
12
12
|
export { b as IMAGE_SIZES, I as ImageData, a as ImagePalette, f as ImagePlaceholderOptions, d as getImageLqip, e as getImagePalette, h as getImagePlaceholderStyle, c as getImageSrcSet, g as getImageUrl } from './image-TT8lTsk5.cjs';
|
|
13
13
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from './video-DbLL8yuc.cjs';
|
|
@@ -19,11 +19,11 @@ export { JwtPayload, createApiKey, createServerToken, decodeServerToken, parseAp
|
|
|
19
19
|
* 빌드 시 버전에 따라 기본값 결정: dev 빌드 → api-dev, 정식 → api.01.software
|
|
20
20
|
*/
|
|
21
21
|
declare function resolveApiUrl(): string;
|
|
22
|
-
interface
|
|
22
|
+
interface ClientConfig {
|
|
23
23
|
clientKey: string;
|
|
24
24
|
/**
|
|
25
25
|
* Customer authentication options.
|
|
26
|
-
* Used to initialize CustomerAuth on
|
|
26
|
+
* Used to initialize CustomerAuth on Client.
|
|
27
27
|
*/
|
|
28
28
|
customer?: {
|
|
29
29
|
/**
|
|
@@ -42,7 +42,7 @@ interface ClientBrowserConfig {
|
|
|
42
42
|
onTokenChange?: (token: string | null) => void;
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
interface ClientServerConfig extends
|
|
45
|
+
interface ClientServerConfig extends ClientConfig {
|
|
46
46
|
secretKey: string;
|
|
47
47
|
}
|
|
48
48
|
interface ClientMetadata {
|
|
@@ -451,7 +451,7 @@ declare class CollectionClient extends HttpClient {
|
|
|
451
451
|
|
|
452
452
|
/**
|
|
453
453
|
* Read-only subset of CollectionQueryBuilder.
|
|
454
|
-
*
|
|
454
|
+
* Client.from() returns this type to prevent write operations at compile time.
|
|
455
455
|
*/
|
|
456
456
|
type ReadOnlyQueryBuilder<T extends PublicCollection> = Pick<CollectionQueryBuilder<T>, 'find' | 'findById' | 'count' | 'findMetadata' | 'findMetadataById'>;
|
|
457
457
|
declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
@@ -585,7 +585,7 @@ interface CustomerAuthOptions {
|
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
/**
|
|
588
|
-
* Customer authentication client
|
|
588
|
+
* Customer authentication client.
|
|
589
589
|
*
|
|
590
590
|
* Manages customer registration, login, logout, and token lifecycle.
|
|
591
591
|
* All requests include X-Client-Key for tenant resolution.
|
|
@@ -894,21 +894,26 @@ declare class QueryHooks extends CollectionHooks {
|
|
|
894
894
|
setCustomerData: CustomerHooks['setCustomerData'];
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
declare class
|
|
897
|
+
declare class Client {
|
|
898
898
|
cart: CartApi;
|
|
899
899
|
query: ReadOnlyQueryHooks;
|
|
900
900
|
collections: CollectionClient;
|
|
901
901
|
queryClient: QueryClient;
|
|
902
902
|
customer: CustomerAuth;
|
|
903
903
|
protected state: ClientState;
|
|
904
|
-
protected config:
|
|
904
|
+
protected config: ClientConfig;
|
|
905
905
|
protected baseUrl: string;
|
|
906
|
-
constructor(options:
|
|
906
|
+
constructor(options: ClientConfig);
|
|
907
907
|
from<T extends PublicCollection>(collection: T): ReadOnlyQueryBuilder<T>;
|
|
908
908
|
getState(): ClientState;
|
|
909
|
-
getConfig():
|
|
909
|
+
getConfig(): ClientConfig;
|
|
910
910
|
}
|
|
911
|
-
|
|
911
|
+
/**
|
|
912
|
+
* Create an SDK client. Works in both browser and server environments.
|
|
913
|
+
* Read-only collection queries + customer auth (cart, login, profile).
|
|
914
|
+
* Use `createServerClient()` when you need full CRUD with secretKey.
|
|
915
|
+
*/
|
|
916
|
+
declare function createClient(options: ClientConfig): Client;
|
|
912
917
|
|
|
913
918
|
declare class ServerClient {
|
|
914
919
|
api: OrderApi;
|
|
@@ -923,8 +928,12 @@ declare class ServerClient {
|
|
|
923
928
|
constructor(options: ClientServerConfig);
|
|
924
929
|
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
925
930
|
getState(): ClientState;
|
|
926
|
-
getConfig():
|
|
931
|
+
getConfig(): ClientConfig;
|
|
927
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* Create a server-only client with full read/write access. Requires secretKey.
|
|
935
|
+
* For read-only usage, prefer `createClient()` (no secretKey needed).
|
|
936
|
+
*/
|
|
928
937
|
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
929
938
|
|
|
930
939
|
declare function getQueryClient(): QueryClient;
|
|
@@ -947,4 +956,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
947
956
|
*/
|
|
948
957
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
949
958
|
|
|
950
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApiQueryReactOptions, type ApplyDiscountParams, BaseApi,
|
|
959
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApiQueryReactOptions, type ApplyDiscountParams, BaseApi, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, Client, type ClientConfig, type ClientMetadata, type ClientServerConfig, type ClientState, Client as ClientType, CollectionClient, type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, ConfigError, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, Exchange, type ExtractArrayType, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, GoneError, NetworkError, Order, OrderApi, type OrderApiOptions, OrderProduct, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, Return, type ReturnProductItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServiceUnavailableError, type StockCheckParams, type StockCheckResponse, type StockCheckResult, TimeoutError, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, collectionKeys, createClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, isApiError, isConfigError, isGoneError, isNetworkError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, resolveApiUrl, resolveRelation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export { o as ApiUsage,
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-mZpmjJBz.js';
|
|
2
|
+
export { o as ApiUsage, au as ApiUsageSelect, A as Audience, aq as AudiencesSelect, bs as Auth, q as BillingHistory, aw as BillingHistorySelect, y as Brand, B as BrandLogo, aF as BrandLogosSelect, aE as BrandsSelect, aV as CartItemsSelect, aU as CartsSelect, g as CodeBlock, br as CollectionsWidget, C as Config, G as Customer, J as CustomerAddress, aS as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, aT as CustomerGroupsSelect, aR as CustomersSelect, W as Discount, aW as DiscountsSelect, $ as Document, b0 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, b1 as DocumentTypesSelect, a$ as DocumentsSelect, m as EmailLog, ar as EmailLogsSelect, N as ExchangeProduct, aP as ExchangeProductsSelect, aO as ExchangesSelect, j as FieldConfig, an as FieldConfigsSelect, ac as Flow, bf as FlowCategoriesSelect, ad as FlowCategory, ag as FlowEdgeType, be as FlowEdgeTypesSelect, af as FlowNodeType, bd as FlowNodeTypesSelect, ae as FlowTag, bg as FlowTagsSelect, bc as FlowsSelect, F as Form, ah as FormSubmission, bm as FormSubmissionsSelect, bl as FormsSelect, K as FulfillmentItem, aL as FulfillmentItemsSelect, aK as FulfillmentsSelect, b8 as GalleriesSelect, a8 as Gallery, b9 as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bb as GalleryItemsSelect, aa as GalleryTag, ba as GalleryTagsSelect, I as IframeBlock, k as Image, ao as ImagesSelect, L as LiveStream, bk as LiveStreamsSelect, a5 as Music, b6 as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, b7 as MusicTagsSelect, b5 as MusicsSelect, aH as OrderProductsSelect, Q as OrderStatusLog, aJ as OrderStatusLogsSelect, aG as OrdersSelect, ai as PayloadKv, bn as PayloadKvSelect, aj as PayloadLockedDocument, bo as PayloadLockedDocumentsSelect, al as PayloadMigration, bq as PayloadMigrationsSelect, ak as PayloadPreference, bp as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, b3 as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, b4 as PlaylistTagsSelect, b2 as PlaylistsSelect, X as Post, Y as PostAuthor, aY as PostAuthorsSelect, aZ as PostCategoriesSelect, Z as PostCategory, _ as PostTag, a_ as PostTagsSelect, aX as PostsSelect, aB as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aD as ProductCollectionsSelect, v as ProductOption, aA as ProductOptionsSelect, x as ProductTag, aC as ProductTagsSelect, u as ProductVariant, az as ProductVariantsSelect, ay as ProductsSelect, M as ReturnProduct, aN as ReturnProductsSelect, aM as ReturnsSelect, aQ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, av as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, ap as SystemMediaSelect, i as Tenant, r as TenantLogo, ax as TenantLogosSelect, at as TenantMetadataSelect, n as TenantMetadatum, as as TenantsSelect, aI as TransactionsSelect, h as User, U as UserAuthOperations, am as UsersSelect, V as Video, bi as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bj as VideoTagsSelect, bh as VideosSelect } from './payload-types-mZpmjJBz.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as PublicCollection } from './const-ikSyKVND.js';
|
|
7
|
-
export { a as COLLECTIONS, C as Collection } from './const-ikSyKVND.js';
|
|
8
6
|
import { Metadata } from 'next';
|
|
9
|
-
import {
|
|
10
|
-
export { a as
|
|
7
|
+
import { P as PublicCollection } from './const-BO4SPN7f.js';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-BO4SPN7f.js';
|
|
9
|
+
import { C as CollectionType } from './webhook-CMi4JRCp.js';
|
|
10
|
+
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-CMi4JRCp.js';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-DupPIYx-.js';
|
|
12
12
|
export { b as IMAGE_SIZES, I as ImageData, a as ImagePalette, f as ImagePlaceholderOptions, d as getImageLqip, e as getImagePalette, h as getImagePlaceholderStyle, c as getImageSrcSet, g as getImageUrl } from './image-TT8lTsk5.js';
|
|
13
13
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from './video-DbLL8yuc.js';
|
|
@@ -19,11 +19,11 @@ export { JwtPayload, createApiKey, createServerToken, decodeServerToken, parseAp
|
|
|
19
19
|
* 빌드 시 버전에 따라 기본값 결정: dev 빌드 → api-dev, 정식 → api.01.software
|
|
20
20
|
*/
|
|
21
21
|
declare function resolveApiUrl(): string;
|
|
22
|
-
interface
|
|
22
|
+
interface ClientConfig {
|
|
23
23
|
clientKey: string;
|
|
24
24
|
/**
|
|
25
25
|
* Customer authentication options.
|
|
26
|
-
* Used to initialize CustomerAuth on
|
|
26
|
+
* Used to initialize CustomerAuth on Client.
|
|
27
27
|
*/
|
|
28
28
|
customer?: {
|
|
29
29
|
/**
|
|
@@ -42,7 +42,7 @@ interface ClientBrowserConfig {
|
|
|
42
42
|
onTokenChange?: (token: string | null) => void;
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
interface ClientServerConfig extends
|
|
45
|
+
interface ClientServerConfig extends ClientConfig {
|
|
46
46
|
secretKey: string;
|
|
47
47
|
}
|
|
48
48
|
interface ClientMetadata {
|
|
@@ -451,7 +451,7 @@ declare class CollectionClient extends HttpClient {
|
|
|
451
451
|
|
|
452
452
|
/**
|
|
453
453
|
* Read-only subset of CollectionQueryBuilder.
|
|
454
|
-
*
|
|
454
|
+
* Client.from() returns this type to prevent write operations at compile time.
|
|
455
455
|
*/
|
|
456
456
|
type ReadOnlyQueryBuilder<T extends PublicCollection> = Pick<CollectionQueryBuilder<T>, 'find' | 'findById' | 'count' | 'findMetadata' | 'findMetadataById'>;
|
|
457
457
|
declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
@@ -585,7 +585,7 @@ interface CustomerAuthOptions {
|
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
/**
|
|
588
|
-
* Customer authentication client
|
|
588
|
+
* Customer authentication client.
|
|
589
589
|
*
|
|
590
590
|
* Manages customer registration, login, logout, and token lifecycle.
|
|
591
591
|
* All requests include X-Client-Key for tenant resolution.
|
|
@@ -894,21 +894,26 @@ declare class QueryHooks extends CollectionHooks {
|
|
|
894
894
|
setCustomerData: CustomerHooks['setCustomerData'];
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
declare class
|
|
897
|
+
declare class Client {
|
|
898
898
|
cart: CartApi;
|
|
899
899
|
query: ReadOnlyQueryHooks;
|
|
900
900
|
collections: CollectionClient;
|
|
901
901
|
queryClient: QueryClient;
|
|
902
902
|
customer: CustomerAuth;
|
|
903
903
|
protected state: ClientState;
|
|
904
|
-
protected config:
|
|
904
|
+
protected config: ClientConfig;
|
|
905
905
|
protected baseUrl: string;
|
|
906
|
-
constructor(options:
|
|
906
|
+
constructor(options: ClientConfig);
|
|
907
907
|
from<T extends PublicCollection>(collection: T): ReadOnlyQueryBuilder<T>;
|
|
908
908
|
getState(): ClientState;
|
|
909
|
-
getConfig():
|
|
909
|
+
getConfig(): ClientConfig;
|
|
910
910
|
}
|
|
911
|
-
|
|
911
|
+
/**
|
|
912
|
+
* Create an SDK client. Works in both browser and server environments.
|
|
913
|
+
* Read-only collection queries + customer auth (cart, login, profile).
|
|
914
|
+
* Use `createServerClient()` when you need full CRUD with secretKey.
|
|
915
|
+
*/
|
|
916
|
+
declare function createClient(options: ClientConfig): Client;
|
|
912
917
|
|
|
913
918
|
declare class ServerClient {
|
|
914
919
|
api: OrderApi;
|
|
@@ -923,8 +928,12 @@ declare class ServerClient {
|
|
|
923
928
|
constructor(options: ClientServerConfig);
|
|
924
929
|
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
925
930
|
getState(): ClientState;
|
|
926
|
-
getConfig():
|
|
931
|
+
getConfig(): ClientConfig;
|
|
927
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* Create a server-only client with full read/write access. Requires secretKey.
|
|
935
|
+
* For read-only usage, prefer `createClient()` (no secretKey needed).
|
|
936
|
+
*/
|
|
928
937
|
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
929
938
|
|
|
930
939
|
declare function getQueryClient(): QueryClient;
|
|
@@ -947,4 +956,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
947
956
|
*/
|
|
948
957
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
949
958
|
|
|
950
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApiQueryReactOptions, type ApplyDiscountParams, BaseApi,
|
|
959
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApiQueryReactOptions, type ApplyDiscountParams, BaseApi, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, Client, type ClientConfig, type ClientMetadata, type ClientServerConfig, type ClientState, Client as ClientType, CollectionClient, type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, ConfigError, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, Exchange, type ExtractArrayType, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, GoneError, NetworkError, Order, OrderApi, type OrderApiOptions, OrderProduct, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, Return, type ReturnProductItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServiceUnavailableError, type StockCheckParams, type StockCheckResponse, type StockCheckResult, TimeoutError, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, collectionKeys, createClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, isApiError, isConfigError, isGoneError, isNetworkError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, resolveApiUrl, resolveRelation };
|
package/dist/index.js
CHANGED
|
@@ -1260,6 +1260,8 @@ var COLLECTIONS = [
|
|
|
1260
1260
|
"playlist-categories",
|
|
1261
1261
|
"playlist-tags",
|
|
1262
1262
|
"musics",
|
|
1263
|
+
"music-categories",
|
|
1264
|
+
"music-tags",
|
|
1263
1265
|
"galleries",
|
|
1264
1266
|
"gallery-categories",
|
|
1265
1267
|
"gallery-tags",
|
|
@@ -1871,7 +1873,7 @@ var CustomerHooks = class {
|
|
|
1871
1873
|
ensureCustomerAuth() {
|
|
1872
1874
|
if (!this.customerAuth) {
|
|
1873
1875
|
throw createConfigError(
|
|
1874
|
-
"Customer hooks require
|
|
1876
|
+
"Customer hooks require Client. Use createClient() instead of createServerClient()."
|
|
1875
1877
|
);
|
|
1876
1878
|
}
|
|
1877
1879
|
return this.customerAuth;
|
|
@@ -1995,7 +1997,7 @@ var QueryHooks = class extends CollectionHooks {
|
|
|
1995
1997
|
};
|
|
1996
1998
|
|
|
1997
1999
|
// src/core/client/client.ts
|
|
1998
|
-
var
|
|
2000
|
+
var Client = class {
|
|
1999
2001
|
constructor(options) {
|
|
2000
2002
|
var _a;
|
|
2001
2003
|
if (!options.clientKey) {
|
|
@@ -2052,8 +2054,8 @@ var BrowserClient = class {
|
|
|
2052
2054
|
return __spreadValues({}, this.config);
|
|
2053
2055
|
}
|
|
2054
2056
|
};
|
|
2055
|
-
function
|
|
2056
|
-
return new
|
|
2057
|
+
function createClient(options) {
|
|
2058
|
+
return new Client(options);
|
|
2057
2059
|
}
|
|
2058
2060
|
|
|
2059
2061
|
// src/core/client/client.server.ts
|
|
@@ -2061,7 +2063,7 @@ var ServerClient = class {
|
|
|
2061
2063
|
constructor(options) {
|
|
2062
2064
|
if (typeof window !== "undefined") {
|
|
2063
2065
|
throw createConfigError(
|
|
2064
|
-
"ServerClient must not be used in a browser environment. This risks exposing your secretKey in client bundles. Use
|
|
2066
|
+
"ServerClient must not be used in a browser environment. This risks exposing your secretKey in client bundles. Use createClient() for browser code instead."
|
|
2065
2067
|
);
|
|
2066
2068
|
}
|
|
2067
2069
|
if (!options.clientKey) {
|
|
@@ -2465,9 +2467,9 @@ function getVideoMp4Url(playbackId, resolution = "high") {
|
|
|
2465
2467
|
export {
|
|
2466
2468
|
ApiError,
|
|
2467
2469
|
BaseApi,
|
|
2468
|
-
BrowserClient,
|
|
2469
2470
|
COLLECTIONS,
|
|
2470
2471
|
CartApi,
|
|
2472
|
+
Client,
|
|
2471
2473
|
CollectionClient,
|
|
2472
2474
|
CollectionHooks,
|
|
2473
2475
|
CollectionQueryBuilder,
|
|
@@ -2489,7 +2491,7 @@ export {
|
|
|
2489
2491
|
ValidationError,
|
|
2490
2492
|
collectionKeys,
|
|
2491
2493
|
createApiKey,
|
|
2492
|
-
|
|
2494
|
+
createClient,
|
|
2493
2495
|
createServerClient,
|
|
2494
2496
|
createServerToken,
|
|
2495
2497
|
createTypedWebhookHandler,
|