@unchainedshop/core 3.0.0-alpha2 → 3.0.0-alpha3

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.
@@ -1,3 +1,79 @@
1
- import { UnchainedCore, UnchainedCoreOptions } from '@unchainedshop/types/core.js';
2
- export declare const initCore: ({ db, migrationRepository, modules, services, bulkImporter, options, }: UnchainedCoreOptions) => Promise<UnchainedCore>;
1
+ import { BulkImporter, Migration, MigrationRepository, ModuleInput } from './types.js';
2
+ import { AssortmentsModule, AssortmentsSettingsOptions } from '@unchainedshop/core-assortments';
3
+ import { BookmarkServices, BookmarksModule } from '@unchainedshop/core-bookmarks';
4
+ import { CountriesModule } from '@unchainedshop/core-countries';
5
+ import { CurrenciesModule } from '@unchainedshop/core-currencies';
6
+ import { DeliveryModule, DeliverySettingsOptions } from '@unchainedshop/core-delivery';
7
+ import { EnrollmentsModule, EnrollmentsSettingsOptions } from '@unchainedshop/core-enrollments';
8
+ import { EventsModule } from '@unchainedshop/core-events';
9
+ import { FileServices, FilesModule, FilesSettingsOptions } from '@unchainedshop/core-files';
10
+ import { FiltersModule, FiltersSettingsOptions } from '@unchainedshop/core-filters';
11
+ import { LanguagesModule } from '@unchainedshop/core-languages';
12
+ import { MessagingModule } from '@unchainedshop/core-messaging';
13
+ import { OrderServices, OrdersModule, OrdersSettingsOptions } from '@unchainedshop/core-orders';
14
+ import { PaymentModule, PaymentSettingsOptions } from '@unchainedshop/core-payment';
15
+ import { ProductServices, ProductsModule, ProductsSettingsOptions } from '@unchainedshop/core-products';
16
+ import { QuotationsModule, QuotationsSettingsOptions } from '@unchainedshop/core-quotations';
17
+ import { UserServices, UserSettingsOptions, UsersModule } from '@unchainedshop/core-users';
18
+ import { WarehousingModule } from '@unchainedshop/core-warehousing';
19
+ import { WorkerModule, WorkerSettingsOptions } from '@unchainedshop/core-worker';
20
+ import { mongodb } from '@unchainedshop/mongodb';
21
+ export * from './types.js';
22
+ export interface ModuleOptions {
23
+ assortments?: AssortmentsSettingsOptions;
24
+ products?: ProductsSettingsOptions;
25
+ delivery?: DeliverySettingsOptions;
26
+ filters?: FiltersSettingsOptions;
27
+ enrollments?: EnrollmentsSettingsOptions;
28
+ orders?: OrdersSettingsOptions;
29
+ quotations?: QuotationsSettingsOptions;
30
+ files?: FilesSettingsOptions;
31
+ payment?: PaymentSettingsOptions;
32
+ worker?: WorkerSettingsOptions;
33
+ users?: UserSettingsOptions;
34
+ }
35
+ export interface UnchainedCoreOptions {
36
+ db: mongodb.Db;
37
+ migrationRepository: MigrationRepository<Migration>;
38
+ bulkImporter: any;
39
+ modules?: Record<string, {
40
+ configure: (params: ModuleInput<any>) => any;
41
+ }>;
42
+ services?: Record<string, any>;
43
+ options?: ModuleOptions;
44
+ }
45
+ export interface Modules {
46
+ assortments: AssortmentsModule;
47
+ bookmarks: BookmarksModule;
48
+ countries: CountriesModule;
49
+ currencies: CurrenciesModule;
50
+ delivery: DeliveryModule;
51
+ enrollments: EnrollmentsModule;
52
+ events: EventsModule;
53
+ files: FilesModule;
54
+ filters: FiltersModule;
55
+ languages: LanguagesModule;
56
+ messaging: MessagingModule;
57
+ orders: OrdersModule;
58
+ payment: PaymentModule;
59
+ products: ProductsModule;
60
+ quotations: QuotationsModule;
61
+ users: UsersModule;
62
+ warehousing: WarehousingModule;
63
+ worker: WorkerModule;
64
+ }
65
+ export interface Services {
66
+ bookmarks: BookmarkServices;
67
+ files: FileServices;
68
+ orders: OrderServices;
69
+ products: ProductServices;
70
+ users: UserServices;
71
+ }
72
+ export interface UnchainedCore {
73
+ modules: Modules;
74
+ services: Services;
75
+ bulkImporter: BulkImporter;
76
+ options: ModuleOptions;
77
+ }
78
+ export declare const initCore: ({ db, migrationRepository, bulkImporter, modules, services, options, }: UnchainedCoreOptions) => Promise<UnchainedCore>;
3
79
  //# sourceMappingURL=core-index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-index.d.ts","sourceRoot":"","sources":["../src/core-index.ts"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,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/core-index.js CHANGED
@@ -1,22 +1,23 @@
1
- import { configureAssortmentsModule } from '@unchainedshop/core-assortments';
2
- import { bookmarkServices, configureBookmarksModule } from '@unchainedshop/core-bookmarks';
1
+ import { configureAssortmentsModule, } from '@unchainedshop/core-assortments';
2
+ import { bookmarkServices, configureBookmarksModule, } from '@unchainedshop/core-bookmarks';
3
3
  import { configureCountriesModule } from '@unchainedshop/core-countries';
4
4
  import { configureCurrenciesModule } from '@unchainedshop/core-currencies';
5
- import { configureDeliveryModule } from '@unchainedshop/core-delivery';
6
- import { configureEnrollmentsModule } from '@unchainedshop/core-enrollments';
5
+ import { configureDeliveryModule, } from '@unchainedshop/core-delivery';
6
+ import { configureEnrollmentsModule, } from '@unchainedshop/core-enrollments';
7
7
  import { configureEventsModule } from '@unchainedshop/core-events';
8
- import { configureFilesModule, fileServices } from '@unchainedshop/core-files';
9
- import { configureFiltersModule } from '@unchainedshop/core-filters';
8
+ import { configureFilesModule, fileServices, } from '@unchainedshop/core-files';
9
+ import { configureFiltersModule, } from '@unchainedshop/core-filters';
10
10
  import { configureLanguagesModule } from '@unchainedshop/core-languages';
11
11
  import { configureMessagingModule } from '@unchainedshop/core-messaging';
12
- import { configureOrdersModule, orderServices } from '@unchainedshop/core-orders';
13
- import { configurePaymentModule } from '@unchainedshop/core-payment';
14
- import { configureProductsModule, productServices } from '@unchainedshop/core-products';
15
- import { configureQuotationsModule } from '@unchainedshop/core-quotations';
16
- import { configureUsersModule, userServices } from '@unchainedshop/core-users';
12
+ import { configureOrdersModule, orderServices, } from '@unchainedshop/core-orders';
13
+ import { configurePaymentModule, } from '@unchainedshop/core-payment';
14
+ import { configureProductsModule, productServices, } from '@unchainedshop/core-products';
15
+ import { configureQuotationsModule, } from '@unchainedshop/core-quotations';
16
+ import { configureUsersModule, userServices, } from '@unchainedshop/core-users';
17
17
  import { configureWarehousingModule } from '@unchainedshop/core-warehousing';
18
18
  import { configureWorkerModule } from '@unchainedshop/core-worker';
19
- export const initCore = async ({ db, migrationRepository, modules, services, bulkImporter, options = {}, }) => {
19
+ export * from './types.js';
20
+ export const initCore = async ({ db, migrationRepository, bulkImporter, modules = {}, services = {}, options = {}, }) => {
20
21
  const assortments = await configureAssortmentsModule({
21
22
  db,
22
23
  options: options.assortments,
@@ -1 +1 @@
1
- {"version":3,"file":"core-index.js","sourceRoot":"","sources":["../src/core-index.ts"],"names":[],"mappings":"AACA,OAA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AAC;YACzB,CAAC,GAAG,CAAC,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC;gBAClC,EAAE;gBACF,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC;gBACvB,mBAAmB;aACpB,CAAC;SACH,CAAC;IACJ,CAAC,EACD,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,CAAC;IAEF,OAAO;QACL,OAAO,EAAE;YACP,WAAW;YACX,SAAS;YACT,SAAS;YACT,UAAU;YACV,QAAQ;YACR,WAAW;YACX,MAAM;YACN,KAAK;YACL,OAAO;YACP,SAAS;YACT,SAAS;YACT,MAAM;YACN,OAAO;YACP,QAAQ;YACR,UAAU;YACV,KAAK;YACL,WAAW;YACX,MAAM;YACN,GAAG,aAAa;SACjB;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,gBAAgB;YAC3B,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,YAAY;YACnB,GAAG,QAAQ;SACZ;QACD,YAAY;QACZ,OAAO;KACR,CAAC;AACJ,CAAC,CAAC"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ import type { mongodb } from '@unchainedshop/mongodb';
2
+ import type { UnchainedCore } from './core-index.js';
3
+ export interface BulkImporter {
4
+ createBulkImporter: (options: any) => any;
5
+ }
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
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;CAC3C;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC;QAAC,YAAY,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvF;AAED,MAAM,WAAW,mBAAmB,CAAC,iBAAiB,SAAS,SAAS;IACtE,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IACf,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAAC;CAC/C;AAMD,MAAM,WAAW,WAAW,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC9D,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IACf,mBAAmB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IACjE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C"}
package/lib/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/core",
3
- "version": "3.0.0-alpha2",
3
+ "version": "3.0.0-alpha3",
4
4
  "main": "lib/core-index.js",
5
5
  "exports": {
6
6
  ".": "./lib/core-index.js",
@@ -31,31 +31,30 @@
31
31
  },
32
32
  "homepage": "https://github.com/unchainedshop/unchained#readme",
33
33
  "dependencies": {
34
- "@unchainedshop/core-assortments": "^3.0.0-alpha2",
35
- "@unchainedshop/core-bookmarks": "^3.0.0-alpha2",
36
- "@unchainedshop/core-countries": "^3.0.0-alpha2",
37
- "@unchainedshop/core-currencies": "^3.0.0-alpha2",
38
- "@unchainedshop/core-delivery": "^3.0.0-alpha2",
39
- "@unchainedshop/core-enrollments": "^3.0.0-alpha2",
40
- "@unchainedshop/core-events": "^3.0.0-alpha2",
41
- "@unchainedshop/core-files": "^3.0.0-alpha2",
42
- "@unchainedshop/core-filters": "^3.0.0-alpha2",
43
- "@unchainedshop/core-languages": "^3.0.0-alpha2",
44
- "@unchainedshop/core-messaging": "^3.0.0-alpha2",
45
- "@unchainedshop/core-orders": "^3.0.0-alpha2",
46
- "@unchainedshop/core-payment": "^3.0.0-alpha2",
47
- "@unchainedshop/core-products": "^3.0.0-alpha2",
48
- "@unchainedshop/core-quotations": "^3.0.0-alpha2",
49
- "@unchainedshop/core-users": "^3.0.0-alpha2",
50
- "@unchainedshop/core-warehousing": "^3.0.0-alpha2",
51
- "@unchainedshop/core-worker": "^3.0.0-alpha2",
52
- "@unchainedshop/logger": "^3.0.0-alpha2"
34
+ "@unchainedshop/core-assortments": "^3.0.0-alpha3",
35
+ "@unchainedshop/core-bookmarks": "^3.0.0-alpha3",
36
+ "@unchainedshop/core-countries": "^3.0.0-alpha3",
37
+ "@unchainedshop/core-currencies": "^3.0.0-alpha3",
38
+ "@unchainedshop/core-delivery": "^3.0.0-alpha3",
39
+ "@unchainedshop/core-enrollments": "^3.0.0-alpha3",
40
+ "@unchainedshop/core-events": "^3.0.0-alpha3",
41
+ "@unchainedshop/core-files": "^3.0.0-alpha3",
42
+ "@unchainedshop/core-filters": "^3.0.0-alpha3",
43
+ "@unchainedshop/core-languages": "^3.0.0-alpha3",
44
+ "@unchainedshop/core-messaging": "^3.0.0-alpha3",
45
+ "@unchainedshop/core-orders": "^3.0.0-alpha3",
46
+ "@unchainedshop/core-payment": "^3.0.0-alpha3",
47
+ "@unchainedshop/core-products": "^3.0.0-alpha3",
48
+ "@unchainedshop/core-quotations": "^3.0.0-alpha3",
49
+ "@unchainedshop/core-users": "^3.0.0-alpha3",
50
+ "@unchainedshop/core-warehousing": "^3.0.0-alpha3",
51
+ "@unchainedshop/core-worker": "^3.0.0-alpha3",
52
+ "@unchainedshop/logger": "^3.0.0-alpha3"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "^20.14.12",
56
- "@unchainedshop/types": "^3.0.0-alpha2",
55
+ "@types/node": "^22.5.5",
57
56
  "jest": "^29.7.0",
58
- "ts-jest": "^29.2.3",
59
- "typescript": "^5.5.4"
57
+ "ts-jest": "^29.2.5",
58
+ "typescript": "^5.6.2"
60
59
  }
61
60
  }
package/src/core-index.ts CHANGED
@@ -1,29 +1,149 @@
1
- import { UnchainedCore, UnchainedCoreOptions } from '@unchainedshop/types/core.js';
2
- import { configureAssortmentsModule } from '@unchainedshop/core-assortments';
3
- import { bookmarkServices, configureBookmarksModule } from '@unchainedshop/core-bookmarks';
4
- import { configureCountriesModule } from '@unchainedshop/core-countries';
5
- import { configureCurrenciesModule } from '@unchainedshop/core-currencies';
6
- import { configureDeliveryModule } from '@unchainedshop/core-delivery';
7
- import { configureEnrollmentsModule } from '@unchainedshop/core-enrollments';
8
- import { configureEventsModule } from '@unchainedshop/core-events';
9
- import { configureFilesModule, fileServices } from '@unchainedshop/core-files';
10
- import { configureFiltersModule } from '@unchainedshop/core-filters';
11
- import { configureLanguagesModule } from '@unchainedshop/core-languages';
12
- import { configureMessagingModule } from '@unchainedshop/core-messaging';
13
- import { configureOrdersModule, orderServices } from '@unchainedshop/core-orders';
14
- import { configurePaymentModule } from '@unchainedshop/core-payment';
15
- import { configureProductsModule, productServices } from '@unchainedshop/core-products';
16
- import { configureQuotationsModule } from '@unchainedshop/core-quotations';
17
- import { configureUsersModule, userServices } from '@unchainedshop/core-users';
18
- import { configureWarehousingModule } from '@unchainedshop/core-warehousing';
19
- import { configureWorkerModule } from '@unchainedshop/core-worker';
1
+ import { BulkImporter, Migration, MigrationRepository, ModuleInput } from './types.js';
2
+ import {
3
+ AssortmentsModule,
4
+ AssortmentsSettingsOptions,
5
+ configureAssortmentsModule,
6
+ } from '@unchainedshop/core-assortments';
7
+ import {
8
+ BookmarkServices,
9
+ bookmarkServices,
10
+ BookmarksModule,
11
+ configureBookmarksModule,
12
+ } from '@unchainedshop/core-bookmarks';
13
+ import { configureCountriesModule, CountriesModule } from '@unchainedshop/core-countries';
14
+ import { configureCurrenciesModule, CurrenciesModule } from '@unchainedshop/core-currencies';
15
+ import {
16
+ configureDeliveryModule,
17
+ DeliveryModule,
18
+ DeliverySettingsOptions,
19
+ } from '@unchainedshop/core-delivery';
20
+ import {
21
+ configureEnrollmentsModule,
22
+ EnrollmentsModule,
23
+ EnrollmentsSettingsOptions,
24
+ } from '@unchainedshop/core-enrollments';
25
+ import { configureEventsModule, EventsModule } from '@unchainedshop/core-events';
26
+ import {
27
+ configureFilesModule,
28
+ FileServices,
29
+ fileServices,
30
+ FilesModule,
31
+ FilesSettingsOptions,
32
+ } from '@unchainedshop/core-files';
33
+ import {
34
+ configureFiltersModule,
35
+ FiltersModule,
36
+ FiltersSettingsOptions,
37
+ } from '@unchainedshop/core-filters';
38
+ import { configureLanguagesModule, LanguagesModule } from '@unchainedshop/core-languages';
39
+ import { configureMessagingModule, MessagingModule } from '@unchainedshop/core-messaging';
40
+ import {
41
+ configureOrdersModule,
42
+ OrderServices,
43
+ orderServices,
44
+ OrdersModule,
45
+ OrdersSettingsOptions,
46
+ } from '@unchainedshop/core-orders';
47
+ import {
48
+ configurePaymentModule,
49
+ PaymentModule,
50
+ PaymentSettingsOptions,
51
+ } from '@unchainedshop/core-payment';
52
+ import {
53
+ configureProductsModule,
54
+ ProductServices,
55
+ productServices,
56
+ ProductsModule,
57
+ ProductsSettingsOptions,
58
+ } from '@unchainedshop/core-products';
59
+ import {
60
+ configureQuotationsModule,
61
+ QuotationsModule,
62
+ QuotationsSettingsOptions,
63
+ } from '@unchainedshop/core-quotations';
64
+ import {
65
+ configureUsersModule,
66
+ UserServices,
67
+ userServices,
68
+ UserSettingsOptions,
69
+ UsersModule,
70
+ } from '@unchainedshop/core-users';
71
+ import { configureWarehousingModule, WarehousingModule } from '@unchainedshop/core-warehousing';
72
+ import { configureWorkerModule, WorkerModule, WorkerSettingsOptions } from '@unchainedshop/core-worker';
73
+ import { mongodb } from '@unchainedshop/mongodb';
74
+
75
+ export * from './types.js';
76
+
77
+ export interface ModuleOptions {
78
+ assortments?: AssortmentsSettingsOptions;
79
+ products?: ProductsSettingsOptions;
80
+ delivery?: DeliverySettingsOptions;
81
+ filters?: FiltersSettingsOptions;
82
+ enrollments?: EnrollmentsSettingsOptions;
83
+ orders?: OrdersSettingsOptions;
84
+ quotations?: QuotationsSettingsOptions;
85
+ files?: FilesSettingsOptions;
86
+ payment?: PaymentSettingsOptions;
87
+ worker?: WorkerSettingsOptions;
88
+ users?: UserSettingsOptions;
89
+ }
90
+
91
+ export interface UnchainedCoreOptions {
92
+ db: mongodb.Db;
93
+ migrationRepository: MigrationRepository<Migration>;
94
+ bulkImporter: any;
95
+ modules?: Record<
96
+ string,
97
+ {
98
+ configure: (params: ModuleInput<any>) => any;
99
+ }
100
+ >;
101
+ services?: Record<string, any>;
102
+ options?: ModuleOptions;
103
+ }
104
+
105
+ export interface Modules {
106
+ assortments: AssortmentsModule;
107
+ bookmarks: BookmarksModule;
108
+ countries: CountriesModule;
109
+ currencies: CurrenciesModule;
110
+ delivery: DeliveryModule;
111
+ enrollments: EnrollmentsModule;
112
+ events: EventsModule;
113
+ files: FilesModule;
114
+ filters: FiltersModule;
115
+ languages: LanguagesModule;
116
+ messaging: MessagingModule;
117
+ orders: OrdersModule;
118
+ payment: PaymentModule;
119
+ products: ProductsModule;
120
+ quotations: QuotationsModule;
121
+ users: UsersModule;
122
+ warehousing: WarehousingModule;
123
+ worker: WorkerModule;
124
+ }
125
+
126
+ export interface Services {
127
+ bookmarks: BookmarkServices;
128
+ files: FileServices;
129
+ orders: OrderServices;
130
+ products: ProductServices;
131
+ users: UserServices;
132
+ }
133
+
134
+ export interface UnchainedCore {
135
+ modules: Modules;
136
+ services: Services;
137
+ bulkImporter: BulkImporter;
138
+ options: ModuleOptions;
139
+ }
20
140
 
21
141
  export const initCore = async ({
22
142
  db,
23
143
  migrationRepository,
24
- modules,
25
- services,
26
144
  bulkImporter,
145
+ modules = {},
146
+ services = {},
27
147
  options = {},
28
148
  }: UnchainedCoreOptions): Promise<UnchainedCore> => {
29
149
  const assortments = await configureAssortmentsModule({
package/src/types.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { mongodb } from '@unchainedshop/mongodb';
2
+ import type { UnchainedCore } from './core-index.js';
3
+
4
+ export interface BulkImporter {
5
+ createBulkImporter: (options: any) => any;
6
+ }
7
+
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
+ /*
22
+ * Module
23
+ */
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
+ }