@01.software/sdk 0.5.0 → 0.5.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/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/{const-hqVXNZoy.d.cts → const-CDpRB7XK.d.cts} +1 -1
- package/dist/{const-BO4SPN7f.d.ts → const-DQIDvvB-.d.ts} +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -23
- package/dist/index.d.ts +35 -23
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-mZpmjJBz.d.cts → payload-types-C-keX5go.d.cts} +10 -37
- package/dist/{payload-types-mZpmjJBz.d.ts → payload-types-C-keX5go.d.ts} +10 -37
- 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/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-D65mzWt2.d.cts → webhook-Dqe2_xMx.d.cts} +2 -2
- package/dist/{webhook-CMi4JRCp.d.ts → webhook-DseJdRFT.d.ts} +2 -2
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +3 -3
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, 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-
|
|
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-C-keX5go.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-C-keX5go.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
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-CDpRB7XK.cjs';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-CDpRB7XK.cjs';
|
|
9
|
+
import { C as CollectionType } from './webhook-Dqe2_xMx.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-Dqe2_xMx.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';
|
|
@@ -97,9 +97,6 @@ interface ApiQueryOptions {
|
|
|
97
97
|
depth?: number;
|
|
98
98
|
select?: Record<string, boolean>;
|
|
99
99
|
}
|
|
100
|
-
interface ApiQueryReactOptions {
|
|
101
|
-
keepPreviousData?: boolean;
|
|
102
|
-
}
|
|
103
100
|
interface DebugConfig {
|
|
104
101
|
logRequests?: boolean;
|
|
105
102
|
logResponses?: boolean;
|
|
@@ -755,16 +752,31 @@ interface CollectionInfiniteQueryParams<T extends PublicCollection> {
|
|
|
755
752
|
options?: Omit<ApiQueryOptions, 'page'>;
|
|
756
753
|
pageSize?: number;
|
|
757
754
|
}
|
|
758
|
-
interface QueryOptions {
|
|
755
|
+
interface QueryOptions<TQueryFnData = unknown, TData = TQueryFnData> {
|
|
756
|
+
enabled?: boolean;
|
|
757
|
+
staleTime?: number;
|
|
758
|
+
gcTime?: number;
|
|
759
|
+
refetchOnWindowFocus?: boolean;
|
|
760
|
+
refetchOnMount?: boolean | 'always';
|
|
761
|
+
refetchInterval?: number | false;
|
|
762
|
+
retry?: boolean | number;
|
|
763
|
+
select?: (data: TQueryFnData) => TData;
|
|
764
|
+
placeholderData?: TQueryFnData | ((previousData: TData | undefined) => TQueryFnData | undefined);
|
|
765
|
+
initialData?: TQueryFnData | (() => TQueryFnData);
|
|
766
|
+
initialDataUpdatedAt?: number | (() => number | undefined);
|
|
767
|
+
}
|
|
768
|
+
type SuspenseQueryOptions<TQueryFnData = unknown, TData = TQueryFnData> = Omit<QueryOptions<TQueryFnData, TData>, 'enabled' | 'placeholderData'>;
|
|
769
|
+
interface InfiniteQueryOptions<TQueryFnData = unknown, TData = InfiniteData<TQueryFnData>> {
|
|
759
770
|
enabled?: boolean;
|
|
760
771
|
staleTime?: number;
|
|
761
772
|
gcTime?: number;
|
|
762
773
|
refetchOnWindowFocus?: boolean;
|
|
763
|
-
refetchOnMount?: boolean;
|
|
774
|
+
refetchOnMount?: boolean | 'always';
|
|
764
775
|
refetchInterval?: number | false;
|
|
765
776
|
retry?: boolean | number;
|
|
777
|
+
select?: (data: InfiniteData<TQueryFnData>) => TData;
|
|
766
778
|
}
|
|
767
|
-
type
|
|
779
|
+
type SuspenseInfiniteQueryOptions<TQueryFnData = unknown, TData = InfiniteData<TQueryFnData>> = Omit<InfiniteQueryOptions<TQueryFnData, TData>, 'enabled'>;
|
|
768
780
|
interface MutationCallbacks$1<TData> {
|
|
769
781
|
onSuccess?: (data: TData) => void;
|
|
770
782
|
onError?: (error: SDKError) => void;
|
|
@@ -774,12 +786,12 @@ declare class CollectionHooks {
|
|
|
774
786
|
protected queryClient: QueryClient;
|
|
775
787
|
protected collectionClient: CollectionClient;
|
|
776
788
|
constructor(queryClient: QueryClient, collectionClient: CollectionClient);
|
|
777
|
-
useQuery<T extends PublicCollection
|
|
778
|
-
useSuspenseQuery<T extends PublicCollection
|
|
779
|
-
useQueryById<T extends PublicCollection
|
|
780
|
-
useSuspenseQueryById<T extends PublicCollection
|
|
781
|
-
useInfiniteQuery<T extends PublicCollection
|
|
782
|
-
useSuspenseInfiniteQuery<T extends PublicCollection
|
|
789
|
+
useQuery<T extends PublicCollection, TData = PayloadFindResponse<CollectionType<T>>>(params: CollectionQueryParams<T>, options?: QueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<TData>, Error>;
|
|
790
|
+
useSuspenseQuery<T extends PublicCollection, TData = PayloadFindResponse<CollectionType<T>>>(params: CollectionQueryParams<T>, options?: SuspenseQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseSuspenseQueryResult<TData, Error>;
|
|
791
|
+
useQueryById<T extends PublicCollection, TData = CollectionType<T>>(params: CollectionDetailQueryParams<T>, options?: QueryOptions<CollectionType<T>, TData>): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<TData>, Error>;
|
|
792
|
+
useSuspenseQueryById<T extends PublicCollection, TData = CollectionType<T>>(params: CollectionDetailQueryParams<T>, options?: SuspenseQueryOptions<CollectionType<T>, TData>): _tanstack_react_query.UseSuspenseQueryResult<TData, Error>;
|
|
793
|
+
useInfiniteQuery<T extends PublicCollection, TData = InfiniteData<PayloadFindResponse<CollectionType<T>>>>(params: CollectionInfiniteQueryParams<T>, options?: InfiniteQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseInfiniteQueryResult<TData, Error>;
|
|
794
|
+
useSuspenseInfiniteQuery<T extends PublicCollection, TData = InfiniteData<PayloadFindResponse<CollectionType<T>>>>(params: CollectionInfiniteQueryParams<T>, options?: SuspenseInfiniteQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseSuspenseInfiniteQueryResult<TData, Error>;
|
|
783
795
|
prefetchQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
784
796
|
staleTime?: number;
|
|
785
797
|
}): Promise<void>;
|
|
@@ -809,9 +821,9 @@ declare class CollectionHooks {
|
|
|
809
821
|
collection: T;
|
|
810
822
|
}, options?: MutationCallbacks$1<CollectionType<T>>): _tanstack_react_query.UseMutationResult<CollectionType<T>, SDKError, string, unknown>;
|
|
811
823
|
invalidateQueries<T extends PublicCollection>(collection: T, type?: 'list' | 'detail' | 'infinite'): Promise<void>;
|
|
812
|
-
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): CollectionType<T
|
|
824
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): PayloadFindResponse<CollectionType<T>> | undefined;
|
|
813
825
|
getQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string, options?: ApiQueryOptions): CollectionType<T> | null | undefined;
|
|
814
|
-
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: CollectionType<T
|
|
826
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: PayloadFindResponse<CollectionType<T>>, options?: ApiQueryOptions): void;
|
|
815
827
|
setQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string, data: CollectionType<T> | null, options?: ApiQueryOptions): void;
|
|
816
828
|
}
|
|
817
829
|
|
|
@@ -831,7 +843,7 @@ declare class CustomerHooks {
|
|
|
831
843
|
staleTime?: number;
|
|
832
844
|
gcTime?: number;
|
|
833
845
|
refetchOnWindowFocus?: boolean;
|
|
834
|
-
refetchOnMount?: boolean;
|
|
846
|
+
refetchOnMount?: boolean | 'always';
|
|
835
847
|
refetchInterval?: number | false;
|
|
836
848
|
retry?: boolean | number;
|
|
837
849
|
}): _tanstack_react_query.UseQueryResult<CustomerProfile | null, Error>;
|
|
@@ -956,4 +968,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
956
968
|
*/
|
|
957
969
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
958
970
|
|
|
959
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type
|
|
971
|
+
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, 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, type InfiniteQueryOptions, NetworkError, Order, OrderApi, type OrderApiOptions, OrderProduct, 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 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, 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-
|
|
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-C-keX5go.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-C-keX5go.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
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-DQIDvvB-.js';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-DQIDvvB-.js';
|
|
9
|
+
import { C as CollectionType } from './webhook-DseJdRFT.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-DseJdRFT.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';
|
|
@@ -97,9 +97,6 @@ interface ApiQueryOptions {
|
|
|
97
97
|
depth?: number;
|
|
98
98
|
select?: Record<string, boolean>;
|
|
99
99
|
}
|
|
100
|
-
interface ApiQueryReactOptions {
|
|
101
|
-
keepPreviousData?: boolean;
|
|
102
|
-
}
|
|
103
100
|
interface DebugConfig {
|
|
104
101
|
logRequests?: boolean;
|
|
105
102
|
logResponses?: boolean;
|
|
@@ -755,16 +752,31 @@ interface CollectionInfiniteQueryParams<T extends PublicCollection> {
|
|
|
755
752
|
options?: Omit<ApiQueryOptions, 'page'>;
|
|
756
753
|
pageSize?: number;
|
|
757
754
|
}
|
|
758
|
-
interface QueryOptions {
|
|
755
|
+
interface QueryOptions<TQueryFnData = unknown, TData = TQueryFnData> {
|
|
756
|
+
enabled?: boolean;
|
|
757
|
+
staleTime?: number;
|
|
758
|
+
gcTime?: number;
|
|
759
|
+
refetchOnWindowFocus?: boolean;
|
|
760
|
+
refetchOnMount?: boolean | 'always';
|
|
761
|
+
refetchInterval?: number | false;
|
|
762
|
+
retry?: boolean | number;
|
|
763
|
+
select?: (data: TQueryFnData) => TData;
|
|
764
|
+
placeholderData?: TQueryFnData | ((previousData: TData | undefined) => TQueryFnData | undefined);
|
|
765
|
+
initialData?: TQueryFnData | (() => TQueryFnData);
|
|
766
|
+
initialDataUpdatedAt?: number | (() => number | undefined);
|
|
767
|
+
}
|
|
768
|
+
type SuspenseQueryOptions<TQueryFnData = unknown, TData = TQueryFnData> = Omit<QueryOptions<TQueryFnData, TData>, 'enabled' | 'placeholderData'>;
|
|
769
|
+
interface InfiniteQueryOptions<TQueryFnData = unknown, TData = InfiniteData<TQueryFnData>> {
|
|
759
770
|
enabled?: boolean;
|
|
760
771
|
staleTime?: number;
|
|
761
772
|
gcTime?: number;
|
|
762
773
|
refetchOnWindowFocus?: boolean;
|
|
763
|
-
refetchOnMount?: boolean;
|
|
774
|
+
refetchOnMount?: boolean | 'always';
|
|
764
775
|
refetchInterval?: number | false;
|
|
765
776
|
retry?: boolean | number;
|
|
777
|
+
select?: (data: InfiniteData<TQueryFnData>) => TData;
|
|
766
778
|
}
|
|
767
|
-
type
|
|
779
|
+
type SuspenseInfiniteQueryOptions<TQueryFnData = unknown, TData = InfiniteData<TQueryFnData>> = Omit<InfiniteQueryOptions<TQueryFnData, TData>, 'enabled'>;
|
|
768
780
|
interface MutationCallbacks$1<TData> {
|
|
769
781
|
onSuccess?: (data: TData) => void;
|
|
770
782
|
onError?: (error: SDKError) => void;
|
|
@@ -774,12 +786,12 @@ declare class CollectionHooks {
|
|
|
774
786
|
protected queryClient: QueryClient;
|
|
775
787
|
protected collectionClient: CollectionClient;
|
|
776
788
|
constructor(queryClient: QueryClient, collectionClient: CollectionClient);
|
|
777
|
-
useQuery<T extends PublicCollection
|
|
778
|
-
useSuspenseQuery<T extends PublicCollection
|
|
779
|
-
useQueryById<T extends PublicCollection
|
|
780
|
-
useSuspenseQueryById<T extends PublicCollection
|
|
781
|
-
useInfiniteQuery<T extends PublicCollection
|
|
782
|
-
useSuspenseInfiniteQuery<T extends PublicCollection
|
|
789
|
+
useQuery<T extends PublicCollection, TData = PayloadFindResponse<CollectionType<T>>>(params: CollectionQueryParams<T>, options?: QueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<TData>, Error>;
|
|
790
|
+
useSuspenseQuery<T extends PublicCollection, TData = PayloadFindResponse<CollectionType<T>>>(params: CollectionQueryParams<T>, options?: SuspenseQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseSuspenseQueryResult<TData, Error>;
|
|
791
|
+
useQueryById<T extends PublicCollection, TData = CollectionType<T>>(params: CollectionDetailQueryParams<T>, options?: QueryOptions<CollectionType<T>, TData>): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<TData>, Error>;
|
|
792
|
+
useSuspenseQueryById<T extends PublicCollection, TData = CollectionType<T>>(params: CollectionDetailQueryParams<T>, options?: SuspenseQueryOptions<CollectionType<T>, TData>): _tanstack_react_query.UseSuspenseQueryResult<TData, Error>;
|
|
793
|
+
useInfiniteQuery<T extends PublicCollection, TData = InfiniteData<PayloadFindResponse<CollectionType<T>>>>(params: CollectionInfiniteQueryParams<T>, options?: InfiniteQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseInfiniteQueryResult<TData, Error>;
|
|
794
|
+
useSuspenseInfiniteQuery<T extends PublicCollection, TData = InfiniteData<PayloadFindResponse<CollectionType<T>>>>(params: CollectionInfiniteQueryParams<T>, options?: SuspenseInfiniteQueryOptions<PayloadFindResponse<CollectionType<T>>, TData>): _tanstack_react_query.UseSuspenseInfiniteQueryResult<TData, Error>;
|
|
783
795
|
prefetchQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
784
796
|
staleTime?: number;
|
|
785
797
|
}): Promise<void>;
|
|
@@ -809,9 +821,9 @@ declare class CollectionHooks {
|
|
|
809
821
|
collection: T;
|
|
810
822
|
}, options?: MutationCallbacks$1<CollectionType<T>>): _tanstack_react_query.UseMutationResult<CollectionType<T>, SDKError, string, unknown>;
|
|
811
823
|
invalidateQueries<T extends PublicCollection>(collection: T, type?: 'list' | 'detail' | 'infinite'): Promise<void>;
|
|
812
|
-
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): CollectionType<T
|
|
824
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): PayloadFindResponse<CollectionType<T>> | undefined;
|
|
813
825
|
getQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string, options?: ApiQueryOptions): CollectionType<T> | null | undefined;
|
|
814
|
-
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: CollectionType<T
|
|
826
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: PayloadFindResponse<CollectionType<T>>, options?: ApiQueryOptions): void;
|
|
815
827
|
setQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string, data: CollectionType<T> | null, options?: ApiQueryOptions): void;
|
|
816
828
|
}
|
|
817
829
|
|
|
@@ -831,7 +843,7 @@ declare class CustomerHooks {
|
|
|
831
843
|
staleTime?: number;
|
|
832
844
|
gcTime?: number;
|
|
833
845
|
refetchOnWindowFocus?: boolean;
|
|
834
|
-
refetchOnMount?: boolean;
|
|
846
|
+
refetchOnMount?: boolean | 'always';
|
|
835
847
|
refetchInterval?: number | false;
|
|
836
848
|
retry?: boolean | number;
|
|
837
849
|
}): _tanstack_react_query.UseQueryResult<CustomerProfile | null, Error>;
|
|
@@ -956,4 +968,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
956
968
|
*/
|
|
957
969
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
958
970
|
|
|
959
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type
|
|
971
|
+
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, 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, type InfiniteQueryOptions, NetworkError, Order, OrderApi, type OrderApiOptions, OrderProduct, 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 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
|
@@ -1627,14 +1627,15 @@ var CollectionHooks = class {
|
|
|
1627
1627
|
// ===== useQuery =====
|
|
1628
1628
|
useQuery(params, options) {
|
|
1629
1629
|
const { collection, options: queryOptions } = params;
|
|
1630
|
-
|
|
1630
|
+
const _a = options != null ? options : {}, { placeholderData } = _a, restOptions = __objRest(_a, ["placeholderData"]);
|
|
1631
|
+
return useQueryOriginal(__spreadValues(__spreadValues({
|
|
1631
1632
|
queryKey: collectionKeys(collection).list(queryOptions),
|
|
1632
1633
|
queryFn: () => __async(this, null, function* () {
|
|
1633
|
-
|
|
1634
|
-
const response = yield this.collectionClient.from(collection).find(queryOptions);
|
|
1635
|
-
return (_a = response.docs) != null ? _a : [];
|
|
1634
|
+
return yield this.collectionClient.from(collection).find(queryOptions);
|
|
1636
1635
|
})
|
|
1637
|
-
},
|
|
1636
|
+
}, restOptions), placeholderData !== void 0 && {
|
|
1637
|
+
placeholderData
|
|
1638
|
+
}));
|
|
1638
1639
|
}
|
|
1639
1640
|
// ===== useSuspenseQuery =====
|
|
1640
1641
|
useSuspenseQuery(params, options) {
|
|
@@ -1642,21 +1643,22 @@ var CollectionHooks = class {
|
|
|
1642
1643
|
return useSuspenseQueryOriginal(__spreadValues({
|
|
1643
1644
|
queryKey: collectionKeys(collection).list(queryOptions),
|
|
1644
1645
|
queryFn: () => __async(this, null, function* () {
|
|
1645
|
-
|
|
1646
|
-
const response = yield this.collectionClient.from(collection).find(queryOptions);
|
|
1647
|
-
return (_a = response.docs) != null ? _a : [];
|
|
1646
|
+
return yield this.collectionClient.from(collection).find(queryOptions);
|
|
1648
1647
|
})
|
|
1649
1648
|
}, options));
|
|
1650
1649
|
}
|
|
1651
1650
|
// ===== useQueryById =====
|
|
1652
1651
|
useQueryById(params, options) {
|
|
1653
1652
|
const { collection, id, options: queryOptions } = params;
|
|
1654
|
-
|
|
1653
|
+
const _a = options != null ? options : {}, { placeholderData } = _a, restOptions = __objRest(_a, ["placeholderData"]);
|
|
1654
|
+
return useQueryOriginal(__spreadValues(__spreadValues({
|
|
1655
1655
|
queryKey: collectionKeys(collection).detail(id, queryOptions),
|
|
1656
1656
|
queryFn: () => __async(this, null, function* () {
|
|
1657
1657
|
return yield this.collectionClient.from(collection).findById(id, queryOptions);
|
|
1658
1658
|
})
|
|
1659
|
-
},
|
|
1659
|
+
}, restOptions), placeholderData !== void 0 && {
|
|
1660
|
+
placeholderData
|
|
1661
|
+
}));
|
|
1660
1662
|
}
|
|
1661
1663
|
// ===== useSuspenseQueryById =====
|
|
1662
1664
|
useSuspenseQueryById(params, options) {
|
|
@@ -1713,9 +1715,7 @@ var CollectionHooks = class {
|
|
|
1713
1715
|
return this.queryClient.prefetchQuery(__spreadValues({
|
|
1714
1716
|
queryKey: collectionKeys(collection).list(queryOptions),
|
|
1715
1717
|
queryFn: () => __async(this, null, function* () {
|
|
1716
|
-
|
|
1717
|
-
const response = yield this.collectionClient.from(collection).find(queryOptions);
|
|
1718
|
-
return (_a = response.docs) != null ? _a : [];
|
|
1718
|
+
return yield this.collectionClient.from(collection).find(queryOptions);
|
|
1719
1719
|
})
|
|
1720
1720
|
}, options));
|
|
1721
1721
|
});
|