@01.software/sdk 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -544,3 +544,41 @@ SOFTWARE_SECRET_KEY=your_secret_key # Server only
544
544
  ```
545
545
 
546
546
  > `secretKey` should only be used in server environments. Never expose it to the browser.
547
+
548
+ ## Migration Guide
549
+
550
+ ### v0.8.0 (Breaking Changes)
551
+
552
+ **Field renames** — update any code that reads these fields from API responses:
553
+
554
+ | Collection | Old | New |
555
+ |---|---|---|
556
+ | Customers | `socialId` | `providerUserId` |
557
+ | Customers | `isVerified` | `isEmailVerified` |
558
+ | Customers | `loginAttempts` | `loginAttemptCount` |
559
+ | Customers | `resetPasswordExpiry` | `resetPasswordExpiresAt` |
560
+ | Orders, Carts | `shippingFee` | `shippingAmount` |
561
+ | Carts | `itemsTotal` | `subtotalAmount` |
562
+ | Transactions | `paymentId` | `pgPaymentId` |
563
+ | Discounts | `type` | `discountType` |
564
+ | Discounts | `value` | `discountValue` |
565
+ | Discounts | `usageLimit` | `maxUses` |
566
+ | Discounts | `usageCount` | `usesCount` |
567
+ | Discounts | `perCustomerLimit` | `maxUsesPerCustomer` |
568
+ | ShippingPolicies | `baseFee` | `baseAmount` |
569
+ | ShippingPolicies | `freeShippingThreshold` | `freeShippingMinAmount` |
570
+ | Documents | `effectiveDate` | `effectiveAt` |
571
+ | Documents | `expiryDate` | `expiresAt` |
572
+ | Posts | `readTime` | `readingMinutes` |
573
+ | ApiUsage | `count` | `apiCallCount` |
574
+ | ApiUsage | `storageUsed` | `storageUsedBytes` |
575
+ | ApiUsage | `totalDocuments` | `documentCount` |
576
+
577
+ **Collection renames:**
578
+ - `order-products` → `order-items`
579
+ - `return-products` → `return-items`
580
+ - Removed: `exchanges`, `exchange-products`
581
+ - Added: `product-option-values`
582
+
583
+ **Boolean field renames** (6 collections):
584
+ - `status: 'active' | 'inactive'` → `isActive: boolean` on Musics, Forms, PostAuthors, CustomerGroups, ShippingPolicies, ProductVariants
package/dist/auth.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import './payload-types-CFDtFiSz.cjs';
1
+ import './payload-types-FfZ2Zxp1.cjs';
2
2
 
3
3
  interface JwtPayload {
4
4
  clientKey: string;
package/dist/auth.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import './payload-types-CFDtFiSz.js';
1
+ import './payload-types-FfZ2Zxp1.js';
2
2
 
3
3
  interface JwtPayload {
4
4
  clientKey: string;
@@ -0,0 +1,19 @@
1
+ import { C as Config } from './payload-types-FfZ2Zxp1.js';
2
+
3
+ /**
4
+ * Collection type derived from Payload Config.
5
+ * This ensures type safety and automatic synchronization with payload-types.ts
6
+ */
7
+ type Collection = keyof Config['collections'];
8
+ /**
9
+ * Array of all public collection names for runtime use (e.g., Zod enum validation).
10
+ * This is the single source of truth for which collections are publicly accessible via SDK.
11
+ */
12
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "musics", "music-categories", "music-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
13
+ /**
14
+ * Public collections available for SDK access.
15
+ * Derived from the COLLECTIONS array (single source of truth).
16
+ */
17
+ type PublicCollection = (typeof COLLECTIONS)[number];
18
+
19
+ export { type Collection as C, type PublicCollection as P, COLLECTIONS as a };
@@ -0,0 +1,19 @@
1
+ import { C as Config } from './payload-types-FfZ2Zxp1.cjs';
2
+
3
+ /**
4
+ * Collection type derived from Payload Config.
5
+ * This ensures type safety and automatic synchronization with payload-types.ts
6
+ */
7
+ type Collection = keyof Config['collections'];
8
+ /**
9
+ * Array of all public collection names for runtime use (e.g., Zod enum validation).
10
+ * This is the single source of truth for which collections are publicly accessible via SDK.
11
+ */
12
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "musics", "music-categories", "music-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
13
+ /**
14
+ * Public collections available for SDK access.
15
+ * Derived from the COLLECTIONS array (single source of truth).
16
+ */
17
+ type PublicCollection = (typeof COLLECTIONS)[number];
18
+
19
+ export { type Collection as C, type PublicCollection as P, COLLECTIONS as a };
package/dist/index.cjs CHANGED
@@ -668,12 +668,6 @@ var OrderApi = class extends BaseApi {
668
668
  params
669
669
  );
670
670
  }
671
- createExchange(params) {
672
- return this.request("/api/exchanges/create", params);
673
- }
674
- updateExchange(params) {
675
- return this.request("/api/exchanges/update", params);
676
- }
677
671
  };
678
672
 
679
673
  // src/core/api/cart-api.ts
@@ -1214,17 +1208,16 @@ var COLLECTIONS = [
1214
1208
  "products",
1215
1209
  "product-variants",
1216
1210
  "product-options",
1211
+ "product-option-values",
1217
1212
  "product-categories",
1218
1213
  "product-tags",
1219
1214
  "product-collections",
1220
1215
  "brands",
1221
1216
  "brand-logos",
1222
1217
  "orders",
1223
- "order-products",
1218
+ "order-items",
1224
1219
  "returns",
1225
- "return-products",
1226
- "exchanges",
1227
- "exchange-products",
1220
+ "return-items",
1228
1221
  "fulfillments",
1229
1222
  "fulfillment-items",
1230
1223
  "transactions",
@@ -1345,32 +1338,32 @@ var CommunityClient = class {
1345
1338
  }
1346
1339
  // Comments
1347
1340
  createComment(params) {
1348
- const { threadId, parentId, content } = params;
1349
- const body = { thread: threadId, content };
1341
+ const { threadId, parentId, body: commentBody } = params;
1342
+ const body = { thread: threadId, body: commentBody };
1350
1343
  if (parentId !== void 0) {
1351
1344
  body.parent = parentId;
1352
1345
  }
1353
1346
  return this.execute("/api/comments", "POST", body);
1354
1347
  }
1355
1348
  listComments(params) {
1356
- const { threadId, page, limit, rootId } = params;
1349
+ const { threadId, page, limit, rootComment } = params;
1357
1350
  const urlParams = new URLSearchParams();
1358
1351
  urlParams.set("where[thread][equals]", threadId);
1359
1352
  urlParams.set("sort", "-createdAt");
1360
1353
  if (limit !== void 0) urlParams.set("limit", String(limit));
1361
1354
  if (page !== void 0) urlParams.set("page", String(page));
1362
- if (rootId !== void 0) urlParams.set("where[rootId][equals]", rootId);
1355
+ if (rootComment !== void 0) urlParams.set("where[rootComment][equals]", rootComment);
1363
1356
  return this.execute(
1364
1357
  `/api/comments?${urlParams.toString()}`,
1365
1358
  "GET"
1366
1359
  );
1367
1360
  }
1368
1361
  updateComment(params) {
1369
- const { commentId, content } = params;
1362
+ const { commentId, body } = params;
1370
1363
  return this.execute(
1371
1364
  `/api/comments/${commentId}`,
1372
1365
  "PATCH",
1373
- { content }
1366
+ { body }
1374
1367
  );
1375
1368
  }
1376
1369
  deleteComment(params) {