@01.software/sdk 0.25.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-C8UhtzLn.d.cts → const-CEiFBZMW.d.cts} +2 -2
- package/dist/{const-Bs-QcTj0.d.ts → const-R3AyqOHY.d.ts} +2 -2
- package/dist/index.cjs +19 -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 +19 -4
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BaK4zCQ8.d.cts → payload-types-BF8VVFt6.d.cts} +618 -692
- package/dist/{payload-types-BaK4zCQ8.d.ts → payload-types-BF8VVFt6.d.ts} +618 -692
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/{server-CkGfBnSx.d.cts → server-CZrUwqDs.d.cts} +3 -3
- package/dist/{server-DQYWLnkt.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-DjaaBExv.d.ts → types-CZ1laT6s.d.ts} +1 -1
- package/dist/{types-BH-YBrFs.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 +8 -7
|
@@ -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", "payload-folders", "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", "payload-folders", "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
|
),
|
|
@@ -1243,6 +1256,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
1243
1256
|
"email-logs",
|
|
1244
1257
|
"api-usage",
|
|
1245
1258
|
"tenant-analytics-daily",
|
|
1259
|
+
"tenant-web-analytics-config",
|
|
1246
1260
|
"analytics-event-schemas",
|
|
1247
1261
|
"subscriptions",
|
|
1248
1262
|
"billing-history",
|
|
@@ -1250,6 +1264,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
1250
1264
|
"api-keys",
|
|
1251
1265
|
"personal-access-tokens",
|
|
1252
1266
|
"tenant-entitlements",
|
|
1267
|
+
"tenant-purge-jobs",
|
|
1253
1268
|
"direct-upload-sessions",
|
|
1254
1269
|
"webhook-events",
|
|
1255
1270
|
"webhook-deliveries",
|