@tstdl/base 0.93.70 → 0.93.72
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/audit/module.js +1 -1
- package/authentication/server/module.js +1 -1
- package/document-management/server/module.js +1 -1
- package/key-value-store/postgres/module.js +1 -1
- package/lock/postgres/module.js +1 -1
- package/mail/module.js +1 -1
- package/orm/server/database.d.ts +4 -2
- package/orm/server/database.js +7 -2
- package/package.json +4 -4
- package/queue/postgres/module.js +1 -1
- package/test/module.js +1 -1
package/audit/module.js
CHANGED
|
@@ -28,6 +28,6 @@ export async function migrateAuditSchema() {
|
|
|
28
28
|
await migrate(database, {
|
|
29
29
|
migrationsSchema: 'audit',
|
|
30
30
|
migrationsTable: '_migrations',
|
|
31
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
31
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -50,6 +50,6 @@ export async function migrateAuthenticationSchema() {
|
|
|
50
50
|
await migrate(database, {
|
|
51
51
|
migrationsSchema: 'authentication',
|
|
52
52
|
migrationsTable: '_migrations',
|
|
53
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
53
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -17,6 +17,6 @@ export async function migrateDocumentManagementSchema() {
|
|
|
17
17
|
await migrate(database, {
|
|
18
18
|
migrationsSchema: 'document_management',
|
|
19
19
|
migrationsTable: '_migrations',
|
|
20
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
20
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -18,6 +18,6 @@ export async function migratePostgresKeyValueStoreSchema() {
|
|
|
18
18
|
await migrate(database, {
|
|
19
19
|
migrationsSchema: 'key_value_store',
|
|
20
20
|
migrationsTable: '_migrations',
|
|
21
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
21
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
22
22
|
});
|
|
23
23
|
}
|
package/lock/postgres/module.js
CHANGED
|
@@ -21,6 +21,6 @@ export async function migratePostgresLockSchema() {
|
|
|
21
21
|
await migrate(database, {
|
|
22
22
|
migrationsSchema: 'lock',
|
|
23
23
|
migrationsTable: '_migrations',
|
|
24
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
24
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
25
25
|
});
|
|
26
26
|
}
|
package/mail/module.js
CHANGED
|
@@ -31,6 +31,6 @@ export async function migrateMailSchema() {
|
|
|
31
31
|
await migrate(database, {
|
|
32
32
|
migrationsSchema: 'mail',
|
|
33
33
|
migrationsTable: '_migrations',
|
|
34
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
34
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
35
35
|
});
|
|
36
36
|
}
|
package/orm/server/database.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* It sets up the dependency injection for the database instance.
|
|
5
5
|
*/
|
|
6
6
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
7
|
-
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
|
7
|
+
import { migrate as drizzleMigrate } from 'drizzle-orm/node-postgres/migrator';
|
|
8
8
|
import { type PoolConfig } from 'pg';
|
|
9
9
|
import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
|
|
10
10
|
/**
|
|
@@ -20,4 +20,6 @@ export type DatabaseArgument = PoolConfig;
|
|
|
20
20
|
export declare class Database extends NodePgDatabase<any> implements Resolvable<DatabaseArgument> {
|
|
21
21
|
readonly [resolveArgumentType]?: DatabaseArgument;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type MigrateParameters = Parameters<typeof drizzleMigrate>;
|
|
24
|
+
export declare function migrate(db: MigrateParameters[0], config: MigrateParameters[1]): Promise<void>;
|
|
25
|
+
export {};
|
package/orm/server/database.js
CHANGED
|
@@ -10,7 +10,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
10
10
|
* It sets up the dependency injection for the database instance.
|
|
11
11
|
*/
|
|
12
12
|
import { drizzle, NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
13
|
-
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
|
13
|
+
import { migrate as drizzleMigrate } from 'drizzle-orm/node-postgres/migrator';
|
|
14
14
|
import { Pool } from 'pg';
|
|
15
15
|
import { inject, Injector, ReplaceClass } from '../../injector/index.js';
|
|
16
16
|
import { isUndefined } from '../../utils/type-guards.js';
|
|
@@ -41,4 +41,9 @@ Injector.registerSingleton(Database, {
|
|
|
41
41
|
return drizzle(pool);
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
|
-
export
|
|
44
|
+
export async function migrate(db, config) {
|
|
45
|
+
const migrationsFolder = config.migrationsFolder
|
|
46
|
+
.replace('file://', '') // drizzle doesn't like it
|
|
47
|
+
.replace(/index\.\w+$/, ''); // workaround for weird import.meta.resolve behavior with tsx
|
|
48
|
+
await drizzleMigrate(db, { ...config, migrationsFolder });
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.93.
|
|
3
|
+
"version": "0.93.72",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"type-fest": "^5.3"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@genkit-ai/google-genai": "^1.
|
|
143
|
+
"@genkit-ai/google-genai": "^1.26",
|
|
144
144
|
"@google-cloud/storage": "^7.18",
|
|
145
|
-
"@google/genai": "^1.
|
|
145
|
+
"@google/genai": "^1.34",
|
|
146
146
|
"@toon-format/toon": "^2.1.0",
|
|
147
147
|
"@tstdl/angular": "^0.93",
|
|
148
148
|
"@zxcvbn-ts/core": "^3.0",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"@zxcvbn-ts/language-en": "^3.0",
|
|
152
152
|
"drizzle-orm": "^0.45",
|
|
153
153
|
"file-type": "^21.1",
|
|
154
|
-
"genkit": "^1.
|
|
154
|
+
"genkit": "^1.26",
|
|
155
155
|
"handlebars": "^4.7",
|
|
156
156
|
"minio": "^8.0",
|
|
157
157
|
"mjml": "^4.18",
|
package/queue/postgres/module.js
CHANGED
|
@@ -24,6 +24,6 @@ export async function migratePostgresQueueSchema() {
|
|
|
24
24
|
await migrate(database, {
|
|
25
25
|
migrationsSchema: 'queue',
|
|
26
26
|
migrationsTable: '_migrations',
|
|
27
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
27
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
28
28
|
});
|
|
29
29
|
}
|
package/test/module.js
CHANGED
|
@@ -12,6 +12,6 @@ export async function migrateTestSchema() {
|
|
|
12
12
|
await migrate(database, {
|
|
13
13
|
migrationsSchema: 'test',
|
|
14
14
|
migrationsTable: '_migrations',
|
|
15
|
-
migrationsFolder: import.meta.resolve('./drizzle')
|
|
15
|
+
migrationsFolder: import.meta.resolve('./drizzle'),
|
|
16
16
|
});
|
|
17
17
|
}
|