@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
package/dist/server.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-
|
|
2
|
-
import './payload-types-
|
|
1
|
+
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-CZrUwqDs.cjs';
|
|
2
|
+
import './payload-types-BF8VVFt6.cjs';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import 'payload';
|
|
5
5
|
import 'next';
|
|
6
|
-
import './types-
|
|
7
|
-
import './const-
|
|
6
|
+
import './types-lPRgx_rC.cjs';
|
|
7
|
+
import './const-CEiFBZMW.cjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-
|
|
2
|
-
import './payload-types-
|
|
1
|
+
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-DULueNYi.js';
|
|
2
|
+
import './payload-types-BF8VVFt6.js';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import 'payload';
|
|
5
5
|
import 'next';
|
|
6
|
-
import './types-
|
|
7
|
-
import './const-
|
|
6
|
+
import './types-CZ1laT6s.js';
|
|
7
|
+
import './const-R3AyqOHY.js';
|
package/dist/server.js
CHANGED
|
@@ -353,14 +353,23 @@ function debugLog(debug, type, message, data) {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
function getErrorSuggestion(status) {
|
|
356
|
-
if (status === 400)
|
|
356
|
+
if (status === 400)
|
|
357
|
+
return "The request data failed validation. Check field values and types.";
|
|
357
358
|
if (status === 401) return "Please check your authentication credentials.";
|
|
358
|
-
if (status === 403)
|
|
359
|
+
if (status === 403)
|
|
360
|
+
return "Access denied. Check your credentials or permissions.";
|
|
359
361
|
if (status === 404) return "The requested resource was not found.";
|
|
360
362
|
if (status === 422) return "The request data failed validation.";
|
|
361
363
|
if (status >= 500) return "A server error occurred. Please try again later.";
|
|
362
364
|
return void 0;
|
|
363
365
|
}
|
|
366
|
+
function isUsageLimitExceededResponse(response) {
|
|
367
|
+
if (response.status !== 429) return false;
|
|
368
|
+
const limit = parseInt(response.headers.get("X-Usage-Limit") || "", 10);
|
|
369
|
+
const current = parseInt(response.headers.get("X-Usage-Current") || "", 10);
|
|
370
|
+
if (!Number.isFinite(limit) || !Number.isFinite(current)) return false;
|
|
371
|
+
return response.headers.get("X-Usage-Exceeded") === "true" || current > limit;
|
|
372
|
+
}
|
|
364
373
|
async function parseErrorBody(response) {
|
|
365
374
|
const fallback = {
|
|
366
375
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
@@ -560,7 +569,7 @@ async function httpFetch(url, options) {
|
|
|
560
569
|
headers: Object.fromEntries(response.headers.entries())
|
|
561
570
|
});
|
|
562
571
|
if (!response.ok) {
|
|
563
|
-
if (response
|
|
572
|
+
if (isUsageLimitExceededResponse(response)) {
|
|
564
573
|
const limit = parseInt(
|
|
565
574
|
response.headers.get("X-Usage-Limit") || "0",
|
|
566
575
|
10
|
|
@@ -577,7 +586,11 @@ async function httpFetch(url, options) {
|
|
|
577
586
|
createUsageLimitError(
|
|
578
587
|
`Monthly API usage limit exceeded (${current.toLocaleString()}/${limit.toLocaleString()})`,
|
|
579
588
|
{ limit, current, remaining },
|
|
580
|
-
{
|
|
589
|
+
{
|
|
590
|
+
url,
|
|
591
|
+
method: requestInit.method || "GET",
|
|
592
|
+
attempt: attempt + 1
|
|
593
|
+
},
|
|
581
594
|
"Monthly API call limit exceeded. Please upgrade your plan.",
|
|
582
595
|
"Upgrade your tenant plan to increase the monthly API call limit."
|
|
583
596
|
),
|