@01.software/sdk 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/{const-_gW__LA1.d.ts → const-B9oeZoDy.d.ts} +2 -2
- package/dist/{const-zEoxAfGX.d.cts → const-CkhnGqnb.d.cts} +2 -2
- package/dist/index.cjs +59 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -43
- package/dist/index.d.ts +27 -43
- package/dist/index.js +59 -56
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-Cwnj_qN4.d.cts → payload-types-DfQct8Dj.d.cts} +335 -103
- package/dist/{payload-types-Cwnj_qN4.d.ts → payload-types-DfQct8Dj.d.ts} +335 -103
- 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-ger4JSeS.d.ts → webhook-CJq7v5Da.d.cts} +7 -4
- package/dist/{webhook-Ce9uNv5c.d.cts → webhook-CKqXQInG.d.ts} +7 -4
- package/dist/webhook.cjs +24 -3
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/dist/webhook.js +24 -3
- package/dist/webhook.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-
|
|
2
|
-
export {
|
|
1
|
+
import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-DfQct8Dj.cjs';
|
|
2
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, D as Document, I as Image, h as Post, i as PostCategory, j as ProductVariant, k as Tenant, V as Video } from './payload-types-DfQct8Dj.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { C as CollectionType } from './webhook-
|
|
8
|
-
export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-
|
|
9
|
-
import { P as PublicCollection } from './const-
|
|
10
|
-
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-
|
|
7
|
+
import { C as CollectionType } from './webhook-CJq7v5Da.cjs';
|
|
8
|
+
export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-CJq7v5Da.cjs';
|
|
9
|
+
import { P as PublicCollection } from './const-CkhnGqnb.cjs';
|
|
10
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-CkhnGqnb.cjs';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.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';
|
|
@@ -39,13 +39,6 @@ interface ClientConfig {
|
|
|
39
39
|
}
|
|
40
40
|
interface ClientServerConfig extends ClientConfig {
|
|
41
41
|
secretKey: string;
|
|
42
|
-
/**
|
|
43
|
-
* Tenant ID for pat01_ API keys. When provided alongside a pat01_ key,
|
|
44
|
-
* every server request includes X-Tenant-Id so the API can scope the
|
|
45
|
-
* request to the correct tenant. Not needed for sk01_ keys (tenant is
|
|
46
|
-
* encoded in the key itself).
|
|
47
|
-
*/
|
|
48
|
-
tenantId?: string;
|
|
49
42
|
}
|
|
50
43
|
interface ClientMetadata {
|
|
51
44
|
userAgent?: string;
|
|
@@ -250,7 +243,6 @@ interface FetchOptions extends RequestInit {
|
|
|
250
243
|
publishableKey?: string;
|
|
251
244
|
secretKey?: string;
|
|
252
245
|
customerToken?: string;
|
|
253
|
-
tenantId?: string;
|
|
254
246
|
timeout?: number;
|
|
255
247
|
debug?: boolean | DebugConfig;
|
|
256
248
|
retry?: RetryConfig;
|
|
@@ -261,11 +253,10 @@ interface FetchOptions extends RequestInit {
|
|
|
261
253
|
declare class HttpClient {
|
|
262
254
|
protected publishableKey: string;
|
|
263
255
|
protected secretKey?: string;
|
|
264
|
-
protected tenantId?: string;
|
|
265
256
|
private getCustomerToken?;
|
|
266
257
|
private onUnauthorized?;
|
|
267
258
|
private onRequestId?;
|
|
268
|
-
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void
|
|
259
|
+
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void);
|
|
269
260
|
protected get defaultOptions(): FetchOptions;
|
|
270
261
|
protected fetchWithTracking(url: string, opts: FetchOptions): Promise<Response>;
|
|
271
262
|
protected buildUrl(endpoint: string, options?: ApiQueryOptions): string;
|
|
@@ -435,12 +426,11 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
435
426
|
interface CommunityClientOptions {
|
|
436
427
|
publishableKey?: string;
|
|
437
428
|
secretKey?: string;
|
|
438
|
-
tenantId?: string;
|
|
439
429
|
customerToken?: string | (() => string | null);
|
|
440
430
|
onUnauthorized?: () => Promise<string | null>;
|
|
441
431
|
onRequestId?: (id: string | null) => void;
|
|
442
432
|
}
|
|
443
|
-
interface
|
|
433
|
+
interface CommunityPost {
|
|
444
434
|
id: string;
|
|
445
435
|
title: string;
|
|
446
436
|
content: unknown;
|
|
@@ -454,7 +444,7 @@ interface Thread {
|
|
|
454
444
|
interface Comment {
|
|
455
445
|
id: string;
|
|
456
446
|
body: string;
|
|
457
|
-
|
|
447
|
+
post?: string;
|
|
458
448
|
parent?: string;
|
|
459
449
|
rootComment?: string;
|
|
460
450
|
createdAt?: string;
|
|
@@ -463,7 +453,7 @@ interface Comment {
|
|
|
463
453
|
}
|
|
464
454
|
interface Reaction {
|
|
465
455
|
id: string;
|
|
466
|
-
|
|
456
|
+
post?: string;
|
|
467
457
|
comment?: string;
|
|
468
458
|
type?: string;
|
|
469
459
|
createdAt?: string;
|
|
@@ -476,7 +466,7 @@ interface ReactionSummary {
|
|
|
476
466
|
}
|
|
477
467
|
interface Bookmark {
|
|
478
468
|
id: string;
|
|
479
|
-
|
|
469
|
+
post?: string;
|
|
480
470
|
createdAt?: string;
|
|
481
471
|
[key: string]: unknown;
|
|
482
472
|
}
|
|
@@ -502,47 +492,46 @@ interface PaginatedResponse<T> {
|
|
|
502
492
|
declare class CommunityClient {
|
|
503
493
|
private readonly publishableKey;
|
|
504
494
|
private readonly secretKey?;
|
|
505
|
-
private readonly tenantId?;
|
|
506
495
|
private readonly customerToken?;
|
|
507
496
|
private readonly onUnauthorized?;
|
|
508
497
|
private readonly onRequestId?;
|
|
509
498
|
constructor(options: CommunityClientOptions);
|
|
510
499
|
private buildQuery;
|
|
511
500
|
private execute;
|
|
512
|
-
|
|
501
|
+
createPost(params: {
|
|
513
502
|
title: string;
|
|
514
503
|
content: unknown;
|
|
515
504
|
categories?: string[];
|
|
516
505
|
thumbnail?: string;
|
|
517
|
-
}): Promise<
|
|
518
|
-
|
|
506
|
+
}): Promise<CommunityPost>;
|
|
507
|
+
getMyPosts(params?: {
|
|
519
508
|
page?: number;
|
|
520
509
|
limit?: number;
|
|
521
|
-
}): Promise<PaginatedResponse<
|
|
510
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
522
511
|
getTrending(params?: {
|
|
523
512
|
page?: number;
|
|
524
513
|
limit?: number;
|
|
525
514
|
period?: string;
|
|
526
|
-
}): Promise<PaginatedResponse<
|
|
515
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
527
516
|
incrementView(params: {
|
|
528
|
-
|
|
517
|
+
postId: string;
|
|
529
518
|
}): Promise<{
|
|
530
519
|
viewCount: number;
|
|
531
520
|
}>;
|
|
532
|
-
|
|
533
|
-
|
|
521
|
+
reportPost(params: {
|
|
522
|
+
postId: string;
|
|
534
523
|
reason?: string;
|
|
535
524
|
reasonDetail?: string;
|
|
536
525
|
}): Promise<{
|
|
537
526
|
success: boolean;
|
|
538
527
|
}>;
|
|
539
528
|
createComment(params: {
|
|
540
|
-
|
|
529
|
+
postId: string;
|
|
541
530
|
body: string;
|
|
542
531
|
parentId?: string;
|
|
543
532
|
}): Promise<Comment>;
|
|
544
533
|
listComments(params: {
|
|
545
|
-
|
|
534
|
+
postId: string;
|
|
546
535
|
page?: number;
|
|
547
536
|
limit?: number;
|
|
548
537
|
rootComment?: string;
|
|
@@ -564,11 +553,11 @@ declare class CommunityClient {
|
|
|
564
553
|
success: boolean;
|
|
565
554
|
}>;
|
|
566
555
|
addReaction(params: {
|
|
567
|
-
|
|
556
|
+
postId: string;
|
|
568
557
|
type: string;
|
|
569
558
|
}): Promise<Reaction>;
|
|
570
559
|
removeReaction(params: {
|
|
571
|
-
|
|
560
|
+
postId: string;
|
|
572
561
|
type: string;
|
|
573
562
|
}): Promise<{
|
|
574
563
|
success: boolean;
|
|
@@ -584,14 +573,14 @@ declare class CommunityClient {
|
|
|
584
573
|
success: boolean;
|
|
585
574
|
}>;
|
|
586
575
|
getReactionSummary(params: {
|
|
587
|
-
|
|
576
|
+
postId: string;
|
|
588
577
|
}): Promise<ReactionSummary>;
|
|
589
578
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
590
579
|
addBookmark(params: {
|
|
591
|
-
|
|
580
|
+
postId: string;
|
|
592
581
|
}): Promise<Bookmark>;
|
|
593
582
|
removeBookmark(params: {
|
|
594
|
-
|
|
583
|
+
postId: string;
|
|
595
584
|
}): Promise<{
|
|
596
585
|
success: boolean;
|
|
597
586
|
}>;
|
|
@@ -604,7 +593,6 @@ declare class CommunityClient {
|
|
|
604
593
|
interface ServerApiOptions {
|
|
605
594
|
publishableKey?: string;
|
|
606
595
|
secretKey: string;
|
|
607
|
-
tenantId?: string;
|
|
608
596
|
onRequestId?: (id: string | null) => void;
|
|
609
597
|
}
|
|
610
598
|
interface RequestOptions {
|
|
@@ -614,7 +602,6 @@ interface RequestOptions {
|
|
|
614
602
|
declare abstract class BaseApi {
|
|
615
603
|
protected readonly publishableKey: string;
|
|
616
604
|
protected readonly secretKey: string;
|
|
617
|
-
protected readonly tenantId?: string;
|
|
618
605
|
protected readonly onRequestId?: (id: string | null) => void;
|
|
619
606
|
constructor(apiName: string, options: ServerApiOptions);
|
|
620
607
|
protected request<T>(endpoint: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
@@ -799,7 +786,6 @@ declare class CustomerNamespace {
|
|
|
799
786
|
interface CartApiOptions {
|
|
800
787
|
publishableKey?: string;
|
|
801
788
|
secretKey?: string;
|
|
802
|
-
tenantId?: string;
|
|
803
789
|
customerToken?: string | (() => string | null);
|
|
804
790
|
onUnauthorized?: () => Promise<string | null>;
|
|
805
791
|
onRequestId?: (id: string | null) => void;
|
|
@@ -831,7 +817,6 @@ type ClearCartParams = {
|
|
|
831
817
|
declare class CartApi {
|
|
832
818
|
private readonly publishableKey;
|
|
833
819
|
private readonly secretKey?;
|
|
834
|
-
private readonly tenantId?;
|
|
835
820
|
private readonly customerToken?;
|
|
836
821
|
private readonly onUnauthorized?;
|
|
837
822
|
private readonly onRequestId?;
|
|
@@ -1187,7 +1172,6 @@ declare class CommerceClient {
|
|
|
1187
1172
|
interface ServerCommerceClientOptions {
|
|
1188
1173
|
publishableKey?: string;
|
|
1189
1174
|
secretKey: string;
|
|
1190
|
-
tenantId?: string;
|
|
1191
1175
|
onRequestId?: (id: string | null) => void;
|
|
1192
1176
|
}
|
|
1193
1177
|
declare class ServerCommerceClient {
|
|
@@ -1496,4 +1480,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1496
1480
|
*/
|
|
1497
1481
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1498
1482
|
|
|
1499
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, AuthError, type BanCustomerParams, BaseApi, type BulkImportFulfillmentsParams, type BulkImportFulfillmentsResponse, 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, CommerceClient, type CommerceClientOptions, type CommunityBan, CommunityClient, type CommunityClientOptions, ConfigError, ConflictError, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, CustomerNamespace, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, DiscountApi, type DiscountApiOptions, type ExtractArrayType, type GenerateMetadataOptions, GoneError, type InfiniteQueryOptions, type ListingGroupsParams, ModerationApi, type ModerationApiOptions, NetworkError, NotFoundError, Order, OrderApi, type OrderApiOptions, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, PermissionError, Product, ProductApi, type ProductApiOptions, type ProductListingGroup, type ProductListingGroupSummary, type ProductListingGroupsItem, type ProductListingGroupsQueryOptions, type ProductListingGroupsResponse, type ProductListingProductShape, type ProductListingProjection, type ProductOptionMatrix, type ProductOptionMatrixOption, type ProductOptionMatrixValue, type ProductOptionMatrixVariant, type ProductOptionShape, type ProductOptionValueShape, type ProductVariantShape, PublicCollection, QueryHooks, type QueryOptions, RateLimitError, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, type ReturnItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServerCommerceClient, type ServerCommerceClientOptions, ServiceUnavailableError, ShippingApi, type ShippingApiOptions, type StockCheckParams, type StockCheckResponse, type StockCheckResult, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, type UnbanCustomerParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, buildProductListingGroupsByOption, buildProductListingProjection, buildProductOptionMatrix, collectionKeys, createAuthError, createClient, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getAvailableOptionValues, getQueryClient, getSelectedValueByOptionId, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, normalizeSelectedValueIds, productKeys, resolveApiUrl, resolveRelation, resolveVariantForSelection };
|
|
1483
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, AuthError, type BanCustomerParams, BaseApi, type BulkImportFulfillmentsParams, type BulkImportFulfillmentsResponse, 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, CommerceClient, type CommerceClientOptions, type CommunityBan, CommunityClient, type CommunityClientOptions, type CommunityPost, ConfigError, ConflictError, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, CustomerNamespace, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, DiscountApi, type DiscountApiOptions, type ExtractArrayType, type GenerateMetadataOptions, GoneError, type InfiniteQueryOptions, type ListingGroupsParams, ModerationApi, type ModerationApiOptions, NetworkError, NotFoundError, Order, OrderApi, type OrderApiOptions, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, PermissionError, Product, ProductApi, type ProductApiOptions, type ProductListingGroup, type ProductListingGroupSummary, type ProductListingGroupsItem, type ProductListingGroupsQueryOptions, type ProductListingGroupsResponse, type ProductListingProductShape, type ProductListingProjection, type ProductOptionMatrix, type ProductOptionMatrixOption, type ProductOptionMatrixValue, type ProductOptionMatrixVariant, type ProductOptionShape, type ProductOptionValueShape, type ProductVariantShape, PublicCollection, QueryHooks, type QueryOptions, RateLimitError, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, type ReturnItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServerCommerceClient, type ServerCommerceClientOptions, ServiceUnavailableError, ShippingApi, type ShippingApiOptions, type StockCheckParams, type StockCheckResponse, type StockCheckResult, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, type UnbanCustomerParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, buildProductListingGroupsByOption, buildProductListingProjection, buildProductOptionMatrix, collectionKeys, createAuthError, createClient, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getAvailableOptionValues, getQueryClient, getSelectedValueByOptionId, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, normalizeSelectedValueIds, productKeys, resolveApiUrl, resolveRelation, resolveVariantForSelection };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-
|
|
2
|
-
export {
|
|
1
|
+
import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-DfQct8Dj.js';
|
|
2
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, D as Document, I as Image, h as Post, i as PostCategory, j as ProductVariant, k as Tenant, V as Video } from './payload-types-DfQct8Dj.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { C as CollectionType } from './webhook-
|
|
8
|
-
export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-
|
|
9
|
-
import { P as PublicCollection } from './const-
|
|
10
|
-
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-
|
|
7
|
+
import { C as CollectionType } from './webhook-CKqXQInG.js';
|
|
8
|
+
export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-CKqXQInG.js';
|
|
9
|
+
import { P as PublicCollection } from './const-B9oeZoDy.js';
|
|
10
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-B9oeZoDy.js';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.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';
|
|
@@ -39,13 +39,6 @@ interface ClientConfig {
|
|
|
39
39
|
}
|
|
40
40
|
interface ClientServerConfig extends ClientConfig {
|
|
41
41
|
secretKey: string;
|
|
42
|
-
/**
|
|
43
|
-
* Tenant ID for pat01_ API keys. When provided alongside a pat01_ key,
|
|
44
|
-
* every server request includes X-Tenant-Id so the API can scope the
|
|
45
|
-
* request to the correct tenant. Not needed for sk01_ keys (tenant is
|
|
46
|
-
* encoded in the key itself).
|
|
47
|
-
*/
|
|
48
|
-
tenantId?: string;
|
|
49
42
|
}
|
|
50
43
|
interface ClientMetadata {
|
|
51
44
|
userAgent?: string;
|
|
@@ -250,7 +243,6 @@ interface FetchOptions extends RequestInit {
|
|
|
250
243
|
publishableKey?: string;
|
|
251
244
|
secretKey?: string;
|
|
252
245
|
customerToken?: string;
|
|
253
|
-
tenantId?: string;
|
|
254
246
|
timeout?: number;
|
|
255
247
|
debug?: boolean | DebugConfig;
|
|
256
248
|
retry?: RetryConfig;
|
|
@@ -261,11 +253,10 @@ interface FetchOptions extends RequestInit {
|
|
|
261
253
|
declare class HttpClient {
|
|
262
254
|
protected publishableKey: string;
|
|
263
255
|
protected secretKey?: string;
|
|
264
|
-
protected tenantId?: string;
|
|
265
256
|
private getCustomerToken?;
|
|
266
257
|
private onUnauthorized?;
|
|
267
258
|
private onRequestId?;
|
|
268
|
-
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void
|
|
259
|
+
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void);
|
|
269
260
|
protected get defaultOptions(): FetchOptions;
|
|
270
261
|
protected fetchWithTracking(url: string, opts: FetchOptions): Promise<Response>;
|
|
271
262
|
protected buildUrl(endpoint: string, options?: ApiQueryOptions): string;
|
|
@@ -435,12 +426,11 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
435
426
|
interface CommunityClientOptions {
|
|
436
427
|
publishableKey?: string;
|
|
437
428
|
secretKey?: string;
|
|
438
|
-
tenantId?: string;
|
|
439
429
|
customerToken?: string | (() => string | null);
|
|
440
430
|
onUnauthorized?: () => Promise<string | null>;
|
|
441
431
|
onRequestId?: (id: string | null) => void;
|
|
442
432
|
}
|
|
443
|
-
interface
|
|
433
|
+
interface CommunityPost {
|
|
444
434
|
id: string;
|
|
445
435
|
title: string;
|
|
446
436
|
content: unknown;
|
|
@@ -454,7 +444,7 @@ interface Thread {
|
|
|
454
444
|
interface Comment {
|
|
455
445
|
id: string;
|
|
456
446
|
body: string;
|
|
457
|
-
|
|
447
|
+
post?: string;
|
|
458
448
|
parent?: string;
|
|
459
449
|
rootComment?: string;
|
|
460
450
|
createdAt?: string;
|
|
@@ -463,7 +453,7 @@ interface Comment {
|
|
|
463
453
|
}
|
|
464
454
|
interface Reaction {
|
|
465
455
|
id: string;
|
|
466
|
-
|
|
456
|
+
post?: string;
|
|
467
457
|
comment?: string;
|
|
468
458
|
type?: string;
|
|
469
459
|
createdAt?: string;
|
|
@@ -476,7 +466,7 @@ interface ReactionSummary {
|
|
|
476
466
|
}
|
|
477
467
|
interface Bookmark {
|
|
478
468
|
id: string;
|
|
479
|
-
|
|
469
|
+
post?: string;
|
|
480
470
|
createdAt?: string;
|
|
481
471
|
[key: string]: unknown;
|
|
482
472
|
}
|
|
@@ -502,47 +492,46 @@ interface PaginatedResponse<T> {
|
|
|
502
492
|
declare class CommunityClient {
|
|
503
493
|
private readonly publishableKey;
|
|
504
494
|
private readonly secretKey?;
|
|
505
|
-
private readonly tenantId?;
|
|
506
495
|
private readonly customerToken?;
|
|
507
496
|
private readonly onUnauthorized?;
|
|
508
497
|
private readonly onRequestId?;
|
|
509
498
|
constructor(options: CommunityClientOptions);
|
|
510
499
|
private buildQuery;
|
|
511
500
|
private execute;
|
|
512
|
-
|
|
501
|
+
createPost(params: {
|
|
513
502
|
title: string;
|
|
514
503
|
content: unknown;
|
|
515
504
|
categories?: string[];
|
|
516
505
|
thumbnail?: string;
|
|
517
|
-
}): Promise<
|
|
518
|
-
|
|
506
|
+
}): Promise<CommunityPost>;
|
|
507
|
+
getMyPosts(params?: {
|
|
519
508
|
page?: number;
|
|
520
509
|
limit?: number;
|
|
521
|
-
}): Promise<PaginatedResponse<
|
|
510
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
522
511
|
getTrending(params?: {
|
|
523
512
|
page?: number;
|
|
524
513
|
limit?: number;
|
|
525
514
|
period?: string;
|
|
526
|
-
}): Promise<PaginatedResponse<
|
|
515
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
527
516
|
incrementView(params: {
|
|
528
|
-
|
|
517
|
+
postId: string;
|
|
529
518
|
}): Promise<{
|
|
530
519
|
viewCount: number;
|
|
531
520
|
}>;
|
|
532
|
-
|
|
533
|
-
|
|
521
|
+
reportPost(params: {
|
|
522
|
+
postId: string;
|
|
534
523
|
reason?: string;
|
|
535
524
|
reasonDetail?: string;
|
|
536
525
|
}): Promise<{
|
|
537
526
|
success: boolean;
|
|
538
527
|
}>;
|
|
539
528
|
createComment(params: {
|
|
540
|
-
|
|
529
|
+
postId: string;
|
|
541
530
|
body: string;
|
|
542
531
|
parentId?: string;
|
|
543
532
|
}): Promise<Comment>;
|
|
544
533
|
listComments(params: {
|
|
545
|
-
|
|
534
|
+
postId: string;
|
|
546
535
|
page?: number;
|
|
547
536
|
limit?: number;
|
|
548
537
|
rootComment?: string;
|
|
@@ -564,11 +553,11 @@ declare class CommunityClient {
|
|
|
564
553
|
success: boolean;
|
|
565
554
|
}>;
|
|
566
555
|
addReaction(params: {
|
|
567
|
-
|
|
556
|
+
postId: string;
|
|
568
557
|
type: string;
|
|
569
558
|
}): Promise<Reaction>;
|
|
570
559
|
removeReaction(params: {
|
|
571
|
-
|
|
560
|
+
postId: string;
|
|
572
561
|
type: string;
|
|
573
562
|
}): Promise<{
|
|
574
563
|
success: boolean;
|
|
@@ -584,14 +573,14 @@ declare class CommunityClient {
|
|
|
584
573
|
success: boolean;
|
|
585
574
|
}>;
|
|
586
575
|
getReactionSummary(params: {
|
|
587
|
-
|
|
576
|
+
postId: string;
|
|
588
577
|
}): Promise<ReactionSummary>;
|
|
589
578
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
590
579
|
addBookmark(params: {
|
|
591
|
-
|
|
580
|
+
postId: string;
|
|
592
581
|
}): Promise<Bookmark>;
|
|
593
582
|
removeBookmark(params: {
|
|
594
|
-
|
|
583
|
+
postId: string;
|
|
595
584
|
}): Promise<{
|
|
596
585
|
success: boolean;
|
|
597
586
|
}>;
|
|
@@ -604,7 +593,6 @@ declare class CommunityClient {
|
|
|
604
593
|
interface ServerApiOptions {
|
|
605
594
|
publishableKey?: string;
|
|
606
595
|
secretKey: string;
|
|
607
|
-
tenantId?: string;
|
|
608
596
|
onRequestId?: (id: string | null) => void;
|
|
609
597
|
}
|
|
610
598
|
interface RequestOptions {
|
|
@@ -614,7 +602,6 @@ interface RequestOptions {
|
|
|
614
602
|
declare abstract class BaseApi {
|
|
615
603
|
protected readonly publishableKey: string;
|
|
616
604
|
protected readonly secretKey: string;
|
|
617
|
-
protected readonly tenantId?: string;
|
|
618
605
|
protected readonly onRequestId?: (id: string | null) => void;
|
|
619
606
|
constructor(apiName: string, options: ServerApiOptions);
|
|
620
607
|
protected request<T>(endpoint: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
@@ -799,7 +786,6 @@ declare class CustomerNamespace {
|
|
|
799
786
|
interface CartApiOptions {
|
|
800
787
|
publishableKey?: string;
|
|
801
788
|
secretKey?: string;
|
|
802
|
-
tenantId?: string;
|
|
803
789
|
customerToken?: string | (() => string | null);
|
|
804
790
|
onUnauthorized?: () => Promise<string | null>;
|
|
805
791
|
onRequestId?: (id: string | null) => void;
|
|
@@ -831,7 +817,6 @@ type ClearCartParams = {
|
|
|
831
817
|
declare class CartApi {
|
|
832
818
|
private readonly publishableKey;
|
|
833
819
|
private readonly secretKey?;
|
|
834
|
-
private readonly tenantId?;
|
|
835
820
|
private readonly customerToken?;
|
|
836
821
|
private readonly onUnauthorized?;
|
|
837
822
|
private readonly onRequestId?;
|
|
@@ -1187,7 +1172,6 @@ declare class CommerceClient {
|
|
|
1187
1172
|
interface ServerCommerceClientOptions {
|
|
1188
1173
|
publishableKey?: string;
|
|
1189
1174
|
secretKey: string;
|
|
1190
|
-
tenantId?: string;
|
|
1191
1175
|
onRequestId?: (id: string | null) => void;
|
|
1192
1176
|
}
|
|
1193
1177
|
declare class ServerCommerceClient {
|
|
@@ -1496,4 +1480,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1496
1480
|
*/
|
|
1497
1481
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1498
1482
|
|
|
1499
|
-
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, AuthError, type BanCustomerParams, BaseApi, type BulkImportFulfillmentsParams, type BulkImportFulfillmentsResponse, 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, CommerceClient, type CommerceClientOptions, type CommunityBan, CommunityClient, type CommunityClientOptions, ConfigError, ConflictError, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, CustomerNamespace, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, DiscountApi, type DiscountApiOptions, type ExtractArrayType, type GenerateMetadataOptions, GoneError, type InfiniteQueryOptions, type ListingGroupsParams, ModerationApi, type ModerationApiOptions, NetworkError, NotFoundError, Order, OrderApi, type OrderApiOptions, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, PermissionError, Product, ProductApi, type ProductApiOptions, type ProductListingGroup, type ProductListingGroupSummary, type ProductListingGroupsItem, type ProductListingGroupsQueryOptions, type ProductListingGroupsResponse, type ProductListingProductShape, type ProductListingProjection, type ProductOptionMatrix, type ProductOptionMatrixOption, type ProductOptionMatrixValue, type ProductOptionMatrixVariant, type ProductOptionShape, type ProductOptionValueShape, type ProductVariantShape, PublicCollection, QueryHooks, type QueryOptions, RateLimitError, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, type ReturnItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServerCommerceClient, type ServerCommerceClientOptions, ServiceUnavailableError, ShippingApi, type ShippingApiOptions, type StockCheckParams, type StockCheckResponse, type StockCheckResult, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, type UnbanCustomerParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, buildProductListingGroupsByOption, buildProductListingProjection, buildProductOptionMatrix, collectionKeys, createAuthError, createClient, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getAvailableOptionValues, getQueryClient, getSelectedValueByOptionId, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, normalizeSelectedValueIds, productKeys, resolveApiUrl, resolveRelation, resolveVariantForSelection };
|
|
1483
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, AuthError, type BanCustomerParams, BaseApi, type BulkImportFulfillmentsParams, type BulkImportFulfillmentsResponse, 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, CommerceClient, type CommerceClientOptions, type CommunityBan, CommunityClient, type CommunityClientOptions, type CommunityPost, ConfigError, ConflictError, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, CustomerHooks, type CustomerLoginData, CustomerNamespace, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, type CustomerRegisterResponse, type CustomerSnapshot, type DebugConfig, type DeepPartial, DiscountApi, type DiscountApiOptions, type ExtractArrayType, type GenerateMetadataOptions, GoneError, type InfiniteQueryOptions, type ListingGroupsParams, ModerationApi, type ModerationApiOptions, NetworkError, NotFoundError, Order, OrderApi, type OrderApiOptions, type PaginationMeta, type PayloadFindResponse, type PayloadMutationResponse, PermissionError, Product, ProductApi, type ProductApiOptions, type ProductListingGroup, type ProductListingGroupSummary, type ProductListingGroupsItem, type ProductListingGroupsQueryOptions, type ProductListingGroupsResponse, type ProductListingProductShape, type ProductListingProjection, type ProductOptionMatrix, type ProductOptionMatrixOption, type ProductOptionMatrixValue, type ProductOptionMatrixVariant, type ProductOptionShape, type ProductOptionValueShape, type ProductVariantShape, PublicCollection, QueryHooks, type QueryOptions, RateLimitError, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, type RequestOptions, type RetryConfig, type ReturnItem, type ReturnReason, type ReturnWithRefundParams, SDKError, type ServerApiOptions, ServerClient, ServerClient as ServerClientType, ServerCommerceClient, type ServerCommerceClientOptions, ServiceUnavailableError, ShippingApi, type ShippingApiOptions, type StockCheckParams, type StockCheckResponse, type StockCheckResult, type SuspenseInfiniteQueryOptions, type SuspenseQueryOptions, TimeoutError, type UnbanCustomerParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, UsageLimitError, type ValidateDiscountParams, type ValidateDiscountResult, ValidationError, buildProductListingGroupsByOption, buildProductListingProjection, buildProductOptionMatrix, collectionKeys, createAuthError, createClient, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getAvailableOptionValues, getQueryClient, getSelectedValueByOptionId, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError, normalizeSelectedValueIds, productKeys, resolveApiUrl, resolveRelation, resolveVariantForSelection };
|