@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/realtime.d.cts
CHANGED
|
@@ -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-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-CEiFBZMW.cjs';
|
|
4
|
+
import './payload-types-BF8VVFt6.cjs';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
package/dist/realtime.d.ts
CHANGED
|
@@ -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-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-R3AyqOHY.js';
|
|
4
|
+
import './payload-types-BF8VVFt6.js';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BF8VVFt6.cjs';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
6
|
+
import { C as CollectionType } from './types-lPRgx_rC.cjs';
|
|
7
|
+
import { P as PublicCollection, S as ServerCollection } from './const-CEiFBZMW.cjs';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BF8VVFt6.js';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
6
|
+
import { C as CollectionType } from './types-CZ1laT6s.js';
|
|
7
|
+
import { P as PublicCollection, S as ServerCollection } from './const-R3AyqOHY.js';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
package/dist/server.cjs
CHANGED
|
@@ -385,14 +385,23 @@ function debugLog(debug, type, message, data) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
function getErrorSuggestion(status) {
|
|
388
|
-
if (status === 400)
|
|
388
|
+
if (status === 400)
|
|
389
|
+
return "The request data failed validation. Check field values and types.";
|
|
389
390
|
if (status === 401) return "Please check your authentication credentials.";
|
|
390
|
-
if (status === 403)
|
|
391
|
+
if (status === 403)
|
|
392
|
+
return "Access denied. Check your credentials or permissions.";
|
|
391
393
|
if (status === 404) return "The requested resource was not found.";
|
|
392
394
|
if (status === 422) return "The request data failed validation.";
|
|
393
395
|
if (status >= 500) return "A server error occurred. Please try again later.";
|
|
394
396
|
return void 0;
|
|
395
397
|
}
|
|
398
|
+
function isUsageLimitExceededResponse(response) {
|
|
399
|
+
if (response.status !== 429) return false;
|
|
400
|
+
const limit = parseInt(response.headers.get("X-Usage-Limit") || "", 10);
|
|
401
|
+
const current = parseInt(response.headers.get("X-Usage-Current") || "", 10);
|
|
402
|
+
if (!Number.isFinite(limit) || !Number.isFinite(current)) return false;
|
|
403
|
+
return response.headers.get("X-Usage-Exceeded") === "true" || current > limit;
|
|
404
|
+
}
|
|
396
405
|
async function parseErrorBody(response) {
|
|
397
406
|
const fallback = {
|
|
398
407
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
@@ -592,7 +601,7 @@ async function httpFetch(url, options) {
|
|
|
592
601
|
headers: Object.fromEntries(response.headers.entries())
|
|
593
602
|
});
|
|
594
603
|
if (!response.ok) {
|
|
595
|
-
if (response
|
|
604
|
+
if (isUsageLimitExceededResponse(response)) {
|
|
596
605
|
const limit = parseInt(
|
|
597
606
|
response.headers.get("X-Usage-Limit") || "0",
|
|
598
607
|
10
|
|
@@ -609,7 +618,11 @@ async function httpFetch(url, options) {
|
|
|
609
618
|
createUsageLimitError(
|
|
610
619
|
`Monthly API usage limit exceeded (${current.toLocaleString()}/${limit.toLocaleString()})`,
|
|
611
620
|
{ limit, current, remaining },
|
|
612
|
-
{
|
|
621
|
+
{
|
|
622
|
+
url,
|
|
623
|
+
method: requestInit.method || "GET",
|
|
624
|
+
attempt: attempt + 1
|
|
625
|
+
},
|
|
613
626
|
"Monthly API call limit exceeded. Please upgrade your plan.",
|
|
614
627
|
"Upgrade your tenant plan to increase the monthly API call limit."
|
|
615
628
|
),
|