@01.software/sdk 0.2.9-dev.260309.c56872d → 0.2.9-dev.260310.cf511cb
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-BieKA-OQ.d.ts → auth-CVVo5UT5.d.ts} +1 -1
- package/dist/{auth-CAV8xgZk.d.cts → auth-CqgrT1qd.d.cts} +1 -1
- package/dist/auth.d.cts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/index.cjs +38 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -13
- package/dist/index.d.ts +10 -13
- package/dist/index.js +38 -27
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-2wbfaDxp.d.cts → payload-types-Cq93wqIe.d.cts} +967 -69
- package/dist/{payload-types-2wbfaDxp.d.ts → payload-types-Cq93wqIe.d.ts} +967 -69
- package/dist/{webhook-Byzl1A0g.d.cts → webhook-C_7s0K66.d.ts} +2 -2
- package/dist/{webhook-I6ZDGW1d.d.ts → webhook-NRdVwXN7.d.cts} +2 -2
- package/dist/webhook.d.cts +2 -2
- package/dist/webhook.d.ts +2 -2
- package/package.json +21 -23
package/dist/auth.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { J as JwtPayload, t as createApiKey, r as createServerToken, s as decodeServerToken, u as parseApiKey, v as verifyServerToken } from './auth-
|
|
1
|
+
export { J as JwtPayload, t as createApiKey, r as createServerToken, s as decodeServerToken, u as parseApiKey, v as verifyServerToken } from './auth-CqgrT1qd.cjs';
|
|
2
2
|
import 'payload';
|
|
3
|
-
import './payload-types-
|
|
3
|
+
import './payload-types-Cq93wqIe.cjs';
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { J as JwtPayload, t as createApiKey, r as createServerToken, s as decodeServerToken, u as parseApiKey, v as verifyServerToken } from './auth-
|
|
1
|
+
export { J as JwtPayload, t as createApiKey, r as createServerToken, s as decodeServerToken, u as parseApiKey, v as verifyServerToken } from './auth-CVVo5UT5.js';
|
|
2
2
|
import 'payload';
|
|
3
|
-
import './payload-types-
|
|
3
|
+
import './payload-types-Cq93wqIe.js';
|
package/dist/components.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { CSSProperties, JSX } from 'react';
|
|
|
2
2
|
import { SerializedLinkNode, SerializedBlockNode } from '@payloadcms/richtext-lexical';
|
|
3
3
|
import { SerializedEditorState, SerializedLexicalNode } from '@payloadcms/richtext-lexical/lexical';
|
|
4
4
|
import { JSXConverters, JSXConverter } from '@payloadcms/richtext-lexical/react';
|
|
5
|
-
import { F as Form } from './payload-types-
|
|
5
|
+
import { F as Form } from './payload-types-Cq93wqIe.cjs';
|
|
6
6
|
import { I as ImageData } from './image-TT8lTsk5.cjs';
|
|
7
7
|
import { BundledTheme } from 'shiki';
|
|
8
8
|
export { BundledTheme } from 'shiki';
|
package/dist/components.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { CSSProperties, JSX } from 'react';
|
|
|
2
2
|
import { SerializedLinkNode, SerializedBlockNode } from '@payloadcms/richtext-lexical';
|
|
3
3
|
import { SerializedEditorState, SerializedLexicalNode } from '@payloadcms/richtext-lexical/lexical';
|
|
4
4
|
import { JSXConverters, JSXConverter } from '@payloadcms/richtext-lexical/react';
|
|
5
|
-
import { F as Form } from './payload-types-
|
|
5
|
+
import { F as Form } from './payload-types-Cq93wqIe.js';
|
|
6
6
|
import { I as ImageData } from './image-TT8lTsk5.js';
|
|
7
7
|
import { BundledTheme } from 'shiki';
|
|
8
8
|
export { BundledTheme } from 'shiki';
|
package/dist/index.cjs
CHANGED
|
@@ -84,6 +84,7 @@ __export(src_exports, {
|
|
|
84
84
|
OrderApi: () => OrderApi,
|
|
85
85
|
ProductApi: () => ProductApi,
|
|
86
86
|
QueryHooks: () => QueryHooks,
|
|
87
|
+
SDKError: () => SDKError,
|
|
87
88
|
ServerClient: () => ServerClient,
|
|
88
89
|
ServiceUnavailableError: () => ServiceUnavailableError,
|
|
89
90
|
TimeoutError: () => TimeoutError,
|
|
@@ -121,7 +122,6 @@ __export(src_exports, {
|
|
|
121
122
|
isUsageLimitError: () => isUsageLimitError,
|
|
122
123
|
isValidWebhookEvent: () => isValidWebhookEvent,
|
|
123
124
|
isValidationError: () => isValidationError,
|
|
124
|
-
objectFor: () => objectFor,
|
|
125
125
|
parseApiKey: () => parseApiKey,
|
|
126
126
|
resolveRelation: () => resolveRelation,
|
|
127
127
|
verifyServerToken: () => verifyServerToken
|
|
@@ -770,42 +770,44 @@ var ProductApi = class {
|
|
|
770
770
|
|
|
771
771
|
// src/utils/types.ts
|
|
772
772
|
var resolveRelation = (ref) => {
|
|
773
|
-
if (typeof ref === "string" || ref === null || ref === void 0)
|
|
773
|
+
if (typeof ref === "string" || typeof ref === "number" || ref === null || ref === void 0)
|
|
774
774
|
return null;
|
|
775
775
|
return ref;
|
|
776
776
|
};
|
|
777
|
-
var objectFor = resolveRelation;
|
|
778
777
|
|
|
779
778
|
// src/core/metadata/index.ts
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
playlists: { description: "description", image: "image" }
|
|
785
|
-
};
|
|
786
|
-
var DEFAULT_META_FIELDS = { description: "description", image: "thumbnail" };
|
|
787
|
-
function extractMetaFields(collection, doc) {
|
|
788
|
-
var _a, _b, _c, _d;
|
|
789
|
-
const mapping = (_a = COLLECTION_META_FIELDS[collection]) != null ? _a : DEFAULT_META_FIELDS;
|
|
779
|
+
function extractSeo(doc) {
|
|
780
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
781
|
+
const seo = (_a = doc.seo) != null ? _a : {};
|
|
782
|
+
const og = (_b = seo.openGraph) != null ? _b : {};
|
|
790
783
|
return {
|
|
791
|
-
title: (
|
|
792
|
-
description:
|
|
793
|
-
|
|
784
|
+
title: (_d = (_c = seo.title) != null ? _c : doc.title) != null ? _d : null,
|
|
785
|
+
description: (_e = seo.description) != null ? _e : null,
|
|
786
|
+
noIndex: (_f = seo.noIndex) != null ? _f : null,
|
|
787
|
+
canonical: (_g = seo.canonical) != null ? _g : null,
|
|
788
|
+
openGraph: {
|
|
789
|
+
title: (_h = og.title) != null ? _h : null,
|
|
790
|
+
description: (_i = og.description) != null ? _i : null,
|
|
791
|
+
image: (_j = og.image) != null ? _j : null
|
|
792
|
+
}
|
|
794
793
|
};
|
|
795
794
|
}
|
|
796
795
|
function generateMetadata(input, options) {
|
|
797
|
-
var _a, _b, _c, _d;
|
|
798
|
-
const title = (
|
|
799
|
-
const description = (
|
|
800
|
-
const
|
|
801
|
-
|
|
796
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
797
|
+
const title = (_a = input.title) != null ? _a : void 0;
|
|
798
|
+
const description = (_b = input.description) != null ? _b : void 0;
|
|
799
|
+
const ogTitle = (_d = (_c = input.openGraph) == null ? void 0 : _c.title) != null ? _d : title;
|
|
800
|
+
const ogDescription = (_f = (_e = input.openGraph) == null ? void 0 : _e.description) != null ? _f : description;
|
|
801
|
+
const image = resolveMetaImage((_g = input.openGraph) == null ? void 0 : _g.image);
|
|
802
|
+
return __spreadProps(__spreadValues(__spreadValues({
|
|
802
803
|
title,
|
|
803
|
-
description
|
|
804
|
-
|
|
804
|
+
description
|
|
805
|
+
}, input.noIndex && { robots: { index: false, follow: false } }), input.canonical && { alternates: { canonical: input.canonical } }), {
|
|
806
|
+
openGraph: __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, ogTitle && { title: ogTitle }), ogDescription && { description: ogDescription }), (options == null ? void 0 : options.siteName) && { siteName: options.siteName }), image && { images: [image] }),
|
|
805
807
|
twitter: __spreadValues(__spreadValues(__spreadValues({
|
|
806
808
|
card: image ? "summary_large_image" : "summary"
|
|
807
|
-
},
|
|
808
|
-
};
|
|
809
|
+
}, ogTitle && { title: ogTitle }), ogDescription && { description: ogDescription }), image && { images: [image.url] })
|
|
810
|
+
});
|
|
809
811
|
}
|
|
810
812
|
function resolveMetaImage(ref) {
|
|
811
813
|
var _a;
|
|
@@ -915,7 +917,7 @@ var CollectionQueryBuilder = class {
|
|
|
915
917
|
const doc = docs[0];
|
|
916
918
|
if (!doc) return null;
|
|
917
919
|
return generateMetadata(
|
|
918
|
-
|
|
920
|
+
extractSeo(doc),
|
|
919
921
|
metadataOptions
|
|
920
922
|
);
|
|
921
923
|
});
|
|
@@ -929,7 +931,7 @@ var CollectionQueryBuilder = class {
|
|
|
929
931
|
return __async(this, null, function* () {
|
|
930
932
|
const doc = yield this.findById(id, { depth: 1 });
|
|
931
933
|
return generateMetadata(
|
|
932
|
-
|
|
934
|
+
extractSeo(doc),
|
|
933
935
|
metadataOptions
|
|
934
936
|
);
|
|
935
937
|
});
|
|
@@ -1037,6 +1039,7 @@ var HttpClient = class {
|
|
|
1037
1039
|
nextPage: (_b = jsonData.nextPage) != null ? _b : null
|
|
1038
1040
|
};
|
|
1039
1041
|
} catch (error) {
|
|
1042
|
+
if (error instanceof SDKError) throw error;
|
|
1040
1043
|
throw createApiError("Failed to parse response.", response.status, {
|
|
1041
1044
|
contentType,
|
|
1042
1045
|
error: error instanceof Error ? error.message : error
|
|
@@ -1063,6 +1066,7 @@ var HttpClient = class {
|
|
|
1063
1066
|
errors: jsonData.errors
|
|
1064
1067
|
};
|
|
1065
1068
|
} catch (error) {
|
|
1069
|
+
if (error instanceof SDKError) throw error;
|
|
1066
1070
|
throw createApiError("Failed to parse response.", response.status, {
|
|
1067
1071
|
contentType,
|
|
1068
1072
|
error: error instanceof Error ? error.message : error
|
|
@@ -1082,6 +1086,7 @@ var HttpClient = class {
|
|
|
1082
1086
|
const jsonData = yield response.json();
|
|
1083
1087
|
return jsonData;
|
|
1084
1088
|
} catch (error) {
|
|
1089
|
+
if (error instanceof SDKError) throw error;
|
|
1085
1090
|
throw createApiError("Failed to parse response.", response.status, {
|
|
1086
1091
|
contentType,
|
|
1087
1092
|
error: error instanceof Error ? error.message : error
|
|
@@ -1277,15 +1282,21 @@ var COLLECTIONS = [
|
|
|
1277
1282
|
"post-images",
|
|
1278
1283
|
"playlists",
|
|
1279
1284
|
"playlist-images",
|
|
1285
|
+
"playlist-categories",
|
|
1280
1286
|
"musics",
|
|
1281
1287
|
"galleries",
|
|
1282
1288
|
"gallery-images",
|
|
1283
1289
|
"gallery-categories",
|
|
1290
|
+
"gallery-tags",
|
|
1284
1291
|
"flows",
|
|
1285
1292
|
"flow-images",
|
|
1286
1293
|
"flow-node-types",
|
|
1287
1294
|
"flow-edge-types",
|
|
1295
|
+
"flow-tags",
|
|
1288
1296
|
"videos",
|
|
1297
|
+
"video-images",
|
|
1298
|
+
"video-categories",
|
|
1299
|
+
"video-tags",
|
|
1289
1300
|
"live-streams",
|
|
1290
1301
|
"live-stream-images",
|
|
1291
1302
|
"forms",
|