@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,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.cjs';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
3
- import { P as PublicCollection } from './const-D6ZRQLxI.cjs';
4
- import './payload-types-BnIET0xU.cjs';
3
+ import { P as PublicCollection } from './const-CCQ3MdLE.cjs';
4
+ import './payload-types-jdsUXunB.cjs';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
@@ -1,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.js';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.js';
3
- import { P as PublicCollection } from './const-CRxPTDGt.js';
4
- import './payload-types-BnIET0xU.js';
3
+ import { P as PublicCollection } from './const-BU79hCFB.js';
4
+ import './payload-types-jdsUXunB.js';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
package/dist/server.cjs CHANGED
@@ -1707,7 +1707,9 @@ var COMMERCE_ENDPOINT_OPERATIONS = {
1707
1707
  ),
1708
1708
  stockCheck: operation("products", "post", "/stock-check"),
1709
1709
  stockSnapshot: operation("products", "get", "/stock"),
1710
- upsert: operation("products", "post", "/upsert")
1710
+ upsert: operation("products", "post", "/upsert"),
1711
+ graphRevision: operation("products", "get", "/:id/graph-revision"),
1712
+ variantsPatch: operation("products", "patch", "/:id/variants")
1711
1713
  },
1712
1714
  orders: {
1713
1715
  create: operation("orders", "post", "/create"),
@@ -1876,6 +1878,14 @@ var CUSTOMER_GROUP_ENDPOINT_OPERATIONS = {
1876
1878
  revoke: operation("customer-groups", "post", "/:id/members/revoke")
1877
1879
  };
1878
1880
  var CUSTOMER_AUTH_ENDPOINT_OPERATIONS = {
1881
+ register: operation("customers", "post", "/register"),
1882
+ login: operation("customers", "post", "/login"),
1883
+ refresh: operation("customers", "post", "/refresh"),
1884
+ me: operation("customers", "get", "/me"),
1885
+ updateProfile: operation("customers", "patch", "/me"),
1886
+ forgotPassword: operation("customers", "post", "/forgot-password"),
1887
+ resetPassword: operation("customers", "post", "/reset-password"),
1888
+ changePassword: operation("customers", "post", "/change-password"),
1879
1889
  revokeRefresh: operation("customers", "post", "/revoke-refresh"),
1880
1890
  withdraw: operation("customers", "post", "/withdraw")
1881
1891
  };
@@ -1885,6 +1895,9 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
1885
1895
  disable: operation("tenants", "delete", "/embedded-admin-app")
1886
1896
  };
1887
1897
  var EVENTS_ENDPOINT_OPERATIONS = {
1898
+ registrations: {
1899
+ listMine: operation("event-registrations", "get", "/my")
1900
+ },
1888
1901
  events: {
1889
1902
  convertSchedule: operation("events", "post", "/:id/schedule")
1890
1903
  },
@@ -5423,10 +5436,68 @@ function normalizeProductUpsertParams(params) {
5423
5436
  variants
5424
5437
  };
5425
5438
  }
5439
+ function assertPriceOperationObject(value, allowed) {
5440
+ if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((key) => !allowed.includes(key))) {
5441
+ throw createValidationError(
5442
+ "Product price operations accept only their declared fields."
5443
+ );
5444
+ }
5445
+ }
5446
+ function productGraphQuery(params) {
5447
+ if (typeof params.productId !== "string" || !params.productId.trim() || params.locale !== void 0 && params.locale !== "ko" && params.locale !== "en") {
5448
+ throw createValidationError(
5449
+ "Provide a productId and, when specified, a ko or en content locale."
5450
+ );
5451
+ }
5452
+ return new URLSearchParams(
5453
+ params.locale ? { locale: params.locale } : void 0
5454
+ );
5455
+ }
5426
5456
  var ProductApi = class extends BaseApi {
5427
5457
  constructor(options) {
5428
5458
  super("ProductApi", options);
5429
5459
  }
5460
+ /** Read a baseline before reviewing values in the same content locale. */
5461
+ async graphRevision(params) {
5462
+ assertPriceOperationObject(params, ["productId", "locale"]);
5463
+ return this.requestEndpoint(
5464
+ COMMERCE_ENDPOINT_OPERATIONS.products.graphRevision,
5465
+ void 0,
5466
+ {
5467
+ pathParams: { id: params.productId },
5468
+ query: productGraphQuery(params)
5469
+ }
5470
+ );
5471
+ }
5472
+ /** Update existing base prices only; conflicts never trigger a rebase or full upsert. */
5473
+ async updateVariantPrices(params) {
5474
+ assertPriceOperationObject(params, [
5475
+ "productId",
5476
+ "locale",
5477
+ "graphRevision",
5478
+ "updates"
5479
+ ]);
5480
+ const query = productGraphQuery(params);
5481
+ if (typeof params.graphRevision !== "string" || !params.graphRevision.length || !Array.isArray(params.updates) || params.updates.length < 1 || params.updates.length > 250) {
5482
+ throw createValidationError(
5483
+ "Provide graphRevision and between 1 and 250 price updates."
5484
+ );
5485
+ }
5486
+ const updates = params.updates.map((row) => {
5487
+ assertPriceOperationObject(row, ["id", "price"]);
5488
+ if (typeof row.id !== "string" || !row.id.trim() || typeof row.price !== "number" || !Number.isFinite(row.price)) {
5489
+ throw createValidationError(
5490
+ "Each price update requires an existing variant id and numeric price."
5491
+ );
5492
+ }
5493
+ return { id: row.id, price: row.price };
5494
+ });
5495
+ return this.requestEndpoint(
5496
+ COMMERCE_ENDPOINT_OPERATIONS.products.variantsPatch,
5497
+ { graphRevision: params.graphRevision, updates },
5498
+ { pathParams: { id: params.productId }, query }
5499
+ );
5500
+ }
5430
5501
  /**
5431
5502
  * Check point-in-time stock availability for one or more product variants.
5432
5503
  * Results reflect available stock at the moment of the call and are not guaranteed
@@ -5988,7 +6059,9 @@ var ServerCommerceClient = class {
5988
6059
  detail: (params) => productApi.detail(this.withMarket(params)),
5989
6060
  detailCatalog: (params) => productApi.detailCatalog(this.withMarket(params)),
5990
6061
  previewDetail: productApi.previewDetail.bind(productApi),
5991
- upsert: productApi.upsert.bind(productApi)
6062
+ upsert: productApi.upsert.bind(productApi),
6063
+ graphRevision: productApi.graphRevision.bind(productApi),
6064
+ updateVariantPrices: productApi.updateVariantPrices.bind(productApi)
5992
6065
  };
5993
6066
  this.carts = {
5994
6067
  create: (params) => cartApi.create(this.withMarket(params ?? {})),
@@ -6089,6 +6162,18 @@ var EventsClient = class {
6089
6162
  { useCustomerAuth: false }
6090
6163
  );
6091
6164
  }
6165
+ listMyRegistrations(params = {}) {
6166
+ const query = new URLSearchParams();
6167
+ if (params.page !== void 0) query.set("page", String(params.page));
6168
+ if (params.limit !== void 0) query.set("limit", String(params.limit));
6169
+ const operation2 = EVENTS_ENDPOINT_OPERATIONS.registrations.listMine;
6170
+ return this.execute(
6171
+ resolveOperationPath(operation2, { query }),
6172
+ resolveOperationMethod(operation2),
6173
+ void 0,
6174
+ { useCustomerAuth: true, noStore: true }
6175
+ );
6176
+ }
6092
6177
  register(params) {
6093
6178
  return this.execute(
6094
6179
  "/api/event-registrations/register",
@@ -6119,6 +6204,7 @@ var EventsClient = class {
6119
6204
  try {
6120
6205
  const response = await httpFetch(endpoint, {
6121
6206
  method,
6207
+ ...options.noStore && { cache: "no-store" },
6122
6208
  apiUrl: this.apiUrl,
6123
6209
  publishableKey: this.publishableKey,
6124
6210
  ...useCustomerAuth && token ? { customerToken: token } : {},
@@ -6769,13 +6855,20 @@ var ServerClient = class _ServerClient {
6769
6855
  "publishableKey is required for server.events. It is sent as X-Publishable-Key for rate limiting and quota enforcement. Get it from Console > Settings > API Keys."
6770
6856
  );
6771
6857
  }
6772
- this._events = new EventsClient({
6858
+ const events = new EventsClient({
6773
6859
  publishableKey: this.config.publishableKey,
6774
6860
  apiUrl: this.config.apiUrl,
6775
6861
  onRequestId: (id) => {
6776
6862
  this.lastRequestId = id;
6777
6863
  }
6778
6864
  });
6865
+ this._events = {
6866
+ getRange: events.getRange.bind(events),
6867
+ getAdmissionAvailability: events.getAdmissionAvailability.bind(events),
6868
+ register: events.register.bind(events),
6869
+ getGuestRegistration: events.getGuestRegistration.bind(events),
6870
+ cancelGuestRegistration: events.cancelGuestRegistration.bind(events)
6871
+ };
6779
6872
  }
6780
6873
  return this._events;
6781
6874
  }