@01.software/sdk 0.18.0 → 0.20.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 +16 -10
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/{const-zEoxAfGX.d.cts → const-BApEF1Hu.d.cts} +2 -2
- package/dist/{const-_gW__LA1.d.ts → const-BNJRuk3V.d.ts} +2 -2
- package/dist/index.cjs +60 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -58
- package/dist/index.d.ts +30 -58
- package/dist/index.js +60 -56
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-Cwnj_qN4.d.cts → payload-types-D7lnu9By.d.cts} +429 -141
- package/dist/{payload-types-Cwnj_qN4.d.ts → payload-types-D7lnu9By.d.ts} +429 -141
- 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/canvas.cjs +33 -34
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +26 -1
- package/dist/ui/canvas.d.ts +26 -1
- package/dist/ui/canvas.js +33 -34
- package/dist/ui/canvas.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-C4BwXP5T.d.cts} +7 -4
- package/dist/{webhook-Ce9uNv5c.d.cts → webhook-C6vne8Ve.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 +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
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-D7lnu9By.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-D7lnu9By.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-C4BwXP5T.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-C4BwXP5T.cjs';
|
|
9
|
+
import { P as PublicCollection } from './const-BApEF1Hu.cjs';
|
|
10
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-BApEF1Hu.cjs';
|
|
11
|
+
import { UpdateTransactionParams, ReturnWithRefundParams } from '@01.software/contracts';
|
|
12
|
+
export { ReturnWithRefundParams, UpdateTransactionParams } from '@01.software/contracts';
|
|
11
13
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
12
14
|
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
15
|
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 +41,6 @@ interface ClientConfig {
|
|
|
39
41
|
}
|
|
40
42
|
interface ClientServerConfig extends ClientConfig {
|
|
41
43
|
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
44
|
}
|
|
50
45
|
interface ClientMetadata {
|
|
51
46
|
userAgent?: string;
|
|
@@ -250,7 +245,6 @@ interface FetchOptions extends RequestInit {
|
|
|
250
245
|
publishableKey?: string;
|
|
251
246
|
secretKey?: string;
|
|
252
247
|
customerToken?: string;
|
|
253
|
-
tenantId?: string;
|
|
254
248
|
timeout?: number;
|
|
255
249
|
debug?: boolean | DebugConfig;
|
|
256
250
|
retry?: RetryConfig;
|
|
@@ -261,11 +255,10 @@ interface FetchOptions extends RequestInit {
|
|
|
261
255
|
declare class HttpClient {
|
|
262
256
|
protected publishableKey: string;
|
|
263
257
|
protected secretKey?: string;
|
|
264
|
-
protected tenantId?: string;
|
|
265
258
|
private getCustomerToken?;
|
|
266
259
|
private onUnauthorized?;
|
|
267
260
|
private onRequestId?;
|
|
268
|
-
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void
|
|
261
|
+
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void);
|
|
269
262
|
protected get defaultOptions(): FetchOptions;
|
|
270
263
|
protected fetchWithTracking(url: string, opts: FetchOptions): Promise<Response>;
|
|
271
264
|
protected buildUrl(endpoint: string, options?: ApiQueryOptions): string;
|
|
@@ -435,12 +428,11 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
435
428
|
interface CommunityClientOptions {
|
|
436
429
|
publishableKey?: string;
|
|
437
430
|
secretKey?: string;
|
|
438
|
-
tenantId?: string;
|
|
439
431
|
customerToken?: string | (() => string | null);
|
|
440
432
|
onUnauthorized?: () => Promise<string | null>;
|
|
441
433
|
onRequestId?: (id: string | null) => void;
|
|
442
434
|
}
|
|
443
|
-
interface
|
|
435
|
+
interface CommunityPost {
|
|
444
436
|
id: string;
|
|
445
437
|
title: string;
|
|
446
438
|
content: unknown;
|
|
@@ -454,7 +446,7 @@ interface Thread {
|
|
|
454
446
|
interface Comment {
|
|
455
447
|
id: string;
|
|
456
448
|
body: string;
|
|
457
|
-
|
|
449
|
+
post?: string;
|
|
458
450
|
parent?: string;
|
|
459
451
|
rootComment?: string;
|
|
460
452
|
createdAt?: string;
|
|
@@ -463,7 +455,7 @@ interface Comment {
|
|
|
463
455
|
}
|
|
464
456
|
interface Reaction {
|
|
465
457
|
id: string;
|
|
466
|
-
|
|
458
|
+
post?: string;
|
|
467
459
|
comment?: string;
|
|
468
460
|
type?: string;
|
|
469
461
|
createdAt?: string;
|
|
@@ -476,7 +468,7 @@ interface ReactionSummary {
|
|
|
476
468
|
}
|
|
477
469
|
interface Bookmark {
|
|
478
470
|
id: string;
|
|
479
|
-
|
|
471
|
+
post?: string;
|
|
480
472
|
createdAt?: string;
|
|
481
473
|
[key: string]: unknown;
|
|
482
474
|
}
|
|
@@ -502,47 +494,46 @@ interface PaginatedResponse<T> {
|
|
|
502
494
|
declare class CommunityClient {
|
|
503
495
|
private readonly publishableKey;
|
|
504
496
|
private readonly secretKey?;
|
|
505
|
-
private readonly tenantId?;
|
|
506
497
|
private readonly customerToken?;
|
|
507
498
|
private readonly onUnauthorized?;
|
|
508
499
|
private readonly onRequestId?;
|
|
509
500
|
constructor(options: CommunityClientOptions);
|
|
510
501
|
private buildQuery;
|
|
511
502
|
private execute;
|
|
512
|
-
|
|
503
|
+
createPost(params: {
|
|
513
504
|
title: string;
|
|
514
505
|
content: unknown;
|
|
515
506
|
categories?: string[];
|
|
516
507
|
thumbnail?: string;
|
|
517
|
-
}): Promise<
|
|
518
|
-
|
|
508
|
+
}): Promise<CommunityPost>;
|
|
509
|
+
getMyPosts(params?: {
|
|
519
510
|
page?: number;
|
|
520
511
|
limit?: number;
|
|
521
|
-
}): Promise<PaginatedResponse<
|
|
512
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
522
513
|
getTrending(params?: {
|
|
523
514
|
page?: number;
|
|
524
515
|
limit?: number;
|
|
525
516
|
period?: string;
|
|
526
|
-
}): Promise<PaginatedResponse<
|
|
517
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
527
518
|
incrementView(params: {
|
|
528
|
-
|
|
519
|
+
postId: string;
|
|
529
520
|
}): Promise<{
|
|
530
521
|
viewCount: number;
|
|
531
522
|
}>;
|
|
532
|
-
|
|
533
|
-
|
|
523
|
+
reportPost(params: {
|
|
524
|
+
postId: string;
|
|
534
525
|
reason?: string;
|
|
535
526
|
reasonDetail?: string;
|
|
536
527
|
}): Promise<{
|
|
537
528
|
success: boolean;
|
|
538
529
|
}>;
|
|
539
530
|
createComment(params: {
|
|
540
|
-
|
|
531
|
+
postId: string;
|
|
541
532
|
body: string;
|
|
542
533
|
parentId?: string;
|
|
543
534
|
}): Promise<Comment>;
|
|
544
535
|
listComments(params: {
|
|
545
|
-
|
|
536
|
+
postId: string;
|
|
546
537
|
page?: number;
|
|
547
538
|
limit?: number;
|
|
548
539
|
rootComment?: string;
|
|
@@ -564,11 +555,11 @@ declare class CommunityClient {
|
|
|
564
555
|
success: boolean;
|
|
565
556
|
}>;
|
|
566
557
|
addReaction(params: {
|
|
567
|
-
|
|
558
|
+
postId: string;
|
|
568
559
|
type: string;
|
|
569
560
|
}): Promise<Reaction>;
|
|
570
561
|
removeReaction(params: {
|
|
571
|
-
|
|
562
|
+
postId: string;
|
|
572
563
|
type: string;
|
|
573
564
|
}): Promise<{
|
|
574
565
|
success: boolean;
|
|
@@ -584,14 +575,14 @@ declare class CommunityClient {
|
|
|
584
575
|
success: boolean;
|
|
585
576
|
}>;
|
|
586
577
|
getReactionSummary(params: {
|
|
587
|
-
|
|
578
|
+
postId: string;
|
|
588
579
|
}): Promise<ReactionSummary>;
|
|
589
580
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
590
581
|
addBookmark(params: {
|
|
591
|
-
|
|
582
|
+
postId: string;
|
|
592
583
|
}): Promise<Bookmark>;
|
|
593
584
|
removeBookmark(params: {
|
|
594
|
-
|
|
585
|
+
postId: string;
|
|
595
586
|
}): Promise<{
|
|
596
587
|
success: boolean;
|
|
597
588
|
}>;
|
|
@@ -604,7 +595,6 @@ declare class CommunityClient {
|
|
|
604
595
|
interface ServerApiOptions {
|
|
605
596
|
publishableKey?: string;
|
|
606
597
|
secretKey: string;
|
|
607
|
-
tenantId?: string;
|
|
608
598
|
onRequestId?: (id: string | null) => void;
|
|
609
599
|
}
|
|
610
600
|
interface RequestOptions {
|
|
@@ -614,7 +604,6 @@ interface RequestOptions {
|
|
|
614
604
|
declare abstract class BaseApi {
|
|
615
605
|
protected readonly publishableKey: string;
|
|
616
606
|
protected readonly secretKey: string;
|
|
617
|
-
protected readonly tenantId?: string;
|
|
618
607
|
protected readonly onRequestId?: (id: string | null) => void;
|
|
619
608
|
constructor(apiName: string, options: ServerApiOptions);
|
|
620
609
|
protected request<T>(endpoint: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
@@ -799,7 +788,6 @@ declare class CustomerNamespace {
|
|
|
799
788
|
interface CartApiOptions {
|
|
800
789
|
publishableKey?: string;
|
|
801
790
|
secretKey?: string;
|
|
802
|
-
tenantId?: string;
|
|
803
791
|
customerToken?: string | (() => string | null);
|
|
804
792
|
onUnauthorized?: () => Promise<string | null>;
|
|
805
793
|
onRequestId?: (id: string | null) => void;
|
|
@@ -831,7 +819,6 @@ type ClearCartParams = {
|
|
|
831
819
|
declare class CartApi {
|
|
832
820
|
private readonly publishableKey;
|
|
833
821
|
private readonly secretKey?;
|
|
834
|
-
private readonly tenantId?;
|
|
835
822
|
private readonly customerToken?;
|
|
836
823
|
private readonly onUnauthorized?;
|
|
837
824
|
private readonly onRequestId?;
|
|
@@ -1060,12 +1047,7 @@ type UpdateOrderParams = {
|
|
|
1060
1047
|
orderNumber: string;
|
|
1061
1048
|
status: Order['status'];
|
|
1062
1049
|
};
|
|
1063
|
-
|
|
1064
|
-
pgPaymentId: string;
|
|
1065
|
-
status: Transaction['status'];
|
|
1066
|
-
paymentMethod?: string;
|
|
1067
|
-
receiptUrl?: string;
|
|
1068
|
-
};
|
|
1050
|
+
|
|
1069
1051
|
type CheckoutParams = {
|
|
1070
1052
|
cartId: string;
|
|
1071
1053
|
orderNumber: string;
|
|
@@ -1116,15 +1098,6 @@ type UpdateReturnParams = {
|
|
|
1116
1098
|
returnId: string;
|
|
1117
1099
|
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
1118
1100
|
};
|
|
1119
|
-
type ReturnWithRefundParams = {
|
|
1120
|
-
orderNumber: string;
|
|
1121
|
-
reason?: ReturnReason;
|
|
1122
|
-
reasonDetail?: string;
|
|
1123
|
-
returnItems: ReturnItem[];
|
|
1124
|
-
refundAmount: number;
|
|
1125
|
-
pgPaymentId: string;
|
|
1126
|
-
refundReceiptUrl?: string;
|
|
1127
|
-
};
|
|
1128
1101
|
declare class OrderApi extends BaseApi {
|
|
1129
1102
|
constructor(options: OrderApiOptions);
|
|
1130
1103
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
@@ -1187,7 +1160,6 @@ declare class CommerceClient {
|
|
|
1187
1160
|
interface ServerCommerceClientOptions {
|
|
1188
1161
|
publishableKey?: string;
|
|
1189
1162
|
secretKey: string;
|
|
1190
|
-
tenantId?: string;
|
|
1191
1163
|
onRequestId?: (id: string | null) => void;
|
|
1192
1164
|
}
|
|
1193
1165
|
declare class ServerCommerceClient {
|
|
@@ -1496,4 +1468,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1496
1468
|
*/
|
|
1497
1469
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1498
1470
|
|
|
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,
|
|
1471
|
+
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, 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, 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,15 @@
|
|
|
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-D7lnu9By.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-D7lnu9By.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-C6vne8Ve.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-C6vne8Ve.js';
|
|
9
|
+
import { P as PublicCollection } from './const-BNJRuk3V.js';
|
|
10
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-BNJRuk3V.js';
|
|
11
|
+
import { UpdateTransactionParams, ReturnWithRefundParams } from '@01.software/contracts';
|
|
12
|
+
export { ReturnWithRefundParams, UpdateTransactionParams } from '@01.software/contracts';
|
|
11
13
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
12
14
|
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
15
|
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 +41,6 @@ interface ClientConfig {
|
|
|
39
41
|
}
|
|
40
42
|
interface ClientServerConfig extends ClientConfig {
|
|
41
43
|
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
44
|
}
|
|
50
45
|
interface ClientMetadata {
|
|
51
46
|
userAgent?: string;
|
|
@@ -250,7 +245,6 @@ interface FetchOptions extends RequestInit {
|
|
|
250
245
|
publishableKey?: string;
|
|
251
246
|
secretKey?: string;
|
|
252
247
|
customerToken?: string;
|
|
253
|
-
tenantId?: string;
|
|
254
248
|
timeout?: number;
|
|
255
249
|
debug?: boolean | DebugConfig;
|
|
256
250
|
retry?: RetryConfig;
|
|
@@ -261,11 +255,10 @@ interface FetchOptions extends RequestInit {
|
|
|
261
255
|
declare class HttpClient {
|
|
262
256
|
protected publishableKey: string;
|
|
263
257
|
protected secretKey?: string;
|
|
264
|
-
protected tenantId?: string;
|
|
265
258
|
private getCustomerToken?;
|
|
266
259
|
private onUnauthorized?;
|
|
267
260
|
private onRequestId?;
|
|
268
|
-
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void
|
|
261
|
+
constructor(publishableKey: string, secretKey?: string, getCustomerToken?: () => string | null, onUnauthorized?: () => Promise<string | null>, onRequestId?: (id: string | null) => void);
|
|
269
262
|
protected get defaultOptions(): FetchOptions;
|
|
270
263
|
protected fetchWithTracking(url: string, opts: FetchOptions): Promise<Response>;
|
|
271
264
|
protected buildUrl(endpoint: string, options?: ApiQueryOptions): string;
|
|
@@ -435,12 +428,11 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
435
428
|
interface CommunityClientOptions {
|
|
436
429
|
publishableKey?: string;
|
|
437
430
|
secretKey?: string;
|
|
438
|
-
tenantId?: string;
|
|
439
431
|
customerToken?: string | (() => string | null);
|
|
440
432
|
onUnauthorized?: () => Promise<string | null>;
|
|
441
433
|
onRequestId?: (id: string | null) => void;
|
|
442
434
|
}
|
|
443
|
-
interface
|
|
435
|
+
interface CommunityPost {
|
|
444
436
|
id: string;
|
|
445
437
|
title: string;
|
|
446
438
|
content: unknown;
|
|
@@ -454,7 +446,7 @@ interface Thread {
|
|
|
454
446
|
interface Comment {
|
|
455
447
|
id: string;
|
|
456
448
|
body: string;
|
|
457
|
-
|
|
449
|
+
post?: string;
|
|
458
450
|
parent?: string;
|
|
459
451
|
rootComment?: string;
|
|
460
452
|
createdAt?: string;
|
|
@@ -463,7 +455,7 @@ interface Comment {
|
|
|
463
455
|
}
|
|
464
456
|
interface Reaction {
|
|
465
457
|
id: string;
|
|
466
|
-
|
|
458
|
+
post?: string;
|
|
467
459
|
comment?: string;
|
|
468
460
|
type?: string;
|
|
469
461
|
createdAt?: string;
|
|
@@ -476,7 +468,7 @@ interface ReactionSummary {
|
|
|
476
468
|
}
|
|
477
469
|
interface Bookmark {
|
|
478
470
|
id: string;
|
|
479
|
-
|
|
471
|
+
post?: string;
|
|
480
472
|
createdAt?: string;
|
|
481
473
|
[key: string]: unknown;
|
|
482
474
|
}
|
|
@@ -502,47 +494,46 @@ interface PaginatedResponse<T> {
|
|
|
502
494
|
declare class CommunityClient {
|
|
503
495
|
private readonly publishableKey;
|
|
504
496
|
private readonly secretKey?;
|
|
505
|
-
private readonly tenantId?;
|
|
506
497
|
private readonly customerToken?;
|
|
507
498
|
private readonly onUnauthorized?;
|
|
508
499
|
private readonly onRequestId?;
|
|
509
500
|
constructor(options: CommunityClientOptions);
|
|
510
501
|
private buildQuery;
|
|
511
502
|
private execute;
|
|
512
|
-
|
|
503
|
+
createPost(params: {
|
|
513
504
|
title: string;
|
|
514
505
|
content: unknown;
|
|
515
506
|
categories?: string[];
|
|
516
507
|
thumbnail?: string;
|
|
517
|
-
}): Promise<
|
|
518
|
-
|
|
508
|
+
}): Promise<CommunityPost>;
|
|
509
|
+
getMyPosts(params?: {
|
|
519
510
|
page?: number;
|
|
520
511
|
limit?: number;
|
|
521
|
-
}): Promise<PaginatedResponse<
|
|
512
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
522
513
|
getTrending(params?: {
|
|
523
514
|
page?: number;
|
|
524
515
|
limit?: number;
|
|
525
516
|
period?: string;
|
|
526
|
-
}): Promise<PaginatedResponse<
|
|
517
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
527
518
|
incrementView(params: {
|
|
528
|
-
|
|
519
|
+
postId: string;
|
|
529
520
|
}): Promise<{
|
|
530
521
|
viewCount: number;
|
|
531
522
|
}>;
|
|
532
|
-
|
|
533
|
-
|
|
523
|
+
reportPost(params: {
|
|
524
|
+
postId: string;
|
|
534
525
|
reason?: string;
|
|
535
526
|
reasonDetail?: string;
|
|
536
527
|
}): Promise<{
|
|
537
528
|
success: boolean;
|
|
538
529
|
}>;
|
|
539
530
|
createComment(params: {
|
|
540
|
-
|
|
531
|
+
postId: string;
|
|
541
532
|
body: string;
|
|
542
533
|
parentId?: string;
|
|
543
534
|
}): Promise<Comment>;
|
|
544
535
|
listComments(params: {
|
|
545
|
-
|
|
536
|
+
postId: string;
|
|
546
537
|
page?: number;
|
|
547
538
|
limit?: number;
|
|
548
539
|
rootComment?: string;
|
|
@@ -564,11 +555,11 @@ declare class CommunityClient {
|
|
|
564
555
|
success: boolean;
|
|
565
556
|
}>;
|
|
566
557
|
addReaction(params: {
|
|
567
|
-
|
|
558
|
+
postId: string;
|
|
568
559
|
type: string;
|
|
569
560
|
}): Promise<Reaction>;
|
|
570
561
|
removeReaction(params: {
|
|
571
|
-
|
|
562
|
+
postId: string;
|
|
572
563
|
type: string;
|
|
573
564
|
}): Promise<{
|
|
574
565
|
success: boolean;
|
|
@@ -584,14 +575,14 @@ declare class CommunityClient {
|
|
|
584
575
|
success: boolean;
|
|
585
576
|
}>;
|
|
586
577
|
getReactionSummary(params: {
|
|
587
|
-
|
|
578
|
+
postId: string;
|
|
588
579
|
}): Promise<ReactionSummary>;
|
|
589
580
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
590
581
|
addBookmark(params: {
|
|
591
|
-
|
|
582
|
+
postId: string;
|
|
592
583
|
}): Promise<Bookmark>;
|
|
593
584
|
removeBookmark(params: {
|
|
594
|
-
|
|
585
|
+
postId: string;
|
|
595
586
|
}): Promise<{
|
|
596
587
|
success: boolean;
|
|
597
588
|
}>;
|
|
@@ -604,7 +595,6 @@ declare class CommunityClient {
|
|
|
604
595
|
interface ServerApiOptions {
|
|
605
596
|
publishableKey?: string;
|
|
606
597
|
secretKey: string;
|
|
607
|
-
tenantId?: string;
|
|
608
598
|
onRequestId?: (id: string | null) => void;
|
|
609
599
|
}
|
|
610
600
|
interface RequestOptions {
|
|
@@ -614,7 +604,6 @@ interface RequestOptions {
|
|
|
614
604
|
declare abstract class BaseApi {
|
|
615
605
|
protected readonly publishableKey: string;
|
|
616
606
|
protected readonly secretKey: string;
|
|
617
|
-
protected readonly tenantId?: string;
|
|
618
607
|
protected readonly onRequestId?: (id: string | null) => void;
|
|
619
608
|
constructor(apiName: string, options: ServerApiOptions);
|
|
620
609
|
protected request<T>(endpoint: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
@@ -799,7 +788,6 @@ declare class CustomerNamespace {
|
|
|
799
788
|
interface CartApiOptions {
|
|
800
789
|
publishableKey?: string;
|
|
801
790
|
secretKey?: string;
|
|
802
|
-
tenantId?: string;
|
|
803
791
|
customerToken?: string | (() => string | null);
|
|
804
792
|
onUnauthorized?: () => Promise<string | null>;
|
|
805
793
|
onRequestId?: (id: string | null) => void;
|
|
@@ -831,7 +819,6 @@ type ClearCartParams = {
|
|
|
831
819
|
declare class CartApi {
|
|
832
820
|
private readonly publishableKey;
|
|
833
821
|
private readonly secretKey?;
|
|
834
|
-
private readonly tenantId?;
|
|
835
822
|
private readonly customerToken?;
|
|
836
823
|
private readonly onUnauthorized?;
|
|
837
824
|
private readonly onRequestId?;
|
|
@@ -1060,12 +1047,7 @@ type UpdateOrderParams = {
|
|
|
1060
1047
|
orderNumber: string;
|
|
1061
1048
|
status: Order['status'];
|
|
1062
1049
|
};
|
|
1063
|
-
|
|
1064
|
-
pgPaymentId: string;
|
|
1065
|
-
status: Transaction['status'];
|
|
1066
|
-
paymentMethod?: string;
|
|
1067
|
-
receiptUrl?: string;
|
|
1068
|
-
};
|
|
1050
|
+
|
|
1069
1051
|
type CheckoutParams = {
|
|
1070
1052
|
cartId: string;
|
|
1071
1053
|
orderNumber: string;
|
|
@@ -1116,15 +1098,6 @@ type UpdateReturnParams = {
|
|
|
1116
1098
|
returnId: string;
|
|
1117
1099
|
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
1118
1100
|
};
|
|
1119
|
-
type ReturnWithRefundParams = {
|
|
1120
|
-
orderNumber: string;
|
|
1121
|
-
reason?: ReturnReason;
|
|
1122
|
-
reasonDetail?: string;
|
|
1123
|
-
returnItems: ReturnItem[];
|
|
1124
|
-
refundAmount: number;
|
|
1125
|
-
pgPaymentId: string;
|
|
1126
|
-
refundReceiptUrl?: string;
|
|
1127
|
-
};
|
|
1128
1101
|
declare class OrderApi extends BaseApi {
|
|
1129
1102
|
constructor(options: OrderApiOptions);
|
|
1130
1103
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
@@ -1187,7 +1160,6 @@ declare class CommerceClient {
|
|
|
1187
1160
|
interface ServerCommerceClientOptions {
|
|
1188
1161
|
publishableKey?: string;
|
|
1189
1162
|
secretKey: string;
|
|
1190
|
-
tenantId?: string;
|
|
1191
1163
|
onRequestId?: (id: string | null) => void;
|
|
1192
1164
|
}
|
|
1193
1165
|
declare class ServerCommerceClient {
|
|
@@ -1496,4 +1468,4 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
1496
1468
|
*/
|
|
1497
1469
|
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
1498
1470
|
|
|
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,
|
|
1471
|
+
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, 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, 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 };
|