@01.software/sdk 0.40.0 → 0.41.1

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 (50) hide show
  1. package/CHANGELOG.md +506 -0
  2. package/MIGRATION.md +183 -0
  3. package/README.md +12 -1
  4. package/dist/analytics/react.cjs.map +1 -1
  5. package/dist/analytics/react.js.map +1 -1
  6. package/dist/analytics.cjs.map +1 -1
  7. package/dist/analytics.js.map +1 -1
  8. package/dist/client.cjs +4 -1
  9. package/dist/client.cjs.map +1 -1
  10. package/dist/client.d.cts +6 -6
  11. package/dist/client.d.ts +6 -6
  12. package/dist/client.js +4 -1
  13. package/dist/client.js.map +1 -1
  14. package/dist/{collection-client-CKFa99C6.d.ts → collection-client-BdcxkW7l.d.ts} +5 -5
  15. package/dist/{collection-client-VYwYi6u6.d.cts → collection-client-Bk--pNzW.d.cts} +5 -5
  16. package/dist/{const-ymprfiPf.d.ts → const-HwdntWtG.d.ts} +1 -1
  17. package/dist/{const-4BUtUdGU.d.cts → const-qGGI7Uii.d.cts} +1 -1
  18. package/dist/{index-w36lpSkU.d.ts → index-B1oW50RY.d.ts} +3 -3
  19. package/dist/{index-Dquv4xTL.d.cts → index-DiXtjVab.d.cts} +3 -3
  20. package/dist/index.cjs +18 -5
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +7 -7
  23. package/dist/index.d.ts +7 -7
  24. package/dist/index.js +18 -5
  25. package/dist/index.js.map +1 -1
  26. package/dist/{payload-types-DC0xzR9i.d.cts → payload-types-CqJOgON7.d.cts} +0 -3
  27. package/dist/{payload-types-DC0xzR9i.d.ts → payload-types-CqJOgON7.d.ts} +0 -3
  28. package/dist/query.d.cts +5 -5
  29. package/dist/query.d.ts +5 -5
  30. package/dist/realtime.cjs.map +1 -1
  31. package/dist/realtime.d.cts +2 -2
  32. package/dist/realtime.d.ts +2 -2
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/server.cjs +10 -5
  35. package/dist/server.cjs.map +1 -1
  36. package/dist/server.d.cts +7 -7
  37. package/dist/server.d.ts +7 -7
  38. package/dist/server.js +10 -5
  39. package/dist/server.js.map +1 -1
  40. package/dist/{types-Umd-YTjM.d.ts → types-BKa9z9s2.d.cts} +36 -5
  41. package/dist/{types-Bh2p-EMc.d.ts → types-BMI3M0nb.d.ts} +1 -1
  42. package/dist/{types-BvpjooU-.d.cts → types-ByLSG-O3.d.cts} +1 -1
  43. package/dist/{types-D5uHrPLr.d.cts → types-DgfXb7iV.d.ts} +36 -5
  44. package/dist/ui/form.d.cts +1 -1
  45. package/dist/ui/form.d.ts +1 -1
  46. package/dist/ui/video.d.cts +1 -1
  47. package/dist/ui/video.d.ts +1 -1
  48. package/dist/webhook.d.cts +4 -4
  49. package/dist/webhook.d.ts +4 -4
  50. package/package.json +4 -2
package/dist/server.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { S as ServerCollectionClient } from './collection-client-VYwYi6u6.cjs';
2
- export { C as CollectionClient } from './collection-client-VYwYi6u6.cjs';
3
- import { N as BaseApi, O as ServerApiOptions, Q as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, V as BanCustomerParams, X as CommunityBan, Y as UnbanCustomerParams, d as ClientState, Z as ClientServerConfig, E as EventsClient, _ as RootServerClientWithEvents } from './types-D5uHrPLr.cjs';
4
- export { A as AddItemParams, g as ApplyDiscountParams, h as CheckoutParams, i as ClearCartParams, $ as CollectionFieldSchema, a0 as CollectionSchemaResponse, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, ak as ModerationApi, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, R as RemoveDiscountParams, w as RemoveItemParams, al as RootServerClient, am as TenantFeatureProgressEvidenceValue, an as TenantFeatureProgressFeature, ao as TenantFeatureProgressGroup, ap as TenantFeatureProgressInput, aq as TenantFeatureProgressItem, ar as TenantFeatureProgressItemState, as as TenantFeatureProgressResponse, at as TenantFeatureProgressSeverity, au as TenantFeatureProgressStatus, av as TenantIntrospectionApi, aw as TenantIntrospectionApiOptions, U as UpdateItemParams } from './types-D5uHrPLr.cjs';
5
- import './payload-types-DC0xzR9i.cjs';
1
+ import { S as ServerCollectionClient } from './collection-client-Bk--pNzW.cjs';
2
+ export { C as CollectionClient } from './collection-client-Bk--pNzW.cjs';
3
+ import { N as BaseApi, O as ServerApiOptions, Q as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, V as BanCustomerParams, X as CommunityBan, Y as UnbanCustomerParams, d as ClientState, Z as ClientServerConfig, E as EventsClient, _ as RootServerClientWithEvents } from './types-BKa9z9s2.cjs';
4
+ export { A as AddItemParams, g as ApplyDiscountParams, h as CheckoutParams, i as ClearCartParams, $ as CollectionFieldSchema, a0 as CollectionSchemaResponse, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, ak as ModerationApi, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, R as RemoveDiscountParams, w as RemoveItemParams, al as RootServerClient, am as TenantFeatureProgressEvidenceValue, an as TenantFeatureProgressFeature, ao as TenantFeatureProgressGroup, ap as TenantFeatureProgressInput, aq as TenantFeatureProgressItem, ar as TenantFeatureProgressItemState, as as TenantFeatureProgressResponse, at as TenantFeatureProgressSeverity, au as TenantFeatureProgressStatus, av as TenantIntrospectionApi, aw as TenantIntrospectionApiOptions, U as UpdateItemParams } from './types-BKa9z9s2.cjs';
5
+ import './payload-types-CqJOgON7.cjs';
6
6
  import './metadata.cjs';
7
- import './const-4BUtUdGU.cjs';
8
- import './types-BvpjooU-.cjs';
7
+ import './const-qGGI7Uii.cjs';
8
+ import './types-ByLSG-O3.cjs';
9
9
 
10
10
  type PreviewDetailParams = {
11
11
  collection: string;
package/dist/server.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { S as ServerCollectionClient } from './collection-client-CKFa99C6.js';
2
- export { C as CollectionClient } from './collection-client-CKFa99C6.js';
3
- import { N as BaseApi, O as ServerApiOptions, Q as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, V as BanCustomerParams, X as CommunityBan, Y as UnbanCustomerParams, d as ClientState, Z as ClientServerConfig, E as EventsClient, _ as RootServerClientWithEvents } from './types-Umd-YTjM.js';
4
- export { A as AddItemParams, g as ApplyDiscountParams, h as CheckoutParams, i as ClearCartParams, $ as CollectionFieldSchema, a0 as CollectionSchemaResponse, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, ak as ModerationApi, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, R as RemoveDiscountParams, w as RemoveItemParams, al as RootServerClient, am as TenantFeatureProgressEvidenceValue, an as TenantFeatureProgressFeature, ao as TenantFeatureProgressGroup, ap as TenantFeatureProgressInput, aq as TenantFeatureProgressItem, ar as TenantFeatureProgressItemState, as as TenantFeatureProgressResponse, at as TenantFeatureProgressSeverity, au as TenantFeatureProgressStatus, av as TenantIntrospectionApi, aw as TenantIntrospectionApiOptions, U as UpdateItemParams } from './types-Umd-YTjM.js';
5
- import './payload-types-DC0xzR9i.js';
1
+ import { S as ServerCollectionClient } from './collection-client-BdcxkW7l.js';
2
+ export { C as CollectionClient } from './collection-client-BdcxkW7l.js';
3
+ import { N as BaseApi, O as ServerApiOptions, Q as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, V as BanCustomerParams, X as CommunityBan, Y as UnbanCustomerParams, d as ClientState, Z as ClientServerConfig, E as EventsClient, _ as RootServerClientWithEvents } from './types-DgfXb7iV.js';
4
+ export { A as AddItemParams, g as ApplyDiscountParams, h as CheckoutParams, i as ClearCartParams, $ as CollectionFieldSchema, a0 as CollectionSchemaResponse, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, ak as ModerationApi, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, R as RemoveDiscountParams, w as RemoveItemParams, al as RootServerClient, am as TenantFeatureProgressEvidenceValue, an as TenantFeatureProgressFeature, ao as TenantFeatureProgressGroup, ap as TenantFeatureProgressInput, aq as TenantFeatureProgressItem, ar as TenantFeatureProgressItemState, as as TenantFeatureProgressResponse, at as TenantFeatureProgressSeverity, au as TenantFeatureProgressStatus, av as TenantIntrospectionApi, aw as TenantIntrospectionApiOptions, U as UpdateItemParams } from './types-DgfXb7iV.js';
5
+ import './payload-types-CqJOgON7.js';
6
6
  import './metadata.js';
7
- import './const-ymprfiPf.js';
8
- import './types-Bh2p-EMc.js';
7
+ import './const-HwdntWtG.js';
8
+ import './types-BMI3M0nb.js';
9
9
 
10
10
  type PreviewDetailParams = {
11
11
  collection: string;
package/dist/server.js CHANGED
@@ -951,9 +951,10 @@ var CollectionQueryBuilder = class {
951
951
  * DELETE /api/{collection}/{id}
952
952
  * @returns Deleted document object directly (no wrapper)
953
953
  */
954
- async remove(id) {
954
+ async remove(id, options) {
955
955
  return this.api.requestDelete(
956
- `/api/${String(this.collection)}/${String(id)}`
956
+ `/api/${String(this.collection)}/${String(id)}`,
957
+ options
957
958
  );
958
959
  }
959
960
  /**
@@ -1085,8 +1086,9 @@ var CollectionClient = class extends HttpClient {
1085
1086
  * Delete document
1086
1087
  * DELETE /api/{collection}/{id}
1087
1088
  */
1088
- async requestDelete(endpoint) {
1089
- const response = await this.fetchWithTracking(endpoint, {
1089
+ async requestDelete(endpoint, options) {
1090
+ const url = this.buildUrl(endpoint, options);
1091
+ const response = await this.fetchWithTracking(url, {
1090
1092
  ...this.defaultOptions,
1091
1093
  method: "DELETE"
1092
1094
  });
@@ -2420,11 +2422,14 @@ function compareVariantOrder(a, b) {
2420
2422
  const bId = String(getRelationID(b.id) ?? "");
2421
2423
  return aId.localeCompare(bId);
2422
2424
  }
2423
- function isVariantAvailableForSale(variant) {
2425
+ function getVariantAvailableForSale(variant) {
2424
2426
  if (variant.isActive === false) return false;
2425
2427
  if (variant.isUnlimited) return true;
2426
2428
  return (variant.stock ?? 0) - (variant.reservedStock ?? 0) > 0;
2427
2429
  }
2430
+ function isVariantAvailableForSale(variant) {
2431
+ return getVariantAvailableForSale(variant);
2432
+ }
2428
2433
  function sortVariantsForMediaSelection(variants) {
2429
2434
  const orderedVariants = [...variants].sort(compareVariantOrder);
2430
2435
  const activeVariants = orderedVariants.filter(