@01.software/sdk 0.1.2 → 0.1.4
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-AVOXtnYN.d.cts → auth-BUG7f-rJ.d.cts} +1 -1
- package/dist/{auth-c2UWJjPa.d.ts → auth-BetnGy2v.d.ts} +1 -1
- package/dist/auth.d.cts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -33
- package/dist/index.d.ts +33 -33
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DFzDtXGO.d.cts → payload-types-BjyFdz5j.d.cts} +205 -1
- package/dist/{payload-types-DFzDtXGO.d.ts → payload-types-BjyFdz5j.d.ts} +205 -1
- package/dist/{webhook-CGpSMkNA.d.ts → webhook-BbT5xP-e.d.cts} +7 -12
- package/dist/{webhook-DJCQSO6S.d.cts → webhook-Cgywcim7.d.ts} +7 -12
- package/dist/webhook.d.cts +2 -2
- package/dist/webhook.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, P as ProductOption } from './payload-types-
|
|
2
|
-
export { i as ApiUsage,
|
|
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-
|
|
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-
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, P as ProductOption } from './payload-types-BjyFdz5j.cjs';
|
|
2
|
+
export { i as ApiUsage, a3 as ApiUsageSelect, A as Audience, Z as AudiencesSelect, aC as Auth, u as Author, an as AuthorsSelect, k as BillingHistory, a5 as BillingHistorySelect, p as Brand, B as BrandLogo, ad as BrandLogosSelect, ac as BrandsSelect, c as CodeBlock, C as Config, D as Document, ap as DocumentCategoriesSelect, x as DocumentCategory, y as DocumentImage, aq as DocumentImagesSelect, ao as DocumentsSelect, E as EmailLog, _ as EmailLogsSelect, K as Form, L as FormSubmission, ax as FormSubmissionsSelect, aw as FormsSelect, au as GalleriesSelect, H as Gallery, J as GalleryImage, av as GalleryImagesSelect, I as IframeBlock, M as Media, Y as MediaSelect, G as Music, at as MusicsSelect, af as OrderProductsSelect, ae as OrdersSelect, N as PayloadKv, ay as PayloadKvSelect, Q as PayloadLockedDocument, az as PayloadLockedDocumentsSelect, W as PayloadMigration, aB as PayloadMigrationsSelect, V as PayloadPreference, aA as PayloadPreferencesSelect, b as PlayerBlock, z as Playlist, F as PlaylistImage, as as PlaylistImagesSelect, ar as PlaylistsSelect, s as Post, ak as PostCategoriesSelect, v as PostCategory, t as PostImage, am as PostImagesSelect, w as PostTag, al as PostTagsSelect, aj as PostsSelect, l as Product, a9 as ProductCategoriesSelect, n as ProductCategory, m as ProductImage, ab as ProductImagesSelect, a8 as ProductOptionsSelect, o as ProductTag, aa as ProductTagsSelect, q as ProductVariant, a7 as ProductVariantsSelect, a6 as ProductsSelect, R as Return, r as ReturnProduct, ah as ReturnProductsSelect, ag as ReturnsSelect, j as Subscription, a4 as SubscriptionsSelect, S as SupportedTimezones, e as Tenant, h as TenantLogo, a1 as TenantLogosSelect, a0 as TenantMetadataSelect, f as TenantMetadatum, g as TenantOgImage, a2 as TenantOgImagesSelect, $ as TenantsSelect, ai as TransactionsSelect, d as User, U as UserAuthOperations, X as UsersSelect } from './payload-types-BjyFdz5j.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-BUG7f-rJ.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-BUG7f-rJ.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import {
|
|
8
|
-
export { b as COLLECTIONS,
|
|
7
|
+
import { P as PublicCollection, C as CollectionType } from './webhook-BbT5xP-e.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-BbT5xP-e.cjs';
|
|
9
9
|
export { RichTextContent, RichTextContentProps, RichTextData } from './components.cjs';
|
|
10
10
|
import 'payload';
|
|
11
11
|
import 'react';
|
|
@@ -40,7 +40,7 @@ declare class HttpClient {
|
|
|
40
40
|
|
|
41
41
|
declare class CollectionClient extends HttpClient {
|
|
42
42
|
constructor(clientKey: string, secretKey?: string, baseUrl?: string);
|
|
43
|
-
from<T extends
|
|
43
|
+
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
44
44
|
/**
|
|
45
45
|
* Find documents (list query)
|
|
46
46
|
* GET /api/{collection}
|
|
@@ -94,8 +94,8 @@ declare class CollectionClient extends HttpClient {
|
|
|
94
94
|
* Read-only subset of CollectionQueryBuilder.
|
|
95
95
|
* BrowserClient.from() returns this type to prevent write operations at compile time.
|
|
96
96
|
*/
|
|
97
|
-
type ReadOnlyQueryBuilder<T extends
|
|
98
|
-
declare class CollectionQueryBuilder<T extends
|
|
97
|
+
type ReadOnlyQueryBuilder<T extends PublicCollection> = Pick<CollectionQueryBuilder<T>, 'find' | 'findById' | 'count'>;
|
|
98
|
+
declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
99
99
|
private api;
|
|
100
100
|
private collection;
|
|
101
101
|
constructor(api: CollectionClient, collection: T);
|
|
@@ -151,7 +151,7 @@ declare class CollectionQueryBuilder<T extends Collection> {
|
|
|
151
151
|
removeMany(where: ApiQueryOptions['where']): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
declare function collectionKeys<T extends
|
|
154
|
+
declare function collectionKeys<T extends PublicCollection>(collection: T): {
|
|
155
155
|
all: readonly [T];
|
|
156
156
|
lists: () => readonly [T, "list"];
|
|
157
157
|
list: (options?: ApiQueryOptions) => readonly [T, "list", ApiQueryOptions | undefined];
|
|
@@ -160,16 +160,16 @@ declare function collectionKeys<T extends Collection>(collection: T): {
|
|
|
160
160
|
infinites: () => readonly [T, "infinite"];
|
|
161
161
|
infinite: (options?: Omit<ApiQueryOptions, "page">) => readonly [T, "infinite", Omit<ApiQueryOptions, "page"> | undefined];
|
|
162
162
|
};
|
|
163
|
-
interface CollectionQueryParams<T extends
|
|
163
|
+
interface CollectionQueryParams<T extends PublicCollection> {
|
|
164
164
|
collection: T;
|
|
165
165
|
options?: ApiQueryOptions;
|
|
166
166
|
}
|
|
167
|
-
interface CollectionDetailQueryParams<T extends
|
|
167
|
+
interface CollectionDetailQueryParams<T extends PublicCollection> {
|
|
168
168
|
collection: T;
|
|
169
169
|
id: string | number;
|
|
170
170
|
options?: ApiQueryOptions;
|
|
171
171
|
}
|
|
172
|
-
interface CollectionInfiniteQueryParams<T extends
|
|
172
|
+
interface CollectionInfiniteQueryParams<T extends PublicCollection> {
|
|
173
173
|
collection: T;
|
|
174
174
|
options?: Omit<ApiQueryOptions, 'page'>;
|
|
175
175
|
pageSize?: number;
|
|
@@ -178,7 +178,7 @@ declare class QueryHooks {
|
|
|
178
178
|
private queryClient;
|
|
179
179
|
private collectionClient;
|
|
180
180
|
constructor(queryClient: QueryClient, collectionClient: CollectionClient);
|
|
181
|
-
useQuery<T extends
|
|
181
|
+
useQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
182
182
|
enabled?: boolean;
|
|
183
183
|
staleTime?: number;
|
|
184
184
|
gcTime?: number;
|
|
@@ -187,7 +187,7 @@ declare class QueryHooks {
|
|
|
187
187
|
refetchInterval?: number | false;
|
|
188
188
|
retry?: boolean | number;
|
|
189
189
|
}): _tanstack_react_query.UseQueryResult<CollectionType<T>[], Error>;
|
|
190
|
-
useSuspenseQuery<T extends
|
|
190
|
+
useSuspenseQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
191
191
|
staleTime?: number;
|
|
192
192
|
gcTime?: number;
|
|
193
193
|
refetchOnWindowFocus?: boolean;
|
|
@@ -195,7 +195,7 @@ declare class QueryHooks {
|
|
|
195
195
|
refetchInterval?: number | false;
|
|
196
196
|
retry?: boolean | number;
|
|
197
197
|
}): _tanstack_react_query.UseSuspenseQueryResult<CollectionType<T>[], Error>;
|
|
198
|
-
useQueryById<T extends
|
|
198
|
+
useQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
199
199
|
enabled?: boolean;
|
|
200
200
|
staleTime?: number;
|
|
201
201
|
gcTime?: number;
|
|
@@ -204,7 +204,7 @@ declare class QueryHooks {
|
|
|
204
204
|
refetchInterval?: number | false;
|
|
205
205
|
retry?: boolean | number;
|
|
206
206
|
}): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<CollectionType<T>>, Error>;
|
|
207
|
-
useSuspenseQueryById<T extends
|
|
207
|
+
useSuspenseQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
208
208
|
staleTime?: number;
|
|
209
209
|
gcTime?: number;
|
|
210
210
|
refetchOnWindowFocus?: boolean;
|
|
@@ -212,7 +212,7 @@ declare class QueryHooks {
|
|
|
212
212
|
refetchInterval?: number | false;
|
|
213
213
|
retry?: boolean | number;
|
|
214
214
|
}): _tanstack_react_query.UseSuspenseQueryResult<CollectionType<T>, Error>;
|
|
215
|
-
useInfiniteQuery<T extends
|
|
215
|
+
useInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
216
216
|
enabled?: boolean;
|
|
217
217
|
staleTime?: number;
|
|
218
218
|
gcTime?: number;
|
|
@@ -220,31 +220,31 @@ declare class QueryHooks {
|
|
|
220
220
|
refetchOnMount?: boolean;
|
|
221
221
|
retry?: boolean | number;
|
|
222
222
|
}): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PayloadFindResponse<CollectionType<T>>, unknown>, Error>;
|
|
223
|
-
useSuspenseInfiniteQuery<T extends
|
|
223
|
+
useSuspenseInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
224
224
|
staleTime?: number;
|
|
225
225
|
gcTime?: number;
|
|
226
226
|
refetchOnWindowFocus?: boolean;
|
|
227
227
|
refetchOnMount?: boolean;
|
|
228
228
|
retry?: boolean | number;
|
|
229
229
|
}): _tanstack_react_query.UseSuspenseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PayloadFindResponse<CollectionType<T>>, unknown>, Error>;
|
|
230
|
-
prefetchQuery<T extends
|
|
230
|
+
prefetchQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
231
231
|
staleTime?: number;
|
|
232
232
|
}): Promise<void>;
|
|
233
|
-
prefetchQueryById<T extends
|
|
233
|
+
prefetchQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
234
234
|
staleTime?: number;
|
|
235
235
|
}): Promise<void>;
|
|
236
|
-
prefetchInfiniteQuery<T extends
|
|
236
|
+
prefetchInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
237
237
|
pages?: number;
|
|
238
238
|
staleTime?: number;
|
|
239
239
|
}): Promise<void>;
|
|
240
|
-
useCreate<T extends
|
|
240
|
+
useCreate<T extends PublicCollection>(params: {
|
|
241
241
|
collection: T;
|
|
242
242
|
}, options?: {
|
|
243
243
|
onSuccess?: (data: PayloadMutationResponse<CollectionType<T>>) => void;
|
|
244
244
|
onError?: (error: Error) => void;
|
|
245
245
|
onSettled?: () => void;
|
|
246
246
|
}): _tanstack_react_query.UseMutationResult<PayloadMutationResponse<CollectionType<T>>, Error, Partial<CollectionType<T>>, unknown>;
|
|
247
|
-
useUpdate<T extends
|
|
247
|
+
useUpdate<T extends PublicCollection>(params: {
|
|
248
248
|
collection: T;
|
|
249
249
|
}, options?: {
|
|
250
250
|
onSuccess?: (data: PayloadMutationResponse<CollectionType<T>>) => void;
|
|
@@ -254,18 +254,18 @@ declare class QueryHooks {
|
|
|
254
254
|
id: string | number;
|
|
255
255
|
data: Partial<CollectionType<T>>;
|
|
256
256
|
}, unknown>;
|
|
257
|
-
useRemove<T extends
|
|
257
|
+
useRemove<T extends PublicCollection>(params: {
|
|
258
258
|
collection: T;
|
|
259
259
|
}, options?: {
|
|
260
260
|
onSuccess?: (data: CollectionType<T>) => void;
|
|
261
261
|
onError?: (error: Error) => void;
|
|
262
262
|
onSettled?: () => void;
|
|
263
263
|
}): _tanstack_react_query.UseMutationResult<CollectionType<T>, Error, string | number, unknown>;
|
|
264
|
-
invalidateQueries<T extends
|
|
265
|
-
getQueryData<T extends
|
|
266
|
-
getQueryData<T extends
|
|
267
|
-
setQueryData<T extends
|
|
268
|
-
setQueryData<T extends
|
|
264
|
+
invalidateQueries<T extends PublicCollection>(collection: T, type?: 'list' | 'detail' | 'infinite'): Promise<void>;
|
|
265
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): CollectionType<T>[] | undefined;
|
|
266
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string | number, options?: ApiQueryOptions): CollectionType<T> | null | undefined;
|
|
267
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: CollectionType<T>[], options?: ApiQueryOptions): void;
|
|
268
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string | number, data: CollectionType<T> | null, options?: ApiQueryOptions): void;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
declare class BrowserClient {
|
|
@@ -276,7 +276,7 @@ declare class BrowserClient {
|
|
|
276
276
|
protected config: ClientBrowserConfig;
|
|
277
277
|
protected baseUrl: string;
|
|
278
278
|
constructor(options: ClientBrowserConfig);
|
|
279
|
-
from<T extends
|
|
279
|
+
from<T extends PublicCollection>(collection: T): ReadOnlyQueryBuilder<T>;
|
|
280
280
|
getState(): ClientState;
|
|
281
281
|
}
|
|
282
282
|
declare function createBrowserClient(options: ClientBrowserConfig): BrowserClient;
|
|
@@ -324,7 +324,7 @@ declare class ServerClient {
|
|
|
324
324
|
protected config: ClientServerConfig;
|
|
325
325
|
protected baseUrl: string;
|
|
326
326
|
constructor(options: ClientServerConfig);
|
|
327
|
-
from<T extends
|
|
327
|
+
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
328
328
|
getState(): ClientState;
|
|
329
329
|
getConfig(): ClientBrowserConfig;
|
|
330
330
|
}
|
|
@@ -349,4 +349,4 @@ declare const resolveRelation: <T>(ref: T | number | null | undefined) => T | nu
|
|
|
349
349
|
/** @deprecated Use `resolveRelation` instead */
|
|
350
350
|
declare const objectFor: <T>(ref: T | number | null | undefined) => T | null;
|
|
351
351
|
|
|
352
|
-
export { ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, ClientBrowserConfig, ClientServerConfig, ClientState,
|
|
352
|
+
export { ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, ProductOption, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, ServerClient, ServerClient as ServerClientType, Transaction, type UpdateOrderParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, 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, P as ProductOption } from './payload-types-
|
|
2
|
-
export { i as ApiUsage,
|
|
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-
|
|
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-
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, P as ProductOption } from './payload-types-BjyFdz5j.js';
|
|
2
|
+
export { i as ApiUsage, a3 as ApiUsageSelect, A as Audience, Z as AudiencesSelect, aC as Auth, u as Author, an as AuthorsSelect, k as BillingHistory, a5 as BillingHistorySelect, p as Brand, B as BrandLogo, ad as BrandLogosSelect, ac as BrandsSelect, c as CodeBlock, C as Config, D as Document, ap as DocumentCategoriesSelect, x as DocumentCategory, y as DocumentImage, aq as DocumentImagesSelect, ao as DocumentsSelect, E as EmailLog, _ as EmailLogsSelect, K as Form, L as FormSubmission, ax as FormSubmissionsSelect, aw as FormsSelect, au as GalleriesSelect, H as Gallery, J as GalleryImage, av as GalleryImagesSelect, I as IframeBlock, M as Media, Y as MediaSelect, G as Music, at as MusicsSelect, af as OrderProductsSelect, ae as OrdersSelect, N as PayloadKv, ay as PayloadKvSelect, Q as PayloadLockedDocument, az as PayloadLockedDocumentsSelect, W as PayloadMigration, aB as PayloadMigrationsSelect, V as PayloadPreference, aA as PayloadPreferencesSelect, b as PlayerBlock, z as Playlist, F as PlaylistImage, as as PlaylistImagesSelect, ar as PlaylistsSelect, s as Post, ak as PostCategoriesSelect, v as PostCategory, t as PostImage, am as PostImagesSelect, w as PostTag, al as PostTagsSelect, aj as PostsSelect, l as Product, a9 as ProductCategoriesSelect, n as ProductCategory, m as ProductImage, ab as ProductImagesSelect, a8 as ProductOptionsSelect, o as ProductTag, aa as ProductTagsSelect, q as ProductVariant, a7 as ProductVariantsSelect, a6 as ProductsSelect, R as Return, r as ReturnProduct, ah as ReturnProductsSelect, ag as ReturnsSelect, j as Subscription, a4 as SubscriptionsSelect, S as SupportedTimezones, e as Tenant, h as TenantLogo, a1 as TenantLogosSelect, a0 as TenantMetadataSelect, f as TenantMetadatum, g as TenantOgImage, a2 as TenantOgImagesSelect, $ as TenantsSelect, ai as TransactionsSelect, d as User, U as UserAuthOperations, X as UsersSelect } from './payload-types-BjyFdz5j.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-BetnGy2v.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-BetnGy2v.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import {
|
|
8
|
-
export { b as COLLECTIONS,
|
|
7
|
+
import { P as PublicCollection, C as CollectionType } from './webhook-Cgywcim7.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-Cgywcim7.js';
|
|
9
9
|
export { RichTextContent, RichTextContentProps, RichTextData } from './components.js';
|
|
10
10
|
import 'payload';
|
|
11
11
|
import 'react';
|
|
@@ -40,7 +40,7 @@ declare class HttpClient {
|
|
|
40
40
|
|
|
41
41
|
declare class CollectionClient extends HttpClient {
|
|
42
42
|
constructor(clientKey: string, secretKey?: string, baseUrl?: string);
|
|
43
|
-
from<T extends
|
|
43
|
+
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
44
44
|
/**
|
|
45
45
|
* Find documents (list query)
|
|
46
46
|
* GET /api/{collection}
|
|
@@ -94,8 +94,8 @@ declare class CollectionClient extends HttpClient {
|
|
|
94
94
|
* Read-only subset of CollectionQueryBuilder.
|
|
95
95
|
* BrowserClient.from() returns this type to prevent write operations at compile time.
|
|
96
96
|
*/
|
|
97
|
-
type ReadOnlyQueryBuilder<T extends
|
|
98
|
-
declare class CollectionQueryBuilder<T extends
|
|
97
|
+
type ReadOnlyQueryBuilder<T extends PublicCollection> = Pick<CollectionQueryBuilder<T>, 'find' | 'findById' | 'count'>;
|
|
98
|
+
declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
99
99
|
private api;
|
|
100
100
|
private collection;
|
|
101
101
|
constructor(api: CollectionClient, collection: T);
|
|
@@ -151,7 +151,7 @@ declare class CollectionQueryBuilder<T extends Collection> {
|
|
|
151
151
|
removeMany(where: ApiQueryOptions['where']): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
declare function collectionKeys<T extends
|
|
154
|
+
declare function collectionKeys<T extends PublicCollection>(collection: T): {
|
|
155
155
|
all: readonly [T];
|
|
156
156
|
lists: () => readonly [T, "list"];
|
|
157
157
|
list: (options?: ApiQueryOptions) => readonly [T, "list", ApiQueryOptions | undefined];
|
|
@@ -160,16 +160,16 @@ declare function collectionKeys<T extends Collection>(collection: T): {
|
|
|
160
160
|
infinites: () => readonly [T, "infinite"];
|
|
161
161
|
infinite: (options?: Omit<ApiQueryOptions, "page">) => readonly [T, "infinite", Omit<ApiQueryOptions, "page"> | undefined];
|
|
162
162
|
};
|
|
163
|
-
interface CollectionQueryParams<T extends
|
|
163
|
+
interface CollectionQueryParams<T extends PublicCollection> {
|
|
164
164
|
collection: T;
|
|
165
165
|
options?: ApiQueryOptions;
|
|
166
166
|
}
|
|
167
|
-
interface CollectionDetailQueryParams<T extends
|
|
167
|
+
interface CollectionDetailQueryParams<T extends PublicCollection> {
|
|
168
168
|
collection: T;
|
|
169
169
|
id: string | number;
|
|
170
170
|
options?: ApiQueryOptions;
|
|
171
171
|
}
|
|
172
|
-
interface CollectionInfiniteQueryParams<T extends
|
|
172
|
+
interface CollectionInfiniteQueryParams<T extends PublicCollection> {
|
|
173
173
|
collection: T;
|
|
174
174
|
options?: Omit<ApiQueryOptions, 'page'>;
|
|
175
175
|
pageSize?: number;
|
|
@@ -178,7 +178,7 @@ declare class QueryHooks {
|
|
|
178
178
|
private queryClient;
|
|
179
179
|
private collectionClient;
|
|
180
180
|
constructor(queryClient: QueryClient, collectionClient: CollectionClient);
|
|
181
|
-
useQuery<T extends
|
|
181
|
+
useQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
182
182
|
enabled?: boolean;
|
|
183
183
|
staleTime?: number;
|
|
184
184
|
gcTime?: number;
|
|
@@ -187,7 +187,7 @@ declare class QueryHooks {
|
|
|
187
187
|
refetchInterval?: number | false;
|
|
188
188
|
retry?: boolean | number;
|
|
189
189
|
}): _tanstack_react_query.UseQueryResult<CollectionType<T>[], Error>;
|
|
190
|
-
useSuspenseQuery<T extends
|
|
190
|
+
useSuspenseQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
191
191
|
staleTime?: number;
|
|
192
192
|
gcTime?: number;
|
|
193
193
|
refetchOnWindowFocus?: boolean;
|
|
@@ -195,7 +195,7 @@ declare class QueryHooks {
|
|
|
195
195
|
refetchInterval?: number | false;
|
|
196
196
|
retry?: boolean | number;
|
|
197
197
|
}): _tanstack_react_query.UseSuspenseQueryResult<CollectionType<T>[], Error>;
|
|
198
|
-
useQueryById<T extends
|
|
198
|
+
useQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
199
199
|
enabled?: boolean;
|
|
200
200
|
staleTime?: number;
|
|
201
201
|
gcTime?: number;
|
|
@@ -204,7 +204,7 @@ declare class QueryHooks {
|
|
|
204
204
|
refetchInterval?: number | false;
|
|
205
205
|
retry?: boolean | number;
|
|
206
206
|
}): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<CollectionType<T>>, Error>;
|
|
207
|
-
useSuspenseQueryById<T extends
|
|
207
|
+
useSuspenseQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
208
208
|
staleTime?: number;
|
|
209
209
|
gcTime?: number;
|
|
210
210
|
refetchOnWindowFocus?: boolean;
|
|
@@ -212,7 +212,7 @@ declare class QueryHooks {
|
|
|
212
212
|
refetchInterval?: number | false;
|
|
213
213
|
retry?: boolean | number;
|
|
214
214
|
}): _tanstack_react_query.UseSuspenseQueryResult<CollectionType<T>, Error>;
|
|
215
|
-
useInfiniteQuery<T extends
|
|
215
|
+
useInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
216
216
|
enabled?: boolean;
|
|
217
217
|
staleTime?: number;
|
|
218
218
|
gcTime?: number;
|
|
@@ -220,31 +220,31 @@ declare class QueryHooks {
|
|
|
220
220
|
refetchOnMount?: boolean;
|
|
221
221
|
retry?: boolean | number;
|
|
222
222
|
}): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PayloadFindResponse<CollectionType<T>>, unknown>, Error>;
|
|
223
|
-
useSuspenseInfiniteQuery<T extends
|
|
223
|
+
useSuspenseInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
224
224
|
staleTime?: number;
|
|
225
225
|
gcTime?: number;
|
|
226
226
|
refetchOnWindowFocus?: boolean;
|
|
227
227
|
refetchOnMount?: boolean;
|
|
228
228
|
retry?: boolean | number;
|
|
229
229
|
}): _tanstack_react_query.UseSuspenseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PayloadFindResponse<CollectionType<T>>, unknown>, Error>;
|
|
230
|
-
prefetchQuery<T extends
|
|
230
|
+
prefetchQuery<T extends PublicCollection>(params: CollectionQueryParams<T>, options?: {
|
|
231
231
|
staleTime?: number;
|
|
232
232
|
}): Promise<void>;
|
|
233
|
-
prefetchQueryById<T extends
|
|
233
|
+
prefetchQueryById<T extends PublicCollection>(params: CollectionDetailQueryParams<T>, options?: {
|
|
234
234
|
staleTime?: number;
|
|
235
235
|
}): Promise<void>;
|
|
236
|
-
prefetchInfiniteQuery<T extends
|
|
236
|
+
prefetchInfiniteQuery<T extends PublicCollection>(params: CollectionInfiniteQueryParams<T>, options?: {
|
|
237
237
|
pages?: number;
|
|
238
238
|
staleTime?: number;
|
|
239
239
|
}): Promise<void>;
|
|
240
|
-
useCreate<T extends
|
|
240
|
+
useCreate<T extends PublicCollection>(params: {
|
|
241
241
|
collection: T;
|
|
242
242
|
}, options?: {
|
|
243
243
|
onSuccess?: (data: PayloadMutationResponse<CollectionType<T>>) => void;
|
|
244
244
|
onError?: (error: Error) => void;
|
|
245
245
|
onSettled?: () => void;
|
|
246
246
|
}): _tanstack_react_query.UseMutationResult<PayloadMutationResponse<CollectionType<T>>, Error, Partial<CollectionType<T>>, unknown>;
|
|
247
|
-
useUpdate<T extends
|
|
247
|
+
useUpdate<T extends PublicCollection>(params: {
|
|
248
248
|
collection: T;
|
|
249
249
|
}, options?: {
|
|
250
250
|
onSuccess?: (data: PayloadMutationResponse<CollectionType<T>>) => void;
|
|
@@ -254,18 +254,18 @@ declare class QueryHooks {
|
|
|
254
254
|
id: string | number;
|
|
255
255
|
data: Partial<CollectionType<T>>;
|
|
256
256
|
}, unknown>;
|
|
257
|
-
useRemove<T extends
|
|
257
|
+
useRemove<T extends PublicCollection>(params: {
|
|
258
258
|
collection: T;
|
|
259
259
|
}, options?: {
|
|
260
260
|
onSuccess?: (data: CollectionType<T>) => void;
|
|
261
261
|
onError?: (error: Error) => void;
|
|
262
262
|
onSettled?: () => void;
|
|
263
263
|
}): _tanstack_react_query.UseMutationResult<CollectionType<T>, Error, string | number, unknown>;
|
|
264
|
-
invalidateQueries<T extends
|
|
265
|
-
getQueryData<T extends
|
|
266
|
-
getQueryData<T extends
|
|
267
|
-
setQueryData<T extends
|
|
268
|
-
setQueryData<T extends
|
|
264
|
+
invalidateQueries<T extends PublicCollection>(collection: T, type?: 'list' | 'detail' | 'infinite'): Promise<void>;
|
|
265
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'list', options?: ApiQueryOptions): CollectionType<T>[] | undefined;
|
|
266
|
+
getQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string | number, options?: ApiQueryOptions): CollectionType<T> | null | undefined;
|
|
267
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'list', data: CollectionType<T>[], options?: ApiQueryOptions): void;
|
|
268
|
+
setQueryData<T extends PublicCollection>(collection: T, type: 'detail', id: string | number, data: CollectionType<T> | null, options?: ApiQueryOptions): void;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
declare class BrowserClient {
|
|
@@ -276,7 +276,7 @@ declare class BrowserClient {
|
|
|
276
276
|
protected config: ClientBrowserConfig;
|
|
277
277
|
protected baseUrl: string;
|
|
278
278
|
constructor(options: ClientBrowserConfig);
|
|
279
|
-
from<T extends
|
|
279
|
+
from<T extends PublicCollection>(collection: T): ReadOnlyQueryBuilder<T>;
|
|
280
280
|
getState(): ClientState;
|
|
281
281
|
}
|
|
282
282
|
declare function createBrowserClient(options: ClientBrowserConfig): BrowserClient;
|
|
@@ -324,7 +324,7 @@ declare class ServerClient {
|
|
|
324
324
|
protected config: ClientServerConfig;
|
|
325
325
|
protected baseUrl: string;
|
|
326
326
|
constructor(options: ClientServerConfig);
|
|
327
|
-
from<T extends
|
|
327
|
+
from<T extends PublicCollection>(collection: T): CollectionQueryBuilder<T>;
|
|
328
328
|
getState(): ClientState;
|
|
329
329
|
getConfig(): ClientBrowserConfig;
|
|
330
330
|
}
|
|
@@ -349,4 +349,4 @@ declare const resolveRelation: <T>(ref: T | number | null | undefined) => T | nu
|
|
|
349
349
|
/** @deprecated Use `resolveRelation` instead */
|
|
350
350
|
declare const objectFor: <T>(ref: T | number | null | undefined) => T | null;
|
|
351
351
|
|
|
352
|
-
export { ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, ClientBrowserConfig, ClientServerConfig, ClientState,
|
|
352
|
+
export { ApiQueryOptions, BrowserClient, BrowserClient as BrowserClientType, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, ProductOption, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, ServerClient, ServerClient as ServerClientType, Transaction, type UpdateOrderParams, type UpdateTransactionParams, collectionKeys, createBrowserClient, createServerClient, formatOrderName, generateOrderNumber, getQueryClient, objectFor, resolveRelation };
|