@01.software/sdk 0.17.0 → 0.18.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/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-CMoyAOjJ.cjs';
2
- export { D as Document, I as Image, e as Post, f as PostCategory, g as PostTag, h as ProductVariant, i as Tenant, V as Video } from './payload-types-CMoyAOjJ.cjs';
1
+ import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-Cwnj_qN4.cjs';
2
+ export { D as Document, I as Image, e as Post, f as PostCategory, g as PostTag, h as ProductVariant, i as Tenant, V as Video } from './payload-types-Cwnj_qN4.cjs';
3
3
  import { Sort, Where } from 'payload';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { QueryClient, InfiniteData } from '@tanstack/react-query';
6
6
  import { Metadata } from 'next';
7
- import { C as CollectionType } from './webhook-Dm2zz7FQ.cjs';
8
- export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-Dm2zz7FQ.cjs';
9
- import { P as PublicCollection } from './const-D2K5HxpP.cjs';
10
- export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-D2K5HxpP.cjs';
7
+ import { C as CollectionType } from './webhook-Ce9uNv5c.cjs';
8
+ export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-Ce9uNv5c.cjs';
9
+ import { P as PublicCollection } from './const-zEoxAfGX.cjs';
10
+ export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-zEoxAfGX.cjs';
11
11
  export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.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';
@@ -668,7 +668,6 @@ interface CustomerProfile {
668
668
  phone?: string | null;
669
669
  authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
670
670
  isGuest?: boolean | null;
671
- isEmailVerified?: boolean | null;
672
671
  marketingConsent?: MarketingConsent | null;
673
672
  metadata?: Record<string, unknown> | null;
674
673
  groups?: string[];
@@ -681,8 +680,6 @@ interface CustomerRegisterData {
681
680
  }
682
681
  interface CustomerRegisterResponse {
683
682
  customer: CustomerProfile;
684
- /** True when tenant requires email verification. Token delivered via webhook. */
685
- verificationRequired?: boolean;
686
683
  }
687
684
  interface CustomerLoginData {
688
685
  email: string;
@@ -763,10 +760,6 @@ declare class CustomerAuth {
763
760
  * Change the password of the currently authenticated customer
764
761
  */
765
762
  changePassword(currentPassword: string, newPassword: string): Promise<void>;
766
- /**
767
- * Verify email using the verification token
768
- */
769
- verifyEmail(token: string): Promise<void>;
770
763
  /**
771
764
  * Get the authenticated customer's orders with pagination and optional status filter
772
765
  */
@@ -1358,7 +1351,6 @@ declare class CustomerHooks {
1358
1351
  token: string;
1359
1352
  password: string;
1360
1353
  }, unknown>;
1361
- useCustomerVerifyEmail(options?: MutationCallbacks<void>): _tanstack_react_query.UseMutationResult<void, SDKError, string, unknown>;
1362
1354
  useCustomerRefreshToken(options?: MutationCallbacks<CustomerRefreshResponse>): _tanstack_react_query.UseMutationResult<CustomerRefreshResponse, SDKError, unknown, unknown>;
1363
1355
  useCustomerUpdateProfile(options?: MutationCallbacks<CustomerProfile>): _tanstack_react_query.UseMutationResult<CustomerProfile, SDKError, UpdateProfileData, unknown>;
1364
1356
  useCustomerChangePassword(options?: MutationCallbacks<void>): _tanstack_react_query.UseMutationResult<void, SDKError, {
@@ -1403,7 +1395,6 @@ declare class QueryHooks extends CollectionHooks {
1403
1395
  useCustomerLogout: CustomerHooks['useCustomerLogout'];
1404
1396
  useCustomerForgotPassword: CustomerHooks['useCustomerForgotPassword'];
1405
1397
  useCustomerResetPassword: CustomerHooks['useCustomerResetPassword'];
1406
- useCustomerVerifyEmail: CustomerHooks['useCustomerVerifyEmail'];
1407
1398
  useCustomerRefreshToken: CustomerHooks['useCustomerRefreshToken'];
1408
1399
  useCustomerUpdateProfile: CustomerHooks['useCustomerUpdateProfile'];
1409
1400
  useCustomerChangePassword: CustomerHooks['useCustomerChangePassword'];
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-CMoyAOjJ.js';
2
- export { D as Document, I as Image, e as Post, f as PostCategory, g as PostTag, h as ProductVariant, i as Tenant, V as Video } from './payload-types-CMoyAOjJ.js';
1
+ import { O as Order, a as Cart, b as CartItem, P as Product, c as OrderItem$1, T as Transaction, d as Fulfillment, R as Return } from './payload-types-Cwnj_qN4.js';
2
+ export { D as Document, I as Image, e as Post, f as PostCategory, g as PostTag, h as ProductVariant, i as Tenant, V as Video } from './payload-types-Cwnj_qN4.js';
3
3
  import { Sort, Where } from 'payload';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { QueryClient, InfiniteData } from '@tanstack/react-query';
6
6
  import { Metadata } from 'next';
7
- import { C as CollectionType } from './webhook-IhuUWnt5.js';
8
- export { a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, d as createTypedWebhookHandler, h as handleWebhook, i as isValidWebhookEvent } from './webhook-IhuUWnt5.js';
9
- import { P as PublicCollection } from './const-DG8TrouX.js';
10
- export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-DG8TrouX.js';
7
+ import { C as CollectionType } from './webhook-ger4JSeS.js';
8
+ export { d as CUSTOMER_PASSWORD_RESET_OPERATION, g as CustomerAuthWebhookEvent, h as CustomerAuthWebhookHandlers, e as CustomerPasswordResetWebhookData, f as CustomerPasswordResetWebhookEvent, a as WebhookEvent, b as WebhookHandler, W as WebhookOperation, c as WebhookOptions, k as createCustomerAuthWebhookHandler, m as createTypedWebhookHandler, l as handleWebhook, j as isCustomerPasswordResetWebhookEvent, i as isValidWebhookEvent } from './webhook-ger4JSeS.js';
9
+ import { P as PublicCollection } from './const-_gW__LA1.js';
10
+ export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS } from './const-_gW__LA1.js';
11
11
  export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.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';
@@ -668,7 +668,6 @@ interface CustomerProfile {
668
668
  phone?: string | null;
669
669
  authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
670
670
  isGuest?: boolean | null;
671
- isEmailVerified?: boolean | null;
672
671
  marketingConsent?: MarketingConsent | null;
673
672
  metadata?: Record<string, unknown> | null;
674
673
  groups?: string[];
@@ -681,8 +680,6 @@ interface CustomerRegisterData {
681
680
  }
682
681
  interface CustomerRegisterResponse {
683
682
  customer: CustomerProfile;
684
- /** True when tenant requires email verification. Token delivered via webhook. */
685
- verificationRequired?: boolean;
686
683
  }
687
684
  interface CustomerLoginData {
688
685
  email: string;
@@ -763,10 +760,6 @@ declare class CustomerAuth {
763
760
  * Change the password of the currently authenticated customer
764
761
  */
765
762
  changePassword(currentPassword: string, newPassword: string): Promise<void>;
766
- /**
767
- * Verify email using the verification token
768
- */
769
- verifyEmail(token: string): Promise<void>;
770
763
  /**
771
764
  * Get the authenticated customer's orders with pagination and optional status filter
772
765
  */
@@ -1358,7 +1351,6 @@ declare class CustomerHooks {
1358
1351
  token: string;
1359
1352
  password: string;
1360
1353
  }, unknown>;
1361
- useCustomerVerifyEmail(options?: MutationCallbacks<void>): _tanstack_react_query.UseMutationResult<void, SDKError, string, unknown>;
1362
1354
  useCustomerRefreshToken(options?: MutationCallbacks<CustomerRefreshResponse>): _tanstack_react_query.UseMutationResult<CustomerRefreshResponse, SDKError, unknown, unknown>;
1363
1355
  useCustomerUpdateProfile(options?: MutationCallbacks<CustomerProfile>): _tanstack_react_query.UseMutationResult<CustomerProfile, SDKError, UpdateProfileData, unknown>;
1364
1356
  useCustomerChangePassword(options?: MutationCallbacks<void>): _tanstack_react_query.UseMutationResult<void, SDKError, {
@@ -1403,7 +1395,6 @@ declare class QueryHooks extends CollectionHooks {
1403
1395
  useCustomerLogout: CustomerHooks['useCustomerLogout'];
1404
1396
  useCustomerForgotPassword: CustomerHooks['useCustomerForgotPassword'];
1405
1397
  useCustomerResetPassword: CustomerHooks['useCustomerResetPassword'];
1406
- useCustomerVerifyEmail: CustomerHooks['useCustomerVerifyEmail'];
1407
1398
  useCustomerRefreshToken: CustomerHooks['useCustomerRefreshToken'];
1408
1399
  useCustomerUpdateProfile: CustomerHooks['useCustomerUpdateProfile'];
1409
1400
  useCustomerChangePassword: CustomerHooks['useCustomerChangePassword'];
package/dist/index.js CHANGED
@@ -966,8 +966,6 @@ var INTERNAL_COLLECTIONS = [
966
966
  "track-assets",
967
967
  "audiences",
968
968
  "email-logs",
969
- "tenant-auth-settings",
970
- "tenant-community-settings",
971
969
  "api-usage",
972
970
  "tenant-analytics-daily",
973
971
  "analytics-event-schemas",
@@ -981,7 +979,8 @@ var INTERNAL_COLLECTIONS = [
981
979
  "webhook-deliveries",
982
980
  "audit-logs",
983
981
  "plans",
984
- "webhooks"
982
+ "webhooks",
983
+ "event-registrations"
985
984
  ];
986
985
  var COLLECTIONS = [
987
986
  "tenants",
@@ -1054,7 +1053,12 @@ var COLLECTIONS = [
1054
1053
  "bookmarks",
1055
1054
  "thread-categories",
1056
1055
  "reports",
1057
- "community-bans"
1056
+ "community-bans",
1057
+ // Events
1058
+ "event-calendars",
1059
+ "events",
1060
+ "event-occurrences",
1061
+ "event-tags"
1058
1062
  ];
1059
1063
 
1060
1064
  // src/core/api/parse-response.ts
@@ -1470,15 +1474,6 @@ var CustomerAuth = class {
1470
1474
  body: JSON.stringify({ currentPassword, newPassword })
1471
1475
  });
1472
1476
  }
1473
- /**
1474
- * Verify email using the verification token
1475
- */
1476
- async verifyEmail(token) {
1477
- await this.requestJson("/api/customers/verify-email", {
1478
- method: "POST",
1479
- body: JSON.stringify({ token })
1480
- });
1481
- }
1482
1477
  /**
1483
1478
  * Get the authenticated customer's orders with pagination and optional status filter
1484
1479
  */
@@ -2216,14 +2211,6 @@ var CustomerHooks = class {
2216
2211
  options
2217
2212
  );
2218
2213
  }
2219
- useCustomerVerifyEmail(options) {
2220
- return createMutation(
2221
- (token) => this.ensureCustomerAuth().verifyEmail(token).then(() => {
2222
- }),
2223
- options,
2224
- this.invalidateMe
2225
- );
2226
- }
2227
2214
  useCustomerRefreshToken(options) {
2228
2215
  return createMutation(
2229
2216
  () => this.ensureCustomerAuth().refreshToken(),
@@ -2268,7 +2255,6 @@ var QueryHooks = class extends CollectionHooks {
2268
2255
  this.useCustomerLogout = (...args) => this._customer.useCustomerLogout(...args);
2269
2256
  this.useCustomerForgotPassword = (...args) => this._customer.useCustomerForgotPassword(...args);
2270
2257
  this.useCustomerResetPassword = (...args) => this._customer.useCustomerResetPassword(...args);
2271
- this.useCustomerVerifyEmail = (...args) => this._customer.useCustomerVerifyEmail(...args);
2272
2258
  this.useCustomerRefreshToken = (...args) => this._customer.useCustomerRefreshToken(...args);
2273
2259
  this.useCustomerUpdateProfile = (...args) => this._customer.useCustomerUpdateProfile(...args);
2274
2260
  this.useCustomerChangePassword = (...args) => this._customer.useCustomerChangePassword(...args);
@@ -2652,7 +2638,32 @@ var RealtimeConnection = class {
2652
2638
  function isValidWebhookEvent(data) {
2653
2639
  if (typeof data !== "object" || data === null) return false;
2654
2640
  const obj = data;
2655
- return typeof obj.collection === "string" && (obj.operation === "create" || obj.operation === "update") && typeof obj.data === "object" && obj.data !== null;
2641
+ return typeof obj.collection === "string" && typeof obj.operation === "string" && obj.operation.length > 0 && typeof obj.data === "object" && obj.data !== null;
2642
+ }
2643
+ var CUSTOMER_PASSWORD_RESET_OPERATION = "password-reset";
2644
+ function isRecord(value) {
2645
+ return typeof value === "object" && value !== null;
2646
+ }
2647
+ function hasString(value, key) {
2648
+ return typeof value[key] === "string";
2649
+ }
2650
+ function hasStringOrNumber(value, key) {
2651
+ return typeof value[key] === "string" || typeof value[key] === "number";
2652
+ }
2653
+ function isCustomerPasswordResetWebhookEvent(event) {
2654
+ if (event.collection !== "customers" || event.operation !== CUSTOMER_PASSWORD_RESET_OPERATION || !isRecord(event.data)) {
2655
+ return false;
2656
+ }
2657
+ return hasStringOrNumber(event.data, "customerId") && hasString(event.data, "email") && hasString(event.data, "name") && hasString(event.data, "resetPasswordToken") && hasString(event.data, "resetPasswordExpiresAt");
2658
+ }
2659
+ function createCustomerAuthWebhookHandler(handlers) {
2660
+ return async (event) => {
2661
+ if (isCustomerPasswordResetWebhookEvent(event) && handlers.passwordReset) {
2662
+ await handlers.passwordReset(event.data, event);
2663
+ return;
2664
+ }
2665
+ await handlers.unhandled?.(event);
2666
+ };
2656
2667
  }
2657
2668
  async function verifySignature(payload, secret, signature) {
2658
2669
  const encoder = new TextEncoder();
@@ -3244,6 +3255,7 @@ export {
3244
3255
  AuthError,
3245
3256
  BaseApi,
3246
3257
  COLLECTIONS,
3258
+ CUSTOMER_PASSWORD_RESET_OPERATION,
3247
3259
  CartApi,
3248
3260
  Client,
3249
3261
  CollectionClient,
@@ -3285,6 +3297,7 @@ export {
3285
3297
  createAuthError,
3286
3298
  createClient,
3287
3299
  createConflictError,
3300
+ createCustomerAuthWebhookHandler,
3288
3301
  createNotFoundError,
3289
3302
  createPermissionError,
3290
3303
  createRateLimitError,
@@ -3311,6 +3324,7 @@ export {
3311
3324
  isAuthError,
3312
3325
  isConfigError,
3313
3326
  isConflictError,
3327
+ isCustomerPasswordResetWebhookEvent,
3314
3328
  isGoneError,
3315
3329
  isNetworkError,
3316
3330
  isNotFoundError,