@etohq/eto 1.3.0 → 1.5.0
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/LICENSE +21 -0
- package/dist/commands/migrate/encore-generate.d.ts +8 -0
- package/dist/commands/migrate/encore-generate.d.ts.map +1 -0
- package/dist/commands/migrate/encore-generate.js +231 -0
- package/dist/commands/migrate/encore-generate.js.map +1 -0
- package/dist/commands/migrate/generate.d.ts +4 -6
- package/dist/commands/migrate/generate.d.ts.map +1 -1
- package/dist/commands/migrate/generate.js +15 -13
- package/dist/commands/migrate/generate.js.map +1 -1
- package/dist/commands/migrate/run-scripts.d.ts +16 -0
- package/dist/commands/migrate/run-scripts.d.ts.map +1 -0
- package/dist/commands/migrate/run-scripts.js +96 -0
- package/dist/commands/migrate/run-scripts.js.map +1 -0
- package/dist/commands/migrate/sync-links-migration.d.ts +2 -2
- package/dist/commands/migrate/sync-links-migration.d.ts.map +1 -1
- package/dist/commands/migrate/sync-links-migration.js +10 -6
- package/dist/commands/migrate/sync-links-migration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/middlewares/authenticate-middleware.d.ts.map +1 -1
- package/package.json +53 -51
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Etohq
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encore-generate.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/encore-generate.ts"],"names":[],"mappings":"AAuNA,OAAO,EAAE,GAAG,EAAqC,MAAM,kBAAkB,CAAA;AAQzE,QAAA,MAAM,IAAI,GAAmB,mCAI1B;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,GAAG,CAAA;IACR,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB,mBA4DA,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// public static async migrateGenerate(
|
|
3
|
+
// serviceName: string,
|
|
4
|
+
// migrationDescription: string,
|
|
5
|
+
// serviceInitPath: string,
|
|
6
|
+
// config: ConfigModule,
|
|
7
|
+
// modulesDefinition: ModuleDefinition
|
|
8
|
+
// ) {
|
|
9
|
+
// console.log("Starting EtoEncoreApp.migrateGenerate...")
|
|
10
|
+
// console.log(`Service Name: ${serviceName}`)
|
|
11
|
+
// console.log(`Migration Description: ${migrationDescription}`)
|
|
12
|
+
// console.log(`Service Init Path: ${serviceInitPath}`)
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
// try {
|
|
15
|
+
// const shadowDbUrlsMap = new Map<string, string>()
|
|
16
|
+
// // Helper to get or fetch a shadow DB URI for a given DB URL
|
|
17
|
+
// async function getOrFetchShadowDbUrl(dbUrl: string): Promise<string> {
|
|
18
|
+
// const dbName = new URL(dbUrl).pathname.substring(1)
|
|
19
|
+
// if (shadowDbUrlsMap.has(dbName)) {
|
|
20
|
+
// return shadowDbUrlsMap.get(dbName)!
|
|
21
|
+
// }
|
|
22
|
+
// console.log(`Processing database: ${dbName}`)
|
|
23
|
+
// const { stdout: shadowDbUrl } = await execa("encore", [
|
|
24
|
+
// "db",
|
|
25
|
+
// "conn-uri",
|
|
26
|
+
// dbName,
|
|
27
|
+
// "--shadow",
|
|
28
|
+
// ])
|
|
29
|
+
// shadowDbUrlsMap.set(dbName, shadowDbUrl)
|
|
30
|
+
// console.log(`Shadow DB URI for ${dbName}: ${shadowDbUrl}`)
|
|
31
|
+
// return shadowDbUrl
|
|
32
|
+
// }
|
|
33
|
+
// // 1. Process projectConfig.databaseUrl
|
|
34
|
+
// const projectDbUrl = config.projectConfig.databaseUrl
|
|
35
|
+
// if (!projectDbUrl) {
|
|
36
|
+
// throw new Error(
|
|
37
|
+
// "projectConfig.databaseUrl is not defined in the provided ConfigModule."
|
|
38
|
+
// )
|
|
39
|
+
// }
|
|
40
|
+
// const primaryShadowDbUrl = await getOrFetchShadowDbUrl(projectDbUrl)
|
|
41
|
+
// // 2. Deep Copy config.modules and process module-specific database URLs
|
|
42
|
+
// const modulesConfigCopy: ConfigModule["modules"] = JSON.parse(
|
|
43
|
+
// JSON.stringify(config.modules || {})
|
|
44
|
+
// )
|
|
45
|
+
// console.log("Processing module-specific database configurations...")
|
|
46
|
+
// for (const moduleKey in modulesConfigCopy) {
|
|
47
|
+
// const moduleConfig = modulesConfigCopy[moduleKey]
|
|
48
|
+
// if (
|
|
49
|
+
// typeof moduleConfig === "object" &&
|
|
50
|
+
// moduleConfig !== null &&
|
|
51
|
+
// "options" in moduleConfig
|
|
52
|
+
// ) {
|
|
53
|
+
// const declaration = moduleConfig as
|
|
54
|
+
// | InternalModuleDeclaration
|
|
55
|
+
// | ExternalModuleDeclaration
|
|
56
|
+
// if (
|
|
57
|
+
// declaration.options?.database &&
|
|
58
|
+
// typeof declaration.options.database === "object" &&
|
|
59
|
+
// "clientUrl" in declaration.options.database
|
|
60
|
+
// ) {
|
|
61
|
+
// const dbObj = declaration.options.database as { clientUrl: string }
|
|
62
|
+
// dbObj.clientUrl = await getOrFetchShadowDbUrl(dbObj.clientUrl)
|
|
63
|
+
// console.log(
|
|
64
|
+
// `Updated module ${moduleKey} clientUrl to: ${dbObj.clientUrl}`
|
|
65
|
+
// )
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
// const updatedProjectConfig = {
|
|
70
|
+
// ...config.projectConfig,
|
|
71
|
+
// databaseUrl: primaryShadowDbUrl,
|
|
72
|
+
// }
|
|
73
|
+
// const updatedConfig: ConfigModule = {
|
|
74
|
+
// ...config,
|
|
75
|
+
// modules: modulesConfigCopy,
|
|
76
|
+
// projectConfig: updatedProjectConfig,
|
|
77
|
+
// }
|
|
78
|
+
// const container = createEtoContainer({})
|
|
79
|
+
// container.register(
|
|
80
|
+
// ContainerRegistrationKeys.CONFIG_MODULE,
|
|
81
|
+
// asFunction(() => updatedConfig)
|
|
82
|
+
// )
|
|
83
|
+
// container.register({
|
|
84
|
+
// // [ContainerRegistrationKeys.LOGGER]: asValue(logger),
|
|
85
|
+
// [ContainerRegistrationKeys.REMOTE_QUERY]: asValue(null),
|
|
86
|
+
// })
|
|
87
|
+
// const etoAppLoader = new EtoAppLoader({
|
|
88
|
+
// modulesDefinition,
|
|
89
|
+
// linkModule: [],
|
|
90
|
+
// })
|
|
91
|
+
// // export type EtoAppOptions = {
|
|
92
|
+
// // workerMode?: "shared" | "worker" | "server"
|
|
93
|
+
// // sharedContainer?: EtoContainer
|
|
94
|
+
// // linkModule?: any
|
|
95
|
+
// // sharedResourcesConfig?: SharedResources
|
|
96
|
+
// // loadedModules?: LoadedModule[]
|
|
97
|
+
// // servicesConfig?: ModuleJoinerConfig[]
|
|
98
|
+
// // modulesConfigPath?: string
|
|
99
|
+
// // modulesConfigFileName?: string
|
|
100
|
+
// // modulesConfig?: EtoModuleConfig
|
|
101
|
+
// // linkModules?: RegisterModuleJoinerConfig | RegisterModuleJoinerConfig[]
|
|
102
|
+
// // remoteFetchData?: RemoteFetchDataCallback
|
|
103
|
+
// // injectedDependencies?: any
|
|
104
|
+
// // onApplicationStartCb?: () => void
|
|
105
|
+
// // /**
|
|
106
|
+
// // * Forces the modules bootstrapper to only run the modules loaders and return prematurely
|
|
107
|
+
// // */
|
|
108
|
+
// // loaderOnly?: boolean
|
|
109
|
+
// // }
|
|
110
|
+
// const etoAppOptions: EtoAppOptions = {
|
|
111
|
+
// modulesConfig: updatedConfig.modules,
|
|
112
|
+
// sharedContainer: container,
|
|
113
|
+
// sharedResourcesConfig: {
|
|
114
|
+
// database: {
|
|
115
|
+
// clientUrl: primaryShadowDbUrl,
|
|
116
|
+
// },
|
|
117
|
+
// },
|
|
118
|
+
// }
|
|
119
|
+
// // console.log("Constructed EtoAppOptions:", JSON.stringify(etoAppOptions, null, 2));
|
|
120
|
+
// // console.log("Calling EtoAppMigrateGenerate...");
|
|
121
|
+
// // await EtoAppLoader(
|
|
122
|
+
// // Object.keys(updatedConfig.modules ?? {}).filter(
|
|
123
|
+
// // (value) => typeof value == "string"
|
|
124
|
+
// // ),
|
|
125
|
+
// // etoAppOptions
|
|
126
|
+
// // )
|
|
127
|
+
// // console.log(
|
|
128
|
+
// // `Successfully generated migration for service '${serviceName}'.`
|
|
129
|
+
// // );
|
|
130
|
+
// let onApplicationPrepareShutdown: () => Promise<void> = async () =>
|
|
131
|
+
// Promise.resolve()
|
|
132
|
+
// let onApplicationShutdown: () => Promise<void> = async () =>
|
|
133
|
+
// Promise.resolve()
|
|
134
|
+
// let container_: EtoContainer
|
|
135
|
+
// let plugins: PluginDetails[]
|
|
136
|
+
// try {
|
|
137
|
+
// const { container } = await containerFromConfig(directory, [])
|
|
138
|
+
// container_ = container
|
|
139
|
+
// await ensureDbExists(container_)
|
|
140
|
+
// const configModule = container_.resolve(
|
|
141
|
+
// ContainerRegistrationKeys.CONFIG_MODULE
|
|
142
|
+
// )
|
|
143
|
+
// plugins = await getResolvedPlugins(directory, configModule, true)
|
|
144
|
+
// mergePluginModules(configModule, plugins)
|
|
145
|
+
// const resources = await loadResources(plugins)
|
|
146
|
+
// onApplicationPrepareShutdown = resources.onApplicationPrepareShutdown
|
|
147
|
+
// onApplicationShutdown = resources.onApplicationShutdown
|
|
148
|
+
// /// encore doesnt need this, custom migration should be store in migrations folder.
|
|
149
|
+
// const scriptsSourcePaths = [
|
|
150
|
+
// join(dirname(require.resolve("@etohq/eto")), "migration-scripts"),
|
|
151
|
+
// ...plugins.map((plugin) => join(plugin.resolve, "migration-scripts")),
|
|
152
|
+
// ]
|
|
153
|
+
// const migrator = new MigrationScriptsMigrator({ container: container_ })
|
|
154
|
+
// await migrator.ensureMigrationsTable()
|
|
155
|
+
// const pendingScripts = await migrator.getPendingMigrations(
|
|
156
|
+
// scriptsSourcePaths
|
|
157
|
+
// )
|
|
158
|
+
// if (!pendingScripts?.length) {
|
|
159
|
+
// logger.info("No pending migration scripts to execute")
|
|
160
|
+
// return true
|
|
161
|
+
// }
|
|
162
|
+
// console.log(new Array(TERMINAL_SIZE).join("-"))
|
|
163
|
+
// logger.info("Pending migration scripts to execute")
|
|
164
|
+
// logger.info(`${pendingScripts.join("\n")}`)
|
|
165
|
+
// console.log(new Array(TERMINAL_SIZE).join("-"))
|
|
166
|
+
// logger.info("Running migration scripts...")
|
|
167
|
+
// await migrator.run(scriptsSourcePaths)
|
|
168
|
+
// console.log(new Array(TERMINAL_SIZE).join("-"))
|
|
169
|
+
// logger.info("Migration scripts completed")
|
|
170
|
+
// return true
|
|
171
|
+
// } finally {
|
|
172
|
+
// await onApplicationPrepareShutdown()
|
|
173
|
+
// await onApplicationShutdown()
|
|
174
|
+
// }
|
|
175
|
+
// } catch (e) {
|
|
176
|
+
// console.error("Migration generation failed:", e)
|
|
177
|
+
// process.exit(1)
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
const path_1 = require("path");
|
|
181
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
182
|
+
const links_1 = require("@etohq/framework/links");
|
|
183
|
+
const logger_1 = require("@etohq/framework/logger");
|
|
184
|
+
const framework_1 = require("@etohq/framework");
|
|
185
|
+
const utils_2 = require("../utils");
|
|
186
|
+
const resolve_plugins_1 = require("../../loaders/helpers/resolve-plugins");
|
|
187
|
+
const modules_sdk_1 = require("@etohq/framework/modules-sdk");
|
|
188
|
+
const TERMINAL_SIZE = process.stdout.columns;
|
|
189
|
+
const main = async function ({ directory, eto, featureFlags, }) {
|
|
190
|
+
try {
|
|
191
|
+
/**
|
|
192
|
+
* Setup
|
|
193
|
+
*/
|
|
194
|
+
const { modulesDefinitionInput, linkModule, inputConfig } = eto;
|
|
195
|
+
const defaultModulesDefinition = (0, modules_sdk_1.generateModulesDefinition)(...modulesDefinitionInput);
|
|
196
|
+
const { container, configModule } = await (0, framework_1.initializeContainer)(directory, featureFlags, modulesDefinitionInput, inputConfig);
|
|
197
|
+
await (0, utils_2.ensureDbExists)(container);
|
|
198
|
+
const etoAppLoader = new framework_1.EtoAppLoader({
|
|
199
|
+
modulesDefinition: defaultModulesDefinition,
|
|
200
|
+
linkModule,
|
|
201
|
+
});
|
|
202
|
+
const plugins = await (0, resolve_plugins_1.getResolvedPlugins)(directory, configModule, true);
|
|
203
|
+
(0, utils_1.mergePluginModules)(configModule, plugins);
|
|
204
|
+
const linksSourcePaths = plugins.map((plugin) => (0, path_1.join)(plugin.resolve, "links"));
|
|
205
|
+
await new links_1.LinkLoader(linksSourcePaths).load();
|
|
206
|
+
/**
|
|
207
|
+
* Generating migrations
|
|
208
|
+
*/
|
|
209
|
+
logger_1.logger.info("Generating migrations...");
|
|
210
|
+
await etoAppLoader.runModulesMigrations({
|
|
211
|
+
action: "generate",
|
|
212
|
+
});
|
|
213
|
+
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
214
|
+
logger_1.logger.info("Migrations generated");
|
|
215
|
+
process.exit();
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
219
|
+
if (error.code && error.code === utils_1.EtoError.Codes.UNKNOWN_MODULES) {
|
|
220
|
+
logger_1.logger.error(error.message);
|
|
221
|
+
const modulesList = error.allModules.map((name) => ` - ${name}`);
|
|
222
|
+
logger_1.logger.error(`Available modules:\n${modulesList.join("\n")}`);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
logger_1.logger.error(error.message, error);
|
|
226
|
+
}
|
|
227
|
+
process.exit(1);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
exports.default = main;
|
|
231
|
+
//# sourceMappingURL=encore-generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encore-generate.js","sourceRoot":"","sources":["../../../src/commands/migrate/encore-generate.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,2BAA2B;AAC3B,oCAAoC;AACpC,+BAA+B;AAC/B,4BAA4B;AAC5B,0CAA0C;AAC1C,QAAQ;AACR,8DAA8D;AAC9D,kDAAkD;AAClD,oEAAoE;AACpE,2DAA2D;;AAE3D,YAAY;AACZ,0DAA0D;AAE1D,qEAAqE;AACrE,+EAA+E;AAC/E,8DAA8D;AAC9D,6CAA6C;AAC7C,gDAAgD;AAChD,YAAY;AACZ,wDAAwD;AACxD,kEAAkE;AAClE,kBAAkB;AAClB,wBAAwB;AACxB,oBAAoB;AACpB,wBAAwB;AACxB,aAAa;AACb,mDAAmD;AACnD,qEAAqE;AACrE,6BAA6B;AAC7B,UAAU;AAEV,gDAAgD;AAChD,8DAA8D;AAC9D,6BAA6B;AAC7B,2BAA2B;AAC3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K,CAAC,eAAe,EAAE,CAAC;YAChE,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CACtC,CAAC,IAAY,EAAE,EAAE,CAAC,eAAe,IAAI,EAAE,CACxC,CAAA;YACD,eAAM,CAAC,KAAK,CAAC,uBAAuB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC/D,CAAC;aAAM,CAAC;YACN,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACpC,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Eto } from "@etohq/framework";
|
|
2
|
+
declare const main: ({ directory, eto, featureFlags, }: {
|
|
3
|
+
directory: string;
|
|
4
|
+
eto: Eto;
|
|
4
5
|
featureFlags: any;
|
|
5
|
-
inlineConfig: any;
|
|
6
|
-
modulesDefinitionResult: any;
|
|
7
|
-
linkModule: any;
|
|
8
6
|
}) => Promise<never>;
|
|
9
7
|
export default main;
|
|
10
8
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/generate.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAqC,MAAM,kBAAkB,CAAA;AAQzE,QAAA,MAAM,IAAI,GAAmB,mCAI1B;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,GAAG,CAAA;IACR,YAAY,MAAA;CACb,mBA8DA,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
// import { join } from "path"
|
|
4
4
|
const utils_1 = require("@etohq/framework/utils");
|
|
5
|
-
|
|
5
|
+
// import { LinkLoader } from "@etohq/framework/links"
|
|
6
6
|
const logger_1 = require("@etohq/framework/logger");
|
|
7
7
|
const framework_1 = require("@etohq/framework");
|
|
8
8
|
const utils_2 = require("../utils");
|
|
9
|
-
const
|
|
9
|
+
const modules_sdk_1 = require("@etohq/framework/modules-sdk");
|
|
10
|
+
// import { getResolvedPlugins } from "../../loaders/helpers/resolve-plugins"
|
|
10
11
|
const TERMINAL_SIZE = process.stdout.columns;
|
|
11
|
-
const main = async function ({ directory,
|
|
12
|
+
const main = async function ({ directory, eto, featureFlags, }) {
|
|
12
13
|
try {
|
|
13
14
|
/**
|
|
14
15
|
* Setup
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const { modulesDefinitionInput, linkModule, inputConfig } = eto;
|
|
18
|
+
const defaultModulesDefinition = (0, modules_sdk_1.generateModulesDefinition)(...modulesDefinitionInput);
|
|
19
|
+
const { container } = await (0, framework_1.initializeContainer)(directory, featureFlags, modulesDefinitionInput, inputConfig);
|
|
17
20
|
await (0, utils_2.ensureDbExists)(container);
|
|
18
|
-
const { modulesDefinition } = modulesDefinitionResult;
|
|
19
21
|
const etoAppLoader = new framework_1.EtoAppLoader({
|
|
20
|
-
modulesDefinition,
|
|
22
|
+
modulesDefinition: defaultModulesDefinition,
|
|
21
23
|
linkModule,
|
|
22
24
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
// const plugins = await getResolvedPlugins(directory, configModule, true)
|
|
26
|
+
// mergePluginModules(configModule, plugins)
|
|
27
|
+
// const linksSourcePaths = plugins.map((plugin) =>
|
|
28
|
+
// join(plugin.resolve, "links")
|
|
29
|
+
// )
|
|
30
|
+
// await new LinkLoader(linksSourcePaths).load()
|
|
28
31
|
/**
|
|
29
32
|
* Generating migrations
|
|
30
33
|
*/
|
|
31
34
|
logger_1.logger.info("Generating migrations...");
|
|
32
35
|
await etoAppLoader.runModulesMigrations({
|
|
33
|
-
moduleNames: modules,
|
|
34
36
|
action: "generate",
|
|
35
37
|
});
|
|
36
38
|
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/migrate/generate.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/migrate/generate.ts"],"names":[],"mappings":";;AAAA,8BAA8B;AAC9B,kDAG+B;AAC/B,sDAAsD;AACtD,oDAAgD;AAChD,gDAAyE;AAEzE,oCAAyC;AACzC,8DAAwE;AACxE,6EAA6E;AAE7E,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;AAE5C,MAAM,IAAI,GAAG,KAAK,WAAW,EAC3B,SAAS,EACT,GAAG,EACH,YAAY,GAKb;IACC,IAAI,CAAC;QACH;;WAEG;QAGH,MAAM,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,GAAG,CAAA;QAE9D,MAAM,wBAAwB,GAAG,IAAA,uCAAyB,EACxD,GAAG,sBAAsB,CAC1B,CAAA;QAEF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,+BAAmB,EAC7C,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,WAAW,CACZ,CAAA;QAED,MAAM,IAAA,sBAAc,EAAC,SAAS,CAAC,CAAA;QAE/B,MAAM,YAAY,GAAG,IAAI,wBAAY,CAAC;YACpC,iBAAiB,EAAE,wBAAwB;YAC3C,UAAU;SACX,CAAC,CAAA;QAEF,0EAA0E;QAC1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A low-level utility to migrate the migration scripts. This util should
|
|
4
|
+
* never exit the process implicitly.
|
|
5
|
+
*/
|
|
6
|
+
export declare function runMigrationScripts({ directory, modulesDefinitionInput, }: {
|
|
7
|
+
directory: string;
|
|
8
|
+
modulesDefinitionInput: any;
|
|
9
|
+
}): Promise<boolean>;
|
|
10
|
+
declare const main: ({ directory, modulesDefinitionInput, }: {
|
|
11
|
+
directory: string;
|
|
12
|
+
modulesDefinitionInput: any;
|
|
13
|
+
container?: EtoContainer;
|
|
14
|
+
}) => Promise<never>;
|
|
15
|
+
export default main;
|
|
16
|
+
//# sourceMappingURL=run-scripts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-scripts.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/run-scripts.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAKpE;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,SAAS,EACT,sBAAsB,GACvB,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,sBAAsB,EAAE,GAAG,CAAA;CAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,CA2DnB;AAqCD,QAAA,MAAM,IAAI,GAAmB,wCAG1B;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,sBAAsB,EAAE,GAAG,CAAA;IAC3B,SAAS,CAAC,EAAE,YAAY,CAAA;CACzB,mBAYA,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runMigrationScripts = runMigrationScripts;
|
|
4
|
+
const framework_1 = require("@etohq/framework");
|
|
5
|
+
const links_1 = require("@etohq/framework/links");
|
|
6
|
+
const logger_1 = require("@etohq/framework/logger");
|
|
7
|
+
const migrations_1 = require("@etohq/framework/migrations");
|
|
8
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const modules_sdk_1 = require("@etohq/framework/modules-sdk");
|
|
11
|
+
const utils_2 = require("../utils");
|
|
12
|
+
const TERMINAL_SIZE = process.stdout.columns;
|
|
13
|
+
/**
|
|
14
|
+
* A low-level utility to migrate the migration scripts. This util should
|
|
15
|
+
* never exit the process implicitly.
|
|
16
|
+
*/
|
|
17
|
+
async function runMigrationScripts({ directory, modulesDefinitionInput, }) {
|
|
18
|
+
let onApplicationPrepareShutdown = async () => Promise.resolve();
|
|
19
|
+
let onApplicationShutdown = async () => Promise.resolve();
|
|
20
|
+
let container_;
|
|
21
|
+
let plugins;
|
|
22
|
+
try {
|
|
23
|
+
const { container, configModule } = await (0, framework_1.initializeContainer)(directory, [], modulesDefinitionInput);
|
|
24
|
+
container_ = container;
|
|
25
|
+
await (0, utils_2.ensureDbExists)(container_);
|
|
26
|
+
plugins = await (0, utils_1.getResolvedPlugins)(directory, configModule, true);
|
|
27
|
+
(0, utils_1.mergePluginModules)(configModule, plugins);
|
|
28
|
+
const resources = await loadResources(plugins);
|
|
29
|
+
onApplicationPrepareShutdown = resources.onApplicationPrepareShutdown;
|
|
30
|
+
onApplicationShutdown = resources.onApplicationShutdown;
|
|
31
|
+
/// encore doesnt need this, custom migration should be store in migrations folder.
|
|
32
|
+
const scriptsSourcePaths = [
|
|
33
|
+
(0, path_1.join)((0, path_1.dirname)(require.resolve("@etohq/eto")), "migration-scripts"),
|
|
34
|
+
...plugins.map((plugin) => (0, path_1.join)(plugin.resolve, "migration-scripts")),
|
|
35
|
+
];
|
|
36
|
+
const migrator = new migrations_1.MigrationScriptsMigrator({ container: container_ });
|
|
37
|
+
await migrator.ensureMigrationsTable();
|
|
38
|
+
const pendingScripts = await migrator.getPendingMigrations(scriptsSourcePaths);
|
|
39
|
+
if (!pendingScripts?.length) {
|
|
40
|
+
logger_1.logger.info("No pending migration scripts to execute");
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
44
|
+
logger_1.logger.info("Pending migration scripts to execute");
|
|
45
|
+
logger_1.logger.info(`${pendingScripts.join("\n")}`);
|
|
46
|
+
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
47
|
+
logger_1.logger.info("Running migration scripts...");
|
|
48
|
+
await migrator.run(scriptsSourcePaths);
|
|
49
|
+
console.log(new Array(TERMINAL_SIZE).join("-"));
|
|
50
|
+
logger_1.logger.info("Migration scripts completed");
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await onApplicationPrepareShutdown();
|
|
55
|
+
await onApplicationShutdown();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function loadResources(plugins) {
|
|
59
|
+
/**
|
|
60
|
+
* Clear all module instances to prevent cache from kicking in
|
|
61
|
+
*/
|
|
62
|
+
modules_sdk_1.EtoModule.clearInstances();
|
|
63
|
+
/**
|
|
64
|
+
* Setup
|
|
65
|
+
*/
|
|
66
|
+
const linksSourcePaths = plugins.map((plugin) => (0, path_1.join)(plugin.resolve, "links"));
|
|
67
|
+
await new links_1.LinkLoader(linksSourcePaths).load();
|
|
68
|
+
// in Eto Module definition is explicite to loader. so we can have different base modules loaded from differennt packages and domains. but default to core, and still allow override in app.
|
|
69
|
+
const etoAppResources = await new framework_1.EtoAppLoader({
|
|
70
|
+
modulesDefinition: {},
|
|
71
|
+
linkModule: {},
|
|
72
|
+
}).load();
|
|
73
|
+
const onApplicationPrepareShutdown = etoAppResources.onApplicationPrepareShutdown;
|
|
74
|
+
const onApplicationShutdown = etoAppResources.onApplicationShutdown;
|
|
75
|
+
await etoAppResources.onApplicationStart();
|
|
76
|
+
return {
|
|
77
|
+
onApplicationPrepareShutdown,
|
|
78
|
+
onApplicationShutdown,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const main = async function ({ directory, modulesDefinitionInput, }) {
|
|
82
|
+
// todo get access to modulesDefinitionInput from loadConfig.
|
|
83
|
+
try {
|
|
84
|
+
const migrated = await runMigrationScripts({
|
|
85
|
+
directory,
|
|
86
|
+
modulesDefinitionInput,
|
|
87
|
+
});
|
|
88
|
+
process.exit(migrated ? 0 : 1);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
logger_1.logger.error(error);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.default = main;
|
|
96
|
+
//# sourceMappingURL=run-scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-scripts.js","sourceRoot":"","sources":["../../../src/commands/migrate/run-scripts.ts"],"names":[],"mappings":";;AAoBA,kDAiEC;AArFD,gDAAoE;AACpE,kDAAmD;AACnD,oDAAgD;AAChD,4DAAsE;AACtE,kDAG+B;AAC/B,+BAAoC;AAEpC,8DAAwD;AAExD,oCAAyC;AAEzC,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;AAE5C;;;GAGG;AACI,KAAK,UAAU,mBAAmB,CAAC,EACxC,SAAS,EACT,sBAAsB,GAIvB;IACC,IAAI,4BAA4B,GAAwB,KAAK,IAAI,EAAE,CACjE,OAAO,CAAC,OAAO,EAAE,CAAA;IACnB,IAAI,qBAAqB,GAAwB,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;IAC9E,IAAI,UAAwB,CAAA;IAC5B,IAAI,OAAwB,CAAA;IAE5B,IAAI,CAAC;QAEH,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,+BAAmB,EAC3D,SAAS,EACT,EAAE,EACF,sBAAsB,CACvB,CAAA;QACD,UAAU,GAAG,SAAS,CAAA;QACtB,MAAM,IAAA,sBAAc,EAAC,UAAU,CAAC,CAAA;QAGhC,OAAO,GAAG,MAAM,IAAA,0BAAkB,EAAC,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAEj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QACF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
|
@@ -7,13 +7,13 @@ export declare function syncLinks(EtoAppLoader: EtoAppLoader, { executeAll, exec
|
|
|
7
7
|
executeSafe: boolean;
|
|
8
8
|
executeAll: boolean;
|
|
9
9
|
}): Promise<void>;
|
|
10
|
-
declare const main: ({ directory, executeSafe, executeAll, featureFlags, inlineConfig,
|
|
10
|
+
declare const main: ({ directory, executeSafe, executeAll, featureFlags, inlineConfig, modulesDefinitionInput, linkModule, }: {
|
|
11
11
|
directory: any;
|
|
12
12
|
executeSafe: any;
|
|
13
13
|
executeAll: any;
|
|
14
14
|
featureFlags: any;
|
|
15
15
|
inlineConfig: any;
|
|
16
|
-
|
|
16
|
+
modulesDefinitionInput: any;
|
|
17
17
|
linkModule: any;
|
|
18
18
|
}) => Promise<never>;
|
|
19
19
|
export default main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-links-migration.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/sync-links-migration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-links-migration.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/sync-links-migration.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAuB,MAAM,kBAAkB,CAAA;AA8EpE;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,YAAY,EAAE,YAAY,EAC1B,EACE,UAAU,EACV,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,iBA4FF;AAED,QAAA,MAAM,IAAI,GAAmB;;;;;;;;CAQ5B,mBAoCA,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -14,7 +14,8 @@ const logger_1 = require("@etohq/framework/logger");
|
|
|
14
14
|
const framework_1 = require("@etohq/framework");
|
|
15
15
|
const resolve_plugins_1 = require("../../loaders/helpers/resolve-plugins");
|
|
16
16
|
const utils_2 = require("../utils");
|
|
17
|
-
|
|
17
|
+
const modules_sdk_1 = require("@etohq/framework/modules-sdk");
|
|
18
|
+
// todo refactor this to detect migration. and
|
|
18
19
|
/**
|
|
19
20
|
* Groups action tables by their "action" property
|
|
20
21
|
* @param actionPlan LinkMigrationsPlannerAction
|
|
@@ -140,13 +141,16 @@ async function syncLinks(EtoAppLoader, { executeAll, executeSafe, }) {
|
|
|
140
141
|
// logger.info("Database already up-to-date")
|
|
141
142
|
// }
|
|
142
143
|
}
|
|
143
|
-
const main = async function ({ directory, executeSafe, executeAll, featureFlags, inlineConfig,
|
|
144
|
+
const main = async function ({ directory, executeSafe, executeAll, featureFlags, inlineConfig, modulesDefinitionInput, linkModule, }) {
|
|
144
145
|
try {
|
|
145
|
-
const
|
|
146
|
+
const defaultModulesDefinition = (0, modules_sdk_1.generateModulesDefinition)(...modulesDefinitionInput);
|
|
147
|
+
const { container, configModule } = await (0, framework_1.initializeContainer)(directory, featureFlags, modulesDefinitionInput, inlineConfig);
|
|
146
148
|
await (0, utils_2.ensureDbExists)(container);
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
|
|
149
|
+
// const { modulesDefinition } = modulesDefinitionOutput
|
|
150
|
+
const etoAppLoader = new framework_1.EtoAppLoader({
|
|
151
|
+
modulesDefinition: defaultModulesDefinition,
|
|
152
|
+
linkModule,
|
|
153
|
+
});
|
|
150
154
|
const plugins = await (0, resolve_plugins_1.getResolvedPlugins)(directory, configModule, true);
|
|
151
155
|
(0, utils_1.mergePluginModules)(configModule, plugins);
|
|
152
156
|
const linksSourcePaths = plugins.map((plugin) => (0, path_1.join)(plugin.resolve, "links"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-links-migration.js","sourceRoot":"","sources":["../../../src/commands/migrate/sync-links-migration.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"sync-links-migration.js","sourceRoot":"","sources":["../../../src/commands/migrate/sync-links-migration.ts"],"names":[],"mappings":";;;;;AA0FA,8BAoGC;AA9LD,kDAAyB;AACzB,kDAAyB;AACzB,+BAA2B;AAC3B,kEAAyC;AACzC,kDAA2D;AAE3D,kDAAmD;AACnD,oDAAgD;AAChD,gDAAoE;AACpE,2EAA0E;AAC1E,oCAAyC;AACzC,8DAAwE;AAExE,8CAA8C;AAE9C;;;GAGG;AACH,SAAS,iBAAiB,CAAC,UAAyC;IAClE,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACvC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;QACzB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/B,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAA+F,CAAC,CAAA;AACrG,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAmC;IAC/D,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;IACjC,MAAM,IAAI,GAAG,eAAK,CAAC,MAAM,CACvB,GAAG,cAAc,CAAC,UAAU,IAAI,cAAc,CAAC,SAAS,EAAE,CAC3D,CAAA;IACD,MAAM,EAAE,GAAG,eAAK,CAAC,MAAM,CACrB,GAAG,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,EAAE,CACvD,CAAA;IACD,MAAM,KAAK,GAAG,eAAK,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,CAAC,CAAA;IAEhD,OAAO,GAAG,IAAI,OAAO,EAAE,IAA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,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC9C,IAAA,WAAI,EAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAC9B,CAAA;QACD,MAAM,IAAI,kBAAU,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAE7C,MAAM,SAAS,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;QAC1D,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/exec.ts","../src/commands/index.ts","../src/commands/user.ts","../src/commands/migrate/create.ts","../src/commands/migrate/generate.ts","../src/commands/migrate/sync-links-migration.ts","../src/commands/utils/index.ts","../src/loaders/helpers/resolve-plugins.ts","../src/types/global.ts","../src/types/index.ts","../src/types/middlewares.ts","../src/types/subscribers.ts","../src/utils/admin-consts.ts","../src/utils/clean-response-data.ts","../src/utils/diff-set.ts","../src/utils/exception-formatter.ts","../src/utils/format-registration-name.ts","../src/utils/index.ts","../src/utils/__tests__/format-registration-name.js","../src/utils/middlewares/authenticate-middleware.ts","../src/utils/middlewares/error-handler.ts","../src/utils/middlewares/index.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/exec.ts","../src/commands/index.ts","../src/commands/user.ts","../src/commands/migrate/create.ts","../src/commands/migrate/encore-generate.ts","../src/commands/migrate/generate.ts","../src/commands/migrate/run-scripts.ts","../src/commands/migrate/sync-links-migration.ts","../src/commands/utils/index.ts","../src/loaders/helpers/resolve-plugins.ts","../src/types/global.ts","../src/types/index.ts","../src/types/middlewares.ts","../src/types/subscribers.ts","../src/utils/admin-consts.ts","../src/utils/clean-response-data.ts","../src/utils/diff-set.ts","../src/utils/exception-formatter.ts","../src/utils/format-registration-name.ts","../src/utils/index.ts","../src/utils/__tests__/format-registration-name.js","../src/utils/middlewares/authenticate-middleware.ts","../src/utils/middlewares/error-handler.ts","../src/utils/middlewares/index.ts"],"version":"5.8.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate-middleware.d.ts","sourceRoot":"","sources":["../../../src/utils/middlewares/authenticate-middleware.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;
|
|
1
|
+
{"version":3,"file":"authenticate-middleware.d.ts","sourceRoot":"","sources":["../../../src/utils/middlewares/authenticate-middleware.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;wBAC+T,CAAC;qBAAgC,CAAC;uDAD1U,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etohq/eto",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Building blocks for API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -32,60 +32,62 @@
|
|
|
32
32
|
},
|
|
33
33
|
"author": "Emmannuel Okanlawon",
|
|
34
34
|
"license": "MIT",
|
|
35
|
-
"scripts": {
|
|
36
|
-
"watch": "tsc --build --watch",
|
|
37
|
-
"build": "rimraf dist && tsc --build",
|
|
38
|
-
"serve": "node dist/app.js",
|
|
39
|
-
"test": "jest --silent=false --bail --maxWorkers=50% --forceExit"
|
|
40
|
-
},
|
|
41
35
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@mikro-orm/
|
|
44
|
-
"@mikro-orm/
|
|
45
|
-
"@mikro-orm/
|
|
46
|
-
"@
|
|
47
|
-
"@opentelemetry/
|
|
48
|
-
"@opentelemetry/instrumentation": "
|
|
49
|
-
"@opentelemetry/
|
|
50
|
-
"@opentelemetry/
|
|
51
|
-
"@opentelemetry/sdk-node": "
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"rimraf": "
|
|
61
|
-
"typescript": "
|
|
36
|
+
"@mikro-orm/core": "6.4.3",
|
|
37
|
+
"@mikro-orm/knex": "6.4.3",
|
|
38
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
39
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
40
|
+
"@opentelemetry/api": "1.9.0",
|
|
41
|
+
"@opentelemetry/instrumentation": "0.53.0",
|
|
42
|
+
"@opentelemetry/instrumentation-pg": "0.44.0",
|
|
43
|
+
"@opentelemetry/resources": "1.26.0",
|
|
44
|
+
"@opentelemetry/sdk-node": "0.53.0",
|
|
45
|
+
"@opentelemetry/sdk-trace-node": "1.26.0",
|
|
46
|
+
"@swc/jest": "0.2.36",
|
|
47
|
+
"@types/jest": "29.5.14",
|
|
48
|
+
"@types/jsonwebtoken": "8.5.9",
|
|
49
|
+
"@types/lodash": "4.14.191",
|
|
50
|
+
"@types/multer": "1.4.7",
|
|
51
|
+
"awilix": "8.0.1",
|
|
52
|
+
"jest": "29.7.0",
|
|
53
|
+
"tsc-alias": "1.8.6",
|
|
54
|
+
"rimraf": "5.0.2",
|
|
55
|
+
"typescript": "5.8.3",
|
|
56
|
+
"@etohq/framework": "1.5.0"
|
|
62
57
|
},
|
|
63
58
|
"dependencies": {
|
|
64
|
-
"@inquirer/checkbox": "
|
|
65
|
-
"@inquirer/input": "
|
|
66
|
-
"@swc/core": "
|
|
67
|
-
"@swc/helpers": "
|
|
68
|
-
"boxen": "
|
|
69
|
-
"chalk": "
|
|
70
|
-
"chokidar": "
|
|
71
|
-
"compression": "
|
|
72
|
-
"fs-exists-cached": "
|
|
73
|
-
"jsonwebtoken": "
|
|
74
|
-
"lodash": "
|
|
75
|
-
"node-schedule": "
|
|
76
|
-
"qs": "
|
|
77
|
-
"request-ip": "
|
|
78
|
-
"slugify": "
|
|
79
|
-
"uuid": "
|
|
59
|
+
"@inquirer/checkbox": "2.3.11",
|
|
60
|
+
"@inquirer/input": "2.2.9",
|
|
61
|
+
"@swc/core": "1.7.28",
|
|
62
|
+
"@swc/helpers": "0.5.11",
|
|
63
|
+
"boxen": "5.0.1",
|
|
64
|
+
"chalk": "4.0.0",
|
|
65
|
+
"chokidar": "3.5.3",
|
|
66
|
+
"compression": "1.7.4",
|
|
67
|
+
"fs-exists-cached": "1.0.0",
|
|
68
|
+
"jsonwebtoken": "9.0.2",
|
|
69
|
+
"lodash": "4.17.21",
|
|
70
|
+
"node-schedule": "2.1.1",
|
|
71
|
+
"qs": "6.11.2",
|
|
72
|
+
"request-ip": "3.3.0",
|
|
73
|
+
"slugify": "1.6.6",
|
|
74
|
+
"uuid": "9.0.0",
|
|
80
75
|
"zod": "3.22.4"
|
|
81
76
|
},
|
|
82
77
|
"peerDependencies": {
|
|
83
|
-
"@
|
|
84
|
-
"@mikro-orm/
|
|
85
|
-
"@mikro-orm/
|
|
86
|
-
"@mikro-orm/
|
|
87
|
-
"
|
|
88
|
-
"
|
|
78
|
+
"@mikro-orm/core": "6.4.3",
|
|
79
|
+
"@mikro-orm/knex": "6.4.3",
|
|
80
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
81
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
82
|
+
"awilix": "8.0.1",
|
|
83
|
+
"@etohq/framework": "1.5.0"
|
|
89
84
|
},
|
|
90
|
-
"gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e"
|
|
91
|
-
|
|
85
|
+
"gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e",
|
|
86
|
+
"scripts": {
|
|
87
|
+
"watch": "tsc --build --watch",
|
|
88
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
|
89
|
+
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
|
90
|
+
"serve": "node dist/app.js",
|
|
91
|
+
"test": "jest --silent=false --bail --maxWorkers=50% --forceExit"
|
|
92
|
+
}
|
|
93
|
+
}
|