@01.software/sdk 0.67.0 → 0.69.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +124 -6
  3. package/dist/client.cjs +422 -319
  4. package/dist/client.cjs.map +1 -1
  5. package/dist/client.d.cts +11 -6
  6. package/dist/client.d.ts +11 -6
  7. package/dist/client.js +422 -319
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-D4HEOoO_.d.ts → collection-client-C2VGBnCC.d.ts} +4 -4
  10. package/dist/{collection-client-jrNFGbrO.d.cts → collection-client-DvWkDxSM.d.cts} +4 -4
  11. package/dist/{const-CCQ3MdLE.d.cts → const-AtPEgg__.d.cts} +2 -2
  12. package/dist/{const-BU79hCFB.d.ts → const-DR96Chal.d.ts} +2 -2
  13. package/dist/embedded-admin/server.cjs +19 -1
  14. package/dist/embedded-admin/server.cjs.map +1 -1
  15. package/dist/embedded-admin/server.d.cts +4 -2
  16. package/dist/embedded-admin/server.d.ts +4 -2
  17. package/dist/embedded-admin/server.js +19 -1
  18. package/dist/embedded-admin/server.js.map +1 -1
  19. package/dist/embedded-admin.cjs +22 -0
  20. package/dist/embedded-admin.cjs.map +1 -1
  21. package/dist/embedded-admin.d.cts +7 -1
  22. package/dist/embedded-admin.d.ts +7 -1
  23. package/dist/embedded-admin.js +22 -0
  24. package/dist/embedded-admin.js.map +1 -1
  25. package/dist/errors.cjs +3 -0
  26. package/dist/errors.cjs.map +1 -1
  27. package/dist/errors.d.cts +3 -3
  28. package/dist/errors.d.ts +3 -3
  29. package/dist/errors.js +3 -0
  30. package/dist/errors.js.map +1 -1
  31. package/dist/{index-DiyhsVHd.d.cts → index-Ce11c_Oh.d.cts} +3 -3
  32. package/dist/{index-CwKxWHIa.d.ts → index-D8fmTrZk.d.ts} +3 -3
  33. package/dist/index.cjs +427 -323
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +7 -7
  36. package/dist/index.d.ts +7 -7
  37. package/dist/index.js +427 -323
  38. package/dist/index.js.map +1 -1
  39. package/dist/{payload-types-jdsUXunB.d.cts → payload-types-rhnw3rR8.d.cts} +48 -1
  40. package/dist/{payload-types-jdsUXunB.d.ts → payload-types-rhnw3rR8.d.ts} +48 -1
  41. package/dist/query.cjs +11 -0
  42. package/dist/query.cjs.map +1 -1
  43. package/dist/query.d.cts +5 -5
  44. package/dist/query.d.ts +5 -5
  45. package/dist/query.js +11 -0
  46. package/dist/query.js.map +1 -1
  47. package/dist/realtime.d.cts +2 -2
  48. package/dist/realtime.d.ts +2 -2
  49. package/dist/server.cjs +1186 -1071
  50. package/dist/server.cjs.map +1 -1
  51. package/dist/server.d.cts +9 -8
  52. package/dist/server.d.ts +9 -8
  53. package/dist/server.js +1186 -1071
  54. package/dist/server.js.map +1 -1
  55. package/dist/storefront-cache.cjs +3 -0
  56. package/dist/storefront-cache.cjs.map +1 -1
  57. package/dist/storefront-cache.js +3 -0
  58. package/dist/storefront-cache.js.map +1 -1
  59. package/dist/{types-CvdBV3ri.d.cts → types-B99utaKU.d.cts} +147 -40
  60. package/dist/{types-BPwXAFZ7.d.cts → types-BR0D4AaW.d.cts} +2 -2
  61. package/dist/{types-BusejG-v.d.ts → types-CHK8VIPa.d.ts} +2 -2
  62. package/dist/{types-I2k6Laad.d.ts → types-L0xmn_iT.d.ts} +147 -40
  63. package/dist/ui/form.d.cts +1 -1
  64. package/dist/ui/form.d.ts +1 -1
  65. package/dist/ui/video.d.cts +1 -1
  66. package/dist/ui/video.d.ts +1 -1
  67. package/dist/webhook.d.cts +5 -5
  68. package/dist/webhook.d.ts +5 -5
  69. package/package.json +2 -2
@@ -108,6 +108,7 @@ interface Config {
108
108
  'draft-orders': DraftOrder;
109
109
  'draft-order-items': DraftOrderItem;
110
110
  discounts: Discount;
111
+ 'benefit-voucher-definitions': BenefitVoucherDefinition;
111
112
  articles: Article;
112
113
  'article-authors': ArticleAuthor;
113
114
  'article-categories': ArticleCategory;
@@ -356,6 +357,7 @@ interface Config {
356
357
  'draft-orders': DraftOrdersSelect<false> | DraftOrdersSelect<true>;
357
358
  'draft-order-items': DraftOrderItemsSelect<false> | DraftOrderItemsSelect<true>;
358
359
  discounts: DiscountsSelect<false> | DiscountsSelect<true>;
360
+ 'benefit-voucher-definitions': BenefitVoucherDefinitionsSelect<false> | BenefitVoucherDefinitionsSelect<true>;
359
361
  articles: ArticlesSelect<false> | ArticlesSelect<true>;
360
362
  'article-authors': ArticleAuthorsSelect<false> | ArticleAuthorsSelect<true>;
361
363
  'article-categories': ArticleCategoriesSelect<false> | ArticleCategoriesSelect<true>;
@@ -729,6 +731,7 @@ interface Tenant {
729
731
  */
730
732
  embeddedAdminApp?: {
731
733
  enabled?: boolean | null;
734
+ allowedRoles?: ('tenant-admin' | 'tenant-editor' | 'tenant-viewer')[] | null;
732
735
  label?: string | null;
733
736
  origin?: string | null;
734
737
  path?: string | null;
@@ -1034,7 +1037,7 @@ interface SystemMedia {
1034
1037
  interface FieldConfig {
1035
1038
  id: string;
1036
1039
  tenant?: (string | null) | Tenant;
1037
- collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'post-tags' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
1040
+ collectionSlug: 'benefit-voucher-definitions' | 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'post-tags' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
1038
1041
  isHidden?: boolean | null;
1039
1042
  hiddenFields?: {
1040
1043
  [k: string]: unknown;
@@ -1867,6 +1870,14 @@ interface Product {
1867
1870
  * Maximum order quantity.
1868
1871
  */
1869
1872
  maxOrderQuantity?: number | null;
1873
+ /**
1874
+ * All variants combined, including committed orders and ongoing checkouts. Leave empty for no limit.
1875
+ */
1876
+ maxQuantityPerCustomer?: number | null;
1877
+ /**
1878
+ * Leave empty to allow anyone to purchase. Otherwise a signed-in customer must currently qualify for one of these groups. Catalog visibility is unchanged.
1879
+ */
1880
+ allowedCustomerGroups?: (string | CustomerGroup)[] | null;
1870
1881
  /**
1871
1882
  * Vendor name from external systems.
1872
1883
  */
@@ -3187,6 +3198,9 @@ interface Checkout {
3187
3198
  checkoutTokenCiphertext?: string | null;
3188
3199
  createIdempotencyKey?: string | null;
3189
3200
  createRequestFingerprint?: string | null;
3201
+ purchasePolicyEvidence?: {
3202
+ [k: string]: unknown;
3203
+ } | unknown[] | string | number | boolean | null;
3190
3204
  admissionEligibilityFreeze?: {
3191
3205
  [k: string]: unknown;
3192
3206
  } | unknown[] | string | number | boolean | null;
@@ -6731,6 +6745,22 @@ interface DraftOrderItem {
6731
6745
  updatedAt: string;
6732
6746
  createdAt: string;
6733
6747
  }
6748
+ /**
6749
+ * Manage single-use benefit voucher definitions and validity periods for customers.
6750
+ *
6751
+ * This interface was referenced by `Config`'s JSON-Schema
6752
+ * via the `definition` "benefit-voucher-definitions".
6753
+ */
6754
+ interface BenefitVoucherDefinition {
6755
+ id: string;
6756
+ tenant?: (string | null) | Tenant;
6757
+ name: string;
6758
+ description?: string | null;
6759
+ validityDays: number;
6760
+ status: 'active' | 'archived';
6761
+ updatedAt: string;
6762
+ createdAt: string;
6763
+ }
6734
6764
  /**
6735
6765
  * Manage publishable articles, authors, and classification.
6736
6766
  *
@@ -9447,6 +9477,7 @@ interface TenantsSelect<T extends boolean = true> {
9447
9477
  };
9448
9478
  embeddedAdminApp?: T | {
9449
9479
  enabled?: T;
9480
+ allowedRoles?: T;
9450
9481
  label?: T;
9451
9482
  origin?: T;
9452
9483
  path?: T;
@@ -9987,6 +10018,8 @@ interface ProductsSelect<T extends boolean = true> {
9987
10018
  weight?: T;
9988
10019
  minOrderQuantity?: T;
9989
10020
  maxOrderQuantity?: T;
10021
+ maxQuantityPerCustomer?: T;
10022
+ allowedCustomerGroups?: T;
9990
10023
  vendor?: T;
9991
10024
  productType?: T;
9992
10025
  priceRange?: T | {
@@ -11825,6 +11858,7 @@ interface CheckoutsSelect<T extends boolean = true> {
11825
11858
  checkoutTokenCiphertext?: T;
11826
11859
  createIdempotencyKey?: T;
11827
11860
  createRequestFingerprint?: T;
11861
+ purchasePolicyEvidence?: T;
11828
11862
  admissionEligibilityFreeze?: T;
11829
11863
  providerOrderId?: T;
11830
11864
  cart?: T;
@@ -12062,6 +12096,19 @@ interface DiscountsSelect<T extends boolean = true> {
12062
12096
  createdAt?: T;
12063
12097
  deletedAt?: T;
12064
12098
  }
12099
+ /**
12100
+ * This interface was referenced by `Config`'s JSON-Schema
12101
+ * via the `definition` "benefit-voucher-definitions_select".
12102
+ */
12103
+ interface BenefitVoucherDefinitionsSelect<T extends boolean = true> {
12104
+ tenant?: T;
12105
+ name?: T;
12106
+ description?: T;
12107
+ validityDays?: T;
12108
+ status?: T;
12109
+ updatedAt?: T;
12110
+ createdAt?: T;
12111
+ }
12065
12112
  /**
12066
12113
  * This interface was referenced by `Config`'s JSON-Schema
12067
12114
  * via the `definition` "articles_select".
@@ -108,6 +108,7 @@ interface Config {
108
108
  'draft-orders': DraftOrder;
109
109
  'draft-order-items': DraftOrderItem;
110
110
  discounts: Discount;
111
+ 'benefit-voucher-definitions': BenefitVoucherDefinition;
111
112
  articles: Article;
112
113
  'article-authors': ArticleAuthor;
113
114
  'article-categories': ArticleCategory;
@@ -356,6 +357,7 @@ interface Config {
356
357
  'draft-orders': DraftOrdersSelect<false> | DraftOrdersSelect<true>;
357
358
  'draft-order-items': DraftOrderItemsSelect<false> | DraftOrderItemsSelect<true>;
358
359
  discounts: DiscountsSelect<false> | DiscountsSelect<true>;
360
+ 'benefit-voucher-definitions': BenefitVoucherDefinitionsSelect<false> | BenefitVoucherDefinitionsSelect<true>;
359
361
  articles: ArticlesSelect<false> | ArticlesSelect<true>;
360
362
  'article-authors': ArticleAuthorsSelect<false> | ArticleAuthorsSelect<true>;
361
363
  'article-categories': ArticleCategoriesSelect<false> | ArticleCategoriesSelect<true>;
@@ -729,6 +731,7 @@ interface Tenant {
729
731
  */
730
732
  embeddedAdminApp?: {
731
733
  enabled?: boolean | null;
734
+ allowedRoles?: ('tenant-admin' | 'tenant-editor' | 'tenant-viewer')[] | null;
732
735
  label?: string | null;
733
736
  origin?: string | null;
734
737
  path?: string | null;
@@ -1034,7 +1037,7 @@ interface SystemMedia {
1034
1037
  interface FieldConfig {
1035
1038
  id: string;
1036
1039
  tenant?: (string | null) | Tenant;
1037
- collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'post-tags' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
1040
+ collectionSlug: 'benefit-voucher-definitions' | 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'post-tags' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
1038
1041
  isHidden?: boolean | null;
1039
1042
  hiddenFields?: {
1040
1043
  [k: string]: unknown;
@@ -1867,6 +1870,14 @@ interface Product {
1867
1870
  * Maximum order quantity.
1868
1871
  */
1869
1872
  maxOrderQuantity?: number | null;
1873
+ /**
1874
+ * All variants combined, including committed orders and ongoing checkouts. Leave empty for no limit.
1875
+ */
1876
+ maxQuantityPerCustomer?: number | null;
1877
+ /**
1878
+ * Leave empty to allow anyone to purchase. Otherwise a signed-in customer must currently qualify for one of these groups. Catalog visibility is unchanged.
1879
+ */
1880
+ allowedCustomerGroups?: (string | CustomerGroup)[] | null;
1870
1881
  /**
1871
1882
  * Vendor name from external systems.
1872
1883
  */
@@ -3187,6 +3198,9 @@ interface Checkout {
3187
3198
  checkoutTokenCiphertext?: string | null;
3188
3199
  createIdempotencyKey?: string | null;
3189
3200
  createRequestFingerprint?: string | null;
3201
+ purchasePolicyEvidence?: {
3202
+ [k: string]: unknown;
3203
+ } | unknown[] | string | number | boolean | null;
3190
3204
  admissionEligibilityFreeze?: {
3191
3205
  [k: string]: unknown;
3192
3206
  } | unknown[] | string | number | boolean | null;
@@ -6731,6 +6745,22 @@ interface DraftOrderItem {
6731
6745
  updatedAt: string;
6732
6746
  createdAt: string;
6733
6747
  }
6748
+ /**
6749
+ * Manage single-use benefit voucher definitions and validity periods for customers.
6750
+ *
6751
+ * This interface was referenced by `Config`'s JSON-Schema
6752
+ * via the `definition` "benefit-voucher-definitions".
6753
+ */
6754
+ interface BenefitVoucherDefinition {
6755
+ id: string;
6756
+ tenant?: (string | null) | Tenant;
6757
+ name: string;
6758
+ description?: string | null;
6759
+ validityDays: number;
6760
+ status: 'active' | 'archived';
6761
+ updatedAt: string;
6762
+ createdAt: string;
6763
+ }
6734
6764
  /**
6735
6765
  * Manage publishable articles, authors, and classification.
6736
6766
  *
@@ -9447,6 +9477,7 @@ interface TenantsSelect<T extends boolean = true> {
9447
9477
  };
9448
9478
  embeddedAdminApp?: T | {
9449
9479
  enabled?: T;
9480
+ allowedRoles?: T;
9450
9481
  label?: T;
9451
9482
  origin?: T;
9452
9483
  path?: T;
@@ -9987,6 +10018,8 @@ interface ProductsSelect<T extends boolean = true> {
9987
10018
  weight?: T;
9988
10019
  minOrderQuantity?: T;
9989
10020
  maxOrderQuantity?: T;
10021
+ maxQuantityPerCustomer?: T;
10022
+ allowedCustomerGroups?: T;
9990
10023
  vendor?: T;
9991
10024
  productType?: T;
9992
10025
  priceRange?: T | {
@@ -11825,6 +11858,7 @@ interface CheckoutsSelect<T extends boolean = true> {
11825
11858
  checkoutTokenCiphertext?: T;
11826
11859
  createIdempotencyKey?: T;
11827
11860
  createRequestFingerprint?: T;
11861
+ purchasePolicyEvidence?: T;
11828
11862
  admissionEligibilityFreeze?: T;
11829
11863
  providerOrderId?: T;
11830
11864
  cart?: T;
@@ -12062,6 +12096,19 @@ interface DiscountsSelect<T extends boolean = true> {
12062
12096
  createdAt?: T;
12063
12097
  deletedAt?: T;
12064
12098
  }
12099
+ /**
12100
+ * This interface was referenced by `Config`'s JSON-Schema
12101
+ * via the `definition` "benefit-voucher-definitions_select".
12102
+ */
12103
+ interface BenefitVoucherDefinitionsSelect<T extends boolean = true> {
12104
+ tenant?: T;
12105
+ name?: T;
12106
+ description?: T;
12107
+ validityDays?: T;
12108
+ status?: T;
12109
+ updatedAt?: T;
12110
+ createdAt?: T;
12111
+ }
12065
12112
  /**
12066
12113
  * This interface was referenced by `Config`'s JSON-Schema
12067
12114
  * via the `definition` "articles_select".
package/dist/query.cjs CHANGED
@@ -615,6 +615,7 @@ var COMMERCE_ERROR_CODES = [
615
615
  "admission_metadata_invalid",
616
616
  "admission_metadata_required",
617
617
  "capacity_exceeded",
618
+ "admission_required",
618
619
  "occurrence_lock_unavailable",
619
620
  "occurrence_not_open",
620
621
  "admission_type_capacity_exceeded",
@@ -633,6 +634,8 @@ var COMMERCE_ERROR_CODES = [
633
634
  "variant_inactive",
634
635
  "variant_product_mismatch",
635
636
  "product_not_public",
637
+ "product_not_eligible",
638
+ "purchase_limit_exceeded",
636
639
  "market_not_found",
637
640
  "market_shipping_currency_unsupported",
638
641
  "missing_market_rate",
@@ -1030,6 +1033,14 @@ var EXTERNAL_CUSTOMER_LINK_ENDPOINT_OPERATIONS = {
1030
1033
  "/external-links/clear-previous-state"
1031
1034
  )
1032
1035
  };
1036
+ var BENEFIT_VOUCHER_ENDPOINT_OPERATIONS = {
1037
+ issue: operation("customers", "post", "/benefit-vouchers/issue"),
1038
+ get: operation("customers", "post", "/benefit-vouchers/get"),
1039
+ list: operation("customers", "post", "/benefit-vouchers/list"),
1040
+ redeem: operation("customers", "post", "/benefit-vouchers/redeem"),
1041
+ void: operation("customers", "post", "/benefit-vouchers/void"),
1042
+ listMine: operation("customers", "get", "/me/benefit-vouchers")
1043
+ };
1033
1044
  var CUSTOMER_GROUP_ENDPOINT_OPERATIONS = {
1034
1045
  members: operation("customer-groups", "get", "/:id/members"),
1035
1046
  grant: operation("customer-groups", "post", "/:id/members/grant"),