@elek-io/core 0.15.2 → 0.15.3

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.
@@ -9881,12 +9881,11 @@ declare const projectSchema: z.ZodObject<{
9881
9881
  }, z.core.$strip>>;
9882
9882
  }, z.core.$strip>;
9883
9883
  type Project = z.infer<typeof projectSchema>;
9884
- declare const outdatedProjectSchema: z.ZodObject<{
9884
+ declare const migrateProjectSchema: z.ZodObject<{
9885
9885
  id: z.ZodReadonly<z.ZodUUID>;
9886
- name: z.ZodString;
9887
9886
  coreVersion: z.ZodString;
9888
- }, z.core.$strip>;
9889
- type OutdatedProject = z.infer<typeof outdatedProjectSchema>;
9887
+ }, z.core.$loose>;
9888
+ type MigrateProjectProps = z.infer<typeof migrateProjectSchema>;
9890
9889
  declare const projectExportSchema: z.ZodObject<{
9891
9890
  id: z.ZodReadonly<z.ZodUUID>;
9892
9891
  created: z.ZodReadonly<z.ZodString>;
@@ -11326,8 +11325,8 @@ declare const projectExportSchema: z.ZodObject<{
11326
11325
  type ProjectExport = z.infer<typeof projectExportSchema>;
11327
11326
  declare const createProjectSchema: z.ZodObject<{
11328
11327
  name: z.ZodString;
11329
- description: z.ZodOptional<z.ZodString>;
11330
- settings: z.ZodOptional<z.ZodObject<{
11328
+ description: z.ZodString;
11329
+ settings: z.ZodObject<{
11331
11330
  language: z.ZodObject<{
11332
11331
  default: z.ZodEnum<{
11333
11332
  bg: "bg";
@@ -11382,7 +11381,7 @@ declare const createProjectSchema: z.ZodObject<{
11382
11381
  zh: "zh";
11383
11382
  }>>;
11384
11383
  }, z.core.$strip>;
11385
- }, z.core.$strip>>;
11384
+ }, z.core.$strip>;
11386
11385
  }, z.core.$strip>;
11387
11386
  type CreateProjectProps = z.infer<typeof createProjectSchema>;
11388
11387
  declare const readProjectSchema: z.ZodObject<{
@@ -11392,9 +11391,9 @@ declare const readProjectSchema: z.ZodObject<{
11392
11391
  type ReadProjectProps = z.infer<typeof readProjectSchema>;
11393
11392
  declare const updateProjectSchema: z.ZodObject<{
11394
11393
  id: z.ZodReadonly<z.ZodUUID>;
11395
- name: z.ZodOptional<z.ZodString>;
11396
- description: z.ZodOptional<z.ZodString>;
11397
- settings: z.ZodOptional<z.ZodObject<{
11394
+ name: z.ZodString;
11395
+ description: z.ZodString;
11396
+ settings: z.ZodObject<{
11398
11397
  language: z.ZodObject<{
11399
11398
  default: z.ZodEnum<{
11400
11399
  bg: "bg";
@@ -11449,7 +11448,7 @@ declare const updateProjectSchema: z.ZodObject<{
11449
11448
  zh: "zh";
11450
11449
  }>>;
11451
11450
  }, z.core.$strip>;
11452
- }, z.core.$strip>>;
11451
+ }, z.core.$strip>;
11453
11452
  }, z.core.$strip>;
11454
11453
  type UpdateProjectProps = z.infer<typeof updateProjectSchema>;
11455
11454
  declare const upgradeProjectSchema: z.ZodObject<{
@@ -12572,10 +12571,10 @@ declare const serviceTypeSchema: z.ZodEnum<{
12572
12571
  Collection: "Collection";
12573
12572
  Entry: "Entry";
12574
12573
  Asset: "Asset";
12574
+ Project: "Project";
12575
12575
  Git: "Git";
12576
12576
  GitTag: "GitTag";
12577
12577
  User: "User";
12578
- Project: "Project";
12579
12578
  JsonFile: "JsonFile";
12580
12579
  Search: "Search";
12581
12580
  Value: "Value";
@@ -14403,12 +14402,11 @@ declare class EntryService extends AbstractCrudService implements CrudServiceWit
14403
14402
  declare class ProjectService extends AbstractCrudService implements CrudServiceWithListCount<Project> {
14404
14403
  private coreVersion;
14405
14404
  private jsonFileService;
14406
- private userService;
14407
14405
  private gitService;
14408
14406
  private assetService;
14409
14407
  private collectionService;
14410
14408
  private entryService;
14411
- constructor(coreVersion: Version, options: ElekIoCoreOptions, logService: LogService, jsonFileService: JsonFileService, userService: UserService, gitService: GitService, assetService: AssetService, collectionService: CollectionService, entryService: EntryService);
14409
+ constructor(coreVersion: Version, options: ElekIoCoreOptions, logService: LogService, jsonFileService: JsonFileService, gitService: GitService, assetService: AssetService, collectionService: CollectionService, entryService: EntryService);
14412
14410
  /**
14413
14411
  * Creates a new Project
14414
14412
  */
@@ -14524,7 +14522,7 @@ declare class ProjectService extends AbstractCrudService implements CrudServiceW
14524
14522
  /**
14525
14523
  * Lists outdated Projects that need to be upgraded
14526
14524
  */
14527
- listOutdated(): Promise<OutdatedProject[]>;
14525
+ listOutdated(): Promise<MigrateProjectProps[]>;
14528
14526
  list(props?: ListProjectsProps): Promise<PaginatedList<Project>>;
14529
14527
  count(): Promise<number>;
14530
14528
  /**
@@ -14534,7 +14532,7 @@ declare class ProjectService extends AbstractCrudService implements CrudServiceW
14534
14532
  /**
14535
14533
  * Migrates an potentially outdated Project file to the current schema
14536
14534
  */
14537
- migrate(potentiallyOutdatedProjectFile: unknown): {
14535
+ migrate(props: MigrateProjectProps): {
14538
14536
  id: string;
14539
14537
  created: string;
14540
14538
  updated: string | null;
@@ -14727,5 +14725,5 @@ declare class ElekIoCore {
14727
14725
  get api(): LocalApi;
14728
14726
  }
14729
14727
  //#endregion
14730
- export { ApiStartProps, Asset, AssetExport, AssetFieldDefinition, AssetFile, BaseFile, BaseUser, BooleanFieldDefinitionBaseSchema, CloneProjectProps, CloudUser, Collection, CollectionExport, CollectionFile, ConstructorElekIoCoreProps, CountAssetsProps, CountCollectionsProps, CountEntriesProps, CountGitTagsProps, CreateAssetProps, CreateCollectionProps, CreateEntryProps, CreateGitTagProps, CreateProjectProps, CrudService, CrudServiceWithListCount, CurrentBranchProjectProps, DateFieldDefinition, DatetimeFieldDefinition, DeleteAssetProps, DeleteCollectionProps, DeleteEntryProps, DeleteGitTagProps, DeleteProjectProps, DirectBooleanValue, DirectNumberValue, DirectStringValue, DirectValue, ElekIoCoreOptions, EmailFieldDefinition, Entry, EntryExport, EntryFieldDefinition, EntryFile, ExportProps, FieldDefinition, FieldDefinitionBase, FieldDefinitionBaseSchema, FieldType, FieldTypeSchema, FieldWidthSchema, FileReference, GenerateApiClientProps, GetChangesProjectProps, GetRemoteOriginUrlProjectProps, GitCloneOptions, GitCommit, GitInitOptions, GitLogOptions, GitMergeOptions, GitMessage, GitSignature, GitSwitchOptions, GitTag, Ipv4FieldDefinition, ListAssetsProps, ListBranchesProjectProps, ListCollectionsProps, ListEntriesProps, ListGitTagsProps, ListProjectsProps, LocalUser, LogConsoleTransportProps, LogProps, LogSource, NumberFieldDefinition, NumberFieldDefinitionBaseSchema, ObjectType, OutdatedProject, PaginatedList, PaginationOptions, Project, ProjectBranch, ProjectExport, ProjectFile, ProjectFolder, ProjectSettings, ProjectStatus, ProjectUpgrade, RangeFieldDefinition, ReadAssetProps, ReadCollectionProps, ReadEntryProps, ReadGitTagProps, ReadProjectProps, ReferenceFieldDefinitionBaseSchema, ReferencedValue, SaveAssetProps, SearchProjectProps, ServiceType, SetRemoteOriginUrlProjectProps, SetUserProps, StringFieldDefinition, StringFieldDefinitionBaseSchema, SupportedIcon, SupportedLanguage, SwitchBranchProjectProps, SynchronizeProjectProps, TelephoneFieldDefinition, TextFieldDefinition, TextareaFieldDefinition, TimeFieldDefinition, ToggleFieldDefinition, TranslatableBoolean, TranslatableNumber, TranslatableString, UpdateAssetProps, UpdateCollectionProps, UpdateEntryProps, UpdateProjectProps, UpgradeProjectProps, UrlFieldDefinition, User, UserFile, UserTypeSchema, Uuid, Value, ValueContentReference, ValueContentReferenceToAsset, ValueContentReferenceToCollection, ValueContentReferenceToEntry, ValueType, ValueTypeSchema, Version, apiStartSchema, assetExportSchema, assetFieldDefinitionSchema, assetFileSchema, assetSchema, baseFileSchema, baseUserSchema, cloneProjectSchema, cloudUserSchema, collectionExportSchema, collectionFileSchema, collectionSchema, constructorElekIoCoreSchema, countAssetsSchema, countCollectionsSchema, countEntriesSchema, countGitTagsSchema, createAssetSchema, createCollectionSchema, createEntrySchema, createGitTagSchema, createProjectSchema, currentBranchProjectSchema, dateFieldDefinitionSchema, datetime, datetimeFieldDefinitionSchema, type ElekIoCore as default, deleteAssetSchema, deleteCollectionSchema, deleteEntrySchema, deleteGitTagSchema, deleteProjectSchema, directBooleanValueSchema, directNumberValueSchema, directStringValueSchema, directValueBaseSchema, directValueSchema, elekIoCoreOptionsSchema, emailFieldDefinitionSchema, entryExportSchema, entryFieldDefinitionSchema, entryFileSchema, entrySchema, exportSchema, fieldDefinitionSchema, fileReferenceSchema, generateApiClientSchema, getChangesProjectSchema, getCreateEntrySchemaFromFieldDefinitions, getEntrySchemaFromFieldDefinitions, getRemoteOriginUrlProjectSchema, getUpdateEntrySchemaFromFieldDefinitions, getValueSchemaFromFieldDefinition, gitCloneOptionsSchema, gitCommitSchema, gitInitOptionsSchema, gitLogOptionsSchema, gitMergeOptionsSchema, gitMessageSchema, gitSignatureSchema, gitSwitchOptionsSchema, gitTagSchema, ipv4FieldDefinitionSchema, listAssetsSchema, listBranchesProjectSchema, listCollectionsSchema, listEntriesSchema, listGitTagsSchema, listProjectsSchema, localUserSchema, logConsoleTransportSchema, logLevelSchema, logSchema, logSourceSchema, numberFieldDefinitionSchema, objectTypeSchema, outdatedProjectSchema, paginatedListOf, projectBranchSchema, projectExportSchema, projectFileSchema, projectFolderSchema, projectSchema, projectSettingsSchema, projectStatusSchema, projectUpgradeSchema, rangeFieldDefinitionSchema, readAssetSchema, readCollectionSchema, readEntrySchema, readGitTagSchema, readProjectSchema, referencedValueSchema, saveAssetSchema, searchProjectSchema, serviceTypeSchema, setRemoteOriginUrlProjectSchema, setUserSchema, slug, stringFieldDefinitionSchema, supportedIconSchema, supportedLanguageSchema, switchBranchProjectSchema, synchronizeProjectSchema, telephoneFieldDefinitionSchema, textFieldDefinitionSchema, textareaFieldDefinitionSchema, timeFieldDefinitionSchema, toggleFieldDefinitionSchema, translatableArrayOf, translatableBooleanSchema, translatableNumberSchema, translatableStringSchema, updateAssetSchema, updateCollectionSchema, updateEntrySchema, updateProjectSchema, upgradeProjectSchema, urlFieldDefinitionSchema, userFileSchema, userSchema, uuid, uuidSchema, valueContentReferenceBase, valueContentReferenceSchema, valueContentReferenceToAssetSchema, valueContentReferenceToCollectionSchema, valueContentReferenceToEntrySchema, valueSchema, versionSchema };
14728
+ export { ApiStartProps, Asset, AssetExport, AssetFieldDefinition, AssetFile, BaseFile, BaseUser, BooleanFieldDefinitionBaseSchema, CloneProjectProps, CloudUser, Collection, CollectionExport, CollectionFile, ConstructorElekIoCoreProps, CountAssetsProps, CountCollectionsProps, CountEntriesProps, CountGitTagsProps, CreateAssetProps, CreateCollectionProps, CreateEntryProps, CreateGitTagProps, CreateProjectProps, CrudService, CrudServiceWithListCount, CurrentBranchProjectProps, DateFieldDefinition, DatetimeFieldDefinition, DeleteAssetProps, DeleteCollectionProps, DeleteEntryProps, DeleteGitTagProps, DeleteProjectProps, DirectBooleanValue, DirectNumberValue, DirectStringValue, DirectValue, ElekIoCoreOptions, EmailFieldDefinition, Entry, EntryExport, EntryFieldDefinition, EntryFile, ExportProps, FieldDefinition, FieldDefinitionBase, FieldDefinitionBaseSchema, FieldType, FieldTypeSchema, FieldWidthSchema, FileReference, GenerateApiClientProps, GetChangesProjectProps, GetRemoteOriginUrlProjectProps, GitCloneOptions, GitCommit, GitInitOptions, GitLogOptions, GitMergeOptions, GitMessage, GitSignature, GitSwitchOptions, GitTag, Ipv4FieldDefinition, ListAssetsProps, ListBranchesProjectProps, ListCollectionsProps, ListEntriesProps, ListGitTagsProps, ListProjectsProps, LocalUser, LogConsoleTransportProps, LogProps, LogSource, MigrateProjectProps, NumberFieldDefinition, NumberFieldDefinitionBaseSchema, ObjectType, PaginatedList, PaginationOptions, Project, ProjectBranch, ProjectExport, ProjectFile, ProjectFolder, ProjectSettings, ProjectStatus, ProjectUpgrade, RangeFieldDefinition, ReadAssetProps, ReadCollectionProps, ReadEntryProps, ReadGitTagProps, ReadProjectProps, ReferenceFieldDefinitionBaseSchema, ReferencedValue, SaveAssetProps, SearchProjectProps, ServiceType, SetRemoteOriginUrlProjectProps, SetUserProps, StringFieldDefinition, StringFieldDefinitionBaseSchema, SupportedIcon, SupportedLanguage, SwitchBranchProjectProps, SynchronizeProjectProps, TelephoneFieldDefinition, TextFieldDefinition, TextareaFieldDefinition, TimeFieldDefinition, ToggleFieldDefinition, TranslatableBoolean, TranslatableNumber, TranslatableString, UpdateAssetProps, UpdateCollectionProps, UpdateEntryProps, UpdateProjectProps, UpgradeProjectProps, UrlFieldDefinition, User, UserFile, UserTypeSchema, Uuid, Value, ValueContentReference, ValueContentReferenceToAsset, ValueContentReferenceToCollection, ValueContentReferenceToEntry, ValueType, ValueTypeSchema, Version, apiStartSchema, assetExportSchema, assetFieldDefinitionSchema, assetFileSchema, assetSchema, baseFileSchema, baseUserSchema, cloneProjectSchema, cloudUserSchema, collectionExportSchema, collectionFileSchema, collectionSchema, constructorElekIoCoreSchema, countAssetsSchema, countCollectionsSchema, countEntriesSchema, countGitTagsSchema, createAssetSchema, createCollectionSchema, createEntrySchema, createGitTagSchema, createProjectSchema, currentBranchProjectSchema, dateFieldDefinitionSchema, datetime, datetimeFieldDefinitionSchema, type ElekIoCore as default, deleteAssetSchema, deleteCollectionSchema, deleteEntrySchema, deleteGitTagSchema, deleteProjectSchema, directBooleanValueSchema, directNumberValueSchema, directStringValueSchema, directValueBaseSchema, directValueSchema, elekIoCoreOptionsSchema, emailFieldDefinitionSchema, entryExportSchema, entryFieldDefinitionSchema, entryFileSchema, entrySchema, exportSchema, fieldDefinitionSchema, fileReferenceSchema, generateApiClientSchema, getChangesProjectSchema, getCreateEntrySchemaFromFieldDefinitions, getEntrySchemaFromFieldDefinitions, getRemoteOriginUrlProjectSchema, getUpdateEntrySchemaFromFieldDefinitions, getValueSchemaFromFieldDefinition, gitCloneOptionsSchema, gitCommitSchema, gitInitOptionsSchema, gitLogOptionsSchema, gitMergeOptionsSchema, gitMessageSchema, gitSignatureSchema, gitSwitchOptionsSchema, gitTagSchema, ipv4FieldDefinitionSchema, listAssetsSchema, listBranchesProjectSchema, listCollectionsSchema, listEntriesSchema, listGitTagsSchema, listProjectsSchema, localUserSchema, logConsoleTransportSchema, logLevelSchema, logSchema, logSourceSchema, migrateProjectSchema, numberFieldDefinitionSchema, objectTypeSchema, paginatedListOf, projectBranchSchema, projectExportSchema, projectFileSchema, projectFolderSchema, projectSchema, projectSettingsSchema, projectStatusSchema, projectUpgradeSchema, rangeFieldDefinitionSchema, readAssetSchema, readCollectionSchema, readEntrySchema, readGitTagSchema, readProjectSchema, referencedValueSchema, saveAssetSchema, searchProjectSchema, serviceTypeSchema, setRemoteOriginUrlProjectSchema, setUserSchema, slug, stringFieldDefinitionSchema, supportedIconSchema, supportedLanguageSchema, switchBranchProjectSchema, synchronizeProjectSchema, telephoneFieldDefinitionSchema, textFieldDefinitionSchema, textareaFieldDefinitionSchema, timeFieldDefinitionSchema, toggleFieldDefinitionSchema, translatableArrayOf, translatableBooleanSchema, translatableNumberSchema, translatableStringSchema, updateAssetSchema, updateCollectionSchema, updateEntrySchema, updateProjectSchema, upgradeProjectSchema, urlFieldDefinitionSchema, userFileSchema, userSchema, uuid, uuidSchema, valueContentReferenceBase, valueContentReferenceSchema, valueContentReferenceToAssetSchema, valueContentReferenceToCollectionSchema, valueContentReferenceToEntrySchema, valueSchema, versionSchema };
14731
14729
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1,2 +1,2 @@
1
- import{z as e}from"@hono/zod-openapi";import{z as t}from"zod";import n from"@sindresorhus/slugify";import{v4 as ee}from"uuid";const r=e.enum([`bg`,`cs`,`da`,`de`,`el`,`en`,`es`,`et`,`fi`,`fr`,`hu`,`it`,`ja`,`lt`,`lv`,`nl`,`pl`,`pt`,`ro`,`ru`,`sk`,`sl`,`sv`,`zh`]),te=e.enum([`home`,`plus`,`foobar`]),i=e.enum([`project`,`asset`,`collection`,`entry`,`value`,`sharedValue`]),a=e.enum([`error`,`warn`,`info`,`debug`]),o=e.string(),s=e.uuid(`shared.invalidUuid`),c=e.partialRecord(r,e.string().trim().min(1,`shared.translatableStringRequired`)),l=e.partialRecord(r,e.number({error:e=>e.input===void 0?`shared.translatableNumberRequired`:`shared.translatableNumberNotANumber`})),ne=e.partialRecord(r,e.boolean({error:e=>e.input===void 0?`shared.translatableBooleanRequired`:`shared.translatableBooleanNotABoolean`}));function re(t){return e.partialRecord(r,e.array(t))}const u=e.object({objectType:i.readonly(),id:s.readonly(),created:e.string().datetime().readonly(),updated:e.string().datetime().nullable()}),ie=e.object({id:s,extension:e.string().optional()}),d=e.object({name:e.string(),email:e.string().email()}),f=e.object({method:e.enum([`create`,`update`,`delete`,`upgrade`]),reference:e.object({objectType:i,id:s,collectionId:s.optional()})}),p=e.object({id:s,message:e.string(),author:d,datetime:e.string().datetime()}),m=e.object({hash:e.string(),message:f,author:d,datetime:e.string().datetime(),tag:p.nullable()}),ae=e.object({initialBranch:e.string()}),oe=e.object({depth:e.number(),singleBranch:e.boolean(),branch:e.string(),bare:e.boolean()}),se=e.object({squash:e.boolean()}),h=e.object({isNew:e.boolean().optional()}),ce=e.object({limit:e.number().optional(),between:e.object({from:e.string(),to:e.string().optional()}),filePath:e.string().optional()}),le=p.pick({message:!0}).extend({path:e.string(),hash:e.string().optional()}),g=e.object({path:e.string(),id:s.readonly()}),ue=g.extend({}),de=e.object({path:e.string()}),_=u.extend({objectType:e.literal(i.enum.asset).readonly(),name:e.string(),description:e.string(),extension:e.string().readonly(),mimeType:e.string().readonly(),size:e.number().readonly()}),fe=_.extend({absolutePath:e.string().readonly(),history:e.array(m)}).openapi(`Asset`),pe=fe.extend({}),me=_.pick({name:!0,description:!0}).extend({projectId:s.readonly(),filePath:e.string().readonly()}),he=_.pick({id:!0}).extend({projectId:s.readonly(),commitHash:e.string().optional().readonly()}),ge=_.pick({id:!0}).extend({projectId:s.readonly(),filePath:e.string().readonly(),commitHash:e.string().optional().readonly()}),_e=_.pick({id:!0,name:!0,description:!0}).extend({projectId:s.readonly(),newFilePath:e.string().readonly().optional()}),ve=_.pick({id:!0,extension:!0}).extend({projectId:s.readonly()}),ye=e.object({projectId:s.readonly()}),v=e.enum([`string`,`number`,`boolean`,`reference`]),y=e.object({id:s}),b=y.extend({objectType:e.literal(i.enum.asset)}),x=y.extend({objectType:e.literal(i.enum.collection)}),S=y.extend({objectType:e.literal(i.enum.entry)}),C=e.union([b,x,S]),w=e.object({objectType:e.literal(i.enum.value).readonly(),fieldDefinitionId:s.readonly()}),T=w.extend({valueType:e.literal(v.enum.string).readonly(),content:c}),E=w.extend({valueType:e.literal(v.enum.number).readonly(),content:l}),D=w.extend({valueType:e.literal(v.enum.boolean).readonly(),content:ne}),O=e.union([T,E,D]),k=e.object({objectType:e.literal(i.enum.value).readonly(),fieldDefinitionId:s.readonly(),valueType:e.literal(v.enum.reference).readonly(),content:re(C)}),A=e.union([O,k]),j=u.extend({objectType:e.literal(i.enum.entry).readonly(),values:e.array(A)}),M=j.extend({history:e.array(m)}).openapi(`Entry`),N=M.extend({}),P=j.omit({id:!0,objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly(),collectionId:s.readonly(),values:e.array(A)}),F=e.object({id:s.readonly(),projectId:s.readonly(),collectionId:s.readonly(),commitHash:e.string().optional().readonly()}),I=j.omit({objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly(),collectionId:s.readonly()}),be=F.extend({}),xe=e.object({projectId:s.readonly(),collectionId:s.readonly()}),L=e.enum([`text`,`textarea`,`email`,`url`,`ipv4`,`date`,`time`,`datetime`,`telephone`,`number`,`range`,`toggle`,`asset`,`entry`]),R=e.enum([`12`,`6`,`4`,`3`]),z=e.object({id:s.readonly(),label:c,description:c.nullable(),isRequired:e.boolean(),isDisabled:e.boolean(),isUnique:e.boolean(),inputWidth:R}),B=z.extend({valueType:e.literal(v.enum.string),defaultValue:e.string().nullable()}),V=B.extend({fieldType:e.literal(L.enum.text),min:e.number().nullable(),max:e.number().nullable()}),H=B.extend({fieldType:e.literal(L.enum.textarea),min:e.number().nullable(),max:e.number().nullable()}),U=B.extend({fieldType:e.literal(L.enum.email),defaultValue:e.email().nullable()}),Se=B.extend({fieldType:e.literal(L.enum.url),defaultValue:e.url().nullable()}),Ce=B.extend({fieldType:e.literal(L.enum.ipv4),defaultValue:e.ipv4().nullable()}),we=B.extend({fieldType:e.literal(L.enum.date),defaultValue:e.iso.date().nullable()}),Te=B.extend({fieldType:e.literal(L.enum.time),defaultValue:e.iso.time().nullable()}),Ee=B.extend({fieldType:e.literal(L.enum.datetime),defaultValue:e.iso.datetime().nullable()}),De=B.extend({fieldType:e.literal(L.enum.telephone),defaultValue:e.e164().nullable()}),Oe=e.union([V,H,U,Se,Ce,we,Te,Ee,De]),W=z.extend({valueType:e.literal(v.enum.number),min:e.number().nullable(),max:e.number().nullable(),isUnique:e.literal(!1),defaultValue:e.number().nullable()}),ke=W.extend({fieldType:e.literal(L.enum.number)}),Ae=W.extend({fieldType:e.literal(L.enum.range),isRequired:e.literal(!0),min:e.number(),max:e.number(),defaultValue:e.number()}),je=z.extend({valueType:e.literal(v.enum.boolean),isRequired:e.literal(!0),defaultValue:e.boolean(),isUnique:e.literal(!1)}),Me=je.extend({fieldType:e.literal(L.enum.toggle)}),G=z.extend({valueType:e.literal(v.enum.reference)}),Ne=G.extend({fieldType:e.literal(L.enum.asset),min:e.number().nullable(),max:e.number().nullable()}),Pe=G.extend({fieldType:e.literal(L.enum.entry),ofCollections:e.array(s),min:e.number().nullable(),max:e.number().nullable()}),Fe=e.union([Oe,ke,Ae,Me,Ne,Pe]),K=u.extend({objectType:e.literal(i.enum.collection).readonly(),name:e.object({singular:c,plural:c}),slug:e.object({singular:e.string(),plural:e.string()}),description:c,icon:te,fieldDefinitions:e.array(Fe)}),Ie=K.extend({history:e.array(m)}).openapi(`Collection`),q=Ie.extend({entries:e.array(N)}),Le=K.omit({id:!0,objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly()}),Re=e.object({id:s.readonly(),projectId:s.readonly(),commitHash:e.string().optional().readonly()}),ze=K.pick({id:!0,name:!0,slug:!0,description:!0,icon:!0,fieldDefinitions:!0}).extend({projectId:s.readonly()}),Be=Re.extend({}),Ve=e.object({projectId:s.readonly()}),He=e.object({log:e.object({level:a}),file:e.object({cache:e.boolean()})}),Ue=He.partial({log:!0,file:!0}).optional(),We=e.enum([`foo`,`bar`,`todo`]),Ge=e.object({language:e.object({default:r,supported:e.array(r)})}),Ke=e.enum([`assets`,`collections`,`shared-values`,`lfs`]),qe=e.enum([`production`,`work`]),J=u.extend({objectType:e.literal(i.enum.project).readonly(),coreVersion:o,name:e.string().trim().min(1,`shared.projectNameRequired`),description:e.string().trim().min(1,`shared.projectDescriptionRequired`),version:o,status:We,settings:Ge}),Y=J.extend({remoteOriginUrl:e.string().nullable().openapi({description:`URL of the remote Git repository`}),history:e.array(m).openapi({description:`Commit history of this Project`}),fullHistory:e.array(m).openapi({description:`Full commit history of this Project including all Assets, Collections, Entries and other files`})}).openapi(`Project`),Je=J.pick({id:!0,name:!0,coreVersion:!0}),Ye=Y.extend({assets:e.array(pe),collections:e.array(q)}),Xe=Y.pick({name:!0,description:!0,settings:!0}).partial({description:!0,settings:!0}),Ze=e.object({id:s.readonly(),commitHash:e.string().optional().readonly()}),Qe=Y.pick({id:!0,name:!0,description:!0,settings:!0}).partial({name:!0,description:!0,settings:!0}),$e=e.object({id:s.readonly(),force:e.boolean().optional()}),et=Ze.extend({force:e.boolean().optional()}),tt=e.object({to:o.readonly(),run:e.function({input:[J],output:e.promise(e.void())})}),nt=e.object({url:e.string()}),rt=e.object({id:s.readonly()}),it=e.object({id:s.readonly()}),at=e.object({id:s.readonly(),branch:e.string(),options:h.optional()}),ot=e.object({id:s.readonly()}),st=e.object({id:s.readonly(),url:e.string()}),ct=e.object({id:s.readonly()}),lt=e.object({id:s.readonly()}),ut=e.object({id:s.readonly(),query:e.string(),language:r,type:e.array(i).optional()});function dt(){return e.boolean()}function ft(t){let n=e.number();return t.min&&(n=n.min(t.min)),t.max&&(n=n.max(t.max)),t.isRequired===!1?n.nullable():n}function pt(t){let n=null;switch(t.fieldType){case L.enum.email:n=e.email();break;case L.enum.url:n=e.url();break;case L.enum.ipv4:n=e.ipv4();break;case L.enum.date:n=e.iso.date();break;case L.enum.time:n=e.iso.time();break;case L.enum.datetime:n=e.iso.datetime();break;case L.enum.telephone:n=e.e164();break;case L.enum.text:case L.enum.textarea:n=e.string().trim();break}return`min`in t&&t.min&&(n=n.min(t.min)),`max`in t&&t.max&&(n=n.max(t.max)),t.isRequired===!1?n.nullable():n.min(1,`shared.stringValueRequired`)}function mt(t){let n;switch(t.fieldType){case L.enum.asset:n=e.array(b);break;case L.enum.entry:n=e.array(S);break}return t.isRequired&&(n=n.min(1,`shared.referenceRequired`)),t.min&&(n=n.min(t.min)),t.max&&(n=n.max(t.max)),n}function ht(t){return e.partialRecord(r,pt(t))}function gt(t){return e.partialRecord(r,ft(t))}function _t(){return e.partialRecord(r,dt())}function vt(t){return e.partialRecord(r,mt(t))}function X(e){switch(e.valueType){case v.enum.boolean:return D.extend({content:_t()});case v.enum.number:return E.extend({content:gt(e)});case v.enum.string:return T.extend({content:ht(e)});case v.enum.reference:return k.extend({content:vt(e)});default:throw Error(`Error generating schema for unsupported ValueType "${e.valueType}"`)}}function yt(t){let n=t.map(e=>X(e));return e.object({...M.shape,values:e.tuple(n)})}function bt(t){let n=t.map(e=>X(e));return e.object({...P.shape,values:e.tuple(n)})}function xt(t){let n=t.map(e=>X(e));return e.object({...I.shape,values:e.tuple(n)})}const St=e.enum([`Git`,`GitTag`,`User`,`Project`,`Asset`,`JsonFile`,`Search`,`Collection`,`Entry`,`Value`]);function Ct(t){return e.object({total:e.number(),limit:e.number(),offset:e.number(),list:e.array(t)})}const Z=e.object({projectId:s,limit:e.number().optional(),offset:e.number().optional()}),wt=Z,Tt=Z.extend({collectionId:s}),Et=Z,Dt=Z.omit({projectId:!0}),Ot=e.object({path:e.string()}),Q=e.enum([`local`,`cloud`]),$=d.extend({userType:Q,language:r,localApi:e.object({isEnabled:e.boolean(),port:e.number()})}),kt=$.extend({userType:e.literal(Q.enum.local)}),At=$.extend({userType:e.literal(Q.enum.cloud),id:s}),jt=e.union([kt,At]),Mt=jt,Nt=Mt,Pt=t.string().default(`./.elek.io`),Ft=t.enum([`ts`,`js`]).default(`ts`),It=t.enum([`esm`,`cjs`]).default(`esm`),Lt=t.enum([`es3`,`es5`,`es6`,`es2015`,`es2016`,`es2017`,`es2018`,`es2019`,`es2020`,`es2021`,`es2022`,`es2023`,`es2024`,`esnext`]).default(`es2020`),Rt=t.string().default(`all`).transform(e=>e===`all`?`all`:e.split(`,`).map(e=>s.parse(e.trim()))),zt=t.object({watch:t.boolean().default(!1)}),Bt=zt.extend({separate:t.boolean().default(!1)}),Vt=t.object({outDir:Pt,language:Ft,format:It,target:Lt,options:zt}),Ht=t.string().default(`31310`).transform((e,n)=>{try{return parseInt(e)}catch{return n.addIssue({code:`custom`,message:`Invalid port number`,input:e}),t.NEVER}}),Ut=t.object({port:Ht}),Wt=t.object({outDir:Pt,projects:Rt,options:Bt}),Gt=e.enum([`core`,`desktop`]),Kt=e.object({source:Gt,message:e.string(),meta:e.record(e.string(),e.unknown()).optional()}),qt=Kt.extend({timestamp:e.string(),level:e.string()});function Jt(){return ee()}function Yt(e){return e?new Date(e).toISOString():new Date().toISOString()}function Xt(e){return n(e,{separator:`-`,lowercase:!0,decamelize:!0})}export{je as BooleanFieldDefinitionBaseSchema,z as FieldDefinitionBaseSchema,L as FieldTypeSchema,R as FieldWidthSchema,W as NumberFieldDefinitionBaseSchema,G as ReferenceFieldDefinitionBaseSchema,B as StringFieldDefinitionBaseSchema,Q as UserTypeSchema,v as ValueTypeSchema,Ut as apiStartSchema,pe as assetExportSchema,Ne as assetFieldDefinitionSchema,_ as assetFileSchema,fe as assetSchema,u as baseFileSchema,$ as baseUserSchema,nt as cloneProjectSchema,At as cloudUserSchema,q as collectionExportSchema,K as collectionFileSchema,Ie as collectionSchema,Ue as constructorElekIoCoreSchema,ye as countAssetsSchema,Ve as countCollectionsSchema,xe as countEntriesSchema,de as countGitTagsSchema,me as createAssetSchema,Le as createCollectionSchema,P as createEntrySchema,le as createGitTagSchema,Xe as createProjectSchema,it as currentBranchProjectSchema,we as dateFieldDefinitionSchema,Yt as datetime,Ee as datetimeFieldDefinitionSchema,ve as deleteAssetSchema,Be as deleteCollectionSchema,be as deleteEntrySchema,ue as deleteGitTagSchema,et as deleteProjectSchema,D as directBooleanValueSchema,E as directNumberValueSchema,T as directStringValueSchema,w as directValueBaseSchema,O as directValueSchema,He as elekIoCoreOptionsSchema,U as emailFieldDefinitionSchema,N as entryExportSchema,Pe as entryFieldDefinitionSchema,j as entryFileSchema,M as entrySchema,Wt as exportSchema,Fe as fieldDefinitionSchema,ie as fileReferenceSchema,Vt as generateApiClientSchema,ct as getChangesProjectSchema,bt as getCreateEntrySchemaFromFieldDefinitions,yt as getEntrySchemaFromFieldDefinitions,ot as getRemoteOriginUrlProjectSchema,xt as getUpdateEntrySchemaFromFieldDefinitions,X as getValueSchemaFromFieldDefinition,oe as gitCloneOptionsSchema,m as gitCommitSchema,ae as gitInitOptionsSchema,ce as gitLogOptionsSchema,se as gitMergeOptionsSchema,f as gitMessageSchema,d as gitSignatureSchema,h as gitSwitchOptionsSchema,p as gitTagSchema,Ce as ipv4FieldDefinitionSchema,Et as listAssetsSchema,rt as listBranchesProjectSchema,wt as listCollectionsSchema,Tt as listEntriesSchema,Ot as listGitTagsSchema,Dt as listProjectsSchema,kt as localUserSchema,qt as logConsoleTransportSchema,a as logLevelSchema,Kt as logSchema,Gt as logSourceSchema,ke as numberFieldDefinitionSchema,i as objectTypeSchema,Je as outdatedProjectSchema,Ct as paginatedListOf,qe as projectBranchSchema,Ye as projectExportSchema,J as projectFileSchema,Ke as projectFolderSchema,Y as projectSchema,Ge as projectSettingsSchema,We as projectStatusSchema,tt as projectUpgradeSchema,Ae as rangeFieldDefinitionSchema,he as readAssetSchema,Re as readCollectionSchema,F as readEntrySchema,g as readGitTagSchema,Ze as readProjectSchema,k as referencedValueSchema,ge as saveAssetSchema,ut as searchProjectSchema,St as serviceTypeSchema,st as setRemoteOriginUrlProjectSchema,Nt as setUserSchema,Xt as slug,Oe as stringFieldDefinitionSchema,te as supportedIconSchema,r as supportedLanguageSchema,at as switchBranchProjectSchema,lt as synchronizeProjectSchema,De as telephoneFieldDefinitionSchema,V as textFieldDefinitionSchema,H as textareaFieldDefinitionSchema,Te as timeFieldDefinitionSchema,Me as toggleFieldDefinitionSchema,re as translatableArrayOf,ne as translatableBooleanSchema,l as translatableNumberSchema,c as translatableStringSchema,_e as updateAssetSchema,ze as updateCollectionSchema,I as updateEntrySchema,Qe as updateProjectSchema,$e as upgradeProjectSchema,Se as urlFieldDefinitionSchema,jt as userFileSchema,Mt as userSchema,Jt as uuid,s as uuidSchema,y as valueContentReferenceBase,C as valueContentReferenceSchema,b as valueContentReferenceToAssetSchema,x as valueContentReferenceToCollectionSchema,S as valueContentReferenceToEntrySchema,A as valueSchema,o as versionSchema};
1
+ import{z as e}from"@hono/zod-openapi";import{z as t}from"zod";import n from"@sindresorhus/slugify";import{v4 as ee}from"uuid";const r=e.enum([`bg`,`cs`,`da`,`de`,`el`,`en`,`es`,`et`,`fi`,`fr`,`hu`,`it`,`ja`,`lt`,`lv`,`nl`,`pl`,`pt`,`ro`,`ru`,`sk`,`sl`,`sv`,`zh`]),te=e.enum([`home`,`plus`,`foobar`]),i=e.enum([`project`,`asset`,`collection`,`entry`,`value`,`sharedValue`]),a=e.enum([`error`,`warn`,`info`,`debug`]),o=e.string(),s=e.uuid(`shared.invalidUuid`),c=e.partialRecord(r,e.string().trim().min(1,`shared.translatableStringRequired`)),l=e.partialRecord(r,e.number({error:e=>e.input===void 0?`shared.translatableNumberRequired`:`shared.translatableNumberNotANumber`})),ne=e.partialRecord(r,e.boolean({error:e=>e.input===void 0?`shared.translatableBooleanRequired`:`shared.translatableBooleanNotABoolean`}));function re(t){return e.partialRecord(r,e.array(t))}const u=e.object({objectType:i.readonly(),id:s.readonly(),created:e.string().datetime().readonly(),updated:e.string().datetime().nullable()}),ie=e.object({id:s,extension:e.string().optional()}),d=e.object({name:e.string(),email:e.string().email()}),f=e.object({method:e.enum([`create`,`update`,`delete`,`upgrade`]),reference:e.object({objectType:i,id:s,collectionId:s.optional()})}),p=e.object({id:s,message:e.string(),author:d,datetime:e.string().datetime()}),m=e.object({hash:e.string(),message:f,author:d,datetime:e.string().datetime(),tag:p.nullable()}),ae=e.object({initialBranch:e.string()}),oe=e.object({depth:e.number(),singleBranch:e.boolean(),branch:e.string(),bare:e.boolean()}),se=e.object({squash:e.boolean()}),h=e.object({isNew:e.boolean().optional()}),ce=e.object({limit:e.number().optional(),between:e.object({from:e.string(),to:e.string().optional()}),filePath:e.string().optional()}),le=p.pick({message:!0}).extend({path:e.string(),hash:e.string().optional()}),g=e.object({path:e.string(),id:s.readonly()}),ue=g.extend({}),de=e.object({path:e.string()}),_=u.extend({objectType:e.literal(i.enum.asset).readonly(),name:e.string(),description:e.string(),extension:e.string().readonly(),mimeType:e.string().readonly(),size:e.number().readonly()}),fe=_.extend({absolutePath:e.string().readonly(),history:e.array(m)}).openapi(`Asset`),pe=fe.extend({}),me=_.pick({name:!0,description:!0}).extend({projectId:s.readonly(),filePath:e.string().readonly()}),he=_.pick({id:!0}).extend({projectId:s.readonly(),commitHash:e.string().optional().readonly()}),ge=_.pick({id:!0}).extend({projectId:s.readonly(),filePath:e.string().readonly(),commitHash:e.string().optional().readonly()}),_e=_.pick({id:!0,name:!0,description:!0}).extend({projectId:s.readonly(),newFilePath:e.string().readonly().optional()}),ve=_.pick({id:!0,extension:!0}).extend({projectId:s.readonly()}),ye=e.object({projectId:s.readonly()}),v=e.enum([`string`,`number`,`boolean`,`reference`]),y=e.object({id:s}),b=y.extend({objectType:e.literal(i.enum.asset)}),x=y.extend({objectType:e.literal(i.enum.collection)}),S=y.extend({objectType:e.literal(i.enum.entry)}),C=e.union([b,x,S]),w=e.object({objectType:e.literal(i.enum.value).readonly(),fieldDefinitionId:s.readonly()}),T=w.extend({valueType:e.literal(v.enum.string).readonly(),content:c}),E=w.extend({valueType:e.literal(v.enum.number).readonly(),content:l}),D=w.extend({valueType:e.literal(v.enum.boolean).readonly(),content:ne}),O=e.union([T,E,D]),k=e.object({objectType:e.literal(i.enum.value).readonly(),fieldDefinitionId:s.readonly(),valueType:e.literal(v.enum.reference).readonly(),content:re(C)}),A=e.union([O,k]),j=u.extend({objectType:e.literal(i.enum.entry).readonly(),values:e.array(A)}),M=j.extend({history:e.array(m)}).openapi(`Entry`),N=M.extend({}),P=j.omit({id:!0,objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly(),collectionId:s.readonly(),values:e.array(A)}),F=e.object({id:s.readonly(),projectId:s.readonly(),collectionId:s.readonly(),commitHash:e.string().optional().readonly()}),I=j.omit({objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly(),collectionId:s.readonly()}),be=F.extend({}),xe=e.object({projectId:s.readonly(),collectionId:s.readonly()}),L=e.enum([`text`,`textarea`,`email`,`url`,`ipv4`,`date`,`time`,`datetime`,`telephone`,`number`,`range`,`toggle`,`asset`,`entry`]),R=e.enum([`12`,`6`,`4`,`3`]),z=e.object({id:s.readonly(),label:c,description:c.nullable(),isRequired:e.boolean(),isDisabled:e.boolean(),isUnique:e.boolean(),inputWidth:R}),B=z.extend({valueType:e.literal(v.enum.string),defaultValue:e.string().nullable()}),V=B.extend({fieldType:e.literal(L.enum.text),min:e.number().nullable(),max:e.number().nullable()}),H=B.extend({fieldType:e.literal(L.enum.textarea),min:e.number().nullable(),max:e.number().nullable()}),U=B.extend({fieldType:e.literal(L.enum.email),defaultValue:e.email().nullable()}),Se=B.extend({fieldType:e.literal(L.enum.url),defaultValue:e.url().nullable()}),Ce=B.extend({fieldType:e.literal(L.enum.ipv4),defaultValue:e.ipv4().nullable()}),we=B.extend({fieldType:e.literal(L.enum.date),defaultValue:e.iso.date().nullable()}),Te=B.extend({fieldType:e.literal(L.enum.time),defaultValue:e.iso.time().nullable()}),Ee=B.extend({fieldType:e.literal(L.enum.datetime),defaultValue:e.iso.datetime().nullable()}),De=B.extend({fieldType:e.literal(L.enum.telephone),defaultValue:e.e164().nullable()}),Oe=e.union([V,H,U,Se,Ce,we,Te,Ee,De]),W=z.extend({valueType:e.literal(v.enum.number),min:e.number().nullable(),max:e.number().nullable(),isUnique:e.literal(!1),defaultValue:e.number().nullable()}),ke=W.extend({fieldType:e.literal(L.enum.number)}),Ae=W.extend({fieldType:e.literal(L.enum.range),isRequired:e.literal(!0),min:e.number(),max:e.number(),defaultValue:e.number()}),je=z.extend({valueType:e.literal(v.enum.boolean),isRequired:e.literal(!0),defaultValue:e.boolean(),isUnique:e.literal(!1)}),Me=je.extend({fieldType:e.literal(L.enum.toggle)}),G=z.extend({valueType:e.literal(v.enum.reference)}),Ne=G.extend({fieldType:e.literal(L.enum.asset),min:e.number().nullable(),max:e.number().nullable()}),Pe=G.extend({fieldType:e.literal(L.enum.entry),ofCollections:e.array(s),min:e.number().nullable(),max:e.number().nullable()}),Fe=e.union([Oe,ke,Ae,Me,Ne,Pe]),K=u.extend({objectType:e.literal(i.enum.collection).readonly(),name:e.object({singular:c,plural:c}),slug:e.object({singular:e.string(),plural:e.string()}),description:c,icon:te,fieldDefinitions:e.array(Fe)}),Ie=K.extend({history:e.array(m)}).openapi(`Collection`),q=Ie.extend({entries:e.array(N)}),Le=K.omit({id:!0,objectType:!0,created:!0,updated:!0}).extend({projectId:s.readonly()}),Re=e.object({id:s.readonly(),projectId:s.readonly(),commitHash:e.string().optional().readonly()}),ze=K.pick({id:!0,name:!0,slug:!0,description:!0,icon:!0,fieldDefinitions:!0}).extend({projectId:s.readonly()}),Be=Re.extend({}),Ve=e.object({projectId:s.readonly()}),He=e.object({log:e.object({level:a}),file:e.object({cache:e.boolean()})}),Ue=He.partial({log:!0,file:!0}).optional(),We=e.enum([`foo`,`bar`,`todo`]),Ge=e.object({language:e.object({default:r,supported:e.array(r)})}),Ke=e.enum([`assets`,`collections`,`shared-values`,`lfs`]),qe=e.enum([`production`,`work`]),J=u.extend({objectType:e.literal(i.enum.project).readonly(),coreVersion:o,name:e.string().trim().min(1,`shared.projectNameRequired`),description:e.string().trim().min(1,`shared.projectDescriptionRequired`),version:o,status:We,settings:Ge}),Y=J.extend({remoteOriginUrl:e.string().nullable().openapi({description:`URL of the remote Git repository`}),history:e.array(m).openapi({description:`Commit history of this Project`}),fullHistory:e.array(m).openapi({description:`Full commit history of this Project including all Assets, Collections, Entries and other files`})}).openapi(`Project`),Je=J.pick({id:!0,coreVersion:!0}).loose(),Ye=Y.extend({assets:e.array(pe),collections:e.array(q)}),Xe=Y.pick({name:!0,description:!0,settings:!0}),Ze=e.object({id:s.readonly(),commitHash:e.string().optional().readonly()}),Qe=Y.pick({id:!0,name:!0,description:!0,settings:!0}),$e=e.object({id:s.readonly(),force:e.boolean().optional()}),et=Ze.extend({force:e.boolean().optional()}),tt=e.object({to:o.readonly(),run:e.function({input:[J],output:e.promise(e.void())})}),nt=e.object({url:e.string()}),rt=e.object({id:s.readonly()}),it=e.object({id:s.readonly()}),at=e.object({id:s.readonly(),branch:e.string(),options:h.optional()}),ot=e.object({id:s.readonly()}),st=e.object({id:s.readonly(),url:e.string()}),ct=e.object({id:s.readonly()}),lt=e.object({id:s.readonly()}),ut=e.object({id:s.readonly(),query:e.string(),language:r,type:e.array(i).optional()});function dt(){return e.boolean()}function ft(t){let n=e.number();return t.min&&(n=n.min(t.min)),t.max&&(n=n.max(t.max)),t.isRequired===!1?n.nullable():n}function pt(t){let n=null;switch(t.fieldType){case L.enum.email:n=e.email();break;case L.enum.url:n=e.url();break;case L.enum.ipv4:n=e.ipv4();break;case L.enum.date:n=e.iso.date();break;case L.enum.time:n=e.iso.time();break;case L.enum.datetime:n=e.iso.datetime();break;case L.enum.telephone:n=e.e164();break;case L.enum.text:case L.enum.textarea:n=e.string().trim();break}return`min`in t&&t.min&&(n=n.min(t.min)),`max`in t&&t.max&&(n=n.max(t.max)),t.isRequired===!1?n.nullable():n.min(1,`shared.stringValueRequired`)}function mt(t){let n;switch(t.fieldType){case L.enum.asset:n=e.array(b);break;case L.enum.entry:n=e.array(S);break}return t.isRequired&&(n=n.min(1,`shared.referenceRequired`)),t.min&&(n=n.min(t.min)),t.max&&(n=n.max(t.max)),n}function ht(t){return e.partialRecord(r,pt(t))}function gt(t){return e.partialRecord(r,ft(t))}function _t(){return e.partialRecord(r,dt())}function vt(t){return e.partialRecord(r,mt(t))}function X(e){switch(e.valueType){case v.enum.boolean:return D.extend({content:_t()});case v.enum.number:return E.extend({content:gt(e)});case v.enum.string:return T.extend({content:ht(e)});case v.enum.reference:return k.extend({content:vt(e)});default:throw Error(`Error generating schema for unsupported ValueType "${e.valueType}"`)}}function yt(t){let n=t.map(e=>X(e));return e.object({...M.shape,values:e.tuple(n)})}function bt(t){let n=t.map(e=>X(e));return e.object({...P.shape,values:e.tuple(n)})}function xt(t){let n=t.map(e=>X(e));return e.object({...I.shape,values:e.tuple(n)})}const St=e.enum([`Git`,`GitTag`,`User`,`Project`,`Asset`,`JsonFile`,`Search`,`Collection`,`Entry`,`Value`]);function Ct(t){return e.object({total:e.number(),limit:e.number(),offset:e.number(),list:e.array(t)})}const Z=e.object({projectId:s,limit:e.number().optional(),offset:e.number().optional()}),wt=Z,Tt=Z.extend({collectionId:s}),Et=Z,Dt=Z.omit({projectId:!0}),Ot=e.object({path:e.string()}),Q=e.enum([`local`,`cloud`]),$=d.extend({userType:Q,language:r,localApi:e.object({isEnabled:e.boolean(),port:e.number()})}),kt=$.extend({userType:e.literal(Q.enum.local)}),At=$.extend({userType:e.literal(Q.enum.cloud),id:s}),jt=e.union([kt,At]),Mt=jt,Nt=Mt,Pt=t.string().default(`./.elek.io`),Ft=t.enum([`ts`,`js`]).default(`ts`),It=t.enum([`esm`,`cjs`]).default(`esm`),Lt=t.enum([`es3`,`es5`,`es6`,`es2015`,`es2016`,`es2017`,`es2018`,`es2019`,`es2020`,`es2021`,`es2022`,`es2023`,`es2024`,`esnext`]).default(`es2020`),Rt=t.string().default(`all`).transform(e=>e===`all`?`all`:e.split(`,`).map(e=>s.parse(e.trim()))),zt=t.object({watch:t.boolean().default(!1)}),Bt=zt.extend({separate:t.boolean().default(!1)}),Vt=t.object({outDir:Pt,language:Ft,format:It,target:Lt,options:zt}),Ht=t.string().default(`31310`).transform((e,n)=>{try{return parseInt(e)}catch{return n.addIssue({code:`custom`,message:`Invalid port number`,input:e}),t.NEVER}}),Ut=t.object({port:Ht}),Wt=t.object({outDir:Pt,projects:Rt,options:Bt}),Gt=e.enum([`core`,`desktop`]),Kt=e.object({source:Gt,message:e.string(),meta:e.record(e.string(),e.unknown()).optional()}),qt=Kt.extend({timestamp:e.string(),level:e.string()});function Jt(){return ee()}function Yt(e){return e?new Date(e).toISOString():new Date().toISOString()}function Xt(e){return n(e,{separator:`-`,lowercase:!0,decamelize:!0})}export{je as BooleanFieldDefinitionBaseSchema,z as FieldDefinitionBaseSchema,L as FieldTypeSchema,R as FieldWidthSchema,W as NumberFieldDefinitionBaseSchema,G as ReferenceFieldDefinitionBaseSchema,B as StringFieldDefinitionBaseSchema,Q as UserTypeSchema,v as ValueTypeSchema,Ut as apiStartSchema,pe as assetExportSchema,Ne as assetFieldDefinitionSchema,_ as assetFileSchema,fe as assetSchema,u as baseFileSchema,$ as baseUserSchema,nt as cloneProjectSchema,At as cloudUserSchema,q as collectionExportSchema,K as collectionFileSchema,Ie as collectionSchema,Ue as constructorElekIoCoreSchema,ye as countAssetsSchema,Ve as countCollectionsSchema,xe as countEntriesSchema,de as countGitTagsSchema,me as createAssetSchema,Le as createCollectionSchema,P as createEntrySchema,le as createGitTagSchema,Xe as createProjectSchema,it as currentBranchProjectSchema,we as dateFieldDefinitionSchema,Yt as datetime,Ee as datetimeFieldDefinitionSchema,ve as deleteAssetSchema,Be as deleteCollectionSchema,be as deleteEntrySchema,ue as deleteGitTagSchema,et as deleteProjectSchema,D as directBooleanValueSchema,E as directNumberValueSchema,T as directStringValueSchema,w as directValueBaseSchema,O as directValueSchema,He as elekIoCoreOptionsSchema,U as emailFieldDefinitionSchema,N as entryExportSchema,Pe as entryFieldDefinitionSchema,j as entryFileSchema,M as entrySchema,Wt as exportSchema,Fe as fieldDefinitionSchema,ie as fileReferenceSchema,Vt as generateApiClientSchema,ct as getChangesProjectSchema,bt as getCreateEntrySchemaFromFieldDefinitions,yt as getEntrySchemaFromFieldDefinitions,ot as getRemoteOriginUrlProjectSchema,xt as getUpdateEntrySchemaFromFieldDefinitions,X as getValueSchemaFromFieldDefinition,oe as gitCloneOptionsSchema,m as gitCommitSchema,ae as gitInitOptionsSchema,ce as gitLogOptionsSchema,se as gitMergeOptionsSchema,f as gitMessageSchema,d as gitSignatureSchema,h as gitSwitchOptionsSchema,p as gitTagSchema,Ce as ipv4FieldDefinitionSchema,Et as listAssetsSchema,rt as listBranchesProjectSchema,wt as listCollectionsSchema,Tt as listEntriesSchema,Ot as listGitTagsSchema,Dt as listProjectsSchema,kt as localUserSchema,qt as logConsoleTransportSchema,a as logLevelSchema,Kt as logSchema,Gt as logSourceSchema,Je as migrateProjectSchema,ke as numberFieldDefinitionSchema,i as objectTypeSchema,Ct as paginatedListOf,qe as projectBranchSchema,Ye as projectExportSchema,J as projectFileSchema,Ke as projectFolderSchema,Y as projectSchema,Ge as projectSettingsSchema,We as projectStatusSchema,tt as projectUpgradeSchema,Ae as rangeFieldDefinitionSchema,he as readAssetSchema,Re as readCollectionSchema,F as readEntrySchema,g as readGitTagSchema,Ze as readProjectSchema,k as referencedValueSchema,ge as saveAssetSchema,ut as searchProjectSchema,St as serviceTypeSchema,st as setRemoteOriginUrlProjectSchema,Nt as setUserSchema,Xt as slug,Oe as stringFieldDefinitionSchema,te as supportedIconSchema,r as supportedLanguageSchema,at as switchBranchProjectSchema,lt as synchronizeProjectSchema,De as telephoneFieldDefinitionSchema,V as textFieldDefinitionSchema,H as textareaFieldDefinitionSchema,Te as timeFieldDefinitionSchema,Me as toggleFieldDefinitionSchema,re as translatableArrayOf,ne as translatableBooleanSchema,l as translatableNumberSchema,c as translatableStringSchema,_e as updateAssetSchema,ze as updateCollectionSchema,I as updateEntrySchema,Qe as updateProjectSchema,$e as upgradeProjectSchema,Se as urlFieldDefinitionSchema,jt as userFileSchema,Mt as userSchema,Jt as uuid,s as uuidSchema,y as valueContentReferenceBase,C as valueContentReferenceSchema,b as valueContentReferenceToAssetSchema,x as valueContentReferenceToCollectionSchema,S as valueContentReferenceToEntrySchema,A as valueSchema,o as versionSchema};
2
2
  //# sourceMappingURL=index.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","names":["z","generateUuid"],"sources":["../../src/schema/baseSchema.ts","../../src/schema/fileSchema.ts","../../src/schema/gitSchema.ts","../../src/schema/assetSchema.ts","../../src/schema/valueSchema.ts","../../src/schema/entrySchema.ts","../../src/schema/fieldSchema.ts","../../src/schema/collectionSchema.ts","../../src/schema/coreSchema.ts","../../src/schema/projectSchema.ts","../../src/schema/schemaFromFieldDefinition.ts","../../src/schema/serviceSchema.ts","../../src/schema/userSchema.ts","../../src/schema/cliSchema.ts","../../src/schema/logSchema.ts","../../src/util/shared.ts"],"sourcesContent":["import { z } from '@hono/zod-openapi';\n\n/**\n * All currently supported, BCP 47 compliant language tags\n *\n * The support depends on the tools and libraries we use.\n * We can't support a given language, if there is no support\n * for it from used third parties. Currently, to check if a langauge\n * tag can be added to this list, it needs to be supported by:\n * - DeepL translation API\n *\n * @see https://www.deepl.com/docs-api/other-functions/listing-supported-languages/\n */\nexport const supportedLanguageSchema = z.enum([\n /**\n * Bulgarian\n */\n 'bg', //\n 'cs', // Czech\n 'da', // Danish\n 'de', // German\n 'el', // Greek\n 'en', // (US) English\n 'es', // Spanish\n 'et', // Estonian\n 'fi', // Finnish\n 'fr', // French\n 'hu', // Hungarian\n 'it', // Italian\n 'ja', // Japanese\n 'lt', // Lithuanian\n 'lv', // Latvian\n 'nl', // Dutch\n 'pl', // Polish\n 'pt', // Portuguese\n 'ro', // Romanian\n 'ru', // Russian\n 'sk', // Slovak\n 'sl', // Slovenian\n 'sv', // Swedish\n 'zh', // (Simplified) Chinese\n]);\nexport type SupportedLanguage = z.infer<typeof supportedLanguageSchema>;\n\nexport const supportedIconSchema = z.enum(['home', 'plus', 'foobar']);\nexport type SupportedIcon = z.infer<typeof supportedIconSchema>;\n\nexport const objectTypeSchema = z.enum([\n 'project',\n 'asset',\n 'collection',\n 'entry',\n 'value',\n 'sharedValue',\n]);\nexport type ObjectType = z.infer<typeof objectTypeSchema>;\n\nexport const logLevelSchema = z.enum(['error', 'warn', 'info', 'debug']);\n\nexport const versionSchema = z.string();\n// .refine((version) => {\n// if (Semver.valid(version) !== null) {\n// return true;\n// }\n// return false;\n// }, 'String must follow the Semantic Versioning format (https://semver.org/)');\nexport type Version = z.infer<typeof versionSchema>;\n\nexport const uuidSchema = z.uuid('shared.invalidUuid');\nexport type Uuid = z.infer<typeof uuidSchema>;\n\n/**\n * A record that can be used to translate a string value into all supported languages\n */\nexport const translatableStringSchema = z.partialRecord(\n supportedLanguageSchema,\n z.string().trim().min(1, 'shared.translatableStringRequired')\n);\nexport type TranslatableString = z.infer<typeof translatableStringSchema>;\n\n/**\n * A record that can be used to translate a number value into all supported languages\n */\nexport const translatableNumberSchema = z.partialRecord(\n supportedLanguageSchema,\n z.number({\n error: (error) =>\n error.input === undefined\n ? 'shared.translatableNumberRequired'\n : 'shared.translatableNumberNotANumber',\n })\n);\nexport type TranslatableNumber = z.infer<typeof translatableNumberSchema>;\n\n/**\n * A record that can be used to translate a boolean value into all supported languages\n */\nexport const translatableBooleanSchema = z.partialRecord(\n supportedLanguageSchema,\n z.boolean({\n error: (error) =>\n error.input === undefined\n ? 'shared.translatableBooleanRequired'\n : 'shared.translatableBooleanNotABoolean',\n })\n);\nexport type TranslatableBoolean = z.infer<typeof translatableBooleanSchema>;\n\nexport function translatableArrayOf<T extends z.ZodTypeAny>(schema: T) {\n return z.partialRecord(supportedLanguageSchema, z.array(schema));\n}\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\n\n/**\n * A basic file structure every elek.io file on disk has to follow\n */\nexport const baseFileSchema = z.object({\n /**\n * The object type of the file\n */\n objectType: objectTypeSchema.readonly(),\n /**\n * The ID of the file\n *\n * The ID is part of the files name.\n */\n id: uuidSchema.readonly(),\n /**\n * The datetime of the file being created is set by the service of \"objectType\" while creating it\n */\n created: z.string().datetime().readonly(),\n /**\n * The datetime of the file being updated is set by the service of \"objectType\" while updating it\n */\n updated: z.string().datetime().nullable(),\n});\nexport type BaseFile = z.infer<typeof baseFileSchema>;\n\nexport const fileReferenceSchema = z.object({\n id: uuidSchema,\n extension: z.string().optional(),\n});\nexport type FileReference = z.infer<typeof fileReferenceSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\n\n/**\n * Signature git uses to identify users\n */\nexport const gitSignatureSchema = z.object({\n name: z.string(),\n email: z.string().email(),\n});\nexport type GitSignature = z.infer<typeof gitSignatureSchema>;\n\nexport const gitMessageSchema = z.object({\n method: z.enum(['create', 'update', 'delete', 'upgrade']),\n reference: z.object({\n objectType: objectTypeSchema,\n /**\n * ID of the objectType\n */\n id: uuidSchema,\n /**\n * Only present if the objectType is of \"entry\"\n */\n collectionId: uuidSchema.optional(),\n }),\n});\nexport type GitMessage = z.infer<typeof gitMessageSchema>;\n\nexport const gitTagSchema = z.object({\n id: uuidSchema,\n message: z.string(),\n author: gitSignatureSchema,\n datetime: z.string().datetime(),\n});\nexport type GitTag = z.infer<typeof gitTagSchema>;\n\nexport const gitCommitSchema = z.object({\n /**\n * SHA-1 hash of the commit\n */\n hash: z.string(),\n message: gitMessageSchema,\n author: gitSignatureSchema,\n datetime: z.string().datetime(),\n tag: gitTagSchema.nullable(),\n});\nexport type GitCommit = z.infer<typeof gitCommitSchema>;\n\nexport const gitInitOptionsSchema = z.object({\n /**\n * Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable).\n */\n initialBranch: z.string(),\n});\nexport type GitInitOptions = z.infer<typeof gitInitOptionsSchema>;\n\nexport const gitCloneOptionsSchema = z.object({\n /**\n * Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules.\n */\n depth: z.number(),\n /**\n * Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.\n */\n singleBranch: z.boolean(),\n /**\n * Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.\n */\n branch: z.string(),\n /**\n * Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>`/.git`, make the <directory> itself the $GIT_DIR.\n * Used primarily to copy an existing local repository to a server, where you want to set up the repository as a central point to work with others.\n *\n * The destination path for the cloned repository should end with a .git by convention.\n *\n * @see https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server\n */\n bare: z.boolean(),\n});\nexport type GitCloneOptions = z.infer<typeof gitCloneOptionsSchema>;\n\nexport const gitMergeOptionsSchema = z.object({\n squash: z.boolean(),\n});\nexport type GitMergeOptions = z.infer<typeof gitMergeOptionsSchema>;\n\nexport const gitSwitchOptionsSchema = z.object({\n /**\n * If true, creates a new local branch and then switches to it\n *\n * @see https://git-scm.com/docs/git-switch#Documentation/git-switch.txt---createltnew-branchgt\n */\n isNew: z.boolean().optional(),\n});\nexport type GitSwitchOptions = z.infer<typeof gitSwitchOptionsSchema>;\n\nexport const gitLogOptionsSchema = z.object({\n /**\n * Limit the result to given number of commits\n */\n limit: z.number().optional(),\n /**\n * Only list commits that are between given SHAs or tag names\n *\n * Note that the commits of from and to are not included in the result\n */\n between: z.object({\n /**\n * From the oldest commit\n */\n from: z.string(),\n /**\n * To the newest commit\n *\n * Defaults to the current HEAD\n */\n to: z.string().optional(),\n }),\n /**\n * Only shows commits of given file\n */\n filePath: z.string().optional(),\n});\nexport type GitLogOptions = z.infer<typeof gitLogOptionsSchema>;\n\nexport const createGitTagSchema = gitTagSchema\n .pick({\n message: true,\n })\n .extend({\n path: z.string(),\n hash: z.string().optional(),\n });\nexport type CreateGitTagProps = z.infer<typeof createGitTagSchema>;\n\nexport const readGitTagSchema = z.object({\n path: z.string(),\n id: uuidSchema.readonly(),\n});\nexport type ReadGitTagProps = z.infer<typeof readGitTagSchema>;\n\nexport const deleteGitTagSchema = readGitTagSchema.extend({});\nexport type DeleteGitTagProps = z.infer<typeof deleteGitTagSchema>;\n\nexport const countGitTagsSchema = z.object({\n path: z.string(),\n});\nexport type CountGitTagsProps = z.infer<typeof countGitTagsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\n\nexport const assetFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.asset).readonly(),\n name: z.string(),\n description: z.string(),\n extension: z.string().readonly(),\n mimeType: z.string().readonly(),\n /**\n * Total size in bytes\n */\n size: z.number().readonly(),\n});\nexport type AssetFile = z.infer<typeof assetFileSchema>;\n\nexport const assetSchema = assetFileSchema\n .extend({\n /**\n * Absolute path on this filesystem\n */\n absolutePath: z.string().readonly(),\n /**\n * Commit history of this Asset\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Asset');\nexport type Asset = z.infer<typeof assetSchema>;\n\nexport const assetExportSchema = assetSchema.extend({});\nexport type AssetExport = z.infer<typeof assetExportSchema>;\n\nexport const createAssetSchema = assetFileSchema\n .pick({\n name: true,\n description: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n /**\n * Path of the file to add as a new Asset\n */\n filePath: z.string().readonly(),\n });\nexport type CreateAssetProps = z.infer<typeof createAssetSchema>;\n\nexport const readAssetSchema = assetFileSchema\n .pick({\n id: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n });\nexport type ReadAssetProps = z.infer<typeof readAssetSchema>;\n\nexport const saveAssetSchema = assetFileSchema\n .pick({\n id: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n filePath: z.string().readonly(),\n commitHash: z.string().optional().readonly(),\n });\nexport type SaveAssetProps = z.infer<typeof saveAssetSchema>;\n\nexport const updateAssetSchema = assetFileSchema\n .pick({\n id: true,\n name: true,\n description: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n /**\n * Path of the new file to update the Asset with\n */\n newFilePath: z.string().readonly().optional(),\n });\nexport type UpdateAssetProps = z.infer<typeof updateAssetSchema>;\n\nexport const deleteAssetSchema = assetFileSchema\n .pick({\n id: true,\n extension: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type DeleteAssetProps = z.infer<typeof deleteAssetSchema>;\n\nexport const countAssetsSchema = z.object({ projectId: uuidSchema.readonly() });\nexport type CountAssetsProps = z.infer<typeof countAssetsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport {\n objectTypeSchema,\n translatableArrayOf,\n translatableBooleanSchema,\n translatableNumberSchema,\n translatableStringSchema,\n uuidSchema,\n} from './baseSchema.js';\n\nexport const ValueTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean',\n 'reference',\n]);\nexport type ValueType = z.infer<typeof ValueTypeSchema>;\n\nexport const valueContentReferenceBase = z.object({\n id: uuidSchema,\n});\n\nexport const valueContentReferenceToAssetSchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.asset),\n });\nexport type ValueContentReferenceToAsset = z.infer<\n typeof valueContentReferenceToAssetSchema\n>;\n\nexport const valueContentReferenceToCollectionSchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.collection),\n });\nexport type ValueContentReferenceToCollection = z.infer<\n typeof valueContentReferenceToCollectionSchema\n>;\n\nexport const valueContentReferenceToEntrySchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.entry),\n });\nexport type ValueContentReferenceToEntry = z.infer<\n typeof valueContentReferenceToEntrySchema\n>;\n\n// export const valueContentReferenceToSharedValueSchema = z.object({\n// referenceObjectType: z.literal(objectTypeSchema.enum.sharedValue),\n// references: z.object({\n// id: uuidSchema,\n// language: supportedLanguageSchema,\n// }),\n// });\n// export type ValueContentReferenceToSharedValue = z.infer<\n// typeof valueContentReferenceToSharedValueSchema\n// >;\n\n// export const sharedValueFileSchema = baseFileWithLanguageSchema.extend({\n// objectType: z.literal(objectTypeSchema.enum.sharedValue).readonly(),\n// valueType: ValueTypeSchema.exclude(['reference']).readonly(),\n// // valueType: ValueTypeSchema.readonly(), @todo do we allow shared Values to reference assets or others?\n// content: z.union([\n// z.string(),\n// z.number(),\n// z.boolean(),\n// z.string().optional(),\n// z.number().optional(),\n// z.boolean().optional(),\n// // valueContentReferenceToAssetSchema, @todo do we allow shared Values to reference assets or others?\n// // valueContentReferenceToSharedValueSchema,\n// ]),\n// });\n// export type SharedValueFile = z.infer<typeof sharedValueFileSchema>;\n\n// export const sharedValueSchema = sharedValueFileSchema.extend({});\n// export type SharedValue = z.infer<typeof sharedValueSchema>;\n\n// export const sharedValueExportSchema = sharedValueSchema.extend({});\n// export type SharedValueExport = z.infer<typeof sharedValueExportSchema>;\n\n// export const resolvedValueContentReferenceToSharedValueSchema =\n// valueContentReferenceToSharedValueSchema.extend({\n// references: z.object({\n// id: uuidSchema,\n// language: supportedLanguageSchema,\n// resolved: sharedValueSchema,\n// }),\n// });\n// export type ResolvedValueContentReferenceToSharedValue = z.infer<\n// typeof resolvedValueContentReferenceToSharedValueSchema\n// >;\n\nexport const valueContentReferenceSchema = z.union([\n valueContentReferenceToAssetSchema,\n valueContentReferenceToCollectionSchema,\n valueContentReferenceToEntrySchema,\n // valueContentReferenceToSharedValueSchema,\n]);\nexport type ValueContentReference = z.infer<typeof valueContentReferenceSchema>;\n\nexport const directValueBaseSchema = z.object({\n objectType: z.literal(objectTypeSchema.enum.value).readonly(),\n fieldDefinitionId: uuidSchema.readonly(),\n});\n\nexport const directStringValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.string).readonly(),\n content: translatableStringSchema,\n});\nexport type DirectStringValue = z.infer<typeof directStringValueSchema>;\n\nexport const directNumberValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.number).readonly(),\n content: translatableNumberSchema,\n});\nexport type DirectNumberValue = z.infer<typeof directNumberValueSchema>;\n\nexport const directBooleanValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.boolean).readonly(),\n content: translatableBooleanSchema,\n});\nexport type DirectBooleanValue = z.infer<typeof directBooleanValueSchema>;\n\nexport const directValueSchema = z.union([\n directStringValueSchema,\n directNumberValueSchema,\n directBooleanValueSchema,\n]);\nexport type DirectValue = z.infer<typeof directValueSchema>;\n\nexport const referencedValueSchema = z.object({\n objectType: z.literal(objectTypeSchema.enum.value).readonly(),\n fieldDefinitionId: uuidSchema.readonly(),\n valueType: z.literal(ValueTypeSchema.enum.reference).readonly(),\n content: translatableArrayOf(valueContentReferenceSchema),\n});\nexport type ReferencedValue = z.infer<typeof referencedValueSchema>;\n\nexport const valueSchema = z.union([directValueSchema, referencedValueSchema]);\nexport type Value = z.infer<typeof valueSchema>;\n\n/**\n * ---\n */\n\n// export const createSharedValueSchema = sharedValueFileSchema\n// .pick({\n// valueType: true,\n// content: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type CreateSharedValueProps = z.infer<typeof createSharedValueSchema>;\n\n// export const readSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type ReadSharedValueProps = z.infer<typeof readSharedValueSchema>;\n\n// export const updateSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// content: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type UpdateSharedValueProps = z.infer<typeof updateSharedValueSchema>;\n\n// export const deleteSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type DeleteSharedValueProps = z.infer<typeof deleteSharedValueSchema>;\n\n/**\n * @todo maybe we need to validate Values and shared Values\n */\n// export const validateValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// definition: FieldDefinitionSchema.readonly(),\n// });\n// export type ValidateValueProps = z.infer<typeof validateValueSchema>;\n\n// export const countValuesSchema = z.object({ projectId: uuidSchema.readonly() });\n// export type CountValuesProps = z.infer<typeof countValuesSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\nimport { valueSchema } from './valueSchema.js';\n\nexport const entryFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.entry).readonly(),\n values: z.array(valueSchema),\n});\nexport type EntryFile = z.infer<typeof entryFileSchema>;\n\nexport const entrySchema = entryFileSchema\n .extend({\n /**\n * Commit history of this Entry\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Entry');\nexport type Entry = z.infer<typeof entrySchema>;\n\nexport const entryExportSchema = entrySchema.extend({});\nexport type EntryExport = z.infer<typeof entryExportSchema>;\n\nexport const createEntrySchema = entryFileSchema\n .omit({\n id: true,\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n values: z.array(valueSchema),\n });\nexport type CreateEntryProps = z.infer<typeof createEntrySchema>;\n\nexport const readEntrySchema = z.object({\n id: uuidSchema.readonly(),\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadEntryProps = z.infer<typeof readEntrySchema>;\n\nexport const updateEntrySchema = entryFileSchema\n .omit({\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n });\nexport type UpdateEntryProps = z.infer<typeof updateEntrySchema>;\n\nexport const deleteEntrySchema = readEntrySchema.extend({});\nexport type DeleteEntryProps = z.infer<typeof deleteEntrySchema>;\n\nexport const countEntriesSchema = z.object({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n});\nexport type CountEntriesProps = z.infer<typeof countEntriesSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { translatableStringSchema, uuidSchema } from './baseSchema.js';\nimport { ValueTypeSchema } from './valueSchema.js';\n\nexport const FieldTypeSchema = z.enum([\n // String Values\n 'text',\n 'textarea',\n 'email',\n // 'password', @todo maybe if there is a usecase\n 'url',\n 'ipv4',\n 'date',\n 'time',\n 'datetime',\n 'telephone',\n // Number Values\n 'number',\n 'range',\n // Boolean Values\n 'toggle',\n // Reference Values\n 'asset',\n 'entry',\n // 'sharedValue', // @todo\n]);\nexport type FieldType = z.infer<typeof FieldTypeSchema>;\n\nexport const FieldWidthSchema = z.enum(['12', '6', '4', '3']);\n\nexport const FieldDefinitionBaseSchema = z.object({\n id: uuidSchema.readonly(),\n label: translatableStringSchema,\n description: translatableStringSchema.nullable(),\n isRequired: z.boolean(),\n isDisabled: z.boolean(),\n isUnique: z.boolean(),\n inputWidth: FieldWidthSchema,\n});\nexport type FieldDefinitionBase = z.infer<typeof FieldDefinitionBaseSchema>;\n\n/**\n * String based Field definitions\n */\n\nexport const StringFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(\n {\n valueType: z.literal(ValueTypeSchema.enum.string),\n defaultValue: z.string().nullable(),\n }\n);\n\nexport const textFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.text),\n min: z.number().nullable(),\n max: z.number().nullable(),\n }\n);\nexport type TextFieldDefinition = z.infer<typeof textFieldDefinitionSchema>;\n\nexport const textareaFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.textarea),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type TextareaFieldDefinition = z.infer<\n typeof textareaFieldDefinitionSchema\n>;\n\nexport const emailFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.email),\n defaultValue: z.email().nullable(),\n });\nexport type EmailFieldDefinition = z.infer<typeof emailFieldDefinitionSchema>;\n\n// @todo why should we support password Values? Client saves it in clear text anyways\n// export const passwordFieldDefinitionSchema =\n// StringFieldDefinitionBaseSchema.extend({\n// fieldType: z.literal(FieldfieldTypeSchema.enum.password),\n// });\n\nexport const urlFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.url),\n defaultValue: z.url().nullable(),\n});\nexport type UrlFieldDefinition = z.infer<typeof urlFieldDefinitionSchema>;\n\nexport const ipv4FieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.ipv4),\n defaultValue: z.ipv4().nullable(),\n }\n);\nexport type Ipv4FieldDefinition = z.infer<typeof ipv4FieldDefinitionSchema>;\n\nexport const dateFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.date),\n defaultValue: z.iso.date().nullable(),\n }\n);\nexport type DateFieldDefinition = z.infer<typeof dateFieldDefinitionSchema>;\n\nexport const timeFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.time),\n defaultValue: z.iso.time().nullable(),\n }\n);\nexport type TimeFieldDefinition = z.infer<typeof timeFieldDefinitionSchema>;\n\nexport const datetimeFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.datetime),\n defaultValue: z.iso.datetime().nullable(),\n });\nexport type DatetimeFieldDefinition = z.infer<\n typeof datetimeFieldDefinitionSchema\n>;\n\nexport const telephoneFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.telephone),\n defaultValue: z.e164().nullable(),\n });\nexport type TelephoneFieldDefinition = z.infer<\n typeof telephoneFieldDefinitionSchema\n>;\n\nexport const stringFieldDefinitionSchema = z.union([\n textFieldDefinitionSchema,\n textareaFieldDefinitionSchema,\n emailFieldDefinitionSchema,\n urlFieldDefinitionSchema,\n ipv4FieldDefinitionSchema,\n dateFieldDefinitionSchema,\n timeFieldDefinitionSchema,\n datetimeFieldDefinitionSchema,\n telephoneFieldDefinitionSchema,\n]);\nexport type StringFieldDefinition = z.infer<typeof stringFieldDefinitionSchema>;\n\n/**\n * Number based Field definitions\n */\n\nexport const NumberFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(\n {\n valueType: z.literal(ValueTypeSchema.enum.number),\n min: z.number().nullable(),\n max: z.number().nullable(),\n isUnique: z.literal(false),\n defaultValue: z.number().nullable(),\n }\n);\n\nexport const numberFieldDefinitionSchema =\n NumberFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.number),\n });\nexport type NumberFieldDefinition = z.infer<typeof numberFieldDefinitionSchema>;\n\nexport const rangeFieldDefinitionSchema =\n NumberFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.range),\n // Overwrite from nullable to required because a range needs min, max and default to work and is required, since it always returns a number\n isRequired: z.literal(true),\n min: z.number(),\n max: z.number(),\n defaultValue: z.number(),\n });\nexport type RangeFieldDefinition = z.infer<typeof rangeFieldDefinitionSchema>;\n\n/**\n * Boolean based Field definitions\n */\n\nexport const BooleanFieldDefinitionBaseSchema =\n FieldDefinitionBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.boolean),\n // Overwrite from nullable to required because a boolean needs a default to work and is required, since it always is either true or false\n isRequired: z.literal(true),\n defaultValue: z.boolean(),\n isUnique: z.literal(false),\n });\n\nexport const toggleFieldDefinitionSchema =\n BooleanFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.toggle),\n });\nexport type ToggleFieldDefinition = z.infer<typeof toggleFieldDefinitionSchema>;\n\n/**\n * Reference based Field definitions\n */\n\nexport const ReferenceFieldDefinitionBaseSchema =\n FieldDefinitionBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.reference),\n });\n\nexport const assetFieldDefinitionSchema =\n ReferenceFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.asset),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type AssetFieldDefinition = z.infer<typeof assetFieldDefinitionSchema>;\n\nexport const entryFieldDefinitionSchema =\n ReferenceFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.entry),\n ofCollections: z.array(uuidSchema),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type EntryFieldDefinition = z.infer<typeof entryFieldDefinitionSchema>;\n\n// export const sharedValueDefinitionSchema =\n// ReferenceValueDefinitionBaseSchema.extend({\n// fieldType: z.literal(ValueInputTypeSchema.enum.sharedValue),\n// // The shared Value can have any of the direct types\n// // but not any reference itself (a shared Value cannot have a reference to another shared Value / Asset or any other future reference)\n// sharedValueType: z.union([\n// z.literal(ValueTypeSchema.enum.boolean),\n// z.literal(ValueTypeSchema.enum.number),\n// z.literal(ValueTypeSchema.enum.string),\n// ]),\n// });\n// export type SharedValueValueDefinition = z.infer<\n// typeof sharedValueDefinitionSchema\n// >;\n\nexport const fieldDefinitionSchema = z.union([\n stringFieldDefinitionSchema,\n numberFieldDefinitionSchema,\n rangeFieldDefinitionSchema,\n toggleFieldDefinitionSchema,\n assetFieldDefinitionSchema,\n entryFieldDefinitionSchema,\n // sharedValueDefinitionSchema,\n]);\nexport type FieldDefinition = z.infer<typeof fieldDefinitionSchema>;\n","import { z } from '@hono/zod-openapi';\nimport {\n objectTypeSchema,\n supportedIconSchema,\n translatableStringSchema,\n uuidSchema,\n} from './baseSchema.js';\nimport { entryExportSchema } from './entrySchema.js';\nimport { fieldDefinitionSchema } from './fieldSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\n\nexport const collectionFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.collection).readonly(),\n name: z.object({\n singular: translatableStringSchema,\n plural: translatableStringSchema,\n }),\n slug: z.object({\n singular: z.string(),\n plural: z.string(),\n }),\n description: translatableStringSchema,\n icon: supportedIconSchema,\n fieldDefinitions: z.array(fieldDefinitionSchema),\n});\nexport type CollectionFile = z.infer<typeof collectionFileSchema>;\n\nexport const collectionSchema = collectionFileSchema\n .extend({\n /**\n * Commit history of this Collection\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Collection');\nexport type Collection = z.infer<typeof collectionSchema>;\n\nexport const collectionExportSchema = collectionSchema.extend({\n entries: z.array(entryExportSchema),\n});\nexport type CollectionExport = z.infer<typeof collectionExportSchema>;\n\nexport const createCollectionSchema = collectionFileSchema\n .omit({\n id: true,\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type CreateCollectionProps = z.infer<typeof createCollectionSchema>;\n\nexport const readCollectionSchema = z.object({\n id: uuidSchema.readonly(),\n projectId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadCollectionProps = z.infer<typeof readCollectionSchema>;\n\nexport const updateCollectionSchema = collectionFileSchema\n .pick({\n id: true,\n name: true,\n slug: true,\n description: true,\n icon: true,\n fieldDefinitions: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type UpdateCollectionProps = z.infer<typeof updateCollectionSchema>;\n\nexport const deleteCollectionSchema = readCollectionSchema.extend({});\nexport type DeleteCollectionProps = z.infer<typeof deleteCollectionSchema>;\n\nexport const countCollectionsSchema = z.object({\n projectId: uuidSchema.readonly(),\n});\nexport type CountCollectionsProps = z.infer<typeof countCollectionsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { logLevelSchema } from './baseSchema.js';\n\n/**\n * Options that can be passed to elek.io core\n */\nexport const elekIoCoreOptionsSchema = z.object({\n log: z.object({\n /**\n * The lowest level that should be logged\n *\n * @default 'info'\n */\n level: logLevelSchema,\n }),\n file: z.object({\n /**\n * If set to true, caches files in memory to speed up access\n *\n * @default true\n */\n cache: z.boolean(),\n }),\n});\nexport type ElekIoCoreOptions = z.infer<typeof elekIoCoreOptionsSchema>;\n\nexport const constructorElekIoCoreSchema = elekIoCoreOptionsSchema\n .partial({\n log: true,\n file: true,\n })\n .optional();\nexport type ConstructorElekIoCoreProps = z.infer<\n typeof constructorElekIoCoreSchema\n>;\n","import { z } from '@hono/zod-openapi';\nimport { assetExportSchema } from './assetSchema.js';\nimport {\n objectTypeSchema,\n supportedLanguageSchema,\n uuidSchema,\n versionSchema,\n} from './baseSchema.js';\nimport { collectionExportSchema } from './collectionSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema, gitSwitchOptionsSchema } from './gitSchema.js';\n\nexport const projectStatusSchema = z.enum(['foo', 'bar', 'todo']);\nexport type ProjectStatus = z.infer<typeof projectStatusSchema>;\n\nexport const projectSettingsSchema = z.object({\n language: z.object({\n default: supportedLanguageSchema,\n supported: z.array(supportedLanguageSchema),\n }),\n});\nexport type ProjectSettings = z.infer<typeof projectSettingsSchema>;\n\nexport const projectFolderSchema = z.enum([\n 'assets',\n 'collections',\n 'shared-values',\n 'lfs',\n // 'logs',\n // 'public',\n // 'theme',\n]);\nexport type ProjectFolder = z.infer<typeof projectFolderSchema>;\n\nexport const projectBranchSchema = z.enum(['production', 'work']);\nexport type ProjectBranch = z.infer<typeof projectBranchSchema>;\n\nexport const projectFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.project).readonly(),\n coreVersion: versionSchema,\n name: z.string().trim().min(1, 'shared.projectNameRequired'),\n description: z.string().trim().min(1, 'shared.projectDescriptionRequired'),\n version: versionSchema,\n status: projectStatusSchema,\n settings: projectSettingsSchema,\n});\nexport type ProjectFile = z.infer<typeof projectFileSchema>;\n\nexport const projectSchema = projectFileSchema\n .extend({\n remoteOriginUrl: z.string().nullable().openapi({\n description: 'URL of the remote Git repository',\n }),\n history: z.array(gitCommitSchema).openapi({\n description: 'Commit history of this Project',\n }),\n fullHistory: z.array(gitCommitSchema).openapi({\n description:\n 'Full commit history of this Project including all Assets, Collections, Entries and other files',\n }),\n })\n .openapi('Project');\nexport type Project = z.infer<typeof projectSchema>;\n\nexport const outdatedProjectSchema = projectFileSchema.pick({\n id: true,\n name: true,\n coreVersion: true,\n});\nexport type OutdatedProject = z.infer<typeof outdatedProjectSchema>;\n\nexport const projectExportSchema = projectSchema.extend({\n assets: z.array(assetExportSchema),\n collections: z.array(collectionExportSchema),\n});\nexport type ProjectExport = z.infer<typeof projectExportSchema>;\n\nexport const createProjectSchema = projectSchema\n .pick({\n name: true,\n description: true,\n settings: true,\n })\n .partial({\n description: true,\n settings: true,\n });\nexport type CreateProjectProps = z.infer<typeof createProjectSchema>;\n\nexport const readProjectSchema = z.object({\n id: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadProjectProps = z.infer<typeof readProjectSchema>;\n\nexport const updateProjectSchema = projectSchema\n .pick({\n id: true,\n name: true,\n description: true,\n settings: true,\n })\n .partial({\n name: true,\n description: true,\n settings: true,\n });\nexport type UpdateProjectProps = z.infer<typeof updateProjectSchema>;\n\nexport const upgradeProjectSchema = z.object({\n id: uuidSchema.readonly(),\n /**\n * Force the upgrade even if the Project is up-to-date\n */\n force: z.boolean().optional(),\n});\nexport type UpgradeProjectProps = z.infer<typeof upgradeProjectSchema>;\n\nexport const deleteProjectSchema = readProjectSchema.extend({\n force: z.boolean().optional(),\n});\nexport type DeleteProjectProps = z.infer<typeof deleteProjectSchema>;\n\nexport const projectUpgradeSchema = z.object({\n /**\n * The Core version the Project will be upgraded to\n */\n to: versionSchema.readonly(),\n /**\n * Function that will be executed in the process of upgrading a Project\n */\n run: z.function({\n input: [projectFileSchema],\n output: z.promise(z.void()),\n }),\n});\nexport type ProjectUpgrade = z.infer<typeof projectUpgradeSchema>;\n\nexport const cloneProjectSchema = z.object({\n url: z.string(),\n});\nexport type CloneProjectProps = z.infer<typeof cloneProjectSchema>;\n\nexport const listBranchesProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type ListBranchesProjectProps = z.infer<\n typeof listBranchesProjectSchema\n>;\n\nexport const currentBranchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type CurrentBranchProjectProps = z.infer<\n typeof currentBranchProjectSchema\n>;\n\nexport const switchBranchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n branch: z.string(),\n options: gitSwitchOptionsSchema.optional(),\n});\nexport type SwitchBranchProjectProps = z.infer<\n typeof switchBranchProjectSchema\n>;\n\nexport const getRemoteOriginUrlProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type GetRemoteOriginUrlProjectProps = z.infer<\n typeof getRemoteOriginUrlProjectSchema\n>;\n\nexport const setRemoteOriginUrlProjectSchema = z.object({\n id: uuidSchema.readonly(),\n url: z.string(),\n});\nexport type SetRemoteOriginUrlProjectProps = z.infer<\n typeof setRemoteOriginUrlProjectSchema\n>;\n\nexport const getChangesProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type GetChangesProjectProps = z.infer<typeof getChangesProjectSchema>;\n\nexport const synchronizeProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type SynchronizeProjectProps = z.infer<typeof synchronizeProjectSchema>;\n\nexport const searchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n query: z.string(),\n language: supportedLanguageSchema,\n type: z.array(objectTypeSchema).optional(),\n});\nexport type SearchProjectProps = z.infer<typeof searchProjectSchema>;\n","/**\n * Dynamic zod schema generation\n *\n * Altough everything is already strictly typed, a type of string might not be an email or text of a certain length.\n * To validate this, we need to generate zod schemas based on Field definitions the user created.\n */\n\nimport { z } from '@hono/zod-openapi';\nimport { supportedLanguageSchema } from './baseSchema.js';\nimport {\n createEntrySchema,\n entrySchema,\n updateEntrySchema,\n} from './entrySchema.js';\nimport type {\n AssetFieldDefinition,\n EntryFieldDefinition,\n FieldDefinition,\n NumberFieldDefinition,\n RangeFieldDefinition,\n StringFieldDefinition} from './fieldSchema.js';\nimport {\n FieldTypeSchema\n} from './fieldSchema.js';\nimport {\n directBooleanValueSchema,\n directNumberValueSchema,\n directStringValueSchema,\n referencedValueSchema,\n valueContentReferenceToAssetSchema,\n valueContentReferenceToEntrySchema,\n ValueTypeSchema,\n} from './valueSchema.js';\n\n/**\n * Boolean Values are always either true or false, so we don't need the Field definition here\n */\nfunction getBooleanValueContentSchemaFromFieldDefinition() {\n return z.boolean();\n}\n\n/**\n * Number Values can have min and max values and can be required or not\n */\nfunction getNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition: NumberFieldDefinition | RangeFieldDefinition\n) {\n let schema = z.number();\n\n if (fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n if (fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n if (fieldDefinition.isRequired === false) {\n return schema.nullable();\n }\n\n return schema;\n}\n\n/**\n * String Values can have different formats (email, url, ipv4, date, time, ...)\n * and can have min and max length and can be required or not\n */\nfunction getStringValueContentSchemaFromFieldDefinition(\n fieldDefinition: StringFieldDefinition\n) {\n let schema = null;\n\n switch (fieldDefinition.fieldType) {\n case FieldTypeSchema.enum.email:\n schema = z.email();\n break;\n case FieldTypeSchema.enum.url:\n schema = z.url();\n break;\n case FieldTypeSchema.enum.ipv4:\n schema = z.ipv4();\n break;\n case FieldTypeSchema.enum.date:\n schema = z.iso.date();\n break;\n case FieldTypeSchema.enum.time:\n schema = z.iso.time();\n break;\n case FieldTypeSchema.enum.datetime:\n schema = z.iso.datetime();\n break;\n case FieldTypeSchema.enum.telephone:\n schema = z.e164();\n break;\n case FieldTypeSchema.enum.text:\n case FieldTypeSchema.enum.textarea:\n schema = z.string().trim();\n break;\n }\n\n if ('min' in fieldDefinition && fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n if ('max' in fieldDefinition && fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n if (fieldDefinition.isRequired === false) {\n return schema.nullable();\n }\n\n return schema.min(1, 'shared.stringValueRequired'); // @see https://github.com/colinhacks/zod/issues/2466\n}\n\n/**\n * Reference Values can reference either Assets or Entries (or Shared Values in the future)\n * and can have min and max number of references and can be required or not\n */\nfunction getReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition: AssetFieldDefinition | EntryFieldDefinition // | SharedValueFieldDefinition\n) {\n let schema;\n\n switch (fieldDefinition.fieldType) {\n case FieldTypeSchema.enum.asset:\n {\n schema = z.array(valueContentReferenceToAssetSchema);\n }\n break;\n case FieldTypeSchema.enum.entry:\n {\n schema = z.array(valueContentReferenceToEntrySchema);\n }\n break;\n // case ValueInputTypeSchema.enum.sharedValue: {\n // let schema = valueContentReferenceToSharedValueSchema.extend({}); // Deep copy to not overwrite the base schema\n // if (definition.isRequired) {\n // const requiredReferences = schema.shape.references.min(\n // 1,\n // 'shared.assetValueRequired'\n // );\n // schema = schema.extend({\n // references: requiredReferences,\n // });\n // }\n // return valueContentReferenceToSharedValueSchema;\n // }\n }\n\n if (fieldDefinition.isRequired) {\n schema = schema.min(1, 'shared.referenceRequired');\n }\n\n if (fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n\n if (fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n return schema;\n}\n\nfunction getTranslatableStringValueContentSchemaFromFieldDefinition(\n fieldDefinition: StringFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getStringValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\nfunction getTranslatableNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition: NumberFieldDefinition | RangeFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getNumberValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\nfunction getTranslatableBooleanValueContentSchemaFromFieldDefinition() {\n return z.partialRecord(\n supportedLanguageSchema,\n getBooleanValueContentSchemaFromFieldDefinition()\n );\n}\n\nfunction getTranslatableReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition: AssetFieldDefinition | EntryFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getReferenceValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\n/**\n * Generates a zod schema to check a Value based on given Field definition\n */\nexport function getValueSchemaFromFieldDefinition(\n fieldDefinition: FieldDefinition\n) {\n switch (fieldDefinition.valueType) {\n case ValueTypeSchema.enum.boolean:\n return directBooleanValueSchema.extend({\n content: getTranslatableBooleanValueContentSchemaFromFieldDefinition(),\n });\n case ValueTypeSchema.enum.number:\n return directNumberValueSchema.extend({\n content:\n getTranslatableNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n case ValueTypeSchema.enum.string:\n return directStringValueSchema.extend({\n content:\n getTranslatableStringValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n case ValueTypeSchema.enum.reference:\n return referencedValueSchema.extend({\n content:\n getTranslatableReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n default:\n throw new Error(\n // @ts-expect-error Code cannot be reached, but if we add a new ValueType and forget to update this function, we want to be notified about it\n `Error generating schema for unsupported ValueType \"${fieldDefinition.valueType}\"`\n );\n }\n}\n\n/**\n * Generates a schema for an Entry based on the given Field definitions and Values\n */\nexport function getEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...entrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n\n/**\n * Generates a schema for creating a new Entry based on the given Field definitions and Values\n */\nexport function getCreateEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...createEntrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n\n/**\n * Generates a schema for updating an existing Entry based on the given Field definitions and Values\n */\nexport function getUpdateEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...updateEntrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n","import { z } from '@hono/zod-openapi';\nimport { uuidSchema } from './baseSchema.js';\n\nexport const serviceTypeSchema = z.enum([\n 'Git',\n 'GitTag',\n 'User',\n 'Project',\n 'Asset',\n 'JsonFile',\n 'Search',\n 'Collection',\n 'Entry',\n 'Value',\n]);\nexport type ServiceType = z.infer<typeof serviceTypeSchema>;\n\nexport interface PaginatedList<T> {\n total: number;\n limit: number;\n offset: number;\n list: T[];\n}\n\nexport function paginatedListOf<T extends z.ZodTypeAny>(schema: T) {\n return z.object({\n total: z.number(),\n limit: z.number(),\n offset: z.number(),\n list: z.array(schema),\n });\n}\n\nexport interface PaginationOptions {\n limit: number;\n offset: number;\n}\n\n/**\n * Implements create, read, update and delete methods\n */\nexport interface CrudService<T> {\n create: (props: never) => Promise<T>;\n read: (props: never) => Promise<T>;\n update: (props: never) => Promise<T>;\n delete: (props: never) => Promise<void>;\n}\n\n/**\n * Implements list and count methods additionally\n * to create, read, update and delete\n */\nexport interface CrudServiceWithListCount<T> extends CrudService<T> {\n /**\n * Returns a list of this services objects\n *\n * Does not return objects where the schema validation fails.\n * If that is the case, upgrade the Client and then Project to the latest version.\n */\n list: (...props: never[]) => Promise<PaginatedList<T>>;\n /**\n * Returns the total number of this services objects\n */\n count: (...props: never[]) => Promise<number>;\n}\n\nconst listSchema = z.object({\n projectId: uuidSchema,\n limit: z.number().optional(),\n offset: z.number().optional(),\n});\n\nexport const listCollectionsSchema = listSchema;\nexport type ListCollectionsProps = z.infer<typeof listCollectionsSchema>;\n\nexport const listEntriesSchema = listSchema.extend({\n collectionId: uuidSchema,\n});\nexport type ListEntriesProps = z.infer<typeof listEntriesSchema>;\n\nexport const listAssetsSchema = listSchema;\nexport type ListAssetsProps = z.infer<typeof listAssetsSchema>;\n\n// export const listSharedValuesSchema = listSchema(sharedValueSchema);\n// export type ListSharedValuesProps = z.infer<typeof listSharedValuesSchema>;\n\nexport const listProjectsSchema = listSchema.omit({\n projectId: true,\n});\nexport type ListProjectsProps = z.infer<typeof listProjectsSchema>;\n\nexport const listGitTagsSchema = z.object({\n path: z.string(),\n});\nexport type ListGitTagsProps = z.infer<typeof listGitTagsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { supportedLanguageSchema, uuidSchema } from './baseSchema.js';\nimport { gitSignatureSchema } from './gitSchema.js';\n\nexport const UserTypeSchema = z.enum(['local', 'cloud']);\n\nexport const baseUserSchema = gitSignatureSchema.extend({\n userType: UserTypeSchema,\n language: supportedLanguageSchema,\n localApi: z.object({\n /**\n * If set to true the local API is started whenever Core is initialized\n */\n isEnabled: z.boolean(),\n /**\n * The port the local API uses\n */\n port: z.number(),\n }),\n});\nexport type BaseUser = z.infer<typeof baseUserSchema>;\n\nexport const localUserSchema = baseUserSchema.extend({\n userType: z.literal(UserTypeSchema.enum.local),\n});\nexport type LocalUser = z.infer<typeof localUserSchema>;\n\nexport const cloudUserSchema = baseUserSchema.extend({\n userType: z.literal(UserTypeSchema.enum.cloud),\n id: uuidSchema,\n});\nexport type CloudUser = z.infer<typeof cloudUserSchema>;\n\nexport const userFileSchema = z.union([localUserSchema, cloudUserSchema]);\nexport type UserFile = z.infer<typeof userFileSchema>;\n\nexport const userSchema = userFileSchema;\nexport type User = z.infer<typeof userSchema>;\n\nexport const setUserSchema = userSchema;\nexport type SetUserProps = z.infer<typeof setUserSchema>;\n","import { z } from 'zod';\nimport { uuidSchema } from './baseSchema.js';\n\nconst outDirSchema = z.string().default('./.elek.io');\nconst languageSchema = z.enum(['ts', 'js']).default('ts');\nconst formatSchema = z.enum(['esm', 'cjs']).default('esm');\nconst targetSchema = z\n .enum([\n 'es3',\n 'es5',\n 'es6',\n 'es2015',\n 'es2016',\n 'es2017',\n 'es2018',\n 'es2019',\n 'es2020',\n 'es2021',\n 'es2022',\n 'es2023',\n 'es2024',\n 'esnext',\n ])\n .default('es2020');\nconst projectsSchema = z\n .string()\n .default('all')\n .transform((value) => {\n if (value === 'all') {\n return 'all';\n }\n\n return value.split(',').map((v) => uuidSchema.parse(v.trim()));\n });\nconst generateApiClientOptionsSchema = z.object({\n watch: z.boolean().default(false),\n});\nconst exportProjectsOptionsSchema = generateApiClientOptionsSchema.extend({\n separate: z.boolean().default(false),\n});\n\nexport const generateApiClientSchema = z.object({\n outDir: outDirSchema,\n language: languageSchema,\n format: formatSchema,\n target: targetSchema,\n options: generateApiClientOptionsSchema,\n});\nexport type GenerateApiClientProps = z.infer<typeof generateApiClientSchema>;\n\nconst portSchema = z\n .string()\n .default('31310')\n .transform((value, context) => {\n try {\n const parsed = parseInt(value);\n\n return parsed;\n } catch (_error) {\n context.addIssue({\n code: 'custom',\n message: 'Invalid port number',\n input: value,\n });\n\n // this is a special constant with type `never`\n // returning it lets you exit the transform without impacting the inferred return type\n return z.NEVER;\n }\n });\n\nexport const apiStartSchema = z.object({\n port: portSchema,\n});\nexport type ApiStartProps = z.infer<typeof apiStartSchema>;\n\nexport const exportSchema = z.object({\n outDir: outDirSchema,\n projects: projectsSchema,\n options: exportProjectsOptionsSchema,\n});\nexport type ExportProps = z.infer<typeof exportSchema>;\n","import { z } from '@hono/zod-openapi';\n\nexport const logSourceSchema = z.enum(['core', 'desktop']);\nexport type LogSource = z.infer<typeof logSourceSchema>;\n\nexport const logSchema = z.object({\n source: logSourceSchema,\n message: z.string(),\n /**\n * Additional metadata for the log entry\n *\n * @example { userId: '12345', action: 'login' }\n */\n meta: z.record(z.string(), z.unknown()).optional(),\n});\nexport type LogProps = z.infer<typeof logSchema>;\n\nexport const logConsoleTransportSchema = logSchema.extend({\n timestamp: z.string(),\n level: z.string(),\n});\nexport type LogConsoleTransportProps = z.infer<\n typeof logConsoleTransportSchema\n>;\n","import slugify from '@sindresorhus/slugify';\nimport { v4 as generateUuid } from 'uuid';\nimport { type Uuid } from '../schema/baseSchema.js';\n\n/**\n * Returns a new UUID\n */\nexport function uuid(): Uuid {\n return generateUuid();\n}\n\n/**\n * Returns a string representing date and time\n * in a simplified format based on ISO 8601.\n * The timezone is always UTC.\n *\n * - If value is not given, the current date and time is used\n * - If value is given, it's converted to above representation and UTC timezone\n *\n * @example 'YYYY-MM-DDTHH:mm:ss.sssZ'\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n * @see https://en.wikipedia.org/wiki/ISO_8601\n */\nexport function datetime(value?: number | string | Date) {\n if (!value) {\n return new Date().toISOString();\n }\n return new Date(value).toISOString();\n}\n\n/**\n * Returns the slug of given string\n */\nexport function slug(string: string): string {\n return slugify(string, {\n separator: '-',\n lowercase: true,\n decamelize: true,\n });\n}\n"],"mappings":"8HAaA,MAAa,EAA0B,EAAE,KAAK,CAI5C,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,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C,CAIvD,OAHK,EAGE,IAAI,KAAK,EAAM,CAAC,aAAa,CAF3B,IAAI,MAAM,CAAC,aAAa,CAQnC,SAAgB,GAAK,EAAwB,CAC3C,OAAO,EAAQ,EAAQ,CACrB,UAAW,IACX,UAAW,GACX,WAAY,GACb,CAAC"}
1
+ {"version":3,"file":"index.browser.js","names":["z","generateUuid"],"sources":["../../src/schema/baseSchema.ts","../../src/schema/fileSchema.ts","../../src/schema/gitSchema.ts","../../src/schema/assetSchema.ts","../../src/schema/valueSchema.ts","../../src/schema/entrySchema.ts","../../src/schema/fieldSchema.ts","../../src/schema/collectionSchema.ts","../../src/schema/coreSchema.ts","../../src/schema/projectSchema.ts","../../src/schema/schemaFromFieldDefinition.ts","../../src/schema/serviceSchema.ts","../../src/schema/userSchema.ts","../../src/schema/cliSchema.ts","../../src/schema/logSchema.ts","../../src/util/shared.ts"],"sourcesContent":["import { z } from '@hono/zod-openapi';\n\n/**\n * All currently supported, BCP 47 compliant language tags\n *\n * The support depends on the tools and libraries we use.\n * We can't support a given language, if there is no support\n * for it from used third parties. Currently, to check if a langauge\n * tag can be added to this list, it needs to be supported by:\n * - DeepL translation API\n *\n * @see https://www.deepl.com/docs-api/other-functions/listing-supported-languages/\n */\nexport const supportedLanguageSchema = z.enum([\n /**\n * Bulgarian\n */\n 'bg', //\n 'cs', // Czech\n 'da', // Danish\n 'de', // German\n 'el', // Greek\n 'en', // (US) English\n 'es', // Spanish\n 'et', // Estonian\n 'fi', // Finnish\n 'fr', // French\n 'hu', // Hungarian\n 'it', // Italian\n 'ja', // Japanese\n 'lt', // Lithuanian\n 'lv', // Latvian\n 'nl', // Dutch\n 'pl', // Polish\n 'pt', // Portuguese\n 'ro', // Romanian\n 'ru', // Russian\n 'sk', // Slovak\n 'sl', // Slovenian\n 'sv', // Swedish\n 'zh', // (Simplified) Chinese\n]);\nexport type SupportedLanguage = z.infer<typeof supportedLanguageSchema>;\n\nexport const supportedIconSchema = z.enum(['home', 'plus', 'foobar']);\nexport type SupportedIcon = z.infer<typeof supportedIconSchema>;\n\nexport const objectTypeSchema = z.enum([\n 'project',\n 'asset',\n 'collection',\n 'entry',\n 'value',\n 'sharedValue',\n]);\nexport type ObjectType = z.infer<typeof objectTypeSchema>;\n\nexport const logLevelSchema = z.enum(['error', 'warn', 'info', 'debug']);\n\nexport const versionSchema = z.string();\n// .refine((version) => {\n// if (Semver.valid(version) !== null) {\n// return true;\n// }\n// return false;\n// }, 'String must follow the Semantic Versioning format (https://semver.org/)');\nexport type Version = z.infer<typeof versionSchema>;\n\nexport const uuidSchema = z.uuid('shared.invalidUuid');\nexport type Uuid = z.infer<typeof uuidSchema>;\n\n/**\n * A record that can be used to translate a string value into all supported languages\n */\nexport const translatableStringSchema = z.partialRecord(\n supportedLanguageSchema,\n z.string().trim().min(1, 'shared.translatableStringRequired')\n);\nexport type TranslatableString = z.infer<typeof translatableStringSchema>;\n\n/**\n * A record that can be used to translate a number value into all supported languages\n */\nexport const translatableNumberSchema = z.partialRecord(\n supportedLanguageSchema,\n z.number({\n error: (error) =>\n error.input === undefined\n ? 'shared.translatableNumberRequired'\n : 'shared.translatableNumberNotANumber',\n })\n);\nexport type TranslatableNumber = z.infer<typeof translatableNumberSchema>;\n\n/**\n * A record that can be used to translate a boolean value into all supported languages\n */\nexport const translatableBooleanSchema = z.partialRecord(\n supportedLanguageSchema,\n z.boolean({\n error: (error) =>\n error.input === undefined\n ? 'shared.translatableBooleanRequired'\n : 'shared.translatableBooleanNotABoolean',\n })\n);\nexport type TranslatableBoolean = z.infer<typeof translatableBooleanSchema>;\n\nexport function translatableArrayOf<T extends z.ZodTypeAny>(schema: T) {\n return z.partialRecord(supportedLanguageSchema, z.array(schema));\n}\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\n\n/**\n * A basic file structure every elek.io file on disk has to follow\n */\nexport const baseFileSchema = z.object({\n /**\n * The object type of the file\n */\n objectType: objectTypeSchema.readonly(),\n /**\n * The ID of the file\n *\n * The ID is part of the files name.\n */\n id: uuidSchema.readonly(),\n /**\n * The datetime of the file being created is set by the service of \"objectType\" while creating it\n */\n created: z.string().datetime().readonly(),\n /**\n * The datetime of the file being updated is set by the service of \"objectType\" while updating it\n */\n updated: z.string().datetime().nullable(),\n});\nexport type BaseFile = z.infer<typeof baseFileSchema>;\n\nexport const fileReferenceSchema = z.object({\n id: uuidSchema,\n extension: z.string().optional(),\n});\nexport type FileReference = z.infer<typeof fileReferenceSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\n\n/**\n * Signature git uses to identify users\n */\nexport const gitSignatureSchema = z.object({\n name: z.string(),\n email: z.string().email(),\n});\nexport type GitSignature = z.infer<typeof gitSignatureSchema>;\n\nexport const gitMessageSchema = z.object({\n method: z.enum(['create', 'update', 'delete', 'upgrade']),\n reference: z.object({\n objectType: objectTypeSchema,\n /**\n * ID of the objectType\n */\n id: uuidSchema,\n /**\n * Only present if the objectType is of \"entry\"\n */\n collectionId: uuidSchema.optional(),\n }),\n});\nexport type GitMessage = z.infer<typeof gitMessageSchema>;\n\nexport const gitTagSchema = z.object({\n id: uuidSchema,\n message: z.string(),\n author: gitSignatureSchema,\n datetime: z.string().datetime(),\n});\nexport type GitTag = z.infer<typeof gitTagSchema>;\n\nexport const gitCommitSchema = z.object({\n /**\n * SHA-1 hash of the commit\n */\n hash: z.string(),\n message: gitMessageSchema,\n author: gitSignatureSchema,\n datetime: z.string().datetime(),\n tag: gitTagSchema.nullable(),\n});\nexport type GitCommit = z.infer<typeof gitCommitSchema>;\n\nexport const gitInitOptionsSchema = z.object({\n /**\n * Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable).\n */\n initialBranch: z.string(),\n});\nexport type GitInitOptions = z.infer<typeof gitInitOptionsSchema>;\n\nexport const gitCloneOptionsSchema = z.object({\n /**\n * Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules.\n */\n depth: z.number(),\n /**\n * Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.\n */\n singleBranch: z.boolean(),\n /**\n * Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.\n */\n branch: z.string(),\n /**\n * Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>`/.git`, make the <directory> itself the $GIT_DIR.\n * Used primarily to copy an existing local repository to a server, where you want to set up the repository as a central point to work with others.\n *\n * The destination path for the cloned repository should end with a .git by convention.\n *\n * @see https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server\n */\n bare: z.boolean(),\n});\nexport type GitCloneOptions = z.infer<typeof gitCloneOptionsSchema>;\n\nexport const gitMergeOptionsSchema = z.object({\n squash: z.boolean(),\n});\nexport type GitMergeOptions = z.infer<typeof gitMergeOptionsSchema>;\n\nexport const gitSwitchOptionsSchema = z.object({\n /**\n * If true, creates a new local branch and then switches to it\n *\n * @see https://git-scm.com/docs/git-switch#Documentation/git-switch.txt---createltnew-branchgt\n */\n isNew: z.boolean().optional(),\n});\nexport type GitSwitchOptions = z.infer<typeof gitSwitchOptionsSchema>;\n\nexport const gitLogOptionsSchema = z.object({\n /**\n * Limit the result to given number of commits\n */\n limit: z.number().optional(),\n /**\n * Only list commits that are between given SHAs or tag names\n *\n * Note that the commits of from and to are not included in the result\n */\n between: z.object({\n /**\n * From the oldest commit\n */\n from: z.string(),\n /**\n * To the newest commit\n *\n * Defaults to the current HEAD\n */\n to: z.string().optional(),\n }),\n /**\n * Only shows commits of given file\n */\n filePath: z.string().optional(),\n});\nexport type GitLogOptions = z.infer<typeof gitLogOptionsSchema>;\n\nexport const createGitTagSchema = gitTagSchema\n .pick({\n message: true,\n })\n .extend({\n path: z.string(),\n hash: z.string().optional(),\n });\nexport type CreateGitTagProps = z.infer<typeof createGitTagSchema>;\n\nexport const readGitTagSchema = z.object({\n path: z.string(),\n id: uuidSchema.readonly(),\n});\nexport type ReadGitTagProps = z.infer<typeof readGitTagSchema>;\n\nexport const deleteGitTagSchema = readGitTagSchema.extend({});\nexport type DeleteGitTagProps = z.infer<typeof deleteGitTagSchema>;\n\nexport const countGitTagsSchema = z.object({\n path: z.string(),\n});\nexport type CountGitTagsProps = z.infer<typeof countGitTagsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\n\nexport const assetFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.asset).readonly(),\n name: z.string(),\n description: z.string(),\n extension: z.string().readonly(),\n mimeType: z.string().readonly(),\n /**\n * Total size in bytes\n */\n size: z.number().readonly(),\n});\nexport type AssetFile = z.infer<typeof assetFileSchema>;\n\nexport const assetSchema = assetFileSchema\n .extend({\n /**\n * Absolute path on this filesystem\n */\n absolutePath: z.string().readonly(),\n /**\n * Commit history of this Asset\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Asset');\nexport type Asset = z.infer<typeof assetSchema>;\n\nexport const assetExportSchema = assetSchema.extend({});\nexport type AssetExport = z.infer<typeof assetExportSchema>;\n\nexport const createAssetSchema = assetFileSchema\n .pick({\n name: true,\n description: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n /**\n * Path of the file to add as a new Asset\n */\n filePath: z.string().readonly(),\n });\nexport type CreateAssetProps = z.infer<typeof createAssetSchema>;\n\nexport const readAssetSchema = assetFileSchema\n .pick({\n id: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n });\nexport type ReadAssetProps = z.infer<typeof readAssetSchema>;\n\nexport const saveAssetSchema = assetFileSchema\n .pick({\n id: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n filePath: z.string().readonly(),\n commitHash: z.string().optional().readonly(),\n });\nexport type SaveAssetProps = z.infer<typeof saveAssetSchema>;\n\nexport const updateAssetSchema = assetFileSchema\n .pick({\n id: true,\n name: true,\n description: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n /**\n * Path of the new file to update the Asset with\n */\n newFilePath: z.string().readonly().optional(),\n });\nexport type UpdateAssetProps = z.infer<typeof updateAssetSchema>;\n\nexport const deleteAssetSchema = assetFileSchema\n .pick({\n id: true,\n extension: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type DeleteAssetProps = z.infer<typeof deleteAssetSchema>;\n\nexport const countAssetsSchema = z.object({ projectId: uuidSchema.readonly() });\nexport type CountAssetsProps = z.infer<typeof countAssetsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport {\n objectTypeSchema,\n translatableArrayOf,\n translatableBooleanSchema,\n translatableNumberSchema,\n translatableStringSchema,\n uuidSchema,\n} from './baseSchema.js';\n\nexport const ValueTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean',\n 'reference',\n]);\nexport type ValueType = z.infer<typeof ValueTypeSchema>;\n\nexport const valueContentReferenceBase = z.object({\n id: uuidSchema,\n});\n\nexport const valueContentReferenceToAssetSchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.asset),\n });\nexport type ValueContentReferenceToAsset = z.infer<\n typeof valueContentReferenceToAssetSchema\n>;\n\nexport const valueContentReferenceToCollectionSchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.collection),\n });\nexport type ValueContentReferenceToCollection = z.infer<\n typeof valueContentReferenceToCollectionSchema\n>;\n\nexport const valueContentReferenceToEntrySchema =\n valueContentReferenceBase.extend({\n objectType: z.literal(objectTypeSchema.enum.entry),\n });\nexport type ValueContentReferenceToEntry = z.infer<\n typeof valueContentReferenceToEntrySchema\n>;\n\n// export const valueContentReferenceToSharedValueSchema = z.object({\n// referenceObjectType: z.literal(objectTypeSchema.enum.sharedValue),\n// references: z.object({\n// id: uuidSchema,\n// language: supportedLanguageSchema,\n// }),\n// });\n// export type ValueContentReferenceToSharedValue = z.infer<\n// typeof valueContentReferenceToSharedValueSchema\n// >;\n\n// export const sharedValueFileSchema = baseFileWithLanguageSchema.extend({\n// objectType: z.literal(objectTypeSchema.enum.sharedValue).readonly(),\n// valueType: ValueTypeSchema.exclude(['reference']).readonly(),\n// // valueType: ValueTypeSchema.readonly(), @todo do we allow shared Values to reference assets or others?\n// content: z.union([\n// z.string(),\n// z.number(),\n// z.boolean(),\n// z.string().optional(),\n// z.number().optional(),\n// z.boolean().optional(),\n// // valueContentReferenceToAssetSchema, @todo do we allow shared Values to reference assets or others?\n// // valueContentReferenceToSharedValueSchema,\n// ]),\n// });\n// export type SharedValueFile = z.infer<typeof sharedValueFileSchema>;\n\n// export const sharedValueSchema = sharedValueFileSchema.extend({});\n// export type SharedValue = z.infer<typeof sharedValueSchema>;\n\n// export const sharedValueExportSchema = sharedValueSchema.extend({});\n// export type SharedValueExport = z.infer<typeof sharedValueExportSchema>;\n\n// export const resolvedValueContentReferenceToSharedValueSchema =\n// valueContentReferenceToSharedValueSchema.extend({\n// references: z.object({\n// id: uuidSchema,\n// language: supportedLanguageSchema,\n// resolved: sharedValueSchema,\n// }),\n// });\n// export type ResolvedValueContentReferenceToSharedValue = z.infer<\n// typeof resolvedValueContentReferenceToSharedValueSchema\n// >;\n\nexport const valueContentReferenceSchema = z.union([\n valueContentReferenceToAssetSchema,\n valueContentReferenceToCollectionSchema,\n valueContentReferenceToEntrySchema,\n // valueContentReferenceToSharedValueSchema,\n]);\nexport type ValueContentReference = z.infer<typeof valueContentReferenceSchema>;\n\nexport const directValueBaseSchema = z.object({\n objectType: z.literal(objectTypeSchema.enum.value).readonly(),\n fieldDefinitionId: uuidSchema.readonly(),\n});\n\nexport const directStringValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.string).readonly(),\n content: translatableStringSchema,\n});\nexport type DirectStringValue = z.infer<typeof directStringValueSchema>;\n\nexport const directNumberValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.number).readonly(),\n content: translatableNumberSchema,\n});\nexport type DirectNumberValue = z.infer<typeof directNumberValueSchema>;\n\nexport const directBooleanValueSchema = directValueBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.boolean).readonly(),\n content: translatableBooleanSchema,\n});\nexport type DirectBooleanValue = z.infer<typeof directBooleanValueSchema>;\n\nexport const directValueSchema = z.union([\n directStringValueSchema,\n directNumberValueSchema,\n directBooleanValueSchema,\n]);\nexport type DirectValue = z.infer<typeof directValueSchema>;\n\nexport const referencedValueSchema = z.object({\n objectType: z.literal(objectTypeSchema.enum.value).readonly(),\n fieldDefinitionId: uuidSchema.readonly(),\n valueType: z.literal(ValueTypeSchema.enum.reference).readonly(),\n content: translatableArrayOf(valueContentReferenceSchema),\n});\nexport type ReferencedValue = z.infer<typeof referencedValueSchema>;\n\nexport const valueSchema = z.union([directValueSchema, referencedValueSchema]);\nexport type Value = z.infer<typeof valueSchema>;\n\n/**\n * ---\n */\n\n// export const createSharedValueSchema = sharedValueFileSchema\n// .pick({\n// valueType: true,\n// content: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type CreateSharedValueProps = z.infer<typeof createSharedValueSchema>;\n\n// export const readSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type ReadSharedValueProps = z.infer<typeof readSharedValueSchema>;\n\n// export const updateSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// content: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type UpdateSharedValueProps = z.infer<typeof updateSharedValueSchema>;\n\n// export const deleteSharedValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// });\n// export type DeleteSharedValueProps = z.infer<typeof deleteSharedValueSchema>;\n\n/**\n * @todo maybe we need to validate Values and shared Values\n */\n// export const validateValueSchema = sharedValueFileSchema\n// .pick({\n// id: true,\n// language: true,\n// })\n// .extend({\n// projectId: uuidSchema.readonly(),\n// definition: FieldDefinitionSchema.readonly(),\n// });\n// export type ValidateValueProps = z.infer<typeof validateValueSchema>;\n\n// export const countValuesSchema = z.object({ projectId: uuidSchema.readonly() });\n// export type CountValuesProps = z.infer<typeof countValuesSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { objectTypeSchema, uuidSchema } from './baseSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\nimport { valueSchema } from './valueSchema.js';\n\nexport const entryFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.entry).readonly(),\n values: z.array(valueSchema),\n});\nexport type EntryFile = z.infer<typeof entryFileSchema>;\n\nexport const entrySchema = entryFileSchema\n .extend({\n /**\n * Commit history of this Entry\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Entry');\nexport type Entry = z.infer<typeof entrySchema>;\n\nexport const entryExportSchema = entrySchema.extend({});\nexport type EntryExport = z.infer<typeof entryExportSchema>;\n\nexport const createEntrySchema = entryFileSchema\n .omit({\n id: true,\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n values: z.array(valueSchema),\n });\nexport type CreateEntryProps = z.infer<typeof createEntrySchema>;\n\nexport const readEntrySchema = z.object({\n id: uuidSchema.readonly(),\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadEntryProps = z.infer<typeof readEntrySchema>;\n\nexport const updateEntrySchema = entryFileSchema\n .omit({\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n });\nexport type UpdateEntryProps = z.infer<typeof updateEntrySchema>;\n\nexport const deleteEntrySchema = readEntrySchema.extend({});\nexport type DeleteEntryProps = z.infer<typeof deleteEntrySchema>;\n\nexport const countEntriesSchema = z.object({\n projectId: uuidSchema.readonly(),\n collectionId: uuidSchema.readonly(),\n});\nexport type CountEntriesProps = z.infer<typeof countEntriesSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { translatableStringSchema, uuidSchema } from './baseSchema.js';\nimport { ValueTypeSchema } from './valueSchema.js';\n\nexport const FieldTypeSchema = z.enum([\n // String Values\n 'text',\n 'textarea',\n 'email',\n // 'password', @todo maybe if there is a usecase\n 'url',\n 'ipv4',\n 'date',\n 'time',\n 'datetime',\n 'telephone',\n // Number Values\n 'number',\n 'range',\n // Boolean Values\n 'toggle',\n // Reference Values\n 'asset',\n 'entry',\n // 'sharedValue', // @todo\n]);\nexport type FieldType = z.infer<typeof FieldTypeSchema>;\n\nexport const FieldWidthSchema = z.enum(['12', '6', '4', '3']);\n\nexport const FieldDefinitionBaseSchema = z.object({\n id: uuidSchema.readonly(),\n label: translatableStringSchema,\n description: translatableStringSchema.nullable(),\n isRequired: z.boolean(),\n isDisabled: z.boolean(),\n isUnique: z.boolean(),\n inputWidth: FieldWidthSchema,\n});\nexport type FieldDefinitionBase = z.infer<typeof FieldDefinitionBaseSchema>;\n\n/**\n * String based Field definitions\n */\n\nexport const StringFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(\n {\n valueType: z.literal(ValueTypeSchema.enum.string),\n defaultValue: z.string().nullable(),\n }\n);\n\nexport const textFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.text),\n min: z.number().nullable(),\n max: z.number().nullable(),\n }\n);\nexport type TextFieldDefinition = z.infer<typeof textFieldDefinitionSchema>;\n\nexport const textareaFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.textarea),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type TextareaFieldDefinition = z.infer<\n typeof textareaFieldDefinitionSchema\n>;\n\nexport const emailFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.email),\n defaultValue: z.email().nullable(),\n });\nexport type EmailFieldDefinition = z.infer<typeof emailFieldDefinitionSchema>;\n\n// @todo why should we support password Values? Client saves it in clear text anyways\n// export const passwordFieldDefinitionSchema =\n// StringFieldDefinitionBaseSchema.extend({\n// fieldType: z.literal(FieldfieldTypeSchema.enum.password),\n// });\n\nexport const urlFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.url),\n defaultValue: z.url().nullable(),\n});\nexport type UrlFieldDefinition = z.infer<typeof urlFieldDefinitionSchema>;\n\nexport const ipv4FieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.ipv4),\n defaultValue: z.ipv4().nullable(),\n }\n);\nexport type Ipv4FieldDefinition = z.infer<typeof ipv4FieldDefinitionSchema>;\n\nexport const dateFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.date),\n defaultValue: z.iso.date().nullable(),\n }\n);\nexport type DateFieldDefinition = z.infer<typeof dateFieldDefinitionSchema>;\n\nexport const timeFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(\n {\n fieldType: z.literal(FieldTypeSchema.enum.time),\n defaultValue: z.iso.time().nullable(),\n }\n);\nexport type TimeFieldDefinition = z.infer<typeof timeFieldDefinitionSchema>;\n\nexport const datetimeFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.datetime),\n defaultValue: z.iso.datetime().nullable(),\n });\nexport type DatetimeFieldDefinition = z.infer<\n typeof datetimeFieldDefinitionSchema\n>;\n\nexport const telephoneFieldDefinitionSchema =\n StringFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.telephone),\n defaultValue: z.e164().nullable(),\n });\nexport type TelephoneFieldDefinition = z.infer<\n typeof telephoneFieldDefinitionSchema\n>;\n\nexport const stringFieldDefinitionSchema = z.union([\n textFieldDefinitionSchema,\n textareaFieldDefinitionSchema,\n emailFieldDefinitionSchema,\n urlFieldDefinitionSchema,\n ipv4FieldDefinitionSchema,\n dateFieldDefinitionSchema,\n timeFieldDefinitionSchema,\n datetimeFieldDefinitionSchema,\n telephoneFieldDefinitionSchema,\n]);\nexport type StringFieldDefinition = z.infer<typeof stringFieldDefinitionSchema>;\n\n/**\n * Number based Field definitions\n */\n\nexport const NumberFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(\n {\n valueType: z.literal(ValueTypeSchema.enum.number),\n min: z.number().nullable(),\n max: z.number().nullable(),\n isUnique: z.literal(false),\n defaultValue: z.number().nullable(),\n }\n);\n\nexport const numberFieldDefinitionSchema =\n NumberFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.number),\n });\nexport type NumberFieldDefinition = z.infer<typeof numberFieldDefinitionSchema>;\n\nexport const rangeFieldDefinitionSchema =\n NumberFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.range),\n // Overwrite from nullable to required because a range needs min, max and default to work and is required, since it always returns a number\n isRequired: z.literal(true),\n min: z.number(),\n max: z.number(),\n defaultValue: z.number(),\n });\nexport type RangeFieldDefinition = z.infer<typeof rangeFieldDefinitionSchema>;\n\n/**\n * Boolean based Field definitions\n */\n\nexport const BooleanFieldDefinitionBaseSchema =\n FieldDefinitionBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.boolean),\n // Overwrite from nullable to required because a boolean needs a default to work and is required, since it always is either true or false\n isRequired: z.literal(true),\n defaultValue: z.boolean(),\n isUnique: z.literal(false),\n });\n\nexport const toggleFieldDefinitionSchema =\n BooleanFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.toggle),\n });\nexport type ToggleFieldDefinition = z.infer<typeof toggleFieldDefinitionSchema>;\n\n/**\n * Reference based Field definitions\n */\n\nexport const ReferenceFieldDefinitionBaseSchema =\n FieldDefinitionBaseSchema.extend({\n valueType: z.literal(ValueTypeSchema.enum.reference),\n });\n\nexport const assetFieldDefinitionSchema =\n ReferenceFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.asset),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type AssetFieldDefinition = z.infer<typeof assetFieldDefinitionSchema>;\n\nexport const entryFieldDefinitionSchema =\n ReferenceFieldDefinitionBaseSchema.extend({\n fieldType: z.literal(FieldTypeSchema.enum.entry),\n ofCollections: z.array(uuidSchema),\n min: z.number().nullable(),\n max: z.number().nullable(),\n });\nexport type EntryFieldDefinition = z.infer<typeof entryFieldDefinitionSchema>;\n\n// export const sharedValueDefinitionSchema =\n// ReferenceValueDefinitionBaseSchema.extend({\n// fieldType: z.literal(ValueInputTypeSchema.enum.sharedValue),\n// // The shared Value can have any of the direct types\n// // but not any reference itself (a shared Value cannot have a reference to another shared Value / Asset or any other future reference)\n// sharedValueType: z.union([\n// z.literal(ValueTypeSchema.enum.boolean),\n// z.literal(ValueTypeSchema.enum.number),\n// z.literal(ValueTypeSchema.enum.string),\n// ]),\n// });\n// export type SharedValueValueDefinition = z.infer<\n// typeof sharedValueDefinitionSchema\n// >;\n\nexport const fieldDefinitionSchema = z.union([\n stringFieldDefinitionSchema,\n numberFieldDefinitionSchema,\n rangeFieldDefinitionSchema,\n toggleFieldDefinitionSchema,\n assetFieldDefinitionSchema,\n entryFieldDefinitionSchema,\n // sharedValueDefinitionSchema,\n]);\nexport type FieldDefinition = z.infer<typeof fieldDefinitionSchema>;\n","import { z } from '@hono/zod-openapi';\nimport {\n objectTypeSchema,\n supportedIconSchema,\n translatableStringSchema,\n uuidSchema,\n} from './baseSchema.js';\nimport { entryExportSchema } from './entrySchema.js';\nimport { fieldDefinitionSchema } from './fieldSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema } from './gitSchema.js';\n\nexport const collectionFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.collection).readonly(),\n name: z.object({\n singular: translatableStringSchema,\n plural: translatableStringSchema,\n }),\n slug: z.object({\n singular: z.string(),\n plural: z.string(),\n }),\n description: translatableStringSchema,\n icon: supportedIconSchema,\n fieldDefinitions: z.array(fieldDefinitionSchema),\n});\nexport type CollectionFile = z.infer<typeof collectionFileSchema>;\n\nexport const collectionSchema = collectionFileSchema\n .extend({\n /**\n * Commit history of this Collection\n */\n history: z.array(gitCommitSchema),\n })\n .openapi('Collection');\nexport type Collection = z.infer<typeof collectionSchema>;\n\nexport const collectionExportSchema = collectionSchema.extend({\n entries: z.array(entryExportSchema),\n});\nexport type CollectionExport = z.infer<typeof collectionExportSchema>;\n\nexport const createCollectionSchema = collectionFileSchema\n .omit({\n id: true,\n objectType: true,\n created: true,\n updated: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type CreateCollectionProps = z.infer<typeof createCollectionSchema>;\n\nexport const readCollectionSchema = z.object({\n id: uuidSchema.readonly(),\n projectId: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadCollectionProps = z.infer<typeof readCollectionSchema>;\n\nexport const updateCollectionSchema = collectionFileSchema\n .pick({\n id: true,\n name: true,\n slug: true,\n description: true,\n icon: true,\n fieldDefinitions: true,\n })\n .extend({\n projectId: uuidSchema.readonly(),\n });\nexport type UpdateCollectionProps = z.infer<typeof updateCollectionSchema>;\n\nexport const deleteCollectionSchema = readCollectionSchema.extend({});\nexport type DeleteCollectionProps = z.infer<typeof deleteCollectionSchema>;\n\nexport const countCollectionsSchema = z.object({\n projectId: uuidSchema.readonly(),\n});\nexport type CountCollectionsProps = z.infer<typeof countCollectionsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { logLevelSchema } from './baseSchema.js';\n\n/**\n * Options that can be passed to elek.io core\n */\nexport const elekIoCoreOptionsSchema = z.object({\n log: z.object({\n /**\n * The lowest level that should be logged\n *\n * @default 'info'\n */\n level: logLevelSchema,\n }),\n file: z.object({\n /**\n * If set to true, caches files in memory to speed up access\n *\n * @default true\n */\n cache: z.boolean(),\n }),\n});\nexport type ElekIoCoreOptions = z.infer<typeof elekIoCoreOptionsSchema>;\n\nexport const constructorElekIoCoreSchema = elekIoCoreOptionsSchema\n .partial({\n log: true,\n file: true,\n })\n .optional();\nexport type ConstructorElekIoCoreProps = z.infer<\n typeof constructorElekIoCoreSchema\n>;\n","import { z } from '@hono/zod-openapi';\nimport { assetExportSchema } from './assetSchema.js';\nimport {\n objectTypeSchema,\n supportedLanguageSchema,\n uuidSchema,\n versionSchema,\n} from './baseSchema.js';\nimport { collectionExportSchema } from './collectionSchema.js';\nimport { baseFileSchema } from './fileSchema.js';\nimport { gitCommitSchema, gitSwitchOptionsSchema } from './gitSchema.js';\n\nexport const projectStatusSchema = z.enum(['foo', 'bar', 'todo']);\nexport type ProjectStatus = z.infer<typeof projectStatusSchema>;\n\nexport const projectSettingsSchema = z.object({\n language: z.object({\n default: supportedLanguageSchema,\n supported: z.array(supportedLanguageSchema),\n }),\n});\nexport type ProjectSettings = z.infer<typeof projectSettingsSchema>;\n\nexport const projectFolderSchema = z.enum([\n 'assets',\n 'collections',\n 'shared-values',\n 'lfs',\n // 'logs',\n // 'public',\n // 'theme',\n]);\nexport type ProjectFolder = z.infer<typeof projectFolderSchema>;\n\nexport const projectBranchSchema = z.enum(['production', 'work']);\nexport type ProjectBranch = z.infer<typeof projectBranchSchema>;\n\nexport const projectFileSchema = baseFileSchema.extend({\n objectType: z.literal(objectTypeSchema.enum.project).readonly(),\n coreVersion: versionSchema,\n name: z.string().trim().min(1, 'shared.projectNameRequired'),\n description: z.string().trim().min(1, 'shared.projectDescriptionRequired'),\n version: versionSchema,\n status: projectStatusSchema,\n settings: projectSettingsSchema,\n});\nexport type ProjectFile = z.infer<typeof projectFileSchema>;\n\nexport const projectSchema = projectFileSchema\n .extend({\n remoteOriginUrl: z.string().nullable().openapi({\n description: 'URL of the remote Git repository',\n }),\n history: z.array(gitCommitSchema).openapi({\n description: 'Commit history of this Project',\n }),\n fullHistory: z.array(gitCommitSchema).openapi({\n description:\n 'Full commit history of this Project including all Assets, Collections, Entries and other files',\n }),\n })\n .openapi('Project');\nexport type Project = z.infer<typeof projectSchema>;\n\nexport const migrateProjectSchema = projectFileSchema\n .pick({\n id: true,\n coreVersion: true,\n })\n .loose();\nexport type MigrateProjectProps = z.infer<typeof migrateProjectSchema>;\n\nexport const projectExportSchema = projectSchema.extend({\n assets: z.array(assetExportSchema),\n collections: z.array(collectionExportSchema),\n});\nexport type ProjectExport = z.infer<typeof projectExportSchema>;\n\nexport const createProjectSchema = projectSchema.pick({\n name: true,\n description: true,\n settings: true,\n});\nexport type CreateProjectProps = z.infer<typeof createProjectSchema>;\n\nexport const readProjectSchema = z.object({\n id: uuidSchema.readonly(),\n commitHash: z.string().optional().readonly(),\n});\nexport type ReadProjectProps = z.infer<typeof readProjectSchema>;\n\nexport const updateProjectSchema = projectSchema.pick({\n id: true,\n name: true,\n description: true,\n settings: true,\n});\nexport type UpdateProjectProps = z.infer<typeof updateProjectSchema>;\n\nexport const upgradeProjectSchema = z.object({\n id: uuidSchema.readonly(),\n /**\n * Force the upgrade even if the Project is up-to-date\n */\n force: z.boolean().optional(),\n});\nexport type UpgradeProjectProps = z.infer<typeof upgradeProjectSchema>;\n\nexport const deleteProjectSchema = readProjectSchema.extend({\n force: z.boolean().optional(),\n});\nexport type DeleteProjectProps = z.infer<typeof deleteProjectSchema>;\n\nexport const projectUpgradeSchema = z.object({\n /**\n * The Core version the Project will be upgraded to\n */\n to: versionSchema.readonly(),\n /**\n * Function that will be executed in the process of upgrading a Project\n */\n run: z.function({\n input: [projectFileSchema],\n output: z.promise(z.void()),\n }),\n});\nexport type ProjectUpgrade = z.infer<typeof projectUpgradeSchema>;\n\nexport const cloneProjectSchema = z.object({\n url: z.string(),\n});\nexport type CloneProjectProps = z.infer<typeof cloneProjectSchema>;\n\nexport const listBranchesProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type ListBranchesProjectProps = z.infer<\n typeof listBranchesProjectSchema\n>;\n\nexport const currentBranchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type CurrentBranchProjectProps = z.infer<\n typeof currentBranchProjectSchema\n>;\n\nexport const switchBranchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n branch: z.string(),\n options: gitSwitchOptionsSchema.optional(),\n});\nexport type SwitchBranchProjectProps = z.infer<\n typeof switchBranchProjectSchema\n>;\n\nexport const getRemoteOriginUrlProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type GetRemoteOriginUrlProjectProps = z.infer<\n typeof getRemoteOriginUrlProjectSchema\n>;\n\nexport const setRemoteOriginUrlProjectSchema = z.object({\n id: uuidSchema.readonly(),\n url: z.string(),\n});\nexport type SetRemoteOriginUrlProjectProps = z.infer<\n typeof setRemoteOriginUrlProjectSchema\n>;\n\nexport const getChangesProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type GetChangesProjectProps = z.infer<typeof getChangesProjectSchema>;\n\nexport const synchronizeProjectSchema = z.object({\n id: uuidSchema.readonly(),\n});\nexport type SynchronizeProjectProps = z.infer<typeof synchronizeProjectSchema>;\n\nexport const searchProjectSchema = z.object({\n id: uuidSchema.readonly(),\n query: z.string(),\n language: supportedLanguageSchema,\n type: z.array(objectTypeSchema).optional(),\n});\nexport type SearchProjectProps = z.infer<typeof searchProjectSchema>;\n","/**\n * Dynamic zod schema generation\n *\n * Altough everything is already strictly typed, a type of string might not be an email or text of a certain length.\n * To validate this, we need to generate zod schemas based on Field definitions the user created.\n */\n\nimport { z } from '@hono/zod-openapi';\nimport { supportedLanguageSchema } from './baseSchema.js';\nimport {\n createEntrySchema,\n entrySchema,\n updateEntrySchema,\n} from './entrySchema.js';\nimport type {\n AssetFieldDefinition,\n EntryFieldDefinition,\n FieldDefinition,\n NumberFieldDefinition,\n RangeFieldDefinition,\n StringFieldDefinition} from './fieldSchema.js';\nimport {\n FieldTypeSchema\n} from './fieldSchema.js';\nimport {\n directBooleanValueSchema,\n directNumberValueSchema,\n directStringValueSchema,\n referencedValueSchema,\n valueContentReferenceToAssetSchema,\n valueContentReferenceToEntrySchema,\n ValueTypeSchema,\n} from './valueSchema.js';\n\n/**\n * Boolean Values are always either true or false, so we don't need the Field definition here\n */\nfunction getBooleanValueContentSchemaFromFieldDefinition() {\n return z.boolean();\n}\n\n/**\n * Number Values can have min and max values and can be required or not\n */\nfunction getNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition: NumberFieldDefinition | RangeFieldDefinition\n) {\n let schema = z.number();\n\n if (fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n if (fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n if (fieldDefinition.isRequired === false) {\n return schema.nullable();\n }\n\n return schema;\n}\n\n/**\n * String Values can have different formats (email, url, ipv4, date, time, ...)\n * and can have min and max length and can be required or not\n */\nfunction getStringValueContentSchemaFromFieldDefinition(\n fieldDefinition: StringFieldDefinition\n) {\n let schema = null;\n\n switch (fieldDefinition.fieldType) {\n case FieldTypeSchema.enum.email:\n schema = z.email();\n break;\n case FieldTypeSchema.enum.url:\n schema = z.url();\n break;\n case FieldTypeSchema.enum.ipv4:\n schema = z.ipv4();\n break;\n case FieldTypeSchema.enum.date:\n schema = z.iso.date();\n break;\n case FieldTypeSchema.enum.time:\n schema = z.iso.time();\n break;\n case FieldTypeSchema.enum.datetime:\n schema = z.iso.datetime();\n break;\n case FieldTypeSchema.enum.telephone:\n schema = z.e164();\n break;\n case FieldTypeSchema.enum.text:\n case FieldTypeSchema.enum.textarea:\n schema = z.string().trim();\n break;\n }\n\n if ('min' in fieldDefinition && fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n if ('max' in fieldDefinition && fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n if (fieldDefinition.isRequired === false) {\n return schema.nullable();\n }\n\n return schema.min(1, 'shared.stringValueRequired'); // @see https://github.com/colinhacks/zod/issues/2466\n}\n\n/**\n * Reference Values can reference either Assets or Entries (or Shared Values in the future)\n * and can have min and max number of references and can be required or not\n */\nfunction getReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition: AssetFieldDefinition | EntryFieldDefinition // | SharedValueFieldDefinition\n) {\n let schema;\n\n switch (fieldDefinition.fieldType) {\n case FieldTypeSchema.enum.asset:\n {\n schema = z.array(valueContentReferenceToAssetSchema);\n }\n break;\n case FieldTypeSchema.enum.entry:\n {\n schema = z.array(valueContentReferenceToEntrySchema);\n }\n break;\n // case ValueInputTypeSchema.enum.sharedValue: {\n // let schema = valueContentReferenceToSharedValueSchema.extend({}); // Deep copy to not overwrite the base schema\n // if (definition.isRequired) {\n // const requiredReferences = schema.shape.references.min(\n // 1,\n // 'shared.assetValueRequired'\n // );\n // schema = schema.extend({\n // references: requiredReferences,\n // });\n // }\n // return valueContentReferenceToSharedValueSchema;\n // }\n }\n\n if (fieldDefinition.isRequired) {\n schema = schema.min(1, 'shared.referenceRequired');\n }\n\n if (fieldDefinition.min) {\n schema = schema.min(fieldDefinition.min);\n }\n\n if (fieldDefinition.max) {\n schema = schema.max(fieldDefinition.max);\n }\n\n return schema;\n}\n\nfunction getTranslatableStringValueContentSchemaFromFieldDefinition(\n fieldDefinition: StringFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getStringValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\nfunction getTranslatableNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition: NumberFieldDefinition | RangeFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getNumberValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\nfunction getTranslatableBooleanValueContentSchemaFromFieldDefinition() {\n return z.partialRecord(\n supportedLanguageSchema,\n getBooleanValueContentSchemaFromFieldDefinition()\n );\n}\n\nfunction getTranslatableReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition: AssetFieldDefinition | EntryFieldDefinition\n) {\n return z.partialRecord(\n supportedLanguageSchema,\n getReferenceValueContentSchemaFromFieldDefinition(fieldDefinition)\n );\n}\n\n/**\n * Generates a zod schema to check a Value based on given Field definition\n */\nexport function getValueSchemaFromFieldDefinition(\n fieldDefinition: FieldDefinition\n) {\n switch (fieldDefinition.valueType) {\n case ValueTypeSchema.enum.boolean:\n return directBooleanValueSchema.extend({\n content: getTranslatableBooleanValueContentSchemaFromFieldDefinition(),\n });\n case ValueTypeSchema.enum.number:\n return directNumberValueSchema.extend({\n content:\n getTranslatableNumberValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n case ValueTypeSchema.enum.string:\n return directStringValueSchema.extend({\n content:\n getTranslatableStringValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n case ValueTypeSchema.enum.reference:\n return referencedValueSchema.extend({\n content:\n getTranslatableReferenceValueContentSchemaFromFieldDefinition(\n fieldDefinition\n ),\n });\n default:\n throw new Error(\n // @ts-expect-error Code cannot be reached, but if we add a new ValueType and forget to update this function, we want to be notified about it\n `Error generating schema for unsupported ValueType \"${fieldDefinition.valueType}\"`\n );\n }\n}\n\n/**\n * Generates a schema for an Entry based on the given Field definitions and Values\n */\nexport function getEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...entrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n\n/**\n * Generates a schema for creating a new Entry based on the given Field definitions and Values\n */\nexport function getCreateEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...createEntrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n\n/**\n * Generates a schema for updating an existing Entry based on the given Field definitions and Values\n */\nexport function getUpdateEntrySchemaFromFieldDefinitions(\n fieldDefinitions: FieldDefinition[]\n) {\n const valueSchemas = fieldDefinitions.map((fieldDefinition) => {\n return getValueSchemaFromFieldDefinition(fieldDefinition);\n });\n\n return z.object({\n ...updateEntrySchema.shape,\n values: z.tuple(\n valueSchemas as [\n (typeof valueSchemas)[number],\n ...(typeof valueSchemas)[number][],\n ] // At least one element is required in a tuple\n ),\n });\n}\n","import { z } from '@hono/zod-openapi';\nimport { uuidSchema } from './baseSchema.js';\n\nexport const serviceTypeSchema = z.enum([\n 'Git',\n 'GitTag',\n 'User',\n 'Project',\n 'Asset',\n 'JsonFile',\n 'Search',\n 'Collection',\n 'Entry',\n 'Value',\n]);\nexport type ServiceType = z.infer<typeof serviceTypeSchema>;\n\nexport interface PaginatedList<T> {\n total: number;\n limit: number;\n offset: number;\n list: T[];\n}\n\nexport function paginatedListOf<T extends z.ZodTypeAny>(schema: T) {\n return z.object({\n total: z.number(),\n limit: z.number(),\n offset: z.number(),\n list: z.array(schema),\n });\n}\n\nexport interface PaginationOptions {\n limit: number;\n offset: number;\n}\n\n/**\n * Implements create, read, update and delete methods\n */\nexport interface CrudService<T> {\n create: (props: never) => Promise<T>;\n read: (props: never) => Promise<T>;\n update: (props: never) => Promise<T>;\n delete: (props: never) => Promise<void>;\n}\n\n/**\n * Implements list and count methods additionally\n * to create, read, update and delete\n */\nexport interface CrudServiceWithListCount<T> extends CrudService<T> {\n /**\n * Returns a list of this services objects\n *\n * Does not return objects where the schema validation fails.\n * If that is the case, upgrade the Client and then Project to the latest version.\n */\n list: (...props: never[]) => Promise<PaginatedList<T>>;\n /**\n * Returns the total number of this services objects\n */\n count: (...props: never[]) => Promise<number>;\n}\n\nconst listSchema = z.object({\n projectId: uuidSchema,\n limit: z.number().optional(),\n offset: z.number().optional(),\n});\n\nexport const listCollectionsSchema = listSchema;\nexport type ListCollectionsProps = z.infer<typeof listCollectionsSchema>;\n\nexport const listEntriesSchema = listSchema.extend({\n collectionId: uuidSchema,\n});\nexport type ListEntriesProps = z.infer<typeof listEntriesSchema>;\n\nexport const listAssetsSchema = listSchema;\nexport type ListAssetsProps = z.infer<typeof listAssetsSchema>;\n\n// export const listSharedValuesSchema = listSchema(sharedValueSchema);\n// export type ListSharedValuesProps = z.infer<typeof listSharedValuesSchema>;\n\nexport const listProjectsSchema = listSchema.omit({\n projectId: true,\n});\nexport type ListProjectsProps = z.infer<typeof listProjectsSchema>;\n\nexport const listGitTagsSchema = z.object({\n path: z.string(),\n});\nexport type ListGitTagsProps = z.infer<typeof listGitTagsSchema>;\n","import { z } from '@hono/zod-openapi';\nimport { supportedLanguageSchema, uuidSchema } from './baseSchema.js';\nimport { gitSignatureSchema } from './gitSchema.js';\n\nexport const UserTypeSchema = z.enum(['local', 'cloud']);\n\nexport const baseUserSchema = gitSignatureSchema.extend({\n userType: UserTypeSchema,\n language: supportedLanguageSchema,\n localApi: z.object({\n /**\n * If set to true the local API is started whenever Core is initialized\n */\n isEnabled: z.boolean(),\n /**\n * The port the local API uses\n */\n port: z.number(),\n }),\n});\nexport type BaseUser = z.infer<typeof baseUserSchema>;\n\nexport const localUserSchema = baseUserSchema.extend({\n userType: z.literal(UserTypeSchema.enum.local),\n});\nexport type LocalUser = z.infer<typeof localUserSchema>;\n\nexport const cloudUserSchema = baseUserSchema.extend({\n userType: z.literal(UserTypeSchema.enum.cloud),\n id: uuidSchema,\n});\nexport type CloudUser = z.infer<typeof cloudUserSchema>;\n\nexport const userFileSchema = z.union([localUserSchema, cloudUserSchema]);\nexport type UserFile = z.infer<typeof userFileSchema>;\n\nexport const userSchema = userFileSchema;\nexport type User = z.infer<typeof userSchema>;\n\nexport const setUserSchema = userSchema;\nexport type SetUserProps = z.infer<typeof setUserSchema>;\n","import { z } from 'zod';\nimport { uuidSchema } from './baseSchema.js';\n\nconst outDirSchema = z.string().default('./.elek.io');\nconst languageSchema = z.enum(['ts', 'js']).default('ts');\nconst formatSchema = z.enum(['esm', 'cjs']).default('esm');\nconst targetSchema = z\n .enum([\n 'es3',\n 'es5',\n 'es6',\n 'es2015',\n 'es2016',\n 'es2017',\n 'es2018',\n 'es2019',\n 'es2020',\n 'es2021',\n 'es2022',\n 'es2023',\n 'es2024',\n 'esnext',\n ])\n .default('es2020');\nconst projectsSchema = z\n .string()\n .default('all')\n .transform((value) => {\n if (value === 'all') {\n return 'all';\n }\n\n return value.split(',').map((v) => uuidSchema.parse(v.trim()));\n });\nconst generateApiClientOptionsSchema = z.object({\n watch: z.boolean().default(false),\n});\nconst exportProjectsOptionsSchema = generateApiClientOptionsSchema.extend({\n separate: z.boolean().default(false),\n});\n\nexport const generateApiClientSchema = z.object({\n outDir: outDirSchema,\n language: languageSchema,\n format: formatSchema,\n target: targetSchema,\n options: generateApiClientOptionsSchema,\n});\nexport type GenerateApiClientProps = z.infer<typeof generateApiClientSchema>;\n\nconst portSchema = z\n .string()\n .default('31310')\n .transform((value, context) => {\n try {\n const parsed = parseInt(value);\n\n return parsed;\n } catch (_error) {\n context.addIssue({\n code: 'custom',\n message: 'Invalid port number',\n input: value,\n });\n\n // this is a special constant with type `never`\n // returning it lets you exit the transform without impacting the inferred return type\n return z.NEVER;\n }\n });\n\nexport const apiStartSchema = z.object({\n port: portSchema,\n});\nexport type ApiStartProps = z.infer<typeof apiStartSchema>;\n\nexport const exportSchema = z.object({\n outDir: outDirSchema,\n projects: projectsSchema,\n options: exportProjectsOptionsSchema,\n});\nexport type ExportProps = z.infer<typeof exportSchema>;\n","import { z } from '@hono/zod-openapi';\n\nexport const logSourceSchema = z.enum(['core', 'desktop']);\nexport type LogSource = z.infer<typeof logSourceSchema>;\n\nexport const logSchema = z.object({\n source: logSourceSchema,\n message: z.string(),\n /**\n * Additional metadata for the log entry\n *\n * @example { userId: '12345', action: 'login' }\n */\n meta: z.record(z.string(), z.unknown()).optional(),\n});\nexport type LogProps = z.infer<typeof logSchema>;\n\nexport const logConsoleTransportSchema = logSchema.extend({\n timestamp: z.string(),\n level: z.string(),\n});\nexport type LogConsoleTransportProps = z.infer<\n typeof logConsoleTransportSchema\n>;\n","import slugify from '@sindresorhus/slugify';\nimport { v4 as generateUuid } from 'uuid';\nimport { type Uuid } from '../schema/baseSchema.js';\n\n/**\n * Returns a new UUID\n */\nexport function uuid(): Uuid {\n return generateUuid();\n}\n\n/**\n * Returns a string representing date and time\n * in a simplified format based on ISO 8601.\n * The timezone is always UTC.\n *\n * - If value is not given, the current date and time is used\n * - If value is given, it's converted to above representation and UTC timezone\n *\n * @example 'YYYY-MM-DDTHH:mm:ss.sssZ'\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n * @see https://en.wikipedia.org/wiki/ISO_8601\n */\nexport function datetime(value?: number | string | Date) {\n if (!value) {\n return new Date().toISOString();\n }\n return new Date(value).toISOString();\n}\n\n/**\n * Returns the slug of given string\n */\nexport function slug(string: string): string {\n return slugify(string, {\n separator: '-',\n lowercase: true,\n decamelize: true,\n });\n}\n"],"mappings":"8HAaA,MAAa,EAA0B,EAAE,KAAK,CAI5C,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACD,CAAC,CAGW,GAAsB,EAAE,KAAK,CAAC,OAAQ,OAAQ,SAAS,CAAC,CAGxD,EAAmB,E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