@donotdev/core 0.1.1 → 0.1.44

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.
Files changed (140) hide show
  1. package/LICENSE.md +21 -242
  2. package/README.md +2 -20
  3. package/empty.cjs +0 -0
  4. package/empty.js +0 -0
  5. package/functions/index.js +20 -10
  6. package/i18n/locales/eager/dndev_ar.json +35 -0
  7. package/i18n/locales/eager/dndev_da.json +63 -8
  8. package/i18n/locales/eager/dndev_de.json +35 -0
  9. package/i18n/locales/eager/dndev_en.json +52 -1
  10. package/i18n/locales/eager/dndev_es.json +35 -0
  11. package/i18n/locales/eager/dndev_fr.json +52 -1
  12. package/i18n/locales/eager/dndev_it.json +35 -0
  13. package/i18n/locales/eager/dndev_ja.json +35 -0
  14. package/i18n/locales/eager/dndev_ko.json +35 -0
  15. package/i18n/locales/eager/dndev_nl.json +59 -7
  16. package/i18n/locales/eager/dndev_pt.json +35 -0
  17. package/i18n/locales/eager/dndev_zh.json +36 -1
  18. package/i18n/locales/lazy/ai_en.json +0 -0
  19. package/i18n/locales/lazy/ai_pt.json +0 -0
  20. package/i18n/locales/lazy/ai_zh.json +0 -0
  21. package/i18n/locales/lazy/auth_ar.json +0 -0
  22. package/i18n/locales/lazy/auth_da.json +0 -0
  23. package/i18n/locales/lazy/auth_de.json +0 -0
  24. package/i18n/locales/lazy/auth_en.json +0 -0
  25. package/i18n/locales/lazy/auth_es.json +0 -0
  26. package/i18n/locales/lazy/auth_fr.json +0 -0
  27. package/i18n/locales/lazy/auth_it.json +0 -0
  28. package/i18n/locales/lazy/auth_ja.json +0 -0
  29. package/i18n/locales/lazy/auth_ko.json +0 -0
  30. package/i18n/locales/lazy/auth_nl.json +0 -0
  31. package/i18n/locales/lazy/auth_pt.json +0 -0
  32. package/i18n/locales/lazy/auth_zh.json +0 -0
  33. package/i18n/locales/lazy/billing_ar.json +0 -0
  34. package/i18n/locales/lazy/billing_da.json +0 -0
  35. package/i18n/locales/lazy/billing_de.json +0 -0
  36. package/i18n/locales/lazy/billing_en.json +0 -0
  37. package/i18n/locales/lazy/billing_es.json +0 -0
  38. package/i18n/locales/lazy/billing_fr.json +0 -0
  39. package/i18n/locales/lazy/billing_it.json +0 -0
  40. package/i18n/locales/lazy/billing_ja.json +0 -0
  41. package/i18n/locales/lazy/billing_ko.json +0 -0
  42. package/i18n/locales/lazy/billing_nl.json +0 -0
  43. package/i18n/locales/lazy/billing_pt.json +0 -0
  44. package/i18n/locales/lazy/billing_zh.json +0 -0
  45. package/i18n/locales/lazy/blog_ar.json +0 -0
  46. package/i18n/locales/lazy/blog_da.json +0 -0
  47. package/i18n/locales/lazy/blog_de.json +0 -0
  48. package/i18n/locales/lazy/blog_en.json +0 -0
  49. package/i18n/locales/lazy/blog_es.json +0 -0
  50. package/i18n/locales/lazy/blog_fr.json +0 -0
  51. package/i18n/locales/lazy/blog_it.json +0 -0
  52. package/i18n/locales/lazy/blog_ja.json +0 -0
  53. package/i18n/locales/lazy/blog_ko.json +0 -0
  54. package/i18n/locales/lazy/blog_nl.json +0 -0
  55. package/i18n/locales/lazy/blog_pt.json +0 -0
  56. package/i18n/locales/lazy/blog_zh.json +0 -0
  57. package/i18n/locales/lazy/cookies_ar.json +0 -0
  58. package/i18n/locales/lazy/cookies_da.json +0 -0
  59. package/i18n/locales/lazy/cookies_de.json +0 -0
  60. package/i18n/locales/lazy/cookies_en.json +0 -0
  61. package/i18n/locales/lazy/cookies_es.json +0 -0
  62. package/i18n/locales/lazy/cookies_fr.json +0 -0
  63. package/i18n/locales/lazy/cookies_it.json +0 -0
  64. package/i18n/locales/lazy/cookies_ja.json +0 -0
  65. package/i18n/locales/lazy/cookies_ko.json +0 -0
  66. package/i18n/locales/lazy/cookies_nl.json +0 -0
  67. package/i18n/locales/lazy/cookies_pt.json +0 -0
  68. package/i18n/locales/lazy/cookies_zh.json +0 -0
  69. package/i18n/locales/lazy/crud_ar.json +6 -5
  70. package/i18n/locales/lazy/crud_da.json +6 -5
  71. package/i18n/locales/lazy/crud_de.json +6 -5
  72. package/i18n/locales/lazy/crud_en.json +7 -5
  73. package/i18n/locales/lazy/crud_es.json +6 -5
  74. package/i18n/locales/lazy/crud_fr.json +7 -5
  75. package/i18n/locales/lazy/crud_it.json +6 -5
  76. package/i18n/locales/lazy/crud_ja.json +6 -5
  77. package/i18n/locales/lazy/crud_ko.json +6 -5
  78. package/i18n/locales/lazy/crud_nl.json +6 -5
  79. package/i18n/locales/lazy/crud_pt.json +6 -5
  80. package/i18n/locales/lazy/crud_zh.json +6 -5
  81. package/i18n/locales/lazy/homeTemplate_ar.json +0 -0
  82. package/i18n/locales/lazy/homeTemplate_da.json +0 -0
  83. package/i18n/locales/lazy/homeTemplate_de.json +0 -0
  84. package/i18n/locales/lazy/homeTemplate_en.json +0 -0
  85. package/i18n/locales/lazy/homeTemplate_es.json +0 -0
  86. package/i18n/locales/lazy/homeTemplate_fr.json +0 -0
  87. package/i18n/locales/lazy/homeTemplate_it.json +0 -0
  88. package/i18n/locales/lazy/homeTemplate_ja.json +0 -0
  89. package/i18n/locales/lazy/homeTemplate_ko.json +0 -0
  90. package/i18n/locales/lazy/homeTemplate_nl.json +0 -0
  91. package/i18n/locales/lazy/homeTemplate_pt.json +0 -0
  92. package/i18n/locales/lazy/homeTemplate_zh.json +0 -0
  93. package/i18n/locales/lazy/legalNotice_en.json +0 -0
  94. package/i18n/locales/lazy/legalNotice_fr.json +0 -0
  95. package/i18n/locales/lazy/legalNotice_pt.json +0 -0
  96. package/i18n/locales/lazy/legalNotice_zh.json +0 -0
  97. package/i18n/locales/lazy/oauth_ar.json +0 -0
  98. package/i18n/locales/lazy/oauth_da.json +0 -0
  99. package/i18n/locales/lazy/oauth_de.json +0 -0
  100. package/i18n/locales/lazy/oauth_en.json +0 -0
  101. package/i18n/locales/lazy/oauth_es.json +0 -0
  102. package/i18n/locales/lazy/oauth_fr.json +0 -0
  103. package/i18n/locales/lazy/oauth_it.json +0 -0
  104. package/i18n/locales/lazy/oauth_ja.json +0 -0
  105. package/i18n/locales/lazy/oauth_ko.json +0 -0
  106. package/i18n/locales/lazy/oauth_nl.json +0 -0
  107. package/i18n/locales/lazy/oauth_pt.json +0 -0
  108. package/i18n/locales/lazy/oauth_zh.json +0 -0
  109. package/i18n/locales/lazy/privacy_ar.json +0 -0
  110. package/i18n/locales/lazy/privacy_da.json +0 -0
  111. package/i18n/locales/lazy/privacy_de.json +0 -0
  112. package/i18n/locales/lazy/privacy_en.json +0 -0
  113. package/i18n/locales/lazy/privacy_es.json +0 -0
  114. package/i18n/locales/lazy/privacy_fr.json +0 -0
  115. package/i18n/locales/lazy/privacy_it.json +0 -0
  116. package/i18n/locales/lazy/privacy_ja.json +0 -0
  117. package/i18n/locales/lazy/privacy_ko.json +0 -0
  118. package/i18n/locales/lazy/privacy_nl.json +0 -0
  119. package/i18n/locales/lazy/privacy_pt.json +0 -0
  120. package/i18n/locales/lazy/privacy_zh.json +1 -1
  121. package/i18n/locales/lazy/terms_ar.json +0 -0
  122. package/i18n/locales/lazy/terms_da.json +0 -0
  123. package/i18n/locales/lazy/terms_de.json +0 -0
  124. package/i18n/locales/lazy/terms_en.json +0 -0
  125. package/i18n/locales/lazy/terms_es.json +0 -0
  126. package/i18n/locales/lazy/terms_fr.json +0 -0
  127. package/i18n/locales/lazy/terms_it.json +0 -0
  128. package/i18n/locales/lazy/terms_ja.json +0 -0
  129. package/i18n/locales/lazy/terms_ko.json +0 -0
  130. package/i18n/locales/lazy/terms_nl.json +0 -0
  131. package/i18n/locales/lazy/terms_pt.json +0 -0
  132. package/i18n/locales/lazy/terms_zh.json +0 -0
  133. package/index.d.ts +928 -215
  134. package/index.js +6 -502
  135. package/next/index.js +258 -68
  136. package/package.json +10 -7
  137. package/server.d.ts +866 -119
  138. package/server.js +1 -1
  139. package/vite/index.d.ts +8 -0
  140. package/vite/index.js +66 -58
package/server.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactNode, ComponentType } from 'react';
1
+ import { ComponentType, ReactNode } from 'react';
2
2
  import * as v from 'valibot';
3
3
  import { InitOptions, TFunction } from 'i18next';
4
4
  import { FieldValues } from 'react-hook-form';
@@ -3246,6 +3246,23 @@ interface PageMeta {
3246
3246
  * ```
3247
3247
  */
3248
3248
  seo?: SeoMeta;
3249
+ /**
3250
+ * User-facing category for sidebar/menu grouping
3251
+ * @description Groups routes into collapsible sections in navigation. Unlike
3252
+ * auto-discovered `entity` (parent-dir name), `category` is author-declared
3253
+ * and typically maps to a higher-level folder (e.g., `Analyzers`, `Tools`).
3254
+ * Routes without `category` render ungrouped at the top of the menu.
3255
+ *
3256
+ * @example
3257
+ * ```tsx
3258
+ * export const meta: PageMeta = {
3259
+ * namespace: 'budgetPlanner',
3260
+ * category: 'Analyzers',
3261
+ * icon: <WalletIcon />,
3262
+ * };
3263
+ * ```
3264
+ */
3265
+ category?: string;
3249
3266
  }
3250
3267
  /**
3251
3268
  * Route metadata (discovery-generated)
@@ -5940,6 +5957,18 @@ interface RemoveCustomClaimsResponse {
5940
5957
  * @author AMBROISE PARK Consulting
5941
5958
  */
5942
5959
  type UnsubscribeFn = () => void;
5960
+ /**
5961
+ * Optional metadata passed to signup methods.
5962
+ * Stored in provider-specific user metadata (Supabase `raw_user_meta_data`, Firebase user doc).
5963
+ */
5964
+ interface SignUpMetadata {
5965
+ /** ISO-8601 timestamp of GDPR consent acceptance */
5966
+ gdpr_consent_at?: string;
5967
+ /** Version identifier of the ToS document accepted */
5968
+ gdpr_tos_version?: string;
5969
+ /** Extensible for consumer-specific fields */
5970
+ [key: string]: unknown;
5971
+ }
5943
5972
  /**
5944
5973
  * Authentication provider interface
5945
5974
  *
@@ -5963,7 +5992,7 @@ interface AuthProvider {
5963
5992
  /**
5964
5993
  * Sign up with email and password
5965
5994
  */
5966
- createUserWithEmailAndPassword(email: string, password: string): Promise<AuthUser>;
5995
+ createUserWithEmailAndPassword(email: string, password: string, metadata?: SignUpMetadata): Promise<AuthUser>;
5967
5996
  /**
5968
5997
  * Sign out the current user
5969
5998
  */
@@ -6001,7 +6030,7 @@ interface AuthProvider {
6001
6030
  */
6002
6031
  hasTier(requiredTier: string): Promise<boolean>;
6003
6032
  signInWithEmail(email: string, password: string): Promise<AuthResult | null>;
6004
- createUserWithEmail(email: string, password: string): Promise<AuthResult | null>;
6033
+ createUserWithEmail(email: string, password: string, metadata?: SignUpMetadata): Promise<AuthResult | null>;
6005
6034
  signInWithPartner(partnerId: AuthPartnerId, method?: AuthMethod): Promise<AuthResult | null>;
6006
6035
  linkWithPartner(partnerId: AuthPartnerId, method?: AuthMethod): Promise<AuthResult | null>;
6007
6036
  signInWithGoogleCredential(credential: string): Promise<AuthResult | null>;
@@ -6106,7 +6135,7 @@ interface AuthAPI {
6106
6135
  getCustomClaims: () => Record<string, unknown>;
6107
6136
  getCustomClaim: (claim: string) => unknown;
6108
6137
  signInWithEmail: (email: string, password: string) => Promise<AuthResult | null>;
6109
- createUserWithEmail: (email: string, password: string) => Promise<AuthResult | null>;
6138
+ createUserWithEmail: (email: string, password: string, metadata?: SignUpMetadata) => Promise<AuthResult | null>;
6110
6139
  signInWithPartner: (partnerId: AuthPartnerId, method?: string) => Promise<AuthResult | null>;
6111
6140
  linkWithPartner: (partnerId: AuthPartnerId, method?: string) => Promise<AuthResult | null>;
6112
6141
  signInWithGoogleCredential: (credential: string) => Promise<AuthResult | null>;
@@ -6387,13 +6416,16 @@ type Visibility = (typeof VISIBILITY)[keyof typeof VISIBILITY];
6387
6416
  * - 'generated': DB-generated — hidden from forms, stripped from writes
6388
6417
  * - 'computed': UI-computed (derived from other fields) — hidden from forms, included in writes
6389
6418
  *
6390
- * Any role string ('user', 'admin', 'super') is also accepted and checked via role hierarchy.
6419
+ * Custom role strings (e.g. future hierarchy keys) are accepted the same way as
6420
+ * {@link FieldType}: `(string & {})` keeps known literals distinguishable for
6421
+ * narrowing; plain `| string` would collapse to `boolean | string` and break
6422
+ * comparisons to `EDITABLE.GENERATED` / `EDITABLE.COMPUTED`.
6391
6423
  *
6392
6424
  * @version 0.1.0
6393
6425
  * @since 0.0.1
6394
6426
  * @author AMBROISE PARK Consulting
6395
6427
  */
6396
- type Editable = (typeof EDITABLE)[keyof typeof EDITABLE] | string;
6428
+ type Editable = (typeof EDITABLE)[keyof typeof EDITABLE] | (string & {});
6397
6429
  /**
6398
6430
  * Entity-level access configuration
6399
6431
  * Controls who can perform CRUD operations on the entity
@@ -7075,6 +7107,40 @@ interface BaseEntityFields {
7075
7107
  */
7076
7108
  status: EntityField<'select'>;
7077
7109
  }
7110
+ /**
7111
+ * Consumer `fields` merged with {@link BaseEntityFields} — same keys {@link defineEntity} returns.
7112
+ *
7113
+ * @version 0.1.0
7114
+ * @since 0.2.0
7115
+ */
7116
+ type MergedEntityFieldMap<F extends Record<string, EntityField>> = F & BaseEntityFields;
7117
+ /**
7118
+ * Merged field map with `readonly` stripped from keys — improves assignability of
7119
+ * `defineEntity` results to widened {@link AnyEntity} props.
7120
+ *
7121
+ * @version 0.1.0
7122
+ * @since 0.2.0
7123
+ */
7124
+ type MutableMergedEntityFieldMap<F extends Record<string, EntityField>> = {
7125
+ -readonly [K in keyof MergedEntityFieldMap<F>]: MergedEntityFieldMap<F>[K];
7126
+ };
7127
+ /**
7128
+ * Default merged field map when an entity is not parameterized with a literal field map.
7129
+ *
7130
+ * @version 0.1.0
7131
+ * @since 0.2.0
7132
+ */
7133
+ type EntityFieldMapDefault = Record<string, EntityField> & BaseEntityFields;
7134
+ /**
7135
+ * CRUD/cache document row inferred from an entity `fields` map (SSOT with `defineEntity` literals).
7136
+ * Intersects {@link Record} so rows satisfy `T extends Record<string, unknown>` (bulk, PII, adapters).
7137
+ *
7138
+ * @version 0.1.0
7139
+ * @since 0.2.0
7140
+ */
7141
+ type EntityRowFromFields<F extends Record<string, EntityField>> = {
7142
+ [K in keyof F]: F[K] extends EntityField<infer FT> ? FT extends keyof FieldTypeToValue ? FieldTypeToValue[FT] : unknown : unknown;
7143
+ } & Record<string, unknown>;
7078
7144
  /**
7079
7145
  * Unique key constraint definition for entity deduplication
7080
7146
  * Enables automatic checking for duplicates on create/update operations
@@ -7231,7 +7297,7 @@ interface ListCardLayout {
7231
7297
  * @since 0.0.1
7232
7298
  * @author AMBROISE PARK Consulting
7233
7299
  */
7234
- interface BusinessEntity {
7300
+ interface BusinessEntity<out F extends Record<string, EntityField> = Record<string, EntityField>> {
7235
7301
  /** Name of the entity */
7236
7302
  name: string;
7237
7303
  /** Firestore collection name */
@@ -7268,7 +7334,7 @@ interface BusinessEntity {
7268
7334
  */
7269
7335
  ownership?: EntityOwnershipConfig;
7270
7336
  /** Field definitions - name and label are required */
7271
- fields: Record<string, EntityField>;
7337
+ fields: F;
7272
7338
  /** Form configuration for advanced forms */
7273
7339
  form?: FormConfig;
7274
7340
  /**
@@ -7407,9 +7473,9 @@ interface BusinessEntity {
7407
7473
  * @since 0.0.1
7408
7474
  * @author AMBROISE PARK Consulting
7409
7475
  */
7410
- interface Entity extends BusinessEntity {
7476
+ interface Entity<out F extends Record<string, EntityField> = EntityFieldMapDefault> extends Omit<BusinessEntity<F>, 'access' | 'namespace'> {
7411
7477
  /** Field definitions including base fields */
7412
- fields: Record<string, EntityField> & BaseEntityFields;
7478
+ fields: F;
7413
7479
  /** Access configuration with defaults applied (always present after defineEntity) */
7414
7480
  access: Required<EntityAccessConfig>;
7415
7481
  /** i18n namespace for translations (always present after defineEntity, defaults to `entity-${name.toLowerCase()}`) */
@@ -7417,6 +7483,28 @@ interface Entity extends BusinessEntity {
7417
7483
  /** Multi-tenancy scope configuration (preserved from BusinessEntity if provided) */
7418
7484
  scope?: ScopeConfig;
7419
7485
  }
7486
+ /**
7487
+ * Document row type for an entity from {@link defineEntity} — use with `useCrud`, `bulk`, and list hooks.
7488
+ *
7489
+ * @version 0.1.0
7490
+ * @since 0.2.0
7491
+ */
7492
+ /**
7493
+ * Widened entity type for props and APIs that accept any `defineEntity()` result
7494
+ * without casting to default {@link Entity}.
7495
+ *
7496
+ * @version 0.1.0
7497
+ * @since 0.2.0
7498
+ */
7499
+ type AnyEntity = Entity<Record<string, EntityField>>;
7500
+ /**
7501
+ * Inferred document row for an entity. Always includes `id` so rows are valid for
7502
+ * lists, keys, and `Record<string, any>`-shaped component props even when `E` is
7503
+ * the widened {@link AnyEntity} (`fields` is only a string index signature).
7504
+ */
7505
+ type InferEntityRow<E extends AnyEntity> = EntityRowFromFields<E['fields']> & {
7506
+ id: string;
7507
+ };
7420
7508
  /**
7421
7509
  * Unified metadata structure for all schemas (CRUD, Functions, etc.)
7422
7510
  * Consolidates different metadata patterns into one DRY interface
@@ -7657,14 +7745,241 @@ interface ListEntitiesResponse {
7657
7745
  }
7658
7746
 
7659
7747
  /**
7660
- * @fileoverview CRUD Adapter Interface
7661
- * @description Provider-agnostic interface for CRUD data access.
7662
- * Any backend (Firestore, Supabase, REST, Postgres) must implement this contract.
7748
+ * @fileoverview CRUD Types
7749
+ * @description Type definitions for CRUD domain. Defines entity types, field types, and CRUD-related interfaces.
7750
+ * Uses unified FeatureStatus enum for feature state management.
7663
7751
  *
7664
7752
  * @version 0.1.0
7665
- * @since 0.5.0
7753
+ * @since 0.0.1
7754
+ * @author AMBROISE PARK Consulting
7755
+ */
7756
+
7757
+ /**
7758
+ * Payload for create flows (`add`, bulk `inserts`) before the document has a
7759
+ * stable `id` (server- or client-generated). Matches runtime: optimistic add
7760
+ * mints a temp id; the create schema validates this shape.
7761
+ *
7762
+ * @version 0.1.0
7763
+ * @since 0.2.0
7764
+ */
7765
+ type CrudCreateInput<T> = T extends Record<string, unknown> ? Omit<T, 'id'> : Record<string, unknown>;
7766
+ /**
7767
+ * CRUD API type - complete interface for useCrud hook
7768
+ *
7769
+ * @version 0.1.0
7770
+ * @since 0.0.1
7771
+ * @author AMBROISE PARK Consulting
7772
+ */
7773
+ interface CrudAPI<T = unknown> {
7774
+ /**
7775
+ * Unified feature status - single source of truth for CRUD state.
7776
+ * - `initializing`: CRUD is loading/initializing
7777
+ * - `ready`: CRUD fully operational
7778
+ * - `degraded`: CRUD unavailable (feature not installed/consent not given)
7779
+ * - `error`: CRUD encountered error
7780
+ */
7781
+ status: FeatureStatus;
7782
+ /** Current data (from get/subscribe) */
7783
+ data: T | null;
7784
+ /** Loading state for async operations */
7785
+ loading: boolean;
7786
+ /** Last error encountered */
7787
+ error: Error | null;
7788
+ /** Fetch single document by ID */
7789
+ get: (id: string) => Promise<T | null>;
7790
+ /** Set/replace document by ID */
7791
+ set: (id: string, data: T, options?: {
7792
+ showSuccessToast?: boolean;
7793
+ }) => Promise<void>;
7794
+ /** Partial update document by ID */
7795
+ update: (id: string, data: Partial<T>, options?: {
7796
+ showSuccessToast?: boolean;
7797
+ }) => Promise<void>;
7798
+ /** Delete document by ID */
7799
+ delete: (id: string, options?: {
7800
+ showSuccessToast?: boolean;
7801
+ }) => Promise<void>;
7802
+ /** Add new document (auto-generated ID) */
7803
+ add: (data: CrudCreateInput<T>, options?: {
7804
+ showSuccessToast?: boolean;
7805
+ }) => Promise<string>;
7806
+ /** Query collection with filters */
7807
+ query: (options: QueryOptions) => Promise<T[]>;
7808
+ /** Subscribe to document changes */
7809
+ subscribe: (id: string, callback: (data: T | null, error?: Error) => void) => () => void;
7810
+ /** Subscribe to collection changes */
7811
+ subscribeToCollection: (options: QueryOptions, callback: (data: T[], error?: Error) => void) => () => void;
7812
+ /** Invalidate cache for this collection (TanStack Query) */
7813
+ invalidate: () => Promise<void>;
7814
+ /** Whether CRUD is available and operational */
7815
+ isAvailable: boolean;
7816
+ /**
7817
+ * Cross-collection atomic bulk write. One optimistic pass, one toast,
7818
+ * coordinated rollback. Batches with `dependsOn` run after their
7819
+ * dependencies; independent batches run in parallel.
7820
+ */
7821
+ bulkAcross?: (batches: BulkAcrossBatch[], options?: {
7822
+ showSuccessToast?: boolean;
7823
+ }) => Promise<BulkAcrossResult>;
7824
+ }
7825
+ /**
7826
+ * Base props for entity templates
7827
+ * @template T - The form values type
7828
+ *
7829
+ * @version 0.1.0
7830
+ * @since 0.0.1
7831
+ * @author AMBROISE PARK Consulting
7832
+ */
7833
+ interface EntityTemplateProps<T extends FieldValues> {
7834
+ /** The DoNotDev schema for the entity */
7835
+ schema: dndevSchema<T>;
7836
+ /** Optional overrides for field configuration */
7837
+ fieldOverrides?: Partial<Record<keyof T, Partial<EntityField>>>;
7838
+ }
7839
+ /**
7840
+ * Column definition for list views
7841
+ * @template T - The item type
7842
+ *
7843
+ * @version 0.1.0
7844
+ * @since 0.0.1
7845
+ * @author AMBROISE PARK Consulting
7846
+ */
7847
+ interface ColumnDef<T extends FieldValues> {
7848
+ /** Key in the data object */
7849
+ key: keyof T;
7850
+ /** Display label */
7851
+ label: string;
7852
+ /** Optional custom render function */
7853
+ render?: (value: T[keyof T], row: T) => ReactNode;
7854
+ }
7855
+ /**
7856
+ * Input shape for a bulk CRUD operation. All three fields are optional — callers
7857
+ * include only the buckets they need. Items are processed in input order per
7858
+ * bucket and returned in the same order in {@link BulkResult}.
7859
+ *
7860
+ * Semantics (enforced by the service, not the adapter):
7861
+ * - Atomic: all ops succeed or none do.
7862
+ * - Collision rejection: an id appearing in both `updates` and `deletes`, or both
7863
+ * `inserts` and `updates`, fails up-front with {@link BulkCollisionError}.
7864
+ * - Empty bulk (`{}`) is a no-op that returns a zeroed {@link BulkResult}
7865
+ * without hitting the adapter.
7866
+ *
7867
+ * @template T - Entity type for the collection. Must be an object so PII
7868
+ * encryption, cache merging and adapter mapping can treat each row as a
7869
+ * `Record<string, unknown>`.
7870
+ *
7871
+ * @example
7872
+ * const ops: BulkOperations<Event> = {
7873
+ * inserts: [{ title: 'A' }, { title: 'B' }],
7874
+ * updates: [{ id: 'e1', patch: { title: 'renamed' } }],
7875
+ * deletes: ['e2', 'e3'],
7876
+ * };
7877
+ *
7878
+ * @version 0.1.0
7879
+ * @since 0.2.0
7880
+ * @author AMBROISE PARK Consulting
7881
+ */
7882
+ interface BulkOperations<T extends Record<string, unknown>> {
7883
+ /** New rows to insert. IDs are server-assigned and returned in {@link BulkResult.insertedIds}. */
7884
+ inserts?: CrudCreateInput<T>[];
7885
+ /** Partial updates keyed by id. `patch` is a shallow merge on top of the stored row. */
7886
+ updates?: Array<{
7887
+ id: string;
7888
+ patch: Partial<T>;
7889
+ }>;
7890
+ /** IDs to delete. */
7891
+ deletes?: string[];
7892
+ }
7893
+ /**
7894
+ * Result of a bulk CRUD operation. Each id list preserves the input order of the
7895
+ * corresponding bucket in {@link BulkOperations}.
7896
+ *
7897
+ * @example
7898
+ * const r: BulkResult = await adapter.bulk('events', {
7899
+ * inserts: [{ title: 'A' }],
7900
+ * deletes: ['x'],
7901
+ * });
7902
+ * r.insertedIds; // ['evt_123']
7903
+ * r.deletedIds; // ['x']
7904
+ *
7905
+ * @version 0.1.0
7906
+ * @since 0.2.0
7907
+ * @author AMBROISE PARK Consulting
7908
+ */
7909
+ interface BulkResult {
7910
+ /** Server-assigned IDs for `inserts`, in input order. */
7911
+ insertedIds: string[];
7912
+ /** IDs that were updated, in input order. */
7913
+ updatedIds: string[];
7914
+ /** IDs that were deleted, in input order. */
7915
+ deletedIds: string[];
7916
+ }
7917
+ /**
7918
+ * One collection's worth of operations inside a {@link bulkAcross} call.
7919
+ *
7920
+ * Inserts may include a caller-provided `id` for cross-collection pre-minting:
7921
+ * mint the ID client-side, use it in both collections, and pass `dependsOn` to
7922
+ * ensure write order.
7923
+ *
7924
+ * @template T - Entity type for this batch's collection.
7925
+ *
7926
+ * @example
7927
+ * const customerId = generateUUID();
7928
+ * await bulkAcross([
7929
+ * {
7930
+ * collection: 'customers',
7931
+ * inserts: [{ id: customerId, ...customerData }],
7932
+ * schemas: { create: customerCreateSchema },
7933
+ * },
7934
+ * {
7935
+ * collection: 'inquiries',
7936
+ * inserts: [{ customerId, ...inquiryData }],
7937
+ * schemas: { create: inquiryCreateSchema },
7938
+ * dependsOn: ['customers'],
7939
+ * },
7940
+ * ]);
7941
+ *
7942
+ * @version 0.1.0
7943
+ * @since 0.3.0
7666
7944
  * @author AMBROISE PARK Consulting
7667
7945
  */
7946
+ interface BulkAcrossBatch<T extends Record<string, unknown> = Record<string, unknown>> {
7947
+ /** Target collection name. */
7948
+ collection: string;
7949
+ /** Rows to insert. May include a caller-provided `id` for pre-minting. */
7950
+ inserts?: Array<CrudCreateInput<T> & {
7951
+ id?: string;
7952
+ }>;
7953
+ /** Rows to update (partial patches). */
7954
+ updates?: Array<{
7955
+ id: string;
7956
+ patch: Partial<T>;
7957
+ }>;
7958
+ /** Document IDs to delete. */
7959
+ deletes?: string[];
7960
+ /** Schemas for insert validation + PII resolution. */
7961
+ schemas: {
7962
+ create?: dndevSchema<T>;
7963
+ draft?: dndevSchema<T>;
7964
+ update?: dndevSchema<T>;
7965
+ };
7966
+ /**
7967
+ * Collections that must be written first.
7968
+ * Batches with no `dependsOn` run in parallel with other dependency-free batches.
7969
+ */
7970
+ dependsOn?: string[];
7971
+ }
7972
+ /**
7973
+ * Result of a {@link bulkAcross} call. Per-collection results keyed by collection name.
7974
+ *
7975
+ * @version 0.1.0
7976
+ * @since 0.3.0
7977
+ * @author AMBROISE PARK Consulting
7978
+ */
7979
+ interface BulkAcrossResult {
7980
+ /** Per-collection {@link BulkResult}, keyed by collection name. */
7981
+ results: Record<string, BulkResult>;
7982
+ }
7668
7983
 
7669
7984
  /** Single where clause for a query. operator accepts CrudOperator or string so consumer code can use variables or literals ('in', '==', etc.) without importing CRUD_OPERATORS. */
7670
7985
  interface QueryWhereClause {
@@ -7711,6 +8026,40 @@ interface PaginatedQueryResult<T> {
7711
8026
  /** Opaque cursor for the next page */
7712
8027
  lastVisible?: string | null;
7713
8028
  }
8029
+ /**
8030
+ * Return shape of the CRUD list-query option builder
8031
+ * (`CrudService.getListQueryOptions` / `getListQueryOptionsImpl`).
8032
+ *
8033
+ * This is the TanStack-compatible descriptor handed to `useQuery()`. Lifted
8034
+ * into `@donotdev/core` so the CRUD facade and its impl can both annotate
8035
+ * their return types against a single source — the inferred-only shape
8036
+ * caused circular type inference (TS7023) after the 1949-LOC CrudService
8037
+ * split.
8038
+ *
8039
+ * **Invariant:** `queryKey[3]` is `JSON.stringify(queryOptions)` — list and
8040
+ * listCard views share the same key, yielding one network read.
8041
+ *
8042
+ * @template T - The entity type in list items
8043
+ */
8044
+ interface CrudListQuery<T> {
8045
+ readonly queryKey: readonly ['crud', string, 'query', string];
8046
+ readonly queryFn: () => Promise<PaginatedQueryResult<T>>;
8047
+ readonly staleTime: number;
8048
+ }
8049
+ /**
8050
+ * Return shape of the CRUD single-document query option builder
8051
+ * (`CrudService.getDocQueryOptions` / `getDocQueryOptionsImpl`).
8052
+ *
8053
+ * TanStack-compatible descriptor for `useQuery()`. See `CrudListQuery` for
8054
+ * the rationale behind promoting this shape into core types.
8055
+ *
8056
+ * @template T - The document entity type
8057
+ */
8058
+ interface CrudDocQuery<T> {
8059
+ readonly queryKey: readonly ['crud', string, 'get', string];
8060
+ readonly queryFn: () => Promise<T | null>;
8061
+ readonly staleTime: number;
8062
+ }
7714
8063
  /** Callback for single-document subscriptions */
7715
8064
  type DocumentSubscriptionCallback<T> = (data: T | null, error?: Error) => void;
7716
8065
  /** Callback for collection subscriptions */
@@ -7720,6 +8069,17 @@ interface CrudOperationOptions {
7720
8069
  /** AbortSignal to cancel the operation */
7721
8070
  signal?: AbortSignal;
7722
8071
  }
8072
+
8073
+ /**
8074
+ * @fileoverview CRUD Adapter Interface
8075
+ * @description Provider-agnostic interface for CRUD data access.
8076
+ * Any backend (Firestore, Supabase, REST, Postgres) must implement this contract.
8077
+ *
8078
+ * @version 0.1.0
8079
+ * @since 0.5.0
8080
+ * @author AMBROISE PARK Consulting
8081
+ */
8082
+
7723
8083
  /**
7724
8084
  * Provider-agnostic CRUD adapter interface.
7725
8085
  *
@@ -7757,6 +8117,18 @@ interface ICrudAdapter {
7757
8117
  id: string;
7758
8118
  data: Record<string, unknown>;
7759
8119
  }>;
8120
+ /**
8121
+ * Execute a bulk transactional operation.
8122
+ * - All ops commit atomically. One transaction/writeBatch.
8123
+ * - One round-trip where the transport supports it.
8124
+ * - Empty ops returns a zeroed BulkResult without wire contact.
8125
+ * - Throws on partial failure; never leaves store in mixed state.
8126
+ *
8127
+ * @example
8128
+ * const r = await adapter.bulk('events', { inserts: [{ title: 'A' }], deletes: ['x'] });
8129
+ * r.insertedIds; r.deletedIds;
8130
+ */
8131
+ bulk<T extends Record<string, unknown>>(collection: string, ops: BulkOperations<T>, schema?: dndevSchema<T>, options?: CrudOperationOptions): Promise<BulkResult>;
7760
8132
  /** Set/replace a document by ID (upsert semantics). */
7761
8133
  set<T>(collection: string, id: string, data: T, schema?: dndevSchema<T>, options?: CrudOperationOptions): Promise<void>;
7762
8134
  /** Partial update a document by ID. */
@@ -7928,7 +8300,7 @@ interface AggregateResponse {
7928
8300
  */
7929
8301
  interface EntityBrowseBaseProps {
7930
8302
  /** The entity definition */
7931
- entity: Entity;
8303
+ entity: AnyEntity;
7932
8304
  /**
7933
8305
  * Base path for view. Default: `/${collection}`. View = `${basePath}/${id}`.
7934
8306
  */
@@ -8047,7 +8419,7 @@ interface CrudCardProps {
8047
8419
  id: string;
8048
8420
  };
8049
8421
  /** The entity definition (for entity.fields and formatting) */
8050
- entity: Entity;
8422
+ entity: AnyEntity;
8051
8423
  /**
8052
8424
  * Called when card is clicked (e.g. open sheet instead of navigating).
8053
8425
  * Navigation via Link is handled by the parent wrapper (CrudCardLink), not by CrudCard itself.
@@ -8073,7 +8445,7 @@ interface CrudCardProps {
8073
8445
  /** Props for the entity form renderer with create/edit modes, validation, and navigation. */
8074
8446
  interface EntityFormRendererProps<T extends EntityRecord = EntityRecord> {
8075
8447
  /** Entity definition - pass the full entity from defineEntity() */
8076
- entity: Entity;
8448
+ entity: AnyEntity;
8077
8449
  /** Form submission handler */
8078
8450
  onSubmit: (data: T) => void | Promise<void>;
8079
8451
  /** Translation function */
@@ -8135,26 +8507,31 @@ interface EntityFormRendererProps<T extends EntityRecord = EntityRecord> {
8135
8507
  * If provided, cancel button will show (with cancelText or default "Cancel").
8136
8508
  */
8137
8509
  onCancel?: () => void;
8138
- /**
8139
- * Whether to show unsaved changes warning when navigating away.
8140
- * @default true
8141
- */
8142
- warnOnUnsavedChanges?: boolean;
8143
- /**
8144
- * Custom message for unsaved changes confirmation.
8145
- */
8146
- unsavedChangesMessage?: string;
8147
8510
  /**
8148
8511
  * Hide visibility indicators (badges + View As toggle).
8149
8512
  * When false (default), shows badge next to non-guest fields and View As role selector.
8150
8513
  * @default false
8151
8514
  */
8152
8515
  hideVisibilityInfo?: boolean;
8516
+ /**
8517
+ * Explicit form instance key for isolation between records.
8518
+ * When provided, React remounts the form whenever this value changes —
8519
+ * ensuring clean state when navigating between entities (e.g. `/cars/:id`).
8520
+ *
8521
+ * Pass the route ID: `instanceKey={id}`
8522
+ *
8523
+ * @example
8524
+ * ```tsx
8525
+ * // Automatically isolates form state per car — no manual reset needed
8526
+ * <EntityFormRenderer entity={carEntity} instanceKey={id} defaultValues={carData} />
8527
+ * ```
8528
+ */
8529
+ instanceKey?: string;
8153
8530
  }
8154
8531
  /** Props for the entity recommendations section (e.g. "Similar items"). */
8155
8532
  interface EntityRecommendationsProps {
8156
8533
  /** The entity definition */
8157
- entity: Entity;
8534
+ entity: AnyEntity;
8158
8535
  /** Query constraints — caller defines "related by what" (where, limit, etc.) */
8159
8536
  queryOptions: QueryOptions;
8160
8537
  /** Section title (e.g. "Similar apartments") */
@@ -8175,7 +8552,7 @@ interface EntityRecommendationsProps {
8175
8552
  /** Props for the read-only entity detail renderer with role-based visibility. */
8176
8553
  interface EntityDisplayRendererProps<T extends EntityRecord = EntityRecord> {
8177
8554
  /** Entity definition - pass the full entity from defineEntity() */
8178
- entity: Entity;
8555
+ entity: AnyEntity;
8179
8556
  /** Entity ID to fetch. Not required when `preview` is provided. */
8180
8557
  id?: string;
8181
8558
  /** Translation function (optional - auto-generated if not provided) */
@@ -8211,95 +8588,92 @@ interface EntityDisplayRendererProps<T extends EntityRecord = EntityRecord> {
8211
8588
  }
8212
8589
 
8213
8590
  /**
8214
- * @fileoverview CRUD Types
8215
- * @description Type definitions for CRUD domain. Defines entity types, field types, and CRUD-related interfaces.
8216
- * Uses unified FeatureStatus enum for feature state management.
8591
+ * @fileoverview CRUD Error Classes
8592
+ * @description Error classes raised by the CRUD service and adapters.
8593
+ * Each error is a plain {@link Error} subclass so consumers can `instanceof` them.
8217
8594
  *
8218
8595
  * @version 0.1.0
8219
- * @since 0.0.1
8596
+ * @since 0.2.0
8220
8597
  * @author AMBROISE PARK Consulting
8221
8598
  */
8222
-
8223
8599
  /**
8224
- * CRUD API type - complete interface for useCrud hook
8600
+ * Thrown when a {@link BulkOperations} payload contains the same id in two
8601
+ * mutually-exclusive buckets. The service rejects these up-front, before any
8602
+ * write is attempted, so partial state is impossible.
8603
+ *
8604
+ * @example
8605
+ * try {
8606
+ * await crud.bulk({
8607
+ * updates: [{ id: 'a', patch: {} }],
8608
+ * deletes: ['a'],
8609
+ * });
8610
+ * } catch (err) {
8611
+ * if (err instanceof BulkCollisionError) {
8612
+ * // err.collidingIds === ['a']
8613
+ * // err.where === 'updates-deletes'
8614
+ * }
8615
+ * }
8225
8616
  *
8226
8617
  * @version 0.1.0
8227
- * @since 0.0.1
8228
- * @author AMBROISE PARK Consulting
8618
+ * @since 0.2.0
8229
8619
  */
8230
- interface CrudAPI<T = unknown> {
8620
+ declare class BulkCollisionError extends Error {
8621
+ /** IDs that appear in both buckets. Preserves the order they were detected. */
8622
+ readonly collidingIds: string[];
8623
+ /** Which two buckets collided. */
8624
+ readonly where: 'updates-deletes' | 'inserts-updates';
8231
8625
  /**
8232
- * Unified feature status - single source of truth for CRUD state.
8233
- * - `initializing`: CRUD is loading/initializing
8234
- * - `ready`: CRUD fully operational
8235
- * - `degraded`: CRUD unavailable (feature not installed/consent not given)
8236
- * - `error`: CRUD encountered error
8626
+ * @param collidingIds - IDs present in both buckets.
8627
+ * @param where - The pair of buckets that produced the collision.
8237
8628
  */
8238
- status: FeatureStatus;
8239
- /** Current data (from get/subscribe) */
8240
- data: T | null;
8241
- /** Loading state for async operations */
8242
- loading: boolean;
8243
- /** Last error encountered */
8244
- error: Error | null;
8245
- /** Fetch single document by ID */
8246
- get: (id: string) => Promise<T | null>;
8247
- /** Set/replace document by ID */
8248
- set: (id: string, data: T, options?: {
8249
- showSuccessToast?: boolean;
8250
- }) => Promise<void>;
8251
- /** Partial update document by ID */
8252
- update: (id: string, data: Partial<T>, options?: {
8253
- showSuccessToast?: boolean;
8254
- }) => Promise<void>;
8255
- /** Delete document by ID */
8256
- delete: (id: string, options?: {
8257
- showSuccessToast?: boolean;
8258
- }) => Promise<void>;
8259
- /** Add new document (auto-generated ID) */
8260
- add: (data: T, options?: {
8261
- showSuccessToast?: boolean;
8262
- }) => Promise<string>;
8263
- /** Query collection with filters */
8264
- query: (options: QueryOptions) => Promise<T[]>;
8265
- /** Subscribe to document changes */
8266
- subscribe: (id: string, callback: (data: T | null, error?: Error) => void) => () => void;
8267
- /** Subscribe to collection changes */
8268
- subscribeToCollection: (options: QueryOptions, callback: (data: T[], error?: Error) => void) => () => void;
8269
- /** Invalidate cache for this collection (TanStack Query) */
8270
- invalidate: () => Promise<void>;
8271
- /** Whether CRUD is available and operational */
8272
- isAvailable: boolean;
8629
+ constructor(collidingIds: string[], where: 'updates-deletes' | 'inserts-updates');
8273
8630
  }
8274
8631
  /**
8275
- * Base props for entity templates
8276
- * @template T - The form values type
8632
+ * Thrown by {@link bulkAcross} before any side effect when `dependsOn`
8633
+ * relationships form a cycle. The `cycle` array lists the collection names
8634
+ * that form the circular dependency chain.
8635
+ *
8636
+ * @example
8637
+ * try {
8638
+ * await crud.bulkAcross([
8639
+ * { collection: 'a', dependsOn: ['b'], ... },
8640
+ * { collection: 'b', dependsOn: ['a'], ... },
8641
+ * ]);
8642
+ * } catch (err) {
8643
+ * if (err instanceof BulkAcrossCycleError) {
8644
+ * console.error(err.cycle); // ['a', 'b']
8645
+ * }
8646
+ * }
8277
8647
  *
8278
8648
  * @version 0.1.0
8279
- * @since 0.0.1
8280
- * @author AMBROISE PARK Consulting
8649
+ * @since 0.3.0
8281
8650
  */
8282
- interface EntityTemplateProps<T extends FieldValues> {
8283
- /** The DoNotDev schema for the entity */
8284
- schema: dndevSchema<T>;
8285
- /** Optional overrides for field configuration */
8286
- fieldOverrides?: Partial<Record<keyof T, Partial<EntityField>>>;
8651
+ declare class BulkAcrossCycleError extends Error {
8652
+ /** Collection names that form the cycle. */
8653
+ readonly cycle: string[];
8654
+ constructor(cycle: string[]);
8287
8655
  }
8288
8656
  /**
8289
- * Column definition for list views
8290
- * @template T - The item type
8657
+ * Thrown by an adapter whose `bulk()` method has not yet been implemented.
8658
+ * Lets the interface stay required across all providers while individual
8659
+ * adapters can land their implementation incrementally.
8660
+ *
8661
+ * @example
8662
+ * // Inside an adapter stub:
8663
+ * async bulk() {
8664
+ * throw new BulkNotImplementedError('restcrud');
8665
+ * }
8291
8666
  *
8292
8667
  * @version 0.1.0
8293
- * @since 0.0.1
8294
- * @author AMBROISE PARK Consulting
8668
+ * @since 0.2.0
8295
8669
  */
8296
- interface ColumnDef<T extends FieldValues> {
8297
- /** Key in the data object */
8298
- key: keyof T;
8299
- /** Display label */
8300
- label: string;
8301
- /** Optional custom render function */
8302
- render?: (value: T[keyof T], row: T) => ReactNode;
8670
+ declare class BulkNotImplementedError extends Error {
8671
+ /** Adapter identifier (e.g. `'firebase-firestore'`, `'supabase'`). */
8672
+ readonly adapterName: string;
8673
+ /**
8674
+ * @param adapterName - Name of the adapter that has not implemented `bulk()`.
8675
+ */
8676
+ constructor(adapterName: string);
8303
8677
  }
8304
8678
 
8305
8679
  /**
@@ -8585,7 +8959,7 @@ declare class DoNotDevError extends Error {
8585
8959
  * @since 0.0.1
8586
8960
  * @author AMBROISE PARK Consulting
8587
8961
  */
8588
- type AuditEventType = 'auth.login.success' | 'auth.login.failure' | 'auth.logout' | 'auth.locked' | 'auth.unlocked' | 'auth.mfa.enrolled' | 'auth.mfa.challenged' | 'auth.session.expired' | 'auth.password.reset' | 'auth.role.changed' | 'crud.create' | 'crud.read' | 'crud.update' | 'crud.delete' | 'pii.access' | 'pii.export' | 'pii.erase' | 'rate_limit.exceeded' | 'anomaly.detected' | 'config.changed';
8962
+ type AuditEventType = 'auth.login.success' | 'auth.login.failure' | 'auth.logout' | 'auth.locked' | 'auth.unlocked' | 'auth.mfa.enrolled' | 'auth.mfa.challenged' | 'auth.session.expired' | 'auth.password.reset' | 'auth.signup.consent' | 'auth.role.changed' | 'crud.create' | 'crud.read' | 'crud.update' | 'crud.delete' | 'crud.bulk' | 'pii.access' | 'pii.export' | 'pii.erase' | 'rate_limit.exceeded' | 'anomaly.detected' | 'config.changed';
8589
8963
  /**
8590
8964
  * A single structured audit log entry.
8591
8965
  *
@@ -9477,13 +9851,13 @@ interface Reference {
9477
9851
  */
9478
9852
  interface EntityMetadata {
9479
9853
  /** ISO 8601 timestamp when the entity was created */
9480
- _createdAt: string;
9854
+ createdAt: string;
9481
9855
  /** ISO 8601 timestamp when the entity was last updated */
9482
- _updatedAt: string;
9856
+ updatedAt: string;
9483
9857
  /** ID of the user who created the entity */
9484
- _createdBy: string;
9858
+ createdById: string;
9485
9859
  /** ID of the user who last updated the entity */
9486
- _updatedBy: string;
9860
+ updatedById: string;
9487
9861
  }
9488
9862
  /**
9489
9863
  * Utility type that adds metadata to a document.
@@ -11290,7 +11664,7 @@ interface ICallableProvider {
11290
11664
  type UploadProgressCallback = (percent: number) => void;
11291
11665
  /** Options for file upload */
11292
11666
  interface UploadOptions {
11293
- /** Storage path/prefix (e.g. 'uploads/images') */
11667
+ /** Folder path within the storage bucket (e.g. 'photos/2024'). Omit to upload to bucket root. */
11294
11668
  storagePath?: string;
11295
11669
  /** Custom filename override */
11296
11670
  filename?: string;
@@ -11361,7 +11735,7 @@ interface IStorageAdapter {
11361
11735
  * configureProviders({
11362
11736
  * crud: new SupabaseCrudAdapter(supabase),
11363
11737
  * auth: new SupabaseAuth(supabase),
11364
- * storage: new SupabaseStorageAdapter(supabase),
11738
+ * storage: new SupabaseStorageAdapter(supabase, 'your-bucket'),
11365
11739
  * });
11366
11740
  * ```
11367
11741
  *
@@ -12417,6 +12791,121 @@ type FeaturesWithoutConsent = {
12417
12791
  [K in FeatureName]: FeatureConsentRequirement<K> extends null ? K : never;
12418
12792
  }[FeatureName];
12419
12793
 
12794
+ /**
12795
+ * @fileoverview Canvas catalog types
12796
+ * @description TypeScript-only types describing widget definitions and the
12797
+ * shape stored in the catalog registry. Runtime validation lives in
12798
+ * `@donotdev/schemas` (see `schemas/common/canvas.ts`). This file is
12799
+ * purely structural and isomorphic (no React imports).
12800
+ *
12801
+ * The React component side of the registered widget is a concern of
12802
+ * `@donotdev/canvas` (the UI package). Server-side consumers (validators,
12803
+ * brokers) only need the definition shape, not the rendered component.
12804
+ *
12805
+ * @version 0.1.0
12806
+ * @since 0.1.0
12807
+ * @author AMBROISE PARK Consulting
12808
+ */
12809
+
12810
+ /**
12811
+ * Which surface a widget is allowed to render on.
12812
+ *
12813
+ * - `household` — any authenticated member.
12814
+ * - `private` — member-scoped (mail, 2nd-brain, homework).
12815
+ * - `meta` — framing widgets (TextBlock, Composite, ProgressCanvas, Confirmation).
12816
+ */
12817
+ type CanvasSurface = 'household' | 'private' | 'meta';
12818
+ /**
12819
+ * A valibot schema with an inferable output type. Accepts the generic base
12820
+ * schema shape used across the monorepo without locking to a specific issue type.
12821
+ */
12822
+ type AnyValibotSchema = v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>;
12823
+ /**
12824
+ * Declarative widget definition — the static metadata a widget module
12825
+ * exports before it is paired with its React component for registration.
12826
+ *
12827
+ * Discriminator: `kind` (string literal, unique in the catalog).
12828
+ *
12829
+ * - `schema` validates the block `payload` for this kind.
12830
+ * - `actions` is a record of action-name -> schema validating that action's event payload.
12831
+ * - `surface` controls policy-layer gating.
12832
+ * - `defaultLifetime` is used by the agent-side emitter when the agent does not override it.
12833
+ */
12834
+ interface WidgetDef<Kind extends string = string, PayloadSchema extends AnyValibotSchema = AnyValibotSchema, Actions extends Record<string, AnyValibotSchema> = Record<string, AnyValibotSchema>> {
12835
+ readonly kind: Kind;
12836
+ readonly schema: PayloadSchema;
12837
+ readonly actions: Actions;
12838
+ readonly surface: CanvasSurface;
12839
+ readonly defaultLifetime?: CanvasLifetime;
12840
+ }
12841
+ /**
12842
+ * Canvas block lifetime. Kept as a type alias here — the runtime schema
12843
+ * `CanvasLifetimeSchema` lives in `@donotdev/schemas`.
12844
+ *
12845
+ * - `ephemeral` — vanishes with the current turn (default).
12846
+ * - `session` — pinned to the current chat thread.
12847
+ * - `persistent` — lives on the PWA dashboard until manually removed.
12848
+ */
12849
+ type CanvasLifetime = 'ephemeral' | 'session' | 'persistent';
12850
+ /**
12851
+ * Optional display hints attached to a canvas block.
12852
+ */
12853
+ interface CanvasWidgetMetadata {
12854
+ readonly title?: string;
12855
+ readonly pinnable?: boolean;
12856
+ readonly preferredHeight?: number;
12857
+ }
12858
+ /**
12859
+ * Envelope for a single canvas block emitted by the agent.
12860
+ *
12861
+ * `payload` is intentionally `unknown` at the envelope level — it is
12862
+ * validated against the registered widget's payload schema inside
12863
+ * `validateBlock`. Do not trust `payload` without that check.
12864
+ */
12865
+ interface CanvasBlock {
12866
+ readonly id: string;
12867
+ readonly kind: string;
12868
+ readonly lifetime: CanvasLifetime;
12869
+ readonly metadata?: CanvasWidgetMetadata;
12870
+ readonly payload: unknown;
12871
+ }
12872
+ /**
12873
+ * Envelope for a user interaction event emitted back to the agent.
12874
+ *
12875
+ * `payload` is validated against the widget's per-action schema inside
12876
+ * `validateEvent`.
12877
+ */
12878
+ interface CanvasEvent {
12879
+ readonly widgetId: string;
12880
+ readonly action: string;
12881
+ readonly payload: unknown;
12882
+ }
12883
+ /**
12884
+ * Caller access tier passed to `validateBlock` for surface gating.
12885
+ *
12886
+ * Mirrors the gontrand access model. `kid` and `null` fail closed for any
12887
+ * non-`meta` surface at the canvas boundary.
12888
+ */
12889
+ type CanvasCallerAccess = 'admin' | 'member' | 'kid' | null;
12890
+ /**
12891
+ * Optional options for `validateBlock`. When `caller` is present, the
12892
+ * widget's `surface` is matched against the caller's access tier after
12893
+ * envelope / kind / payload checks pass.
12894
+ */
12895
+ interface ValidateBlockOptions {
12896
+ readonly caller?: {
12897
+ readonly access: CanvasCallerAccess;
12898
+ };
12899
+ }
12900
+ /**
12901
+ * Props every widget component receives from `CanvasHost`. The React
12902
+ * component shape itself lives in `@donotdev/canvas` (UI package).
12903
+ */
12904
+ interface CanvasWidgetProps {
12905
+ readonly payload: unknown;
12906
+ readonly emit: (action: string, payload: unknown) => void;
12907
+ }
12908
+
12420
12909
  /** Options for the handleError utility. */
12421
12910
  interface HandleErrorOptions {
12422
12911
  userMessage?: string;
@@ -12881,10 +13370,10 @@ declare function translateArrayWithIndices(t: TFunction, keyPrefix: string, maxI
12881
13370
  * for database operations, ensuring consistency across the application.
12882
13371
  *
12883
13372
  * **Metadata Fields:**
12884
- * - `_createdAt`: ISO timestamp when document was created
12885
- * - `_updatedAt`: ISO timestamp when document was last updated
12886
- * - `_createdBy`: User ID who created the document
12887
- * - `_updatedBy`: User ID who last updated the document
13373
+ * - `createdAt`: ISO timestamp when document was created
13374
+ * - `updatedAt`: ISO timestamp when document was last updated
13375
+ * - `createdById`: User ID who created the document
13376
+ * - `updatedById`: User ID who last updated the document
12888
13377
  *
12889
13378
  * @version 0.1.0
12890
13379
  * @since 0.0.1
@@ -12934,10 +13423,10 @@ declare function translateArrayWithIndices(t: TFunction, keyPrefix: string, maxI
12934
13423
  * ```
12935
13424
  */
12936
13425
  declare function createMetadata(userId: string): {
12937
- _createdAt: string;
12938
- _updatedAt: string;
12939
- _createdBy: string;
12940
- _updatedBy: string;
13426
+ createdAt: string;
13427
+ updatedAt: string;
13428
+ createdById: string;
13429
+ updatedById: string;
12941
13430
  };
12942
13431
 
12943
13432
  /**
@@ -13618,7 +14107,7 @@ declare function hasTierAccess(userTier: string | undefined, requiredTier: strin
13618
14107
  * configureProviders({
13619
14108
  * crud: new SupabaseCrudAdapter(supabase),
13620
14109
  * auth: new SupabaseAuth(supabase),
13621
- * storage: new SupabaseStorageAdapter(supabase),
14110
+ * storage: new SupabaseStorageAdapter(supabase, 'your-bucket'),
13622
14111
  * });
13623
14112
  * ```
13624
14113
  *
@@ -13826,8 +14315,8 @@ declare class SingletonManager {
13826
14315
  * @returns An object with update timestamp and user ID
13827
14316
  */
13828
14317
  declare function updateMetadata(userId: string): {
13829
- _updatedAt: string;
13830
- _updatedBy: string;
14318
+ updatedAt: string;
14319
+ updatedById: string;
13831
14320
  };
13832
14321
 
13833
14322
  /**
@@ -14911,7 +15400,9 @@ declare const baseFields: TypedBaseFields;
14911
15400
  * @since 0.0.1
14912
15401
  * @author AMBROISE PARK Consulting
14913
15402
  */
14914
- declare function defineEntity(entity: BusinessEntity): Entity;
15403
+ declare function defineEntity<const F extends Record<string, EntityField>>(entity: Omit<BusinessEntity<F>, 'fields'> & {
15404
+ fields: F;
15405
+ }): Entity<MutableMergedEntityFieldMap<F>>;
14915
15406
 
14916
15407
  /**
14917
15408
  * @fileoverview Unified Schema Generation
@@ -14970,7 +15461,7 @@ interface OperationSchemas {
14970
15461
  * // schemas.delete - just { id }
14971
15462
  * ```
14972
15463
  */
14973
- declare function createSchemas(entity: Entity): OperationSchemas;
15464
+ declare function createSchemas(entity: AnyEntity): OperationSchemas;
14974
15465
 
14975
15466
  /**
14976
15467
  * @fileoverview Option generation helpers for select fields
@@ -15131,5 +15622,261 @@ declare function getRegisteredScopeProviders(): string[];
15131
15622
  */
15132
15623
  declare function clearScopeProviders(): void;
15133
15624
 
15134
- export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AIChatRequestSchema, AIChatResponseSchema, AIMessageSchema, AIProviderConfigSchema, AIToolCallSchema, AIToolDefinitionSchema, AIUsageSchema, AI_ERROR_CODES, AI_MODELS, AI_PROVIDERS, AI_ROLES, AI_TIERS, AI_TOKEN_PRICING, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_AI_CONFIG, DEFAULT_AI_MARKUP, DEFAULT_CRUD_TIMEOUT, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DEFAULT_UPLOAD_TIMEOUT, DENSITY, DoNotDevError, EDITABLE, EMAIL_ERROR_CODES, EMAIL_PROVIDERS, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, FOOTER_MODE, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LAYOUT_PRESET, LIST_SCHEMA_TYPE, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, SendEmailRequestSchema, SendEmailResponseSchema, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearGlobalSingleton, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, generateUUID, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getGlobalSingleton, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, resetProviders, revokeGitHubAccessSchema, safeValidate, sanitizeHref, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAIChatRequest, validateAIChatResponse, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateMetadata, validateOAuthPartners, validateSendEmailRequest, validateSendEmailResponse, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, withTimeout, wrapAuthError, wrapCrudError, wrapStorageError };
15135
- export type { AIAPI, AIChatRequest, AIChatResponse, AIConfig, AICostConfig, AICostEvent, AICostRecord, AICostResult, AIErrorCode, AIMessage, AIModelPricing, AIProvider, AIProviderConfig, AIRateLimitConfig, AIRouteConfig, AITierId, AIToolCall, AIToolDefinition, AIToolParameter, AIUsage, AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyFieldValue, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner, AuthPartnerHookResult, AuthPartnerId, AuthPartnerResult, AuthPartnerState, AuthProvider, AuthProviderProps, AuthRedirectHookResult, AuthRedirectOperation, AuthRedirectOptions, AuthResult, AuthState, AuthStateStore, AuthStatus, AuthTokenHookResult, AuthUser, BackendGeneratedField, BaseActions, BaseCredentials, BaseDocument, BaseEntityFields, BasePartnerState, BaseState, BaseStoreActions, BaseStoreState, BaseUserProfile, BasicUserInfo, BeforeCheckoutHook, BeforeCheckoutResult, BillingAPI, BillingAdapter, BillingErrorCode, BillingEvent, BillingEventData, BillingEventKey, BillingEventName, BillingProvider, BillingProviderConfig, BillingRedirectOperation, Breakpoint, BreakpointUtils, BuiltInFieldType, BusinessEntity, CachedError, CanAPI, CheckGitHubAccessRequest, CheckoutMode, CheckoutOptions, CheckoutSessionMetadata, CollectionSubscriptionCallback, ColumnDef, CommonSubscriptionFeatures, CommonTranslations, ConditionBuilderLike, ConditionExpression, ConditionGroup, ConditionInput, ConditionNode, ConditionOperator, ConditionResult, ConditionalBehavior, ConfidenceLevel, ConnectOptions, ConsentAPI, ConsentActions, ConsentCategory, ConsentState, Context, CookieOptions, CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, CreateEntityData, CreateEntityRequest, CreateEntityResponse, CrudAPI, CrudCardProps, CrudConfig, CrudOperationOptions, CrudOperator, CurrencyEntry, CustomClaims, CustomFieldOptionsMap, CustomSchemaGenerator, CustomStoreConfig, DateFormatOptions, DateFormatPreset, DateValue, DeleteEntityRequest, DeleteEntityResponse, Density, DnDevOverride, DnDevWrapper, DndevFrameworkConfig, DndevProviders, DndevStoreApi, DoNotDevCookieCategories, DocumentSubscriptionCallback, DynamicFormRule, Editable, EffectiveConnectionType, EmailConfig, EmailErrorCode, EmailProvider, EmailRouteConfig, EmailTemplate, EmailTemplateRegistry, EmailVerificationHookResult, EmailVerificationStatus, Entity, EntityAccessConfig, EntityAccessDefaults, EntityBrowseBaseProps, EntityCardListProps, EntityDisplayRendererProps, EntityField, EntityFormRendererProps, EntityHookErrors, EntityListProps, EntityMetadata, EntityOwnershipConfig, EntityOwnershipPublicCondition, EntityRecommendationsProps, EntityRecord, EntityTemplateProps, EntityTranslations, EnvironmentMode, ErrorCode, ErrorHandlerConfig, ErrorHandlerFunction, ErrorSeverity, ErrorSource, ExchangeTokenParams, ExchangeTokenRequest, ExchangeTokenResponse, FaviconConfig, Feature, FeatureAccessHookResult, FeatureConsentRequirement, FeatureHookResult, FeatureId, FeatureName, FeatureStatus, FeaturesConfig, FeaturesPluginConfig, FeaturesRequiringAnyConsent, FeaturesRequiringConsent, FeaturesWithoutConsent, FieldCondition, FieldType, FieldTypeToValue, FileAsset, FilterVisibleFieldsOptions, FirebaseCallOptions, FirebaseConfig, FirestoreTimestamp, FirestoreUniqueConstraintValidator, FooterConfig, FooterMode, FooterZoneConfig, FormConfig, FormStep, FunctionCallConfig, FunctionCallContext, FunctionCallOptions, FunctionCallResult, FunctionClient, FunctionClientFactoryOptions, FunctionDefaults, FunctionEndpoint, FunctionError, FunctionLoader, FunctionMemory, FunctionMeta, FunctionPlatform, FunctionResponse, FunctionSchema, FunctionSchemas, FunctionSystem, FunctionTrigger, FunctionsConfig, GetCustomClaimsResponse, GetEntityData, GetEntityRequest, GetEntityResponse, GetUserAuthStatusResponse, GetVisibleFieldsOptions, GitHubPermission, GitHubRepoConfig, GrantGitHubAccessRequest, GroupByDefinition, HandleErrorOptions, HeaderZoneConfig, I18nConfig, I18nPluginConfig, I18nProviderProps, ICallableProvider, ICrudAdapter, ID, INetworkManager, IServerAuthAdapter, IStorageAdapter, IStorageManager, IStorageStrategy, Invoice, InvoiceItem, LanguageData, LanguageInfo, LayoutConfig, LayoutPreset, LegalCompanyInfo, LegalConfig, LegalContactInfo, LegalDirectorInfo, LegalHostingInfo, LegalJurisdictionInfo, LegalSectionsConfig, LegalWebsiteInfo, ListCardLayout, ListEntitiesRequest, ListEntitiesResponse, ListEntityData, ListOptions, ListResponse, ListSchemaType, LoadingActions, LoadingState, LockoutResult, MergedBarConfig, MetricDefinition, MobileBehaviorConfig, ModalActions, ModalState, MutationResponse, NavigationRoute, NetworkCheckConfig, NetworkConnectionType, NetworkReconnectCallback, NetworkState, NetworkStatus, NetworkStatusHookResult, OAuthAPI, OAuthApiRequestOptions, OAuthCallbackHookResult, OAuthConnection, OAuthConnectionInfo, OAuthConnectionRequest, OAuthConnectionStatus, OAuthCredentials, OAuthEventData, OAuthEventKey, OAuthEventName, OAuthPartner, OAuthPartnerHookResult, OAuthPartnerId, OAuthPartnerResult, OAuthPartnerState, OAuthPurpose, OAuthRedirectOperation, OAuthRefreshRequest, OAuthRefreshResponse, OAuthResult, OAuthStoreActions, OAuthStoreState, Observable, OperationSchemas, OrderByClause, OrderDirection, PWAAssetType, PWADisplayMode, PWAPluginConfig, PageAuth, PageMeta, PaginatedQueryResult, PaginationOptions, PartnerConnectionState, PartnerIconId, PartnerId, PartnerResult, PartnerType, PayloadCacheEventData, PayloadDocument, PayloadDocumentEventData, PayloadEventKey, PayloadEventName, PayloadGlobalEventData, PayloadMediaEventData, PayloadPageRegenerationEventData, PayloadRequest, PayloadUserEventData, PaymentEventData, PaymentMethod, PaymentMethodType, PaymentMode, Permission, Picture, Platform, PresetConfig, PresetRegistry, ProcessPaymentSuccessRequest, ProcessPaymentSuccessResponse, ProductDeclaration, ProviderInstances, QueryConfig, QueryOptions, QueryOrderBy, QueryWhereClause, RateLimitBackend, RateLimitConfig, RateLimitManager, RateLimitResult, RateLimitState, RateLimiter, ReadCallback, RedirectOperation, RedirectOverlayActions, RedirectOverlayConfig, RedirectOverlayPhase, RedirectOverlayState, Reference, RefreshSubscriptionRequest, RefreshSubscriptionResponse, RemoveCustomClaimsResponse, ResolvedLayoutConfig, RevokeGitHubAccessRequest, RouteMeta, RouteSource, RoutesPluginConfig, SEOConfig, SchemaMetadata, SchemaWithVisibility, ScopeConfig, ScopeProviderFn, SecurityContext, SecurityEntityConfig, SelectOption, SendEmailRequest, SendEmailResponse, SeoMeta, ServerRateLimitConfig, ServerRateLimitResult, ServerUserRecord, SetCustomClaimsResponse, SidebarZoneConfig, SlotContent, StatusField, StorageOptions, StorageScope, StorageType, Store, StripeBackConfig, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSessionEventData, StripeConfig, StripeCustomer, StripeCustomerEventData, StripeEventData, StripeEventKey, StripeEventName, StripeFrontConfig, StripeInvoice, StripeInvoiceEventData, StripePayment, StripePaymentIntentEventData, StripePaymentMethod, StripePrice, StripeProduct, StripeProvider, StripeSubscription, StripeSubscriptionData, StripeWebhookEvent, StripeWebhookEventData, Subscription, SubscriptionClaims, SubscriptionConfig, SubscriptionData, SubscriptionDuration, SubscriptionEventData, SubscriptionHookResult, SubscriptionInfo, SubscriptionStatus, SubscriptionTier, SupportedLanguage, TechnicalField, ThemeActions, ThemeInfo, ThemeMode, ThemeState, ThemesPluginConfig, TierAccessHookResult, Timestamp, TokenInfo, TokenResponse, TokenState, TokenStatus, TranslationOptions, TranslationResource, TypedBaseFields, UIFieldOptions, UniqueConstraintValidator, UniqueKeyDefinition, UnsubscribeFn, UpdateEntityData, UpdateEntityRequest, UpdateEntityResponse, UploadOptions, UploadProgressCallback, UploadResult, UseFunctionsCallResult, UseFunctionsMutationOptions, UseFunctionsMutationResult, UseFunctionsQueryOptions, UseFunctionsQueryResult, UseTranslationOptionsEnhanced, UserContext, UserProfile, UserProviderData, UserRole, UserSubscription, ValidationRules, ValueTypeForField, VerifiedToken, Visibility, WebhookEvent, WebhookEventData, WhereClause, WhereOperator, WithMetadata, dndevSchema };
15625
+ /**
15626
+ * @fileoverview Bulk CRUD wire schemas
15627
+ * @description Valibot schemas for the transactional bulk endpoint
15628
+ * `POST /api/crud/:collection/bulk`. These are on-the-wire validators only —
15629
+ * row shapes are kept opaque (`record<string, unknown>`) because per-entity
15630
+ * validation is performed upstream by the CRUD service against the entity's
15631
+ * generated `create` / `update` schemas. Isomorphic (client + server).
15632
+ *
15633
+ * @version 0.1.0
15634
+ * @since 0.2.0
15635
+ * @author AMBROISE PARK Consulting
15636
+ */
15637
+
15638
+ /**
15639
+ * Opaque insert row schema.
15640
+ *
15641
+ * The bulk endpoint does not know the entity at parse time; per-field
15642
+ * validation is delegated to the CRUD service using the entity's `create`
15643
+ * schema. We only enforce the structural invariant: each insert is an object.
15644
+ *
15645
+ * @example
15646
+ * import * as v from 'valibot';
15647
+ * import { BulkInsertSchema } from '@donotdev/schemas';
15648
+ *
15649
+ * v.parse(BulkInsertSchema, { name: 'Alice', age: 30 });
15650
+ */
15651
+ declare const BulkInsertSchema: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
15652
+ /**
15653
+ * Opaque update row schema: `{ id, patch }`.
15654
+ *
15655
+ * `patch` keeps field-level validation deferred to the entity's `update`
15656
+ * schema, mirroring how single-row `update()` accepts a partial payload.
15657
+ *
15658
+ * @example
15659
+ * import * as v from 'valibot';
15660
+ * import { BulkUpdateSchema } from '@donotdev/schemas';
15661
+ *
15662
+ * v.parse(BulkUpdateSchema, { id: 'abc', patch: { name: 'Bob' } });
15663
+ */
15664
+ declare const BulkUpdateSchema: v.ObjectSchema<{
15665
+ readonly id: v.StringSchema<undefined>;
15666
+ readonly patch: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
15667
+ }, undefined>;
15668
+ /**
15669
+ * Opaque delete-id schema — a single document id.
15670
+ *
15671
+ * @example
15672
+ * import * as v from 'valibot';
15673
+ * import { BulkDeleteIdSchema } from '@donotdev/schemas';
15674
+ *
15675
+ * v.parse(BulkDeleteIdSchema, 'doc-123');
15676
+ */
15677
+ declare const BulkDeleteIdSchema: v.StringSchema<undefined>;
15678
+ /**
15679
+ * Wire schema for `POST /:collection/bulk` request body.
15680
+ *
15681
+ * All three op arrays are optional so clients can submit any subset.
15682
+ * An empty object `{}` is a valid no-op payload — the service short-circuits
15683
+ * and returns empty arrays without hitting the database.
15684
+ *
15685
+ * Per the bulk contract (see `BULK_CRUD_TODO.md`):
15686
+ * 1. Atomic — all ops succeed or none do.
15687
+ * 2. One round-trip.
15688
+ * 3. Validation up-front (per-entity schemas in CRUD service).
15689
+ * 4. Collision rejection (see `detectBulkCollisions`).
15690
+ *
15691
+ * @example
15692
+ * import * as v from 'valibot';
15693
+ * import { BulkRequestSchema } from '@donotdev/schemas';
15694
+ *
15695
+ * const body = v.parse(BulkRequestSchema, {
15696
+ * inserts: [{ name: 'Alice' }],
15697
+ * updates: [{ id: 'a', patch: { name: 'Bob' } }],
15698
+ * deletes: ['c'],
15699
+ * });
15700
+ */
15701
+ declare const BulkRequestSchema: v.ObjectSchema<{
15702
+ readonly inserts: v.OptionalSchema<v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
15703
+ readonly updates: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
15704
+ readonly id: v.StringSchema<undefined>;
15705
+ readonly patch: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
15706
+ }, undefined>, undefined>, undefined>;
15707
+ readonly deletes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
15708
+ }, undefined>;
15709
+ /**
15710
+ * Wire schema for `POST /:collection/bulk` response body.
15711
+ *
15712
+ * Arrays preserve input order so consumers can zip the echoed ids back onto
15713
+ * the client-side op list (e.g. to reconcile optimistic cache entries).
15714
+ *
15715
+ * @example
15716
+ * import * as v from 'valibot';
15717
+ * import { BulkResponseSchema } from '@donotdev/schemas';
15718
+ *
15719
+ * const result = v.parse(BulkResponseSchema, {
15720
+ * insertedIds: ['new-1'],
15721
+ * updatedIds: ['a'],
15722
+ * deletedIds: ['c'],
15723
+ * });
15724
+ */
15725
+ declare const BulkResponseSchema: v.ObjectSchema<{
15726
+ readonly insertedIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
15727
+ readonly updatedIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
15728
+ readonly deletedIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
15729
+ }, undefined>;
15730
+ /**
15731
+ * Inferred request type for the bulk endpoint.
15732
+ *
15733
+ * @example
15734
+ * import type { BulkRequest } from '@donotdev/schemas';
15735
+ *
15736
+ * const req: BulkRequest = { deletes: ['a'] };
15737
+ */
15738
+ type BulkRequest = v.InferOutput<typeof BulkRequestSchema>;
15739
+ /**
15740
+ * Inferred response type for the bulk endpoint.
15741
+ *
15742
+ * @example
15743
+ * import type { BulkResponse } from '@donotdev/schemas';
15744
+ *
15745
+ * const res: BulkResponse = { insertedIds: [], updatedIds: [], deletedIds: [] };
15746
+ */
15747
+ type BulkResponse = v.InferOutput<typeof BulkResponseSchema>;
15748
+ /**
15749
+ * Report returned by {@link detectBulkCollisions}.
15750
+ *
15751
+ * `where` identifies the first category of collision encountered. `collisions`
15752
+ * lists the offending ids for that category. Callers decide how to surface
15753
+ * this (the CRUD service throws; server handlers return 400).
15754
+ *
15755
+ * @since 0.2.0
15756
+ */
15757
+ interface BulkCollisionReport {
15758
+ /** Ids that appear in both collided sets. Empty iff `where === null`. */
15759
+ collisions: string[];
15760
+ /** Which pair collided, or `null` when no collision was found. */
15761
+ where: 'updates-deletes' | 'inserts-updates' | null;
15762
+ }
15763
+ /**
15764
+ * Detects id collisions that must reject a bulk op before any write.
15765
+ *
15766
+ * Separated from the Valibot parse so the wire schema stays purely structural
15767
+ * and callers can surface a precise error (which ids, which pair). Pure, no
15768
+ * side effects — the caller throws.
15769
+ *
15770
+ * Collision rules (see `BULK_CRUD_TODO.md` §7):
15771
+ * - Same id in `updates` and `deletes` → ambiguous intent, reject.
15772
+ * - Same id in `inserts` (if the client supplies an explicit `id`) and
15773
+ * `updates` → ambiguous intent, reject.
15774
+ * - Inserts without an explicit id never collide (server mints the id).
15775
+ *
15776
+ * Checks run in order: `updates-deletes` first, then `inserts-updates`. The
15777
+ * first collision found short-circuits — one clear error per request.
15778
+ *
15779
+ * @param ops - The bulk ops to inspect. All three arrays are optional.
15780
+ * @returns A report; `where === null` means no collision.
15781
+ *
15782
+ * @example
15783
+ * import { detectBulkCollisions } from '@donotdev/schemas';
15784
+ *
15785
+ * detectBulkCollisions({ updates: [{ id: 'a', patch: {} }], deletes: ['a'] });
15786
+ * // => { collisions: ['a'], where: 'updates-deletes' }
15787
+ */
15788
+ declare function detectBulkCollisions(ops: {
15789
+ inserts?: Array<{
15790
+ id?: string;
15791
+ [k: string]: unknown;
15792
+ }>;
15793
+ updates?: Array<{
15794
+ id: string;
15795
+ patch: unknown;
15796
+ }>;
15797
+ deletes?: string[];
15798
+ }): BulkCollisionReport;
15799
+
15800
+ /**
15801
+ * @fileoverview Canvas base schemas + catalog + validators
15802
+ * @description Valibot schemas for the two canvas contracts (agent -> canvas
15803
+ * render, canvas -> agent event), plus the process-local widget registry
15804
+ * and the two validation entry points (`validateBlock`, `validateEvent`).
15805
+ *
15806
+ * The catalog is the single trust boundary between untrusted
15807
+ * LLM-originated payloads and the renderer. Unknown kinds, missing
15808
+ * actions, and schema mismatches are all reported as `{ ok: false }`;
15809
+ * callers never receive malformed data.
15810
+ *
15811
+ * This file is isomorphic (no React). The React host + component
15812
+ * registration helpers live in `@donotdev/canvas`.
15813
+ *
15814
+ * @version 0.1.0
15815
+ * @since 0.1.0
15816
+ * @author AMBROISE PARK Consulting
15817
+ */
15818
+
15819
+ /**
15820
+ * Box-proxied image URL. Covers, avatars, thumbnails — every image in a
15821
+ * canvas widget MUST resolve through the box proxy.
15822
+ *
15823
+ * Accepted forms:
15824
+ * - `/proxy/...` — absolute proxy path on the same origin.
15825
+ * - `data:image/...` — inline data URI (agent-generated thumbnails).
15826
+ */
15827
+ declare const ProxiedImageUrlSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Image URL must be box-proxied (/proxy/...) or an inline data:image URI.">]>;
15828
+ declare const CanvasLifetimeSchema: v.PicklistSchema<["ephemeral", "session", "persistent"], undefined>;
15829
+ declare const CanvasWidgetMetadataSchema: v.ObjectSchema<{
15830
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15831
+ readonly pinnable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
15832
+ readonly preferredHeight: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
15833
+ }, undefined>;
15834
+ declare const CanvasBlockSchema: v.ObjectSchema<{
15835
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15836
+ readonly kind: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15837
+ readonly lifetime: v.OptionalSchema<v.PicklistSchema<["ephemeral", "session", "persistent"], undefined>, "ephemeral">;
15838
+ readonly metadata: v.OptionalSchema<v.ObjectSchema<{
15839
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15840
+ readonly pinnable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
15841
+ readonly preferredHeight: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
15842
+ }, undefined>, undefined>;
15843
+ readonly payload: v.UnknownSchema;
15844
+ }, undefined>;
15845
+ declare const CanvasEventSchema: v.ObjectSchema<{
15846
+ readonly widgetId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15847
+ readonly action: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15848
+ readonly payload: v.UnknownSchema;
15849
+ }, undefined>;
15850
+ /**
15851
+ * A widget as it lives in the registry. Widened to accept an arbitrary
15852
+ * component attachment so the UI package can register React components
15853
+ * without this module importing React.
15854
+ */
15855
+ interface RegisteredWidgetBase<Kind extends string = string, PayloadSchema extends AnyValibotSchema = AnyValibotSchema, Actions extends Record<string, AnyValibotSchema> = Record<string, AnyValibotSchema>> extends WidgetDef<Kind, PayloadSchema, Actions> {
15856
+ readonly component: unknown;
15857
+ }
15858
+ declare function registerWidget(widget: RegisteredWidgetBase): void;
15859
+ declare function getWidget(kind: string): RegisteredWidgetBase | undefined;
15860
+ declare function listWidgets(): readonly RegisteredWidgetBase[];
15861
+ type ValidateResult<T> = {
15862
+ readonly ok: true;
15863
+ readonly value: T;
15864
+ readonly widget: RegisteredWidgetBase;
15865
+ } | {
15866
+ readonly ok: false;
15867
+ readonly reason: string;
15868
+ };
15869
+ /**
15870
+ * Validate an incoming canvas block end-to-end: envelope shape, kind is
15871
+ * in the allowlist, payload conforms to the widget's payload schema, and
15872
+ * (optionally) the widget's surface is reachable by the caller's access tier.
15873
+ *
15874
+ * Failure ordering: envelope → kind → payload → surface. Surface-rejection
15875
+ * reasons are prefixed `surface_forbidden: ` so callers can distinguish
15876
+ * policy rejection from schema rejection.
15877
+ */
15878
+ declare function validateBlock(block: unknown, opts?: ValidateBlockOptions): ValidateResult<CanvasBlock>;
15879
+ declare function validateEvent(event: unknown, widgetKind: string): ValidateResult<CanvasEvent>;
15880
+
15881
+ export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AIChatRequestSchema, AIChatResponseSchema, AIMessageSchema, AIProviderConfigSchema, AIToolCallSchema, AIToolDefinitionSchema, AIUsageSchema, AI_ERROR_CODES, AI_MODELS, AI_PROVIDERS, AI_ROLES, AI_TIERS, AI_TOKEN_PRICING, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, BulkAcrossCycleError, BulkCollisionError, BulkDeleteIdSchema, BulkInsertSchema, BulkNotImplementedError, BulkRequestSchema, BulkResponseSchema, BulkUpdateSchema, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CanvasBlockSchema, CanvasEventSchema, CanvasLifetimeSchema, CanvasWidgetMetadataSchema, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_AI_CONFIG, DEFAULT_AI_MARKUP, DEFAULT_CRUD_TIMEOUT, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DEFAULT_UPLOAD_TIMEOUT, DENSITY, DoNotDevError, EDITABLE, EMAIL_ERROR_CODES, EMAIL_PROVIDERS, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, FOOTER_MODE, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LAYOUT_PRESET, LIST_SCHEMA_TYPE, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ProxiedImageUrlSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, SendEmailRequestSchema, SendEmailResponseSchema, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearGlobalSingleton, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectBulkCollisions, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, generateUUID, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getGlobalSingleton, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, getWidget, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, listWidgets, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, registerWidget, resetProviders, revokeGitHubAccessSchema, safeValidate, sanitizeHref, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAIChatRequest, validateAIChatResponse, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateBlock, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateEvent, validateMetadata, validateOAuthPartners, validateSendEmailRequest, validateSendEmailResponse, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, withTimeout, wrapAuthError, wrapCrudError, wrapStorageError };
15882
+ export type { AIAPI, AIChatRequest, AIChatResponse, AIConfig, AICostConfig, AICostEvent, AICostRecord, AICostResult, AIErrorCode, AIMessage, AIModelPricing, AIProvider, AIProviderConfig, AIRateLimitConfig, AIRouteConfig, AITierId, AIToolCall, AIToolDefinition, AIToolParameter, AIUsage, AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyEntity, AnyFieldValue, AnyValibotSchema, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner, AuthPartnerHookResult, AuthPartnerId, AuthPartnerResult, AuthPartnerState, AuthProvider, AuthProviderProps, AuthRedirectHookResult, AuthRedirectOperation, AuthRedirectOptions, AuthResult, AuthState, AuthStateStore, AuthStatus, AuthTokenHookResult, AuthUser, BackendGeneratedField, BaseActions, BaseCredentials, BaseDocument, BaseEntityFields, BasePartnerState, BaseState, BaseStoreActions, BaseStoreState, BaseUserProfile, BasicUserInfo, BeforeCheckoutHook, BeforeCheckoutResult, BillingAPI, BillingAdapter, BillingErrorCode, BillingEvent, BillingEventData, BillingEventKey, BillingEventName, BillingProvider, BillingProviderConfig, BillingRedirectOperation, Breakpoint, BreakpointUtils, BuiltInFieldType, BulkAcrossBatch, BulkAcrossResult, BulkCollisionReport, BulkOperations, BulkRequest, BulkResponse, BulkResult, BusinessEntity, CachedError, CanAPI, CanvasBlock, CanvasCallerAccess, CanvasEvent, CanvasLifetime, CanvasSurface, CanvasWidgetMetadata, CanvasWidgetProps, CheckGitHubAccessRequest, CheckoutMode, CheckoutOptions, CheckoutSessionMetadata, CollectionSubscriptionCallback, ColumnDef, CommonSubscriptionFeatures, CommonTranslations, ConditionBuilderLike, ConditionExpression, ConditionGroup, ConditionInput, ConditionNode, ConditionOperator, ConditionResult, ConditionalBehavior, ConfidenceLevel, ConnectOptions, ConsentAPI, ConsentActions, ConsentCategory, ConsentState, Context, CookieOptions, CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, CreateEntityData, CreateEntityRequest, CreateEntityResponse, CrudAPI, CrudCardProps, CrudConfig, CrudCreateInput, CrudDocQuery, CrudListQuery, CrudOperationOptions, CrudOperator, CurrencyEntry, CustomClaims, CustomFieldOptionsMap, CustomSchemaGenerator, CustomStoreConfig, DateFormatOptions, DateFormatPreset, DateValue, DeleteEntityRequest, DeleteEntityResponse, Density, DnDevOverride, DnDevWrapper, DndevFrameworkConfig, DndevProviders, DndevStoreApi, DoNotDevCookieCategories, DocumentSubscriptionCallback, DynamicFormRule, Editable, EffectiveConnectionType, EmailConfig, EmailErrorCode, EmailProvider, EmailRouteConfig, EmailTemplate, EmailTemplateRegistry, EmailVerificationHookResult, EmailVerificationStatus, Entity, EntityAccessConfig, EntityAccessDefaults, EntityBrowseBaseProps, EntityCardListProps, EntityDisplayRendererProps, EntityField, EntityFieldMapDefault, EntityFormRendererProps, EntityHookErrors, EntityListProps, EntityMetadata, EntityOwnershipConfig, EntityOwnershipPublicCondition, EntityRecommendationsProps, EntityRecord, EntityRowFromFields, EntityTemplateProps, EntityTranslations, EnvironmentMode, ErrorCode, ErrorHandlerConfig, ErrorHandlerFunction, ErrorSeverity, ErrorSource, ExchangeTokenParams, ExchangeTokenRequest, ExchangeTokenResponse, FaviconConfig, Feature, FeatureAccessHookResult, FeatureConsentRequirement, FeatureHookResult, FeatureId, FeatureName, FeatureStatus, FeaturesConfig, FeaturesPluginConfig, FeaturesRequiringAnyConsent, FeaturesRequiringConsent, FeaturesWithoutConsent, FieldCondition, FieldType, FieldTypeToValue, FileAsset, FilterVisibleFieldsOptions, FirebaseCallOptions, FirebaseConfig, FirestoreTimestamp, FirestoreUniqueConstraintValidator, FooterConfig, FooterMode, FooterZoneConfig, FormConfig, FormStep, FunctionCallConfig, FunctionCallContext, FunctionCallOptions, FunctionCallResult, FunctionClient, FunctionClientFactoryOptions, FunctionDefaults, FunctionEndpoint, FunctionError, FunctionLoader, FunctionMemory, FunctionMeta, FunctionPlatform, FunctionResponse, FunctionSchema, FunctionSchemas, FunctionSystem, FunctionTrigger, FunctionsConfig, GetCustomClaimsResponse, GetEntityData, GetEntityRequest, GetEntityResponse, GetUserAuthStatusResponse, GetVisibleFieldsOptions, GitHubPermission, GitHubRepoConfig, GrantGitHubAccessRequest, GroupByDefinition, HandleErrorOptions, HeaderZoneConfig, I18nConfig, I18nPluginConfig, I18nProviderProps, ICallableProvider, ICrudAdapter, ID, INetworkManager, IServerAuthAdapter, IStorageAdapter, IStorageManager, IStorageStrategy, InferEntityRow, Invoice, InvoiceItem, LanguageData, LanguageInfo, LayoutConfig, LayoutPreset, LegalCompanyInfo, LegalConfig, LegalContactInfo, LegalDirectorInfo, LegalHostingInfo, LegalJurisdictionInfo, LegalSectionsConfig, LegalWebsiteInfo, ListCardLayout, ListEntitiesRequest, ListEntitiesResponse, ListEntityData, ListOptions, ListResponse, ListSchemaType, LoadingActions, LoadingState, LockoutResult, MergedBarConfig, MergedEntityFieldMap, MetricDefinition, MobileBehaviorConfig, ModalActions, ModalState, MutableMergedEntityFieldMap, MutationResponse, NavigationRoute, NetworkCheckConfig, NetworkConnectionType, NetworkReconnectCallback, NetworkState, NetworkStatus, NetworkStatusHookResult, OAuthAPI, OAuthApiRequestOptions, OAuthCallbackHookResult, OAuthConnection, OAuthConnectionInfo, OAuthConnectionRequest, OAuthConnectionStatus, OAuthCredentials, OAuthEventData, OAuthEventKey, OAuthEventName, OAuthPartner, OAuthPartnerHookResult, OAuthPartnerId, OAuthPartnerResult, OAuthPartnerState, OAuthPurpose, OAuthRedirectOperation, OAuthRefreshRequest, OAuthRefreshResponse, OAuthResult, OAuthStoreActions, OAuthStoreState, Observable, OperationSchemas, OrderByClause, OrderDirection, PWAAssetType, PWADisplayMode, PWAPluginConfig, PageAuth, PageMeta, PaginatedQueryResult, PaginationOptions, PartnerConnectionState, PartnerIconId, PartnerId, PartnerResult, PartnerType, PayloadCacheEventData, PayloadDocument, PayloadDocumentEventData, PayloadEventKey, PayloadEventName, PayloadGlobalEventData, PayloadMediaEventData, PayloadPageRegenerationEventData, PayloadRequest, PayloadUserEventData, PaymentEventData, PaymentMethod, PaymentMethodType, PaymentMode, Permission, Picture, Platform, PresetConfig, PresetRegistry, ProcessPaymentSuccessRequest, ProcessPaymentSuccessResponse, ProductDeclaration, ProviderInstances, QueryConfig, QueryOptions, QueryOrderBy, QueryWhereClause, RateLimitBackend, RateLimitConfig, RateLimitManager, RateLimitResult, RateLimitState, RateLimiter, ReadCallback, RedirectOperation, RedirectOverlayActions, RedirectOverlayConfig, RedirectOverlayPhase, RedirectOverlayState, Reference, RefreshSubscriptionRequest, RefreshSubscriptionResponse, RegisteredWidgetBase, RemoveCustomClaimsResponse, ResolvedLayoutConfig, RevokeGitHubAccessRequest, RouteMeta, RouteSource, RoutesPluginConfig, SEOConfig, SchemaMetadata, SchemaWithVisibility, ScopeConfig, ScopeProviderFn, SecurityContext, SecurityEntityConfig, SelectOption, SendEmailRequest, SendEmailResponse, SeoMeta, ServerRateLimitConfig, ServerRateLimitResult, ServerUserRecord, SetCustomClaimsResponse, SidebarZoneConfig, SignUpMetadata, SlotContent, StatusField, StorageOptions, StorageScope, StorageType, Store, StripeBackConfig, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSessionEventData, StripeConfig, StripeCustomer, StripeCustomerEventData, StripeEventData, StripeEventKey, StripeEventName, StripeFrontConfig, StripeInvoice, StripeInvoiceEventData, StripePayment, StripePaymentIntentEventData, StripePaymentMethod, StripePrice, StripeProduct, StripeProvider, StripeSubscription, StripeSubscriptionData, StripeWebhookEvent, StripeWebhookEventData, Subscription, SubscriptionClaims, SubscriptionConfig, SubscriptionData, SubscriptionDuration, SubscriptionEventData, SubscriptionHookResult, SubscriptionInfo, SubscriptionStatus, SubscriptionTier, SupportedLanguage, TechnicalField, ThemeActions, ThemeInfo, ThemeMode, ThemeState, ThemesPluginConfig, TierAccessHookResult, Timestamp, TokenInfo, TokenResponse, TokenState, TokenStatus, TranslationOptions, TranslationResource, TypedBaseFields, UIFieldOptions, UniqueConstraintValidator, UniqueKeyDefinition, UnsubscribeFn, UpdateEntityData, UpdateEntityRequest, UpdateEntityResponse, UploadOptions, UploadProgressCallback, UploadResult, UseFunctionsCallResult, UseFunctionsMutationOptions, UseFunctionsMutationResult, UseFunctionsQueryOptions, UseFunctionsQueryResult, UseTranslationOptionsEnhanced, UserContext, UserProfile, UserProviderData, UserRole, UserSubscription, ValidateBlockOptions, ValidateResult, ValidationRules, ValueTypeForField, VerifiedToken, Visibility, WebhookEvent, WebhookEventData, WhereClause, WhereOperator, WidgetDef, WithMetadata, dndevSchema };