@unchainedshop/platform 4.4.0 → 4.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.
@@ -1,5 +1,4 @@
1
1
  export * from './startPlatform.ts';
2
- export * from './context/index.ts';
3
2
  export * from './templates/index.ts';
4
3
  export * from './migrations/runMigrations.ts';
5
4
  export declare const printRuntimeConfiguration: () => void;
@@ -1,5 +1,4 @@
1
1
  export * from "./startPlatform.js";
2
- export * from "./context/index.js";
3
2
  export * from "./templates/index.js";
4
3
  export * from "./migrations/runMigrations.js";
5
4
  import { MessagingDirector, getAllAdapters } from '@unchainedshop/core';
@@ -1,11 +1,3 @@
1
- var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
- });
6
- }
7
- return path;
8
- };
9
1
  import { startAPIServer, roles } from '@unchainedshop/api';
10
2
  import { initCore } from '@unchainedshop/core';
11
3
  import { initDb, mongodb, stopDb } from '@unchainedshop/mongodb';
@@ -15,6 +7,7 @@ import { setupUploadHandlers } from "./setup/setupUploadHandlers.js";
15
7
  import { setupTemplates, MessageTypes } from "./setup/setupTemplates.js";
16
8
  import { stopWorkqueue, setupWorkqueue } from "./setup/setupWorkqueue.js";
17
9
  import { createMigrationRepository } from "./migrations/migrationRepository.js";
10
+ const { UNCHAINED_API_VERSION, npm_package_version } = process.env;
18
11
  export { MessageTypes };
19
12
  const REQUIRED_ENV_VARIABLES = [
20
13
  'EMAIL_WEBSITE_NAME',
@@ -64,10 +57,8 @@ export const startPlatform = async ({ modules, services, options, rolesOptions,
64
57
  migrationRepository,
65
58
  ...workQueueOptions,
66
59
  });
67
- const { default: packageJson } = await import(__rewriteRelativeImportExtension(`${import.meta.dirname}/../package.json`), {
68
- with: { type: 'json' },
69
- });
70
- defaultLogger.info(`Unchained Engine running`, { version: packageJson.version });
60
+ const version = UNCHAINED_API_VERSION || npm_package_version || 'n/a';
61
+ defaultLogger.info(`Unchained Engine running`, { version });
71
62
  const cleanup = (signal) => async () => {
72
63
  defaultLogger.debug('Stopping Workqueue', { signal });
73
64
  stopWorkqueue();
@@ -75,7 +66,7 @@ export const startPlatform = async ({ modules, services, options, rolesOptions,
75
66
  await graphqlHandler.dispose();
76
67
  defaultLogger.debug('Stopping DB Connection', { signal });
77
68
  await stopDb();
78
- defaultLogger.debug(`Unchained Engine exiting`, { signal, version: packageJson.version });
69
+ defaultLogger.debug(`Unchained Engine exiting`, { signal, version });
79
70
  process.exit(0);
80
71
  };
81
72
  process.on('SIGTERM', cleanup('SIGTERM'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/platform",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "main": "lib/platform-index.js",
5
5
  "types": "lib/platform-index.d.ts",
6
6
  "type": "module",
@@ -37,15 +37,15 @@
37
37
  "npm": ">=10.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "@unchainedshop/api": "^4.4.0",
41
- "@unchainedshop/core": "^4.4.0",
42
- "@unchainedshop/events": "^4.4.0",
43
- "@unchainedshop/file-upload": "^4.4.0",
44
- "@unchainedshop/logger": "^4.4.0",
45
- "@unchainedshop/mongodb": "^4.4.0",
46
- "@unchainedshop/plugins": "^4.4.0",
47
- "@unchainedshop/roles": "^4.4.0",
48
- "@unchainedshop/utils": "^4.4.0",
40
+ "@unchainedshop/api": "^4.5.0",
41
+ "@unchainedshop/core": "^4.5.0",
42
+ "@unchainedshop/events": "^4.5.0",
43
+ "@unchainedshop/file-upload": "^4.5.0",
44
+ "@unchainedshop/logger": "^4.5.0",
45
+ "@unchainedshop/mongodb": "^4.5.0",
46
+ "@unchainedshop/plugins": "^4.5.0",
47
+ "@unchainedshop/roles": "^4.5.0",
48
+ "@unchainedshop/utils": "^4.5.0",
49
49
  "safe-stable-stringify": "^2.5.0"
50
50
  },
51
51
  "devDependencies": {
@@ -1 +0,0 @@
1
- export { default as setAccessToken } from './setAccessToken.ts';
@@ -1 +0,0 @@
1
- export { default as setAccessToken } from "./setAccessToken.js";
@@ -1,3 +0,0 @@
1
- import type { UnchainedCore } from '@unchainedshop/core';
2
- declare const _default: (unchainedAPI: UnchainedCore, username: string, plainSecret: string) => Promise<void>;
3
- export default _default;
@@ -1,11 +0,0 @@
1
- import { sha256 } from '@unchainedshop/utils';
2
- export default async (unchainedAPI, username, plainSecret) => {
3
- const secret = await sha256(`${username}:${plainSecret}`);
4
- await unchainedAPI.modules.users.updateUser({ username }, {
5
- $set: {
6
- 'services.token': {
7
- secret,
8
- },
9
- },
10
- }, {});
11
- };