@01.software/sdk 0.2.9-dev.260305.4f1735b → 0.2.9-dev.260306.1a05ae3

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/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, C as CartItem, P as ProductOption } from './payload-types-Bpi16SHO.cjs';
2
- export { k as ApiUsage, ae as ApiUsageSelect, A as Audience, aa as AudiencesSelect, b0 as Auth, m as BillingHistory, ag as BillingHistorySelect, u as Brand, B as BrandLogo, aq as BrandLogosSelect, ap as BrandsSelect, K as Cart, aG as CartItemsSelect, aF as CartsSelect, f as CodeBlock, a$ as CollectionsWidget, c as Config, w as Customer, z as CustomerAddress, aC as CustomerAddressesSelect, d as CustomerAuthOperations, x as CustomerGroup, y as CustomerGroupImage, aE as CustomerGroupImagesSelect, aD as CustomerGroupsSelect, aB as CustomersSelect, L as Discount, aH as DiscountsSelect, Y as Document, aP as DocumentCategoriesSelect, $ as DocumentCategory, _ as DocumentImage, aR as DocumentImagesSelect, Z as DocumentType, aQ as DocumentTypesSelect, aO as DocumentsSelect, E as EmailLog, ab as EmailLogsSelect, G as Exchange, H as ExchangeProduct, aA as ExchangeProductsSelect, az as ExchangesSelect, F as Form, a3 as FormSubmission, aW as FormSubmissionsSelect, aV as FormsSelect, J as FulfillmentItem, aw as FulfillmentItemsSelect, av as FulfillmentsSelect, I as IframeBlock, M as Media, a9 as MediaSelect, a1 as Music, aT as MusicsSelect, at as OrderProductsSelect, as as OrdersSelect, a4 as PayloadKv, aX as PayloadKvSelect, a5 as PayloadLockedDocument, aY as PayloadLockedDocumentsSelect, a7 as PayloadMigration, a_ as PayloadMigrationsSelect, a6 as PayloadPreference, aZ as PayloadPreferencesSelect, e as PlayerBlock, a0 as Playlist, a2 as PlaylistImage, aU as PlaylistImagesSelect, aS as PlaylistsSelect, N as Post, V as PostAuthor, aK as PostAuthorsSelect, aL as PostCategoriesSelect, W as PostCategory, Q as PostImage, aN as PostImagesSelect, X as PostTag, aM as PostTagsSelect, aJ as PostsSelect, o as Product, am as ProductCategoriesSelect, r as ProductCategory, t as ProductCollection, ao as ProductCollectionsSelect, p as ProductImage, ar as ProductImagesSelect, al as ProductOptionsSelect, s as ProductTag, an as ProductTagsSelect, q as ProductVariant, ak as ProductVariantsSelect, aj as ProductsSelect, D as ReturnProduct, ay as ReturnProductsSelect, ax as ReturnsSelect, aI as ShippingPoliciesSelect, v as ShippingPolicy, l as Subscription, af as SubscriptionsSelect, S as SupportedTimezones, h as Tenant, n as TenantLogo, ah as TenantLogosSelect, ad as TenantMetadataSelect, i as TenantMetadatum, j as TenantOgImage, ai as TenantOgImagesSelect, ac as TenantsSelect, au as TransactionsSelect, g as User, U as UserAuthOperations, a8 as UsersSelect } from './payload-types-Bpi16SHO.cjs';
3
- import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-3qWmYUln.cjs';
4
- export { t as API_URLS, f as ApiError, y as ApiQueryReactOptions, w as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, s as Environment, e as ErrorLogger, E as ExtractArrayType, J as JwtPayload, N as NetworkError, x as PaginationMeta, R as RetryConfig, S as SDKError, T as TimeoutError, U as UsageLimitError, V as ValidationError, q as createApiKey, o as createServerToken, p as decodeServerToken, k as isApiError, l as isConfigError, h as isNetworkError, i as isSDKError, m as isTimeoutError, n as isUsageLimitError, j as isValidationError, r as parseApiKey, u as resolveApiUrl, v as verifyServerToken } from './auth-3qWmYUln.cjs';
1
+ import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, C as CartItem, P as Product } from './payload-types-CoLxaq7L.cjs';
2
+ export { k as ApiUsage, ag as ApiUsageSelect, A as Audience, ac as AudiencesSelect, b4 as Auth, m as BillingHistory, ai as BillingHistorySelect, u as Brand, B as BrandLogo, as as BrandLogosSelect, ar as BrandsSelect, K as Cart, aJ as CartItemsSelect, aI as CartsSelect, f as CodeBlock, b3 as CollectionsWidget, c as Config, w as Customer, z as CustomerAddress, aF as CustomerAddressesSelect, d as CustomerAuthOperations, x as CustomerGroup, y as CustomerGroupImage, aH as CustomerGroupImagesSelect, aG as CustomerGroupsSelect, aE as CustomersSelect, L as Discount, aK as DiscountsSelect, Y as Document, aR as DocumentCategoriesSelect, $ as DocumentCategory, _ as DocumentImage, aT as DocumentImagesSelect, Z as DocumentType, aS as DocumentTypesSelect, aQ as DocumentsSelect, E as EmailLog, ad as EmailLogsSelect, H as Exchange, J as ExchangeProduct, aC as ExchangeProductsSelect, aB as ExchangesSelect, a3 as Flow, a4 as FlowImage, aY as FlowImagesSelect, aX as FlowsSelect, F as Form, a5 as FormSubmission, a_ as FormSubmissionsSelect, aZ as FormsSelect, D as FulfillmentItem, ay as FulfillmentItemsSelect, ax as FulfillmentsSelect, I as IframeBlock, M as Media, ab as MediaSelect, a1 as Music, aV as MusicsSelect, av as OrderProductsSelect, au as OrdersSelect, a6 as PayloadKv, a$ as PayloadKvSelect, a7 as PayloadLockedDocument, b0 as PayloadLockedDocumentsSelect, a9 as PayloadMigration, b2 as PayloadMigrationsSelect, a8 as PayloadPreference, b1 as PayloadPreferencesSelect, e as PlayerBlock, a0 as Playlist, a2 as PlaylistImage, aW as PlaylistImagesSelect, aU as PlaylistsSelect, N as Post, V as PostAuthor, aM as PostAuthorsSelect, aN as PostCategoriesSelect, W as PostCategory, Q as PostImage, aP as PostImagesSelect, X as PostTag, aO as PostTagsSelect, aL as PostsSelect, ao as ProductCategoriesSelect, r as ProductCategory, t as ProductCollection, aq as ProductCollectionsSelect, o as ProductImage, at as ProductImagesSelect, q as ProductOption, an as ProductOptionsSelect, s as ProductTag, ap as ProductTagsSelect, p as ProductVariant, am as ProductVariantsSelect, al as ProductsSelect, G as ReturnProduct, aA as ReturnProductsSelect, az as ReturnsSelect, aD as ShippingPoliciesSelect, v as ShippingPolicy, l as Subscription, ah as SubscriptionsSelect, S as SupportedTimezones, h as Tenant, n as TenantLogo, aj as TenantLogosSelect, af as TenantMetadataSelect, i as TenantMetadatum, j as TenantOgImage, ak as TenantOgImagesSelect, ae as TenantsSelect, aw as TransactionsSelect, g as User, U as UserAuthOperations, aa as UsersSelect } from './payload-types-CoLxaq7L.cjs';
3
+ import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-CveDznSJ.cjs';
4
+ export { t as API_URLS, f as ApiError, y as ApiQueryReactOptions, w as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, s as Environment, e as ErrorLogger, E as ExtractArrayType, J as JwtPayload, N as NetworkError, x as PaginationMeta, R as RetryConfig, S as SDKError, T as TimeoutError, U as UsageLimitError, V as ValidationError, q as createApiKey, o as createServerToken, p as decodeServerToken, k as isApiError, l as isConfigError, h as isNetworkError, i as isSDKError, m as isTimeoutError, n as isUsageLimitError, j as isValidationError, r as parseApiKey, u as resolveApiUrl, v as verifyServerToken } from './auth-CveDznSJ.cjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { QueryClient } from '@tanstack/react-query';
7
- import { P as PublicCollection, C as CollectionType } from './webhook-DMN-IPra.cjs';
8
- export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-DMN-IPra.cjs';
7
+ import { P as PublicCollection, C as CollectionType } from './webhook-BESEe9jO.cjs';
8
+ export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-BESEe9jO.cjs';
9
9
  import { Metadata } from 'next';
10
10
  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';
11
11
  import 'payload';
@@ -16,12 +16,17 @@ interface OrderApiOptions {
16
16
  baseUrl?: string;
17
17
  }
18
18
  type CreateOrderParams = {
19
- paymentId: string;
20
19
  orderNumber: string;
21
- email: string;
20
+ customer?: string;
21
+ customerSnapshot: {
22
+ name?: string;
23
+ email: string;
24
+ phone?: string;
25
+ };
22
26
  shippingAddress: Order['shippingAddress'];
23
27
  orderProducts: Omit<OrderProduct, 'id' | 'brand' | 'createdAt' | 'updatedAt' | 'order' | 'status'>[];
24
28
  totalAmount: number;
29
+ paymentId?: string;
25
30
  };
26
31
  type UpdateOrderParams = {
27
32
  orderNumber: string;
@@ -30,18 +35,18 @@ type UpdateOrderParams = {
30
35
  type UpdateTransactionParams = {
31
36
  paymentId: string;
32
37
  status: Transaction['status'];
33
- paymentMethod: Transaction['paymentMethod'];
34
- receiptUrl: Transaction['receiptUrl'];
38
+ paymentMethod?: string;
39
+ receiptUrl?: string;
35
40
  };
36
41
  type CheckoutParams = {
37
42
  cartId: string;
38
- paymentId: string;
39
43
  orderNumber: string;
40
44
  customerSnapshot: {
41
45
  name?: string;
42
46
  email: string;
43
47
  phone?: string;
44
48
  };
49
+ paymentId?: string;
45
50
  };
46
51
  type CreateFulfillmentParams = {
47
52
  orderNumber: string;
@@ -71,7 +76,7 @@ type UpdateReturnParams = {
71
76
  };
72
77
  type ReturnWithRefundParams = {
73
78
  orderNumber: string;
74
- reason?: string;
79
+ reason?: 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
75
80
  reasonDetail?: string;
76
81
  returnProducts: Array<{
77
82
  orderProduct: string;
@@ -681,7 +686,10 @@ declare function getQueryClient(): QueryClient;
681
686
 
682
687
  declare const generateOrderNumber: () => string;
683
688
 
684
- declare const formatOrderName: (options: ProductOption[]) => string;
689
+ type OrderItem = {
690
+ product: Product | string | null | undefined;
691
+ };
692
+ declare const formatOrderName: (items: OrderItem[]) => string;
685
693
 
686
694
  /**
687
695
  * Resolves a Payload CMS relation field value.
@@ -696,4 +704,4 @@ declare const resolveRelation: <T>(ref: T | string | null | undefined) => T | nu
696
704
  /** @deprecated Use `resolveRelation` instead */
697
705
  declare const objectFor: <T>(ref: T | string | null | undefined) => T | null;
698
706
 
699
- export { type AddItemParams, ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, CartApi, type CartApiOptions, CartItem, type CheckoutParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, ProductApi, type ProductApiOptions, ProductOption, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveItemParams, Return, type ReturnWithRefundParams, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateItemParams, type UpdateOrderParams, type UpdateReturnParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, objectFor, resolveRelation };
707
+ export { type AddItemParams, ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, CartApi, type CartApiOptions, CartItem, type CheckoutParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveItemParams, Return, type ReturnWithRefundParams, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateItemParams, type UpdateOrderParams, type UpdateReturnParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, objectFor, resolveRelation };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, C as CartItem, P as ProductOption } from './payload-types-Bpi16SHO.js';
2
- export { k as ApiUsage, ae as ApiUsageSelect, A as Audience, aa as AudiencesSelect, b0 as Auth, m as BillingHistory, ag as BillingHistorySelect, u as Brand, B as BrandLogo, aq as BrandLogosSelect, ap as BrandsSelect, K as Cart, aG as CartItemsSelect, aF as CartsSelect, f as CodeBlock, a$ as CollectionsWidget, c as Config, w as Customer, z as CustomerAddress, aC as CustomerAddressesSelect, d as CustomerAuthOperations, x as CustomerGroup, y as CustomerGroupImage, aE as CustomerGroupImagesSelect, aD as CustomerGroupsSelect, aB as CustomersSelect, L as Discount, aH as DiscountsSelect, Y as Document, aP as DocumentCategoriesSelect, $ as DocumentCategory, _ as DocumentImage, aR as DocumentImagesSelect, Z as DocumentType, aQ as DocumentTypesSelect, aO as DocumentsSelect, E as EmailLog, ab as EmailLogsSelect, G as Exchange, H as ExchangeProduct, aA as ExchangeProductsSelect, az as ExchangesSelect, F as Form, a3 as FormSubmission, aW as FormSubmissionsSelect, aV as FormsSelect, J as FulfillmentItem, aw as FulfillmentItemsSelect, av as FulfillmentsSelect, I as IframeBlock, M as Media, a9 as MediaSelect, a1 as Music, aT as MusicsSelect, at as OrderProductsSelect, as as OrdersSelect, a4 as PayloadKv, aX as PayloadKvSelect, a5 as PayloadLockedDocument, aY as PayloadLockedDocumentsSelect, a7 as PayloadMigration, a_ as PayloadMigrationsSelect, a6 as PayloadPreference, aZ as PayloadPreferencesSelect, e as PlayerBlock, a0 as Playlist, a2 as PlaylistImage, aU as PlaylistImagesSelect, aS as PlaylistsSelect, N as Post, V as PostAuthor, aK as PostAuthorsSelect, aL as PostCategoriesSelect, W as PostCategory, Q as PostImage, aN as PostImagesSelect, X as PostTag, aM as PostTagsSelect, aJ as PostsSelect, o as Product, am as ProductCategoriesSelect, r as ProductCategory, t as ProductCollection, ao as ProductCollectionsSelect, p as ProductImage, ar as ProductImagesSelect, al as ProductOptionsSelect, s as ProductTag, an as ProductTagsSelect, q as ProductVariant, ak as ProductVariantsSelect, aj as ProductsSelect, D as ReturnProduct, ay as ReturnProductsSelect, ax as ReturnsSelect, aI as ShippingPoliciesSelect, v as ShippingPolicy, l as Subscription, af as SubscriptionsSelect, S as SupportedTimezones, h as Tenant, n as TenantLogo, ah as TenantLogosSelect, ad as TenantMetadataSelect, i as TenantMetadatum, j as TenantOgImage, ai as TenantOgImagesSelect, ac as TenantsSelect, au as TransactionsSelect, g as User, U as UserAuthOperations, a8 as UsersSelect } from './payload-types-Bpi16SHO.js';
3
- import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-BfGmV75P.js';
4
- export { t as API_URLS, f as ApiError, y as ApiQueryReactOptions, w as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, s as Environment, e as ErrorLogger, E as ExtractArrayType, J as JwtPayload, N as NetworkError, x as PaginationMeta, R as RetryConfig, S as SDKError, T as TimeoutError, U as UsageLimitError, V as ValidationError, q as createApiKey, o as createServerToken, p as decodeServerToken, k as isApiError, l as isConfigError, h as isNetworkError, i as isSDKError, m as isTimeoutError, n as isUsageLimitError, j as isValidationError, r as parseApiKey, u as resolveApiUrl, v as verifyServerToken } from './auth-BfGmV75P.js';
1
+ import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, C as CartItem, P as Product } from './payload-types-CoLxaq7L.js';
2
+ export { k as ApiUsage, ag as ApiUsageSelect, A as Audience, ac as AudiencesSelect, b4 as Auth, m as BillingHistory, ai as BillingHistorySelect, u as Brand, B as BrandLogo, as as BrandLogosSelect, ar as BrandsSelect, K as Cart, aJ as CartItemsSelect, aI as CartsSelect, f as CodeBlock, b3 as CollectionsWidget, c as Config, w as Customer, z as CustomerAddress, aF as CustomerAddressesSelect, d as CustomerAuthOperations, x as CustomerGroup, y as CustomerGroupImage, aH as CustomerGroupImagesSelect, aG as CustomerGroupsSelect, aE as CustomersSelect, L as Discount, aK as DiscountsSelect, Y as Document, aR as DocumentCategoriesSelect, $ as DocumentCategory, _ as DocumentImage, aT as DocumentImagesSelect, Z as DocumentType, aS as DocumentTypesSelect, aQ as DocumentsSelect, E as EmailLog, ad as EmailLogsSelect, H as Exchange, J as ExchangeProduct, aC as ExchangeProductsSelect, aB as ExchangesSelect, a3 as Flow, a4 as FlowImage, aY as FlowImagesSelect, aX as FlowsSelect, F as Form, a5 as FormSubmission, a_ as FormSubmissionsSelect, aZ as FormsSelect, D as FulfillmentItem, ay as FulfillmentItemsSelect, ax as FulfillmentsSelect, I as IframeBlock, M as Media, ab as MediaSelect, a1 as Music, aV as MusicsSelect, av as OrderProductsSelect, au as OrdersSelect, a6 as PayloadKv, a$ as PayloadKvSelect, a7 as PayloadLockedDocument, b0 as PayloadLockedDocumentsSelect, a9 as PayloadMigration, b2 as PayloadMigrationsSelect, a8 as PayloadPreference, b1 as PayloadPreferencesSelect, e as PlayerBlock, a0 as Playlist, a2 as PlaylistImage, aW as PlaylistImagesSelect, aU as PlaylistsSelect, N as Post, V as PostAuthor, aM as PostAuthorsSelect, aN as PostCategoriesSelect, W as PostCategory, Q as PostImage, aP as PostImagesSelect, X as PostTag, aO as PostTagsSelect, aL as PostsSelect, ao as ProductCategoriesSelect, r as ProductCategory, t as ProductCollection, aq as ProductCollectionsSelect, o as ProductImage, at as ProductImagesSelect, q as ProductOption, an as ProductOptionsSelect, s as ProductTag, ap as ProductTagsSelect, p as ProductVariant, am as ProductVariantsSelect, al as ProductsSelect, G as ReturnProduct, aA as ReturnProductsSelect, az as ReturnsSelect, aD as ShippingPoliciesSelect, v as ShippingPolicy, l as Subscription, ah as SubscriptionsSelect, S as SupportedTimezones, h as Tenant, n as TenantLogo, aj as TenantLogosSelect, af as TenantMetadataSelect, i as TenantMetadatum, j as TenantOgImage, ak as TenantOgImagesSelect, ae as TenantsSelect, aw as TransactionsSelect, g as User, U as UserAuthOperations, aa as UsersSelect } from './payload-types-CoLxaq7L.js';
3
+ import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-DmZlBU74.js';
4
+ export { t as API_URLS, f as ApiError, y as ApiQueryReactOptions, w as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, s as Environment, e as ErrorLogger, E as ExtractArrayType, J as JwtPayload, N as NetworkError, x as PaginationMeta, R as RetryConfig, S as SDKError, T as TimeoutError, U as UsageLimitError, V as ValidationError, q as createApiKey, o as createServerToken, p as decodeServerToken, k as isApiError, l as isConfigError, h as isNetworkError, i as isSDKError, m as isTimeoutError, n as isUsageLimitError, j as isValidationError, r as parseApiKey, u as resolveApiUrl, v as verifyServerToken } from './auth-DmZlBU74.js';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { QueryClient } from '@tanstack/react-query';
7
- import { P as PublicCollection, C as CollectionType } from './webhook-Bk-i0A59.js';
8
- export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-Bk-i0A59.js';
7
+ import { P as PublicCollection, C as CollectionType } from './webhook-DuERNp5A.js';
8
+ export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-DuERNp5A.js';
9
9
  import { Metadata } from 'next';
10
10
  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';
11
11
  import 'payload';
@@ -16,12 +16,17 @@ interface OrderApiOptions {
16
16
  baseUrl?: string;
17
17
  }
18
18
  type CreateOrderParams = {
19
- paymentId: string;
20
19
  orderNumber: string;
21
- email: string;
20
+ customer?: string;
21
+ customerSnapshot: {
22
+ name?: string;
23
+ email: string;
24
+ phone?: string;
25
+ };
22
26
  shippingAddress: Order['shippingAddress'];
23
27
  orderProducts: Omit<OrderProduct, 'id' | 'brand' | 'createdAt' | 'updatedAt' | 'order' | 'status'>[];
24
28
  totalAmount: number;
29
+ paymentId?: string;
25
30
  };
26
31
  type UpdateOrderParams = {
27
32
  orderNumber: string;
@@ -30,18 +35,18 @@ type UpdateOrderParams = {
30
35
  type UpdateTransactionParams = {
31
36
  paymentId: string;
32
37
  status: Transaction['status'];
33
- paymentMethod: Transaction['paymentMethod'];
34
- receiptUrl: Transaction['receiptUrl'];
38
+ paymentMethod?: string;
39
+ receiptUrl?: string;
35
40
  };
36
41
  type CheckoutParams = {
37
42
  cartId: string;
38
- paymentId: string;
39
43
  orderNumber: string;
40
44
  customerSnapshot: {
41
45
  name?: string;
42
46
  email: string;
43
47
  phone?: string;
44
48
  };
49
+ paymentId?: string;
45
50
  };
46
51
  type CreateFulfillmentParams = {
47
52
  orderNumber: string;
@@ -71,7 +76,7 @@ type UpdateReturnParams = {
71
76
  };
72
77
  type ReturnWithRefundParams = {
73
78
  orderNumber: string;
74
- reason?: string;
79
+ reason?: 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
75
80
  reasonDetail?: string;
76
81
  returnProducts: Array<{
77
82
  orderProduct: string;
@@ -681,7 +686,10 @@ declare function getQueryClient(): QueryClient;
681
686
 
682
687
  declare const generateOrderNumber: () => string;
683
688
 
684
- declare const formatOrderName: (options: ProductOption[]) => string;
689
+ type OrderItem = {
690
+ product: Product | string | null | undefined;
691
+ };
692
+ declare const formatOrderName: (items: OrderItem[]) => string;
685
693
 
686
694
  /**
687
695
  * Resolves a Payload CMS relation field value.
@@ -696,4 +704,4 @@ declare const resolveRelation: <T>(ref: T | string | null | undefined) => T | nu
696
704
  /** @deprecated Use `resolveRelation` instead */
697
705
  declare const objectFor: <T>(ref: T | string | null | undefined) => T | null;
698
706
 
699
- export { type AddItemParams, ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, CartApi, type CartApiOptions, CartItem, type CheckoutParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, ProductApi, type ProductApiOptions, ProductOption, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveItemParams, Return, type ReturnWithRefundParams, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateItemParams, type UpdateOrderParams, type UpdateReturnParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, objectFor, resolveRelation };
707
+ export { type AddItemParams, ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, CartApi, type CartApiOptions, CartItem, type CheckoutParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveItemParams, Return, type ReturnWithRefundParams, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateItemParams, type UpdateOrderParams, type UpdateReturnParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, objectFor, resolveRelation };
package/dist/index.js CHANGED
@@ -156,8 +156,8 @@ var createUsageLimitError = (message, usage, details, userMessage, suggestion) =
156
156
  // src/core/client/types.ts
157
157
  var API_URLS = {
158
158
  local: "http://localhost:3000",
159
- development: "https://dev.01.software",
160
- staging: "https://stg.01.software",
159
+ development: "https://api-dev.01.software",
160
+ staging: "https://api-stg.01.software",
161
161
  production: "https://api.01.software"
162
162
  };
163
163
  function resolveApiUrl(config) {
@@ -1137,6 +1137,8 @@ var COLLECTIONS = [
1137
1137
  "playlists",
1138
1138
  "playlist-images",
1139
1139
  "musics",
1140
+ "flows",
1141
+ "flow-images",
1140
1142
  "forms",
1141
1143
  "form-submissions",
1142
1144
  "media"
@@ -1985,11 +1987,11 @@ var generateOrderNumber = () => {
1985
1987
  };
1986
1988
 
1987
1989
  // src/utils/order/formatOrderName.ts
1988
- var formatOrderName = (options) => {
1990
+ var formatOrderName = (items) => {
1989
1991
  var _a, _b;
1990
- if (options.length === 0) return "";
1991
- const firstTitle = ((_b = resolveRelation((_a = options[0]) == null ? void 0 : _a.product)) == null ? void 0 : _b.title) || "";
1992
- return options.length === 1 ? firstTitle : `${firstTitle} \uC678 ${options.length - 1}\uAC74`;
1992
+ if (items.length === 0) return "";
1993
+ const firstTitle = ((_b = resolveRelation((_a = items[0]) == null ? void 0 : _a.product)) == null ? void 0 : _b.title) || "";
1994
+ return items.length === 1 ? firstTitle : `${firstTitle} \uC678 ${items.length - 1}\uAC74`;
1993
1995
  };
1994
1996
  export {
1995
1997
  ApiError,