@kyro-cms/core 0.12.70 → 0.12.71

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 (80) hide show
  1. package/dist/{WebhookService-CGNSlclW.d.ts → WebhookService-DQyM9fVo.d.ts} +1 -1
  2. package/dist/{WebhookService-CIQPD1We.d.cts → WebhookService-bo1NrgBW.d.cts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +1 -1
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +1 -1
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/{types-CpjuXbe7.d.cts → base-BcfNgOqZ.d.ts} +69 -1
  10. package/dist/{types-CpjuXbe7.d.ts → base-urWvrsX8.d.cts} +69 -1
  11. package/dist/bootstrap-E24SGUJP.cjs +1 -0
  12. package/dist/{bootstrap-WB6FDH2T.js → bootstrap-YFVE7MRG.js} +1 -1
  13. package/dist/{chunk-6USPOWA4.js → chunk-26KFM3P6.js} +10 -10
  14. package/dist/{chunk-MRR7OTRX.js → chunk-2HATK4C5.js} +28 -28
  15. package/dist/{chunk-637PTUHF.js → chunk-3TAUNYEM.js} +1 -1
  16. package/dist/{chunk-IL2TMAHB.cjs → chunk-A35ZP72D.cjs} +3 -3
  17. package/dist/{chunk-TBTQXIHP.js → chunk-CHYVUWZ3.js} +1 -1
  18. package/dist/{chunk-3XLXKGEU.cjs → chunk-FG3IFGJP.cjs} +1 -1
  19. package/dist/{chunk-XVPTVTQC.js → chunk-FSWDDVLA.js} +2 -2
  20. package/dist/{chunk-MVZSSTCV.js → chunk-FUFS65Q5.js} +2 -2
  21. package/dist/{chunk-Z552BTXA.cjs → chunk-H7PC2ENZ.cjs} +1 -1
  22. package/dist/chunk-K6ZW5M6S.cjs +56 -0
  23. package/dist/{chunk-OBH6EEAO.cjs → chunk-LKQHIOPW.cjs} +5 -5
  24. package/dist/{chunk-SOCBJPYB.cjs → chunk-RVBSJ4UQ.cjs} +1 -1
  25. package/dist/{chunk-ZQETJ4T4.cjs → chunk-TCFL3UWT.cjs} +1 -1
  26. package/dist/{chunk-4OMQURN7.js → chunk-ZAKYTBEN.js} +1 -1
  27. package/dist/cli/index.cjs +1 -1
  28. package/dist/cli/index.js +1 -1
  29. package/dist/client.cjs +109 -1
  30. package/dist/client.js +109 -2
  31. package/dist/drizzle/index.cjs +1 -1
  32. package/dist/drizzle/index.d.cts +3 -4
  33. package/dist/drizzle/index.d.ts +3 -4
  34. package/dist/drizzle/index.js +1 -1
  35. package/dist/fields/index.d.cts +2 -2
  36. package/dist/fields/index.d.ts +2 -2
  37. package/dist/graphql/index.d.cts +3 -3
  38. package/dist/graphql/index.d.ts +3 -3
  39. package/dist/{index-DTy4k1oU.d.ts → index-4cH-BjtP.d.ts} +2 -2
  40. package/dist/{index-BHYGO3yF.d.cts → index-d1m_oup7.d.cts} +2 -2
  41. package/dist/index.cjs +35 -16
  42. package/dist/index.d.cts +105 -13
  43. package/dist/index.d.ts +105 -13
  44. package/dist/index.js +39 -20
  45. package/dist/mongodb/index.d.cts +3 -4
  46. package/dist/mongodb/index.d.ts +3 -4
  47. package/dist/postgres-auth-adapter-SK3N3OSS.js +1 -1
  48. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +1 -1
  49. package/dist/postgres-js-7YBZKGXG.cjs +1 -0
  50. package/dist/{postgres-js-WE3NBRFO.js → postgres-js-JLFIWOBH.js} +1 -1
  51. package/dist/rest/index.cjs +1 -1
  52. package/dist/rest/index.d.cts +4 -4
  53. package/dist/rest/index.d.ts +4 -4
  54. package/dist/rest/index.js +1 -1
  55. package/dist/templates/index.d.cts +2 -2
  56. package/dist/templates/index.d.ts +2 -2
  57. package/dist/trpc/index.d.cts +3 -3
  58. package/dist/trpc/index.d.ts +3 -3
  59. package/dist/{types-BWJx6zzm.d.ts → types-BADIMVGF.d.ts} +2 -2
  60. package/dist/{types-BKPEavuy.d.cts → types-DlGSbh7I.d.cts} +1 -1
  61. package/dist/{types-BKPEavuy.d.ts → types-DlGSbh7I.d.ts} +1 -1
  62. package/dist/{types-CeAQSR87.d.cts → types-YAVR0H9Z.d.cts} +2 -2
  63. package/package.json +2 -2
  64. package/dist/base-Ds06wMo9.d.cts +0 -69
  65. package/dist/base-DxDXLyWe.d.ts +0 -69
  66. package/dist/bootstrap-XDT4MRML.cjs +0 -1
  67. package/dist/chunk-7FXEXHK6.js +0 -21
  68. package/dist/chunk-JSTDCK3Z.js +0 -2
  69. package/dist/chunk-JT36FTHY.cjs +0 -20
  70. package/dist/chunk-L2QXP26Q.js +0 -2
  71. package/dist/chunk-MVX2PYJJ.cjs +0 -1
  72. package/dist/chunk-MYGHZQMO.cjs +0 -1
  73. package/dist/chunk-OUAR4ZCU.cjs +0 -56
  74. package/dist/client.d.cts +0 -12
  75. package/dist/client.d.ts +0 -12
  76. package/dist/index-D7kt5jT_.d.ts +0 -97
  77. package/dist/index-DPtCjn94.d.cts +0 -97
  78. package/dist/postgres-js-GXZX3AGZ.cjs +0 -1
  79. /package/dist/{chunk-XTTGHN3D.cjs → chunk-FLS2FJM6.cjs} +0 -0
  80. /package/dist/{chunk-KWGB3YNI.js → chunk-PFKVHUOT.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-BWJx6zzm.js';
2
- import '../types-BKPEavuy.js';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-BADIMVGF.js';
2
+ import '../types-DlGSbh7I.js';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
5
5
 
@@ -1,6 +1,6 @@
1
- import { B as BaseAdapter, l as User, R as Request, b as FindResult } from '../types-CeAQSR87.cjs';
2
- import { j as createWebhookService } from '../WebhookService-CIQPD1We.cjs';
3
- import '../types-BKPEavuy.cjs';
1
+ import { B as BaseAdapter, i as User, R as Request, b as FindResult } from '../types-YAVR0H9Z.cjs';
2
+ import { j as createWebhookService } from '../WebhookService-bo1NrgBW.cjs';
3
+ import '../types-DlGSbh7I.cjs';
4
4
 
5
5
  interface ApiKeyContext {
6
6
  userId: string;
@@ -1,6 +1,6 @@
1
- import { B as BaseAdapter, l as User, R as Request, b as FindResult } from '../types-BWJx6zzm.js';
2
- import { j as createWebhookService } from '../WebhookService-CGNSlclW.js';
3
- import '../types-BKPEavuy.js';
1
+ import { B as BaseAdapter, i as User, R as Request, b as FindResult } from '../types-BADIMVGF.js';
2
+ import { j as createWebhookService } from '../WebhookService-DQyM9fVo.js';
3
+ import '../types-DlGSbh7I.js';
4
4
 
5
5
  interface ApiKeyContext {
6
6
  userId: string;
@@ -1,4 +1,4 @@
1
- import { F as Field } from './types-BKPEavuy.js';
1
+ import { F as Field } from './types-DlGSbh7I.js';
2
2
 
3
3
  interface Request {
4
4
  body?: any;
@@ -773,4 +773,4 @@ interface KyroConfig {
773
773
  debug?: boolean;
774
774
  }
775
775
 
776
- export { runFieldHooks as $, type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type PluginAPI as J, type KyroConfig as K, type PluginHooks as L, ReviewsPlugin as M, SEOPlugin as N, WishlistPlugin as O, PluginManager as P, evaluateAccess as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, getWhereClause as X, mergeWhereClauses as Y, presetPlugins as Z, resolveProvider as _, type AuthConfig as a, runHooks as a0, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindOneArgs as f, type FindVersionsArgs as g, type VersionRecord as h, type CreateVersionArgs as i, type StorageProvider as j, KyroPlugin as k, type User as l, type AccessArgs as m, type AccessControl as n, type AdapterConfig as o, AnalyticsPlugin as p, type CollectionAccess as q, type CollectionHooks as r, CommentsPlugin as s, ConfigService as t, type CreateResult as u, type FieldAccess as v, type FieldHooks as w, type GlobalAccess as x, type GlobalHooks as y, type HookArgs as z };
776
+ export { runFieldHooks as $, type AccessArgs as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, ReviewsPlugin as J, KyroPlugin as K, SEOPlugin as L, type UploadConfig as M, type VersionConfig as N, WishlistPlugin as O, PluginManager as P, evaluateAccess as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type WhereClause as W, getWhereClause as X, mergeWhereClauses as Y, presetPlugins as Z, resolveProvider as _, type StorageProvider as a, runHooks as a0, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type FindOneArgs as e, type FindVersionsArgs as f, type CreateVersionArgs as g, type KyroConfig as h, type User as i, type AccessControl as j, type AdapterConfig as k, type AdminConfig as l, AnalyticsPlugin as m, type AuthConfig as n, type CollectionAccess as o, type CollectionHooks as p, CommentsPlugin as q, ConfigService as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type HookArgs as x, type PluginAPI as y, type PluginHooks as z };
@@ -294,4 +294,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
294
294
  declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
295
295
  declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
296
296
 
297
- export { isRelationshipField as $, ALL_FIELD_TYPES as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, type Hook as H, type IconField as I, type JSONField as J, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, type PasswordField as P, isBlocksField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ArrayField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, type Block as b, type BlockAdmin as c, type BlockImage as d, type BlocksField as e, type CodeField as f, type CollapsibleField as g, type ColorField as h, type DeclarativeCondition as i, type FieldAdmin as j, type FieldType as k, type ImageField as l, type RelationshipField as m, type RichTextBlock as n, type RichTextField as o, type RowField as p, type SelectField as q, type TextField as r, type TextareaField as s, type ActionField as t, type ButtonField as u, COMPLEX_FIELD_TYPES as v, type ListField as w, PRIMITIVE_FIELD_TYPES as x, RELATIONAL_FIELD_TYPES as y, type TextFieldVariant as z };
297
+ export { isRelationshipField as $, ALL_FIELD_TYPES as A, type BaseField as B, COMPLEX_FIELD_TYPES as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, type Hook as H, type IconField as I, type JSONField as J, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, PRIMITIVE_FIELD_TYPES as P, isBlocksField as Q, RELATIONAL_FIELD_TYPES as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ActionField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, type ArrayField as b, type Block as c, type BlockAdmin as d, type BlockImage as e, type BlocksField as f, type ButtonField as g, type CheckboxField as h, type CodeField as i, type CollapsibleField as j, type ColorField as k, type DeclarativeCondition as l, type FieldAdmin as m, type FieldType as n, type ImageField as o, type ListField as p, type PasswordField as q, type RadioField as r, type RelationshipField as s, type RichTextBlock as t, type RichTextField as u, type RowField as v, type SelectField as w, type TextField as x, type TextFieldVariant as y, type TextareaField as z };
@@ -294,4 +294,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
294
294
  declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "icon", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
295
295
  declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
296
296
 
297
- export { isRelationshipField as $, ALL_FIELD_TYPES as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, type Hook as H, type IconField as I, type JSONField as J, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, type PasswordField as P, isBlocksField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ArrayField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, type Block as b, type BlockAdmin as c, type BlockImage as d, type BlocksField as e, type CodeField as f, type CollapsibleField as g, type ColorField as h, type DeclarativeCondition as i, type FieldAdmin as j, type FieldType as k, type ImageField as l, type RelationshipField as m, type RichTextBlock as n, type RichTextField as o, type RowField as p, type SelectField as q, type TextField as r, type TextareaField as s, type ActionField as t, type ButtonField as u, COMPLEX_FIELD_TYPES as v, type ListField as w, PRIMITIVE_FIELD_TYPES as x, RELATIONAL_FIELD_TYPES as y, type TextFieldVariant as z };
297
+ export { isRelationshipField as $, ALL_FIELD_TYPES as A, type BaseField as B, COMPLEX_FIELD_TYPES as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, type Hook as H, type IconField as I, type JSONField as J, createRelationshipFieldConfig as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isArrayField as O, PRIMITIVE_FIELD_TYPES as P, isBlocksField as Q, RELATIONAL_FIELD_TYPES as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isGroupField as W, isIconField as X, isImageField as Y, isLayoutField as Z, isNumberField as _, type ActionField as a, isRichTextField as a0, isSelectField as a1, isTextField as a2, isUploadField as a3, type ArrayField as b, type Block as c, type BlockAdmin as d, type BlockImage as e, type BlocksField as f, type ButtonField as g, type CheckboxField as h, type CodeField as i, type CollapsibleField as j, type ColorField as k, type DeclarativeCondition as l, type FieldAdmin as m, type FieldType as n, type ImageField as o, type ListField as p, type PasswordField as q, type RadioField as r, type RelationshipField as s, type RichTextBlock as t, type RichTextField as u, type RowField as v, type SelectField as w, type TextField as x, type TextFieldVariant as y, type TextareaField as z };
@@ -1,4 +1,4 @@
1
- import { F as Field } from './types-BKPEavuy.cjs';
1
+ import { F as Field } from './types-DlGSbh7I.cjs';
2
2
 
3
3
  interface Request {
4
4
  body?: any;
@@ -773,4 +773,4 @@ interface KyroConfig {
773
773
  debug?: boolean;
774
774
  }
775
775
 
776
- export { runFieldHooks as $, type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type PluginAPI as J, type KyroConfig as K, type PluginHooks as L, ReviewsPlugin as M, SEOPlugin as N, WishlistPlugin as O, PluginManager as P, evaluateAccess as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, getWhereClause as X, mergeWhereClauses as Y, presetPlugins as Z, resolveProvider as _, type AuthConfig as a, runHooks as a0, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindOneArgs as f, type FindVersionsArgs as g, type VersionRecord as h, type CreateVersionArgs as i, type StorageProvider as j, KyroPlugin as k, type User as l, type AccessArgs as m, type AccessControl as n, type AdapterConfig as o, AnalyticsPlugin as p, type CollectionAccess as q, type CollectionHooks as r, CommentsPlugin as s, ConfigService as t, type CreateResult as u, type FieldAccess as v, type FieldHooks as w, type GlobalAccess as x, type GlobalHooks as y, type HookArgs as z };
776
+ export { runFieldHooks as $, type AccessArgs as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, ReviewsPlugin as J, KyroPlugin as K, SEOPlugin as L, type UploadConfig as M, type VersionConfig as N, WishlistPlugin as O, PluginManager as P, evaluateAccess as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type WhereClause as W, getWhereClause as X, mergeWhereClauses as Y, presetPlugins as Z, resolveProvider as _, type StorageProvider as a, runHooks as a0, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type FindOneArgs as e, type FindVersionsArgs as f, type CreateVersionArgs as g, type KyroConfig as h, type User as i, type AccessControl as j, type AdapterConfig as k, type AdminConfig as l, AnalyticsPlugin as m, type AuthConfig as n, type CollectionAccess as o, type CollectionHooks as p, CommentsPlugin as q, ConfigService as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type HookArgs as x, type PluginAPI as y, type PluginHooks as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyro-cms/core",
3
- "version": "0.12.70",
3
+ "version": "0.12.71",
4
4
  "description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -191,7 +191,7 @@
191
191
  "ws": "^8.18.0",
192
192
  "zod": "^3.24.0",
193
193
  "zod-to-json-schema": "^3.25.2",
194
- "@kyro-cms/ai": "0.12.70"
194
+ "@kyro-cms/ai": "0.12.71"
195
195
  },
196
196
  "devDependencies": {
197
197
  "@tailwindcss/vite": "^4.0.0",
@@ -1,69 +0,0 @@
1
- import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindOneArgs, g as FindVersionsArgs, h as VersionRecord, i as CreateVersionArgs } from './types-CeAQSR87.cjs';
2
- import { F as Field, m as RelationshipField, U as UploadField } from './types-BKPEavuy.cjs';
3
-
4
- declare abstract class AbstractBaseAdapter implements BaseAdapter {
5
- protected collections: Map<string, CollectionConfig>;
6
- protected globals: Map<string, GlobalConfig>;
7
- protected connected: boolean;
8
- protected tenantContext?: TenantContext;
9
- abstract connect(): Promise<void>;
10
- abstract disconnect(): Promise<void>;
11
- setTenantContext(context: TenantContext | undefined): void;
12
- getTenantContext(): TenantContext | undefined;
13
- init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
14
- abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
15
- abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
16
- abstract create<T>(args: CreateArgs): Promise<T>;
17
- abstract update<T>(args: UpdateArgs): Promise<T>;
18
- abstract delete<T>(args: DeleteArgs): Promise<T>;
19
- abstract count(args: {
20
- collection: string;
21
- where?: Record<string, any>;
22
- tenantId?: string;
23
- }): Promise<number>;
24
- abstract findOne(args: FindOneArgs): Promise<any>;
25
- abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
26
- abstract findVersionByID(args: {
27
- collection: string;
28
- versionId: string;
29
- tenantId?: string;
30
- }): Promise<VersionRecord | null>;
31
- abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
32
- abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
33
- abstract deleteVersions(args: {
34
- collection: string;
35
- documentId: string;
36
- keepLatest?: number;
37
- tenantId?: string;
38
- }): Promise<void>;
39
- migrate?(): Promise<void>;
40
- rollback?(): Promise<void>;
41
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
42
- protected getCollection(slug: string): CollectionConfig;
43
- protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
44
- protected getTableName(slug: string): string;
45
- protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
46
- protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
47
- protected parseSort(sort?: string): {
48
- field: string;
49
- direction: 'asc' | 'desc';
50
- };
51
- protected calculatePagination(page: number, limit: number, totalDocs: number): {
52
- totalDocs: number;
53
- limit: number;
54
- totalPages: number;
55
- page: number;
56
- pagingCounter: number;
57
- hasPrevPage: boolean;
58
- hasNextPage: boolean;
59
- prevPage: number | null;
60
- nextPage: number | null;
61
- };
62
- protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
63
- protected isRelationshipField(field: Field): field is RelationshipField;
64
- protected isUploadField(field: Field): field is UploadField;
65
- protected getRelationshipFields(fields: Field[]): RelationshipField[];
66
- protected getUploadFields(fields: Field[]): UploadField[];
67
- }
68
-
69
- export { AbstractBaseAdapter as A };
@@ -1,69 +0,0 @@
1
- import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindOneArgs, g as FindVersionsArgs, h as VersionRecord, i as CreateVersionArgs } from './types-BWJx6zzm.js';
2
- import { F as Field, m as RelationshipField, U as UploadField } from './types-BKPEavuy.js';
3
-
4
- declare abstract class AbstractBaseAdapter implements BaseAdapter {
5
- protected collections: Map<string, CollectionConfig>;
6
- protected globals: Map<string, GlobalConfig>;
7
- protected connected: boolean;
8
- protected tenantContext?: TenantContext;
9
- abstract connect(): Promise<void>;
10
- abstract disconnect(): Promise<void>;
11
- setTenantContext(context: TenantContext | undefined): void;
12
- getTenantContext(): TenantContext | undefined;
13
- init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
14
- abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
15
- abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
16
- abstract create<T>(args: CreateArgs): Promise<T>;
17
- abstract update<T>(args: UpdateArgs): Promise<T>;
18
- abstract delete<T>(args: DeleteArgs): Promise<T>;
19
- abstract count(args: {
20
- collection: string;
21
- where?: Record<string, any>;
22
- tenantId?: string;
23
- }): Promise<number>;
24
- abstract findOne(args: FindOneArgs): Promise<any>;
25
- abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
26
- abstract findVersionByID(args: {
27
- collection: string;
28
- versionId: string;
29
- tenantId?: string;
30
- }): Promise<VersionRecord | null>;
31
- abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
32
- abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
33
- abstract deleteVersions(args: {
34
- collection: string;
35
- documentId: string;
36
- keepLatest?: number;
37
- tenantId?: string;
38
- }): Promise<void>;
39
- migrate?(): Promise<void>;
40
- rollback?(): Promise<void>;
41
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
42
- protected getCollection(slug: string): CollectionConfig;
43
- protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
44
- protected getTableName(slug: string): string;
45
- protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
46
- protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
47
- protected parseSort(sort?: string): {
48
- field: string;
49
- direction: 'asc' | 'desc';
50
- };
51
- protected calculatePagination(page: number, limit: number, totalDocs: number): {
52
- totalDocs: number;
53
- limit: number;
54
- totalPages: number;
55
- page: number;
56
- pagingCounter: number;
57
- hasPrevPage: boolean;
58
- hasNextPage: boolean;
59
- prevPage: number | null;
60
- nextPage: number | null;
61
- };
62
- protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
63
- protected isRelationshipField(field: Field): field is RelationshipField;
64
- protected isUploadField(field: Field): field is UploadField;
65
- protected getRelationshipFields(fields: Field[]): RelationshipField[];
66
- protected getUploadFields(fields: Field[]): UploadField[];
67
- }
68
-
69
- export { AbstractBaseAdapter as A };
@@ -1 +0,0 @@
1
- 'use strict';var chunk3XLXKGEU_cjs=require('./chunk-3XLXKGEU.cjs');require('./chunk-XTTGHN3D.cjs'),require('./chunk-HPYH7GTS.cjs'),require('./chunk-OPTVCCQQ.cjs'),require('./chunk-VRZC4TTF.cjs'),require('./chunk-HTYVI2HK.cjs'),require('./chunk-BUNLC3II.cjs');Object.defineProperty(exports,"autoBootstrap",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.e}});Object.defineProperty(exports,"bootstrapAdmin",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.a}});Object.defineProperty(exports,"bootstrapWithRetry",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.f}});Object.defineProperty(exports,"buildBootstrapConfig",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.c}});Object.defineProperty(exports,"checkBootstrapRequired",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.b}});Object.defineProperty(exports,"getBootstrapFromEnv",{enumerable:true,get:function(){return chunk3XLXKGEU_cjs.d}});
@@ -1,21 +0,0 @@
1
- import {g as g$1}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g$1();var g=class{constructor(s){this.config=s;}config;css=[];addRule(s,e){let n=Object.entries(e).map(([o,t])=>` ${o}: ${t};`).join(`
3
- `);return this.css.push(`${s} {
4
- ${n}
5
- }`),this}addMediaQuery(s,e){return this.css.push(`@media (min-width: ${s}) {
6
- ${e.join(`
7
- `)}
8
- }`),this}generate(){return this.css.join(`
9
-
10
- `)}};function f(r){return {theme:{extend:{colors:r.colors||{},fontFamily:r.fonts||{},spacing:r.spacing||{},borderRadius:r.borderRadius||{},boxShadow:r.shadows||{},screens:r.breakpoints||{}}}}}var i={colors:{primary:"#3b82f6",secondary:"#6366f1",accent:"#ec4899",background:"#ffffff",surface:"#f9fafb",text:"#111827",textMuted:"#6b7280",border:"#e5e7eb",error:"#ef4444",warning:"#f59e0b",success:"#10b981",info:"#3b82f6"},fonts:{sans:"system-ui, -apple-system, sans-serif",serif:"Georgia, serif",mono:"Menlo, monospace"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1)"}},x={colors:{primary:"#60a5fa",secondary:"#818cf8",accent:"#f472b6",background:"#111827",surface:"#1f2937",text:"#f9fafb",textMuted:"#9ca3af",border:"#374151",error:"#f87171",warning:"#fbbf24",success:"#34d399",info:"#60a5fa"},fonts:i.fonts,spacing:i.spacing,borderRadius:i.borderRadius,shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.3)",md:"0 4px 6px -1px rgb(0 0 0 / 0.4)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.5)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.6)"}},u={colors:{primary:"#FF6B35",secondary:"#1A1A2E",accent:"#16C79A",background:"#FFFFFF",surface:"#F8F9FA",text:"#1A1A2E",textMuted:"#6B7280",border:"#E5E7EB",error:"#EF4444",warning:"#F59E0B",success:"#16C79A",info:"#3B82F6"},fonts:{sans:'"Inter", "Satoshi", system-ui, sans-serif',serif:'"Playfair Display", Georgia, serif',mono:'"JetBrains Mono", monospace'},spacing:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"3rem","4xl":"4rem"},borderRadius:{sm:"0",md:"0",lg:"0",xl:"0",full:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px rgba(0,0,0,0.07)",lg:"0 10px 15px rgba(0,0,0,0.1)",xl:"0 20px 25px rgba(0,0,0,0.15)"}};function p(r){let s=[];if(r.colors)for(let[e,n]of Object.entries(r.colors))s.push(` --color-${e}: ${n};`);if(r.fonts)for(let[e,n]of Object.entries(r.fonts))s.push(` --font-${e}: ${n};`);if(r.spacing)for(let[e,n]of Object.entries(r.spacing))s.push(` --spacing-${e}: ${n};`);if(r.borderRadius)for(let[e,n]of Object.entries(r.borderRadius))s.push(` --radius-${e}: ${n};`);if(r.shadows)for(let[e,n]of Object.entries(r.shadows))s.push(` --shadow-${e}: ${n};`);return `:root {
11
- ${s.join(`
12
- `)}
13
- }`}function b(r){let s=p(r.theme||i),e=[];if(r.componentOverrides)for(let[n,o]of Object.entries(r.componentOverrides)){let t=Object.entries(o).map(([c,d])=>` ${c}: ${d};`).join(`
14
- `);e.push(`${n} {
15
- ${t}
16
- }`);}return `
17
- ${s}
18
- ${r.customStyles||""}
19
- ${e.join(`
20
- `)}
21
- `}var h={text:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500",color:"var(--color-text)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",fontSize:"0.875rem"},error:{color:"var(--color-error)",fontSize:"0.75rem",marginTop:"var(--spacing-xs)"}},number:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)"}},checkbox:{wrapper:{display:"flex",alignItems:"center",gap:"var(--spacing-sm)"},input:{width:"1rem",height:"1rem"},label:{cursor:"pointer"}},select:{wrapper:{marginBottom:"var(--spacing-md)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",backgroundColor:"white"}}};export{g as a,f as b,i as c,x as d,u as e,p as f,b as g,h};
@@ -1,2 +0,0 @@
1
- import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();var R=new Set(["type","admin","label","singularLabel","labelPlural","relationTo","required","hasMany","defaultValue","validate","options","dynamicOptions","filterOptions","hooks","min","max","minLength","maxLength","minRows","maxRows","minDate","maxDate","step","integer","variant","pattern","format","fields","tabs","blocks"]);function P(o){return typeof o!="object"||o===null||Array.isArray(o)?false:Object.keys(o).some(l=>R.has(l))}function m(o,l=""){let e={};for(let[n,i]of Object.entries(o)){let r=l?`${l}.${n}`:n;i&&typeof i=="object"&&!Array.isArray(i)&&!P(i)?Object.assign(e,m(i,r)):e[r]=i;}return e}function y(o,l,e,n=true){let i=l.split(".");if(i.length===0)return false;let r=i[0],t=i.slice(1).join("."),f=r.match(/^(?:tab|tabs)\[(.+?)\]$/i);if(f){let s=f[1].toLowerCase();for(let c of o)if(c.type==="tabs"&&c.tabs&&Array.isArray(c.tabs)){for(let a of c.tabs)if((a.label||a.name||"").toLowerCase()===s&&a.fields&&Array.isArray(a.fields))return y(a.fields,t,e,n)}return false}for(let s of o){if(s.name===r)if(t){if(s.fields&&Array.isArray(s.fields))return y(s.fields,t,e,n);if(s.type==="tabs"&&s.tabs&&Array.isArray(s.tabs)){for(let a of s.tabs)if(a.fields&&Array.isArray(a.fields)&&y(a.fields,t,e,n))return true;return false}if(s.type==="blocks"&&s.blocks&&Array.isArray(s.blocks)){let a=t.split(".")[0],b=t.split(".").slice(1).join(".");if(!b)return false;for(let d of s.blocks)if(d.slug===a&&d.fields&&Array.isArray(d.fields))return y(d.fields,b,e,n);return false}return s.type==="array"&&s.fields&&Array.isArray(s.fields)?y(s.fields,t,e,n):false}else return Object.assign(s,e),true;if(s.type==="blocks"&&s.blocks&&Array.isArray(s.blocks)){for(let a of s.blocks)if(a.slug===r&&a.fields&&Array.isArray(a.fields)&&y(a.fields,t,e,n))return true}if(!s.name||s.type==="tabs"||s.type==="row"||s.type==="collapsible"){if(s.fields&&Array.isArray(s.fields)&&y(s.fields,l,e,false))return true;if(s.type==="tabs"&&s.tabs&&Array.isArray(s.tabs)){for(let a of s.tabs)if(a.fields&&Array.isArray(a.fields)&&y(a.fields,l,e,false))return true}}}return n&&!t&&e&&e.type?(o.push({name:r,...e}),true):false}function h(o,l){if(!l)return;let e=Array.isArray(l)?l:Object.entries(l).map(([i,r])=>({slug:r?.slug||i,...r}));function n(i){for(let r of i){if(r.type==="blocks"){Array.isArray(r.blocks)||(r.blocks=[]);for(let t of e){let f=r.blocks.findIndex(s=>s.slug===t.slug);f>=0?r.blocks[f]={...r.blocks[f],...t}:r.blocks.push(t);}return true}if(r.fields&&Array.isArray(r.fields)&&n(r.fields))return true;if(r.type==="tabs"&&r.tabs&&Array.isArray(r.tabs)){for(let t of r.tabs)if(t.fields&&Array.isArray(t.fields)&&n(t.fields))return true}}return false}n(o);}function x(o,l){if(!l)return;let e=Array.isArray(l)?l:Object.entries(l).map(([i,r])=>({label:r?.label||i,...Array.isArray(r)?{fields:r}:r})),n=o.find(i=>i.type==="tabs");if(n&&Array.isArray(n.tabs))for(let i of e){let r=n.tabs.find(t=>(t.label||t.name||"").toLowerCase()===(i.label||i.name||"").toLowerCase());r?(i.fields&&Array.isArray(i.fields)&&(Array.isArray(r.fields)||(r.fields=[]),r.fields.push(...i.fields)),Object.assign(r,i)):n.tabs.push(i);}else {let i=[...o];o.length=0,o.push({type:"tabs",tabs:[{label:"General",fields:i},...e]});}}function T(o,l){if(l)for(let e of o){let n=l[e.slug];if(n){let{fields:i,blocks:r,tabs:t,labels:f,label:s,singularLabel:c,labelPlural:a,hidden:b,timestamps:d,versions:u,seo:A,access:g,hooks:p,admin:k,...v}=n;if(s&&(e.label=s),c&&(e.singularLabel=c),a&&(e.labelPlural=a),f&&(f.singular&&(e.singularLabel=f.singular),f.plural&&(e.labelPlural=f.plural)),d!==void 0&&(e.timestamps=d),u!==void 0&&(e.versions={...e.versions,...u}),A!==void 0&&(e.seo=A),g&&(e.access={...e.access,...g}),p&&(e.hooks={...e.hooks,...p}),(k||v)&&(e.admin={...e.admin,...k,...v}),r&&h(e.fields,r),t&&x(e.fields,t),i){let F=m(i);for(let[L,j]of Object.entries(F))y(e.fields,L,j);}}}}function S(o,l){if(l)for(let e of o){let n=l[e.slug];if(n){let{fields:i,blocks:r,tabs:t,label:f,hidden:s,versions:c,access:a,hooks:b,admin:d,...u}=n;if(f&&(e.label=f),c!==void 0&&(e.versions={...e.versions,...c}),a&&(e.access={...e.access,...a}),b&&(e.hooks={...e.hooks,...b}),(d||u)&&(e.admin={...e.admin,...d,...u}),r&&h(e.fields,r),t&&x(e.fields,t),i){let A=m(i);for(let[g,p]of Object.entries(A))y(e.fields,g,p);}}}}export{R as a,P as b,m as c,y as d,h as e,x as f,T as g,S as h};
@@ -1,20 +0,0 @@
1
- 'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var g=class{constructor(s){this.config=s;}config;css=[];addRule(s,e){let n=Object.entries(e).map(([o,t])=>` ${o}: ${t};`).join(`
2
- `);return this.css.push(`${s} {
3
- ${n}
4
- }`),this}addMediaQuery(s,e){return this.css.push(`@media (min-width: ${s}) {
5
- ${e.join(`
6
- `)}
7
- }`),this}generate(){return this.css.join(`
8
-
9
- `)}};function m(r){return {theme:{extend:{colors:r.colors||{},fontFamily:r.fonts||{},spacing:r.spacing||{},borderRadius:r.borderRadius||{},boxShadow:r.shadows||{},screens:r.breakpoints||{}}}}}var i={colors:{primary:"#3b82f6",secondary:"#6366f1",accent:"#ec4899",background:"#ffffff",surface:"#f9fafb",text:"#111827",textMuted:"#6b7280",border:"#e5e7eb",error:"#ef4444",warning:"#f59e0b",success:"#10b981",info:"#3b82f6"},fonts:{sans:"system-ui, -apple-system, sans-serif",serif:"Georgia, serif",mono:"Menlo, monospace"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1)"}},f={colors:{primary:"#60a5fa",secondary:"#818cf8",accent:"#f472b6",background:"#111827",surface:"#1f2937",text:"#f9fafb",textMuted:"#9ca3af",border:"#374151",error:"#f87171",warning:"#fbbf24",success:"#34d399",info:"#60a5fa"},fonts:i.fonts,spacing:i.spacing,borderRadius:i.borderRadius,shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.3)",md:"0 4px 6px -1px rgb(0 0 0 / 0.4)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.5)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.6)"}},x={colors:{primary:"#FF6B35",secondary:"#1A1A2E",accent:"#16C79A",background:"#FFFFFF",surface:"#F8F9FA",text:"#1A1A2E",textMuted:"#6B7280",border:"#E5E7EB",error:"#EF4444",warning:"#F59E0B",success:"#16C79A",info:"#3B82F6"},fonts:{sans:'"Inter", "Satoshi", system-ui, sans-serif',serif:'"Playfair Display", Georgia, serif',mono:'"JetBrains Mono", monospace'},spacing:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"3rem","4xl":"4rem"},borderRadius:{sm:"0",md:"0",lg:"0",xl:"0",full:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px rgba(0,0,0,0.07)",lg:"0 10px 15px rgba(0,0,0,0.1)",xl:"0 20px 25px rgba(0,0,0,0.15)"}};function p(r){let s=[];if(r.colors)for(let[e,n]of Object.entries(r.colors))s.push(` --color-${e}: ${n};`);if(r.fonts)for(let[e,n]of Object.entries(r.fonts))s.push(` --font-${e}: ${n};`);if(r.spacing)for(let[e,n]of Object.entries(r.spacing))s.push(` --spacing-${e}: ${n};`);if(r.borderRadius)for(let[e,n]of Object.entries(r.borderRadius))s.push(` --radius-${e}: ${n};`);if(r.shadows)for(let[e,n]of Object.entries(r.shadows))s.push(` --shadow-${e}: ${n};`);return `:root {
10
- ${s.join(`
11
- `)}
12
- }`}function u(r){let s=p(r.theme||i),e=[];if(r.componentOverrides)for(let[n,o]of Object.entries(r.componentOverrides)){let t=Object.entries(o).map(([c,d])=>` ${c}: ${d};`).join(`
13
- `);e.push(`${n} {
14
- ${t}
15
- }`);}return `
16
- ${s}
17
- ${r.customStyles||""}
18
- ${e.join(`
19
- `)}
20
- `}var b={text:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500",color:"var(--color-text)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",fontSize:"0.875rem"},error:{color:"var(--color-error)",fontSize:"0.75rem",marginTop:"var(--spacing-xs)"}},number:{wrapper:{marginBottom:"var(--spacing-md)"},label:{display:"block",marginBottom:"var(--spacing-xs)",fontWeight:"500"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)"}},checkbox:{wrapper:{display:"flex",alignItems:"center",gap:"var(--spacing-sm)"},input:{width:"1rem",height:"1rem"},label:{cursor:"pointer"}},select:{wrapper:{marginBottom:"var(--spacing-md)"},input:{width:"100%",padding:"var(--spacing-sm) var(--spacing-md)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-md)",backgroundColor:"white"}}};exports.a=g;exports.b=m;exports.c=i;exports.d=f;exports.e=x;exports.f=p;exports.g=u;exports.h=b;
@@ -1,2 +0,0 @@
1
- import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();function s(e){return {ipAddress:e.headers.get("x-forwarded-for")?.split(",")[0]?.trim()||e.headers.get("x-real-ip")||"unknown",userAgent:e.headers.get("user-agent")||"unknown"}}export{s as a};
@@ -1 +0,0 @@
1
- 'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();function n(e){return {ipAddress:e.headers.get("x-forwarded-for")?.split(",")[0]?.trim()||e.headers.get("x-real-ip")||"unknown",userAgent:e.headers.get("user-agent")||"unknown"}}exports.a=n;
@@ -1 +0,0 @@
1
- 'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var R=new Set(["type","admin","label","singularLabel","labelPlural","relationTo","required","hasMany","defaultValue","validate","options","dynamicOptions","filterOptions","hooks","min","max","minLength","maxLength","minRows","maxRows","minDate","maxDate","step","integer","variant","pattern","format","fields","tabs","blocks"]);function P(o){return typeof o!="object"||o===null||Array.isArray(o)?false:Object.keys(o).some(l=>R.has(l))}function m(o,l=""){let e={};for(let[n,i]of Object.entries(o)){let r=l?`${l}.${n}`:n;i&&typeof i=="object"&&!Array.isArray(i)&&!P(i)?Object.assign(e,m(i,r)):e[r]=i;}return e}function y(o,l,e,n=true){let i=l.split(".");if(i.length===0)return false;let r=i[0],t=i.slice(1).join("."),f=r.match(/^(?:tab|tabs)\[(.+?)\]$/i);if(f){let s=f[1].toLowerCase();for(let c of o)if(c.type==="tabs"&&c.tabs&&Array.isArray(c.tabs)){for(let a of c.tabs)if((a.label||a.name||"").toLowerCase()===s&&a.fields&&Array.isArray(a.fields))return y(a.fields,t,e,n)}return false}for(let s of o){if(s.name===r)if(t){if(s.fields&&Array.isArray(s.fields))return y(s.fields,t,e,n);if(s.type==="tabs"&&s.tabs&&Array.isArray(s.tabs)){for(let a of s.tabs)if(a.fields&&Array.isArray(a.fields)&&y(a.fields,t,e,n))return true;return false}if(s.type==="blocks"&&s.blocks&&Array.isArray(s.blocks)){let a=t.split(".")[0],b=t.split(".").slice(1).join(".");if(!b)return false;for(let d of s.blocks)if(d.slug===a&&d.fields&&Array.isArray(d.fields))return y(d.fields,b,e,n);return false}return s.type==="array"&&s.fields&&Array.isArray(s.fields)?y(s.fields,t,e,n):false}else return Object.assign(s,e),true;if(s.type==="blocks"&&s.blocks&&Array.isArray(s.blocks)){for(let a of s.blocks)if(a.slug===r&&a.fields&&Array.isArray(a.fields)&&y(a.fields,t,e,n))return true}if(!s.name||s.type==="tabs"||s.type==="row"||s.type==="collapsible"){if(s.fields&&Array.isArray(s.fields)&&y(s.fields,l,e,false))return true;if(s.type==="tabs"&&s.tabs&&Array.isArray(s.tabs)){for(let a of s.tabs)if(a.fields&&Array.isArray(a.fields)&&y(a.fields,l,e,false))return true}}}return n&&!t&&e&&e.type?(o.push({name:r,...e}),true):false}function h(o,l){if(!l)return;let e=Array.isArray(l)?l:Object.entries(l).map(([i,r])=>({slug:r?.slug||i,...r}));function n(i){for(let r of i){if(r.type==="blocks"){Array.isArray(r.blocks)||(r.blocks=[]);for(let t of e){let f=r.blocks.findIndex(s=>s.slug===t.slug);f>=0?r.blocks[f]={...r.blocks[f],...t}:r.blocks.push(t);}return true}if(r.fields&&Array.isArray(r.fields)&&n(r.fields))return true;if(r.type==="tabs"&&r.tabs&&Array.isArray(r.tabs)){for(let t of r.tabs)if(t.fields&&Array.isArray(t.fields)&&n(t.fields))return true}}return false}n(o);}function x(o,l){if(!l)return;let e=Array.isArray(l)?l:Object.entries(l).map(([i,r])=>({label:r?.label||i,...Array.isArray(r)?{fields:r}:r})),n=o.find(i=>i.type==="tabs");if(n&&Array.isArray(n.tabs))for(let i of e){let r=n.tabs.find(t=>(t.label||t.name||"").toLowerCase()===(i.label||i.name||"").toLowerCase());r?(i.fields&&Array.isArray(i.fields)&&(Array.isArray(r.fields)||(r.fields=[]),r.fields.push(...i.fields)),Object.assign(r,i)):n.tabs.push(i);}else {let i=[...o];o.length=0,o.push({type:"tabs",tabs:[{label:"General",fields:i},...e]});}}function I(o,l){if(l)for(let e of o){let n=l[e.slug];if(n){let{fields:i,blocks:r,tabs:t,labels:f,label:s,singularLabel:c,labelPlural:a,hidden:b,timestamps:d,versions:u,seo:A,access:g,hooks:p,admin:k,...v}=n;if(s&&(e.label=s),c&&(e.singularLabel=c),a&&(e.labelPlural=a),f&&(f.singular&&(e.singularLabel=f.singular),f.plural&&(e.labelPlural=f.plural)),d!==void 0&&(e.timestamps=d),u!==void 0&&(e.versions={...e.versions,...u}),A!==void 0&&(e.seo=A),g&&(e.access={...e.access,...g}),p&&(e.hooks={...e.hooks,...p}),(k||v)&&(e.admin={...e.admin,...k,...v}),r&&h(e.fields,r),t&&x(e.fields,t),i){let F=m(i);for(let[L,j]of Object.entries(F))y(e.fields,L,j);}}}}function T(o,l){if(l)for(let e of o){let n=l[e.slug];if(n){let{fields:i,blocks:r,tabs:t,label:f,hidden:s,versions:c,access:a,hooks:b,admin:d,...u}=n;if(f&&(e.label=f),c!==void 0&&(e.versions={...e.versions,...c}),a&&(e.access={...e.access,...a}),b&&(e.hooks={...e.hooks,...b}),(d||u)&&(e.admin={...e.admin,...d,...u}),r&&h(e.fields,r),t&&x(e.fields,t),i){let A=m(i);for(let[g,p]of Object.entries(A))y(e.fields,g,p);}}}}exports.a=R;exports.b=P;exports.c=m;exports.d=y;exports.e=h;exports.f=x;exports.g=I;exports.h=T;