@01.software/sdk 0.37.0 → 0.38.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 (48) hide show
  1. package/README.md +75 -53
  2. package/dist/client.cjs +67 -104
  3. package/dist/client.cjs.map +1 -1
  4. package/dist/client.d.cts +6 -6
  5. package/dist/client.d.ts +6 -6
  6. package/dist/client.js +67 -104
  7. package/dist/client.js.map +1 -1
  8. package/dist/{collection-client-zOmnxwdA.d.cts → collection-client-B0J9wMNE.d.cts} +5 -5
  9. package/dist/{collection-client-DyELGUcL.d.ts → collection-client-BroIWHY1.d.ts} +5 -5
  10. package/dist/const-6XHz_jej.d.ts +32 -0
  11. package/dist/const-B5KT72c7.d.cts +32 -0
  12. package/dist/{index-DRJs7QIh.d.cts → index-BOLQxveo.d.cts} +3 -3
  13. package/dist/{index-DTqoUZk_.d.ts → index-CSwR2HSg.d.ts} +3 -3
  14. package/dist/index.cjs +95 -123
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +9 -9
  17. package/dist/index.d.ts +9 -9
  18. package/dist/index.js +95 -123
  19. package/dist/index.js.map +1 -1
  20. package/dist/{payload-types-CREOjFNT.d.cts → payload-types-m3jjhxk9.d.cts} +418 -106
  21. package/dist/{payload-types-CREOjFNT.d.ts → payload-types-m3jjhxk9.d.ts} +418 -106
  22. package/dist/query.cjs +3 -1035
  23. package/dist/query.cjs.map +1 -1
  24. package/dist/query.d.cts +13 -13
  25. package/dist/query.d.ts +13 -13
  26. package/dist/query.js +3 -1035
  27. package/dist/query.js.map +1 -1
  28. package/dist/realtime.d.cts +2 -2
  29. package/dist/realtime.d.ts +2 -2
  30. package/dist/server.cjs +42 -21
  31. package/dist/server.cjs.map +1 -1
  32. package/dist/server.d.cts +7 -7
  33. package/dist/server.d.ts +7 -7
  34. package/dist/server.js +42 -21
  35. package/dist/server.js.map +1 -1
  36. package/dist/{types-DMvVHdb1.d.ts → types-CIGscmus.d.cts} +1455 -1208
  37. package/dist/{types-CxzWHspI.d.ts → types-Cmrd1ezc.d.ts} +1 -15
  38. package/dist/{types-BkZNhuBh.d.cts → types-D0ubzQw0.d.cts} +1 -15
  39. package/dist/{types-BWMUr3Zw.d.cts → types-D2xYdz4P.d.ts} +1455 -1208
  40. package/dist/ui/form.d.cts +1 -1
  41. package/dist/ui/form.d.ts +1 -1
  42. package/dist/ui/video.d.cts +1 -1
  43. package/dist/ui/video.d.ts +1 -1
  44. package/dist/webhook.d.cts +4 -4
  45. package/dist/webhook.d.ts +4 -4
  46. package/package.json +3 -3
  47. package/dist/const-CK_FPaIn.d.cts +0 -32
  48. package/dist/const-Dqz05oaG.d.ts +0 -32
@@ -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-CK_FPaIn.cjs';
4
- import './payload-types-CREOjFNT.cjs';
3
+ import { P as PublicCollection } from './const-B5KT72c7.cjs';
4
+ import './payload-types-m3jjhxk9.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-Dqz05oaG.js';
4
- import './payload-types-CREOjFNT.js';
3
+ import { P as PublicCollection } from './const-6XHz_jej.js';
4
+ import './payload-types-m3jjhxk9.js';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
package/dist/server.cjs CHANGED
@@ -1256,7 +1256,8 @@ var CommunityClient = class extends CustomerScopedApi {
1256
1256
  const urlParams = new URLSearchParams();
1257
1257
  const sort = params?.sort ?? DEFAULT_POST_LIST_SORT;
1258
1258
  urlParams.set("sort", sort);
1259
- if (params?.limit !== void 0) urlParams.set("limit", String(params.limit));
1259
+ if (params?.limit !== void 0)
1260
+ urlParams.set("limit", String(params.limit));
1260
1261
  if (params?.page !== void 0) urlParams.set("page", String(params.page));
1261
1262
  if (params?.categoryId !== void 0) {
1262
1263
  urlParams.set("where[categories][in]", params.categoryId);
@@ -1264,7 +1265,7 @@ var CommunityClient = class extends CustomerScopedApi {
1264
1265
  if (params?.tagId !== void 0) {
1265
1266
  urlParams.set("where[tags][in]", params.tagId);
1266
1267
  }
1267
- return `/api/posts?${urlParams.toString()}`;
1268
+ return `/api/posts/public?${urlParams.toString()}`;
1268
1269
  }
1269
1270
  buildCommentsListQuery(params) {
1270
1271
  const urlParams = new URLSearchParams();
@@ -1284,7 +1285,7 @@ var CommunityClient = class extends CustomerScopedApi {
1284
1285
  }
1285
1286
  if (params.limit !== void 0) urlParams.set("limit", String(params.limit));
1286
1287
  if (params.page !== void 0) urlParams.set("page", String(params.page));
1287
- return `/api/comments?${urlParams.toString()}`;
1288
+ return `/api/comments/public?${urlParams.toString()}`;
1288
1289
  }
1289
1290
  async execute(endpoint, method, body) {
1290
1291
  return this.request(endpoint, { method, body });
@@ -1294,7 +1295,11 @@ var CommunityClient = class extends CustomerScopedApi {
1294
1295
  return unwrapPayloadDoc(response);
1295
1296
  }
1296
1297
  createPost(params) {
1297
- return this.executeDoc("/api/posts", "POST", params);
1298
+ return this.executeDoc(
1299
+ "/api/posts",
1300
+ "POST",
1301
+ params
1302
+ );
1298
1303
  }
1299
1304
  /**
1300
1305
  * Public post feed. Server applies the same visibility contract as
@@ -1351,7 +1356,11 @@ var CommunityClient = class extends CustomerScopedApi {
1351
1356
  if (parentId !== void 0) {
1352
1357
  body.parent = parentId;
1353
1358
  }
1354
- return this.executeDoc("/api/comments", "POST", body);
1359
+ return this.executeDoc(
1360
+ "/api/comments",
1361
+ "POST",
1362
+ body
1363
+ );
1355
1364
  }
1356
1365
  /**
1357
1366
  * List comments for a post.
@@ -1420,10 +1429,14 @@ var CommunityClient = class extends CustomerScopedApi {
1420
1429
  400
1421
1430
  );
1422
1431
  }
1423
- return this.executeDoc("/api/reactions", "POST", {
1424
- post: postId,
1425
- type: reactionType
1426
- });
1432
+ return this.executeDoc(
1433
+ "/api/reactions",
1434
+ "POST",
1435
+ {
1436
+ post: postId,
1437
+ type: reactionType
1438
+ }
1439
+ );
1427
1440
  }
1428
1441
  removeReaction(params) {
1429
1442
  const { postId, type } = params;
@@ -1442,10 +1455,14 @@ var CommunityClient = class extends CustomerScopedApi {
1442
1455
  400
1443
1456
  );
1444
1457
  }
1445
- return this.executeDoc("/api/reactions", "POST", {
1446
- comment: commentId,
1447
- type: reactionType
1448
- });
1458
+ return this.executeDoc(
1459
+ "/api/reactions",
1460
+ "POST",
1461
+ {
1462
+ comment: commentId,
1463
+ type: reactionType
1464
+ }
1465
+ );
1449
1466
  }
1450
1467
  removeCommentReaction(params) {
1451
1468
  const { commentId, type } = params;
@@ -1474,9 +1491,13 @@ var CommunityClient = class extends CustomerScopedApi {
1474
1491
  }
1475
1492
  // Bookmarks
1476
1493
  addBookmark(params) {
1477
- return this.executeDoc("/api/bookmarks", "POST", {
1478
- post: params.postId
1479
- });
1494
+ return this.executeDoc(
1495
+ "/api/bookmarks",
1496
+ "POST",
1497
+ {
1498
+ post: params.postId
1499
+ }
1500
+ );
1480
1501
  }
1481
1502
  removeBookmark(params) {
1482
1503
  return this.execute(
@@ -1492,10 +1513,7 @@ var CommunityClient = class extends CustomerScopedApi {
1492
1513
  }
1493
1514
  // Profiles
1494
1515
  listProfileLists(params) {
1495
- return this.execute(
1496
- `/api/customer-profile-lists${this.buildQuery(params)}`,
1497
- "GET"
1498
- );
1516
+ return this.execute(`/api/customer-profile-lists${this.buildQuery(params)}`, "GET");
1499
1517
  }
1500
1518
  async getProfileList(params) {
1501
1519
  const query = "slug" in params ? `?where[slug][equals]=${encodeURIComponent(params.slug)}&limit=1` : `?where[id][equals]=${encodeURIComponent(params.id)}&limit=1`;
@@ -1577,7 +1595,10 @@ var CartApi = class extends CustomerScopedApi {
1577
1595
  return this.request(endpoint, { method, body });
1578
1596
  }
1579
1597
  getCart(cartId) {
1580
- return this.execute(`/api/carts/${cartId}`, "GET");
1598
+ return this.execute(
1599
+ `/api/carts/${cartId}?depth=0&joins=false`,
1600
+ "GET"
1601
+ );
1581
1602
  }
1582
1603
  addItem(params) {
1583
1604
  return this.execute("/api/carts/add-item", "POST", params);