@01.software/sdk 0.73.1 → 0.75.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/CHANGELOG.md +75 -0
- package/README.md +109 -4
- package/dist/client.cjs +59 -14
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +59 -14
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-BH4dIZ6c.d.cts → collection-client-BNC6tUdK.d.cts} +3 -4
- package/dist/{collection-client-lLAl3xCZ.d.ts → collection-client-CNkBMUHj.d.ts} +3 -4
- package/dist/collection-documents-Bl0AF0m0.d.cts +5486 -0
- package/dist/collection-documents-Bl0AF0m0.d.ts +5486 -0
- package/dist/{const-CCvoknRY.d.ts → const-CcOT0taO.d.cts} +1 -3
- package/dist/{const-BS2EaIp4.d.cts → const-CcOT0taO.d.ts} +1 -3
- package/dist/{index-DVqNpmsc.d.ts → index-CQsJvMCN.d.ts} +2 -3
- package/dist/{index-CHdrzJ8-.d.cts → index-CfxkqaY9.d.cts} +2 -3
- package/dist/index.cjs +60 -14
- 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 +60 -14
- package/dist/index.js.map +1 -1
- package/dist/query.cjs +16 -1
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +16 -1
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +1 -2
- package/dist/realtime.d.ts +1 -2
- package/dist/server.cjs +50 -11
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +50 -11
- package/dist/server.js.map +1 -1
- package/dist/{types-lbzbJSZh.d.ts → types-Btxz6NVi.d.ts} +161 -31
- package/dist/types-CQw4HXky.d.ts +151 -0
- package/dist/{types-Chwgg4CQ.d.cts → types-DMwRdJ-4.d.cts} +161 -31
- package/dist/types-Jr4xTiGs.d.cts +151 -0
- package/dist/ui/form.cjs.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/video.cjs.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/ui/video.js.map +1 -1
- package/dist/webhook.d.cts +7 -5
- package/dist/webhook.d.ts +7 -5
- package/package.json +1 -1
- package/dist/payload-types-PXkmefhZ.d.cts +0 -14027
- package/dist/payload-types-PXkmefhZ.d.ts +0 -14027
- package/dist/types-CQRsG6sA.d.ts +0 -53
- package/dist/types-CyMz0Kzc.d.cts +0 -53
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import './payload-types-PXkmefhZ.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Internal collections that should not be exposed via SDK.
|
|
5
3
|
* Includes Payload system collections and admin-only collections.
|
|
6
4
|
*/
|
|
7
|
-
declare const INTERNAL_COLLECTIONS: readonly ["benefit-voucher-definitions", "users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
|
|
5
|
+
declare const INTERNAL_COLLECTIONS: readonly ["benefit-voucher-definitions", "users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-social-provider-configs", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
|
|
8
6
|
type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
|
|
9
7
|
/**
|
|
10
8
|
* Array of browser-public collection names for runtime use (e.g., Zod enum validation).
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import './payload-types-PXkmefhZ.cjs';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Internal collections that should not be exposed via SDK.
|
|
5
3
|
* Includes Payload system collections and admin-only collections.
|
|
6
4
|
*/
|
|
7
|
-
declare const INTERNAL_COLLECTIONS: readonly ["benefit-voucher-definitions", "users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
|
|
5
|
+
declare const INTERNAL_COLLECTIONS: readonly ["benefit-voucher-definitions", "users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-mcp-usage-daily", "subscriptions", "billing-history", "billing-consent-receipts", "usage-rate-cards", "usage-invoices", "inventory-reservations", "inventory-adjustments", "payment-sessions", "payment-event-inbox", "payment-refund-attempts", "portone-payment-interactions", "commerce-payment-webhook-routes", "commerce-notification-intents", "commerce-idempotency-records", "product-collection-items", "order-status-logs", "fulfillment-events", "tenant-commerce-config", "customer-oauth-clients", "customer-social-provider-configs", "customer-consent-receipts", "customer-group-grants", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "webhook-outbox-deliveries", "audit-logs", "plans", "webhooks", "custom-field-definitions", "event-registrations", "event-admission-holds", "event-admission-types", "customer-payment-methods", "tenant-payment-credentials", "membership-unapplied-paid-evidence", "commerce-payment-accounts", "payment-provider-customer-aliases"];
|
|
8
6
|
type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
|
|
9
7
|
/**
|
|
10
8
|
* Array of browser-public collection names for runtime use (e.g., Zod enum validation).
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-PXkmefhZ.js';
|
|
1
|
+
import { C as Collection } from './const-CcOT0taO.js';
|
|
2
|
+
import { C as CollectionType } from './types-CQw4HXky.js';
|
|
4
3
|
|
|
5
4
|
type WebhookOperation = string;
|
|
6
5
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-PXkmefhZ.cjs';
|
|
1
|
+
import { C as Collection } from './const-CcOT0taO.cjs';
|
|
2
|
+
import { C as CollectionType } from './types-Jr4xTiGs.cjs';
|
|
4
3
|
|
|
5
4
|
type WebhookOperation = string;
|
|
6
5
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -1479,16 +1479,28 @@ var CUSTOMER_AUTH_ENDPOINT_OPERATIONS = {
|
|
|
1479
1479
|
resetPassword: operation("customers", "post", "/reset-password"),
|
|
1480
1480
|
changePassword: operation("customers", "post", "/change-password"),
|
|
1481
1481
|
revokeRefresh: operation("customers", "post", "/revoke-refresh"),
|
|
1482
|
-
withdraw: operation("customers", "post", "/withdraw")
|
|
1482
|
+
withdraw: operation("customers", "post", "/withdraw"),
|
|
1483
|
+
requestWithdrawalCode: operation("customers", "post", "/withdraw/email-code")
|
|
1483
1484
|
};
|
|
1484
1485
|
var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
|
|
1485
1486
|
show: operation("tenants", "get", "/embedded-admin-app"),
|
|
1486
1487
|
configure: operation("tenants", "patch", "/embedded-admin-app"),
|
|
1487
1488
|
disable: operation("tenants", "delete", "/embedded-admin-app")
|
|
1488
1489
|
};
|
|
1490
|
+
var FIELD_CONFIG_ENDPOINT_OPERATIONS = {
|
|
1491
|
+
list: operation("field-configs", "get", "/list"),
|
|
1492
|
+
save: operation("field-configs", "post", "/save")
|
|
1493
|
+
};
|
|
1489
1494
|
var EVENTS_ENDPOINT_OPERATIONS = {
|
|
1490
1495
|
registrations: {
|
|
1491
1496
|
register: operation("event-registrations", "post", "/register"),
|
|
1497
|
+
requestEmailVerification: operation(
|
|
1498
|
+
"event-registrations",
|
|
1499
|
+
"post",
|
|
1500
|
+
"/request-email-verification"
|
|
1501
|
+
),
|
|
1502
|
+
emailCancelPage: operation("event-registrations", "get", "/email-cancel"),
|
|
1503
|
+
emailCancel: operation("event-registrations", "post", "/email-cancel"),
|
|
1492
1504
|
guestLookup: operation("event-registrations", "post", "/guest/lookup"),
|
|
1493
1505
|
guestLookupByUrl: operation("event-registrations", "get", "/guest/:token"),
|
|
1494
1506
|
guestCancel: operation("event-registrations", "post", "/guest/cancel"),
|
|
@@ -1527,6 +1539,9 @@ var VIDEO_ENDPOINT_OPERATIONS = {
|
|
|
1527
1539
|
function resolveOperationTemplate(descriptor) {
|
|
1528
1540
|
return descriptor.collection ? `/api/${descriptor.collection}${descriptor.path}` : `/api${descriptor.path}`;
|
|
1529
1541
|
}
|
|
1542
|
+
var PAYMENT_DIAGNOSTIC_ENDPOINT_OPERATIONS = {
|
|
1543
|
+
diagnose: operation("tenants", "get", "/payment-diagnostics")
|
|
1544
|
+
};
|
|
1530
1545
|
function resolveOperationPath(descriptor, options) {
|
|
1531
1546
|
const path = resolveOperationTemplate(descriptor).replace(
|
|
1532
1547
|
/:([A-Za-z][A-Za-z0-9_]*)/g,
|
|
@@ -4908,8 +4923,25 @@ var CustomerAuth = class {
|
|
|
4908
4923
|
body: JSON.stringify({ refreshToken })
|
|
4909
4924
|
});
|
|
4910
4925
|
}
|
|
4911
|
-
/**
|
|
4912
|
-
async
|
|
4926
|
+
/** Send a withdrawal-only code to the current passwordless customer's stored email. */
|
|
4927
|
+
async requestWithdrawalCode() {
|
|
4928
|
+
const token = this.getToken();
|
|
4929
|
+
if (!token) throw new ApiError("Not authenticated", 401);
|
|
4930
|
+
const operation2 = CUSTOMER_AUTH_ENDPOINT_OPERATIONS.requestWithdrawalCode;
|
|
4931
|
+
const result = await this.requestJson(
|
|
4932
|
+
resolveOperationPath(operation2),
|
|
4933
|
+
{
|
|
4934
|
+
method: resolveOperationMethod(operation2),
|
|
4935
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
4936
|
+
body: JSON.stringify({})
|
|
4937
|
+
}
|
|
4938
|
+
);
|
|
4939
|
+
if (!result || typeof result.message !== "string")
|
|
4940
|
+
throw new ApiError("Invalid withdrawal code response", 502);
|
|
4941
|
+
return result;
|
|
4942
|
+
}
|
|
4943
|
+
/** Archive the current account and clear this client's credentials on success. */
|
|
4944
|
+
async withdraw(proof) {
|
|
4913
4945
|
const token = this.getToken();
|
|
4914
4946
|
if (!token) throw new ApiError("Not authenticated", 401);
|
|
4915
4947
|
const operation2 = CUSTOMER_AUTH_ENDPOINT_OPERATIONS.withdraw;
|
|
@@ -4918,7 +4950,9 @@ var CustomerAuth = class {
|
|
|
4918
4950
|
{
|
|
4919
4951
|
method: resolveOperationMethod(operation2),
|
|
4920
4952
|
headers: { Authorization: `Bearer ${token}` },
|
|
4921
|
-
body: JSON.stringify(
|
|
4953
|
+
body: JSON.stringify(
|
|
4954
|
+
typeof proof === "string" ? { currentPassword: proof } : proof
|
|
4955
|
+
)
|
|
4922
4956
|
}
|
|
4923
4957
|
);
|
|
4924
4958
|
if (!result || typeof result.withdrawnAt !== "string" || !Number.isFinite(Date.parse(result.withdrawnAt)))
|
|
@@ -6979,10 +7013,13 @@ function buildProductHref(product, group, options = {}) {
|
|
|
6979
7013
|
return params.size > 0 ? `${path}?${params.toString()}` : path;
|
|
6980
7014
|
}
|
|
6981
7015
|
function compareVariantOrder(a, b) {
|
|
6982
|
-
const aOrder =
|
|
6983
|
-
const bOrder =
|
|
6984
|
-
if (
|
|
6985
|
-
|
|
7016
|
+
const aOrder = a._order || null;
|
|
7017
|
+
const bOrder = b._order || null;
|
|
7018
|
+
if (aOrder !== bOrder) {
|
|
7019
|
+
if (aOrder === null) return 1;
|
|
7020
|
+
if (bOrder === null) return -1;
|
|
7021
|
+
const byOrder = compareOrdinal(aOrder, bOrder);
|
|
7022
|
+
if (byOrder !== 0) return byOrder;
|
|
6986
7023
|
}
|
|
6987
7024
|
const aId = String(getRelationID(a.id) ?? "");
|
|
6988
7025
|
const bId = String(getRelationID(b.id) ?? "");
|
|
@@ -7296,11 +7333,7 @@ function buildProductListingPageWhere(params) {
|
|
|
7296
7333
|
const search = params.search?.trim();
|
|
7297
7334
|
if (search) {
|
|
7298
7335
|
clauses.push({
|
|
7299
|
-
or: [
|
|
7300
|
-
{ title: { like: search } },
|
|
7301
|
-
{ slug: { like: search } },
|
|
7302
|
-
{ handle: { like: search } }
|
|
7303
|
-
]
|
|
7336
|
+
or: [{ title: { like: search } }, { slug: { like: search } }]
|
|
7304
7337
|
});
|
|
7305
7338
|
}
|
|
7306
7339
|
const filters = params.filters;
|
|
@@ -7578,6 +7611,15 @@ var EventsClient = class {
|
|
|
7578
7611
|
{ useCustomerAuth: true }
|
|
7579
7612
|
);
|
|
7580
7613
|
}
|
|
7614
|
+
requestRegistrationEmailVerification(params) {
|
|
7615
|
+
const operation2 = EVENTS_ENDPOINT_OPERATIONS.registrations.requestEmailVerification;
|
|
7616
|
+
return this.execute(
|
|
7617
|
+
resolveOperationPath(operation2),
|
|
7618
|
+
resolveOperationMethod(operation2),
|
|
7619
|
+
buildRegistrationRequestBody(params),
|
|
7620
|
+
{ useCustomerAuth: true, noStore: true }
|
|
7621
|
+
);
|
|
7622
|
+
}
|
|
7581
7623
|
getGuestRegistration(token) {
|
|
7582
7624
|
return this.execute(
|
|
7583
7625
|
resolveOperationPath(
|
|
@@ -7630,7 +7672,10 @@ function buildRegistrationRequestBody(params) {
|
|
|
7630
7672
|
occurrence: params.occurrence,
|
|
7631
7673
|
...params.quantity !== void 0 && { quantity: params.quantity },
|
|
7632
7674
|
...params.attendee !== void 0 && { attendee: params.attendee },
|
|
7633
|
-
...params.answers !== void 0 && { answers: params.answers }
|
|
7675
|
+
...params.answers !== void 0 && { answers: params.answers },
|
|
7676
|
+
...params.emailVerification !== void 0 && {
|
|
7677
|
+
emailVerification: params.emailVerification
|
|
7678
|
+
}
|
|
7634
7679
|
};
|
|
7635
7680
|
}
|
|
7636
7681
|
function buildGuestCancelRequestBody(token, params) {
|
|
@@ -8233,6 +8278,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
8233
8278
|
"fulfillment-events",
|
|
8234
8279
|
"tenant-commerce-config",
|
|
8235
8280
|
"customer-oauth-clients",
|
|
8281
|
+
"customer-social-provider-configs",
|
|
8236
8282
|
"customer-consent-receipts",
|
|
8237
8283
|
"customer-group-grants",
|
|
8238
8284
|
"api-keys",
|