perspectapi-ts-sdk 6.5.3 → 6.5.6

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/index.d.mts CHANGED
@@ -741,12 +741,13 @@ interface CreatePaymentGatewayRequest {
741
741
  configuration: Record<string, any>;
742
742
  isActive?: boolean;
743
743
  }
744
+ type WebhookEventType = "content.created" | "content.updated" | "content.published" | "content.unpublished" | "content.deleted" | "newsletter.created" | "newsletter.updated" | "newsletter.published" | "newsletter.sent" | "newsletter.deleted" | "product.created" | "product.updated" | "product.deleted" | "product.stock_changed" | "order.paid" | "category.created" | "category.updated" | "category.deleted" | "site.updated" | "site.settings_changed" | "ab.flag_started" | "ab.flag_paused" | "ab.flag_resumed" | "ab.flag_stopped" | "ab.flag_updated" | "ab.config_warmup" | (string & Record<never, never>);
744
745
  interface Webhook {
745
746
  id: string;
746
747
  name: string;
747
748
  url: string;
748
749
  provider: string;
749
- events: string[];
750
+ events: WebhookEventType[];
750
751
  isActive: boolean;
751
752
  secret?: string;
752
753
  organizationId?: number;
@@ -757,7 +758,7 @@ interface CreateWebhookRequest {
757
758
  name: string;
758
759
  url: string;
759
760
  provider: string;
760
- events: string[];
761
+ events: WebhookEventType[];
761
762
  isActive?: boolean;
762
763
  secret?: string;
763
764
  }
@@ -1041,6 +1042,7 @@ interface BundleCollection {
1041
1042
  description?: string;
1042
1043
  available_from?: string;
1043
1044
  available_until?: string;
1045
+ custom?: Record<string, any> | string | null;
1044
1046
  published: number;
1045
1047
  created_at: string;
1046
1048
  updated_at: string;
@@ -1050,6 +1052,7 @@ interface CreateBundleCollectionRequest {
1050
1052
  description?: string;
1051
1053
  available_from?: string;
1052
1054
  available_until?: string;
1055
+ custom?: Record<string, any> | null;
1053
1056
  published?: number;
1054
1057
  }
1055
1058
  interface BundleCollectionItem {
@@ -1284,6 +1287,10 @@ interface V2Product extends V2Object {
1284
1287
  } | null;
1285
1288
  tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
1286
1289
  category_id: string | null;
1290
+ gateway_product_id_test: string | null;
1291
+ gateway_product_id_live: string | null;
1292
+ gateway_price_id_test: string | null;
1293
+ gateway_price_id_live: string | null;
1287
1294
  media: V2Media[];
1288
1295
  created_at: string | null;
1289
1296
  updated_at: string | null;
@@ -1345,6 +1352,7 @@ interface V2Collection extends V2Object {
1345
1352
  description: string | null;
1346
1353
  available_from: string | null;
1347
1354
  available_until: string | null;
1355
+ custom: Record<string, unknown> | null;
1348
1356
  published: boolean;
1349
1357
  created_at: string | null;
1350
1358
  updated_at: string | null;
@@ -1361,6 +1369,7 @@ interface V2CollectionCreateParams {
1361
1369
  description?: string | null;
1362
1370
  available_from?: string | null;
1363
1371
  available_until?: string | null;
1372
+ custom?: Record<string, unknown> | null;
1364
1373
  published?: boolean;
1365
1374
  }
1366
1375
  interface V2CollectionUpdateParams extends Partial<V2CollectionCreateParams> {
@@ -1693,11 +1702,12 @@ interface V2ApiKey extends V2Object {
1693
1702
  created_at: string | null;
1694
1703
  updated_at: string | null;
1695
1704
  }
1705
+ type V2WebhookEventType = "content.created" | "content.updated" | "content.published" | "content.unpublished" | "content.deleted" | "newsletter.created" | "newsletter.updated" | "newsletter.published" | "newsletter.sent" | "newsletter.deleted" | "product.created" | "product.updated" | "product.deleted" | "product.stock_changed" | "order.paid" | "category.created" | "category.updated" | "category.deleted" | "site.updated" | "site.settings_changed" | "ab.flag_started" | "ab.flag_paused" | "ab.flag_resumed" | "ab.flag_stopped" | "ab.flag_updated" | "ab.config_warmup" | (string & Record<never, never>);
1696
1706
  interface V2Webhook extends V2Object {
1697
1707
  object: "webhook";
1698
1708
  url: string;
1699
1709
  description: string | null;
1700
- events: string[] | null;
1710
+ events: V2WebhookEventType[] | null;
1701
1711
  is_active: boolean;
1702
1712
  created_at: string | null;
1703
1713
  updated_at: string | null;
@@ -1705,7 +1715,7 @@ interface V2Webhook extends V2Object {
1705
1715
  interface V2WebhookCreateParams {
1706
1716
  url: string;
1707
1717
  description?: string;
1708
- events?: string[];
1718
+ events?: V2WebhookEventType[];
1709
1719
  is_active?: boolean;
1710
1720
  }
1711
1721
  interface V2WebhookUpdateParams extends Partial<V2WebhookCreateParams> {
@@ -1890,6 +1900,7 @@ declare class CategoriesV2Client extends BaseV2Client {
1890
1900
 
1891
1901
  declare class CollectionsV2Client extends BaseV2Client {
1892
1902
  list(siteName: string, params?: V2PaginationParams): Promise<V2List<V2Collection>>;
1903
+ listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>): AsyncGenerator<V2Collection, void, unknown>;
1893
1904
  getCurrent(siteName: string): Promise<V2Collection | null>;
1894
1905
  get(siteName: string, id: string): Promise<V2Collection>;
1895
1906
  create(siteName: string, data: V2CollectionCreateParams): Promise<V2Collection>;
@@ -4525,4 +4536,4 @@ declare function createCheckoutSession(options: CheckoutSessionOptions): Promise
4525
4536
  error: string;
4526
4537
  }>;
4527
4538
 
4528
- export { type AbClient, type AbForRequestResult, type AbVariantResult, type AddCollectionItemRequest, type ApiError, type ApiKey, ApiKeysClient, type ApiResponse, AuthClient, BaseClient, type BlogPost, type BundleCollection, type BundleCollectionItem, type BundleCollectionItemWithProduct, BundlesClient, type CacheAdapter, type CacheConfig, CacheManager, type CancelSubscriptionRequest, type CancelSubscriptionResponse, CategoriesClient, type Category, type CategorySummary, type CheckoutAddress, CheckoutClient, type CheckoutMetadata, type CheckoutMetadataValue, type CheckoutSession, type CheckoutSessionOptions, type CheckoutSessionTax, type CheckoutTaxBreakdownItem, type CheckoutTaxCustomerExemptionRequest, type CheckoutTaxExemptionStatus, type CheckoutTaxRequest, type CheckoutTaxStrategy, CloudflareKVCacheAdapter, ContactClient, type ContactStatusResponse, type ContactSubmission, type ContactSubmitResponse, type Content, type ContentCategoryResponse, ContentClient, type ContentQueryParams, type ContentStatus, type ContentType, type CreateApiKeyRequest, type CreateBundleCollectionRequest, type CreateBundleGroupRequest, type CreateCategoryRequest, type CreateCheckoutSessionRequest, type CreateContactRequest, type CreateContentRequest, type CreateNewsletterSubscriptionRequest, type CreateOrganizationRequest, type CreatePaymentGatewayRequest, type CreatePerspectAbOptions, type CreateProductRequest, type CreateProductSkuRequest, type CreateSiteRequest, type CreateWebhookRequest, type CreditBalance, type CreditBalanceWithTransactions, type CreditTransaction, DEFAULT_IMAGE_SIZES, type GrantCreditRequest, HttpClient, type HttpMethod, type ImageTransformOptions, InMemoryCacheAdapter, type LoadBlockBySlugOptions, type LoadContentBySlugOptions, type LoadContentOptions, type LoadProductBySlugOptions, type LoadProductsOptions, type LoaderLogger, type LoaderOptions, type MediaItem, type NewsletterCampaignDetail, type NewsletterCampaignListResponse, type NewsletterCampaignSummary, type NewsletterCampaignTestSendRequest, type NewsletterCampaignTestSendResponse, NewsletterClient, type NewsletterConfirmResponse, type NewsletterExportCreateRequest, type NewsletterExportCreateResponse, type NewsletterList, type NewsletterManagementCampaign, type NewsletterManagementCampaignListResponse, NewsletterManagementClient, type NewsletterManagementList, type NewsletterManagementListMembership, type NewsletterManagementPagination, type NewsletterManagementSeries, type NewsletterManagementStatsResponse, type NewsletterManagementSubscription, type NewsletterManagementSubscriptionsListResponse, type NewsletterPreferences, type NewsletterStatusResponse, type NewsletterSubscribeResponse, type NewsletterSubscription, type NewsletterSubscriptionImportRowRequest, type NewsletterSubscriptionMembershipUpdateRequest, type NewsletterSubscriptionSyncRequest, type NewsletterSubscriptionSyncResponse, type NewsletterSubscriptionsBulkAction, type NewsletterSubscriptionsBulkOutcome, type NewsletterSubscriptionsBulkUpdateRequest, type NewsletterSubscriptionsBulkUpdateResponse, type NewsletterSubscriptionsImportRequest, type NewsletterSubscriptionsImportResponse, type NewsletterSubscriptionsImportRowResult, type NewsletterUnsubscribeRequest, type NewsletterUnsubscribeResponse, NoopCacheAdapter, type Organization, OrganizationsClient, type PaginatedResponse, type PaginationParams, type PaymentGateway, type PerspectAb, PerspectApiClient, type PerspectApiConfig, PerspectApiError, PerspectApiV2Client, PerspectV2Error, type Product, type ProductBundleGroup, type ProductQueryParams, type ProductSku, type ProductSkuMediaItem, type ProductSkuOption, ProductsClient, type RequestOptions, type RequestOtpRequest, type ResponsiveImageSizes, type SetProfileValueRequest, type Site, type SiteUser, type SiteUserOrder, type SiteUserProfile, type SiteUserSubscription, SiteUsersClient, SitesClient, type SubscriptionCancellationMode, type UpdateApiKeyRequest, type UpdateContentRequest, type UpdateSiteUserRequest, type User, V1_DEPRECATION_NOTICE, V1_SUNSET_DATE, type V2ApiKey, type V2CancelSubscriptionResult, type V2Category, type V2CategoryCreateParams, type V2CategoryUpdateParams, type V2Collection, type V2CollectionCreateParams, type V2CollectionItem, type V2CollectionUpdateParams, type V2ContactSubmission, type V2Content, type V2ContentCreateParams, type V2ContentListParams, type V2ContentUpdateParams, type V2CreditBalance, type V2CreditTransaction, type V2Deleted, type V2Error, type V2ErrorType, type V2GrantCreditParams, type V2GrantCreditResult, type V2List, type V2Media, type V2NewsletterCampaign, type V2NewsletterImportRequest, type V2NewsletterImportResult, type V2NewsletterList, type V2NewsletterListCreateParams, type V2NewsletterListUpdateParams, type V2NewsletterSubscription, type V2NewsletterSubscriptionListMembershipUpdate, type V2NewsletterSyncInput, type V2NewsletterSyncResult, type V2NewsletterTrackingResponse, type V2Object, type V2Order, type V2OrderAddress, type V2OrderCreateParams, type V2OrderCreateResult, type V2OrderFulfillmentUpdate, type V2OrderLineItem, type V2OrderLineItemPriceData, type V2OrderListParams, type V2OrderTaxRequest, type V2Organization, type V2PaginationParams, type V2Product, type V2ProductCreateParams, type V2ProductListParams, type V2ProductUpdateParams, type V2Site, type V2SiteUser, type V2SiteUserListParams, type V2SiteUserMeUpdateParams, type V2SiteUserProfile, type V2SiteUserSubscription, type V2SiteUserUpdateParams, type V2SiteUserWithProfile, type V2SubscriptionCancelParams, type V2SubscriptionChangePlanParams, type V2SubscriptionPauseParams, type V2Webhook, type V2WebhookCreateParams, type V2WebhookUpdateParams, type VerifyOtpRequest, type VerifyOtpResponse, type Webhook, WebhooksClient, bucketFor, buildImageUrl, createApiError, createCheckoutSession, createPerspectAb, createPerspectApiClient, createPerspectApiV2Client, PerspectApiClient as default, generateResponsiveImageHtml, generateResponsiveUrls, generateSizesAttribute, generateSrcSet, loadAllContent, loadBlockBySlug, loadBlocks, loadContentBySlug, loadPages, loadPosts, loadProductBySlug, loadProducts, transformContent, transformMediaItem, transformProduct, variantForBucket };
4539
+ export { type AbClient, type AbForRequestResult, type AbVariantResult, type AddCollectionItemRequest, type ApiError, type ApiKey, ApiKeysClient, type ApiResponse, AuthClient, BaseClient, type BlogPost, type BundleCollection, type BundleCollectionItem, type BundleCollectionItemWithProduct, BundlesClient, type CacheAdapter, type CacheConfig, CacheManager, type CancelSubscriptionRequest, type CancelSubscriptionResponse, CategoriesClient, type Category, type CategorySummary, type CheckoutAddress, CheckoutClient, type CheckoutMetadata, type CheckoutMetadataValue, type CheckoutSession, type CheckoutSessionOptions, type CheckoutSessionTax, type CheckoutTaxBreakdownItem, type CheckoutTaxCustomerExemptionRequest, type CheckoutTaxExemptionStatus, type CheckoutTaxRequest, type CheckoutTaxStrategy, CloudflareKVCacheAdapter, ContactClient, type ContactStatusResponse, type ContactSubmission, type ContactSubmitResponse, type Content, type ContentCategoryResponse, ContentClient, type ContentQueryParams, type ContentStatus, type ContentType, type CreateApiKeyRequest, type CreateBundleCollectionRequest, type CreateBundleGroupRequest, type CreateCategoryRequest, type CreateCheckoutSessionRequest, type CreateContactRequest, type CreateContentRequest, type CreateNewsletterSubscriptionRequest, type CreateOrganizationRequest, type CreatePaymentGatewayRequest, type CreatePerspectAbOptions, type CreateProductRequest, type CreateProductSkuRequest, type CreateSiteRequest, type CreateWebhookRequest, type CreditBalance, type CreditBalanceWithTransactions, type CreditTransaction, DEFAULT_IMAGE_SIZES, type GrantCreditRequest, HttpClient, type HttpMethod, type ImageTransformOptions, InMemoryCacheAdapter, type LoadBlockBySlugOptions, type LoadContentBySlugOptions, type LoadContentOptions, type LoadProductBySlugOptions, type LoadProductsOptions, type LoaderLogger, type LoaderOptions, type MediaItem, type NewsletterCampaignDetail, type NewsletterCampaignListResponse, type NewsletterCampaignSummary, type NewsletterCampaignTestSendRequest, type NewsletterCampaignTestSendResponse, NewsletterClient, type NewsletterConfirmResponse, type NewsletterExportCreateRequest, type NewsletterExportCreateResponse, type NewsletterList, type NewsletterManagementCampaign, type NewsletterManagementCampaignListResponse, NewsletterManagementClient, type NewsletterManagementList, type NewsletterManagementListMembership, type NewsletterManagementPagination, type NewsletterManagementSeries, type NewsletterManagementStatsResponse, type NewsletterManagementSubscription, type NewsletterManagementSubscriptionsListResponse, type NewsletterPreferences, type NewsletterStatusResponse, type NewsletterSubscribeResponse, type NewsletterSubscription, type NewsletterSubscriptionImportRowRequest, type NewsletterSubscriptionMembershipUpdateRequest, type NewsletterSubscriptionSyncRequest, type NewsletterSubscriptionSyncResponse, type NewsletterSubscriptionsBulkAction, type NewsletterSubscriptionsBulkOutcome, type NewsletterSubscriptionsBulkUpdateRequest, type NewsletterSubscriptionsBulkUpdateResponse, type NewsletterSubscriptionsImportRequest, type NewsletterSubscriptionsImportResponse, type NewsletterSubscriptionsImportRowResult, type NewsletterUnsubscribeRequest, type NewsletterUnsubscribeResponse, NoopCacheAdapter, type Organization, OrganizationsClient, type PaginatedResponse, type PaginationParams, type PaymentGateway, type PerspectAb, PerspectApiClient, type PerspectApiConfig, PerspectApiError, PerspectApiV2Client, PerspectV2Error, type Product, type ProductBundleGroup, type ProductQueryParams, type ProductSku, type ProductSkuMediaItem, type ProductSkuOption, ProductsClient, type RequestOptions, type RequestOtpRequest, type ResponsiveImageSizes, type SetProfileValueRequest, type Site, type SiteUser, type SiteUserOrder, type SiteUserProfile, type SiteUserSubscription, SiteUsersClient, SitesClient, type SubscriptionCancellationMode, type UpdateApiKeyRequest, type UpdateContentRequest, type UpdateSiteUserRequest, type User, V1_DEPRECATION_NOTICE, V1_SUNSET_DATE, type V2ApiKey, type V2CancelSubscriptionResult, type V2Category, type V2CategoryCreateParams, type V2CategoryUpdateParams, type V2Collection, type V2CollectionCreateParams, type V2CollectionItem, type V2CollectionUpdateParams, type V2ContactSubmission, type V2Content, type V2ContentCreateParams, type V2ContentListParams, type V2ContentUpdateParams, type V2CreditBalance, type V2CreditTransaction, type V2Deleted, type V2Error, type V2ErrorType, type V2GrantCreditParams, type V2GrantCreditResult, type V2List, type V2Media, type V2NewsletterCampaign, type V2NewsletterImportRequest, type V2NewsletterImportResult, type V2NewsletterList, type V2NewsletterListCreateParams, type V2NewsletterListUpdateParams, type V2NewsletterSubscription, type V2NewsletterSubscriptionListMembershipUpdate, type V2NewsletterSyncInput, type V2NewsletterSyncResult, type V2NewsletterTrackingResponse, type V2Object, type V2Order, type V2OrderAddress, type V2OrderCreateParams, type V2OrderCreateResult, type V2OrderFulfillmentUpdate, type V2OrderLineItem, type V2OrderLineItemPriceData, type V2OrderListParams, type V2OrderTaxRequest, type V2Organization, type V2PaginationParams, type V2Product, type V2ProductCreateParams, type V2ProductListParams, type V2ProductUpdateParams, type V2Site, type V2SiteUser, type V2SiteUserListParams, type V2SiteUserMeUpdateParams, type V2SiteUserProfile, type V2SiteUserSubscription, type V2SiteUserUpdateParams, type V2SiteUserWithProfile, type V2SubscriptionCancelParams, type V2SubscriptionChangePlanParams, type V2SubscriptionPauseParams, type V2Webhook, type V2WebhookCreateParams, type V2WebhookEventType, type V2WebhookUpdateParams, type VerifyOtpRequest, type VerifyOtpResponse, type Webhook, type WebhookEventType, WebhooksClient, bucketFor, buildImageUrl, createApiError, createCheckoutSession, createPerspectAb, createPerspectApiClient, createPerspectApiV2Client, PerspectApiClient as default, generateResponsiveImageHtml, generateResponsiveUrls, generateSizesAttribute, generateSrcSet, loadAllContent, loadBlockBySlug, loadBlocks, loadContentBySlug, loadPages, loadPosts, loadProductBySlug, loadProducts, transformContent, transformMediaItem, transformProduct, variantForBucket };
package/dist/index.d.ts CHANGED
@@ -741,12 +741,13 @@ interface CreatePaymentGatewayRequest {
741
741
  configuration: Record<string, any>;
742
742
  isActive?: boolean;
743
743
  }
744
+ type WebhookEventType = "content.created" | "content.updated" | "content.published" | "content.unpublished" | "content.deleted" | "newsletter.created" | "newsletter.updated" | "newsletter.published" | "newsletter.sent" | "newsletter.deleted" | "product.created" | "product.updated" | "product.deleted" | "product.stock_changed" | "order.paid" | "category.created" | "category.updated" | "category.deleted" | "site.updated" | "site.settings_changed" | "ab.flag_started" | "ab.flag_paused" | "ab.flag_resumed" | "ab.flag_stopped" | "ab.flag_updated" | "ab.config_warmup" | (string & Record<never, never>);
744
745
  interface Webhook {
745
746
  id: string;
746
747
  name: string;
747
748
  url: string;
748
749
  provider: string;
749
- events: string[];
750
+ events: WebhookEventType[];
750
751
  isActive: boolean;
751
752
  secret?: string;
752
753
  organizationId?: number;
@@ -757,7 +758,7 @@ interface CreateWebhookRequest {
757
758
  name: string;
758
759
  url: string;
759
760
  provider: string;
760
- events: string[];
761
+ events: WebhookEventType[];
761
762
  isActive?: boolean;
762
763
  secret?: string;
763
764
  }
@@ -1041,6 +1042,7 @@ interface BundleCollection {
1041
1042
  description?: string;
1042
1043
  available_from?: string;
1043
1044
  available_until?: string;
1045
+ custom?: Record<string, any> | string | null;
1044
1046
  published: number;
1045
1047
  created_at: string;
1046
1048
  updated_at: string;
@@ -1050,6 +1052,7 @@ interface CreateBundleCollectionRequest {
1050
1052
  description?: string;
1051
1053
  available_from?: string;
1052
1054
  available_until?: string;
1055
+ custom?: Record<string, any> | null;
1053
1056
  published?: number;
1054
1057
  }
1055
1058
  interface BundleCollectionItem {
@@ -1284,6 +1287,10 @@ interface V2Product extends V2Object {
1284
1287
  } | null;
1285
1288
  tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
1286
1289
  category_id: string | null;
1290
+ gateway_product_id_test: string | null;
1291
+ gateway_product_id_live: string | null;
1292
+ gateway_price_id_test: string | null;
1293
+ gateway_price_id_live: string | null;
1287
1294
  media: V2Media[];
1288
1295
  created_at: string | null;
1289
1296
  updated_at: string | null;
@@ -1345,6 +1352,7 @@ interface V2Collection extends V2Object {
1345
1352
  description: string | null;
1346
1353
  available_from: string | null;
1347
1354
  available_until: string | null;
1355
+ custom: Record<string, unknown> | null;
1348
1356
  published: boolean;
1349
1357
  created_at: string | null;
1350
1358
  updated_at: string | null;
@@ -1361,6 +1369,7 @@ interface V2CollectionCreateParams {
1361
1369
  description?: string | null;
1362
1370
  available_from?: string | null;
1363
1371
  available_until?: string | null;
1372
+ custom?: Record<string, unknown> | null;
1364
1373
  published?: boolean;
1365
1374
  }
1366
1375
  interface V2CollectionUpdateParams extends Partial<V2CollectionCreateParams> {
@@ -1693,11 +1702,12 @@ interface V2ApiKey extends V2Object {
1693
1702
  created_at: string | null;
1694
1703
  updated_at: string | null;
1695
1704
  }
1705
+ type V2WebhookEventType = "content.created" | "content.updated" | "content.published" | "content.unpublished" | "content.deleted" | "newsletter.created" | "newsletter.updated" | "newsletter.published" | "newsletter.sent" | "newsletter.deleted" | "product.created" | "product.updated" | "product.deleted" | "product.stock_changed" | "order.paid" | "category.created" | "category.updated" | "category.deleted" | "site.updated" | "site.settings_changed" | "ab.flag_started" | "ab.flag_paused" | "ab.flag_resumed" | "ab.flag_stopped" | "ab.flag_updated" | "ab.config_warmup" | (string & Record<never, never>);
1696
1706
  interface V2Webhook extends V2Object {
1697
1707
  object: "webhook";
1698
1708
  url: string;
1699
1709
  description: string | null;
1700
- events: string[] | null;
1710
+ events: V2WebhookEventType[] | null;
1701
1711
  is_active: boolean;
1702
1712
  created_at: string | null;
1703
1713
  updated_at: string | null;
@@ -1705,7 +1715,7 @@ interface V2Webhook extends V2Object {
1705
1715
  interface V2WebhookCreateParams {
1706
1716
  url: string;
1707
1717
  description?: string;
1708
- events?: string[];
1718
+ events?: V2WebhookEventType[];
1709
1719
  is_active?: boolean;
1710
1720
  }
1711
1721
  interface V2WebhookUpdateParams extends Partial<V2WebhookCreateParams> {
@@ -1890,6 +1900,7 @@ declare class CategoriesV2Client extends BaseV2Client {
1890
1900
 
1891
1901
  declare class CollectionsV2Client extends BaseV2Client {
1892
1902
  list(siteName: string, params?: V2PaginationParams): Promise<V2List<V2Collection>>;
1903
+ listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>): AsyncGenerator<V2Collection, void, unknown>;
1893
1904
  getCurrent(siteName: string): Promise<V2Collection | null>;
1894
1905
  get(siteName: string, id: string): Promise<V2Collection>;
1895
1906
  create(siteName: string, data: V2CollectionCreateParams): Promise<V2Collection>;
@@ -4525,4 +4536,4 @@ declare function createCheckoutSession(options: CheckoutSessionOptions): Promise
4525
4536
  error: string;
4526
4537
  }>;
4527
4538
 
4528
- export { type AbClient, type AbForRequestResult, type AbVariantResult, type AddCollectionItemRequest, type ApiError, type ApiKey, ApiKeysClient, type ApiResponse, AuthClient, BaseClient, type BlogPost, type BundleCollection, type BundleCollectionItem, type BundleCollectionItemWithProduct, BundlesClient, type CacheAdapter, type CacheConfig, CacheManager, type CancelSubscriptionRequest, type CancelSubscriptionResponse, CategoriesClient, type Category, type CategorySummary, type CheckoutAddress, CheckoutClient, type CheckoutMetadata, type CheckoutMetadataValue, type CheckoutSession, type CheckoutSessionOptions, type CheckoutSessionTax, type CheckoutTaxBreakdownItem, type CheckoutTaxCustomerExemptionRequest, type CheckoutTaxExemptionStatus, type CheckoutTaxRequest, type CheckoutTaxStrategy, CloudflareKVCacheAdapter, ContactClient, type ContactStatusResponse, type ContactSubmission, type ContactSubmitResponse, type Content, type ContentCategoryResponse, ContentClient, type ContentQueryParams, type ContentStatus, type ContentType, type CreateApiKeyRequest, type CreateBundleCollectionRequest, type CreateBundleGroupRequest, type CreateCategoryRequest, type CreateCheckoutSessionRequest, type CreateContactRequest, type CreateContentRequest, type CreateNewsletterSubscriptionRequest, type CreateOrganizationRequest, type CreatePaymentGatewayRequest, type CreatePerspectAbOptions, type CreateProductRequest, type CreateProductSkuRequest, type CreateSiteRequest, type CreateWebhookRequest, type CreditBalance, type CreditBalanceWithTransactions, type CreditTransaction, DEFAULT_IMAGE_SIZES, type GrantCreditRequest, HttpClient, type HttpMethod, type ImageTransformOptions, InMemoryCacheAdapter, type LoadBlockBySlugOptions, type LoadContentBySlugOptions, type LoadContentOptions, type LoadProductBySlugOptions, type LoadProductsOptions, type LoaderLogger, type LoaderOptions, type MediaItem, type NewsletterCampaignDetail, type NewsletterCampaignListResponse, type NewsletterCampaignSummary, type NewsletterCampaignTestSendRequest, type NewsletterCampaignTestSendResponse, NewsletterClient, type NewsletterConfirmResponse, type NewsletterExportCreateRequest, type NewsletterExportCreateResponse, type NewsletterList, type NewsletterManagementCampaign, type NewsletterManagementCampaignListResponse, NewsletterManagementClient, type NewsletterManagementList, type NewsletterManagementListMembership, type NewsletterManagementPagination, type NewsletterManagementSeries, type NewsletterManagementStatsResponse, type NewsletterManagementSubscription, type NewsletterManagementSubscriptionsListResponse, type NewsletterPreferences, type NewsletterStatusResponse, type NewsletterSubscribeResponse, type NewsletterSubscription, type NewsletterSubscriptionImportRowRequest, type NewsletterSubscriptionMembershipUpdateRequest, type NewsletterSubscriptionSyncRequest, type NewsletterSubscriptionSyncResponse, type NewsletterSubscriptionsBulkAction, type NewsletterSubscriptionsBulkOutcome, type NewsletterSubscriptionsBulkUpdateRequest, type NewsletterSubscriptionsBulkUpdateResponse, type NewsletterSubscriptionsImportRequest, type NewsletterSubscriptionsImportResponse, type NewsletterSubscriptionsImportRowResult, type NewsletterUnsubscribeRequest, type NewsletterUnsubscribeResponse, NoopCacheAdapter, type Organization, OrganizationsClient, type PaginatedResponse, type PaginationParams, type PaymentGateway, type PerspectAb, PerspectApiClient, type PerspectApiConfig, PerspectApiError, PerspectApiV2Client, PerspectV2Error, type Product, type ProductBundleGroup, type ProductQueryParams, type ProductSku, type ProductSkuMediaItem, type ProductSkuOption, ProductsClient, type RequestOptions, type RequestOtpRequest, type ResponsiveImageSizes, type SetProfileValueRequest, type Site, type SiteUser, type SiteUserOrder, type SiteUserProfile, type SiteUserSubscription, SiteUsersClient, SitesClient, type SubscriptionCancellationMode, type UpdateApiKeyRequest, type UpdateContentRequest, type UpdateSiteUserRequest, type User, V1_DEPRECATION_NOTICE, V1_SUNSET_DATE, type V2ApiKey, type V2CancelSubscriptionResult, type V2Category, type V2CategoryCreateParams, type V2CategoryUpdateParams, type V2Collection, type V2CollectionCreateParams, type V2CollectionItem, type V2CollectionUpdateParams, type V2ContactSubmission, type V2Content, type V2ContentCreateParams, type V2ContentListParams, type V2ContentUpdateParams, type V2CreditBalance, type V2CreditTransaction, type V2Deleted, type V2Error, type V2ErrorType, type V2GrantCreditParams, type V2GrantCreditResult, type V2List, type V2Media, type V2NewsletterCampaign, type V2NewsletterImportRequest, type V2NewsletterImportResult, type V2NewsletterList, type V2NewsletterListCreateParams, type V2NewsletterListUpdateParams, type V2NewsletterSubscription, type V2NewsletterSubscriptionListMembershipUpdate, type V2NewsletterSyncInput, type V2NewsletterSyncResult, type V2NewsletterTrackingResponse, type V2Object, type V2Order, type V2OrderAddress, type V2OrderCreateParams, type V2OrderCreateResult, type V2OrderFulfillmentUpdate, type V2OrderLineItem, type V2OrderLineItemPriceData, type V2OrderListParams, type V2OrderTaxRequest, type V2Organization, type V2PaginationParams, type V2Product, type V2ProductCreateParams, type V2ProductListParams, type V2ProductUpdateParams, type V2Site, type V2SiteUser, type V2SiteUserListParams, type V2SiteUserMeUpdateParams, type V2SiteUserProfile, type V2SiteUserSubscription, type V2SiteUserUpdateParams, type V2SiteUserWithProfile, type V2SubscriptionCancelParams, type V2SubscriptionChangePlanParams, type V2SubscriptionPauseParams, type V2Webhook, type V2WebhookCreateParams, type V2WebhookUpdateParams, type VerifyOtpRequest, type VerifyOtpResponse, type Webhook, WebhooksClient, bucketFor, buildImageUrl, createApiError, createCheckoutSession, createPerspectAb, createPerspectApiClient, createPerspectApiV2Client, PerspectApiClient as default, generateResponsiveImageHtml, generateResponsiveUrls, generateSizesAttribute, generateSrcSet, loadAllContent, loadBlockBySlug, loadBlocks, loadContentBySlug, loadPages, loadPosts, loadProductBySlug, loadProducts, transformContent, transformMediaItem, transformProduct, variantForBucket };
4539
+ export { type AbClient, type AbForRequestResult, type AbVariantResult, type AddCollectionItemRequest, type ApiError, type ApiKey, ApiKeysClient, type ApiResponse, AuthClient, BaseClient, type BlogPost, type BundleCollection, type BundleCollectionItem, type BundleCollectionItemWithProduct, BundlesClient, type CacheAdapter, type CacheConfig, CacheManager, type CancelSubscriptionRequest, type CancelSubscriptionResponse, CategoriesClient, type Category, type CategorySummary, type CheckoutAddress, CheckoutClient, type CheckoutMetadata, type CheckoutMetadataValue, type CheckoutSession, type CheckoutSessionOptions, type CheckoutSessionTax, type CheckoutTaxBreakdownItem, type CheckoutTaxCustomerExemptionRequest, type CheckoutTaxExemptionStatus, type CheckoutTaxRequest, type CheckoutTaxStrategy, CloudflareKVCacheAdapter, ContactClient, type ContactStatusResponse, type ContactSubmission, type ContactSubmitResponse, type Content, type ContentCategoryResponse, ContentClient, type ContentQueryParams, type ContentStatus, type ContentType, type CreateApiKeyRequest, type CreateBundleCollectionRequest, type CreateBundleGroupRequest, type CreateCategoryRequest, type CreateCheckoutSessionRequest, type CreateContactRequest, type CreateContentRequest, type CreateNewsletterSubscriptionRequest, type CreateOrganizationRequest, type CreatePaymentGatewayRequest, type CreatePerspectAbOptions, type CreateProductRequest, type CreateProductSkuRequest, type CreateSiteRequest, type CreateWebhookRequest, type CreditBalance, type CreditBalanceWithTransactions, type CreditTransaction, DEFAULT_IMAGE_SIZES, type GrantCreditRequest, HttpClient, type HttpMethod, type ImageTransformOptions, InMemoryCacheAdapter, type LoadBlockBySlugOptions, type LoadContentBySlugOptions, type LoadContentOptions, type LoadProductBySlugOptions, type LoadProductsOptions, type LoaderLogger, type LoaderOptions, type MediaItem, type NewsletterCampaignDetail, type NewsletterCampaignListResponse, type NewsletterCampaignSummary, type NewsletterCampaignTestSendRequest, type NewsletterCampaignTestSendResponse, NewsletterClient, type NewsletterConfirmResponse, type NewsletterExportCreateRequest, type NewsletterExportCreateResponse, type NewsletterList, type NewsletterManagementCampaign, type NewsletterManagementCampaignListResponse, NewsletterManagementClient, type NewsletterManagementList, type NewsletterManagementListMembership, type NewsletterManagementPagination, type NewsletterManagementSeries, type NewsletterManagementStatsResponse, type NewsletterManagementSubscription, type NewsletterManagementSubscriptionsListResponse, type NewsletterPreferences, type NewsletterStatusResponse, type NewsletterSubscribeResponse, type NewsletterSubscription, type NewsletterSubscriptionImportRowRequest, type NewsletterSubscriptionMembershipUpdateRequest, type NewsletterSubscriptionSyncRequest, type NewsletterSubscriptionSyncResponse, type NewsletterSubscriptionsBulkAction, type NewsletterSubscriptionsBulkOutcome, type NewsletterSubscriptionsBulkUpdateRequest, type NewsletterSubscriptionsBulkUpdateResponse, type NewsletterSubscriptionsImportRequest, type NewsletterSubscriptionsImportResponse, type NewsletterSubscriptionsImportRowResult, type NewsletterUnsubscribeRequest, type NewsletterUnsubscribeResponse, NoopCacheAdapter, type Organization, OrganizationsClient, type PaginatedResponse, type PaginationParams, type PaymentGateway, type PerspectAb, PerspectApiClient, type PerspectApiConfig, PerspectApiError, PerspectApiV2Client, PerspectV2Error, type Product, type ProductBundleGroup, type ProductQueryParams, type ProductSku, type ProductSkuMediaItem, type ProductSkuOption, ProductsClient, type RequestOptions, type RequestOtpRequest, type ResponsiveImageSizes, type SetProfileValueRequest, type Site, type SiteUser, type SiteUserOrder, type SiteUserProfile, type SiteUserSubscription, SiteUsersClient, SitesClient, type SubscriptionCancellationMode, type UpdateApiKeyRequest, type UpdateContentRequest, type UpdateSiteUserRequest, type User, V1_DEPRECATION_NOTICE, V1_SUNSET_DATE, type V2ApiKey, type V2CancelSubscriptionResult, type V2Category, type V2CategoryCreateParams, type V2CategoryUpdateParams, type V2Collection, type V2CollectionCreateParams, type V2CollectionItem, type V2CollectionUpdateParams, type V2ContactSubmission, type V2Content, type V2ContentCreateParams, type V2ContentListParams, type V2ContentUpdateParams, type V2CreditBalance, type V2CreditTransaction, type V2Deleted, type V2Error, type V2ErrorType, type V2GrantCreditParams, type V2GrantCreditResult, type V2List, type V2Media, type V2NewsletterCampaign, type V2NewsletterImportRequest, type V2NewsletterImportResult, type V2NewsletterList, type V2NewsletterListCreateParams, type V2NewsletterListUpdateParams, type V2NewsletterSubscription, type V2NewsletterSubscriptionListMembershipUpdate, type V2NewsletterSyncInput, type V2NewsletterSyncResult, type V2NewsletterTrackingResponse, type V2Object, type V2Order, type V2OrderAddress, type V2OrderCreateParams, type V2OrderCreateResult, type V2OrderFulfillmentUpdate, type V2OrderLineItem, type V2OrderLineItemPriceData, type V2OrderListParams, type V2OrderTaxRequest, type V2Organization, type V2PaginationParams, type V2Product, type V2ProductCreateParams, type V2ProductListParams, type V2ProductUpdateParams, type V2Site, type V2SiteUser, type V2SiteUserListParams, type V2SiteUserMeUpdateParams, type V2SiteUserProfile, type V2SiteUserSubscription, type V2SiteUserUpdateParams, type V2SiteUserWithProfile, type V2SubscriptionCancelParams, type V2SubscriptionChangePlanParams, type V2SubscriptionPauseParams, type V2Webhook, type V2WebhookCreateParams, type V2WebhookEventType, type V2WebhookUpdateParams, type VerifyOtpRequest, type VerifyOtpResponse, type Webhook, type WebhookEventType, WebhooksClient, bucketFor, buildImageUrl, createApiError, createCheckoutSession, createPerspectAb, createPerspectApiClient, createPerspectApiV2Client, PerspectApiClient as default, generateResponsiveImageHtml, generateResponsiveUrls, generateSizesAttribute, generateSrcSet, loadAllContent, loadBlockBySlug, loadBlocks, loadContentBySlug, loadPages, loadPosts, loadProductBySlug, loadProducts, transformContent, transformMediaItem, transformProduct, variantForBucket };
package/dist/index.js CHANGED
@@ -907,6 +907,9 @@ var CollectionsV2Client = class extends BaseV2Client {
907
907
  tags: [`collections:${siteName}`]
908
908
  });
909
909
  }
910
+ async *listAutoPaginated(siteName, params) {
911
+ yield* this.listAutoPaginate(this.sitePath(siteName, "collections"), params);
912
+ }
910
913
  async getCurrent(siteName) {
911
914
  const result = await this.getOne(
912
915
  this.sitePath(siteName, "collections", "current")
package/dist/index.mjs CHANGED
@@ -831,6 +831,9 @@ var CollectionsV2Client = class extends BaseV2Client {
831
831
  tags: [`collections:${siteName}`]
832
832
  });
833
833
  }
834
+ async *listAutoPaginated(siteName, params) {
835
+ yield* this.listAutoPaginate(this.sitePath(siteName, "collections"), params);
836
+ }
834
837
  async getCurrent(siteName) {
835
838
  const result = await this.getOne(
836
839
  this.sitePath(siteName, "collections", "current")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perspectapi-ts-sdk",
3
- "version": "6.5.3",
3
+ "version": "6.5.6",
4
4
  "description": "TypeScript SDK for PerspectAPI - Cloudflare Workers compatible",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -732,12 +732,41 @@ export interface CreatePaymentGatewayRequest {
732
732
  }
733
733
 
734
734
  // Webhooks
735
+ export type WebhookEventType =
736
+ | "content.created"
737
+ | "content.updated"
738
+ | "content.published"
739
+ | "content.unpublished"
740
+ | "content.deleted"
741
+ | "newsletter.created"
742
+ | "newsletter.updated"
743
+ | "newsletter.published"
744
+ | "newsletter.sent"
745
+ | "newsletter.deleted"
746
+ | "product.created"
747
+ | "product.updated"
748
+ | "product.deleted"
749
+ | "product.stock_changed"
750
+ | "order.paid"
751
+ | "category.created"
752
+ | "category.updated"
753
+ | "category.deleted"
754
+ | "site.updated"
755
+ | "site.settings_changed"
756
+ | "ab.flag_started"
757
+ | "ab.flag_paused"
758
+ | "ab.flag_resumed"
759
+ | "ab.flag_stopped"
760
+ | "ab.flag_updated"
761
+ | "ab.config_warmup"
762
+ | (string & Record<never, never>);
763
+
735
764
  export interface Webhook {
736
765
  id: string;
737
766
  name: string;
738
767
  url: string;
739
768
  provider: string;
740
- events: string[];
769
+ events: WebhookEventType[];
741
770
  isActive: boolean;
742
771
  secret?: string;
743
772
  organizationId?: number;
@@ -749,7 +778,7 @@ export interface CreateWebhookRequest {
749
778
  name: string;
750
779
  url: string;
751
780
  provider: string;
752
- events: string[];
781
+ events: WebhookEventType[];
753
782
  isActive?: boolean;
754
783
  secret?: string;
755
784
  }
@@ -1093,6 +1122,7 @@ export interface BundleCollection {
1093
1122
  description?: string;
1094
1123
  available_from?: string;
1095
1124
  available_until?: string;
1125
+ custom?: Record<string, any> | string | null;
1096
1126
  published: number;
1097
1127
  created_at: string;
1098
1128
  updated_at: string;
@@ -1103,6 +1133,7 @@ export interface CreateBundleCollectionRequest {
1103
1133
  description?: string;
1104
1134
  available_from?: string;
1105
1135
  available_until?: string;
1136
+ custom?: Record<string, any> | null;
1106
1137
  published?: number;
1107
1138
  }
1108
1139
 
@@ -16,6 +16,10 @@ export class CollectionsV2Client extends BaseV2Client {
16
16
  });
17
17
  }
18
18
 
19
+ async *listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>) {
20
+ yield* this.listAutoPaginate<V2Collection>(this.sitePath(siteName, 'collections'), params);
21
+ }
22
+
19
23
  async getCurrent(siteName: string): Promise<V2Collection | null> {
20
24
  const result = await this.getOne<{ object: string; data: V2Collection | null }>(
21
25
  this.sitePath(siteName, 'collections', 'current'),
package/src/v2/types.ts CHANGED
@@ -129,6 +129,10 @@ export interface V2Product extends V2Object {
129
129
  recurring: { interval: string; interval_count?: number } | null;
130
130
  tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
131
131
  category_id: string | null;
132
+ gateway_product_id_test: string | null;
133
+ gateway_product_id_live: string | null;
134
+ gateway_price_id_test: string | null;
135
+ gateway_price_id_live: string | null;
132
136
  media: V2Media[];
133
137
  created_at: string | null;
134
138
  updated_at: string | null;
@@ -196,6 +200,7 @@ export interface V2Collection extends V2Object {
196
200
  description: string | null;
197
201
  available_from: string | null;
198
202
  available_until: string | null;
203
+ custom: Record<string, unknown> | null;
199
204
  published: boolean;
200
205
  created_at: string | null;
201
206
  updated_at: string | null;
@@ -214,6 +219,7 @@ export interface V2CollectionCreateParams {
214
219
  description?: string | null;
215
220
  available_from?: string | null;
216
221
  available_until?: string | null;
222
+ custom?: Record<string, unknown> | null;
217
223
  published?: boolean;
218
224
  }
219
225
 
@@ -597,11 +603,40 @@ export interface V2ApiKey extends V2Object {
597
603
 
598
604
  // --- Webhooks ---
599
605
 
606
+ export type V2WebhookEventType =
607
+ | "content.created"
608
+ | "content.updated"
609
+ | "content.published"
610
+ | "content.unpublished"
611
+ | "content.deleted"
612
+ | "newsletter.created"
613
+ | "newsletter.updated"
614
+ | "newsletter.published"
615
+ | "newsletter.sent"
616
+ | "newsletter.deleted"
617
+ | "product.created"
618
+ | "product.updated"
619
+ | "product.deleted"
620
+ | "product.stock_changed"
621
+ | "order.paid"
622
+ | "category.created"
623
+ | "category.updated"
624
+ | "category.deleted"
625
+ | "site.updated"
626
+ | "site.settings_changed"
627
+ | "ab.flag_started"
628
+ | "ab.flag_paused"
629
+ | "ab.flag_resumed"
630
+ | "ab.flag_stopped"
631
+ | "ab.flag_updated"
632
+ | "ab.config_warmup"
633
+ | (string & Record<never, never>);
634
+
600
635
  export interface V2Webhook extends V2Object {
601
636
  object: "webhook";
602
637
  url: string;
603
638
  description: string | null;
604
- events: string[] | null;
639
+ events: V2WebhookEventType[] | null;
605
640
  is_active: boolean;
606
641
  created_at: string | null;
607
642
  updated_at: string | null;
@@ -610,7 +645,7 @@ export interface V2Webhook extends V2Object {
610
645
  export interface V2WebhookCreateParams {
611
646
  url: string;
612
647
  description?: string;
613
- events?: string[];
648
+ events?: V2WebhookEventType[];
614
649
  is_active?: boolean;
615
650
  }
616
651