@unchainedshop/core 3.0.0-alpha3 → 3.0.0-alpha5
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/lib/core-index.d.ts +3 -3
- package/lib/core-index.d.ts.map +1 -1
- package/lib/types.d.ts +0 -28
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -1
- package/package.json +22 -22
- package/src/core-index.ts +3 -3
- package/src/types.ts +0 -31
- package/tests/core.test.ts +2 -4
package/lib/core-index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BulkImporter
|
|
1
|
+
import { BulkImporter } from './types.js';
|
|
2
2
|
import { AssortmentsModule, AssortmentsSettingsOptions } from '@unchainedshop/core-assortments';
|
|
3
3
|
import { BookmarkServices, BookmarksModule } from '@unchainedshop/core-bookmarks';
|
|
4
4
|
import { CountriesModule } from '@unchainedshop/core-countries';
|
|
@@ -17,7 +17,7 @@ import { QuotationsModule, QuotationsSettingsOptions } from '@unchainedshop/core
|
|
|
17
17
|
import { UserServices, UserSettingsOptions, UsersModule } from '@unchainedshop/core-users';
|
|
18
18
|
import { WarehousingModule } from '@unchainedshop/core-warehousing';
|
|
19
19
|
import { WorkerModule, WorkerSettingsOptions } from '@unchainedshop/core-worker';
|
|
20
|
-
import { mongodb } from '@unchainedshop/mongodb';
|
|
20
|
+
import { mongodb, MigrationRepository, ModuleInput } from '@unchainedshop/mongodb';
|
|
21
21
|
export * from './types.js';
|
|
22
22
|
export interface ModuleOptions {
|
|
23
23
|
assortments?: AssortmentsSettingsOptions;
|
|
@@ -34,7 +34,7 @@ export interface ModuleOptions {
|
|
|
34
34
|
}
|
|
35
35
|
export interface UnchainedCoreOptions {
|
|
36
36
|
db: mongodb.Db;
|
|
37
|
-
migrationRepository: MigrationRepository<
|
|
37
|
+
migrationRepository: MigrationRepository<UnchainedCore>;
|
|
38
38
|
bulkImporter: any;
|
|
39
39
|
modules?: Record<string, {
|
|
40
40
|
configure: (params: ModuleInput<any>) => any;
|
package/lib/core-index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-index.d.ts","sourceRoot":"","sources":["../src/core-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"core-index.d.ts","sourceRoot":"","sources":["../src/core-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAE3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,gBAAgB,EAEhB,eAAe,EAEhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAA4B,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAA6B,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAEL,cAAc,EACd,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAyB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAEL,YAAY,EAEZ,WAAW,EACX,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,aAAa,EACb,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAA4B,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAA4B,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAEL,aAAa,EAEb,YAAY,EACZ,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,aAAa,EACb,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,eAAe,EAEf,cAAc,EACd,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,E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AW,OAAO;IACtB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,eAAO,MAAM,QAAQ,2EAOlB,oBAAoB,KAAG,OAAO,CAAC,aAAa,CAmI9C,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import type { mongodb } from '@unchainedshop/mongodb';
|
|
2
|
-
import type { UnchainedCore } from './core-index.js';
|
|
3
1
|
export interface BulkImporter {
|
|
4
2
|
createBulkImporter: (options: any) => any;
|
|
5
3
|
}
|
|
6
|
-
export interface Migration {
|
|
7
|
-
id: number;
|
|
8
|
-
name: string;
|
|
9
|
-
up: (params: {
|
|
10
|
-
logger: any | Console;
|
|
11
|
-
unchainedAPI: UnchainedCore;
|
|
12
|
-
}) => Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export interface MigrationRepository<MigrationInstance extends Migration> {
|
|
15
|
-
db: mongodb.Db;
|
|
16
|
-
migrations: Map<number, MigrationInstance>;
|
|
17
|
-
register: (migration: MigrationInstance) => void;
|
|
18
|
-
allMigrations: () => Array<MigrationInstance>;
|
|
19
|
-
}
|
|
20
|
-
export interface ModuleInput<Options extends Record<string, any>> {
|
|
21
|
-
db: mongodb.Db;
|
|
22
|
-
migrationRepository?: MigrationRepository<Migration>;
|
|
23
|
-
options?: Options;
|
|
24
|
-
}
|
|
25
|
-
export interface ModuleCreateMutation<T> {
|
|
26
|
-
create: (doc: T) => Promise<string | null>;
|
|
27
|
-
}
|
|
28
|
-
export interface ModuleMutations<T> extends ModuleCreateMutation<T> {
|
|
29
|
-
update: (_id: string, doc: mongodb.UpdateFilter<T> | T) => Promise<string>;
|
|
30
|
-
delete: (_id: string) => Promise<number>;
|
|
31
|
-
}
|
|
32
4
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;CAC3C"}
|
package/lib/types.js
CHANGED
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAIA;;GAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-alpha5",
|
|
4
4
|
"main": "lib/core-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/core-index.js",
|
|
@@ -31,30 +31,30 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@unchainedshop/core-assortments": "^3.0.0-
|
|
35
|
-
"@unchainedshop/core-bookmarks": "^3.0.0-
|
|
36
|
-
"@unchainedshop/core-countries": "^3.0.0-
|
|
37
|
-
"@unchainedshop/core-currencies": "^3.0.0-
|
|
38
|
-
"@unchainedshop/core-delivery": "^3.0.0-
|
|
39
|
-
"@unchainedshop/core-enrollments": "^3.0.0-
|
|
40
|
-
"@unchainedshop/core-events": "^3.0.0-
|
|
41
|
-
"@unchainedshop/core-files": "^3.0.0-
|
|
42
|
-
"@unchainedshop/core-filters": "^3.0.0-
|
|
43
|
-
"@unchainedshop/core-languages": "^3.0.0-
|
|
44
|
-
"@unchainedshop/core-messaging": "^3.0.0-
|
|
45
|
-
"@unchainedshop/core-orders": "^3.0.0-
|
|
46
|
-
"@unchainedshop/core-payment": "^3.0.0-
|
|
47
|
-
"@unchainedshop/core-products": "^3.0.0-
|
|
48
|
-
"@unchainedshop/core-quotations": "^3.0.0-
|
|
49
|
-
"@unchainedshop/core-users": "^3.0.0-
|
|
50
|
-
"@unchainedshop/core-warehousing": "^3.0.0-
|
|
51
|
-
"@unchainedshop/core-worker": "^3.0.0-
|
|
52
|
-
"@unchainedshop/logger": "^3.0.0-
|
|
34
|
+
"@unchainedshop/core-assortments": "^3.0.0-alpha4",
|
|
35
|
+
"@unchainedshop/core-bookmarks": "^3.0.0-alpha4",
|
|
36
|
+
"@unchainedshop/core-countries": "^3.0.0-alpha4",
|
|
37
|
+
"@unchainedshop/core-currencies": "^3.0.0-alpha4",
|
|
38
|
+
"@unchainedshop/core-delivery": "^3.0.0-alpha4",
|
|
39
|
+
"@unchainedshop/core-enrollments": "^3.0.0-alpha4",
|
|
40
|
+
"@unchainedshop/core-events": "^3.0.0-alpha4",
|
|
41
|
+
"@unchainedshop/core-files": "^3.0.0-alpha4",
|
|
42
|
+
"@unchainedshop/core-filters": "^3.0.0-alpha4",
|
|
43
|
+
"@unchainedshop/core-languages": "^3.0.0-alpha4",
|
|
44
|
+
"@unchainedshop/core-messaging": "^3.0.0-alpha4",
|
|
45
|
+
"@unchainedshop/core-orders": "^3.0.0-alpha4",
|
|
46
|
+
"@unchainedshop/core-payment": "^3.0.0-alpha4",
|
|
47
|
+
"@unchainedshop/core-products": "^3.0.0-alpha4",
|
|
48
|
+
"@unchainedshop/core-quotations": "^3.0.0-alpha4",
|
|
49
|
+
"@unchainedshop/core-users": "^3.0.0-alpha4",
|
|
50
|
+
"@unchainedshop/core-warehousing": "^3.0.0-alpha4",
|
|
51
|
+
"@unchainedshop/core-worker": "^3.0.0-alpha4",
|
|
52
|
+
"@unchainedshop/logger": "^3.0.0-alpha4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^22.
|
|
55
|
+
"@types/node": "^22.8.1",
|
|
56
56
|
"jest": "^29.7.0",
|
|
57
57
|
"ts-jest": "^29.2.5",
|
|
58
|
-
"typescript": "^5.6.
|
|
58
|
+
"typescript": "^5.6.3"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/src/core-index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BulkImporter
|
|
1
|
+
import { BulkImporter } from './types.js';
|
|
2
2
|
import {
|
|
3
3
|
AssortmentsModule,
|
|
4
4
|
AssortmentsSettingsOptions,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
} from '@unchainedshop/core-users';
|
|
71
71
|
import { configureWarehousingModule, WarehousingModule } from '@unchainedshop/core-warehousing';
|
|
72
72
|
import { configureWorkerModule, WorkerModule, WorkerSettingsOptions } from '@unchainedshop/core-worker';
|
|
73
|
-
import { mongodb } from '@unchainedshop/mongodb';
|
|
73
|
+
import { mongodb, MigrationRepository, ModuleInput } from '@unchainedshop/mongodb';
|
|
74
74
|
|
|
75
75
|
export * from './types.js';
|
|
76
76
|
|
|
@@ -90,7 +90,7 @@ export interface ModuleOptions {
|
|
|
90
90
|
|
|
91
91
|
export interface UnchainedCoreOptions {
|
|
92
92
|
db: mongodb.Db;
|
|
93
|
-
migrationRepository: MigrationRepository<
|
|
93
|
+
migrationRepository: MigrationRepository<UnchainedCore>;
|
|
94
94
|
bulkImporter: any;
|
|
95
95
|
modules?: Record<
|
|
96
96
|
string,
|
package/src/types.ts
CHANGED
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
import type { mongodb } from '@unchainedshop/mongodb';
|
|
2
|
-
import type { UnchainedCore } from './core-index.js';
|
|
3
|
-
|
|
4
1
|
export interface BulkImporter {
|
|
5
2
|
createBulkImporter: (options: any) => any;
|
|
6
3
|
}
|
|
7
4
|
|
|
8
|
-
export interface Migration {
|
|
9
|
-
id: number;
|
|
10
|
-
name: string;
|
|
11
|
-
up: (params: { logger: any | Console; unchainedAPI: UnchainedCore }) => Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface MigrationRepository<MigrationInstance extends Migration> {
|
|
15
|
-
db: mongodb.Db;
|
|
16
|
-
migrations: Map<number, MigrationInstance>;
|
|
17
|
-
register: (migration: MigrationInstance) => void;
|
|
18
|
-
allMigrations: () => Array<MigrationInstance>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
5
|
/*
|
|
22
6
|
* Module
|
|
23
7
|
*/
|
|
24
|
-
|
|
25
|
-
export interface ModuleInput<Options extends Record<string, any>> {
|
|
26
|
-
db: mongodb.Db;
|
|
27
|
-
migrationRepository?: MigrationRepository<Migration>;
|
|
28
|
-
options?: Options;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ModuleCreateMutation<T> {
|
|
32
|
-
create: (doc: T) => Promise<string | null>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ModuleMutations<T> extends ModuleCreateMutation<T> {
|
|
36
|
-
update: (_id: string, doc: mongodb.UpdateFilter<T> | T) => Promise<string>;
|
|
37
|
-
delete: (_id: string) => Promise<number>;
|
|
38
|
-
}
|