@01.software/sdk 0.4.1 → 0.4.3-dev.1774320821495
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/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/{const-BsO3aVX_.d.cts → const-BO4SPN7f.d.ts} +2 -2
- package/dist/{const-DZyvV9wU.d.ts → const-hqVXNZoy.d.cts} +2 -2
- package/dist/index.cjs +21 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BsjHfeAF.d.cts → payload-types-mZpmjJBz.d.cts} +128 -4
- package/dist/{payload-types-BsjHfeAF.d.ts → payload-types-mZpmjJBz.d.ts} +128 -4
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +1 -1
- package/dist/ui/flow.cjs +403 -92
- package/dist/ui/flow.cjs.map +1 -1
- package/dist/ui/flow.d.cts +58 -5
- package/dist/ui/flow.d.ts +58 -5
- package/dist/ui/flow.js +398 -87
- package/dist/ui/flow.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/{webhook-BBWl8O2f.d.ts → webhook-CMi4JRCp.d.ts} +3 -3
- package/dist/{webhook-CkL56e65.d.cts → webhook-D65mzWt2.d.cts} +3 -3
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +7 -12
package/dist/auth.d.cts
CHANGED
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Config } from './payload-types-
|
|
1
|
+
import { C as Config } from './payload-types-mZpmjJBz.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -9,7 +9,7 @@ type Collection = keyof Config['collections'];
|
|
|
9
9
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
10
10
|
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
11
11
|
*/
|
|
12
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-products", "returns", "return-products", "exchanges", "exchange-products", "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", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "flows", "flow-node-types", "flow-edge-types", "flow-categories", "flow-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions"];
|
|
12
|
+
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-products", "returns", "return-products", "exchanges", "exchange-products", "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", "flows", "flow-node-types", "flow-edge-types", "flow-categories", "flow-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions"];
|
|
13
13
|
/**
|
|
14
14
|
* Public collections available for SDK access.
|
|
15
15
|
* Derived from the COLLECTIONS array (single source of truth).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Config } from './payload-types-
|
|
1
|
+
import { C as Config } from './payload-types-mZpmjJBz.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -9,7 +9,7 @@ type Collection = keyof Config['collections'];
|
|
|
9
9
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
10
10
|
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
11
11
|
*/
|
|
12
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-products", "returns", "return-products", "exchanges", "exchange-products", "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", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "flows", "flow-node-types", "flow-edge-types", "flow-categories", "flow-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions"];
|
|
12
|
+
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-products", "returns", "return-products", "exchanges", "exchange-products", "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", "flows", "flow-node-types", "flow-edge-types", "flow-categories", "flow-tags", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions"];
|
|
13
13
|
/**
|
|
14
14
|
* Public collections available for SDK access.
|
|
15
15
|
* Derived from the COLLECTIONS array (single source of truth).
|
package/dist/index.cjs
CHANGED
|
@@ -348,13 +348,13 @@ function resolveApiUrl() {
|
|
|
348
348
|
return envUrl.replace(/\/$/, "");
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
return "
|
|
351
|
+
return "http://localhost:3000";
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
// src/core/internal/utils/http.ts
|
|
355
355
|
var DEFAULT_TIMEOUT = 3e4;
|
|
356
356
|
var DEFAULT_RETRYABLE_STATUSES = [408, 429, 500, 502, 503, 504];
|
|
357
|
-
var NON_RETRYABLE_STATUSES = [401, 403, 404, 422];
|
|
357
|
+
var NON_RETRYABLE_STATUSES = [400, 401, 403, 404, 422];
|
|
358
358
|
var SAFE_METHODS = ["GET", "HEAD", "OPTIONS"];
|
|
359
359
|
function debugLog(debug, type, message, data) {
|
|
360
360
|
if (!debug) return;
|
|
@@ -366,6 +366,7 @@ function debugLog(debug, type, message, data) {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function getErrorSuggestion(status) {
|
|
369
|
+
if (status === 400) return "The request data failed validation. Check field values and types.";
|
|
369
370
|
if (status === 401) return "Please check your authentication credentials.";
|
|
370
371
|
if (status === 403) return "Access denied. Check your credentials or permissions.";
|
|
371
372
|
if (status === 404) return "The requested resource was not found.";
|
|
@@ -375,6 +376,7 @@ function getErrorSuggestion(status) {
|
|
|
375
376
|
}
|
|
376
377
|
function parseErrorBody(response) {
|
|
377
378
|
return __async(this, null, function* () {
|
|
379
|
+
var _a;
|
|
378
380
|
const fallback = {
|
|
379
381
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
380
382
|
userMessage: `Request failed (status: ${response.status})`
|
|
@@ -382,14 +384,27 @@ function parseErrorBody(response) {
|
|
|
382
384
|
try {
|
|
383
385
|
const body = yield response.json();
|
|
384
386
|
if (body.errors && Array.isArray(body.errors)) {
|
|
385
|
-
const
|
|
387
|
+
const fieldErrors = [];
|
|
388
|
+
for (const e of body.errors) {
|
|
389
|
+
if (((_a = e.data) == null ? void 0 : _a.errors) && Array.isArray(e.data.errors) && e.data.errors.length > 0) {
|
|
390
|
+
for (const fe of e.data.errors) {
|
|
391
|
+
fieldErrors.push({
|
|
392
|
+
field: fe.path || fe.field,
|
|
393
|
+
message: fe.message
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
} else if (e.field || e.message) {
|
|
397
|
+
fieldErrors.push({ field: e.field, message: e.message });
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
const details = (fieldErrors.length > 0 ? fieldErrors : body.errors).map(
|
|
386
401
|
(e) => e.field ? `${e.field}: ${e.message}` : e.message
|
|
387
402
|
).filter(Boolean).join("; ");
|
|
388
403
|
if (details) {
|
|
389
404
|
return {
|
|
390
405
|
errorMessage: `HTTP ${response.status}: ${details}`,
|
|
391
406
|
userMessage: details,
|
|
392
|
-
errors: body.errors
|
|
407
|
+
errors: fieldErrors.length > 0 ? fieldErrors : body.errors
|
|
393
408
|
};
|
|
394
409
|
}
|
|
395
410
|
}
|
|
@@ -1326,6 +1341,8 @@ var COLLECTIONS = [
|
|
|
1326
1341
|
"playlist-categories",
|
|
1327
1342
|
"playlist-tags",
|
|
1328
1343
|
"musics",
|
|
1344
|
+
"music-categories",
|
|
1345
|
+
"music-tags",
|
|
1329
1346
|
"galleries",
|
|
1330
1347
|
"gallery-categories",
|
|
1331
1348
|
"gallery-tags",
|