@01.software/sdk 0.7.0 → 0.8.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 +38 -0
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/const-CCh99Gxu.d.ts +19 -0
- package/dist/const-dv0zuAxG.d.cts +19 -0
- package/dist/index.cjs +9 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -37
- package/dist/index.d.ts +32 -37
- package/dist/index.js +9 -16
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-CFDtFiSz.d.cts → payload-types-FfZ2Zxp1.d.cts} +801 -450
- package/dist/{payload-types-CFDtFiSz.d.ts → payload-types-FfZ2Zxp1.d.ts} +801 -450
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.cjs +1 -1
- package/dist/ui/video.cjs.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/ui/video.js +1 -1
- package/dist/ui/video.js.map +1 -1
- package/dist/{webhook-BB8amLBv.d.ts → webhook-B9MDrH22.d.ts} +2 -2
- package/dist/{webhook-CrBjPpUT.d.cts → webhook-t7JGFLKQ.d.cts} +2 -2
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +3 -3
- package/dist/const-6BfmvZug.d.cts +0 -19
- package/dist/const-DQYzabjw.d.ts +0 -19
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as
|
|
2
|
-
export {
|
|
1
|
+
import { O as Order, a as OrderItem$1, T as Transaction, b as Fulfillment, R as Return, c as Cart, d as CartItem, P as Product } from './payload-types-FfZ2Zxp1.cjs';
|
|
2
|
+
export { n as ApiUsage, aE as ApiUsageSelect, A as Audience, aA as AudiencesSelect, bM as Auth, p as BillingHistory, aG as BillingHistorySelect, ao as Bookmark, bB as BookmarksSelect, y as Brand, B as BrandLogo, aQ as BrandLogosSelect, aP as BrandsSelect, br as CanvasCategoriesSelect, af as CanvasCategory, ai as CanvasEdgeType, bq as CanvasEdgeTypesSelect, ah as CanvasNodeType, bp as CanvasNodeTypesSelect, ag as CanvasTag, bs as CanvasTagsSelect, ae as Canvase, bo as CanvasesSelect, b2 as CartItemsSelect, b1 as CartsSelect, g as CodeBlock, bL as CollectionsWidget, al as Comment, by as CommentsSelect, aq as CommunityBan, bE as CommunityBansSelect, C as Config, G as Customer, J as CustomerAddress, a$ as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, b0 as CustomerGroupsSelect, a_ as CustomersSelect, Q as Discount, b3 as DiscountsSelect, _ as Document, b9 as DocumentCategoriesSelect, a0 as DocumentCategory, $ as DocumentType, ba as DocumentTypesSelect, b8 as DocumentsSelect, E as EmailLog, aB as EmailLogsSelect, k as FieldConfig, ax as FieldConfigsSelect, F as Form, ar as FormSubmission, bG as FormSubmissionsSelect, bF as FormsSelect, K as FulfillmentItem, aW as FulfillmentItemsSelect, aV as FulfillmentsSelect, bh as GalleriesSelect, a7 as Gallery, bi as GalleryCategoriesSelect, a8 as GalleryCategory, aa as GalleryItem, bk as GalleryItemsSelect, a9 as GalleryTag, bj as GalleryTagsSelect, I as IframeBlock, j as Image, ay as ImagesSelect, ab as Link, bm as LinkCategoriesSelect, ac as LinkCategory, ad as LinkTag, bn as LinkTagsSelect, bl as LinksSelect, L as LiveStream, bw as LiveStreamsSelect, a4 as Music, bf as MusicCategoriesSelect, a5 as MusicCategory, a6 as MusicTag, bg as MusicTagsSelect, be as MusicsSelect, aS as OrderItemsSelect, N as OrderStatusLog, aU as OrderStatusLogsSelect, aR as OrdersSelect, as as PayloadKv, bH as PayloadKvSelect, at as PayloadLockedDocument, bI as PayloadLockedDocumentsSelect, av as PayloadMigration, bK as PayloadMigrationsSelect, au as PayloadPreference, bJ as PayloadPreferencesSelect, f as PlayerBlock, a1 as Playlist, bc as PlaylistCategoriesSelect, a2 as PlaylistCategory, a3 as PlaylistTag, bd as PlaylistTagsSelect, bb as PlaylistsSelect, W as Post, X as PostAuthor, b5 as PostAuthorsSelect, b6 as PostCategoriesSelect, Y as PostCategory, Z as PostTag, b7 as PostTagsSelect, b4 as PostsSelect, aM as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aO as ProductCollectionsSelect, v as ProductOption, u as ProductOptionValue, aL as ProductOptionValuesSelect, aK as ProductOptionsSelect, x as ProductTag, aN as ProductTagsSelect, t as ProductVariant, aJ as ProductVariantsSelect, aI as ProductsSelect, am as Reaction, an as ReactionType, bA as ReactionTypesSelect, bz as ReactionsSelect, ap as Report, bD as ReportsSelect, M as ReturnItem, aY as ReturnItemsSelect, aX as ReturnsSelect, aZ as ShippingPoliciesSelect, z as ShippingPolicy, o as Subscription, aF as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, az as SystemMediaSelect, i as Tenant, q as TenantLogo, aH as TenantLogosSelect, aD as TenantMetadataSelect, m as TenantMetadatum, aC as TenantsSelect, aj as Thread, bC as ThreadCategoriesSelect, ak as ThreadCategory, bx as ThreadsSelect, aT as TransactionsSelect, h as User, U as UserAuthOperations, aw as UsersSelect, V as Video, bu as VideoCategoriesSelect, r as VideoCategory, s as VideoTag, bv as VideoTagsSelect, bt as VideosSelect } from './payload-types-FfZ2Zxp1.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { P as PublicCollection } from './const-
|
|
8
|
-
export { a as COLLECTIONS, C as Collection } from './const-
|
|
9
|
-
import { C as CollectionType } from './webhook-
|
|
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-
|
|
7
|
+
import { P as PublicCollection } from './const-dv0zuAxG.cjs';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-dv0zuAxG.cjs';
|
|
9
|
+
import { C as CollectionType } from './webhook-t7JGFLKQ.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-t7JGFLKQ.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';
|
|
@@ -147,7 +147,7 @@ type CustomerSnapshot = {
|
|
|
147
147
|
};
|
|
148
148
|
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
|
|
149
149
|
type ReturnProductItem = {
|
|
150
|
-
|
|
150
|
+
orderItem: string;
|
|
151
151
|
quantity: number;
|
|
152
152
|
};
|
|
153
153
|
type CreateOrderParams = {
|
|
@@ -155,7 +155,7 @@ type CreateOrderParams = {
|
|
|
155
155
|
customer?: string;
|
|
156
156
|
customerSnapshot: CustomerSnapshot;
|
|
157
157
|
shippingAddress: Order['shippingAddress'];
|
|
158
|
-
orderProducts: Pick<
|
|
158
|
+
orderProducts: Pick<OrderItem$1, 'product' | 'variant' | 'quantity' | 'unitPrice' | 'totalPrice'>[];
|
|
159
159
|
totalAmount: number;
|
|
160
160
|
shippingFee?: number;
|
|
161
161
|
paymentId?: string;
|
|
@@ -198,18 +198,19 @@ type CalculateShippingParams = {
|
|
|
198
198
|
};
|
|
199
199
|
type CalculateShippingResult = {
|
|
200
200
|
shippingFee: number;
|
|
201
|
-
|
|
201
|
+
baseAmount: number;
|
|
202
202
|
extraFee: number;
|
|
203
203
|
freeShipping: boolean;
|
|
204
|
-
|
|
204
|
+
freeShippingMinAmount: number | null;
|
|
205
205
|
isJeju: boolean;
|
|
206
|
+
isRemoteIsland: boolean;
|
|
206
207
|
};
|
|
207
208
|
type CreateFulfillmentParams = {
|
|
208
209
|
orderNumber: string;
|
|
209
210
|
carrier?: string;
|
|
210
211
|
trackingNumber?: string;
|
|
211
212
|
items: Array<{
|
|
212
|
-
|
|
213
|
+
orderItem: string;
|
|
213
214
|
quantity: number;
|
|
214
215
|
}>;
|
|
215
216
|
};
|
|
@@ -242,19 +243,6 @@ type ReturnWithRefundParams = {
|
|
|
242
243
|
paymentId: string;
|
|
243
244
|
refundReceiptUrl?: string;
|
|
244
245
|
};
|
|
245
|
-
type CreateExchangeParams = {
|
|
246
|
-
orderNumber: string;
|
|
247
|
-
reason?: 'wrong_size' | 'wrong_color' | 'defective' | 'other';
|
|
248
|
-
reasonDetail?: string;
|
|
249
|
-
exchangeProducts: Array<{
|
|
250
|
-
orderProduct: string;
|
|
251
|
-
quantity: number;
|
|
252
|
-
}>;
|
|
253
|
-
};
|
|
254
|
-
type UpdateExchangeParams = {
|
|
255
|
-
exchangeId: string;
|
|
256
|
-
status: 'processing' | 'shipped' | 'completed' | 'rejected';
|
|
257
|
-
};
|
|
258
246
|
declare class OrderApi extends BaseApi {
|
|
259
247
|
constructor(options: OrderApiOptions);
|
|
260
248
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
@@ -272,8 +260,6 @@ declare class OrderApi extends BaseApi {
|
|
|
272
260
|
updateReturn(params: UpdateReturnParams): Promise<Return>;
|
|
273
261
|
validateDiscount(params: ValidateDiscountParams): Promise<ValidateDiscountResult>;
|
|
274
262
|
calculateShipping(params: CalculateShippingParams): Promise<CalculateShippingResult>;
|
|
275
|
-
createExchange(params: CreateExchangeParams): Promise<Exchange>;
|
|
276
|
-
updateExchange(params: UpdateExchangeParams): Promise<Exchange>;
|
|
277
263
|
}
|
|
278
264
|
|
|
279
265
|
interface CartApiOptions {
|
|
@@ -331,12 +317,12 @@ declare class CartApi {
|
|
|
331
317
|
type ProductApiOptions = ServerApiOptions;
|
|
332
318
|
type StockCheckParams = {
|
|
333
319
|
items: Array<{
|
|
334
|
-
|
|
320
|
+
variantId: string;
|
|
335
321
|
quantity: number;
|
|
336
322
|
}>;
|
|
337
323
|
};
|
|
338
324
|
type StockCheckResult = {
|
|
339
|
-
|
|
325
|
+
variantId: string;
|
|
340
326
|
available: boolean;
|
|
341
327
|
availableStock: number;
|
|
342
328
|
requestedQuantity: number;
|
|
@@ -555,10 +541,10 @@ interface Thread {
|
|
|
555
541
|
}
|
|
556
542
|
interface Comment {
|
|
557
543
|
id: string;
|
|
558
|
-
|
|
544
|
+
body: string;
|
|
559
545
|
thread?: string;
|
|
560
546
|
parent?: string;
|
|
561
|
-
|
|
547
|
+
rootComment?: string;
|
|
562
548
|
createdAt?: string;
|
|
563
549
|
updatedAt?: string;
|
|
564
550
|
[key: string]: unknown;
|
|
@@ -648,18 +634,18 @@ declare class CommunityClient {
|
|
|
648
634
|
}>;
|
|
649
635
|
createComment(params: {
|
|
650
636
|
threadId: string;
|
|
651
|
-
|
|
637
|
+
body: string;
|
|
652
638
|
parentId?: string;
|
|
653
639
|
}): Promise<Comment>;
|
|
654
640
|
listComments(params: {
|
|
655
641
|
threadId: string;
|
|
656
642
|
page?: number;
|
|
657
643
|
limit?: number;
|
|
658
|
-
|
|
644
|
+
rootComment?: string;
|
|
659
645
|
}): Promise<PaginatedResponse<Comment>>;
|
|
660
646
|
updateComment(params: {
|
|
661
647
|
commentId: string;
|
|
662
|
-
|
|
648
|
+
body: string;
|
|
663
649
|
}): Promise<Comment>;
|
|
664
650
|
deleteComment(params: {
|
|
665
651
|
commentId: string;
|
|
@@ -726,6 +712,15 @@ interface CustomerAuthResponse {
|
|
|
726
712
|
token: string;
|
|
727
713
|
customer: CustomerProfile;
|
|
728
714
|
}
|
|
715
|
+
interface MarketingConsentChannel {
|
|
716
|
+
isConsented?: boolean;
|
|
717
|
+
}
|
|
718
|
+
interface MarketingConsent {
|
|
719
|
+
email?: MarketingConsentChannel;
|
|
720
|
+
sms?: MarketingConsentChannel;
|
|
721
|
+
push?: MarketingConsentChannel;
|
|
722
|
+
consentSource?: string;
|
|
723
|
+
}
|
|
729
724
|
interface CustomerProfile {
|
|
730
725
|
id: string;
|
|
731
726
|
name: string;
|
|
@@ -733,8 +728,8 @@ interface CustomerProfile {
|
|
|
733
728
|
phone?: string | null;
|
|
734
729
|
authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
|
|
735
730
|
isGuest?: boolean | null;
|
|
736
|
-
|
|
737
|
-
marketingConsent?:
|
|
731
|
+
isEmailVerified?: boolean | null;
|
|
732
|
+
marketingConsent?: MarketingConsent | null;
|
|
738
733
|
metadata?: Record<string, unknown> | null;
|
|
739
734
|
groups?: string[];
|
|
740
735
|
}
|
|
@@ -759,7 +754,7 @@ interface CustomerRefreshResponse {
|
|
|
759
754
|
interface UpdateProfileData {
|
|
760
755
|
name?: string;
|
|
761
756
|
phone?: string;
|
|
762
|
-
marketingConsent?:
|
|
757
|
+
marketingConsent?: MarketingConsent;
|
|
763
758
|
}
|
|
764
759
|
interface CustomerAuthOptions {
|
|
765
760
|
/**
|
|
@@ -1167,4 +1162,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1167
1162
|
*/
|
|
1168
1163
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1169
1164
|
|
|
1170
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, 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, CommunityClient, type CommunityClientOptions, ConfigError, type
|
|
1165
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, 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, CommunityClient, type CommunityClientOptions, ConfigError, 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, type ExtractArrayType, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, GoneError, type InfiniteQueryOptions, NetworkError, Order, OrderApi, type OrderApiOptions, OrderItem$1 as OrderItem, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type QueryOptions, 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, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, Transaction, 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
|
|
2
|
-
export {
|
|
1
|
+
import { O as Order, a as OrderItem$1, T as Transaction, b as Fulfillment, R as Return, c as Cart, d as CartItem, P as Product } from './payload-types-FfZ2Zxp1.js';
|
|
2
|
+
export { n as ApiUsage, aE as ApiUsageSelect, A as Audience, aA as AudiencesSelect, bM as Auth, p as BillingHistory, aG as BillingHistorySelect, ao as Bookmark, bB as BookmarksSelect, y as Brand, B as BrandLogo, aQ as BrandLogosSelect, aP as BrandsSelect, br as CanvasCategoriesSelect, af as CanvasCategory, ai as CanvasEdgeType, bq as CanvasEdgeTypesSelect, ah as CanvasNodeType, bp as CanvasNodeTypesSelect, ag as CanvasTag, bs as CanvasTagsSelect, ae as Canvase, bo as CanvasesSelect, b2 as CartItemsSelect, b1 as CartsSelect, g as CodeBlock, bL as CollectionsWidget, al as Comment, by as CommentsSelect, aq as CommunityBan, bE as CommunityBansSelect, C as Config, G as Customer, J as CustomerAddress, a$ as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, b0 as CustomerGroupsSelect, a_ as CustomersSelect, Q as Discount, b3 as DiscountsSelect, _ as Document, b9 as DocumentCategoriesSelect, a0 as DocumentCategory, $ as DocumentType, ba as DocumentTypesSelect, b8 as DocumentsSelect, E as EmailLog, aB as EmailLogsSelect, k as FieldConfig, ax as FieldConfigsSelect, F as Form, ar as FormSubmission, bG as FormSubmissionsSelect, bF as FormsSelect, K as FulfillmentItem, aW as FulfillmentItemsSelect, aV as FulfillmentsSelect, bh as GalleriesSelect, a7 as Gallery, bi as GalleryCategoriesSelect, a8 as GalleryCategory, aa as GalleryItem, bk as GalleryItemsSelect, a9 as GalleryTag, bj as GalleryTagsSelect, I as IframeBlock, j as Image, ay as ImagesSelect, ab as Link, bm as LinkCategoriesSelect, ac as LinkCategory, ad as LinkTag, bn as LinkTagsSelect, bl as LinksSelect, L as LiveStream, bw as LiveStreamsSelect, a4 as Music, bf as MusicCategoriesSelect, a5 as MusicCategory, a6 as MusicTag, bg as MusicTagsSelect, be as MusicsSelect, aS as OrderItemsSelect, N as OrderStatusLog, aU as OrderStatusLogsSelect, aR as OrdersSelect, as as PayloadKv, bH as PayloadKvSelect, at as PayloadLockedDocument, bI as PayloadLockedDocumentsSelect, av as PayloadMigration, bK as PayloadMigrationsSelect, au as PayloadPreference, bJ as PayloadPreferencesSelect, f as PlayerBlock, a1 as Playlist, bc as PlaylistCategoriesSelect, a2 as PlaylistCategory, a3 as PlaylistTag, bd as PlaylistTagsSelect, bb as PlaylistsSelect, W as Post, X as PostAuthor, b5 as PostAuthorsSelect, b6 as PostCategoriesSelect, Y as PostCategory, Z as PostTag, b7 as PostTagsSelect, b4 as PostsSelect, aM as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aO as ProductCollectionsSelect, v as ProductOption, u as ProductOptionValue, aL as ProductOptionValuesSelect, aK as ProductOptionsSelect, x as ProductTag, aN as ProductTagsSelect, t as ProductVariant, aJ as ProductVariantsSelect, aI as ProductsSelect, am as Reaction, an as ReactionType, bA as ReactionTypesSelect, bz as ReactionsSelect, ap as Report, bD as ReportsSelect, M as ReturnItem, aY as ReturnItemsSelect, aX as ReturnsSelect, aZ as ShippingPoliciesSelect, z as ShippingPolicy, o as Subscription, aF as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, az as SystemMediaSelect, i as Tenant, q as TenantLogo, aH as TenantLogosSelect, aD as TenantMetadataSelect, m as TenantMetadatum, aC as TenantsSelect, aj as Thread, bC as ThreadCategoriesSelect, ak as ThreadCategory, bx as ThreadsSelect, aT as TransactionsSelect, h as User, U as UserAuthOperations, aw as UsersSelect, V as Video, bu as VideoCategoriesSelect, r as VideoCategory, s as VideoTag, bv as VideoTagsSelect, bt as VideosSelect } from './payload-types-FfZ2Zxp1.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { P as PublicCollection } from './const-
|
|
8
|
-
export { a as COLLECTIONS, C as Collection } from './const-
|
|
9
|
-
import { C as CollectionType } from './webhook-
|
|
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-
|
|
7
|
+
import { P as PublicCollection } from './const-CCh99Gxu.js';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-CCh99Gxu.js';
|
|
9
|
+
import { C as CollectionType } from './webhook-B9MDrH22.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-B9MDrH22.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';
|
|
@@ -147,7 +147,7 @@ type CustomerSnapshot = {
|
|
|
147
147
|
};
|
|
148
148
|
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
|
|
149
149
|
type ReturnProductItem = {
|
|
150
|
-
|
|
150
|
+
orderItem: string;
|
|
151
151
|
quantity: number;
|
|
152
152
|
};
|
|
153
153
|
type CreateOrderParams = {
|
|
@@ -155,7 +155,7 @@ type CreateOrderParams = {
|
|
|
155
155
|
customer?: string;
|
|
156
156
|
customerSnapshot: CustomerSnapshot;
|
|
157
157
|
shippingAddress: Order['shippingAddress'];
|
|
158
|
-
orderProducts: Pick<
|
|
158
|
+
orderProducts: Pick<OrderItem$1, 'product' | 'variant' | 'quantity' | 'unitPrice' | 'totalPrice'>[];
|
|
159
159
|
totalAmount: number;
|
|
160
160
|
shippingFee?: number;
|
|
161
161
|
paymentId?: string;
|
|
@@ -198,18 +198,19 @@ type CalculateShippingParams = {
|
|
|
198
198
|
};
|
|
199
199
|
type CalculateShippingResult = {
|
|
200
200
|
shippingFee: number;
|
|
201
|
-
|
|
201
|
+
baseAmount: number;
|
|
202
202
|
extraFee: number;
|
|
203
203
|
freeShipping: boolean;
|
|
204
|
-
|
|
204
|
+
freeShippingMinAmount: number | null;
|
|
205
205
|
isJeju: boolean;
|
|
206
|
+
isRemoteIsland: boolean;
|
|
206
207
|
};
|
|
207
208
|
type CreateFulfillmentParams = {
|
|
208
209
|
orderNumber: string;
|
|
209
210
|
carrier?: string;
|
|
210
211
|
trackingNumber?: string;
|
|
211
212
|
items: Array<{
|
|
212
|
-
|
|
213
|
+
orderItem: string;
|
|
213
214
|
quantity: number;
|
|
214
215
|
}>;
|
|
215
216
|
};
|
|
@@ -242,19 +243,6 @@ type ReturnWithRefundParams = {
|
|
|
242
243
|
paymentId: string;
|
|
243
244
|
refundReceiptUrl?: string;
|
|
244
245
|
};
|
|
245
|
-
type CreateExchangeParams = {
|
|
246
|
-
orderNumber: string;
|
|
247
|
-
reason?: 'wrong_size' | 'wrong_color' | 'defective' | 'other';
|
|
248
|
-
reasonDetail?: string;
|
|
249
|
-
exchangeProducts: Array<{
|
|
250
|
-
orderProduct: string;
|
|
251
|
-
quantity: number;
|
|
252
|
-
}>;
|
|
253
|
-
};
|
|
254
|
-
type UpdateExchangeParams = {
|
|
255
|
-
exchangeId: string;
|
|
256
|
-
status: 'processing' | 'shipped' | 'completed' | 'rejected';
|
|
257
|
-
};
|
|
258
246
|
declare class OrderApi extends BaseApi {
|
|
259
247
|
constructor(options: OrderApiOptions);
|
|
260
248
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
@@ -272,8 +260,6 @@ declare class OrderApi extends BaseApi {
|
|
|
272
260
|
updateReturn(params: UpdateReturnParams): Promise<Return>;
|
|
273
261
|
validateDiscount(params: ValidateDiscountParams): Promise<ValidateDiscountResult>;
|
|
274
262
|
calculateShipping(params: CalculateShippingParams): Promise<CalculateShippingResult>;
|
|
275
|
-
createExchange(params: CreateExchangeParams): Promise<Exchange>;
|
|
276
|
-
updateExchange(params: UpdateExchangeParams): Promise<Exchange>;
|
|
277
263
|
}
|
|
278
264
|
|
|
279
265
|
interface CartApiOptions {
|
|
@@ -331,12 +317,12 @@ declare class CartApi {
|
|
|
331
317
|
type ProductApiOptions = ServerApiOptions;
|
|
332
318
|
type StockCheckParams = {
|
|
333
319
|
items: Array<{
|
|
334
|
-
|
|
320
|
+
variantId: string;
|
|
335
321
|
quantity: number;
|
|
336
322
|
}>;
|
|
337
323
|
};
|
|
338
324
|
type StockCheckResult = {
|
|
339
|
-
|
|
325
|
+
variantId: string;
|
|
340
326
|
available: boolean;
|
|
341
327
|
availableStock: number;
|
|
342
328
|
requestedQuantity: number;
|
|
@@ -555,10 +541,10 @@ interface Thread {
|
|
|
555
541
|
}
|
|
556
542
|
interface Comment {
|
|
557
543
|
id: string;
|
|
558
|
-
|
|
544
|
+
body: string;
|
|
559
545
|
thread?: string;
|
|
560
546
|
parent?: string;
|
|
561
|
-
|
|
547
|
+
rootComment?: string;
|
|
562
548
|
createdAt?: string;
|
|
563
549
|
updatedAt?: string;
|
|
564
550
|
[key: string]: unknown;
|
|
@@ -648,18 +634,18 @@ declare class CommunityClient {
|
|
|
648
634
|
}>;
|
|
649
635
|
createComment(params: {
|
|
650
636
|
threadId: string;
|
|
651
|
-
|
|
637
|
+
body: string;
|
|
652
638
|
parentId?: string;
|
|
653
639
|
}): Promise<Comment>;
|
|
654
640
|
listComments(params: {
|
|
655
641
|
threadId: string;
|
|
656
642
|
page?: number;
|
|
657
643
|
limit?: number;
|
|
658
|
-
|
|
644
|
+
rootComment?: string;
|
|
659
645
|
}): Promise<PaginatedResponse<Comment>>;
|
|
660
646
|
updateComment(params: {
|
|
661
647
|
commentId: string;
|
|
662
|
-
|
|
648
|
+
body: string;
|
|
663
649
|
}): Promise<Comment>;
|
|
664
650
|
deleteComment(params: {
|
|
665
651
|
commentId: string;
|
|
@@ -726,6 +712,15 @@ interface CustomerAuthResponse {
|
|
|
726
712
|
token: string;
|
|
727
713
|
customer: CustomerProfile;
|
|
728
714
|
}
|
|
715
|
+
interface MarketingConsentChannel {
|
|
716
|
+
isConsented?: boolean;
|
|
717
|
+
}
|
|
718
|
+
interface MarketingConsent {
|
|
719
|
+
email?: MarketingConsentChannel;
|
|
720
|
+
sms?: MarketingConsentChannel;
|
|
721
|
+
push?: MarketingConsentChannel;
|
|
722
|
+
consentSource?: string;
|
|
723
|
+
}
|
|
729
724
|
interface CustomerProfile {
|
|
730
725
|
id: string;
|
|
731
726
|
name: string;
|
|
@@ -733,8 +728,8 @@ interface CustomerProfile {
|
|
|
733
728
|
phone?: string | null;
|
|
734
729
|
authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
|
|
735
730
|
isGuest?: boolean | null;
|
|
736
|
-
|
|
737
|
-
marketingConsent?:
|
|
731
|
+
isEmailVerified?: boolean | null;
|
|
732
|
+
marketingConsent?: MarketingConsent | null;
|
|
738
733
|
metadata?: Record<string, unknown> | null;
|
|
739
734
|
groups?: string[];
|
|
740
735
|
}
|
|
@@ -759,7 +754,7 @@ interface CustomerRefreshResponse {
|
|
|
759
754
|
interface UpdateProfileData {
|
|
760
755
|
name?: string;
|
|
761
756
|
phone?: string;
|
|
762
|
-
marketingConsent?:
|
|
757
|
+
marketingConsent?: MarketingConsent;
|
|
763
758
|
}
|
|
764
759
|
interface CustomerAuthOptions {
|
|
765
760
|
/**
|
|
@@ -1167,4 +1162,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1167
1162
|
*/
|
|
1168
1163
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1169
1164
|
|
|
1170
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, 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, CommunityClient, type CommunityClientOptions, ConfigError, type
|
|
1165
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, 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, CommunityClient, type CommunityClientOptions, ConfigError, 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, type ExtractArrayType, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, GoneError, type InfiniteQueryOptions, NetworkError, Order, OrderApi, type OrderApiOptions, OrderItem$1 as OrderItem, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type QueryOptions, 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, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, Transaction, 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
|
@@ -583,12 +583,6 @@ var OrderApi = class extends BaseApi {
|
|
|
583
583
|
params
|
|
584
584
|
);
|
|
585
585
|
}
|
|
586
|
-
createExchange(params) {
|
|
587
|
-
return this.request("/api/exchanges/create", params);
|
|
588
|
-
}
|
|
589
|
-
updateExchange(params) {
|
|
590
|
-
return this.request("/api/exchanges/update", params);
|
|
591
|
-
}
|
|
592
586
|
};
|
|
593
587
|
|
|
594
588
|
// src/core/api/cart-api.ts
|
|
@@ -1129,17 +1123,16 @@ var COLLECTIONS = [
|
|
|
1129
1123
|
"products",
|
|
1130
1124
|
"product-variants",
|
|
1131
1125
|
"product-options",
|
|
1126
|
+
"product-option-values",
|
|
1132
1127
|
"product-categories",
|
|
1133
1128
|
"product-tags",
|
|
1134
1129
|
"product-collections",
|
|
1135
1130
|
"brands",
|
|
1136
1131
|
"brand-logos",
|
|
1137
1132
|
"orders",
|
|
1138
|
-
"order-
|
|
1133
|
+
"order-items",
|
|
1139
1134
|
"returns",
|
|
1140
|
-
"return-
|
|
1141
|
-
"exchanges",
|
|
1142
|
-
"exchange-products",
|
|
1135
|
+
"return-items",
|
|
1143
1136
|
"fulfillments",
|
|
1144
1137
|
"fulfillment-items",
|
|
1145
1138
|
"transactions",
|
|
@@ -1260,32 +1253,32 @@ var CommunityClient = class {
|
|
|
1260
1253
|
}
|
|
1261
1254
|
// Comments
|
|
1262
1255
|
createComment(params) {
|
|
1263
|
-
const { threadId, parentId,
|
|
1264
|
-
const body = { thread: threadId,
|
|
1256
|
+
const { threadId, parentId, body: commentBody } = params;
|
|
1257
|
+
const body = { thread: threadId, body: commentBody };
|
|
1265
1258
|
if (parentId !== void 0) {
|
|
1266
1259
|
body.parent = parentId;
|
|
1267
1260
|
}
|
|
1268
1261
|
return this.execute("/api/comments", "POST", body);
|
|
1269
1262
|
}
|
|
1270
1263
|
listComments(params) {
|
|
1271
|
-
const { threadId, page, limit,
|
|
1264
|
+
const { threadId, page, limit, rootComment } = params;
|
|
1272
1265
|
const urlParams = new URLSearchParams();
|
|
1273
1266
|
urlParams.set("where[thread][equals]", threadId);
|
|
1274
1267
|
urlParams.set("sort", "-createdAt");
|
|
1275
1268
|
if (limit !== void 0) urlParams.set("limit", String(limit));
|
|
1276
1269
|
if (page !== void 0) urlParams.set("page", String(page));
|
|
1277
|
-
if (
|
|
1270
|
+
if (rootComment !== void 0) urlParams.set("where[rootComment][equals]", rootComment);
|
|
1278
1271
|
return this.execute(
|
|
1279
1272
|
`/api/comments?${urlParams.toString()}`,
|
|
1280
1273
|
"GET"
|
|
1281
1274
|
);
|
|
1282
1275
|
}
|
|
1283
1276
|
updateComment(params) {
|
|
1284
|
-
const { commentId,
|
|
1277
|
+
const { commentId, body } = params;
|
|
1285
1278
|
return this.execute(
|
|
1286
1279
|
`/api/comments/${commentId}`,
|
|
1287
1280
|
"PATCH",
|
|
1288
|
-
{
|
|
1281
|
+
{ body }
|
|
1289
1282
|
);
|
|
1290
1283
|
}
|
|
1291
1284
|
deleteComment(params) {
|