@breadstone-infrastructure/prisma-seeds 0.0.231
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 +9 -0
- package/LICENSE +21 -0
- package/README.md +284 -0
- package/ai/AISeedGenerator.d.ts +127 -0
- package/ai/AISeedGenerator.d.ts.map +1 -0
- package/ai/AISeedGenerator.js +438 -0
- package/ai/AISeedGenerator.js.map +1 -0
- package/ai/AISeedTypes.d.ts +138 -0
- package/ai/AISeedTypes.d.ts.map +1 -0
- package/ai/AISeedTypes.js +3 -0
- package/ai/AISeedTypes.js.map +1 -0
- package/ai/PrismaModelAnalyzer.d.ts +36 -0
- package/ai/PrismaModelAnalyzer.d.ts.map +1 -0
- package/ai/PrismaModelAnalyzer.js +110 -0
- package/ai/PrismaModelAnalyzer.js.map +1 -0
- package/ai/PrismaTypeSchemaGenerator.d.ts +38 -0
- package/ai/PrismaTypeSchemaGenerator.d.ts.map +1 -0
- package/ai/PrismaTypeSchemaGenerator.js +71 -0
- package/ai/PrismaTypeSchemaGenerator.js.map +1 -0
- package/ai/createAISeeder.d.ts +11 -0
- package/ai/createAISeeder.d.ts.map +1 -0
- package/ai/createAISeeder.js +72 -0
- package/ai/createAISeeder.js.map +1 -0
- package/ai/index.d.ts +6 -0
- package/ai/index.d.ts.map +1 -0
- package/ai/index.js +5 -0
- package/ai/index.js.map +1 -0
- package/assets/AssetManager.d.ts +213 -0
- package/assets/AssetManager.d.ts.map +1 -0
- package/assets/AssetManager.js +460 -0
- package/assets/AssetManager.js.map +1 -0
- package/assets/IImageTransformOptions.d.ts +42 -0
- package/assets/IImageTransformOptions.d.ts.map +1 -0
- package/assets/IImageTransformOptions.js +22 -0
- package/assets/IImageTransformOptions.js.map +1 -0
- package/assets/adapters/BlobAdapterFactory.d.ts +21 -0
- package/assets/adapters/BlobAdapterFactory.d.ts.map +1 -0
- package/assets/adapters/BlobAdapterFactory.js +3 -0
- package/assets/adapters/BlobAdapterFactory.js.map +1 -0
- package/assets/adapters/CloudflareR2BlobAdapter.d.ts +97 -0
- package/assets/adapters/CloudflareR2BlobAdapter.d.ts.map +1 -0
- package/assets/adapters/CloudflareR2BlobAdapter.js +265 -0
- package/assets/adapters/CloudflareR2BlobAdapter.js.map +1 -0
- package/assets/adapters/EmptyBlobAdapter.d.ts +42 -0
- package/assets/adapters/EmptyBlobAdapter.d.ts.map +1 -0
- package/assets/adapters/EmptyBlobAdapter.js +65 -0
- package/assets/adapters/EmptyBlobAdapter.js.map +1 -0
- package/assets/adapters/LocalFileAdapter.d.ts +34 -0
- package/assets/adapters/LocalFileAdapter.d.ts.map +1 -0
- package/assets/adapters/LocalFileAdapter.js +74 -0
- package/assets/adapters/LocalFileAdapter.js.map +1 -0
- package/assets/adapters/VercelBlobAdapter.d.ts +73 -0
- package/assets/adapters/VercelBlobAdapter.d.ts.map +1 -0
- package/assets/adapters/VercelBlobAdapter.js +168 -0
- package/assets/adapters/VercelBlobAdapter.js.map +1 -0
- package/assets/adapters/abstracts/BlobAdapterBase.d.ts +62 -0
- package/assets/adapters/abstracts/BlobAdapterBase.d.ts.map +1 -0
- package/assets/adapters/abstracts/BlobAdapterBase.js +58 -0
- package/assets/adapters/abstracts/BlobAdapterBase.js.map +1 -0
- package/assets/adapters/abstracts/HttpBlobAdapterBase.d.ts +43 -0
- package/assets/adapters/abstracts/HttpBlobAdapterBase.d.ts.map +1 -0
- package/assets/adapters/abstracts/HttpBlobAdapterBase.js +88 -0
- package/assets/adapters/abstracts/HttpBlobAdapterBase.js.map +1 -0
- package/assets/adapters/createBlobAdapter.d.ts +47 -0
- package/assets/adapters/createBlobAdapter.d.ts.map +1 -0
- package/assets/adapters/createBlobAdapter.js +63 -0
- package/assets/adapters/createBlobAdapter.js.map +1 -0
- package/assets/adapters/index.d.ts +11 -0
- package/assets/adapters/index.d.ts.map +1 -0
- package/assets/adapters/index.js +7 -0
- package/assets/adapters/index.js.map +1 -0
- package/assets/adapters/interfaces/IBlobAdapter.d.ts +41 -0
- package/assets/adapters/interfaces/IBlobAdapter.d.ts.map +1 -0
- package/assets/adapters/interfaces/IBlobAdapter.js +3 -0
- package/assets/adapters/interfaces/IBlobAdapter.js.map +1 -0
- package/assets/adapters/interfaces/IBlobAdapterConfig.d.ts +16 -0
- package/assets/adapters/interfaces/IBlobAdapterConfig.d.ts.map +1 -0
- package/assets/adapters/interfaces/IBlobAdapterConfig.js +2 -0
- package/assets/adapters/interfaces/IBlobAdapterConfig.js.map +1 -0
- package/assets/adapters/interfaces/IBlobUploadResult.d.ts +24 -0
- package/assets/adapters/interfaces/IBlobUploadResult.d.ts.map +1 -0
- package/assets/adapters/interfaces/IBlobUploadResult.js +2 -0
- package/assets/adapters/interfaces/IBlobUploadResult.js.map +1 -0
- package/base/BaseSeeder.d.ts +21 -0
- package/base/BaseSeeder.d.ts.map +1 -0
- package/base/BaseSeeder.js +45 -0
- package/base/BaseSeeder.js.map +1 -0
- package/base/functionalSeeder.d.ts +31 -0
- package/base/functionalSeeder.d.ts.map +1 -0
- package/base/functionalSeeder.js +33 -0
- package/base/functionalSeeder.js.map +1 -0
- package/cli/Cli.d.ts +2 -0
- package/cli/Cli.d.ts.map +1 -0
- package/cli/Cli.js +32 -0
- package/cli/Cli.js.map +1 -0
- package/cli/CliArgs.d.ts +2 -0
- package/cli/CliArgs.d.ts.map +1 -0
- package/cli/CliArgs.js +133 -0
- package/cli/CliArgs.js.map +1 -0
- package/cli/CliArgsConfig.d.ts +2 -0
- package/cli/CliArgsConfig.d.ts.map +1 -0
- package/cli/CliArgsConfig.js +15 -0
- package/cli/CliArgsConfig.js.map +1 -0
- package/cli/CliRun.d.ts +2 -0
- package/cli/CliRun.d.ts.map +1 -0
- package/cli/CliRun.js +34 -0
- package/cli/CliRun.js.map +1 -0
- package/cli/commands/SeedCommand.d.ts +2 -0
- package/cli/commands/SeedCommand.d.ts.map +1 -0
- package/cli/commands/SeedCommand.js +73 -0
- package/cli/commands/SeedCommand.js.map +1 -0
- package/cli/commands/SeedCommandArgsConfig.d.ts +2 -0
- package/cli/commands/SeedCommandArgsConfig.d.ts.map +1 -0
- package/cli/commands/SeedCommandArgsConfig.js +31 -0
- package/cli/commands/SeedCommandArgsConfig.js.map +1 -0
- package/cli/seed.d.ts +2 -0
- package/cli/seed.d.ts.map +1 -0
- package/cli/seed.js +42 -0
- package/cli/seed.js.map +1 -0
- package/config/IAssetConfig.d.ts +36 -0
- package/config/IAssetConfig.d.ts.map +1 -0
- package/config/IAssetConfig.js +3 -0
- package/config/IAssetConfig.js.map +1 -0
- package/config/IComposedSeedConfig.d.ts +32 -0
- package/config/IComposedSeedConfig.d.ts.map +1 -0
- package/config/IComposedSeedConfig.js +3 -0
- package/config/IComposedSeedConfig.js.map +1 -0
- package/config/ISeedConfig.d.ts +75 -0
- package/config/ISeedConfig.d.ts.map +1 -0
- package/config/ISeedConfig.js +3 -0
- package/config/ISeedConfig.js.map +1 -0
- package/config/ISeedContext.d.ts +92 -0
- package/config/ISeedContext.d.ts.map +1 -0
- package/config/ISeedContext.js +3 -0
- package/config/ISeedContext.js.map +1 -0
- package/config/ISeedDefinition.d.ts +38 -0
- package/config/ISeedDefinition.d.ts.map +1 -0
- package/config/ISeedDefinition.js +3 -0
- package/config/ISeedDefinition.js.map +1 -0
- package/config/ISeedFactory.d.ts +15 -0
- package/config/ISeedFactory.d.ts.map +1 -0
- package/config/ISeedFactory.js +3 -0
- package/config/ISeedFactory.js.map +1 -0
- package/config/ISeedOptions.d.ts +44 -0
- package/config/ISeedOptions.d.ts.map +1 -0
- package/config/ISeedOptions.js +2 -0
- package/config/ISeedOptions.js.map +1 -0
- package/config/ISeedResult.d.ts +44 -0
- package/config/ISeedResult.d.ts.map +1 -0
- package/config/ISeedResult.js +2 -0
- package/config/ISeedResult.js.map +1 -0
- package/config/ISeeder.d.ts +37 -0
- package/config/ISeeder.d.ts.map +1 -0
- package/config/ISeeder.js +3 -0
- package/config/ISeeder.js.map +1 -0
- package/config/createAdapter.d.ts +13 -0
- package/config/createAdapter.d.ts.map +1 -0
- package/config/createAdapter.js +16 -0
- package/config/createAdapter.js.map +1 -0
- package/config/createSeed.d.ts +6 -0
- package/config/createSeed.d.ts.map +1 -0
- package/config/createSeed.js +16 -0
- package/config/createSeed.js.map +1 -0
- package/config/defineConfig.d.ts +27 -0
- package/config/defineConfig.d.ts.map +1 -0
- package/config/defineConfig.js +35 -0
- package/config/defineConfig.js.map +1 -0
- package/discovery/SeedConfigDiscovery.d.ts +16 -0
- package/discovery/SeedConfigDiscovery.d.ts.map +1 -0
- package/discovery/SeedConfigDiscovery.js +137 -0
- package/discovery/SeedConfigDiscovery.js.map +1 -0
- package/index.d.ts +32 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/json/JsonReferenceResolver.d.ts +23 -0
- package/json/JsonReferenceResolver.d.ts.map +1 -0
- package/json/JsonReferenceResolver.js +99 -0
- package/json/JsonReferenceResolver.js.map +1 -0
- package/json/JsonSchemaValidator.d.ts +23 -0
- package/json/JsonSchemaValidator.d.ts.map +1 -0
- package/json/JsonSchemaValidator.js +98 -0
- package/json/JsonSchemaValidator.js.map +1 -0
- package/json/JsonSeedLoader.d.ts +33 -0
- package/json/JsonSeedLoader.d.ts.map +1 -0
- package/json/JsonSeedLoader.js +176 -0
- package/json/JsonSeedLoader.js.map +1 -0
- package/json/JsonSeedTypes.d.ts +204 -0
- package/json/JsonSeedTypes.d.ts.map +1 -0
- package/json/JsonSeedTypes.js +3 -0
- package/json/JsonSeedTypes.js.map +1 -0
- package/json/createJsonSeeder.d.ts +13 -0
- package/json/createJsonSeeder.d.ts.map +1 -0
- package/json/createJsonSeeder.js +240 -0
- package/json/createJsonSeeder.js.map +1 -0
- package/json/index.d.ts +6 -0
- package/json/index.d.ts.map +1 -0
- package/json/index.js +7 -0
- package/json/index.js.map +1 -0
- package/logging/ISeedLogger.d.ts +55 -0
- package/logging/ISeedLogger.d.ts.map +1 -0
- package/logging/ISeedLogger.js +3 -0
- package/logging/ISeedLogger.js.map +1 -0
- package/logging/LogLevel.d.ts +30 -0
- package/logging/LogLevel.d.ts.map +1 -0
- package/logging/LogLevel.js +37 -0
- package/logging/LogLevel.js.map +1 -0
- package/logging/SeedLogger.d.ts +24 -0
- package/logging/SeedLogger.d.ts.map +1 -0
- package/logging/SeedLogger.js +94 -0
- package/logging/SeedLogger.js.map +1 -0
- package/orchestration/SeedOrchestrator.d.ts +30 -0
- package/orchestration/SeedOrchestrator.d.ts.map +1 -0
- package/orchestration/SeedOrchestrator.js +262 -0
- package/orchestration/SeedOrchestrator.js.map +1 -0
- package/package.json +27 -0
- package/resolvers/EntityResolver.d.ts +43 -0
- package/resolvers/EntityResolver.d.ts.map +1 -0
- package/resolvers/EntityResolver.js +95 -0
- package/resolvers/EntityResolver.js.map +1 -0
- package/utils/AssetReferenceResolver.d.ts +49 -0
- package/utils/AssetReferenceResolver.d.ts.map +1 -0
- package/utils/AssetReferenceResolver.js +62 -0
- package/utils/AssetReferenceResolver.js.map +1 -0
- package/utils/EntityLookupCache.d.ts +47 -0
- package/utils/EntityLookupCache.d.ts.map +1 -0
- package/utils/EntityLookupCache.js +64 -0
- package/utils/EntityLookupCache.js.map +1 -0
- package/utils/ISeedRandom.d.ts +70 -0
- package/utils/ISeedRandom.d.ts.map +1 -0
- package/utils/ISeedRandom.js +3 -0
- package/utils/ISeedRandom.js.map +1 -0
- package/utils/LocalizationToolkit.d.ts +125 -0
- package/utils/LocalizationToolkit.d.ts.map +1 -0
- package/utils/LocalizationToolkit.js +131 -0
- package/utils/LocalizationToolkit.js.map +1 -0
- package/utils/SeededRandom.d.ts +15 -0
- package/utils/SeededRandom.d.ts.map +1 -0
- package/utils/SeededRandom.js +56 -0
- package/utils/SeededRandom.js.map +1 -0
- package/utils/StringArrayToolkit.d.ts +25 -0
- package/utils/StringArrayToolkit.d.ts.map +1 -0
- package/utils/StringArrayToolkit.js +56 -0
- package/utils/StringArrayToolkit.js.map +1 -0
- package/utils/StringValueGuard.d.ts +24 -0
- package/utils/StringValueGuard.d.ts.map +1 -0
- package/utils/StringValueGuard.js +46 -0
- package/utils/StringValueGuard.js.map +1 -0
- package/utils/WarningCollector.d.ts +40 -0
- package/utils/WarningCollector.d.ts.map +1 -0
- package/utils/WarningCollector.js +83 -0
- package/utils/WarningCollector.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeedCommandArgsConfig.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/SeedCommandArgsConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// #region Imports
|
|
2
|
+
import { DEFAULT_CLI_ARGS_CONFIG } from '../CliArgsConfig.js';
|
|
3
|
+
/**
|
|
4
|
+
* @description Default seed command argument values.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_SEED_COMMAND_ARGS_CONFIG = {
|
|
8
|
+
...DEFAULT_CLI_ARGS_CONFIG,
|
|
9
|
+
searchPaths: ['libs/**', 'apps/**'],
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @description Argument to override the search paths for seed config discovery.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export const SEARCH_PATHS_ARG = {
|
|
16
|
+
alias: ['-p', '--search-paths'],
|
|
17
|
+
options: {
|
|
18
|
+
required: false,
|
|
19
|
+
default: DEFAULT_SEED_COMMAND_ARGS_CONFIG.searchPaths.join(','),
|
|
20
|
+
metavar: 'string',
|
|
21
|
+
help: 'Comma-separated search paths for seed config discovery.',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @description All seed command specific arguments.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export const SEED_COMMAND_ARGS = [
|
|
29
|
+
SEARCH_PATHS_ARG,
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=SeedCommandArgsConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeedCommandArgsConfig.js","sourceRoot":"","sources":["../../../src/cli/commands/SeedCommandArgsConfig.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAGlB,OAAO,EAAE,uBAAuB,EAAuB,MAAM,qBAAqB,CAAC;AAuBnF;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAA2B;IACpE,GAAG,uBAAuB;IAC1B,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IACzC,KAAK,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAC/B,OAAO,EAAE;QACL,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,gCAAgC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/D,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,yDAAyD;KAClE;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAuB;IACjD,gBAAgB;CACnB,CAAC"}
|
package/cli/seed.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/cli/seed.ts"],"names":[],"mappings":""}
|
package/cli/seed.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// #region Imports
|
|
2
|
+
import { SeedLogger } from '../logging/SeedLogger.js';
|
|
3
|
+
import { SeedOrchestrator } from '../orchestration/SeedOrchestrator.js';
|
|
4
|
+
// #endregion
|
|
5
|
+
async function main() {
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const logger = new SeedLogger();
|
|
8
|
+
// Parse command line arguments
|
|
9
|
+
const options = {
|
|
10
|
+
drop: args.includes('--drop') || process.env['SEED_DROP'] === 'true',
|
|
11
|
+
count: args.includes('--count')
|
|
12
|
+
? parseInt(args[args.indexOf('--count') + 1] || '5')
|
|
13
|
+
: parseInt(process.env['SEED_COUNT'] || '5'),
|
|
14
|
+
force: args.includes('--force'),
|
|
15
|
+
dryRun: args.includes('--dry-run'),
|
|
16
|
+
seed: args.includes('--seed')
|
|
17
|
+
? parseInt(args[args.indexOf('--seed') + 1] || String(Date.now()))
|
|
18
|
+
: Date.now(),
|
|
19
|
+
environment: process.env['NODE_ENV'] || 'development'
|
|
20
|
+
};
|
|
21
|
+
const orchestrator = new SeedOrchestrator();
|
|
22
|
+
try {
|
|
23
|
+
const result = await orchestrator.execute(process.cwd(), options);
|
|
24
|
+
if (result.success) {
|
|
25
|
+
logger.log('✅ Seeding completed successfully!');
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
logger.error('❌ Seeding failed with errors:');
|
|
30
|
+
for (const error of result.errors) {
|
|
31
|
+
logger.error(` ${error}`);
|
|
32
|
+
}
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
logger.error(`💥 Fatal error: ${error}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
main();
|
|
42
|
+
//# sourceMappingURL=seed.js.map
|
package/cli/seed.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/cli/seed.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,aAAa;AAEb,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEhC,+BAA+B;IAC/B,MAAM,OAAO,GAAG;QACZ,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,MAAM;QACpE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3B,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC;YACpD,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC;QAChD,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QAClC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACzB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAClE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAChB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,aAAa;KACxD,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAE5C,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;QAElE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC9C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAChC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BlobAdapterConfiguration } from '../assets/adapters/BlobAdapterFactory.js';
|
|
2
|
+
import type { IAssetImageTransformConfiguration } from '../assets/AssetManager.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for asset management in seed operations.
|
|
5
|
+
* Completely standalone - no backend dependencies.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface IAssetConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Whether asset management is enabled
|
|
12
|
+
*/
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Base directory containing seed assets (defaults to `.seed/assets`)
|
|
16
|
+
*/
|
|
17
|
+
assetsDir?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to upload assets to blob storage during seeding
|
|
20
|
+
*/
|
|
21
|
+
uploadToBlob?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Blob adapter configuration
|
|
24
|
+
*/
|
|
25
|
+
blobAdapter?: BlobAdapterConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* File mappings for automatic asset upload
|
|
28
|
+
* Key: asset key for retrieval, Value: file path or directory
|
|
29
|
+
*/
|
|
30
|
+
files?: Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional image transformation rules applied before uploading assets.
|
|
33
|
+
*/
|
|
34
|
+
imageTransforms?: IAssetImageTransformConfiguration;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=IAssetConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAssetConfig.d.ts","sourceRoot":"","sources":["../../src/config/IAssetConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAInF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,wBAAwB,CAAC;IAEvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/B;;OAEG;IACH,eAAe,CAAC,EAAE,iCAAiC,CAAC;CAEvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAssetConfig.js","sourceRoot":"","sources":["../../src/config/IAssetConfig.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ISeedConfig } from './ISeedConfig';
|
|
2
|
+
import { ISeedDefinition } from './ISeedDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration representing a composed seed setup with root and feature configs.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IComposedSeedConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The root seed configuration.
|
|
11
|
+
*
|
|
12
|
+
* @readonly
|
|
13
|
+
*/
|
|
14
|
+
readonly rootConfig: ISeedConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The feature seed configurations.
|
|
17
|
+
*
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
readonly featureConfigs: ISeedConfig[];
|
|
21
|
+
/**
|
|
22
|
+
* The resolved seed definitions and their execution order.
|
|
23
|
+
*
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
readonly resolved: {
|
|
27
|
+
readonly seeds: ISeedDefinition[];
|
|
28
|
+
readonly executionOrder: string[];
|
|
29
|
+
readonly logLevel?: import('../logging/LogLevel.js').LogLevel;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=IComposedSeedConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IComposedSeedConfig.d.ts","sourceRoot":"","sources":["../../src/config/IComposedSeedConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAIhC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACf,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;QAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;QAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,wBAAwB,EAAE,QAAQ,CAAC;KACjE,CAAC;CAIL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IComposedSeedConfig.js","sourceRoot":"","sources":["../../src/config/IComposedSeedConfig.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { IAISeedConfig } from '../ai';
|
|
2
|
+
import type { IAssetConfig } from './IAssetConfig.js';
|
|
3
|
+
import { ISeedDefinition } from './ISeedDefinition';
|
|
4
|
+
import type { ISeedOptions } from './ISeedOptions.js';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for a seeding operation, including seed definitions and execution order.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface ISeedConfig {
|
|
11
|
+
/**
|
|
12
|
+
* The name of the seed configuration.
|
|
13
|
+
*
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/**
|
|
18
|
+
* The absolute path to the config file (set during discovery).
|
|
19
|
+
*
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
readonly configPath?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the seed configuration is enabled.
|
|
25
|
+
*
|
|
26
|
+
* @readonly
|
|
27
|
+
*/
|
|
28
|
+
readonly enabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The order in which the seeds should be executed.
|
|
31
|
+
*
|
|
32
|
+
* @readonly
|
|
33
|
+
*/
|
|
34
|
+
readonly order?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The names of other seed configurations that this one depends on.
|
|
37
|
+
*
|
|
38
|
+
* @readonly
|
|
39
|
+
*/
|
|
40
|
+
readonly dependencies?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* The seed definitions included in this configuration.
|
|
43
|
+
*
|
|
44
|
+
* @readonly
|
|
45
|
+
*/
|
|
46
|
+
readonly seeds: ISeedDefinition[];
|
|
47
|
+
/**
|
|
48
|
+
* Optional AI configuration for intelligent seed generation.
|
|
49
|
+
*
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
readonly ai?: IAISeedConfig;
|
|
53
|
+
/**
|
|
54
|
+
* Optional asset management configuration for blob storage.
|
|
55
|
+
*
|
|
56
|
+
* @readonly
|
|
57
|
+
*/
|
|
58
|
+
readonly assets?: IAssetConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Log level for this seed configuration.
|
|
61
|
+
* Controls which log messages are displayed.
|
|
62
|
+
* Default: 'info'
|
|
63
|
+
*
|
|
64
|
+
* @readonly
|
|
65
|
+
*/
|
|
66
|
+
readonly logLevel?: import('../logging/LogLevel.js').LogLevel;
|
|
67
|
+
/**
|
|
68
|
+
* Default runtime options for seeding.
|
|
69
|
+
* These can be overridden by the NX executor or CLI options.
|
|
70
|
+
*
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
readonly options?: ISeedOptions;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=ISeedConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedConfig.d.ts","sourceRoot":"","sources":["../../src/config/ISeedConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAIxB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;IAElC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAE/B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,wBAAwB,EAAE,QAAQ,CAAC;IAE9D;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CAInC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedConfig.js","sourceRoot":"","sources":["../../src/config/ISeedConfig.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { PrismaClient } from '@prisma/client';
|
|
2
|
+
import { AssetManager } from '../assets/AssetManager';
|
|
3
|
+
import { ISeedRandom } from '../utils/ISeedRandom';
|
|
4
|
+
import { ISeedLogger } from '../logging/ISeedLogger';
|
|
5
|
+
import { ISeedOptions } from './ISeedOptions';
|
|
6
|
+
import { EntityResolver } from '../resolvers/EntityResolver';
|
|
7
|
+
/**
|
|
8
|
+
* Context provided to seeders during execution, including Prisma client and utilities.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ISeedContext {
|
|
13
|
+
/**
|
|
14
|
+
* The Prisma client instance for database operations.
|
|
15
|
+
*
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
18
|
+
readonly prisma: PrismaClient;
|
|
19
|
+
/**
|
|
20
|
+
* Options for the seeding operation.
|
|
21
|
+
*
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
readonly options: ISeedOptions;
|
|
25
|
+
/**
|
|
26
|
+
* Logger for seeding operations.
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
readonly logger: ISeedLogger;
|
|
31
|
+
/**
|
|
32
|
+
* Random data generator for seeding operations.
|
|
33
|
+
*
|
|
34
|
+
* @readonly
|
|
35
|
+
*/
|
|
36
|
+
readonly random: ISeedRandom;
|
|
37
|
+
/**
|
|
38
|
+
* Asset manager for handling file uploads and asset discovery.
|
|
39
|
+
*
|
|
40
|
+
* @readonly
|
|
41
|
+
*/
|
|
42
|
+
readonly assets: AssetManager;
|
|
43
|
+
/**
|
|
44
|
+
* Absolute path to the seed configuration file currently executing.
|
|
45
|
+
*
|
|
46
|
+
* @readonly
|
|
47
|
+
*/
|
|
48
|
+
readonly seedConfigPath?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Warning collector for aggregating and summarizing warnings.
|
|
51
|
+
*
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
54
|
+
readonly warnings?: import('../utils/WarningCollector.js').WarningCollector;
|
|
55
|
+
/**
|
|
56
|
+
* Create a cached entity resolver for efficient ID lookups.
|
|
57
|
+
*
|
|
58
|
+
* @param modelName - Prisma model name (e.g., 'exerciseCategory')
|
|
59
|
+
* @param uniqueField - Field name to use as lookup key (e.g., 'key', 'name')
|
|
60
|
+
* @returns EntityResolver instance with automatic caching
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const categoryId = await ctx.entity('exerciseCategory', 'key').resolve(data.categoryKey);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
entity<TResult = string>(modelName: string, uniqueField: string): EntityResolver<string, TResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Create a cached entity resolver for batch ID lookups.
|
|
70
|
+
*
|
|
71
|
+
* @param modelName - Prisma model name
|
|
72
|
+
* @param uniqueField - Field name to use as lookup key
|
|
73
|
+
* @returns EntityResolver instance optimized for batch resolution
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const muscleIds = await ctx.manyEntity('muscleGroup', 'name').resolveMany(data.muscles);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
manyEntity<TResult = string>(modelName: string, uniqueField: string): EntityResolver<string, TResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Localization helpers (direct passthrough to LocalizationToolkit).
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const name = ctx.localize.resolvePrimary(data.name, ['en']);
|
|
87
|
+
* const nameGroup = ctx.localize.createGroup(data.name, { fieldName: 'Exercise name', fallbackLocales: ['en'] });
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
readonly localize: any;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=ISeedContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedContext.d.ts","sourceRoot":"","sources":["../../src/config/ISeedContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAIzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,8BAA8B,EAAE,gBAAgB,CAAC;IAM5E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAO,GAAG,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACpB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,OAAO,GAAG,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACpB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;CAI1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedContext.js","sourceRoot":"","sources":["../../src/config/ISeedContext.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ISeedFactory } from './ISeedFactory';
|
|
2
|
+
/**
|
|
3
|
+
* Definition of a single seed, including its factory and options.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface ISeedDefinition {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the seed.
|
|
10
|
+
*
|
|
11
|
+
* @readonly
|
|
12
|
+
*/
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the seed is enabled.
|
|
16
|
+
*
|
|
17
|
+
* @readonly
|
|
18
|
+
*/
|
|
19
|
+
readonly enabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The factory used to create the seed.
|
|
22
|
+
*
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
readonly factory: ISeedFactory;
|
|
26
|
+
/**
|
|
27
|
+
* Options for the seed.
|
|
28
|
+
*
|
|
29
|
+
* @readonly
|
|
30
|
+
*/
|
|
31
|
+
readonly options?: Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Absolute path to the seed configuration file that declared this seed.
|
|
34
|
+
* Populated automatically during discovery.
|
|
35
|
+
*/
|
|
36
|
+
readonly configPath?: string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ISeedDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedDefinition.d.ts","sourceRoot":"","sources":["../../src/config/ISeedDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAI5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAIhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedDefinition.js","sourceRoot":"","sources":["../../src/config/ISeedDefinition.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ISeeder } from './ISeeder';
|
|
2
|
+
/**
|
|
3
|
+
* Factory interface for creating seeder instances.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface ISeedFactory {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new seeder instance.
|
|
10
|
+
*
|
|
11
|
+
* @returns A new seeder instance.
|
|
12
|
+
*/
|
|
13
|
+
readonly create: () => ISeeder;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ISeedFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedFactory.d.ts","sourceRoot":"","sources":["../../src/config/ISeedFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAIzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC;CAIlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedFactory.js","sourceRoot":"","sources":["../../src/config/ISeedFactory.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for controlling seeding behavior.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface ISeedOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to drop existing data before seeding.
|
|
9
|
+
*
|
|
10
|
+
* @readonly
|
|
11
|
+
*/
|
|
12
|
+
readonly drop?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The number of items to seed.
|
|
15
|
+
*
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
18
|
+
readonly count?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to force the seeding operation.
|
|
21
|
+
*
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
readonly force?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to run the seeding operation in dry run mode.
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
readonly dryRun?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The seed value to use.
|
|
33
|
+
*
|
|
34
|
+
* @readonly
|
|
35
|
+
*/
|
|
36
|
+
readonly seed?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The environment to use for seeding.
|
|
39
|
+
*
|
|
40
|
+
* @readonly
|
|
41
|
+
*/
|
|
42
|
+
readonly environment?: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ISeedOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedOptions.d.ts","sourceRoot":"","sources":["../../src/config/ISeedOptions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAIzB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAIjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedOptions.js","sourceRoot":"","sources":["../../src/config/ISeedOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result returned by a seeding operation, including success status and metadata.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface ISeedResult {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the seeding operation was successful.
|
|
9
|
+
*
|
|
10
|
+
* @readonly
|
|
11
|
+
*/
|
|
12
|
+
readonly success: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The number of items created during the seeding operation.
|
|
15
|
+
*
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
18
|
+
readonly itemsCreated: number;
|
|
19
|
+
/**
|
|
20
|
+
* The duration of the seeding operation in milliseconds.
|
|
21
|
+
*
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
readonly duration: number;
|
|
25
|
+
/**
|
|
26
|
+
* Any errors encountered during the seeding operation.
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
readonly errors: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Any warnings encountered during the seeding operation.
|
|
33
|
+
*
|
|
34
|
+
* @readonly
|
|
35
|
+
*/
|
|
36
|
+
readonly warnings: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Metadata about the seeding operation.
|
|
39
|
+
*
|
|
40
|
+
* @readonly
|
|
41
|
+
*/
|
|
42
|
+
readonly metadata?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ISeedResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedResult.d.ts","sourceRoot":"","sources":["../../src/config/ISeedResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAIxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAI/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeedResult.js","sourceRoot":"","sources":["../../src/config/ISeedResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ISeedResult } from './ISeedResult';
|
|
2
|
+
import { ISeedContext } from './ISeedContext';
|
|
3
|
+
/**
|
|
4
|
+
* Seeder interface defining the contract for all seeders.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ISeeder {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the seeder.
|
|
11
|
+
*
|
|
12
|
+
* @readonly
|
|
13
|
+
*/
|
|
14
|
+
readonly name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Execute the seeding operation.
|
|
17
|
+
*
|
|
18
|
+
* @param context The seed context providing necessary services and options.
|
|
19
|
+
* @returns A promise that resolves to the result of the seeding operation.
|
|
20
|
+
*/
|
|
21
|
+
seed(context: ISeedContext): Promise<ISeedResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Validate the seeding operation.
|
|
24
|
+
*
|
|
25
|
+
* @param context The seed context providing necessary services and options.
|
|
26
|
+
* @returns A promise that resolves to a boolean indicating whether the seeding operation is valid.
|
|
27
|
+
*/
|
|
28
|
+
validate?(context: ISeedContext): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Cleanup after the seeding operation.
|
|
31
|
+
*
|
|
32
|
+
* @param context The seed context providing necessary services and options.
|
|
33
|
+
* @returns A promise that resolves when the cleanup is complete.
|
|
34
|
+
*/
|
|
35
|
+
cleanup?(context: ISeedContext): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ISeeder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeeder.d.ts","sourceRoot":"","sources":["../../src/config/ISeeder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;GAIG;AACH,MAAM,WAAW,OAAO;IAIpB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAMtB;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAElD;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAIlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISeeder.js","sourceRoot":"","sources":["../../src/config/ISeeder.ts"],"names":[],"mappings":"AAAA,mCAAmC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IBlobAdapter } from '../assets/adapters/interfaces/IBlobAdapter.js';
|
|
2
|
+
import { BlobAdapterType } from '../assets/adapters/createBlobAdapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* Factory function to create a blob adapter based on type and configuration.
|
|
5
|
+
*
|
|
6
|
+
* @param type The type of blob adapter to create.
|
|
7
|
+
* @param config The configuration object for the adapter.
|
|
8
|
+
* @returns An instance of the requested blob adapter.
|
|
9
|
+
* @throws Error if the adapter type is unsupported.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare function createAdapter(type: BlobAdapterType, config?: any): IBlobAdapter;
|
|
13
|
+
//# sourceMappingURL=createAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAdapter.d.ts","sourceRoot":"","sources":["../../src/config/createAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAqB,MAAM,yCAAyC,CAAC;AAI7F;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,YAAY,CAE/E"}
|