@01.software/sdk 0.5.8 → 0.5.10
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-Dde6Z3er.d.ts → const-Bk3-zigV.d.ts} +2 -2
- package/dist/{const-MzPYopC7.d.cts → const-DQZQAXex.d.cts} +2 -2
- package/dist/index.cjs +211 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +196 -7
- package/dist/index.d.ts +196 -7
- package/dist/index.js +211 -1
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-CyaSGIFI.d.cts → payload-types-DCVm1syH.d.cts} +400 -16
- package/dist/{payload-types-CyaSGIFI.d.ts → payload-types-DCVm1syH.d.ts} +400 -16
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/{webhook-cfGx5lXy.d.ts → webhook-BTtG_8f2.d.ts} +2 -2
- package/dist/{webhook-D78o4MiB.d.cts → webhook-TDfT7aKA.d.cts} +2 -2
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +3 -3
package/dist/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,
|
|
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-DCVm1syH.cjs';
|
|
2
|
+
export { o as ApiUsage, aF as ApiUsageSelect, A as Audience, aB as AudiencesSelect, bO as Auth, q as BillingHistory, aH as BillingHistorySelect, ap as Bookmark, bD as BookmarksSelect, y as Brand, B as BrandLogo, aQ as BrandLogosSelect, aP as BrandsSelect, b4 as CartItemsSelect, b3 as CartsSelect, g as CodeBlock, bN as CollectionsWidget, am as Comment, bA as CommentsSelect, ar as CommunityBan, bG as CommunityBansSelect, C as Config, G as Customer, J as CustomerAddress, b1 as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, b2 as CustomerGroupsSelect, b0 as CustomersSelect, W as Discount, b5 as DiscountsSelect, $ as Document, bb as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, bc as DocumentTypesSelect, ba as DocumentsSelect, m as EmailLog, aC as EmailLogsSelect, N as ExchangeProduct, a_ as ExchangeProductsSelect, aZ as ExchangesSelect, j as FieldConfig, ay as FieldConfigsSelect, af as Flow, bt as FlowCategoriesSelect, ag as FlowCategory, aj as FlowEdgeType, bs as FlowEdgeTypesSelect, ai as FlowNodeType, br as FlowNodeTypesSelect, ah as FlowTag, bu as FlowTagsSelect, bq as FlowsSelect, F as Form, as as FormSubmission, bI as FormSubmissionsSelect, bH as FormsSelect, K as FulfillmentItem, aW as FulfillmentItemsSelect, aV as FulfillmentsSelect, bj as GalleriesSelect, a8 as Gallery, bk as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bm as GalleryItemsSelect, aa as GalleryTag, bl as GalleryTagsSelect, I as IframeBlock, k as Image, az as ImagesSelect, ac as Link, bo as LinkCategoriesSelect, ad as LinkCategory, ae as LinkTag, bp as LinkTagsSelect, bn as LinksSelect, L as LiveStream, by as LiveStreamsSelect, a5 as Music, bh as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, bi as MusicTagsSelect, bg as MusicsSelect, aS as OrderProductsSelect, Q as OrderStatusLog, aU as OrderStatusLogsSelect, aR as OrdersSelect, at as PayloadKv, bJ as PayloadKvSelect, au as PayloadLockedDocument, bK as PayloadLockedDocumentsSelect, aw as PayloadMigration, bM as PayloadMigrationsSelect, av as PayloadPreference, bL as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, be as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, bf as PlaylistTagsSelect, bd as PlaylistsSelect, X as Post, Y as PostAuthor, b7 as PostAuthorsSelect, b8 as PostCategoriesSelect, Z as PostCategory, _ as PostTag, b9 as PostTagsSelect, b6 as PostsSelect, aM as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aO as ProductCollectionsSelect, v as ProductOption, aL as ProductOptionsSelect, x as ProductTag, aN as ProductTagsSelect, u as ProductVariant, aK as ProductVariantsSelect, aJ as ProductsSelect, an as Reaction, ao as ReactionType, bC as ReactionTypesSelect, bB as ReactionsSelect, aq as Report, bF as ReportsSelect, M as ReturnProduct, aY as ReturnProductsSelect, aX as ReturnsSelect, a$ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, aG as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, aA as SystemMediaSelect, i as Tenant, r as TenantLogo, aI as TenantLogosSelect, aE as TenantMetadataSelect, n as TenantMetadatum, aD as TenantsSelect, ak as Thread, bE as ThreadCategoriesSelect, al as ThreadCategory, bz as ThreadsSelect, aT as TransactionsSelect, h as User, U as UserAuthOperations, ax as UsersSelect, V as Video, bw as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bx as VideoTagsSelect, bv as VideosSelect } from './payload-types-DCVm1syH.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { P as PublicCollection } from './const-
|
|
8
|
-
export { a as COLLECTIONS, C as Collection } from './const-
|
|
9
|
-
import { C as CollectionType } from './webhook-
|
|
10
|
-
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-
|
|
7
|
+
import { P as PublicCollection } from './const-DQZQAXex.cjs';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-DQZQAXex.cjs';
|
|
9
|
+
import { C as CollectionType } from './webhook-TDfT7aKA.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-TDfT7aKA.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';
|
|
@@ -525,6 +525,193 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
525
525
|
removeMany(where: ApiQueryOptions['where']): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
interface CommunityClientOptions {
|
|
529
|
+
clientKey: string;
|
|
530
|
+
secretKey?: string;
|
|
531
|
+
customerToken?: string | (() => string | null);
|
|
532
|
+
baseUrl?: string;
|
|
533
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
534
|
+
}
|
|
535
|
+
interface Thread {
|
|
536
|
+
id: string;
|
|
537
|
+
title: string;
|
|
538
|
+
content: unknown;
|
|
539
|
+
categories?: string[];
|
|
540
|
+
thumbnail?: string;
|
|
541
|
+
viewCount?: number;
|
|
542
|
+
createdAt?: string;
|
|
543
|
+
updatedAt?: string;
|
|
544
|
+
[key: string]: unknown;
|
|
545
|
+
}
|
|
546
|
+
interface Comment {
|
|
547
|
+
id: string;
|
|
548
|
+
content: string;
|
|
549
|
+
thread?: string;
|
|
550
|
+
parent?: string;
|
|
551
|
+
rootId?: string;
|
|
552
|
+
createdAt?: string;
|
|
553
|
+
updatedAt?: string;
|
|
554
|
+
[key: string]: unknown;
|
|
555
|
+
}
|
|
556
|
+
interface Reaction {
|
|
557
|
+
id: string;
|
|
558
|
+
thread?: string;
|
|
559
|
+
comment?: string;
|
|
560
|
+
type?: string;
|
|
561
|
+
createdAt?: string;
|
|
562
|
+
[key: string]: unknown;
|
|
563
|
+
}
|
|
564
|
+
interface ReactionSummary {
|
|
565
|
+
counts: Record<string, number>;
|
|
566
|
+
total: number;
|
|
567
|
+
userReactions: string[];
|
|
568
|
+
}
|
|
569
|
+
interface Bookmark {
|
|
570
|
+
id: string;
|
|
571
|
+
thread?: string;
|
|
572
|
+
createdAt?: string;
|
|
573
|
+
[key: string]: unknown;
|
|
574
|
+
}
|
|
575
|
+
interface ReactionType {
|
|
576
|
+
id: string;
|
|
577
|
+
title: string;
|
|
578
|
+
slug: string;
|
|
579
|
+
emoji?: string;
|
|
580
|
+
[key: string]: unknown;
|
|
581
|
+
}
|
|
582
|
+
interface CommunityBan {
|
|
583
|
+
id: string;
|
|
584
|
+
customer: string;
|
|
585
|
+
isPermanent?: boolean;
|
|
586
|
+
bannedUntil?: string;
|
|
587
|
+
reason?: string;
|
|
588
|
+
createdAt?: string;
|
|
589
|
+
updatedAt?: string;
|
|
590
|
+
[key: string]: unknown;
|
|
591
|
+
}
|
|
592
|
+
interface PaginatedResponse<T> {
|
|
593
|
+
docs: T[];
|
|
594
|
+
totalDocs: number;
|
|
595
|
+
limit: number;
|
|
596
|
+
totalPages: number;
|
|
597
|
+
page: number;
|
|
598
|
+
pagingCounter: number;
|
|
599
|
+
hasPrevPage: boolean;
|
|
600
|
+
hasNextPage: boolean;
|
|
601
|
+
prevPage: number | null;
|
|
602
|
+
nextPage: number | null;
|
|
603
|
+
}
|
|
604
|
+
declare class CommunityClient {
|
|
605
|
+
private readonly clientKey;
|
|
606
|
+
private readonly secretKey?;
|
|
607
|
+
private readonly customerToken?;
|
|
608
|
+
private readonly baseUrl?;
|
|
609
|
+
private readonly onUnauthorized?;
|
|
610
|
+
constructor(options: CommunityClientOptions);
|
|
611
|
+
private execute;
|
|
612
|
+
createThread(params: {
|
|
613
|
+
title: string;
|
|
614
|
+
content: unknown;
|
|
615
|
+
categories?: string[];
|
|
616
|
+
thumbnail?: string;
|
|
617
|
+
}): Promise<Thread>;
|
|
618
|
+
getMyThreads(params?: {
|
|
619
|
+
page?: number;
|
|
620
|
+
limit?: number;
|
|
621
|
+
}): Promise<PaginatedResponse<Thread>>;
|
|
622
|
+
getTrending(params?: {
|
|
623
|
+
page?: number;
|
|
624
|
+
limit?: number;
|
|
625
|
+
period?: string;
|
|
626
|
+
}): Promise<PaginatedResponse<Thread>>;
|
|
627
|
+
incrementView(params: {
|
|
628
|
+
threadId: string;
|
|
629
|
+
}): Promise<{
|
|
630
|
+
viewCount: number;
|
|
631
|
+
}>;
|
|
632
|
+
reportThread(params: {
|
|
633
|
+
threadId: string;
|
|
634
|
+
reason?: string;
|
|
635
|
+
reasonDetail?: string;
|
|
636
|
+
}): Promise<{
|
|
637
|
+
success: boolean;
|
|
638
|
+
}>;
|
|
639
|
+
createComment(params: {
|
|
640
|
+
threadId: string;
|
|
641
|
+
content: string;
|
|
642
|
+
parentId?: string;
|
|
643
|
+
}): Promise<Comment>;
|
|
644
|
+
listComments(params: {
|
|
645
|
+
threadId: string;
|
|
646
|
+
page?: number;
|
|
647
|
+
limit?: number;
|
|
648
|
+
rootId?: string;
|
|
649
|
+
}): Promise<PaginatedResponse<Comment>>;
|
|
650
|
+
updateComment(params: {
|
|
651
|
+
commentId: string;
|
|
652
|
+
content: string;
|
|
653
|
+
}): Promise<Comment>;
|
|
654
|
+
deleteComment(params: {
|
|
655
|
+
commentId: string;
|
|
656
|
+
}): Promise<{
|
|
657
|
+
success: boolean;
|
|
658
|
+
}>;
|
|
659
|
+
reportComment(params: {
|
|
660
|
+
commentId: string;
|
|
661
|
+
reason?: string;
|
|
662
|
+
reasonDetail?: string;
|
|
663
|
+
}): Promise<{
|
|
664
|
+
success: boolean;
|
|
665
|
+
}>;
|
|
666
|
+
addReaction(params: {
|
|
667
|
+
threadId: string;
|
|
668
|
+
type: string;
|
|
669
|
+
}): Promise<Reaction>;
|
|
670
|
+
removeReaction(params: {
|
|
671
|
+
threadId: string;
|
|
672
|
+
type: string;
|
|
673
|
+
}): Promise<{
|
|
674
|
+
success: boolean;
|
|
675
|
+
}>;
|
|
676
|
+
addCommentReaction(params: {
|
|
677
|
+
commentId: string;
|
|
678
|
+
type: string;
|
|
679
|
+
}): Promise<Reaction>;
|
|
680
|
+
removeCommentReaction(params: {
|
|
681
|
+
commentId: string;
|
|
682
|
+
type: string;
|
|
683
|
+
}): Promise<{
|
|
684
|
+
success: boolean;
|
|
685
|
+
}>;
|
|
686
|
+
getReactionSummary(params: {
|
|
687
|
+
threadId: string;
|
|
688
|
+
}): Promise<ReactionSummary>;
|
|
689
|
+
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
690
|
+
addBookmark(params: {
|
|
691
|
+
threadId: string;
|
|
692
|
+
}): Promise<Bookmark>;
|
|
693
|
+
removeBookmark(params: {
|
|
694
|
+
threadId: string;
|
|
695
|
+
}): Promise<{
|
|
696
|
+
success: boolean;
|
|
697
|
+
}>;
|
|
698
|
+
getMyBookmarks(params?: {
|
|
699
|
+
page?: number;
|
|
700
|
+
limit?: number;
|
|
701
|
+
}): Promise<PaginatedResponse<Bookmark>>;
|
|
702
|
+
banCustomer(params: {
|
|
703
|
+
customerId: string;
|
|
704
|
+
isPermanent?: boolean;
|
|
705
|
+
bannedUntil?: string;
|
|
706
|
+
reason?: string;
|
|
707
|
+
}): Promise<CommunityBan>;
|
|
708
|
+
unbanCustomer(params: {
|
|
709
|
+
customerId: string;
|
|
710
|
+
}): Promise<{
|
|
711
|
+
success: boolean;
|
|
712
|
+
}>;
|
|
713
|
+
}
|
|
714
|
+
|
|
528
715
|
interface CustomerAuthResponse {
|
|
529
716
|
token: string;
|
|
530
717
|
customer: CustomerProfile;
|
|
@@ -908,6 +1095,7 @@ declare class QueryHooks extends CollectionHooks {
|
|
|
908
1095
|
|
|
909
1096
|
declare class Client {
|
|
910
1097
|
cart: CartApi;
|
|
1098
|
+
community: CommunityClient;
|
|
911
1099
|
query: ReadOnlyQueryHooks;
|
|
912
1100
|
collections: CollectionClient;
|
|
913
1101
|
queryClient: QueryClient;
|
|
@@ -930,6 +1118,7 @@ declare function createClient(options: ClientConfig): Client;
|
|
|
930
1118
|
declare class ServerClient {
|
|
931
1119
|
api: OrderApi;
|
|
932
1120
|
cart: CartApi;
|
|
1121
|
+
community: CommunityClient;
|
|
933
1122
|
product: ProductApi;
|
|
934
1123
|
query: QueryHooks;
|
|
935
1124
|
collections: CollectionClient;
|
|
@@ -968,4 +1157,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
968
1157
|
*/
|
|
969
1158
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
970
1159
|
|
|
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 };
|
|
1160
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, BaseApi, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, Client, type ClientConfig, type ClientMetadata, type ClientServerConfig, type ClientState, Client as ClientType, CollectionClient, type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, CommunityClient, type CommunityClientOptions, ConfigError, type 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,
|
|
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-DCVm1syH.js';
|
|
2
|
+
export { o as ApiUsage, aF as ApiUsageSelect, A as Audience, aB as AudiencesSelect, bO as Auth, q as BillingHistory, aH as BillingHistorySelect, ap as Bookmark, bD as BookmarksSelect, y as Brand, B as BrandLogo, aQ as BrandLogosSelect, aP as BrandsSelect, b4 as CartItemsSelect, b3 as CartsSelect, g as CodeBlock, bN as CollectionsWidget, am as Comment, bA as CommentsSelect, ar as CommunityBan, bG as CommunityBansSelect, C as Config, G as Customer, J as CustomerAddress, b1 as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, b2 as CustomerGroupsSelect, b0 as CustomersSelect, W as Discount, b5 as DiscountsSelect, $ as Document, bb as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, bc as DocumentTypesSelect, ba as DocumentsSelect, m as EmailLog, aC as EmailLogsSelect, N as ExchangeProduct, a_ as ExchangeProductsSelect, aZ as ExchangesSelect, j as FieldConfig, ay as FieldConfigsSelect, af as Flow, bt as FlowCategoriesSelect, ag as FlowCategory, aj as FlowEdgeType, bs as FlowEdgeTypesSelect, ai as FlowNodeType, br as FlowNodeTypesSelect, ah as FlowTag, bu as FlowTagsSelect, bq as FlowsSelect, F as Form, as as FormSubmission, bI as FormSubmissionsSelect, bH as FormsSelect, K as FulfillmentItem, aW as FulfillmentItemsSelect, aV as FulfillmentsSelect, bj as GalleriesSelect, a8 as Gallery, bk as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bm as GalleryItemsSelect, aa as GalleryTag, bl as GalleryTagsSelect, I as IframeBlock, k as Image, az as ImagesSelect, ac as Link, bo as LinkCategoriesSelect, ad as LinkCategory, ae as LinkTag, bp as LinkTagsSelect, bn as LinksSelect, L as LiveStream, by as LiveStreamsSelect, a5 as Music, bh as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, bi as MusicTagsSelect, bg as MusicsSelect, aS as OrderProductsSelect, Q as OrderStatusLog, aU as OrderStatusLogsSelect, aR as OrdersSelect, at as PayloadKv, bJ as PayloadKvSelect, au as PayloadLockedDocument, bK as PayloadLockedDocumentsSelect, aw as PayloadMigration, bM as PayloadMigrationsSelect, av as PayloadPreference, bL as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, be as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, bf as PlaylistTagsSelect, bd as PlaylistsSelect, X as Post, Y as PostAuthor, b7 as PostAuthorsSelect, b8 as PostCategoriesSelect, Z as PostCategory, _ as PostTag, b9 as PostTagsSelect, b6 as PostsSelect, aM as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aO as ProductCollectionsSelect, v as ProductOption, aL as ProductOptionsSelect, x as ProductTag, aN as ProductTagsSelect, u as ProductVariant, aK as ProductVariantsSelect, aJ as ProductsSelect, an as Reaction, ao as ReactionType, bC as ReactionTypesSelect, bB as ReactionsSelect, aq as Report, bF as ReportsSelect, M as ReturnProduct, aY as ReturnProductsSelect, aX as ReturnsSelect, a$ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, aG as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, aA as SystemMediaSelect, i as Tenant, r as TenantLogo, aI as TenantLogosSelect, aE as TenantMetadataSelect, n as TenantMetadatum, aD as TenantsSelect, ak as Thread, bE as ThreadCategoriesSelect, al as ThreadCategory, bz as ThreadsSelect, aT as TransactionsSelect, h as User, U as UserAuthOperations, ax as UsersSelect, V as Video, bw as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bx as VideoTagsSelect, bv as VideosSelect } from './payload-types-DCVm1syH.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { Metadata } from 'next';
|
|
7
|
-
import { P as PublicCollection } from './const-
|
|
8
|
-
export { a as COLLECTIONS, C as Collection } from './const-
|
|
9
|
-
import { C as CollectionType } from './webhook-
|
|
10
|
-
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-
|
|
7
|
+
import { P as PublicCollection } from './const-Bk3-zigV.js';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-Bk3-zigV.js';
|
|
9
|
+
import { C as CollectionType } from './webhook-BTtG_8f2.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-BTtG_8f2.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';
|
|
@@ -525,6 +525,193 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
525
525
|
removeMany(where: ApiQueryOptions['where']): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
interface CommunityClientOptions {
|
|
529
|
+
clientKey: string;
|
|
530
|
+
secretKey?: string;
|
|
531
|
+
customerToken?: string | (() => string | null);
|
|
532
|
+
baseUrl?: string;
|
|
533
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
534
|
+
}
|
|
535
|
+
interface Thread {
|
|
536
|
+
id: string;
|
|
537
|
+
title: string;
|
|
538
|
+
content: unknown;
|
|
539
|
+
categories?: string[];
|
|
540
|
+
thumbnail?: string;
|
|
541
|
+
viewCount?: number;
|
|
542
|
+
createdAt?: string;
|
|
543
|
+
updatedAt?: string;
|
|
544
|
+
[key: string]: unknown;
|
|
545
|
+
}
|
|
546
|
+
interface Comment {
|
|
547
|
+
id: string;
|
|
548
|
+
content: string;
|
|
549
|
+
thread?: string;
|
|
550
|
+
parent?: string;
|
|
551
|
+
rootId?: string;
|
|
552
|
+
createdAt?: string;
|
|
553
|
+
updatedAt?: string;
|
|
554
|
+
[key: string]: unknown;
|
|
555
|
+
}
|
|
556
|
+
interface Reaction {
|
|
557
|
+
id: string;
|
|
558
|
+
thread?: string;
|
|
559
|
+
comment?: string;
|
|
560
|
+
type?: string;
|
|
561
|
+
createdAt?: string;
|
|
562
|
+
[key: string]: unknown;
|
|
563
|
+
}
|
|
564
|
+
interface ReactionSummary {
|
|
565
|
+
counts: Record<string, number>;
|
|
566
|
+
total: number;
|
|
567
|
+
userReactions: string[];
|
|
568
|
+
}
|
|
569
|
+
interface Bookmark {
|
|
570
|
+
id: string;
|
|
571
|
+
thread?: string;
|
|
572
|
+
createdAt?: string;
|
|
573
|
+
[key: string]: unknown;
|
|
574
|
+
}
|
|
575
|
+
interface ReactionType {
|
|
576
|
+
id: string;
|
|
577
|
+
title: string;
|
|
578
|
+
slug: string;
|
|
579
|
+
emoji?: string;
|
|
580
|
+
[key: string]: unknown;
|
|
581
|
+
}
|
|
582
|
+
interface CommunityBan {
|
|
583
|
+
id: string;
|
|
584
|
+
customer: string;
|
|
585
|
+
isPermanent?: boolean;
|
|
586
|
+
bannedUntil?: string;
|
|
587
|
+
reason?: string;
|
|
588
|
+
createdAt?: string;
|
|
589
|
+
updatedAt?: string;
|
|
590
|
+
[key: string]: unknown;
|
|
591
|
+
}
|
|
592
|
+
interface PaginatedResponse<T> {
|
|
593
|
+
docs: T[];
|
|
594
|
+
totalDocs: number;
|
|
595
|
+
limit: number;
|
|
596
|
+
totalPages: number;
|
|
597
|
+
page: number;
|
|
598
|
+
pagingCounter: number;
|
|
599
|
+
hasPrevPage: boolean;
|
|
600
|
+
hasNextPage: boolean;
|
|
601
|
+
prevPage: number | null;
|
|
602
|
+
nextPage: number | null;
|
|
603
|
+
}
|
|
604
|
+
declare class CommunityClient {
|
|
605
|
+
private readonly clientKey;
|
|
606
|
+
private readonly secretKey?;
|
|
607
|
+
private readonly customerToken?;
|
|
608
|
+
private readonly baseUrl?;
|
|
609
|
+
private readonly onUnauthorized?;
|
|
610
|
+
constructor(options: CommunityClientOptions);
|
|
611
|
+
private execute;
|
|
612
|
+
createThread(params: {
|
|
613
|
+
title: string;
|
|
614
|
+
content: unknown;
|
|
615
|
+
categories?: string[];
|
|
616
|
+
thumbnail?: string;
|
|
617
|
+
}): Promise<Thread>;
|
|
618
|
+
getMyThreads(params?: {
|
|
619
|
+
page?: number;
|
|
620
|
+
limit?: number;
|
|
621
|
+
}): Promise<PaginatedResponse<Thread>>;
|
|
622
|
+
getTrending(params?: {
|
|
623
|
+
page?: number;
|
|
624
|
+
limit?: number;
|
|
625
|
+
period?: string;
|
|
626
|
+
}): Promise<PaginatedResponse<Thread>>;
|
|
627
|
+
incrementView(params: {
|
|
628
|
+
threadId: string;
|
|
629
|
+
}): Promise<{
|
|
630
|
+
viewCount: number;
|
|
631
|
+
}>;
|
|
632
|
+
reportThread(params: {
|
|
633
|
+
threadId: string;
|
|
634
|
+
reason?: string;
|
|
635
|
+
reasonDetail?: string;
|
|
636
|
+
}): Promise<{
|
|
637
|
+
success: boolean;
|
|
638
|
+
}>;
|
|
639
|
+
createComment(params: {
|
|
640
|
+
threadId: string;
|
|
641
|
+
content: string;
|
|
642
|
+
parentId?: string;
|
|
643
|
+
}): Promise<Comment>;
|
|
644
|
+
listComments(params: {
|
|
645
|
+
threadId: string;
|
|
646
|
+
page?: number;
|
|
647
|
+
limit?: number;
|
|
648
|
+
rootId?: string;
|
|
649
|
+
}): Promise<PaginatedResponse<Comment>>;
|
|
650
|
+
updateComment(params: {
|
|
651
|
+
commentId: string;
|
|
652
|
+
content: string;
|
|
653
|
+
}): Promise<Comment>;
|
|
654
|
+
deleteComment(params: {
|
|
655
|
+
commentId: string;
|
|
656
|
+
}): Promise<{
|
|
657
|
+
success: boolean;
|
|
658
|
+
}>;
|
|
659
|
+
reportComment(params: {
|
|
660
|
+
commentId: string;
|
|
661
|
+
reason?: string;
|
|
662
|
+
reasonDetail?: string;
|
|
663
|
+
}): Promise<{
|
|
664
|
+
success: boolean;
|
|
665
|
+
}>;
|
|
666
|
+
addReaction(params: {
|
|
667
|
+
threadId: string;
|
|
668
|
+
type: string;
|
|
669
|
+
}): Promise<Reaction>;
|
|
670
|
+
removeReaction(params: {
|
|
671
|
+
threadId: string;
|
|
672
|
+
type: string;
|
|
673
|
+
}): Promise<{
|
|
674
|
+
success: boolean;
|
|
675
|
+
}>;
|
|
676
|
+
addCommentReaction(params: {
|
|
677
|
+
commentId: string;
|
|
678
|
+
type: string;
|
|
679
|
+
}): Promise<Reaction>;
|
|
680
|
+
removeCommentReaction(params: {
|
|
681
|
+
commentId: string;
|
|
682
|
+
type: string;
|
|
683
|
+
}): Promise<{
|
|
684
|
+
success: boolean;
|
|
685
|
+
}>;
|
|
686
|
+
getReactionSummary(params: {
|
|
687
|
+
threadId: string;
|
|
688
|
+
}): Promise<ReactionSummary>;
|
|
689
|
+
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
690
|
+
addBookmark(params: {
|
|
691
|
+
threadId: string;
|
|
692
|
+
}): Promise<Bookmark>;
|
|
693
|
+
removeBookmark(params: {
|
|
694
|
+
threadId: string;
|
|
695
|
+
}): Promise<{
|
|
696
|
+
success: boolean;
|
|
697
|
+
}>;
|
|
698
|
+
getMyBookmarks(params?: {
|
|
699
|
+
page?: number;
|
|
700
|
+
limit?: number;
|
|
701
|
+
}): Promise<PaginatedResponse<Bookmark>>;
|
|
702
|
+
banCustomer(params: {
|
|
703
|
+
customerId: string;
|
|
704
|
+
isPermanent?: boolean;
|
|
705
|
+
bannedUntil?: string;
|
|
706
|
+
reason?: string;
|
|
707
|
+
}): Promise<CommunityBan>;
|
|
708
|
+
unbanCustomer(params: {
|
|
709
|
+
customerId: string;
|
|
710
|
+
}): Promise<{
|
|
711
|
+
success: boolean;
|
|
712
|
+
}>;
|
|
713
|
+
}
|
|
714
|
+
|
|
528
715
|
interface CustomerAuthResponse {
|
|
529
716
|
token: string;
|
|
530
717
|
customer: CustomerProfile;
|
|
@@ -908,6 +1095,7 @@ declare class QueryHooks extends CollectionHooks {
|
|
|
908
1095
|
|
|
909
1096
|
declare class Client {
|
|
910
1097
|
cart: CartApi;
|
|
1098
|
+
community: CommunityClient;
|
|
911
1099
|
query: ReadOnlyQueryHooks;
|
|
912
1100
|
collections: CollectionClient;
|
|
913
1101
|
queryClient: QueryClient;
|
|
@@ -930,6 +1118,7 @@ declare function createClient(options: ClientConfig): Client;
|
|
|
930
1118
|
declare class ServerClient {
|
|
931
1119
|
api: OrderApi;
|
|
932
1120
|
cart: CartApi;
|
|
1121
|
+
community: CommunityClient;
|
|
933
1122
|
product: ProductApi;
|
|
934
1123
|
query: QueryHooks;
|
|
935
1124
|
collections: CollectionClient;
|
|
@@ -968,4 +1157,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
968
1157
|
*/
|
|
969
1158
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
970
1159
|
|
|
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 };
|
|
1160
|
+
export { type AddItemParams, ApiError, type ApiQueryOptions, type ApplyDiscountParams, BaseApi, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, Client, type ClientConfig, type ClientMetadata, type ClientServerConfig, type ClientState, Client as ClientType, CollectionClient, type CollectionDetailQueryParams, CollectionHooks, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, CommunityClient, type CommunityClientOptions, ConfigError, type 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 };
|