@01.software/sdk 0.4.1 → 0.4.3-dev.260324.6dc30aa
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.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/{const-BsO3aVX_.d.cts → const-BO4SPN7f.d.ts} +2 -2
- package/dist/{const-DZyvV9wU.d.ts → const-hqVXNZoy.d.cts} +2 -2
- package/dist/index.cjs +21 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BsjHfeAF.d.cts → payload-types-mZpmjJBz.d.cts} +128 -4
- package/dist/{payload-types-BsjHfeAF.d.ts → payload-types-mZpmjJBz.d.ts} +128 -4
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +1 -1
- package/dist/ui/flow.cjs +338 -88
- package/dist/ui/flow.cjs.map +1 -1
- package/dist/ui/flow.d.cts +50 -5
- package/dist/ui/flow.d.ts +50 -5
- package/dist/ui/flow.js +333 -83
- package/dist/ui/flow.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/{webhook-BBWl8O2f.d.ts → webhook-CMi4JRCp.d.ts} +3 -3
- package/dist/{webhook-CkL56e65.d.cts → webhook-D65mzWt2.d.cts} +3 -3
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +6 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export { o as ApiUsage,
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-mZpmjJBz.cjs';
|
|
2
|
+
export { o as ApiUsage, au as ApiUsageSelect, A as Audience, aq as AudiencesSelect, bs as Auth, q as BillingHistory, aw as BillingHistorySelect, y as Brand, B as BrandLogo, aF as BrandLogosSelect, aE as BrandsSelect, aV as CartItemsSelect, aU as CartsSelect, g as CodeBlock, br as CollectionsWidget, C as Config, G as Customer, J as CustomerAddress, aS as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, aT as CustomerGroupsSelect, aR as CustomersSelect, W as Discount, aW as DiscountsSelect, $ as Document, b0 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, b1 as DocumentTypesSelect, a$ as DocumentsSelect, m as EmailLog, ar as EmailLogsSelect, N as ExchangeProduct, aP as ExchangeProductsSelect, aO as ExchangesSelect, j as FieldConfig, an as FieldConfigsSelect, ac as Flow, bf as FlowCategoriesSelect, ad as FlowCategory, ag as FlowEdgeType, be as FlowEdgeTypesSelect, af as FlowNodeType, bd as FlowNodeTypesSelect, ae as FlowTag, bg as FlowTagsSelect, bc as FlowsSelect, F as Form, ah as FormSubmission, bm as FormSubmissionsSelect, bl as FormsSelect, K as FulfillmentItem, aL as FulfillmentItemsSelect, aK as FulfillmentsSelect, b8 as GalleriesSelect, a8 as Gallery, b9 as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bb as GalleryItemsSelect, aa as GalleryTag, ba as GalleryTagsSelect, I as IframeBlock, k as Image, ao as ImagesSelect, L as LiveStream, bk as LiveStreamsSelect, a5 as Music, b6 as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, b7 as MusicTagsSelect, b5 as MusicsSelect, aH as OrderProductsSelect, Q as OrderStatusLog, aJ as OrderStatusLogsSelect, aG as OrdersSelect, ai as PayloadKv, bn as PayloadKvSelect, aj as PayloadLockedDocument, bo as PayloadLockedDocumentsSelect, al as PayloadMigration, bq as PayloadMigrationsSelect, ak as PayloadPreference, bp as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, b3 as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, b4 as PlaylistTagsSelect, b2 as PlaylistsSelect, X as Post, Y as PostAuthor, aY as PostAuthorsSelect, aZ as PostCategoriesSelect, Z as PostCategory, _ as PostTag, a_ as PostTagsSelect, aX as PostsSelect, aB as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aD as ProductCollectionsSelect, v as ProductOption, aA as ProductOptionsSelect, x as ProductTag, aC as ProductTagsSelect, u as ProductVariant, az as ProductVariantsSelect, ay as ProductsSelect, M as ReturnProduct, aN as ReturnProductsSelect, aM as ReturnsSelect, aQ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, av as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, ap as SystemMediaSelect, i as Tenant, r as TenantLogo, ax as TenantLogosSelect, at as TenantMetadataSelect, n as TenantMetadatum, as as TenantsSelect, aI as TransactionsSelect, h as User, U as UserAuthOperations, am as UsersSelect, V as Video, bi as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bj as VideoTagsSelect, bh as VideosSelect } from './payload-types-mZpmjJBz.cjs';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as PublicCollection } from './const-BsO3aVX_.cjs';
|
|
7
|
-
export { a as COLLECTIONS, C as Collection } from './const-BsO3aVX_.cjs';
|
|
8
6
|
import { Metadata } from 'next';
|
|
9
|
-
import {
|
|
10
|
-
export { a as
|
|
7
|
+
import { P as PublicCollection } from './const-hqVXNZoy.cjs';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-hqVXNZoy.cjs';
|
|
9
|
+
import { C as CollectionType } from './webhook-D65mzWt2.cjs';
|
|
10
|
+
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-D65mzWt2.cjs';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-DupPIYx-.cjs';
|
|
12
12
|
export { b as IMAGE_SIZES, I as ImageData, a as ImagePalette, f as ImagePlaceholderOptions, d as getImageLqip, e as getImagePalette, h as getImagePlaceholderStyle, c as getImageSrcSet, g as getImageUrl } from './image-TT8lTsk5.cjs';
|
|
13
13
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from './video-DbLL8yuc.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-
|
|
2
|
-
export { o as ApiUsage,
|
|
1
|
+
import { O as Order, a as OrderProduct, T as Transaction, b as Fulfillment, R as Return, E as Exchange, c as Cart, d as CartItem, P as Product } from './payload-types-mZpmjJBz.js';
|
|
2
|
+
export { o as ApiUsage, au as ApiUsageSelect, A as Audience, aq as AudiencesSelect, bs as Auth, q as BillingHistory, aw as BillingHistorySelect, y as Brand, B as BrandLogo, aF as BrandLogosSelect, aE as BrandsSelect, aV as CartItemsSelect, aU as CartsSelect, g as CodeBlock, br as CollectionsWidget, C as Config, G as Customer, J as CustomerAddress, aS as CustomerAddressesSelect, e as CustomerAuthOperations, H as CustomerGroup, aT as CustomerGroupsSelect, aR as CustomersSelect, W as Discount, aW as DiscountsSelect, $ as Document, b0 as DocumentCategoriesSelect, a1 as DocumentCategory, a0 as DocumentType, b1 as DocumentTypesSelect, a$ as DocumentsSelect, m as EmailLog, ar as EmailLogsSelect, N as ExchangeProduct, aP as ExchangeProductsSelect, aO as ExchangesSelect, j as FieldConfig, an as FieldConfigsSelect, ac as Flow, bf as FlowCategoriesSelect, ad as FlowCategory, ag as FlowEdgeType, be as FlowEdgeTypesSelect, af as FlowNodeType, bd as FlowNodeTypesSelect, ae as FlowTag, bg as FlowTagsSelect, bc as FlowsSelect, F as Form, ah as FormSubmission, bm as FormSubmissionsSelect, bl as FormsSelect, K as FulfillmentItem, aL as FulfillmentItemsSelect, aK as FulfillmentsSelect, b8 as GalleriesSelect, a8 as Gallery, b9 as GalleryCategoriesSelect, a9 as GalleryCategory, ab as GalleryItem, bb as GalleryItemsSelect, aa as GalleryTag, ba as GalleryTagsSelect, I as IframeBlock, k as Image, ao as ImagesSelect, L as LiveStream, bk as LiveStreamsSelect, a5 as Music, b6 as MusicCategoriesSelect, a6 as MusicCategory, a7 as MusicTag, b7 as MusicTagsSelect, b5 as MusicsSelect, aH as OrderProductsSelect, Q as OrderStatusLog, aJ as OrderStatusLogsSelect, aG as OrdersSelect, ai as PayloadKv, bn as PayloadKvSelect, aj as PayloadLockedDocument, bo as PayloadLockedDocumentsSelect, al as PayloadMigration, bq as PayloadMigrationsSelect, ak as PayloadPreference, bp as PayloadPreferencesSelect, f as PlayerBlock, a2 as Playlist, b3 as PlaylistCategoriesSelect, a3 as PlaylistCategory, a4 as PlaylistTag, b4 as PlaylistTagsSelect, b2 as PlaylistsSelect, X as Post, Y as PostAuthor, aY as PostAuthorsSelect, aZ as PostCategoriesSelect, Z as PostCategory, _ as PostTag, a_ as PostTagsSelect, aX as PostsSelect, aB as ProductCategoriesSelect, w as ProductCategory, D as ProductCollection, aD as ProductCollectionsSelect, v as ProductOption, aA as ProductOptionsSelect, x as ProductTag, aC as ProductTagsSelect, u as ProductVariant, az as ProductVariantsSelect, ay as ProductsSelect, M as ReturnProduct, aN as ReturnProductsSelect, aM as ReturnsSelect, aQ as ShippingPoliciesSelect, z as ShippingPolicy, p as Subscription, av as SubscriptionsSelect, S as SupportedTimezones, l as SystemMedia, ap as SystemMediaSelect, i as Tenant, r as TenantLogo, ax as TenantLogosSelect, at as TenantMetadataSelect, n as TenantMetadatum, as as TenantsSelect, aI as TransactionsSelect, h as User, U as UserAuthOperations, am as UsersSelect, V as Video, bi as VideoCategoriesSelect, s as VideoCategory, t as VideoTag, bj as VideoTagsSelect, bh as VideosSelect } from './payload-types-mZpmjJBz.js';
|
|
3
3
|
import { Sort, Where } from 'payload';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as PublicCollection } from './const-DZyvV9wU.js';
|
|
7
|
-
export { a as COLLECTIONS, C as Collection } from './const-DZyvV9wU.js';
|
|
8
6
|
import { Metadata } from 'next';
|
|
9
|
-
import {
|
|
10
|
-
export { a as
|
|
7
|
+
import { P as PublicCollection } from './const-BO4SPN7f.js';
|
|
8
|
+
export { a as COLLECTIONS, C as Collection } from './const-BO4SPN7f.js';
|
|
9
|
+
import { C as CollectionType } from './webhook-CMi4JRCp.js';
|
|
10
|
+
export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-CMi4JRCp.js';
|
|
11
11
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-DupPIYx-.js';
|
|
12
12
|
export { b as IMAGE_SIZES, I as ImageData, a as ImagePalette, f as ImagePlaceholderOptions, d as getImageLqip, e as getImagePalette, h as getImagePlaceholderStyle, c as getImageSrcSet, g as getImageUrl } from './image-TT8lTsk5.js';
|
|
13
13
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from './video-DbLL8yuc.js';
|
package/dist/index.js
CHANGED
|
@@ -267,13 +267,13 @@ function resolveApiUrl() {
|
|
|
267
267
|
return envUrl.replace(/\/$/, "");
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
return "https://api.01.software";
|
|
270
|
+
return "https://api-dev.01.software";
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
// src/core/internal/utils/http.ts
|
|
274
274
|
var DEFAULT_TIMEOUT = 3e4;
|
|
275
275
|
var DEFAULT_RETRYABLE_STATUSES = [408, 429, 500, 502, 503, 504];
|
|
276
|
-
var NON_RETRYABLE_STATUSES = [401, 403, 404, 422];
|
|
276
|
+
var NON_RETRYABLE_STATUSES = [400, 401, 403, 404, 422];
|
|
277
277
|
var SAFE_METHODS = ["GET", "HEAD", "OPTIONS"];
|
|
278
278
|
function debugLog(debug, type, message, data) {
|
|
279
279
|
if (!debug) return;
|
|
@@ -285,6 +285,7 @@ function debugLog(debug, type, message, data) {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
function getErrorSuggestion(status) {
|
|
288
|
+
if (status === 400) return "The request data failed validation. Check field values and types.";
|
|
288
289
|
if (status === 401) return "Please check your authentication credentials.";
|
|
289
290
|
if (status === 403) return "Access denied. Check your credentials or permissions.";
|
|
290
291
|
if (status === 404) return "The requested resource was not found.";
|
|
@@ -294,6 +295,7 @@ function getErrorSuggestion(status) {
|
|
|
294
295
|
}
|
|
295
296
|
function parseErrorBody(response) {
|
|
296
297
|
return __async(this, null, function* () {
|
|
298
|
+
var _a;
|
|
297
299
|
const fallback = {
|
|
298
300
|
errorMessage: `HTTP ${response.status}: ${response.statusText}`,
|
|
299
301
|
userMessage: `Request failed (status: ${response.status})`
|
|
@@ -301,14 +303,27 @@ function parseErrorBody(response) {
|
|
|
301
303
|
try {
|
|
302
304
|
const body = yield response.json();
|
|
303
305
|
if (body.errors && Array.isArray(body.errors)) {
|
|
304
|
-
const
|
|
306
|
+
const fieldErrors = [];
|
|
307
|
+
for (const e of body.errors) {
|
|
308
|
+
if (((_a = e.data) == null ? void 0 : _a.errors) && Array.isArray(e.data.errors) && e.data.errors.length > 0) {
|
|
309
|
+
for (const fe of e.data.errors) {
|
|
310
|
+
fieldErrors.push({
|
|
311
|
+
field: fe.path || fe.field,
|
|
312
|
+
message: fe.message
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
} else if (e.field || e.message) {
|
|
316
|
+
fieldErrors.push({ field: e.field, message: e.message });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const details = (fieldErrors.length > 0 ? fieldErrors : body.errors).map(
|
|
305
320
|
(e) => e.field ? `${e.field}: ${e.message}` : e.message
|
|
306
321
|
).filter(Boolean).join("; ");
|
|
307
322
|
if (details) {
|
|
308
323
|
return {
|
|
309
324
|
errorMessage: `HTTP ${response.status}: ${details}`,
|
|
310
325
|
userMessage: details,
|
|
311
|
-
errors: body.errors
|
|
326
|
+
errors: fieldErrors.length > 0 ? fieldErrors : body.errors
|
|
312
327
|
};
|
|
313
328
|
}
|
|
314
329
|
}
|
|
@@ -1245,6 +1260,8 @@ var COLLECTIONS = [
|
|
|
1245
1260
|
"playlist-categories",
|
|
1246
1261
|
"playlist-tags",
|
|
1247
1262
|
"musics",
|
|
1263
|
+
"music-categories",
|
|
1264
|
+
"music-tags",
|
|
1248
1265
|
"galleries",
|
|
1249
1266
|
"gallery-categories",
|
|
1250
1267
|
"gallery-tags",
|