pocketbase-zod-schema 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +233 -98
- package/dist/cli/index.cjs +45 -11
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +45 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/migrate.cjs +45 -11
- package/dist/cli/migrate.cjs.map +1 -1
- package/dist/cli/migrate.js +45 -11
- package/dist/cli/migrate.js.map +1 -1
- package/dist/index.cjs +86 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +81 -26
- package/dist/index.js.map +1 -1
- package/dist/migration/analyzer.cjs +46 -11
- package/dist/migration/analyzer.cjs.map +1 -1
- package/dist/migration/analyzer.d.cts +11 -1
- package/dist/migration/analyzer.d.ts +11 -1
- package/dist/migration/analyzer.js +46 -12
- package/dist/migration/analyzer.js.map +1 -1
- package/dist/migration/index.cjs +45 -11
- package/dist/migration/index.cjs.map +1 -1
- package/dist/migration/index.js +45 -11
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/snapshot.cjs.map +1 -1
- package/dist/migration/snapshot.js.map +1 -1
- package/dist/mutator.cjs +20 -21
- package/dist/mutator.cjs.map +1 -1
- package/dist/mutator.d.cts +2 -2
- package/dist/mutator.d.ts +2 -2
- package/dist/mutator.js +20 -21
- package/dist/mutator.js.map +1 -1
- package/dist/schema.cjs +41 -16
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +98 -8
- package/dist/schema.d.ts +98 -8
- package/dist/schema.js +36 -15
- package/dist/schema.js.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{user-_AM523hb.d.cts → user-DTJQIj4K.d.cts} +31 -5
- package/dist/{user-_AM523hb.d.ts → user-DTJQIj4K.d.ts} +31 -5
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { StatusEnum, StatusEnumType } from './enums.cjs';
|
|
2
2
|
export { UserMutator } from './mutator.cjs';
|
|
3
3
|
export { ProjectInputType, ProjectType, TypedPocketBase, UserInputType, UserType } from './types.cjs';
|
|
4
|
-
export { PermissionTemplates, PermissionValidationResult, RelationConfig, RelationsConfig, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, createPermissions, dateField, editorField, emailField, extractRelationMetadata, fileField, filesField, geoPointField, inputImageFileSchema, isPermissionSchema, isTemplateConfig, jsonField, mergePermissions, numberField, omitImageFilesSchema,
|
|
4
|
+
export { CollectionConfig, PermissionTemplates, PermissionValidationResult, RelationConfig, RelationField, RelationsConfig, RelationsField, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, createPermissions, dateField, defineCollection, editorField, emailField, extractRelationMetadata, fileField, filesField, geoPointField, inputImageFileSchema, isPermissionSchema, isTemplateConfig, jsonField, mergePermissions, numberField, omitImageFilesSchema, resolveTemplate, selectField, textField, urlField, validatePermissionConfig, validateRuleExpression, withIndexes, withPermissions } from './schema.cjs';
|
|
5
5
|
export { A as APIRuleType, P as PermissionSchema, a as PermissionTemplate, b as PermissionTemplateConfig, R as RuleExpression } from './permissions-ZHafVSIx.cjs';
|
|
6
|
-
export { P as ProjectInputSchema, a as ProjectSchema, U as UserInputSchema,
|
|
6
|
+
export { b as ProjectCollection, P as ProjectInputSchema, a as ProjectSchema, e as UserCollection, c as UserCollectionSchema, U as UserInputSchema, d as UserSchema } from './user-DTJQIj4K.cjs';
|
|
7
7
|
export { SchemaAnalyzer, SchemaAnalyzerConfig, buildFieldDefinition, buildSchemaDefinition, convertZodSchemaToCollectionSchema, discoverSchemaFiles, extractFieldDefinitions, extractIndexes, extractSchemaDefinitions, getCollectionNameFromFile, importSchemaModule, isAuthCollection, parseSchemaFiles, selectSchemaForCollection } from './migration/analyzer.cjs';
|
|
8
8
|
export { SnapshotConfig, SnapshotManager, convertPocketBaseMigration, findLatestSnapshot, getSnapshotPath, getSnapshotVersion, loadBaseMigration, loadSnapshot, loadSnapshotIfExists, loadSnapshotWithMigrations, mergeSnapshots, saveSnapshot, snapshotExists, validateSnapshot } from './migration/snapshot.cjs';
|
|
9
9
|
export { ChangeSummary, DestructiveChange, DiffEngine, DiffEngineConfig, aggregateChanges, categorizeChangesBySeverity, compare, compareFieldConstraints, compareFieldOptions, compareFieldTypes, comparePermissions, compareRelationConfigurations, detectDestructiveChanges, detectFieldChanges, filterSystemCollections, findNewCollections, findNewFields, findRemovedCollections, findRemovedFields, generateChangeSummary, getUsersSystemFields, isSystemCollection, matchCollectionsByName, matchFieldsByName, requiresForceFlag } from './migration/diff.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { StatusEnum, StatusEnumType } from './enums.js';
|
|
2
2
|
export { UserMutator } from './mutator.js';
|
|
3
3
|
export { ProjectInputType, ProjectType, TypedPocketBase, UserInputType, UserType } from './types.js';
|
|
4
|
-
export { PermissionTemplates, PermissionValidationResult, RelationConfig, RelationsConfig, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, createPermissions, dateField, editorField, emailField, extractRelationMetadata, fileField, filesField, geoPointField, inputImageFileSchema, isPermissionSchema, isTemplateConfig, jsonField, mergePermissions, numberField, omitImageFilesSchema,
|
|
4
|
+
export { CollectionConfig, PermissionTemplates, PermissionValidationResult, RelationConfig, RelationField, RelationsConfig, RelationsField, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, createPermissions, dateField, defineCollection, editorField, emailField, extractRelationMetadata, fileField, filesField, geoPointField, inputImageFileSchema, isPermissionSchema, isTemplateConfig, jsonField, mergePermissions, numberField, omitImageFilesSchema, resolveTemplate, selectField, textField, urlField, validatePermissionConfig, validateRuleExpression, withIndexes, withPermissions } from './schema.js';
|
|
5
5
|
export { A as APIRuleType, P as PermissionSchema, a as PermissionTemplate, b as PermissionTemplateConfig, R as RuleExpression } from './permissions-ZHafVSIx.js';
|
|
6
|
-
export { P as ProjectInputSchema, a as ProjectSchema, U as UserInputSchema,
|
|
6
|
+
export { b as ProjectCollection, P as ProjectInputSchema, a as ProjectSchema, e as UserCollection, c as UserCollectionSchema, U as UserInputSchema, d as UserSchema } from './user-DTJQIj4K.js';
|
|
7
7
|
export { SchemaAnalyzer, SchemaAnalyzerConfig, buildFieldDefinition, buildSchemaDefinition, convertZodSchemaToCollectionSchema, discoverSchemaFiles, extractFieldDefinitions, extractIndexes, extractSchemaDefinitions, getCollectionNameFromFile, importSchemaModule, isAuthCollection, parseSchemaFiles, selectSchemaForCollection } from './migration/analyzer.js';
|
|
8
8
|
export { SnapshotConfig, SnapshotManager, convertPocketBaseMigration, findLatestSnapshot, getSnapshotPath, getSnapshotVersion, loadBaseMigration, loadSnapshot, loadSnapshotIfExists, loadSnapshotWithMigrations, mergeSnapshots, saveSnapshot, snapshotExists, validateSnapshot } from './migration/snapshot.js';
|
|
9
9
|
export { ChangeSummary, DestructiveChange, DiffEngine, DiffEngineConfig, aggregateChanges, categorizeChangesBySeverity, compare, compareFieldConstraints, compareFieldOptions, compareFieldTypes, comparePermissions, compareRelationConfigurations, detectDestructiveChanges, detectFieldChanges, filterSystemCollections, findNewCollections, findNewFields, findRemovedCollections, findRemovedFields, generateChangeSummary, getUsersSystemFields, isSystemCollection, matchCollectionsByName, matchFieldsByName, requiresForceFlag } from './migration/diff.js';
|
package/dist/index.js
CHANGED
|
@@ -78,7 +78,7 @@ function filesField(options) {
|
|
|
78
78
|
return schema;
|
|
79
79
|
}
|
|
80
80
|
var RELATION_METADATA_KEY = "__pocketbase_relation__";
|
|
81
|
-
function
|
|
81
|
+
function RelationField(config) {
|
|
82
82
|
const metadata = {
|
|
83
83
|
[RELATION_METADATA_KEY]: {
|
|
84
84
|
type: "single",
|
|
@@ -90,7 +90,7 @@ function relationField(config) {
|
|
|
90
90
|
};
|
|
91
91
|
return z.string().describe(JSON.stringify(metadata));
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function RelationsField(config) {
|
|
94
94
|
const metadata = {
|
|
95
95
|
[RELATION_METADATA_KEY]: {
|
|
96
96
|
type: "multiple",
|
|
@@ -149,6 +149,22 @@ function withIndexes(schema, indexes) {
|
|
|
149
149
|
};
|
|
150
150
|
return schema.describe(JSON.stringify(metadata));
|
|
151
151
|
}
|
|
152
|
+
function defineCollection(config) {
|
|
153
|
+
const { collectionName, schema, permissions, indexes, ...futureOptions } = config;
|
|
154
|
+
const metadata = {
|
|
155
|
+
collectionName
|
|
156
|
+
};
|
|
157
|
+
if (permissions) {
|
|
158
|
+
metadata.permissions = permissions;
|
|
159
|
+
}
|
|
160
|
+
if (indexes) {
|
|
161
|
+
metadata.indexes = indexes;
|
|
162
|
+
}
|
|
163
|
+
if (Object.keys(futureOptions).length > 0) {
|
|
164
|
+
Object.assign(metadata, futureOptions);
|
|
165
|
+
}
|
|
166
|
+
return schema.describe(JSON.stringify(metadata));
|
|
167
|
+
}
|
|
152
168
|
|
|
153
169
|
// src/utils/permission-templates.ts
|
|
154
170
|
var PermissionTemplates = {
|
|
@@ -375,12 +391,14 @@ var ProjectInputSchema = z.object({
|
|
|
375
391
|
content: z.string(),
|
|
376
392
|
status: StatusEnum,
|
|
377
393
|
summary: z.string().optional(),
|
|
378
|
-
OwnerUser:
|
|
379
|
-
SubscriberUsers:
|
|
394
|
+
OwnerUser: RelationField({ collection: "Users" }),
|
|
395
|
+
SubscriberUsers: RelationsField({ collection: "Users" })
|
|
380
396
|
}).extend(inputImageFileSchema);
|
|
381
|
-
var ProjectSchema =
|
|
382
|
-
|
|
383
|
-
|
|
397
|
+
var ProjectSchema = ProjectInputSchema.omit(omitImageFilesSchema).extend(baseImageFileSchema);
|
|
398
|
+
var ProjectCollection = defineCollection({
|
|
399
|
+
collectionName: "Projects",
|
|
400
|
+
schema: ProjectSchema,
|
|
401
|
+
permissions: {
|
|
384
402
|
template: "owner-only",
|
|
385
403
|
ownerField: "OwnerUser",
|
|
386
404
|
customRules: {
|
|
@@ -388,7 +406,7 @@ var ProjectSchema = withPermissions(
|
|
|
388
406
|
viewRule: '@request.auth.id != "" && (OwnerUser = @request.auth.id || SubscriberUsers ?= @request.auth.id)'
|
|
389
407
|
}
|
|
390
408
|
}
|
|
391
|
-
);
|
|
409
|
+
});
|
|
392
410
|
var UserInputSchema = z.object({
|
|
393
411
|
name: z.string().optional(),
|
|
394
412
|
email: z.string().email(),
|
|
@@ -396,14 +414,17 @@ var UserInputSchema = z.object({
|
|
|
396
414
|
passwordConfirm: z.string(),
|
|
397
415
|
avatar: z.instanceof(File).optional()
|
|
398
416
|
});
|
|
399
|
-
var
|
|
417
|
+
var UserCollectionSchema = z.object({
|
|
400
418
|
name: z.string().optional(),
|
|
401
419
|
email: z.string().email(),
|
|
402
420
|
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
403
421
|
avatar: z.instanceof(File).optional()
|
|
404
422
|
});
|
|
405
|
-
var UserSchema =
|
|
406
|
-
|
|
423
|
+
var UserSchema = UserCollectionSchema.extend(baseSchema);
|
|
424
|
+
var UserCollection = defineCollection({
|
|
425
|
+
collectionName: "Users",
|
|
426
|
+
schema: UserSchema,
|
|
427
|
+
permissions: {
|
|
407
428
|
// Users can list their own profile
|
|
408
429
|
listRule: "id = @request.auth.id",
|
|
409
430
|
// Users can view their own profile
|
|
@@ -415,13 +436,13 @@ var UserSchema = withIndexes(
|
|
|
415
436
|
// Users can only delete their own account
|
|
416
437
|
deleteRule: "id = @request.auth.id"
|
|
417
438
|
// manageRule is null in PocketBase default (not set)
|
|
418
|
-
}
|
|
419
|
-
[
|
|
439
|
+
},
|
|
440
|
+
indexes: [
|
|
420
441
|
// PocketBase's default indexes for auth collections
|
|
421
442
|
"CREATE UNIQUE INDEX `idx_tokenKey__pb_users_auth_` ON `users` (`tokenKey`)",
|
|
422
443
|
"CREATE UNIQUE INDEX `idx_email__pb_users_auth_` ON `users` (`email`) WHERE `email` != ''"
|
|
423
444
|
]
|
|
424
|
-
);
|
|
445
|
+
});
|
|
425
446
|
var BaseMutator = class {
|
|
426
447
|
pb;
|
|
427
448
|
// Define a default property that subclasses will override
|
|
@@ -1943,6 +1964,16 @@ function getFieldTypeInfo(zodType, fieldName) {
|
|
|
1943
1964
|
}
|
|
1944
1965
|
|
|
1945
1966
|
// src/migration/analyzer.ts
|
|
1967
|
+
var tsxLoaderRegistered = false;
|
|
1968
|
+
async function ensureTsxLoader() {
|
|
1969
|
+
if (tsxLoaderRegistered) return;
|
|
1970
|
+
try {
|
|
1971
|
+
await import('tsx/esm');
|
|
1972
|
+
tsxLoaderRegistered = true;
|
|
1973
|
+
} catch {
|
|
1974
|
+
tsxLoaderRegistered = false;
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1946
1977
|
var DEFAULT_CONFIG = {
|
|
1947
1978
|
workspaceRoot: process.cwd(),
|
|
1948
1979
|
excludePatterns: [
|
|
@@ -2040,24 +2071,37 @@ async function importSchemaModule(filePath, config) {
|
|
|
2040
2071
|
} else {
|
|
2041
2072
|
resolvedPath = jsPath;
|
|
2042
2073
|
}
|
|
2074
|
+
if (resolvedPath.endsWith(".ts")) {
|
|
2075
|
+
await ensureTsxLoader();
|
|
2076
|
+
if (!tsxLoaderRegistered) {
|
|
2077
|
+
throw new SchemaParsingError(
|
|
2078
|
+
`Failed to import TypeScript schema file. The 'tsx' package is required to load TypeScript files.
|
|
2079
|
+
Please install tsx: npm install tsx (or yarn add tsx, or pnpm add tsx)
|
|
2080
|
+
Alternatively, compile your schema files to JavaScript first.`,
|
|
2081
|
+
filePath
|
|
2082
|
+
);
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2043
2085
|
const fileUrl = new URL(`file://${path5.resolve(resolvedPath)}`);
|
|
2044
2086
|
const module = await import(fileUrl.href);
|
|
2045
2087
|
return module;
|
|
2046
2088
|
} catch (error) {
|
|
2047
2089
|
const tsPath = `${filePath}.ts`;
|
|
2048
2090
|
const isTypeScriptFile = fs3.existsSync(tsPath);
|
|
2091
|
+
if (isTypeScriptFile && error instanceof SchemaParsingError) {
|
|
2092
|
+
throw error;
|
|
2093
|
+
}
|
|
2049
2094
|
if (isTypeScriptFile) {
|
|
2050
2095
|
throw new SchemaParsingError(
|
|
2051
|
-
`Failed to import TypeScript schema file.
|
|
2052
|
-
Please
|
|
2053
|
-
|
|
2054
|
-
2. Use tsx to run the migration tool (e.g., "npx tsx package/dist/cli/migrate.js status" or "tsx package/dist/cli/migrate.js status")`,
|
|
2096
|
+
`Failed to import TypeScript schema file. The 'tsx' package is required to load TypeScript files.
|
|
2097
|
+
Please install tsx: npm install tsx (or yarn add tsx, or pnpm add tsx)
|
|
2098
|
+
Alternatively, compile your schema files to JavaScript first.`,
|
|
2055
2099
|
filePath,
|
|
2056
2100
|
error
|
|
2057
2101
|
);
|
|
2058
2102
|
}
|
|
2059
2103
|
throw new SchemaParsingError(
|
|
2060
|
-
`Failed to import schema module. Make sure the schema files
|
|
2104
|
+
`Failed to import schema module. Make sure the schema files exist and are valid.`,
|
|
2061
2105
|
filePath,
|
|
2062
2106
|
error
|
|
2063
2107
|
);
|
|
@@ -2067,6 +2111,19 @@ function getCollectionNameFromFile(filePath) {
|
|
|
2067
2111
|
const filename = path5.basename(filePath).replace(/\.(ts|js)$/, "");
|
|
2068
2112
|
return toCollectionName(filename);
|
|
2069
2113
|
}
|
|
2114
|
+
function extractCollectionNameFromSchema(zodSchema) {
|
|
2115
|
+
if (!zodSchema.description) {
|
|
2116
|
+
return null;
|
|
2117
|
+
}
|
|
2118
|
+
try {
|
|
2119
|
+
const metadata = JSON.parse(zodSchema.description);
|
|
2120
|
+
if (metadata.collectionName && typeof metadata.collectionName === "string") {
|
|
2121
|
+
return metadata.collectionName;
|
|
2122
|
+
}
|
|
2123
|
+
} catch {
|
|
2124
|
+
}
|
|
2125
|
+
return null;
|
|
2126
|
+
}
|
|
2070
2127
|
function extractSchemaDefinitions(module, patterns = ["Schema", "InputSchema"]) {
|
|
2071
2128
|
const result = {};
|
|
2072
2129
|
for (const [key, value] of Object.entries(module)) {
|
|
@@ -2141,11 +2198,8 @@ function buildFieldDefinition(fieldName, zodType) {
|
|
|
2141
2198
|
// Default to false, can be configured later
|
|
2142
2199
|
};
|
|
2143
2200
|
if (fieldDef.options) {
|
|
2144
|
-
const { min, max, pattern, ...relationSafeOptions } = fieldDef.options;
|
|
2145
|
-
|
|
2146
|
-
console.log("max", max);
|
|
2147
|
-
console.log("pattern", pattern);
|
|
2148
|
-
fieldDef.options = Object.keys(relationSafeOptions).length > 0 ? relationSafeOptions : void 0;
|
|
2201
|
+
const { min: _min, max: _max, pattern: _pattern, ...relationSafeOptions } = fieldDef.options;
|
|
2202
|
+
fieldDef.options = Object.keys(relationSafeOptions).length ? relationSafeOptions : void 0;
|
|
2149
2203
|
}
|
|
2150
2204
|
}
|
|
2151
2205
|
return fieldDef;
|
|
@@ -2242,7 +2296,8 @@ async function buildSchemaDefinition(config) {
|
|
|
2242
2296
|
console.warn(`No valid schema found in ${filePath}, skipping...`);
|
|
2243
2297
|
continue;
|
|
2244
2298
|
}
|
|
2245
|
-
const
|
|
2299
|
+
const collectionNameFromSchema = extractCollectionNameFromSchema(zodSchema);
|
|
2300
|
+
const collectionName = collectionNameFromSchema ?? getCollectionNameFromFile(filePath);
|
|
2246
2301
|
const collectionSchema = convertZodSchemaToCollectionSchema(collectionName, zodSchema);
|
|
2247
2302
|
collections.set(collectionName, collectionSchema);
|
|
2248
2303
|
} catch (error) {
|
|
@@ -5176,6 +5231,6 @@ async function executeStatus(options) {
|
|
|
5176
5231
|
}
|
|
5177
5232
|
}
|
|
5178
5233
|
|
|
5179
|
-
export { CLIUsageError, ConfigurationError, DiffEngine, FIELD_TYPE_INFO, FileSystemError, MigrationError, MigrationGenerationError, MigrationGenerator, POCKETBASE_FIELD_TYPES, PermissionTemplates, ProjectInputSchema, ProjectSchema, SchemaAnalyzer, SchemaParsingError, SnapshotError, SnapshotManager, StatusEnum, UserInputSchema, UserMutator, UserSchema, aggregateChanges, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, buildFieldDefinition, buildSchemaDefinition, categorizeChangesBySeverity, compare, compareFieldConstraints, compareFieldOptions, compareFieldTypes, comparePermissions, compareRelationConfigurations, convertPocketBaseMigration, convertZodSchemaToCollectionSchema, createMigrationFileStructure, createPermissions, dateField, detectDestructiveChanges, detectFieldChanges, discoverSchemaFiles, editorField, emailField, extractComprehensiveFieldOptions, extractFieldDefinitions, extractFieldOptions, extractIndexes, extractRelationMetadata, extractSchemaDefinitions, fileField, filesField, filterSystemCollections, findLatestSnapshot, findNewCollections, findNewFields, findRemovedCollections, findRemovedFields, formatChangeSummary, generate, generateChangeSummary, generateCollectionCreation, generateCollectionPermissions, generateCollectionRules, generateDownMigration, generateFieldAddition, generateFieldDefinitionObject, generateFieldDeletion, generateFieldModification, generateFieldsArray, generateIndexesArray, executeGenerate as generateMigration, generateMigrationDescription, generateMigrationFilename, generatePermissionUpdate, generateTimestamp, generateUpMigration, geoPointField, getArrayElementType, getCollectionNameFromFile, getDefaultValue, getFieldTypeInfo, getMaxSelect, executeStatus as getMigrationStatus, getMinSelect, getSnapshotPath, getSnapshotVersion, getUsersSystemFields, importSchemaModule, inputImageFileSchema, isArrayType, isAuthCollection, isEditorField, isFieldRequired, isFileFieldByName, isGeoPointType, isMultipleRelationField, isPermissionSchema, isRelationField, isSingleRelationField, isSystemCollection, isTemplateConfig, jsonField, loadBaseMigration, loadConfig, loadSnapshot, loadSnapshotIfExists, loadSnapshotWithMigrations, logError, logInfo, logSection, logSuccess, logWarning, mapZodArrayType, mapZodBooleanType, mapZodDateType, mapZodEnumType, mapZodNumberType, mapZodRecordType, mapZodStringType, mapZodTypeToPocketBase, matchCollectionsByName, matchFieldsByName, mergePermissions, mergeSnapshots, numberField, omitImageFilesSchema, parseSchemaFiles, pluralize,
|
|
5234
|
+
export { CLIUsageError, ConfigurationError, DiffEngine, FIELD_TYPE_INFO, FileSystemError, MigrationError, MigrationGenerationError, MigrationGenerator, POCKETBASE_FIELD_TYPES, PermissionTemplates, ProjectCollection, ProjectInputSchema, ProjectSchema, RelationField, RelationsField, SchemaAnalyzer, SchemaParsingError, SnapshotError, SnapshotManager, StatusEnum, UserCollection, UserCollectionSchema, UserInputSchema, UserMutator, UserSchema, aggregateChanges, baseImageFileSchema, baseSchema, baseSchemaWithTimestamps, boolField, buildFieldDefinition, buildSchemaDefinition, categorizeChangesBySeverity, compare, compareFieldConstraints, compareFieldOptions, compareFieldTypes, comparePermissions, compareRelationConfigurations, convertPocketBaseMigration, convertZodSchemaToCollectionSchema, createMigrationFileStructure, createPermissions, dateField, defineCollection, detectDestructiveChanges, detectFieldChanges, discoverSchemaFiles, editorField, emailField, extractComprehensiveFieldOptions, extractFieldDefinitions, extractFieldOptions, extractIndexes, extractRelationMetadata, extractSchemaDefinitions, fileField, filesField, filterSystemCollections, findLatestSnapshot, findNewCollections, findNewFields, findRemovedCollections, findRemovedFields, formatChangeSummary, generate, generateChangeSummary, generateCollectionCreation, generateCollectionPermissions, generateCollectionRules, generateDownMigration, generateFieldAddition, generateFieldDefinitionObject, generateFieldDeletion, generateFieldModification, generateFieldsArray, generateIndexesArray, executeGenerate as generateMigration, generateMigrationDescription, generateMigrationFilename, generatePermissionUpdate, generateTimestamp, generateUpMigration, geoPointField, getArrayElementType, getCollectionNameFromFile, getDefaultValue, getFieldTypeInfo, getMaxSelect, executeStatus as getMigrationStatus, getMinSelect, getSnapshotPath, getSnapshotVersion, getUsersSystemFields, importSchemaModule, inputImageFileSchema, isArrayType, isAuthCollection, isEditorField, isFieldRequired, isFileFieldByName, isGeoPointType, isMultipleRelationField, isPermissionSchema, isRelationField, isSingleRelationField, isSystemCollection, isTemplateConfig, jsonField, loadBaseMigration, loadConfig, loadSnapshot, loadSnapshotIfExists, loadSnapshotWithMigrations, logError, logInfo, logSection, logSuccess, logWarning, mapZodArrayType, mapZodBooleanType, mapZodDateType, mapZodEnumType, mapZodNumberType, mapZodRecordType, mapZodStringType, mapZodTypeToPocketBase, matchCollectionsByName, matchFieldsByName, mergePermissions, mergeSnapshots, numberField, omitImageFilesSchema, parseSchemaFiles, pluralize, requiresForceFlag, resolveTargetCollection, resolveTemplate, saveSnapshot, selectField, selectSchemaForCollection, singularize, snapshotExists, textField, toCollectionName, unwrapZodType, urlField, validatePermissionConfig, validateRuleExpression, validateSnapshot, withIndexes, withPermissions, withProgress, writeMigrationFile };
|
|
5180
5235
|
//# sourceMappingURL=index.js.map
|
|
5181
5236
|
//# sourceMappingURL=index.js.map
|