@credo-ts/drizzle-storage 0.6.0-pr-2324-20250709084821 → 0.6.0-pr-2324-20250709092632
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/build/DrizzleRecord.d.ts +5 -9
- package/build/action-menu/bundle.d.ts +6 -6
- package/build/action-menu/bundle.js +2 -10
- package/build/action-menu/bundle.js.map +1 -1
- package/build/anoncreds/bundle.d.ts +6 -6
- package/build/anoncreds/bundle.js +2 -10
- package/build/anoncreds/bundle.js.map +1 -1
- package/build/core/bundle.d.ts +6 -6
- package/build/core/bundle.js +2 -10
- package/build/core/bundle.js.map +1 -1
- package/build/didcomm/bundle.d.ts +6 -6
- package/build/didcomm/bundle.js +2 -10
- package/build/didcomm/bundle.js.map +1 -1
- package/build/drpc/bundle.d.ts +6 -6
- package/build/drpc/bundle.js +2 -10
- package/build/drpc/bundle.js.map +1 -1
- package/build/openid4vc/bundle.d.ts +6 -6
- package/build/openid4vc/bundle.js +2 -10
- package/build/openid4vc/bundle.js.map +1 -1
- package/build/question-answer/bundle.d.ts +6 -6
- package/build/question-answer/bundle.js +2 -10
- package/build/question-answer/bundle.js.map +1 -1
- package/build/tenants/bundle.d.ts +6 -6
- package/build/tenants/bundle.js +2 -10
- package/build/tenants/bundle.js.map +1 -1
- package/build/util.d.ts +3 -0
- package/build/util.js +16 -0
- package/build/util.js.map +1 -0
- package/cli/drizzle.config.ts +1 -3
- package/cli-build/drizzle.config.js +1 -3
- package/cli-build/drizzle.config.js.map +1 -1
- package/cli-build/generate-migrations.js +4 -4
- package/cli-build/generate-migrations.js.map +1 -1
- package/cli-build/run-migrations.js +1 -2
- package/cli-build/run-migrations.js.map +1 -1
- package/cli-build/utils.d.ts +3 -3
- package/cli-build/utils.js +3 -5
- package/cli-build/utils.js.map +1 -1
- package/package.json +9 -9
- package/src/DrizzleRecord.ts +5 -9
- package/src/action-menu/bundle.ts +2 -10
- package/src/anoncreds/bundle.ts +2 -10
- package/src/core/bundle.ts +2 -10
- package/src/didcomm/bundle.ts +2 -10
- package/src/drpc/bundle.ts +2 -10
- package/src/openid4vc/bundle.ts +2 -10
- package/src/question-answer/bundle.ts +2 -10
- package/src/tenants/bundle.ts +2 -10
- package/src/util.ts +14 -0
package/build/DrizzleRecord.d.ts
CHANGED
|
@@ -25,33 +25,29 @@ export interface DrizzleRecordBundle {
|
|
|
25
25
|
* file will only be resolved during generation of migrations, and thus it's not needed to publish
|
|
26
26
|
* the source files in your NPM package, as long as the module resolves during migration generation.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
schemaSourcePath: string;
|
|
29
29
|
/**
|
|
30
30
|
* The migrations path where the migrations should be generated and retrieved. Note that the contents
|
|
31
31
|
* of this directory must be published with your NPM package so it can be used to apply migrations.
|
|
32
32
|
*
|
|
33
|
-
* The path
|
|
34
|
-
* have different exports during development, this should still resolve to the generated migration files
|
|
35
|
-
* in the generated packages, so it's recommended to place your migrations outside of the src folder
|
|
33
|
+
* The path to the migrations directory MUST be abosulate.
|
|
36
34
|
*/
|
|
37
35
|
migrationsPath: string;
|
|
38
36
|
};
|
|
39
37
|
postgres: {
|
|
40
38
|
/**
|
|
41
|
-
* A resolvable
|
|
39
|
+
* A resolvable path that contains the drizzle Postgres schema definition for the complete bundle.
|
|
42
40
|
*
|
|
43
41
|
* NOTE: this MUST resolve to the TypeScript schema file, it cannot point to the built files. This
|
|
44
42
|
* file will only be resolved during generation of migrations, and thus it's not needed to publish
|
|
45
43
|
* the source files in your NPM package, as long as the module resolves during migration generation.
|
|
46
44
|
*/
|
|
47
|
-
|
|
45
|
+
schemaSourcePath: string;
|
|
48
46
|
/**
|
|
49
47
|
* The migrations path where the migrations should be generated and retrieved. Note that the contents
|
|
50
48
|
* of this directory must be published with your NPM package so it can be used to apply migrations.
|
|
51
49
|
*
|
|
52
|
-
* The path
|
|
53
|
-
* have different exports during development, this should still resolve to the generated migration files
|
|
54
|
-
* in the generated packages, so it's recommended to place your migrations outside of the src folder
|
|
50
|
+
* The path to the migrations directory MUST be abosulate.
|
|
55
51
|
*/
|
|
56
52
|
migrationsPath: string;
|
|
57
53
|
};
|
|
@@ -6,13 +6,13 @@ declare const _default: {
|
|
|
6
6
|
sqlite: typeof import("./action-menu/sqlite");
|
|
7
7
|
}];
|
|
8
8
|
readonly migrations: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
sqlite: {
|
|
10
|
+
schemaSourcePath: string;
|
|
11
|
+
migrationsPath: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
postgres: {
|
|
14
|
+
schemaSourcePath: string;
|
|
15
|
+
migrationsPath: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const action_menu_1 = require("./action-menu");
|
|
4
5
|
exports.default = {
|
|
5
6
|
name: 'action-menu',
|
|
6
7
|
records: [action_menu_1.didcommActionMenuDrizzleRecord],
|
|
7
|
-
migrations:
|
|
8
|
-
postgres: {
|
|
9
|
-
schemaModule: '@credo-ts/drizzle-storage/action-menu/postgres',
|
|
10
|
-
migrationsPath: '../../migrations/action-menu/postgres',
|
|
11
|
-
},
|
|
12
|
-
sqlite: {
|
|
13
|
-
schemaModule: '@credo-ts/drizzle-storage/action-menu/sqlite',
|
|
14
|
-
migrationsPath: '../../migrations/action-menu/sqlite',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
8
|
+
migrations: (0, util_1.bundleMigrationDefinition)('action-menu'),
|
|
17
9
|
};
|
|
18
10
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/action-menu/bundle.ts"],"names":[],"mappings":";;AACA,+CAA8D;AAE9D,kBAAe;IACb,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,CAAC,4CAA8B,CAAC;IAEzC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/action-menu/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,+CAA8D;AAE9D,kBAAe;IACb,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,CAAC,4CAA8B,CAAC;IAEzC,UAAU,EAAE,IAAA,gCAAyB,EAAC,aAAa,CAAC;CACd,CAAA"}
|
|
@@ -22,13 +22,13 @@ declare const _default: {
|
|
|
22
22
|
sqlite: typeof import("./link-secret/sqlite");
|
|
23
23
|
}, import("../DrizzleRecord").DrizzleRecord, import("../DrizzleRecord").DrizzleRecord, import("../DrizzleRecord").DrizzleRecord];
|
|
24
24
|
readonly migrations: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
sqlite: {
|
|
26
|
+
schemaSourcePath: string;
|
|
27
|
+
migrationsPath: string;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
postgres: {
|
|
30
|
+
schemaSourcePath: string;
|
|
31
|
+
migrationsPath: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const credential_1 = require("./credential");
|
|
4
5
|
const credential_definition_1 = require("./credential-definition");
|
|
5
6
|
const credential_definition_private_1 = require("./credential-definition-private");
|
|
@@ -20,15 +21,6 @@ exports.default = {
|
|
|
20
21
|
revocation_registry_definition_private_1.anonCredsRevocationRegistryDefinitionPrivateDrizzleRecord,
|
|
21
22
|
schema_1.anonCredsSchemaDrizzleRecord,
|
|
22
23
|
],
|
|
23
|
-
migrations:
|
|
24
|
-
postgres: {
|
|
25
|
-
schemaModule: '@credo-ts/drizzle-storage/anoncreds/postgres',
|
|
26
|
-
migrationsPath: '../../migrations/anoncreds/postgres',
|
|
27
|
-
},
|
|
28
|
-
sqlite: {
|
|
29
|
-
schemaModule: '@credo-ts/drizzle-storage/anoncreds/sqlite',
|
|
30
|
-
migrationsPath: '../../migrations/anoncreds/sqlite',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
24
|
+
migrations: (0, util_1.bundleMigrationDefinition)('anoncreds'),
|
|
33
25
|
};
|
|
34
26
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/anoncreds/bundle.ts"],"names":[],"mappings":";;AACA,6CAA+D;AAC/D,mEAAoF;AACpF,mFAAmG;AACnG,mEAAmF;AACnF,+CAAgE;AAChE,qFAAqG;AACrG,qGAAoH;AACpH,qCAAuD;AAEvD,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP,6CAAgC;QAChC,kEAA0C;QAC1C,iFAAiD;QACjD,iEAAyC;QACzC,8CAAgC;QAChC,mFAAkD;QAClD,kGAAyD;QACzD,qCAA4B;KAC7B;IAED,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/anoncreds/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,6CAA+D;AAC/D,mEAAoF;AACpF,mFAAmG;AACnG,mEAAmF;AACnF,+CAAgE;AAChE,qFAAqG;AACrG,qGAAoH;AACpH,qCAAuD;AAEvD,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP,6CAAgC;QAChC,kEAA0C;QAC1C,iFAAiD;QACjD,iEAAyC;QACzC,8CAAgC;QAChC,mFAAkD;QAClD,kGAAyD;QACzD,qCAA4B;KAC7B;IAED,UAAU,EAAE,IAAA,gCAAyB,EAAC,WAAW,CAAC;CACZ,CAAA"}
|
package/build/core/bundle.d.ts
CHANGED
|
@@ -33,13 +33,13 @@ declare const _default: {
|
|
|
33
33
|
sqlite: typeof import("./singleContextLruCache/sqlite");
|
|
34
34
|
}];
|
|
35
35
|
readonly migrations: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
sqlite: {
|
|
37
|
+
schemaSourcePath: string;
|
|
38
|
+
migrationsPath: string;
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
postgres: {
|
|
41
|
+
schemaSourcePath: string;
|
|
42
|
+
migrationsPath: string;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
};
|
package/build/core/bundle.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const context_1 = require("./context");
|
|
4
5
|
const did_1 = require("./did");
|
|
5
6
|
const genericRecord_1 = require("./genericRecord");
|
|
@@ -20,15 +21,6 @@ exports.default = {
|
|
|
20
21
|
w3cCredential_1.w3cCredentialDrizzleRecord,
|
|
21
22
|
singleContextLruCache_1.singleContextLruCacheDrizzleRecord,
|
|
22
23
|
],
|
|
23
|
-
migrations:
|
|
24
|
-
postgres: {
|
|
25
|
-
schemaModule: '@credo-ts/drizzle-storage/core/postgres',
|
|
26
|
-
migrationsPath: '../../migrations/core/postgres',
|
|
27
|
-
},
|
|
28
|
-
sqlite: {
|
|
29
|
-
schemaModule: '@credo-ts/drizzle-storage/core/sqlite',
|
|
30
|
-
migrationsPath: '../../migrations/core/sqlite',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
24
|
+
migrations: (0, util_1.bundleMigrationDefinition)('core'),
|
|
33
25
|
};
|
|
34
26
|
//# sourceMappingURL=bundle.js.map
|
package/build/core/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/core/bundle.ts"],"names":[],"mappings":";;AACA,uCAAgD;AAChD,+BAAwC;AACxC,mDAA4D;AAC5D,iCAA0C;AAC1C,uCAAgD;AAChD,mEAA4E;AAC5E,qDAA8D;AAC9D,mDAA4D;AAE5D,kBAAe;IACb,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;QACP,8BAAoB;QACpB,8BAAoB;QACpB,wBAAiB;QACjB,4CAA2B;QAC3B,0CAA0B;QAC1B,sBAAgB;QAChB,0CAA0B;QAC1B,0DAAkC;KACnC;IACD,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/core/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,uCAAgD;AAChD,+BAAwC;AACxC,mDAA4D;AAC5D,iCAA0C;AAC1C,uCAAgD;AAChD,mEAA4E;AAC5E,qDAA8D;AAC9D,mDAA4D;AAE5D,kBAAe;IACb,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;QACP,8BAAoB;QACpB,8BAAoB;QACpB,wBAAiB;QACjB,4CAA2B;QAC3B,0CAA0B;QAC1B,sBAAgB;QAChB,0CAA0B;QAC1B,0DAAkC;KACnC;IACD,UAAU,EAAE,IAAA,gCAAyB,EAAC,MAAM,CAAC;CACP,CAAA"}
|
|
@@ -34,13 +34,13 @@ declare const _default: {
|
|
|
34
34
|
sqlite: typeof import("./proof-exchange/sqlite");
|
|
35
35
|
}];
|
|
36
36
|
readonly migrations: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
sqlite: {
|
|
38
|
+
schemaSourcePath: string;
|
|
39
|
+
migrationsPath: string;
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
postgres: {
|
|
42
|
+
schemaSourcePath: string;
|
|
43
|
+
migrationsPath: string;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
};
|
package/build/didcomm/bundle.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const basic_message_1 = require("./basic-message");
|
|
4
5
|
const connection_1 = require("./connection");
|
|
5
6
|
const credential_exchange_1 = require("./credential-exchange");
|
|
@@ -20,15 +21,6 @@ exports.default = {
|
|
|
20
21
|
out_of_band_1.didcommOutOfBandDrizzleRecord,
|
|
21
22
|
proof_exchange_1.didcommProofExchangeDrizzleRecord,
|
|
22
23
|
],
|
|
23
|
-
migrations:
|
|
24
|
-
postgres: {
|
|
25
|
-
schemaModule: '@credo-ts/drizzle-storage/didcomm/postgres',
|
|
26
|
-
migrationsPath: '../../migrations/didcomm/postgres',
|
|
27
|
-
},
|
|
28
|
-
sqlite: {
|
|
29
|
-
schemaModule: '@credo-ts/drizzle-storage/didcomm/sqlite',
|
|
30
|
-
migrationsPath: '../../migrations/didcomm/sqlite',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
24
|
+
migrations: (0, util_1.bundleMigrationDefinition)('didcomm'),
|
|
33
25
|
};
|
|
34
26
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/didcomm/bundle.ts"],"names":[],"mappings":";;AACA,mDAAkE;AAClE,6CAA6D;AAC7D,+DAA8E;AAC9E,uDAA+D;AAC/D,2CAA2D;AAC3D,yDAAwE;AACxE,+CAA6D;AAC7D,qDAAoE;AAEpE,kBAAe;IACb,IAAI,EAAE,SAAS;IACf,OAAO,EAAE;QACP,gDAAgC;QAChC,2CAA8B;QAC9B,4DAAsC;QACtC,6CAA2B;QAC3B,yCAA6B;QAC7B,sDAAmC;QACnC,2CAA6B;QAC7B,kDAAiC;KAClC;IAED,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/didcomm/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,mDAAkE;AAClE,6CAA6D;AAC7D,+DAA8E;AAC9E,uDAA+D;AAC/D,2CAA2D;AAC3D,yDAAwE;AACxE,+CAA6D;AAC7D,qDAAoE;AAEpE,kBAAe;IACb,IAAI,EAAE,SAAS;IACf,OAAO,EAAE;QACP,gDAAgC;QAChC,2CAA8B;QAC9B,4DAAsC;QACtC,6CAA2B;QAC3B,yCAA6B;QAC7B,sDAAmC;QACnC,2CAA6B;QAC7B,kDAAiC;KAClC;IAED,UAAU,EAAE,IAAA,gCAAyB,EAAC,SAAS,CAAC;CACV,CAAA"}
|
package/build/drpc/bundle.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ declare const _default: {
|
|
|
6
6
|
sqlite: typeof import("./drpc/sqlite");
|
|
7
7
|
}];
|
|
8
8
|
readonly migrations: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
sqlite: {
|
|
10
|
+
schemaSourcePath: string;
|
|
11
|
+
migrationsPath: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
postgres: {
|
|
14
|
+
schemaSourcePath: string;
|
|
15
|
+
migrationsPath: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
};
|
package/build/drpc/bundle.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const drpc_1 = require("./drpc");
|
|
4
5
|
exports.default = {
|
|
5
6
|
name: 'drpc',
|
|
6
7
|
records: [drpc_1.didcommDrpcDrizzleRecord],
|
|
7
|
-
migrations:
|
|
8
|
-
postgres: {
|
|
9
|
-
schemaModule: '@credo-ts/drizzle-storage/drpc/postgres',
|
|
10
|
-
migrationsPath: '../../migrations/drpc/postgres',
|
|
11
|
-
},
|
|
12
|
-
sqlite: {
|
|
13
|
-
schemaModule: '@credo-ts/drizzle-storage/drpc/sqlite',
|
|
14
|
-
migrationsPath: '../../migrations/drpc/sqlite',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
8
|
+
migrations: (0, util_1.bundleMigrationDefinition)('drpc'),
|
|
17
9
|
};
|
|
18
10
|
//# sourceMappingURL=bundle.js.map
|
package/build/drpc/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/drpc/bundle.ts"],"names":[],"mappings":";;AACA,iCAAiD;AAEjD,kBAAe;IACb,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,CAAC,+BAAwB,CAAC;IAEnC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/drpc/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,iCAAiD;AAEjD,kBAAe;IACb,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,CAAC,+BAAwB,CAAC;IAEnC,UAAU,EAAE,IAAA,gCAAyB,EAAC,MAAM,CAAC;CACP,CAAA"}
|
|
@@ -18,13 +18,13 @@ declare const _default: {
|
|
|
18
18
|
sqlite: typeof import("./openid4vc-verification-session/sqlite");
|
|
19
19
|
}];
|
|
20
20
|
readonly migrations: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
sqlite: {
|
|
22
|
+
schemaSourcePath: string;
|
|
23
|
+
migrationsPath: string;
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
postgres: {
|
|
26
|
+
schemaSourcePath: string;
|
|
27
|
+
migrationsPath: string;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const openid4vc_issuance_session_1 = require("./openid4vc-issuance-session");
|
|
4
5
|
const openid4vc_issuer_1 = require("./openid4vc-issuer");
|
|
5
6
|
const openid4vc_verification_session_1 = require("./openid4vc-verification-session");
|
|
@@ -12,15 +13,6 @@ exports.default = {
|
|
|
12
13
|
openid4vc_verifier_1.openid4vcVerifierDrizzleRecord,
|
|
13
14
|
openid4vc_verification_session_1.openId4VcVerificationSessionDrizzleRecord,
|
|
14
15
|
],
|
|
15
|
-
migrations:
|
|
16
|
-
postgres: {
|
|
17
|
-
schemaModule: '@credo-ts/drizzle-storage/openid4vc/postgres',
|
|
18
|
-
migrationsPath: '../../migrations/openid4vc/postgres',
|
|
19
|
-
},
|
|
20
|
-
sqlite: {
|
|
21
|
-
schemaModule: '@credo-ts/drizzle-storage/openid4vc/sqlite',
|
|
22
|
-
migrationsPath: '../../migrations/openid4vc/sqlite',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
16
|
+
migrations: (0, util_1.bundleMigrationDefinition)('openid4vc'),
|
|
25
17
|
};
|
|
26
18
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/openid4vc/bundle.ts"],"names":[],"mappings":";;AACA,6EAAoF;AACpF,yDAAiE;AACjE,qFAA4F;AAC5F,6DAAqE;AAErE,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP,+CAA4B;QAC5B,kEAAqC;QACrC,mDAA8B;QAC9B,0EAAyC;KAC1C;IAED,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/openid4vc/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,6EAAoF;AACpF,yDAAiE;AACjE,qFAA4F;AAC5F,6DAAqE;AAErE,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP,+CAA4B;QAC5B,kEAAqC;QACrC,mDAA8B;QAC9B,0EAAyC;KAC1C;IAED,UAAU,EAAE,IAAA,gCAAyB,EAAC,WAAW,CAAC;CACZ,CAAA"}
|
|
@@ -6,13 +6,13 @@ declare const _default: {
|
|
|
6
6
|
sqlite: typeof import("./question-answer/sqlite");
|
|
7
7
|
}];
|
|
8
8
|
readonly migrations: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
sqlite: {
|
|
10
|
+
schemaSourcePath: string;
|
|
11
|
+
migrationsPath: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
postgres: {
|
|
14
|
+
schemaSourcePath: string;
|
|
15
|
+
migrationsPath: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const question_answer_1 = require("./question-answer");
|
|
4
5
|
exports.default = {
|
|
5
6
|
name: 'question-answer',
|
|
6
7
|
records: [question_answer_1.didcommQuestionAnswerDrizzleRecord],
|
|
7
|
-
migrations:
|
|
8
|
-
postgres: {
|
|
9
|
-
schemaModule: '@credo-ts/drizzle-storage/question-answer/postgres',
|
|
10
|
-
migrationsPath: '../../migrations/question-answer/postgres',
|
|
11
|
-
},
|
|
12
|
-
sqlite: {
|
|
13
|
-
schemaModule: '@credo-ts/drizzle-storage/question-answer/sqlite',
|
|
14
|
-
migrationsPath: '../../migrations/question-answer/sqlite',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
8
|
+
migrations: (0, util_1.bundleMigrationDefinition)('question-answer'),
|
|
17
9
|
};
|
|
18
10
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/question-answer/bundle.ts"],"names":[],"mappings":";;AACA,uDAAsE;AAEtE,kBAAe;IACb,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,CAAC,oDAAkC,CAAC;IAE7C,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/question-answer/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,uDAAsE;AAEtE,kBAAe;IACb,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,CAAC,oDAAkC,CAAC;IAE7C,UAAU,EAAE,IAAA,gCAAyB,EAAC,iBAAiB,CAAC;CAClB,CAAA"}
|
|
@@ -10,13 +10,13 @@ declare const _default: {
|
|
|
10
10
|
sqlite: typeof import("./tenant-routing/sqlite");
|
|
11
11
|
}];
|
|
12
12
|
readonly migrations: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
sqlite: {
|
|
14
|
+
schemaSourcePath: string;
|
|
15
|
+
migrationsPath: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
postgres: {
|
|
18
|
+
schemaSourcePath: string;
|
|
19
|
+
migrationsPath: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
};
|
package/build/tenants/bundle.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("../util");
|
|
3
4
|
const tenant_1 = require("./tenant");
|
|
4
5
|
const tenant_routing_1 = require("./tenant-routing");
|
|
5
6
|
exports.default = {
|
|
6
7
|
name: 'tenants',
|
|
7
8
|
records: [tenant_1.tenantDrizzleRecord, tenant_routing_1.tenantRoutingDrizzleRecord],
|
|
8
|
-
migrations:
|
|
9
|
-
postgres: {
|
|
10
|
-
schemaModule: '@credo-ts/drizzle-storage/tenants/postgres',
|
|
11
|
-
migrationsPath: '../../migrations/tenants/postgres',
|
|
12
|
-
},
|
|
13
|
-
sqlite: {
|
|
14
|
-
schemaModule: '@credo-ts/drizzle-storage/tenants/sqlite',
|
|
15
|
-
migrationsPath: '../../migrations/tenants/sqlite',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
9
|
+
migrations: (0, util_1.bundleMigrationDefinition)('tenants'),
|
|
18
10
|
};
|
|
19
11
|
//# sourceMappingURL=bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/tenants/bundle.ts"],"names":[],"mappings":";;AACA,qCAA8C;AAC9C,qDAA6D;AAE7D,kBAAe;IACb,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,4BAAmB,EAAE,2CAA0B,CAAC;IAE1D,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/tenants/bundle.ts"],"names":[],"mappings":";;AACA,kCAAmD;AACnD,qCAA8C;AAC9C,qDAA6D;AAE7D,kBAAe;IACb,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,4BAAmB,EAAE,2CAA0B,CAAC;IAE1D,UAAU,EAAE,IAAA,gCAAyB,EAAC,SAAS,CAAC;CACV,CAAA"}
|
package/build/util.d.ts
ADDED
package/build/util.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundleMigrationDefinition = exports.rootDirectory = void 0;
|
|
4
|
+
exports.rootDirectory = `${__dirname}/..`;
|
|
5
|
+
const bundleMigrationDefinition = (bundle) => ({
|
|
6
|
+
postgres: {
|
|
7
|
+
schemaSourcePath: `${exports.rootDirectory}/src/${bundle}/postgres.ts`,
|
|
8
|
+
migrationsPath: `${exports.rootDirectory}/migrations/${bundle}/postgres`,
|
|
9
|
+
},
|
|
10
|
+
sqlite: {
|
|
11
|
+
schemaSourcePath: `${exports.rootDirectory}/src/${bundle}/sqlite.ts`,
|
|
12
|
+
migrationsPath: `${exports.rootDirectory}/migrations/${bundle}/sqlite`,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
exports.bundleMigrationDefinition = bundleMigrationDefinition;
|
|
16
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG,GAAG,SAAS,KAAK,CAAA;AAEvC,MAAM,yBAAyB,GAAG,CAAC,MAAc,EAAqC,EAAE,CAAC,CAAC;IAC/F,QAAQ,EAAE;QACR,gBAAgB,EAAE,GAAG,qBAAa,QAAQ,MAAM,cAAc;QAC9D,cAAc,EAAE,GAAG,qBAAa,eAAe,MAAM,WAAW;KACjE;IACD,MAAM,EAAE;QACN,gBAAgB,EAAE,GAAG,qBAAa,QAAQ,MAAM,YAAY;QAC5D,cAAc,EAAE,GAAG,qBAAa,eAAe,MAAM,SAAS;KAC/D;CACF,CAAC,CAAA;AATW,QAAA,yBAAyB,6BASpC"}
|
package/cli/drizzle.config.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.config.js","sourceRoot":"","sources":["../cli/drizzle.config.ts"],"names":[],"mappings":";;AAAA,6CAAkD;AAElD,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA;AAE3D,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAA;AAClD,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,KAAK,QAAQ,IAAI,cAAc,KAAK,UAAU,CAAC,EAAE,CAAC;IACtF,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;AACnG,CAAC;AAED,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAA;AACzD,MAAM,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAA;AACrE,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAA;AAEnE,IAAI,aAAqB,CAAA;AAEzB,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;IAChC,aAAa,GAAG,IAAA,0BAAY,EAAC;QAC3B,OAAO,EAAE,cAAc;QACvB,gFAAgF;QAChF,gEAAgE;QAChE,MAAM,EAAE,iBAAiB;QACzB,GAAG,EAAE,uBAAuB;QAC5B,UAAU,EAAE,sBAAsB;YAChC,CAAC,CAAC;gBACE,KAAK,EAAE,sBAAsB;aAC9B;YACH,CAAC,CAAC,SAAS;QACb,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,aAAa,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;aAC3C;YACH,CAAC,CAAC;gBACE,MAAM,EAAE,MAAM;aACf,CAAC;KACP,CAAC,CAAA;AACJ,CAAC;KAAM,CAAC;IACN,aAAa,GAAG,IAAA,0BAAY,EAAC;QAC3B,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,iBAAiB;QACzB,GAAG,EAAE,uBAAuB;QAC5B,UAAU,EAAE,sBAAsB;YAChC,CAAC,CAAC;gBACE,KAAK,EAAE,sBAAsB;aAC9B;YACH,CAAC,CAAC,SAAS;QACb,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,aAAa,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;aAC3C;YACH,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"drizzle.config.js","sourceRoot":"","sources":["../cli/drizzle.config.ts"],"names":[],"mappings":";;AAAA,6CAAkD;AAElD,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA;AAE3D,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAA;AAClD,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,KAAK,QAAQ,IAAI,cAAc,KAAK,UAAU,CAAC,EAAE,CAAC;IACtF,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;AACnG,CAAC;AAED,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAA;AACzD,MAAM,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAA;AACrE,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAA;AAEnE,IAAI,aAAqB,CAAA;AAEzB,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;IAChC,aAAa,GAAG,IAAA,0BAAY,EAAC;QAC3B,OAAO,EAAE,cAAc;QACvB,gFAAgF;QAChF,gEAAgE;QAChE,MAAM,EAAE,iBAAiB;QACzB,GAAG,EAAE,uBAAuB;QAC5B,UAAU,EAAE,sBAAsB;YAChC,CAAC,CAAC;gBACE,KAAK,EAAE,sBAAsB;aAC9B;YACH,CAAC,CAAC,SAAS;QACb,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,aAAa,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;aAC3C;YACH,CAAC,CAAC;gBACE,MAAM,EAAE,MAAM;aACf,CAAC;KACP,CAAC,CAAA;AACJ,CAAC;KAAM,CAAC;IACN,aAAa,GAAG,IAAA,0BAAY,EAAC;QAC3B,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,iBAAiB;QACzB,GAAG,EAAE,uBAAuB;QAC5B,UAAU,EAAE,sBAAsB;YAChC,CAAC,CAAC;gBACE,KAAK,EAAE,sBAAsB;aAC9B;YACH,CAAC,CAAC,SAAS;QACb,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,aAAa,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;aAC3C;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -16,8 +16,8 @@ async function generateMigrations({ dialects, bundles, name }) {
|
|
|
16
16
|
const bundle = await (0, utils_1.resolveBundle)(bundleModule);
|
|
17
17
|
for (const dialect of dialects) {
|
|
18
18
|
const dialectBundle = bundle.migrations[dialect];
|
|
19
|
-
const schemaFile = await (0, utils_1.resolveSchemaFile)(dialectBundle.
|
|
20
|
-
const drizzleMigrationsFolder = (0, utils_1.getMigrationsDirectory)(
|
|
19
|
+
const schemaFile = await (0, utils_1.resolveSchemaFile)(dialectBundle.schemaSourcePath);
|
|
20
|
+
const drizzleMigrationsFolder = (0, utils_1.getMigrationsDirectory)(dialectBundle.migrationsPath);
|
|
21
21
|
const migrateResult = (0, child_process_1.spawnSync)(tsNodeCliPath, [
|
|
22
22
|
'--project',
|
|
23
23
|
tsconfig,
|
|
@@ -36,9 +36,9 @@ async function generateMigrations({ dialects, bundles, name }) {
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
if (migrateResult.status !== 0) {
|
|
39
|
-
throw new Error(`Error generating migrations for schema ${dialectBundle.
|
|
39
|
+
throw new Error(`Error generating migrations for schema ${dialectBundle.schemaSourcePath} with dialect ${dialect}. Error: ${migrateResult.stderr || migrateResult.stdout}`);
|
|
40
40
|
}
|
|
41
|
-
(0, utils_1.log)(`Generated migrations for ${dialectBundle.
|
|
41
|
+
(0, utils_1.log)(`Generated migrations for ${dialectBundle.schemaSourcePath} with dialect ${dialect}:`);
|
|
42
42
|
(0, utils_1.log)(migrateResult.stdout);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-migrations.js","sourceRoot":"","sources":["../cli/generate-migrations.ts"],"names":[],"mappings":";;;;;AAoBA,gDA+CC;AAnED,iDAAyC;AACzC,gDAAuB;AACvB,mCAQgB;AAUT,KAAK,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAA4B;IAC5F,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAA;IAEvE,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAChD,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAChD,MAAM,aAAa,GAAG,IAAA,wBAAgB,GAAE,CAAA;IAExC,KAAK,MAAM,YAAY,IAAI,OAAO,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,YAAY,CAAC,CAAA;QAEhD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAChD,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAiB,EAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"generate-migrations.js","sourceRoot":"","sources":["../cli/generate-migrations.ts"],"names":[],"mappings":";;;;;AAoBA,gDA+CC;AAnED,iDAAyC;AACzC,gDAAuB;AACvB,mCAQgB;AAUT,KAAK,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAA4B;IAC5F,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAA;IAEvE,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAChD,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAChD,MAAM,aAAa,GAAG,IAAA,wBAAgB,GAAE,CAAA;IAExC,KAAK,MAAM,YAAY,IAAI,OAAO,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,YAAY,CAAC,CAAA;QAEhD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAChD,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAiB,EAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;YAC1E,MAAM,uBAAuB,GAAG,IAAA,8BAAsB,EAAC,aAAa,CAAC,cAAc,CAAC,CAAA;YAEpF,MAAM,aAAa,GAAG,IAAA,yBAAS,EAC7B,aAAa,EACb;gBACE,WAAW;gBACX,QAAQ;gBACR,iBAAiB;gBACjB,UAAU;gBACV,UAAU;gBACV,iBAAiB;gBACjB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAClC,EACD;gBACE,QAAQ,EAAE,OAAO;gBACjB,GAAG,EAAE;oBACH,GAAG,OAAO,CAAC,GAAG;oBACd,eAAe,EAAE,OAAO;oBACxB,mBAAmB,EAAE,UAAU;oBAC/B,yBAAyB,EAAE,uBAAuB;iBACnD;aACF,CACF,CAAA;YAED,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CACb,0CAA0C,aAAa,CAAC,gBAAgB,iBAAiB,OAAO,YAAY,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,EAAE,CAC3J,CAAA;YACH,CAAC;YAED,IAAA,WAAG,EAAC,4BAA4B,aAAa,CAAC,gBAAgB,iBAAiB,OAAO,GAAG,CAAC,CAAA;YAC1F,IAAA,WAAG,EAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -9,8 +9,7 @@ async function runMigrations({ database, bundles }) {
|
|
|
9
9
|
for (const bundleModule of bundles) {
|
|
10
10
|
const bundle = await (0, utils_1.resolveBundle)(bundleModule);
|
|
11
11
|
const dialectBundle = bundle.migrations[database.dialect];
|
|
12
|
-
const
|
|
13
|
-
const drizzleMigrationsFolder = (0, utils_1.getMigrationsDirectory)(schemaFile, dialectBundle.migrationsPath);
|
|
12
|
+
const drizzleMigrationsFolder = (0, utils_1.getMigrationsDirectory)(dialectBundle.migrationsPath);
|
|
14
13
|
const migrateResult = (0, child_process_1.spawnSync)(drizzleKitCliPath, ['migrate', '--config', drizzleConfigPath], {
|
|
15
14
|
encoding: 'utf-8',
|
|
16
15
|
env: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-migrations.js","sourceRoot":"","sources":["../cli/run-migrations.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"run-migrations.js","sourceRoot":"","sources":["../cli/run-migrations.ts"],"names":[],"mappings":";;AAaA,sCA6BC;AA1CD,iDAAyC;AAEzC,mCAAgH;AAWzG,KAAK,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAwB;IAC7E,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAChD,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAA;IAEhD,KAAK,MAAM,YAAY,IAAI,OAAO,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,YAAY,CAAC,CAAA;QAChD,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACzD,MAAM,uBAAuB,GAAG,IAAA,8BAAsB,EAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAEpF,MAAM,aAAa,GAAG,IAAA,yBAAS,EAAC,iBAAiB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,EAAE;YAC7F,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE;gBACH,GAAG,OAAO,CAAC,GAAG;gBACd,oBAAoB,EAAE,QAAQ,CAAC,GAAG;gBAClC,eAAe,EAAE,QAAQ,CAAC,OAAO;gBACjC,yBAAyB,EAAE,uBAAuB;gBAClD,wBAAwB,EAAE,qBAAqB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;aAClH;SACF,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,wCAAwC,YAAY,iBAAiB,QAAQ,CAAC,OAAO,YAAY,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,EAAE,CAChJ,CAAA;QACH,CAAC;QAED,IAAA,WAAG,EAAC,mBAAmB,YAAY,gBAAgB,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAA;QACvE,IAAA,WAAG,EAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC"}
|
package/cli-build/utils.d.ts
CHANGED
|
@@ -2,17 +2,17 @@ export declare function resolveBundle(bundle: string): Promise<{
|
|
|
2
2
|
name: string;
|
|
3
3
|
migrations: {
|
|
4
4
|
sqlite: {
|
|
5
|
-
|
|
5
|
+
schemaSourcePath: string;
|
|
6
6
|
migrationsPath: string;
|
|
7
7
|
};
|
|
8
8
|
postgres: {
|
|
9
|
-
|
|
9
|
+
schemaSourcePath: string;
|
|
10
10
|
migrationsPath: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
}>;
|
|
14
14
|
export declare function resolveSchemaFile(schemaModule: string): Promise<string>;
|
|
15
|
-
export declare function getMigrationsDirectory(
|
|
15
|
+
export declare function getMigrationsDirectory(migrationsPath: string): string;
|
|
16
16
|
export declare function getDrizzleConfigPath(): string;
|
|
17
17
|
export declare function getDrizzleKitCliPath(): string;
|
|
18
18
|
export declare function getTsNodeCliPath(): string;
|
package/cli-build/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ exports.errorLog = errorLog;
|
|
|
14
14
|
const fs_1 = require("fs");
|
|
15
15
|
const path_1 = __importDefault(require("path"));
|
|
16
16
|
async function resolveBundle(bundle) {
|
|
17
|
-
const options = [bundle];
|
|
17
|
+
const options = [bundle, path_1.default.join(process.cwd(), bundle)];
|
|
18
18
|
if (!bundle.startsWith('/')) {
|
|
19
19
|
options.push(`@credo-ts/drizzle-storage/${bundle}`);
|
|
20
20
|
}
|
|
@@ -49,10 +49,8 @@ async function resolveSchemaFile(schemaModule) {
|
|
|
49
49
|
throw new Error(`Unable to resolve schema module ${schemaModule}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function getMigrationsDirectory(
|
|
53
|
-
const
|
|
54
|
-
const drizzleMigrationsFolder = path_1.default.join(schemaDirectory, migrationsPath);
|
|
55
|
-
const schemaMigrationsDirectory = path_1.default.relative(process.cwd(), drizzleMigrationsFolder);
|
|
52
|
+
function getMigrationsDirectory(migrationsPath) {
|
|
53
|
+
const schemaMigrationsDirectory = path_1.default.relative(process.cwd(), migrationsPath);
|
|
56
54
|
return schemaMigrationsDirectory;
|
|
57
55
|
}
|
|
58
56
|
function getDrizzleConfigPath() {
|
package/cli-build/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../cli/utils.ts"],"names":[],"mappings":";;;;;AAGA,sCAyCC;AAED,8CAOC;AAED,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../cli/utils.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credo-ts/drizzle-storage",
|
|
3
|
-
"version": "0.6.0-pr-2324-
|
|
3
|
+
"version": "0.6.0-pr-2324-20250709092632",
|
|
4
4
|
"files": [
|
|
5
5
|
"build",
|
|
6
6
|
"cli-build",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"ts-node": "^10.9.2",
|
|
53
53
|
"tsyringe": "^4.8.0",
|
|
54
54
|
"zod": "^3.24.2",
|
|
55
|
-
"@credo-ts/action-menu": "0.6.0-pr-2324-
|
|
56
|
-
"@credo-ts/anoncreds": "0.6.0-pr-2324-
|
|
57
|
-
"@credo-ts/core": "0.6.0-pr-2324-
|
|
58
|
-
"@credo-ts/didcomm": "0.6.0-pr-2324-
|
|
59
|
-
"@credo-ts/drpc": "0.6.0-pr-2324-
|
|
60
|
-
"@credo-ts/openid4vc": "0.6.0-pr-2324-
|
|
61
|
-
"@credo-ts/question-answer": "0.6.0-pr-2324-
|
|
62
|
-
"@credo-ts/tenants": "0.6.0-pr-2324-
|
|
55
|
+
"@credo-ts/action-menu": "0.6.0-pr-2324-20250709092632",
|
|
56
|
+
"@credo-ts/anoncreds": "0.6.0-pr-2324-20250709092632",
|
|
57
|
+
"@credo-ts/core": "0.6.0-pr-2324-20250709092632",
|
|
58
|
+
"@credo-ts/didcomm": "0.6.0-pr-2324-20250709092632",
|
|
59
|
+
"@credo-ts/drpc": "0.6.0-pr-2324-20250709092632",
|
|
60
|
+
"@credo-ts/openid4vc": "0.6.0-pr-2324-20250709092632",
|
|
61
|
+
"@credo-ts/question-answer": "0.6.0-pr-2324-20250709092632",
|
|
62
|
+
"@credo-ts/tenants": "0.6.0-pr-2324-20250709092632"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"drizzle-orm": "^0.44.2"
|
package/src/DrizzleRecord.ts
CHANGED
|
@@ -28,35 +28,31 @@ export interface DrizzleRecordBundle {
|
|
|
28
28
|
* file will only be resolved during generation of migrations, and thus it's not needed to publish
|
|
29
29
|
* the source files in your NPM package, as long as the module resolves during migration generation.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
schemaSourcePath: string
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* The migrations path where the migrations should be generated and retrieved. Note that the contents
|
|
35
35
|
* of this directory must be published with your NPM package so it can be used to apply migrations.
|
|
36
36
|
*
|
|
37
|
-
* The path
|
|
38
|
-
* have different exports during development, this should still resolve to the generated migration files
|
|
39
|
-
* in the generated packages, so it's recommended to place your migrations outside of the src folder
|
|
37
|
+
* The path to the migrations directory MUST be abosulate.
|
|
40
38
|
*/
|
|
41
39
|
migrationsPath: string
|
|
42
40
|
}
|
|
43
41
|
postgres: {
|
|
44
42
|
/**
|
|
45
|
-
* A resolvable
|
|
43
|
+
* A resolvable path that contains the drizzle Postgres schema definition for the complete bundle.
|
|
46
44
|
*
|
|
47
45
|
* NOTE: this MUST resolve to the TypeScript schema file, it cannot point to the built files. This
|
|
48
46
|
* file will only be resolved during generation of migrations, and thus it's not needed to publish
|
|
49
47
|
* the source files in your NPM package, as long as the module resolves during migration generation.
|
|
50
48
|
*/
|
|
51
|
-
|
|
49
|
+
schemaSourcePath: string
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
52
|
* The migrations path where the migrations should be generated and retrieved. Note that the contents
|
|
55
53
|
* of this directory must be published with your NPM package so it can be used to apply migrations.
|
|
56
54
|
*
|
|
57
|
-
* The path
|
|
58
|
-
* have different exports during development, this should still resolve to the generated migration files
|
|
59
|
-
* in the generated packages, so it's recommended to place your migrations outside of the src folder
|
|
55
|
+
* The path to the migrations directory MUST be abosulate.
|
|
60
56
|
*/
|
|
61
57
|
migrationsPath: string
|
|
62
58
|
}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { didcommActionMenuDrizzleRecord } from './action-menu'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
name: 'action-menu',
|
|
6
7
|
records: [didcommActionMenuDrizzleRecord],
|
|
7
8
|
|
|
8
|
-
migrations:
|
|
9
|
-
postgres: {
|
|
10
|
-
schemaModule: '@credo-ts/drizzle-storage/action-menu/postgres',
|
|
11
|
-
migrationsPath: '../../migrations/action-menu/postgres',
|
|
12
|
-
},
|
|
13
|
-
sqlite: {
|
|
14
|
-
schemaModule: '@credo-ts/drizzle-storage/action-menu/sqlite',
|
|
15
|
-
migrationsPath: '../../migrations/action-menu/sqlite',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
9
|
+
migrations: bundleMigrationDefinition('action-menu'),
|
|
18
10
|
} as const satisfies DrizzleRecordBundle
|
package/src/anoncreds/bundle.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { anonCredsCredentialDrizzleRecord } from './credential'
|
|
3
4
|
import { anonCredsCredentialDefinitionDrizzleRecord } from './credential-definition'
|
|
4
5
|
import { anonCredsCredentialDefinitionPrivateDrizzleRecord } from './credential-definition-private'
|
|
@@ -21,14 +22,5 @@ export default {
|
|
|
21
22
|
anonCredsSchemaDrizzleRecord,
|
|
22
23
|
],
|
|
23
24
|
|
|
24
|
-
migrations:
|
|
25
|
-
postgres: {
|
|
26
|
-
schemaModule: '@credo-ts/drizzle-storage/anoncreds/postgres',
|
|
27
|
-
migrationsPath: '../../migrations/anoncreds/postgres',
|
|
28
|
-
},
|
|
29
|
-
sqlite: {
|
|
30
|
-
schemaModule: '@credo-ts/drizzle-storage/anoncreds/sqlite',
|
|
31
|
-
migrationsPath: '../../migrations/anoncreds/sqlite',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
25
|
+
migrations: bundleMigrationDefinition('anoncreds'),
|
|
34
26
|
} as const satisfies DrizzleRecordBundle
|
package/src/core/bundle.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { contextDrizzleRecord } from './context'
|
|
3
4
|
import { didDrizzleRecord } from './did'
|
|
4
5
|
import { genericRecordDrizzleRecord } from './genericRecord'
|
|
@@ -20,14 +21,5 @@ export default {
|
|
|
20
21
|
w3cCredentialDrizzleRecord,
|
|
21
22
|
singleContextLruCacheDrizzleRecord,
|
|
22
23
|
],
|
|
23
|
-
migrations:
|
|
24
|
-
postgres: {
|
|
25
|
-
schemaModule: '@credo-ts/drizzle-storage/core/postgres',
|
|
26
|
-
migrationsPath: '../../migrations/core/postgres',
|
|
27
|
-
},
|
|
28
|
-
sqlite: {
|
|
29
|
-
schemaModule: '@credo-ts/drizzle-storage/core/sqlite',
|
|
30
|
-
migrationsPath: '../../migrations/core/sqlite',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
24
|
+
migrations: bundleMigrationDefinition('core'),
|
|
33
25
|
} as const satisfies DrizzleRecordBundle
|
package/src/didcomm/bundle.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { didcommBasicMessageDrizzleRecord } from './basic-message'
|
|
3
4
|
import { didcommConnectionDrizzleRecord } from './connection'
|
|
4
5
|
import { didcommCredentialExchangeDrizzleRecord } from './credential-exchange'
|
|
@@ -21,14 +22,5 @@ export default {
|
|
|
21
22
|
didcommProofExchangeDrizzleRecord,
|
|
22
23
|
],
|
|
23
24
|
|
|
24
|
-
migrations:
|
|
25
|
-
postgres: {
|
|
26
|
-
schemaModule: '@credo-ts/drizzle-storage/didcomm/postgres',
|
|
27
|
-
migrationsPath: '../../migrations/didcomm/postgres',
|
|
28
|
-
},
|
|
29
|
-
sqlite: {
|
|
30
|
-
schemaModule: '@credo-ts/drizzle-storage/didcomm/sqlite',
|
|
31
|
-
migrationsPath: '../../migrations/didcomm/sqlite',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
25
|
+
migrations: bundleMigrationDefinition('didcomm'),
|
|
34
26
|
} as const satisfies DrizzleRecordBundle
|
package/src/drpc/bundle.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { didcommDrpcDrizzleRecord } from './drpc'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
name: 'drpc',
|
|
6
7
|
records: [didcommDrpcDrizzleRecord],
|
|
7
8
|
|
|
8
|
-
migrations:
|
|
9
|
-
postgres: {
|
|
10
|
-
schemaModule: '@credo-ts/drizzle-storage/drpc/postgres',
|
|
11
|
-
migrationsPath: '../../migrations/drpc/postgres',
|
|
12
|
-
},
|
|
13
|
-
sqlite: {
|
|
14
|
-
schemaModule: '@credo-ts/drizzle-storage/drpc/sqlite',
|
|
15
|
-
migrationsPath: '../../migrations/drpc/sqlite',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
9
|
+
migrations: bundleMigrationDefinition('drpc'),
|
|
18
10
|
} as const satisfies DrizzleRecordBundle
|
package/src/openid4vc/bundle.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { openId4VcIssuanceSessionDrizzleRecord } from './openid4vc-issuance-session'
|
|
3
4
|
import { openid4vcIssuerDrizzleRecord } from './openid4vc-issuer'
|
|
4
5
|
import { openId4VcVerificationSessionDrizzleRecord } from './openid4vc-verification-session'
|
|
@@ -13,14 +14,5 @@ export default {
|
|
|
13
14
|
openId4VcVerificationSessionDrizzleRecord,
|
|
14
15
|
],
|
|
15
16
|
|
|
16
|
-
migrations:
|
|
17
|
-
postgres: {
|
|
18
|
-
schemaModule: '@credo-ts/drizzle-storage/openid4vc/postgres',
|
|
19
|
-
migrationsPath: '../../migrations/openid4vc/postgres',
|
|
20
|
-
},
|
|
21
|
-
sqlite: {
|
|
22
|
-
schemaModule: '@credo-ts/drizzle-storage/openid4vc/sqlite',
|
|
23
|
-
migrationsPath: '../../migrations/openid4vc/sqlite',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
17
|
+
migrations: bundleMigrationDefinition('openid4vc'),
|
|
26
18
|
} as const satisfies DrizzleRecordBundle
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { didcommQuestionAnswerDrizzleRecord } from './question-answer'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
name: 'question-answer',
|
|
6
7
|
records: [didcommQuestionAnswerDrizzleRecord],
|
|
7
8
|
|
|
8
|
-
migrations:
|
|
9
|
-
postgres: {
|
|
10
|
-
schemaModule: '@credo-ts/drizzle-storage/question-answer/postgres',
|
|
11
|
-
migrationsPath: '../../migrations/question-answer/postgres',
|
|
12
|
-
},
|
|
13
|
-
sqlite: {
|
|
14
|
-
schemaModule: '@credo-ts/drizzle-storage/question-answer/sqlite',
|
|
15
|
-
migrationsPath: '../../migrations/question-answer/sqlite',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
9
|
+
migrations: bundleMigrationDefinition('question-answer'),
|
|
18
10
|
} as const satisfies DrizzleRecordBundle
|
package/src/tenants/bundle.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DrizzleRecordBundle } from '../DrizzleRecord'
|
|
2
|
+
import { bundleMigrationDefinition } from '../util'
|
|
2
3
|
import { tenantDrizzleRecord } from './tenant'
|
|
3
4
|
import { tenantRoutingDrizzleRecord } from './tenant-routing'
|
|
4
5
|
|
|
@@ -6,14 +7,5 @@ export default {
|
|
|
6
7
|
name: 'tenants',
|
|
7
8
|
records: [tenantDrizzleRecord, tenantRoutingDrizzleRecord],
|
|
8
9
|
|
|
9
|
-
migrations:
|
|
10
|
-
postgres: {
|
|
11
|
-
schemaModule: '@credo-ts/drizzle-storage/tenants/postgres',
|
|
12
|
-
migrationsPath: '../../migrations/tenants/postgres',
|
|
13
|
-
},
|
|
14
|
-
sqlite: {
|
|
15
|
-
schemaModule: '@credo-ts/drizzle-storage/tenants/sqlite',
|
|
16
|
-
migrationsPath: '../../migrations/tenants/sqlite',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
10
|
+
migrations: bundleMigrationDefinition('tenants'),
|
|
19
11
|
} as const satisfies DrizzleRecordBundle
|
package/src/util.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DrizzleRecordBundle } from './DrizzleRecord'
|
|
2
|
+
|
|
3
|
+
export const rootDirectory = `${__dirname}/..`
|
|
4
|
+
|
|
5
|
+
export const bundleMigrationDefinition = (bundle: string): DrizzleRecordBundle['migrations'] => ({
|
|
6
|
+
postgres: {
|
|
7
|
+
schemaSourcePath: `${rootDirectory}/src/${bundle}/postgres.ts`,
|
|
8
|
+
migrationsPath: `${rootDirectory}/migrations/${bundle}/postgres`,
|
|
9
|
+
},
|
|
10
|
+
sqlite: {
|
|
11
|
+
schemaSourcePath: `${rootDirectory}/src/${bundle}/sqlite.ts`,
|
|
12
|
+
migrationsPath: `${rootDirectory}/migrations/${bundle}/sqlite`,
|
|
13
|
+
},
|
|
14
|
+
})
|