pocketbase-zod-schema 0.1.2
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 +18 -0
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/cli/index.cjs +3383 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +30 -0
- package/dist/cli/index.d.ts +30 -0
- package/dist/cli/index.js +3331 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/migrate.cjs +3380 -0
- package/dist/cli/migrate.cjs.map +1 -0
- package/dist/cli/migrate.d.cts +1 -0
- package/dist/cli/migrate.d.ts +1 -0
- package/dist/cli/migrate.js +3353 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/cli/utils/index.cjs +540 -0
- package/dist/cli/utils/index.cjs.map +1 -0
- package/dist/cli/utils/index.d.cts +232 -0
- package/dist/cli/utils/index.d.ts +232 -0
- package/dist/cli/utils/index.js +487 -0
- package/dist/cli/utils/index.js.map +1 -0
- package/dist/enums.cjs +19 -0
- package/dist/enums.cjs.map +1 -0
- package/dist/enums.d.cts +6 -0
- package/dist/enums.d.ts +6 -0
- package/dist/enums.js +17 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.cjs +4900 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +4726 -0
- package/dist/index.js.map +1 -0
- package/dist/migration/analyzer.cjs +1267 -0
- package/dist/migration/analyzer.cjs.map +1 -0
- package/dist/migration/analyzer.d.cts +186 -0
- package/dist/migration/analyzer.d.ts +186 -0
- package/dist/migration/analyzer.js +1232 -0
- package/dist/migration/analyzer.js.map +1 -0
- package/dist/migration/diff.cjs +557 -0
- package/dist/migration/diff.cjs.map +1 -0
- package/dist/migration/diff.d.cts +291 -0
- package/dist/migration/diff.d.ts +291 -0
- package/dist/migration/diff.js +534 -0
- package/dist/migration/diff.js.map +1 -0
- package/dist/migration/generator.cjs +778 -0
- package/dist/migration/generator.cjs.map +1 -0
- package/dist/migration/generator.d.cts +225 -0
- package/dist/migration/generator.d.ts +225 -0
- package/dist/migration/generator.js +737 -0
- package/dist/migration/generator.js.map +1 -0
- package/dist/migration/index.cjs +3390 -0
- package/dist/migration/index.cjs.map +1 -0
- package/dist/migration/index.d.cts +103 -0
- package/dist/migration/index.d.ts +103 -0
- package/dist/migration/index.js +3265 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/snapshot.cjs +609 -0
- package/dist/migration/snapshot.cjs.map +1 -0
- package/dist/migration/snapshot.d.cts +167 -0
- package/dist/migration/snapshot.d.ts +167 -0
- package/dist/migration/snapshot.js +575 -0
- package/dist/migration/snapshot.js.map +1 -0
- package/dist/migration/utils/index.cjs +672 -0
- package/dist/migration/utils/index.cjs.map +1 -0
- package/dist/migration/utils/index.d.cts +207 -0
- package/dist/migration/utils/index.d.ts +207 -0
- package/dist/migration/utils/index.js +641 -0
- package/dist/migration/utils/index.js.map +1 -0
- package/dist/mutator.cjs +427 -0
- package/dist/mutator.cjs.map +1 -0
- package/dist/mutator.d.cts +190 -0
- package/dist/mutator.d.ts +190 -0
- package/dist/mutator.js +425 -0
- package/dist/mutator.js.map +1 -0
- package/dist/permissions-ZHafVSIx.d.cts +71 -0
- package/dist/permissions-ZHafVSIx.d.ts +71 -0
- package/dist/schema.cjs +430 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +316 -0
- package/dist/schema.d.ts +316 -0
- package/dist/schema.js +396 -0
- package/dist/schema.js.map +1 -0
- package/dist/types-BbTgmg6H.d.cts +91 -0
- package/dist/types-z1Dkjg8m.d.ts +91 -0
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +14 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/user-jS1aYoeD.d.cts +123 -0
- package/dist/user-jS1aYoeD.d.ts +123 -0
- package/package.json +165 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export { SchemaAnalyzer, SchemaAnalyzerConfig, buildFieldDefinition, buildSchemaDefinition, convertZodSchemaToCollectionSchema, discoverSchemaFiles, extractFieldDefinitions, extractIndexes, extractSchemaDefinitions, getCollectionNameFromFile, importSchemaModule, isAuthCollection, parseSchemaFiles, selectSchemaForCollection } from './analyzer.cjs';
|
|
2
|
+
export { SnapshotConfig, SnapshotManager, convertPocketBaseMigration, findLatestSnapshot, getSnapshotPath, getSnapshotVersion, loadBaseMigration, loadSnapshot, loadSnapshotIfExists, mergeSnapshots, saveSnapshot, snapshotExists, validateSnapshot } from './snapshot.cjs';
|
|
3
|
+
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 './diff.cjs';
|
|
4
|
+
export { MigrationGenerator, MigrationGeneratorConfig, createMigrationFileStructure, generate, generateCollectionCreation, generateCollectionPermissions, generateCollectionRules, generateDownMigration, generateFieldAddition, generateFieldDefinitionObject, generateFieldDeletion, generateFieldModification, generateFieldsArray, generateIndexesArray, generateMigrationDescription, generateMigrationFilename, generatePermissionUpdate, generateTimestamp, generateUpMigration, writeMigrationFile } from './generator.cjs';
|
|
5
|
+
export { e as CollectionModification, C as CollectionSchema, b as FieldChange, F as FieldDefinition, c as FieldModification, d as PermissionChange, P as PocketBaseFieldType, R as RuleUpdate, S as SchemaDefinition, f as SchemaDiff, a as SchemaSnapshot } from '../types-BbTgmg6H.cjs';
|
|
6
|
+
export { ExtractedFieldOptions, FIELD_TYPE_INFO, FieldTypeInfo, FieldTypeResult, POCKETBASE_FIELD_TYPES, extractComprehensiveFieldOptions, extractFieldOptions, getArrayElementType, getDefaultValue, getFieldTypeInfo, getMaxSelect, getMinSelect, isArrayType, isEditorField, isFieldRequired, isFileFieldByName, isGeoPointType, isMultipleRelationField, isRelationField, isSingleRelationField, mapZodArrayType, mapZodBooleanType, mapZodDateType, mapZodEnumType, mapZodNumberType, mapZodRecordType, mapZodStringType, mapZodTypeToPocketBase, pluralize, resolveTargetCollection, singularize, toCollectionName, unwrapZodType } from './utils/index.cjs';
|
|
7
|
+
export { A as APIRuleType } from '../permissions-ZHafVSIx.cjs';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Custom error classes for migration tool
|
|
12
|
+
* Provides specific error types for better error handling and user feedback
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Base error class for all migration-related errors
|
|
16
|
+
*/
|
|
17
|
+
declare class MigrationError extends Error {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Error thrown when schema parsing fails
|
|
22
|
+
* Used when Zod schemas cannot be parsed or are invalid
|
|
23
|
+
*/
|
|
24
|
+
declare class SchemaParsingError extends MigrationError {
|
|
25
|
+
readonly filePath?: string;
|
|
26
|
+
readonly originalError?: Error;
|
|
27
|
+
constructor(message: string, filePath?: string, originalError?: Error);
|
|
28
|
+
/**
|
|
29
|
+
* Creates a formatted error message with file path and original error details
|
|
30
|
+
*/
|
|
31
|
+
getDetailedMessage(): string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when snapshot operations fail
|
|
35
|
+
* Used for snapshot file read/write/parse errors
|
|
36
|
+
*/
|
|
37
|
+
declare class SnapshotError extends MigrationError {
|
|
38
|
+
readonly snapshotPath?: string;
|
|
39
|
+
readonly operation?: "read" | "write" | "parse" | "validate";
|
|
40
|
+
readonly originalError?: Error;
|
|
41
|
+
constructor(message: string, snapshotPath?: string, operation?: "read" | "write" | "parse" | "validate", originalError?: Error);
|
|
42
|
+
/**
|
|
43
|
+
* Creates a formatted error message with snapshot path and operation details
|
|
44
|
+
*/
|
|
45
|
+
getDetailedMessage(): string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Error thrown when migration file generation fails
|
|
49
|
+
* Used when migration files cannot be created or written
|
|
50
|
+
*/
|
|
51
|
+
declare class MigrationGenerationError extends MigrationError {
|
|
52
|
+
readonly migrationPath?: string;
|
|
53
|
+
readonly originalError?: Error;
|
|
54
|
+
constructor(message: string, migrationPath?: string, originalError?: Error);
|
|
55
|
+
/**
|
|
56
|
+
* Creates a formatted error message with migration path and original error details
|
|
57
|
+
*/
|
|
58
|
+
getDetailedMessage(): string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Error thrown when file system operations fail
|
|
62
|
+
* Used for directory creation, file permissions, disk space issues
|
|
63
|
+
*/
|
|
64
|
+
declare class FileSystemError extends MigrationError {
|
|
65
|
+
readonly path?: string;
|
|
66
|
+
readonly operation?: "read" | "write" | "create" | "delete" | "access";
|
|
67
|
+
readonly code?: string;
|
|
68
|
+
readonly originalError?: Error;
|
|
69
|
+
constructor(message: string, path?: string, operation?: "read" | "write" | "create" | "delete" | "access", code?: string, originalError?: Error);
|
|
70
|
+
/**
|
|
71
|
+
* Creates a formatted error message with path, operation, and error code details
|
|
72
|
+
*/
|
|
73
|
+
getDetailedMessage(): string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Error thrown when configuration is invalid
|
|
77
|
+
* Used for configuration file parsing, validation, and path resolution errors
|
|
78
|
+
*/
|
|
79
|
+
declare class ConfigurationError extends MigrationError {
|
|
80
|
+
readonly configPath?: string;
|
|
81
|
+
readonly invalidFields?: string[];
|
|
82
|
+
readonly originalError?: Error;
|
|
83
|
+
constructor(message: string, configPath?: string, invalidFields?: string[], originalError?: Error);
|
|
84
|
+
/**
|
|
85
|
+
* Creates a formatted error message with configuration details
|
|
86
|
+
*/
|
|
87
|
+
getDetailedMessage(): string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Error thrown when CLI command usage is incorrect
|
|
91
|
+
* Used for invalid arguments, missing required options, etc.
|
|
92
|
+
*/
|
|
93
|
+
declare class CLIUsageError extends MigrationError {
|
|
94
|
+
readonly command?: string;
|
|
95
|
+
readonly suggestion?: string;
|
|
96
|
+
constructor(message: string, command?: string, suggestion?: string);
|
|
97
|
+
/**
|
|
98
|
+
* Creates a formatted error message with usage suggestions
|
|
99
|
+
*/
|
|
100
|
+
getDetailedMessage(): string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { CLIUsageError, ConfigurationError, FileSystemError, MigrationError, MigrationGenerationError, SchemaParsingError, SnapshotError };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export { SchemaAnalyzer, SchemaAnalyzerConfig, buildFieldDefinition, buildSchemaDefinition, convertZodSchemaToCollectionSchema, discoverSchemaFiles, extractFieldDefinitions, extractIndexes, extractSchemaDefinitions, getCollectionNameFromFile, importSchemaModule, isAuthCollection, parseSchemaFiles, selectSchemaForCollection } from './analyzer.js';
|
|
2
|
+
export { SnapshotConfig, SnapshotManager, convertPocketBaseMigration, findLatestSnapshot, getSnapshotPath, getSnapshotVersion, loadBaseMigration, loadSnapshot, loadSnapshotIfExists, mergeSnapshots, saveSnapshot, snapshotExists, validateSnapshot } from './snapshot.js';
|
|
3
|
+
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 './diff.js';
|
|
4
|
+
export { MigrationGenerator, MigrationGeneratorConfig, createMigrationFileStructure, generate, generateCollectionCreation, generateCollectionPermissions, generateCollectionRules, generateDownMigration, generateFieldAddition, generateFieldDefinitionObject, generateFieldDeletion, generateFieldModification, generateFieldsArray, generateIndexesArray, generateMigrationDescription, generateMigrationFilename, generatePermissionUpdate, generateTimestamp, generateUpMigration, writeMigrationFile } from './generator.js';
|
|
5
|
+
export { e as CollectionModification, C as CollectionSchema, b as FieldChange, F as FieldDefinition, c as FieldModification, d as PermissionChange, P as PocketBaseFieldType, R as RuleUpdate, S as SchemaDefinition, f as SchemaDiff, a as SchemaSnapshot } from '../types-z1Dkjg8m.js';
|
|
6
|
+
export { ExtractedFieldOptions, FIELD_TYPE_INFO, FieldTypeInfo, FieldTypeResult, POCKETBASE_FIELD_TYPES, extractComprehensiveFieldOptions, extractFieldOptions, getArrayElementType, getDefaultValue, getFieldTypeInfo, getMaxSelect, getMinSelect, isArrayType, isEditorField, isFieldRequired, isFileFieldByName, isGeoPointType, isMultipleRelationField, isRelationField, isSingleRelationField, mapZodArrayType, mapZodBooleanType, mapZodDateType, mapZodEnumType, mapZodNumberType, mapZodRecordType, mapZodStringType, mapZodTypeToPocketBase, pluralize, resolveTargetCollection, singularize, toCollectionName, unwrapZodType } from './utils/index.js';
|
|
7
|
+
export { A as APIRuleType } from '../permissions-ZHafVSIx.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Custom error classes for migration tool
|
|
12
|
+
* Provides specific error types for better error handling and user feedback
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Base error class for all migration-related errors
|
|
16
|
+
*/
|
|
17
|
+
declare class MigrationError extends Error {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Error thrown when schema parsing fails
|
|
22
|
+
* Used when Zod schemas cannot be parsed or are invalid
|
|
23
|
+
*/
|
|
24
|
+
declare class SchemaParsingError extends MigrationError {
|
|
25
|
+
readonly filePath?: string;
|
|
26
|
+
readonly originalError?: Error;
|
|
27
|
+
constructor(message: string, filePath?: string, originalError?: Error);
|
|
28
|
+
/**
|
|
29
|
+
* Creates a formatted error message with file path and original error details
|
|
30
|
+
*/
|
|
31
|
+
getDetailedMessage(): string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when snapshot operations fail
|
|
35
|
+
* Used for snapshot file read/write/parse errors
|
|
36
|
+
*/
|
|
37
|
+
declare class SnapshotError extends MigrationError {
|
|
38
|
+
readonly snapshotPath?: string;
|
|
39
|
+
readonly operation?: "read" | "write" | "parse" | "validate";
|
|
40
|
+
readonly originalError?: Error;
|
|
41
|
+
constructor(message: string, snapshotPath?: string, operation?: "read" | "write" | "parse" | "validate", originalError?: Error);
|
|
42
|
+
/**
|
|
43
|
+
* Creates a formatted error message with snapshot path and operation details
|
|
44
|
+
*/
|
|
45
|
+
getDetailedMessage(): string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Error thrown when migration file generation fails
|
|
49
|
+
* Used when migration files cannot be created or written
|
|
50
|
+
*/
|
|
51
|
+
declare class MigrationGenerationError extends MigrationError {
|
|
52
|
+
readonly migrationPath?: string;
|
|
53
|
+
readonly originalError?: Error;
|
|
54
|
+
constructor(message: string, migrationPath?: string, originalError?: Error);
|
|
55
|
+
/**
|
|
56
|
+
* Creates a formatted error message with migration path and original error details
|
|
57
|
+
*/
|
|
58
|
+
getDetailedMessage(): string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Error thrown when file system operations fail
|
|
62
|
+
* Used for directory creation, file permissions, disk space issues
|
|
63
|
+
*/
|
|
64
|
+
declare class FileSystemError extends MigrationError {
|
|
65
|
+
readonly path?: string;
|
|
66
|
+
readonly operation?: "read" | "write" | "create" | "delete" | "access";
|
|
67
|
+
readonly code?: string;
|
|
68
|
+
readonly originalError?: Error;
|
|
69
|
+
constructor(message: string, path?: string, operation?: "read" | "write" | "create" | "delete" | "access", code?: string, originalError?: Error);
|
|
70
|
+
/**
|
|
71
|
+
* Creates a formatted error message with path, operation, and error code details
|
|
72
|
+
*/
|
|
73
|
+
getDetailedMessage(): string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Error thrown when configuration is invalid
|
|
77
|
+
* Used for configuration file parsing, validation, and path resolution errors
|
|
78
|
+
*/
|
|
79
|
+
declare class ConfigurationError extends MigrationError {
|
|
80
|
+
readonly configPath?: string;
|
|
81
|
+
readonly invalidFields?: string[];
|
|
82
|
+
readonly originalError?: Error;
|
|
83
|
+
constructor(message: string, configPath?: string, invalidFields?: string[], originalError?: Error);
|
|
84
|
+
/**
|
|
85
|
+
* Creates a formatted error message with configuration details
|
|
86
|
+
*/
|
|
87
|
+
getDetailedMessage(): string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Error thrown when CLI command usage is incorrect
|
|
91
|
+
* Used for invalid arguments, missing required options, etc.
|
|
92
|
+
*/
|
|
93
|
+
declare class CLIUsageError extends MigrationError {
|
|
94
|
+
readonly command?: string;
|
|
95
|
+
readonly suggestion?: string;
|
|
96
|
+
constructor(message: string, command?: string, suggestion?: string);
|
|
97
|
+
/**
|
|
98
|
+
* Creates a formatted error message with usage suggestions
|
|
99
|
+
*/
|
|
100
|
+
getDetailedMessage(): string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { CLIUsageError, ConfigurationError, FileSystemError, MigrationError, MigrationGenerationError, SchemaParsingError, SnapshotError };
|