@01.software/sdk 0.2.9-dev.260309.c56872d → 0.2.9-dev.260310.cf511cb
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-BieKA-OQ.d.ts → auth-CVVo5UT5.d.ts} +1 -1
- package/dist/{auth-CAV8xgZk.d.cts → auth-CqgrT1qd.d.cts} +1 -1
- package/dist/auth.d.cts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/index.cjs +38 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -13
- package/dist/index.d.ts +10 -13
- package/dist/index.js +38 -27
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-2wbfaDxp.d.cts → payload-types-Cq93wqIe.d.cts} +967 -69
- package/dist/{payload-types-2wbfaDxp.d.ts → payload-types-Cq93wqIe.d.ts} +967 -69
- package/dist/{webhook-Byzl1A0g.d.cts → webhook-C_7s0K66.d.ts} +2 -2
- package/dist/{webhook-I6ZDGW1d.d.ts → webhook-NRdVwXN7.d.cts} +2 -2
- package/dist/webhook.d.cts +2 -2
- package/dist/webhook.d.ts +2 -2
- package/package.json +21 -23
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, C as Cart, c as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export {
|
|
3
|
-
import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, S as SDKError, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-
|
|
4
|
-
export { x as API_URLS, f as ApiError, H as ApiQueryReactOptions, z as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, w as Environment, e as ErrorLogger, E as ExtractArrayType, G as GoneError, J as JwtPayload, N as NetworkError, B as PaginationMeta, R as RetryConfig, h as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, t as createApiKey, r as createServerToken, s as decodeServerToken, l as isApiError, m as isConfigError, o as isGoneError, j as isNetworkError, i as isSDKError, p as isServiceUnavailableError, n as isTimeoutError, q as isUsageLimitError, k as isValidationError, u as parseApiKey, y as resolveApiUrl, v as verifyServerToken } from './auth-
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, C as Cart, c as CartItem, P as Product } from './payload-types-Cq93wqIe.cjs';
|
|
2
|
+
export { n as ApiUsage, ax as ApiUsageSelect, A as Audience, at as AudiencesSelect, bA as Auth, p as BillingHistory, az as BillingHistorySelect, x as Brand, B as BrandLogo, aJ as BrandLogosSelect, aI as BrandsSelect, a$ as CartItemsSelect, a_ as CartsSelect, g as CodeBlock, bz as CollectionsWidget, d as Config, z as Customer, H as CustomerAddress, aX as CustomerAddressesSelect, e as CustomerAuthOperations, D as CustomerGroup, G as CustomerGroupImage, aZ as CustomerGroupImagesSelect, aY as CustomerGroupsSelect, aW as CustomersSelect, Q as Discount, b0 as DiscountsSelect, _ as Document, b7 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentImage, b9 as DocumentImagesSelect, $ as DocumentType, b8 as DocumentTypesSelect, b6 as DocumentsSelect, k as EmailLog, au as EmailLogsSelect, L as ExchangeProduct, aU as ExchangeProductsSelect, aT as ExchangesSelect, j as FieldConfig, ar as FieldConfigsSelect, aa as Flow, ae as FlowEdgeType, bk as FlowEdgeTypesSelect, ab as FlowImage, bl as FlowImagesSelect, ad as FlowNodeType, bj as FlowNodeTypesSelect, ac as FlowTag, bm as FlowTagsSelect, bi as FlowsSelect, F as Form, al as FormSubmission, bu as FormSubmissionsSelect, bt as FormsSelect, J as FulfillmentItem, aQ as FulfillmentItemsSelect, aP as FulfillmentsSelect, be as GalleriesSelect, a6 as Gallery, bg as GalleryCategoriesSelect, a8 as GalleryCategory, a7 as GalleryImage, bf as GalleryImagesSelect, a9 as GalleryTag, bh as GalleryTagsSelect, I as IframeBlock, ag as LiveStream, ah as LiveStreamImage, bs as LiveStreamImagesSelect, br as LiveStreamsSelect, M as Media, as as MediaSelect, a3 as Music, bc as MusicsSelect, aM as OrderProductsSelect, N as OrderStatusLog, aO as OrderStatusLogsSelect, aL as OrdersSelect, am as PayloadKv, bv as PayloadKvSelect, an as PayloadLockedDocument, bw as PayloadLockedDocumentsSelect, ap as PayloadMigration, by as PayloadMigrationsSelect, ao as PayloadPreference, bx as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, bb as PlaylistCategoriesSelect, a4 as PlaylistCategory, a5 as PlaylistImage, bd as PlaylistImagesSelect, ba as PlaylistsSelect, V as Post, X as PostAuthor, b2 as PostAuthorsSelect, b3 as PostCategoriesSelect, Y as PostCategory, W as PostImage, b5 as PostImagesSelect, Z as PostTag, b4 as PostTagsSelect, b1 as PostsSelect, aF as ProductCategoriesSelect, u as ProductCategory, w as ProductCollection, aH as ProductCollectionsSelect, r as ProductImage, aK as ProductImagesSelect, t as ProductOption, aE as ProductOptionsSelect, v as ProductTag, aG as ProductTagsSelect, s as ProductVariant, aD as ProductVariantsSelect, aC as ProductsSelect, K as ReturnProduct, aS as ReturnProductsSelect, aR as ReturnsSelect, aV as ShippingPoliciesSelect, y as ShippingPolicy, o as Subscription, ay as SubscriptionsSelect, S as SupportedTimezones, i as Tenant, q as TenantLogo, aA as TenantLogosSelect, aw as TenantMetadataSelect, l as TenantMetadatum, m as TenantOgImage, aB as TenantOgImagesSelect, av as TenantsSelect, aN as TransactionsSelect, h as User, U as UserAuthOperations, aq as UsersSelect, af as Video, bo as VideoCategoriesSelect, aj as VideoCategory, ai as VideoImage, bq as VideoImagesSelect, ak as VideoTag, bp as VideoTagsSelect, bn as VideosSelect } from './payload-types-Cq93wqIe.cjs';
|
|
3
|
+
import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, S as SDKError, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-CqgrT1qd.cjs';
|
|
4
|
+
export { x as API_URLS, f as ApiError, H as ApiQueryReactOptions, z as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, w as Environment, e as ErrorLogger, E as ExtractArrayType, G as GoneError, J as JwtPayload, N as NetworkError, B as PaginationMeta, R as RetryConfig, h as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, t as createApiKey, r as createServerToken, s as decodeServerToken, l as isApiError, m as isConfigError, o as isGoneError, j as isNetworkError, i as isSDKError, p as isServiceUnavailableError, n as isTimeoutError, q as isUsageLimitError, k as isValidationError, u as parseApiKey, y as resolveApiUrl, v as verifyServerToken } from './auth-CqgrT1qd.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import { P as PublicCollection, C as CollectionType } from './webhook-
|
|
8
|
-
export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-
|
|
7
|
+
import { P as PublicCollection, C as CollectionType } from './webhook-NRdVwXN7.cjs';
|
|
8
|
+
export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-NRdVwXN7.cjs';
|
|
9
9
|
import { Metadata } from 'next';
|
|
10
10
|
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';
|
|
11
11
|
import 'payload';
|
|
@@ -26,6 +26,7 @@ type CreateOrderParams = {
|
|
|
26
26
|
shippingAddress: Order['shippingAddress'];
|
|
27
27
|
orderProducts: Omit<OrderProduct, 'id' | 'brand' | 'createdAt' | 'updatedAt' | 'order' | 'status'>[];
|
|
28
28
|
totalAmount: number;
|
|
29
|
+
shippingFee?: number;
|
|
29
30
|
paymentId?: string;
|
|
30
31
|
discountCode?: string;
|
|
31
32
|
};
|
|
@@ -242,8 +243,6 @@ declare class ProductApi {
|
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
interface GenerateMetadataOptions {
|
|
245
|
-
title?: string;
|
|
246
|
-
description?: string;
|
|
247
246
|
siteName?: string;
|
|
248
247
|
}
|
|
249
248
|
|
|
@@ -528,7 +527,7 @@ declare class CustomerAuth {
|
|
|
528
527
|
page?: number;
|
|
529
528
|
limit?: number;
|
|
530
529
|
status?: string;
|
|
531
|
-
}): Promise<
|
|
530
|
+
}): Promise<PayloadFindResponse<Order>>;
|
|
532
531
|
/**
|
|
533
532
|
* Get the current token (or null if not authenticated)
|
|
534
533
|
*/
|
|
@@ -796,9 +795,7 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
796
795
|
* @param ref - The relation field value (T, string, number, null, or undefined)
|
|
797
796
|
* @returns The resolved document object, or null if not populated
|
|
798
797
|
*/
|
|
799
|
-
declare const resolveRelation: <T>(ref: T | string | null | undefined) => T | null;
|
|
800
|
-
/** @deprecated Use `resolveRelation` instead */
|
|
801
|
-
declare const objectFor: <T>(ref: T | string | null | undefined) => T | null;
|
|
798
|
+
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
802
799
|
|
|
803
800
|
interface VideoThumbnailOptions {
|
|
804
801
|
/** Width in pixels (default: 640) */
|
|
@@ -884,4 +881,4 @@ declare function getVideoStreamUrl(playbackId: string): string;
|
|
|
884
881
|
*/
|
|
885
882
|
declare function getVideoMp4Url(playbackId: string, resolution?: 'high' | 'medium' | 'low'): string;
|
|
886
883
|
|
|
887
|
-
export { type AddItemParams, ApiQueryOptions, type ApplyDiscountParams, BrowserClient, BrowserClient as BrowserClientType, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Exchange, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, Return, type ReturnWithRefundParams, SDKError, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, type ValidateDiscountParams, type ValidateDiscountResult, type VideoGifOptions, type VideoThumbnailOptions, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, getVideoGif, getVideoMp4Url, getVideoStoryboard, getVideoStreamUrl, getVideoThumbnail,
|
|
884
|
+
export { type AddItemParams, ApiQueryOptions, type ApplyDiscountParams, BrowserClient, BrowserClient as BrowserClientType, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Exchange, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, Return, type ReturnWithRefundParams, SDKError, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, type ValidateDiscountParams, type ValidateDiscountResult, type VideoGifOptions, type VideoThumbnailOptions, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, getVideoGif, getVideoMp4Url, getVideoStoryboard, getVideoStreamUrl, getVideoThumbnail, resolveRelation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, C as Cart, c as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export {
|
|
3
|
-
import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, S as SDKError, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-
|
|
4
|
-
export { x as API_URLS, f as ApiError, H as ApiQueryReactOptions, z as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, w as Environment, e as ErrorLogger, E as ExtractArrayType, G as GoneError, J as JwtPayload, N as NetworkError, B as PaginationMeta, R as RetryConfig, h as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, t as createApiKey, r as createServerToken, s as decodeServerToken, l as isApiError, m as isConfigError, o as isGoneError, j as isNetworkError, i as isSDKError, p as isServiceUnavailableError, n as isTimeoutError, q as isUsageLimitError, k as isValidationError, u as parseApiKey, y as resolveApiUrl, v as verifyServerToken } from './auth-
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, C as Cart, c as CartItem, P as Product } from './payload-types-Cq93wqIe.js';
|
|
2
|
+
export { n as ApiUsage, ax as ApiUsageSelect, A as Audience, at as AudiencesSelect, bA as Auth, p as BillingHistory, az as BillingHistorySelect, x as Brand, B as BrandLogo, aJ as BrandLogosSelect, aI as BrandsSelect, a$ as CartItemsSelect, a_ as CartsSelect, g as CodeBlock, bz as CollectionsWidget, d as Config, z as Customer, H as CustomerAddress, aX as CustomerAddressesSelect, e as CustomerAuthOperations, D as CustomerGroup, G as CustomerGroupImage, aZ as CustomerGroupImagesSelect, aY as CustomerGroupsSelect, aW as CustomersSelect, Q as Discount, b0 as DiscountsSelect, _ as Document, b7 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentImage, b9 as DocumentImagesSelect, $ as DocumentType, b8 as DocumentTypesSelect, b6 as DocumentsSelect, k as EmailLog, au as EmailLogsSelect, L as ExchangeProduct, aU as ExchangeProductsSelect, aT as ExchangesSelect, j as FieldConfig, ar as FieldConfigsSelect, aa as Flow, ae as FlowEdgeType, bk as FlowEdgeTypesSelect, ab as FlowImage, bl as FlowImagesSelect, ad as FlowNodeType, bj as FlowNodeTypesSelect, ac as FlowTag, bm as FlowTagsSelect, bi as FlowsSelect, F as Form, al as FormSubmission, bu as FormSubmissionsSelect, bt as FormsSelect, J as FulfillmentItem, aQ as FulfillmentItemsSelect, aP as FulfillmentsSelect, be as GalleriesSelect, a6 as Gallery, bg as GalleryCategoriesSelect, a8 as GalleryCategory, a7 as GalleryImage, bf as GalleryImagesSelect, a9 as GalleryTag, bh as GalleryTagsSelect, I as IframeBlock, ag as LiveStream, ah as LiveStreamImage, bs as LiveStreamImagesSelect, br as LiveStreamsSelect, M as Media, as as MediaSelect, a3 as Music, bc as MusicsSelect, aM as OrderProductsSelect, N as OrderStatusLog, aO as OrderStatusLogsSelect, aL as OrdersSelect, am as PayloadKv, bv as PayloadKvSelect, an as PayloadLockedDocument, bw as PayloadLockedDocumentsSelect, ap as PayloadMigration, by as PayloadMigrationsSelect, ao as PayloadPreference, bx as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, bb as PlaylistCategoriesSelect, a4 as PlaylistCategory, a5 as PlaylistImage, bd as PlaylistImagesSelect, ba as PlaylistsSelect, V as Post, X as PostAuthor, b2 as PostAuthorsSelect, b3 as PostCategoriesSelect, Y as PostCategory, W as PostImage, b5 as PostImagesSelect, Z as PostTag, b4 as PostTagsSelect, b1 as PostsSelect, aF as ProductCategoriesSelect, u as ProductCategory, w as ProductCollection, aH as ProductCollectionsSelect, r as ProductImage, aK as ProductImagesSelect, t as ProductOption, aE as ProductOptionsSelect, v as ProductTag, aG as ProductTagsSelect, s as ProductVariant, aD as ProductVariantsSelect, aC as ProductsSelect, K as ReturnProduct, aS as ReturnProductsSelect, aR as ReturnsSelect, aV as ShippingPoliciesSelect, y as ShippingPolicy, o as Subscription, ay as SubscriptionsSelect, S as SupportedTimezones, i as Tenant, q as TenantLogo, aA as TenantLogosSelect, aw as TenantMetadataSelect, l as TenantMetadatum, m as TenantOgImage, aB as TenantOgImagesSelect, av as TenantsSelect, aN as TransactionsSelect, h as User, U as UserAuthOperations, aq as UsersSelect, af as Video, bo as VideoCategoriesSelect, aj as VideoCategory, ai as VideoImage, bq as VideoImagesSelect, ak as VideoTag, bp as VideoTagsSelect, bn as VideosSelect } from './payload-types-Cq93wqIe.js';
|
|
3
|
+
import { F as FetchOptions, A as ApiQueryOptions, P as PayloadFindResponse, a as PayloadMutationResponse, S as SDKError, C as ClientBrowserConfig, b as ClientState, c as ClientServerConfig } from './auth-CVVo5UT5.js';
|
|
4
|
+
export { x as API_URLS, f as ApiError, H as ApiQueryReactOptions, z as ClientMetadata, g as ConfigError, d as DebugConfig, D as DeepPartial, w as Environment, e as ErrorLogger, E as ExtractArrayType, G as GoneError, J as JwtPayload, N as NetworkError, B as PaginationMeta, R as RetryConfig, h as ServiceUnavailableError, T as TimeoutError, U as UsageLimitError, V as ValidationError, t as createApiKey, r as createServerToken, s as decodeServerToken, l as isApiError, m as isConfigError, o as isGoneError, j as isNetworkError, i as isSDKError, p as isServiceUnavailableError, n as isTimeoutError, q as isUsageLimitError, k as isValidationError, u as parseApiKey, y as resolveApiUrl, v as verifyServerToken } from './auth-CVVo5UT5.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import { P as PublicCollection, C as CollectionType } from './webhook-
|
|
8
|
-
export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-
|
|
7
|
+
import { P as PublicCollection, C as CollectionType } from './webhook-C_7s0K66.js';
|
|
8
|
+
export { b as COLLECTIONS, a as Collection, c as WebhookEvent, d as WebhookHandler, W as WebhookOperation, e as WebhookOptions, f as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-C_7s0K66.js';
|
|
9
9
|
import { Metadata } from 'next';
|
|
10
10
|
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';
|
|
11
11
|
import 'payload';
|
|
@@ -26,6 +26,7 @@ type CreateOrderParams = {
|
|
|
26
26
|
shippingAddress: Order['shippingAddress'];
|
|
27
27
|
orderProducts: Omit<OrderProduct, 'id' | 'brand' | 'createdAt' | 'updatedAt' | 'order' | 'status'>[];
|
|
28
28
|
totalAmount: number;
|
|
29
|
+
shippingFee?: number;
|
|
29
30
|
paymentId?: string;
|
|
30
31
|
discountCode?: string;
|
|
31
32
|
};
|
|
@@ -242,8 +243,6 @@ declare class ProductApi {
|
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
interface GenerateMetadataOptions {
|
|
245
|
-
title?: string;
|
|
246
|
-
description?: string;
|
|
247
246
|
siteName?: string;
|
|
248
247
|
}
|
|
249
248
|
|
|
@@ -528,7 +527,7 @@ declare class CustomerAuth {
|
|
|
528
527
|
page?: number;
|
|
529
528
|
limit?: number;
|
|
530
529
|
status?: string;
|
|
531
|
-
}): Promise<
|
|
530
|
+
}): Promise<PayloadFindResponse<Order>>;
|
|
532
531
|
/**
|
|
533
532
|
* Get the current token (or null if not authenticated)
|
|
534
533
|
*/
|
|
@@ -796,9 +795,7 @@ declare const formatOrderName: (items: OrderItem[]) => string;
|
|
|
796
795
|
* @param ref - The relation field value (T, string, number, null, or undefined)
|
|
797
796
|
* @returns The resolved document object, or null if not populated
|
|
798
797
|
*/
|
|
799
|
-
declare const resolveRelation: <T>(ref: T | string | null | undefined) => T | null;
|
|
800
|
-
/** @deprecated Use `resolveRelation` instead */
|
|
801
|
-
declare const objectFor: <T>(ref: T | string | null | undefined) => T | null;
|
|
798
|
+
declare const resolveRelation: <T>(ref: T | string | number | null | undefined) => T | null;
|
|
802
799
|
|
|
803
800
|
interface VideoThumbnailOptions {
|
|
804
801
|
/** Width in pixels (default: 640) */
|
|
@@ -884,4 +881,4 @@ declare function getVideoStreamUrl(playbackId: string): string;
|
|
|
884
881
|
*/
|
|
885
882
|
declare function getVideoMp4Url(playbackId: string, resolution?: 'high' | 'medium' | 'low'): string;
|
|
886
883
|
|
|
887
|
-
export { type AddItemParams, ApiQueryOptions, type ApplyDiscountParams, BrowserClient, BrowserClient as BrowserClientType, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Exchange, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, Return, type ReturnWithRefundParams, SDKError, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, type ValidateDiscountParams, type ValidateDiscountResult, type VideoGifOptions, type VideoThumbnailOptions, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, getVideoGif, getVideoMp4Url, getVideoStoryboard, getVideoStreamUrl, getVideoThumbnail,
|
|
884
|
+
export { type AddItemParams, ApiQueryOptions, type ApplyDiscountParams, BrowserClient, BrowserClient as BrowserClientType, type CalculateShippingParams, type CalculateShippingResult, Cart, CartApi, type CartApiOptions, CartItem, type CheckoutParams, type ClearCartParams, ClientBrowserConfig, ClientServerConfig, ClientState, CollectionClient, type CollectionDetailQueryParams, type CollectionInfiniteQueryParams, CollectionQueryBuilder, type CollectionQueryParams, CollectionType, type CreateExchangeParams, type CreateFulfillmentParams, type CreateOrderParams, type CreateReturnParams, CustomerAuth, type CustomerAuthOptions, type CustomerAuthResponse, type CustomerLoginData, type CustomerProfile, type CustomerRefreshResponse, type CustomerRegisterData, Exchange, Fulfillment, type GenerateMetadataOptions, type GetOrderParams, Order, OrderApi, type OrderApiOptions, OrderProduct, PayloadFindResponse, PayloadMutationResponse, Product, ProductApi, type ProductApiOptions, PublicCollection, QueryHooks, type ReadOnlyQueryBuilder, type ReadOnlyQueryHooks, type RemoveDiscountParams, type RemoveItemParams, Return, type ReturnWithRefundParams, SDKError, ServerClient, ServerClient as ServerClientType, type StockCheckParams, type StockCheckResponse, type StockCheckResult, Transaction, type UpdateExchangeParams, type UpdateFulfillmentParams, type UpdateItemParams, type UpdateOrderParams, type UpdateProfileData, type UpdateReturnParams, type UpdateTransactionParams, type ValidateDiscountParams, type ValidateDiscountResult, type VideoGifOptions, type VideoThumbnailOptions, collectionKeys, createBrowserClient, createServerClient, customerKeys, formatOrderName, generateOrderNumber, getQueryClient, getVideoGif, getVideoMp4Url, getVideoStoryboard, getVideoStreamUrl, getVideoThumbnail, resolveRelation };
|
package/dist/index.js
CHANGED
|
@@ -693,42 +693,44 @@ var ProductApi = class {
|
|
|
693
693
|
|
|
694
694
|
// src/utils/types.ts
|
|
695
695
|
var resolveRelation = (ref) => {
|
|
696
|
-
if (typeof ref === "string" || ref === null || ref === void 0)
|
|
696
|
+
if (typeof ref === "string" || typeof ref === "number" || ref === null || ref === void 0)
|
|
697
697
|
return null;
|
|
698
698
|
return ref;
|
|
699
699
|
};
|
|
700
|
-
var objectFor = resolveRelation;
|
|
701
700
|
|
|
702
701
|
// src/core/metadata/index.ts
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
playlists: { description: "description", image: "image" }
|
|
708
|
-
};
|
|
709
|
-
var DEFAULT_META_FIELDS = { description: "description", image: "thumbnail" };
|
|
710
|
-
function extractMetaFields(collection, doc) {
|
|
711
|
-
var _a, _b, _c, _d;
|
|
712
|
-
const mapping = (_a = COLLECTION_META_FIELDS[collection]) != null ? _a : DEFAULT_META_FIELDS;
|
|
702
|
+
function extractSeo(doc) {
|
|
703
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
704
|
+
const seo = (_a = doc.seo) != null ? _a : {};
|
|
705
|
+
const og = (_b = seo.openGraph) != null ? _b : {};
|
|
713
706
|
return {
|
|
714
|
-
title: (
|
|
715
|
-
description:
|
|
716
|
-
|
|
707
|
+
title: (_d = (_c = seo.title) != null ? _c : doc.title) != null ? _d : null,
|
|
708
|
+
description: (_e = seo.description) != null ? _e : null,
|
|
709
|
+
noIndex: (_f = seo.noIndex) != null ? _f : null,
|
|
710
|
+
canonical: (_g = seo.canonical) != null ? _g : null,
|
|
711
|
+
openGraph: {
|
|
712
|
+
title: (_h = og.title) != null ? _h : null,
|
|
713
|
+
description: (_i = og.description) != null ? _i : null,
|
|
714
|
+
image: (_j = og.image) != null ? _j : null
|
|
715
|
+
}
|
|
717
716
|
};
|
|
718
717
|
}
|
|
719
718
|
function generateMetadata(input, options) {
|
|
720
|
-
var _a, _b, _c, _d;
|
|
721
|
-
const title = (
|
|
722
|
-
const description = (
|
|
723
|
-
const
|
|
724
|
-
|
|
719
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
720
|
+
const title = (_a = input.title) != null ? _a : void 0;
|
|
721
|
+
const description = (_b = input.description) != null ? _b : void 0;
|
|
722
|
+
const ogTitle = (_d = (_c = input.openGraph) == null ? void 0 : _c.title) != null ? _d : title;
|
|
723
|
+
const ogDescription = (_f = (_e = input.openGraph) == null ? void 0 : _e.description) != null ? _f : description;
|
|
724
|
+
const image = resolveMetaImage((_g = input.openGraph) == null ? void 0 : _g.image);
|
|
725
|
+
return __spreadProps(__spreadValues(__spreadValues({
|
|
725
726
|
title,
|
|
726
|
-
description
|
|
727
|
-
|
|
727
|
+
description
|
|
728
|
+
}, input.noIndex && { robots: { index: false, follow: false } }), input.canonical && { alternates: { canonical: input.canonical } }), {
|
|
729
|
+
openGraph: __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, ogTitle && { title: ogTitle }), ogDescription && { description: ogDescription }), (options == null ? void 0 : options.siteName) && { siteName: options.siteName }), image && { images: [image] }),
|
|
728
730
|
twitter: __spreadValues(__spreadValues(__spreadValues({
|
|
729
731
|
card: image ? "summary_large_image" : "summary"
|
|
730
|
-
},
|
|
731
|
-
};
|
|
732
|
+
}, ogTitle && { title: ogTitle }), ogDescription && { description: ogDescription }), image && { images: [image.url] })
|
|
733
|
+
});
|
|
732
734
|
}
|
|
733
735
|
function resolveMetaImage(ref) {
|
|
734
736
|
var _a;
|
|
@@ -838,7 +840,7 @@ var CollectionQueryBuilder = class {
|
|
|
838
840
|
const doc = docs[0];
|
|
839
841
|
if (!doc) return null;
|
|
840
842
|
return generateMetadata(
|
|
841
|
-
|
|
843
|
+
extractSeo(doc),
|
|
842
844
|
metadataOptions
|
|
843
845
|
);
|
|
844
846
|
});
|
|
@@ -852,7 +854,7 @@ var CollectionQueryBuilder = class {
|
|
|
852
854
|
return __async(this, null, function* () {
|
|
853
855
|
const doc = yield this.findById(id, { depth: 1 });
|
|
854
856
|
return generateMetadata(
|
|
855
|
-
|
|
857
|
+
extractSeo(doc),
|
|
856
858
|
metadataOptions
|
|
857
859
|
);
|
|
858
860
|
});
|
|
@@ -960,6 +962,7 @@ var HttpClient = class {
|
|
|
960
962
|
nextPage: (_b = jsonData.nextPage) != null ? _b : null
|
|
961
963
|
};
|
|
962
964
|
} catch (error) {
|
|
965
|
+
if (error instanceof SDKError) throw error;
|
|
963
966
|
throw createApiError("Failed to parse response.", response.status, {
|
|
964
967
|
contentType,
|
|
965
968
|
error: error instanceof Error ? error.message : error
|
|
@@ -986,6 +989,7 @@ var HttpClient = class {
|
|
|
986
989
|
errors: jsonData.errors
|
|
987
990
|
};
|
|
988
991
|
} catch (error) {
|
|
992
|
+
if (error instanceof SDKError) throw error;
|
|
989
993
|
throw createApiError("Failed to parse response.", response.status, {
|
|
990
994
|
contentType,
|
|
991
995
|
error: error instanceof Error ? error.message : error
|
|
@@ -1005,6 +1009,7 @@ var HttpClient = class {
|
|
|
1005
1009
|
const jsonData = yield response.json();
|
|
1006
1010
|
return jsonData;
|
|
1007
1011
|
} catch (error) {
|
|
1012
|
+
if (error instanceof SDKError) throw error;
|
|
1008
1013
|
throw createApiError("Failed to parse response.", response.status, {
|
|
1009
1014
|
contentType,
|
|
1010
1015
|
error: error instanceof Error ? error.message : error
|
|
@@ -1200,15 +1205,21 @@ var COLLECTIONS = [
|
|
|
1200
1205
|
"post-images",
|
|
1201
1206
|
"playlists",
|
|
1202
1207
|
"playlist-images",
|
|
1208
|
+
"playlist-categories",
|
|
1203
1209
|
"musics",
|
|
1204
1210
|
"galleries",
|
|
1205
1211
|
"gallery-images",
|
|
1206
1212
|
"gallery-categories",
|
|
1213
|
+
"gallery-tags",
|
|
1207
1214
|
"flows",
|
|
1208
1215
|
"flow-images",
|
|
1209
1216
|
"flow-node-types",
|
|
1210
1217
|
"flow-edge-types",
|
|
1218
|
+
"flow-tags",
|
|
1211
1219
|
"videos",
|
|
1220
|
+
"video-images",
|
|
1221
|
+
"video-categories",
|
|
1222
|
+
"video-tags",
|
|
1212
1223
|
"live-streams",
|
|
1213
1224
|
"live-stream-images",
|
|
1214
1225
|
"forms",
|
|
@@ -2185,6 +2196,7 @@ export {
|
|
|
2185
2196
|
OrderApi,
|
|
2186
2197
|
ProductApi,
|
|
2187
2198
|
QueryHooks,
|
|
2199
|
+
SDKError,
|
|
2188
2200
|
ServerClient,
|
|
2189
2201
|
ServiceUnavailableError,
|
|
2190
2202
|
TimeoutError,
|
|
@@ -2222,7 +2234,6 @@ export {
|
|
|
2222
2234
|
isUsageLimitError,
|
|
2223
2235
|
isValidWebhookEvent,
|
|
2224
2236
|
isValidationError,
|
|
2225
|
-
objectFor,
|
|
2226
2237
|
parseApiKey,
|
|
2227
2238
|
resolveRelation,
|
|
2228
2239
|
verifyServerToken
|