@01.software/sdk 0.65.0 → 0.67.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 (55) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +79 -2
  3. package/dist/client.cjs +79 -27
  4. package/dist/client.cjs.map +1 -1
  5. package/dist/client.d.cts +6 -6
  6. package/dist/client.d.ts +6 -6
  7. package/dist/client.js +79 -27
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-C2sMvfme.d.ts → collection-client-D4HEOoO_.d.ts} +4 -4
  10. package/dist/{collection-client-B7rsTtVj.d.cts → collection-client-jrNFGbrO.d.cts} +4 -4
  11. package/dist/{const-CRxPTDGt.d.ts → const-BU79hCFB.d.ts} +2 -2
  12. package/dist/{const-D6ZRQLxI.d.cts → const-CCQ3MdLE.d.cts} +2 -2
  13. package/dist/{index-1auUEYrl.d.ts → index-CwKxWHIa.d.ts} +3 -3
  14. package/dist/{index-Bbpf5t-l.d.cts → index-DiyhsVHd.d.cts} +3 -3
  15. package/dist/index.cjs +80 -27
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +7 -7
  18. package/dist/index.d.ts +7 -7
  19. package/dist/index.js +80 -27
  20. package/dist/index.js.map +1 -1
  21. package/dist/{payload-types-BnIET0xU.d.cts → payload-types-jdsUXunB.d.cts} +128 -49
  22. package/dist/{payload-types-BnIET0xU.d.ts → payload-types-jdsUXunB.d.ts} +128 -49
  23. package/dist/query.cjs +14 -1
  24. package/dist/query.cjs.map +1 -1
  25. package/dist/query.d.cts +5 -5
  26. package/dist/query.d.ts +5 -5
  27. package/dist/query.js +14 -1
  28. package/dist/query.js.map +1 -1
  29. package/dist/realtime.d.cts +2 -2
  30. package/dist/realtime.d.ts +2 -2
  31. package/dist/server.cjs +96 -3
  32. package/dist/server.cjs.map +1 -1
  33. package/dist/server.d.cts +9 -9
  34. package/dist/server.d.ts +9 -9
  35. package/dist/server.js +96 -3
  36. package/dist/server.js.map +1 -1
  37. package/dist/{types-Dp1oYpD3.d.cts → types-BPwXAFZ7.d.cts} +2 -2
  38. package/dist/{types-D1y4TgQm.d.ts → types-BusejG-v.d.ts} +2 -2
  39. package/dist/{types-Dzn0LD2N.d.cts → types-CvdBV3ri.d.cts} +71 -6
  40. package/dist/{types-DnRC3nLG.d.ts → types-I2k6Laad.d.ts} +71 -6
  41. package/dist/ui/canvas.cjs +5 -1
  42. package/dist/ui/canvas.cjs.map +1 -1
  43. package/dist/ui/canvas.js +5 -1
  44. package/dist/ui/canvas.js.map +1 -1
  45. package/dist/ui/form.d.cts +1 -1
  46. package/dist/ui/form.d.ts +1 -1
  47. package/dist/ui/video.cjs +9 -2
  48. package/dist/ui/video.cjs.map +1 -1
  49. package/dist/ui/video.d.cts +1 -1
  50. package/dist/ui/video.d.ts +1 -1
  51. package/dist/ui/video.js +9 -2
  52. package/dist/ui/video.js.map +1 -1
  53. package/dist/webhook.d.cts +5 -5
  54. package/dist/webhook.d.ts +5 -5
  55. package/package.json +5 -5
@@ -1,8 +1,8 @@
1
- import { G as DebugConfig, ak as RetryConfig, i as ApiQueryOptions, P as PayloadFindResponse, L as PayloadMutationResponse, cM as ApiDeleteOptions, cN as PublicReadQueryOptions } from './types-DnRC3nLG.js';
2
- import './payload-types-BnIET0xU.js';
1
+ import { G as DebugConfig, ak as RetryConfig, i as ApiQueryOptions, P as PayloadFindResponse, L as PayloadMutationResponse, cU as ApiDeleteOptions, cV as PublicReadQueryOptions } from './types-I2k6Laad.js';
2
+ import './payload-types-jdsUXunB.js';
3
3
  import { GenerateMetadataOptions, Metadata } from './metadata.js';
4
- import { C as Collection, S as ServerCollection, P as PublicCollection } from './const-CRxPTDGt.js';
5
- import { C as CollectionType } from './types-D1y4TgQm.js';
4
+ import { C as Collection, S as ServerCollection, P as PublicCollection } from './const-BU79hCFB.js';
5
+ import { C as CollectionType } from './types-BusejG-v.js';
6
6
 
7
7
  interface FetchOptions extends RequestInit {
8
8
  apiUrl?: string;
@@ -1,8 +1,8 @@
1
- import { G as DebugConfig, ak as RetryConfig, i as ApiQueryOptions, P as PayloadFindResponse, L as PayloadMutationResponse, cM as ApiDeleteOptions, cN as PublicReadQueryOptions } from './types-Dzn0LD2N.cjs';
2
- import './payload-types-BnIET0xU.cjs';
1
+ import { G as DebugConfig, ak as RetryConfig, i as ApiQueryOptions, P as PayloadFindResponse, L as PayloadMutationResponse, cU as ApiDeleteOptions, cV as PublicReadQueryOptions } from './types-CvdBV3ri.cjs';
2
+ import './payload-types-jdsUXunB.cjs';
3
3
  import { GenerateMetadataOptions, Metadata } from './metadata.cjs';
4
- import { C as Collection, S as ServerCollection, P as PublicCollection } from './const-D6ZRQLxI.cjs';
5
- import { C as CollectionType } from './types-Dp1oYpD3.cjs';
4
+ import { C as Collection, S as ServerCollection, P as PublicCollection } from './const-CCQ3MdLE.cjs';
5
+ import { C as CollectionType } from './types-BPwXAFZ7.cjs';
6
6
 
7
7
  interface FetchOptions extends RequestInit {
8
8
  apiUrl?: string;
@@ -1,10 +1,10 @@
1
- import './payload-types-BnIET0xU.js';
1
+ import './payload-types-jdsUXunB.js';
2
2
 
3
3
  /**
4
4
  * Internal collections that should not be exposed via SDK.
5
5
  * Includes Payload system collections and admin-only collections.
6
6
  */
7
- declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
7
+ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
8
8
  type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
9
9
  /**
10
10
  * Array of browser-public collection names for runtime use (e.g., Zod enum validation).
@@ -1,10 +1,10 @@
1
- import './payload-types-BnIET0xU.cjs';
1
+ import './payload-types-jdsUXunB.cjs';
2
2
 
3
3
  /**
4
4
  * Internal collections that should not be exposed via SDK.
5
5
  * Includes Payload system collections and admin-only collections.
6
6
  */
7
- declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
7
+ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
8
8
  type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
9
9
  /**
10
10
  * Array of browser-public collection names for runtime use (e.g., Zod enum validation).
@@ -1,6 +1,6 @@
1
- import { C as Collection } from './const-CRxPTDGt.js';
2
- import { C as CollectionType } from './types-D1y4TgQm.js';
3
- import './payload-types-BnIET0xU.js';
1
+ import { C as Collection } from './const-BU79hCFB.js';
2
+ import { C as CollectionType } from './types-BusejG-v.js';
3
+ import './payload-types-jdsUXunB.js';
4
4
 
5
5
  type WebhookOperation = string;
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { C as Collection } from './const-D6ZRQLxI.cjs';
2
- import { C as CollectionType } from './types-Dp1oYpD3.cjs';
3
- import './payload-types-BnIET0xU.cjs';
1
+ import { C as Collection } from './const-CCQ3MdLE.cjs';
2
+ import { C as CollectionType } from './types-BPwXAFZ7.cjs';
3
+ import './payload-types-jdsUXunB.cjs';
4
4
 
5
5
  type WebhookOperation = string;
6
6
  /**
package/dist/index.cjs CHANGED
@@ -1525,7 +1525,9 @@ var COMMERCE_ENDPOINT_OPERATIONS = {
1525
1525
  ),
1526
1526
  stockCheck: operation("products", "post", "/stock-check"),
1527
1527
  stockSnapshot: operation("products", "get", "/stock"),
1528
- upsert: operation("products", "post", "/upsert")
1528
+ upsert: operation("products", "post", "/upsert"),
1529
+ graphRevision: operation("products", "get", "/:id/graph-revision"),
1530
+ variantsPatch: operation("products", "patch", "/:id/variants")
1529
1531
  },
1530
1532
  orders: {
1531
1533
  create: operation("orders", "post", "/create"),
@@ -1694,6 +1696,14 @@ var CUSTOMER_GROUP_ENDPOINT_OPERATIONS = {
1694
1696
  revoke: operation("customer-groups", "post", "/:id/members/revoke")
1695
1697
  };
1696
1698
  var CUSTOMER_AUTH_ENDPOINT_OPERATIONS = {
1699
+ register: operation("customers", "post", "/register"),
1700
+ login: operation("customers", "post", "/login"),
1701
+ refresh: operation("customers", "post", "/refresh"),
1702
+ me: operation("customers", "get", "/me"),
1703
+ updateProfile: operation("customers", "patch", "/me"),
1704
+ forgotPassword: operation("customers", "post", "/forgot-password"),
1705
+ resetPassword: operation("customers", "post", "/reset-password"),
1706
+ changePassword: operation("customers", "post", "/change-password"),
1697
1707
  revokeRefresh: operation("customers", "post", "/revoke-refresh"),
1698
1708
  withdraw: operation("customers", "post", "/withdraw")
1699
1709
  };
@@ -1703,6 +1713,9 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
1703
1713
  disable: operation("tenants", "delete", "/embedded-admin-app")
1704
1714
  };
1705
1715
  var EVENTS_ENDPOINT_OPERATIONS = {
1716
+ registrations: {
1717
+ listMine: operation("event-registrations", "get", "/my")
1718
+ },
1706
1719
  events: {
1707
1720
  convertSchedule: operation("events", "post", "/:id/schedule")
1708
1721
  },
@@ -4128,19 +4141,24 @@ var CustomerAuth = class {
4128
4141
  * Register a new customer account
4129
4142
  */
4130
4143
  async register(data) {
4131
- return this.requestJson("/api/customers/register", {
4132
- method: "POST",
4133
- body: JSON.stringify(data)
4134
- });
4144
+ return this.requestJson(
4145
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.register),
4146
+ {
4147
+ method: resolveOperationMethod(
4148
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.register
4149
+ ),
4150
+ body: JSON.stringify(data)
4151
+ }
4152
+ );
4135
4153
  }
4136
4154
  /**
4137
4155
  * Login with email and password. Stores the token internally.
4138
4156
  */
4139
4157
  async login(data) {
4140
4158
  const result = await this.requestJson(
4141
- "/api/customers/login",
4159
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.login),
4142
4160
  {
4143
- method: "POST",
4161
+ method: resolveOperationMethod(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.login),
4144
4162
  body: JSON.stringify(data)
4145
4163
  }
4146
4164
  );
@@ -4386,14 +4404,18 @@ var CustomerAuth = class {
4386
4404
  }
4387
4405
  async _doRefreshToken(intended) {
4388
4406
  const init = intended.refreshToken ? {
4389
- method: "POST",
4407
+ method: resolveOperationMethod(
4408
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.refresh
4409
+ ),
4390
4410
  body: JSON.stringify({ refreshToken: intended.refreshToken })
4391
4411
  } : {
4392
- method: "POST",
4412
+ method: resolveOperationMethod(
4413
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.refresh
4414
+ ),
4393
4415
  headers: { Authorization: `Bearer ${intended.token}` }
4394
4416
  };
4395
4417
  const result = await this.requestJson(
4396
- "/api/customers/refresh",
4418
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.refresh),
4397
4419
  init
4398
4420
  );
4399
4421
  const state = this.classifyCanonicalState(intended);
@@ -4462,9 +4484,9 @@ var CustomerAuth = class {
4462
4484
  if (!token) return null;
4463
4485
  try {
4464
4486
  const data = await this.requestJson(
4465
- "/api/customers/me",
4487
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.me),
4466
4488
  {
4467
- method: "GET",
4489
+ method: resolveOperationMethod(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.me),
4468
4490
  headers: { Authorization: `Bearer ${token}` }
4469
4491
  }
4470
4492
  );
@@ -4481,19 +4503,29 @@ var CustomerAuth = class {
4481
4503
  * Request a password reset email
4482
4504
  */
4483
4505
  async forgotPassword(email) {
4484
- await this.requestJson("/api/customers/forgot-password", {
4485
- method: "POST",
4486
- body: JSON.stringify({ email })
4487
- });
4506
+ await this.requestJson(
4507
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.forgotPassword),
4508
+ {
4509
+ method: resolveOperationMethod(
4510
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.forgotPassword
4511
+ ),
4512
+ body: JSON.stringify({ email })
4513
+ }
4514
+ );
4488
4515
  }
4489
4516
  /**
4490
4517
  * Reset password using a token from the reset email
4491
4518
  */
4492
4519
  async resetPassword(token, password) {
4493
- await this.requestJson("/api/customers/reset-password", {
4494
- method: "POST",
4495
- body: JSON.stringify({ token, password })
4496
- });
4520
+ await this.requestJson(
4521
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.resetPassword),
4522
+ {
4523
+ method: resolveOperationMethod(
4524
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.resetPassword
4525
+ ),
4526
+ body: JSON.stringify({ token, password })
4527
+ }
4528
+ );
4497
4529
  }
4498
4530
  /**
4499
4531
  * Update the authenticated customer's profile (name, phone, marketingConsent)
@@ -4502,9 +4534,11 @@ var CustomerAuth = class {
4502
4534
  const token = this.getToken();
4503
4535
  if (!token) throw new ApiError("Not authenticated", 401);
4504
4536
  const result = await this.requestJson(
4505
- "/api/customers/me",
4537
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.updateProfile),
4506
4538
  {
4507
- method: "PATCH",
4539
+ method: resolveOperationMethod(
4540
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.updateProfile
4541
+ ),
4508
4542
  headers: { Authorization: `Bearer ${token}` },
4509
4543
  body: JSON.stringify(data)
4510
4544
  }
@@ -4517,11 +4551,16 @@ var CustomerAuth = class {
4517
4551
  async changePassword(currentPassword, newPassword) {
4518
4552
  const token = this.getToken();
4519
4553
  if (!token) throw new ApiError("Not authenticated", 401);
4520
- await this.requestJson("/api/customers/change-password", {
4521
- method: "POST",
4522
- headers: { Authorization: `Bearer ${token}` },
4523
- body: JSON.stringify({ currentPassword, newPassword })
4524
- });
4554
+ await this.requestJson(
4555
+ resolveOperationPath(CUSTOMER_AUTH_ENDPOINT_OPERATIONS.changePassword),
4556
+ {
4557
+ method: resolveOperationMethod(
4558
+ CUSTOMER_AUTH_ENDPOINT_OPERATIONS.changePassword
4559
+ ),
4560
+ headers: { Authorization: `Bearer ${token}` },
4561
+ body: JSON.stringify({ currentPassword, newPassword })
4562
+ }
4563
+ );
4525
4564
  }
4526
4565
  /**
4527
4566
  * Get the authenticated customer's orders with pagination and optional status filter
@@ -7039,6 +7078,18 @@ var EventsClient = class {
7039
7078
  { useCustomerAuth: false }
7040
7079
  );
7041
7080
  }
7081
+ listMyRegistrations(params = {}) {
7082
+ const query = new URLSearchParams();
7083
+ if (params.page !== void 0) query.set("page", String(params.page));
7084
+ if (params.limit !== void 0) query.set("limit", String(params.limit));
7085
+ const operation2 = EVENTS_ENDPOINT_OPERATIONS.registrations.listMine;
7086
+ return this.execute(
7087
+ resolveOperationPath(operation2, { query }),
7088
+ resolveOperationMethod(operation2),
7089
+ void 0,
7090
+ { useCustomerAuth: true, noStore: true }
7091
+ );
7092
+ }
7042
7093
  register(params) {
7043
7094
  return this.execute(
7044
7095
  "/api/event-registrations/register",
@@ -7069,6 +7120,7 @@ var EventsClient = class {
7069
7120
  try {
7070
7121
  const response = await httpFetch(endpoint, {
7071
7122
  method,
7123
+ ...options.noStore && { cache: "no-store" },
7072
7124
  apiUrl: this.apiUrl,
7073
7125
  publishableKey: this.publishableKey,
7074
7126
  ...useCustomerAuth && token ? { customerToken: token } : {},
@@ -7655,6 +7707,7 @@ var INTERNAL_COLLECTIONS = [
7655
7707
  "tenant-mcp-usage-daily",
7656
7708
  "subscriptions",
7657
7709
  "billing-history",
7710
+ "billing-consent-receipts",
7658
7711
  "usage-rate-cards",
7659
7712
  "usage-invoices",
7660
7713
  "inventory-reservations",