@01.software/sdk 0.24.0 → 0.26.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/dist/{const-Cgd4op4V.d.cts → const-CEiFBZMW.d.cts} +2 -2
- package/dist/{const-CMdmNgEs.d.ts → const-R3AyqOHY.d.ts} +2 -2
- package/dist/index.cjs +20 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-D8-G1PiT.d.cts → payload-types-BF8VVFt6.d.cts} +673 -692
- package/dist/{payload-types-D8-G1PiT.d.ts → payload-types-BF8VVFt6.d.ts} +673 -692
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/{server-DJcDyOmM.d.cts → server-CZrUwqDs.d.cts} +3 -3
- package/dist/{server-D7FcHj7J.d.ts → server-DULueNYi.d.ts} +3 -3
- package/dist/server.cjs +17 -4
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +17 -4
- package/dist/server.js.map +1 -1
- package/dist/{types-BQqfXbB2.d.ts → types-CZ1laT6s.d.ts} +1 -1
- package/dist/{types-C_kwEIvY.d.cts → types-lPRgx_rC.d.cts} +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/rich-text.cjs +138 -0
- package/dist/ui/rich-text.cjs.map +1 -1
- package/dist/ui/rich-text.d.cts +23 -1
- package/dist/ui/rich-text.d.ts +23 -1
- package/dist/ui/rich-text.js +138 -0
- package/dist/ui/rich-text.js.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +6 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Config } from './payload-types-
|
|
1
|
+
import { c as Config } from './payload-types-BF8VVFt6.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -9,7 +9,7 @@ type Collection = keyof Config['collections'];
|
|
|
9
9
|
* Internal collections that should not be exposed via SDK.
|
|
10
10
|
* Includes Payload system collections and admin-only collections.
|
|
11
11
|
*/
|
|
12
|
-
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
12
|
+
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "tenant-web-analytics-config", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
13
13
|
type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
|
|
14
14
|
/**
|
|
15
15
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Config } from './payload-types-
|
|
1
|
+
import { c as Config } from './payload-types-BF8VVFt6.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -9,7 +9,7 @@ type Collection = keyof Config['collections'];
|
|
|
9
9
|
* Internal collections that should not be exposed via SDK.
|
|
10
10
|
* Includes Payload system collections and admin-only collections.
|
|
11
11
|
*/
|
|
12
|
-
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
12
|
+
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "tenant-web-analytics-config", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
13
13
|
type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
|
|
14
14
|
/**
|
|
15
15
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
package/dist/index.cjs
CHANGED
|
@@ -574,14 +574,23 @@ function debugLog(debug, type, message, data) {
|
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
function getErrorSuggestion(status) {
|
|
577
|
-
if (status === 400)
|
|
577
|
+
if (status === 400)
|
|
578
|
+
return "The request data failed validation. Check field values and types.";
|
|
578
579
|
if (status === 401) return "Please check your authentication credentials.";
|
|
579
|
-
if (status === 403)
|
|
580
|
+
if (status === 403)
|
|
581
|
+
return "Access denied. Check your credentials or permissions.";
|
|
580
582
|
if (status === 404) return "The requested resource was not found.";
|
|
581
583
|
if (status === 422) return "The request data failed validation.";
|
|
582
584
|
if (status >= 500) return "A server error occurred. Please try again later.";
|
|
583
585
|
return void 0;
|
|
584
586
|
}
|
|
587
|
+
function isUsageLimitExceededResponse(response) {
|
|
588
|
+
if (response.status !== 429) return false;
|
|
589
|
+
const limit = parseInt(response.headers.get("X-Usage-Limit") || "", 10);
|
|
590
|
+
const current = parseInt(response.headers.get("X-Usage-Current") || "", 10);
|
|
591
|
+
if (!Number.isFinite(limit) || !Number.isFinite(current)) return false;
|
|
592
|
+
return response.headers.get("X-Usage-Exceeded") === "true" || current > limit;
|
|
593
|
+
}
|
|
585
594
|
async function parseErrorBody(response) {
|
|
586
595
|
const fallback = {
|
|
587
596
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
@@ -781,7 +790,7 @@ async function httpFetch(url, options) {
|
|
|
781
790
|
headers: Object.fromEntries(response.headers.entries())
|
|
782
791
|
});
|
|
783
792
|
if (!response.ok) {
|
|
784
|
-
if (response
|
|
793
|
+
if (isUsageLimitExceededResponse(response)) {
|
|
785
794
|
const limit = parseInt(
|
|
786
795
|
response.headers.get("X-Usage-Limit") || "0",
|
|
787
796
|
10
|
|
@@ -798,7 +807,11 @@ async function httpFetch(url, options) {
|
|
|
798
807
|
createUsageLimitError(
|
|
799
808
|
`Monthly API usage limit exceeded (${current.toLocaleString()}/${limit.toLocaleString()})`,
|
|
800
809
|
{ limit, current, remaining },
|
|
801
|
-
{
|
|
810
|
+
{
|
|
811
|
+
url,
|
|
812
|
+
method: requestInit.method || "GET",
|
|
813
|
+
attempt: attempt + 1
|
|
814
|
+
},
|
|
802
815
|
"Monthly API call limit exceeded. Please upgrade your plan.",
|
|
803
816
|
"Upgrade your tenant plan to increase the monthly API call limit."
|
|
804
817
|
),
|
|
@@ -1235,6 +1248,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
1235
1248
|
"payload-locked-documents",
|
|
1236
1249
|
"payload-preferences",
|
|
1237
1250
|
"payload-migrations",
|
|
1251
|
+
"payload-folders",
|
|
1238
1252
|
"field-configs",
|
|
1239
1253
|
"system-media",
|
|
1240
1254
|
"track-assets",
|
|
@@ -1242,6 +1256,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
1242
1256
|
"email-logs",
|
|
1243
1257
|
"api-usage",
|
|
1244
1258
|
"tenant-analytics-daily",
|
|
1259
|
+
"tenant-web-analytics-config",
|
|
1245
1260
|
"analytics-event-schemas",
|
|
1246
1261
|
"subscriptions",
|
|
1247
1262
|
"billing-history",
|
|
@@ -1249,6 +1264,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
1249
1264
|
"api-keys",
|
|
1250
1265
|
"personal-access-tokens",
|
|
1251
1266
|
"tenant-entitlements",
|
|
1267
|
+
"tenant-purge-jobs",
|
|
1252
1268
|
"direct-upload-sessions",
|
|
1253
1269
|
"webhook-events",
|
|
1254
1270
|
"webhook-deliveries",
|