@colveor/core 1.5.0 → 1.5.1

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/database/seeds/settings.seed.d.ts.map +1 -1
  3. package/dist/database/seeds/settings.seed.js +26 -1
  4. package/dist/database/seeds/settings.seed.js.map +1 -1
  5. package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
  6. package/dist/modules/jobs/queues/jobs.queue.js +5 -3
  7. package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
  8. package/dist/modules/jobs/sms/providers/sendchamp.provider.d.ts +12 -0
  9. package/dist/modules/jobs/sms/providers/sendchamp.provider.d.ts.map +1 -0
  10. package/dist/modules/jobs/sms/providers/sendchamp.provider.js +88 -0
  11. package/dist/modules/jobs/sms/providers/sendchamp.provider.js.map +1 -0
  12. package/dist/modules/jobs/sms/sms-provider.interface.d.ts +1 -1
  13. package/dist/modules/jobs/sms/sms-provider.interface.js +1 -1
  14. package/dist/modules/jobs/sms/sms-proxy.service.d.ts +3 -1
  15. package/dist/modules/jobs/sms/sms-proxy.service.d.ts.map +1 -1
  16. package/dist/modules/jobs/sms/sms-proxy.service.js +6 -2
  17. package/dist/modules/jobs/sms/sms-proxy.service.js.map +1 -1
  18. package/dist/modules/jobs/sms/sms.module.d.ts.map +1 -1
  19. package/dist/modules/jobs/sms/sms.module.js +2 -0
  20. package/dist/modules/jobs/sms/sms.module.js.map +1 -1
  21. package/dist/modules/settings/constants/settings.defaults.d.ts +3 -0
  22. package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
  23. package/dist/modules/settings/constants/settings.defaults.js +4 -1
  24. package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
  25. package/dist/modules/settings/constants/settings.keys.d.ts +7 -1
  26. package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
  27. package/dist/modules/settings/constants/settings.keys.js +7 -1
  28. package/dist/modules/settings/constants/settings.keys.js.map +1 -1
  29. package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -1
  30. package/dist/modules/settings/utils/settings-secret.util.js +1 -0
  31. package/dist/modules/settings/utils/settings-secret.util.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/e2e/bootstrap-setup.d.ts +0 -41
  34. package/dist/e2e/bootstrap-setup.d.ts.map +0 -1
  35. package/dist/e2e/bootstrap-setup.js +0 -169
  36. package/dist/e2e/bootstrap-setup.js.map +0 -1
  37. package/dist/e2e/create-e2e-app-module.d.ts +0 -42
  38. package/dist/e2e/create-e2e-app-module.d.ts.map +0 -1
  39. package/dist/e2e/create-e2e-app-module.js +0 -67
  40. package/dist/e2e/create-e2e-app-module.js.map +0 -1
  41. package/dist/e2e/define-e2e-host.d.ts +0 -64
  42. package/dist/e2e/define-e2e-host.d.ts.map +0 -1
  43. package/dist/e2e/define-e2e-host.js +0 -70
  44. package/dist/e2e/define-e2e-host.js.map +0 -1
  45. package/dist/e2e/e2e-env.d.ts +0 -20
  46. package/dist/e2e/e2e-env.d.ts.map +0 -1
  47. package/dist/e2e/e2e-env.js +0 -68
  48. package/dist/e2e/e2e-env.js.map +0 -1
  49. package/dist/e2e/http.d.ts +0 -12
  50. package/dist/e2e/http.d.ts.map +0 -1
  51. package/dist/e2e/http.js +0 -29
  52. package/dist/e2e/http.js.map +0 -1
  53. package/dist/e2e/index.d.ts +0 -42
  54. package/dist/e2e/index.d.ts.map +0 -1
  55. package/dist/e2e/index.js +0 -59
  56. package/dist/e2e/index.js.map +0 -1
  57. package/dist/e2e/listen-e2e-app.d.ts +0 -15
  58. package/dist/e2e/listen-e2e-app.d.ts.map +0 -1
  59. package/dist/e2e/listen-e2e-app.js +0 -44
  60. package/dist/e2e/listen-e2e-app.js.map +0 -1
  61. package/dist/e2e/runtime.d.ts +0 -12
  62. package/dist/e2e/runtime.d.ts.map +0 -1
  63. package/dist/e2e/runtime.js +0 -25
  64. package/dist/e2e/runtime.js.map +0 -1
  65. package/dist/modules/notifications/dto/user-device-token.dto.d.ts +0 -9
  66. package/dist/modules/notifications/dto/user-device-token.dto.d.ts.map +0 -1
  67. package/dist/modules/notifications/dto/user-device-token.dto.js +0 -3
  68. package/dist/modules/notifications/dto/user-device-token.dto.js.map +0 -1
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeE2eRuntime = exports.readE2eRuntime = exports.getE2eRuntimeFile = exports.clearE2eRuntime = void 0;
4
- exports.getE2eBaseUrl = getE2eBaseUrl;
5
- exports.getE2eOtpPhone = getE2eOtpPhone;
6
- exports.applyE2eEnvDefaults = applyE2eEnvDefaults;
7
- const runtime_1 = require("./runtime");
8
- var runtime_2 = require("./runtime");
9
- Object.defineProperty(exports, "clearE2eRuntime", { enumerable: true, get: function () { return runtime_2.clearE2eRuntime; } });
10
- Object.defineProperty(exports, "getE2eRuntimeFile", { enumerable: true, get: function () { return runtime_2.getE2eRuntimeFile; } });
11
- Object.defineProperty(exports, "readE2eRuntime", { enumerable: true, get: function () { return runtime_2.readE2eRuntime; } });
12
- Object.defineProperty(exports, "writeE2eRuntime", { enumerable: true, get: function () { return runtime_2.writeE2eRuntime; } });
13
- /**
14
- * Shared HTTP e2e env for @colveor/core consumers.
15
- *
16
- * E2E_BASE_URL — when set before setup, skip self-hosted boot and hit this API root
17
- * E2E_OTP_PHONE — E.164 phone for send-otp (prefer a seeded test.otp_identifiers entry)
18
- * E2E_PORT / E2E_DATABASE_NAME — isolate self-hosted boot from local example apps
19
- */
20
- function getE2eBaseUrl(runtimeFile) {
21
- const fromEnv = process.env.E2E_BASE_URL?.trim();
22
- if (fromEnv)
23
- return fromEnv.replace(/\/$/, '');
24
- const runtime = (0, runtime_1.readE2eRuntime)(runtimeFile ?? (0, runtime_1.getE2eRuntimeFile)());
25
- if (runtime?.baseUrl)
26
- return runtime.baseUrl.replace(/\/$/, '');
27
- throw new Error('E2E_BASE_URL is not set and e2e/.runtime.json is missing. ' +
28
- 'Run via `npm run test:e2e` (self-hosted) or export E2E_BASE_URL to an already-running API.');
29
- }
30
- function getE2eOtpPhone() {
31
- return process.env.E2E_OTP_PHONE?.trim() || '+2348012345678';
32
- }
33
- /** Defaults applied only when the corresponding env var is unset (CI / fresh machines). */
34
- function applyE2eEnvDefaults(options = {}) {
35
- const defaults = {
36
- NODE_ENV: 'development',
37
- API_PREFIX: 'api/v1',
38
- LOG_LEVEL: 'error',
39
- SWAGGER_ENABLED: 'false',
40
- REDIS_ENABLED: 'false',
41
- REALTIME_ENABLED: 'false',
42
- DATABASE_HOST: 'localhost',
43
- DATABASE_PORT: '5432',
44
- DATABASE_USERNAME: 'postgres',
45
- DATABASE_PASSWORD: 'postgres',
46
- DATABASE_SSL: 'false',
47
- JWT_SECRET: 'e2e-jwt-secret-min-32-characters-long!',
48
- REFRESH_TOKEN_PEPPER: 'e2e-refresh-pepper-min-32-chars-long!',
49
- SUPER_ADMIN_PHONE: '+2348012345678',
50
- SUPER_ADMIN_EMAIL: 'e2e-admin@example.com',
51
- SUPER_ADMIN_FIRST_NAME: 'E2E',
52
- SUPER_ADMIN_LAST_NAME: 'Admin',
53
- OTP_USERS: '+2348012345678',
54
- OTP_CODE_LENGTH: '6',
55
- AUTH_METHOD: 'phone',
56
- };
57
- for (const [key, value] of Object.entries(defaults)) {
58
- if (process.env[key] === undefined || process.env[key] === '') {
59
- process.env[key] = value;
60
- }
61
- }
62
- // Always isolate self-hosted e2e from a developer .env / example app unless overridden.
63
- process.env.PORT = options.port ?? process.env.E2E_PORT?.trim() ?? '3101';
64
- process.env.DATABASE_NAME =
65
- options.databaseName ?? process.env.E2E_DATABASE_NAME?.trim() ?? 'colveor_core_e2e';
66
- process.env.APP_URL = `http://127.0.0.1:${process.env.PORT}`;
67
- }
68
- //# sourceMappingURL=e2e-env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e2e-env.js","sourceRoot":"","sources":["../../src/e2e/e2e-env.ts"],"names":[],"mapp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nC,iBAAiB,EAAE,uBAAuB;QAC1C,sBAAsB,EAAE,KAAK;QAC7B,qBAAqB,EAAE,OAAO;QAC9B,SAAS,EAAE,gBAAgB;QAC3B,eAAe,EAAE,GAAG;QACpB,WAAW,EAAE,OAAO;KACpB,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC;YAC/D,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC1B,CAAC;IACF,CAAC;IAED,wFAAwF;IACxF,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,aAAa;QACxB,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,kBAAkB,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,oBAAoB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC"}
@@ -1,12 +0,0 @@
1
- export type E2eFetchResult = {
2
- res: Response;
3
- body: unknown;
4
- };
5
- export type E2eFetchOptions = RequestInit & {
6
- /** When true, do not throw on non-2xx (for negative tests). Default false. */
7
- allowError?: boolean;
8
- /** Override base URL resolution (defaults to getE2eBaseUrl()). */
9
- baseUrl?: string;
10
- };
11
- export declare function e2eFetch(path: string, init?: E2eFetchOptions): Promise<E2eFetchResult>;
12
- //# sourceMappingURL=http.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/e2e/http.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC5B,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CA2BhG"}
package/dist/e2e/http.js DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.e2eFetch = e2eFetch;
4
- const e2e_env_1 = require("./e2e-env");
5
- async function e2eFetch(path, init = {}) {
6
- const { allowError = false, baseUrl, ...requestInit } = init;
7
- const root = (baseUrl ?? (0, e2e_env_1.getE2eBaseUrl)()).replace(/\/$/, '');
8
- const url = `${root}${path.startsWith('/') ? path : `/${path}`}`;
9
- const res = await fetch(url, {
10
- ...requestInit,
11
- headers: {
12
- 'Content-Type': 'application/json',
13
- ...(requestInit.headers ?? {}),
14
- },
15
- });
16
- const text = await res.text();
17
- let body = text;
18
- try {
19
- body = text ? JSON.parse(text) : null;
20
- }
21
- catch {
22
- // keep raw text
23
- }
24
- if (!allowError && !res.ok) {
25
- throw new Error(`E2E ${requestInit.method ?? 'GET'} ${url} → ${res.status}\n${typeof body === 'string' ? body : JSON.stringify(body, null, 2)}`);
26
- }
27
- return { res, body };
28
- }
29
- //# sourceMappingURL=http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/e2e/http.ts"],"names":[],"mappings":";;AAcA,4BA2BC;AAzCD,uCAA0C;AAcnC,KAAK,UAAU,QAAQ,CAAC,IAAY,EAAE,OAAwB,EAAE;IACtE,MAAM,EAA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**
2
- * HTTP e2e host kit for `@colveor/core` and downstream packages (e.g. `@colveor/fintech`).
3
- *
4
- * Import from `@colveor/core/e2e` (not the package root).
5
- *
6
- * @example
7
- * ```ts
8
- * import { defineE2eHost, readSortedMigrations, resolveCorePackageRoot } from '@colveor/core/e2e';
9
- * import { FintechModule } from '@colveor/fintech';
10
- *
11
- * export const e2eHost = defineE2eHost({
12
- * packageRoot: join(__dirname, '..'),
13
- * mainPath: join(__dirname, 'app/main.ts'),
14
- * databaseName: 'colveor_fintech_e2e',
15
- * imports: [FintechModule.forRoot()],
16
- * typeOrm: {
17
- * corePackageRoot: resolveCorePackageRoot(),
18
- * entities: [join(fintechRoot, 'dist', '**', '*.entity.{ts,js}')],
19
- * migrations: readSortedMigrations([
20
- * join(fintechRoot, 'dist', 'database', 'migrations'),
21
- * ]),
22
- * },
23
- * extraSeeds: [runFintechSeeds],
24
- * });
25
- * ```
26
- */
27
- export { runCoreSeeds } from '../database/seeds/run-seed';
28
- export type { TypeOrmExtensionOptions } from '../database/typeorm.util';
29
- export { createDataSourceOptions, createTypeOrmOptions, readSortedMigrations, resolveCorePackageRoot, } from '../database/typeorm.util';
30
- export type { E2eGlobalSetupOptions, E2eGlobalTeardownOptions } from './bootstrap-setup';
31
- export { ensureE2eDatabaseExists, runE2eGlobalSetup, runE2eGlobalTeardown, runE2eMigrations, runE2eSeeds, } from './bootstrap-setup';
32
- export type { CreateE2eAppModuleOptions } from './create-e2e-app-module';
33
- export { createE2eAppModule } from './create-e2e-app-module';
34
- export type { DefineE2eHostOptions, E2eHost } from './define-e2e-host';
35
- export { defineE2eHost } from './define-e2e-host';
36
- export type { ApplyE2eEnvDefaultsOptions, E2eRuntime } from './e2e-env';
37
- export { applyE2eEnvDefaults, clearE2eRuntime, getE2eBaseUrl, getE2eOtpPhone, getE2eRuntimeFile, readE2eRuntime, writeE2eRuntime, } from './e2e-env';
38
- export type { E2eFetchOptions, E2eFetchResult } from './http';
39
- export { e2eFetch } from './http';
40
- export type { ListenE2eAppOptions } from './listen-e2e-app';
41
- export { listenE2eApp } from './listen-e2e-app';
42
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/e2e/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EACN,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,GACX,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/e2e/index.js DELETED
@@ -1,59 +0,0 @@
1
- "use strict";
2
- /**
3
- * HTTP e2e host kit for `@colveor/core` and downstream packages (e.g. `@colveor/fintech`).
4
- *
5
- * Import from `@colveor/core/e2e` (not the package root).
6
- *
7
- * @example
8
- * ```ts
9
- * import { defineE2eHost, readSortedMigrations, resolveCorePackageRoot } from '@colveor/core/e2e';
10
- * import { FintechModule } from '@colveor/fintech';
11
- *
12
- * export const e2eHost = defineE2eHost({
13
- * packageRoot: join(__dirname, '..'),
14
- * mainPath: join(__dirname, 'app/main.ts'),
15
- * databaseName: 'colveor_fintech_e2e',
16
- * imports: [FintechModule.forRoot()],
17
- * typeOrm: {
18
- * corePackageRoot: resolveCorePackageRoot(),
19
- * entities: [join(fintechRoot, 'dist', '**', '*.entity.{ts,js}')],
20
- * migrations: readSortedMigrations([
21
- * join(fintechRoot, 'dist', 'database', 'migrations'),
22
- * ]),
23
- * },
24
- * extraSeeds: [runFintechSeeds],
25
- * });
26
- * ```
27
- */
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.listenE2eApp = exports.e2eFetch = exports.writeE2eRuntime = exports.readE2eRuntime = exports.getE2eRuntimeFile = exports.getE2eOtpPhone = exports.getE2eBaseUrl = exports.clearE2eRuntime = exports.applyE2eEnvDefaults = exports.defineE2eHost = exports.createE2eAppModule = exports.runE2eSeeds = exports.runE2eMigrations = exports.runE2eGlobalTeardown = exports.runE2eGlobalSetup = exports.ensureE2eDatabaseExists = exports.resolveCorePackageRoot = exports.readSortedMigrations = exports.createTypeOrmOptions = exports.createDataSourceOptions = exports.runCoreSeeds = void 0;
30
- var run_seed_1 = require("../database/seeds/run-seed");
31
- Object.defineProperty(exports, "runCoreSeeds", { enumerable: true, get: function () { return run_seed_1.runCoreSeeds; } });
32
- var typeorm_util_1 = require("../database/typeorm.util");
33
- Object.defineProperty(exports, "createDataSourceOptions", { enumerable: true, get: function () { return typeorm_util_1.createDataSourceOptions; } });
34
- Object.defineProperty(exports, "createTypeOrmOptions", { enumerable: true, get: function () { return typeorm_util_1.createTypeOrmOptions; } });
35
- Object.defineProperty(exports, "readSortedMigrations", { enumerable: true, get: function () { return typeorm_util_1.readSortedMigrations; } });
36
- Object.defineProperty(exports, "resolveCorePackageRoot", { enumerable: true, get: function () { return typeorm_util_1.resolveCorePackageRoot; } });
37
- var bootstrap_setup_1 = require("./bootstrap-setup");
38
- Object.defineProperty(exports, "ensureE2eDatabaseExists", { enumerable: true, get: function () { return bootstrap_setup_1.ensureE2eDatabaseExists; } });
39
- Object.defineProperty(exports, "runE2eGlobalSetup", { enumerable: true, get: function () { return bootstrap_setup_1.runE2eGlobalSetup; } });
40
- Object.defineProperty(exports, "runE2eGlobalTeardown", { enumerable: true, get: function () { return bootstrap_setup_1.runE2eGlobalTeardown; } });
41
- Object.defineProperty(exports, "runE2eMigrations", { enumerable: true, get: function () { return bootstrap_setup_1.runE2eMigrations; } });
42
- Object.defineProperty(exports, "runE2eSeeds", { enumerable: true, get: function () { return bootstrap_setup_1.runE2eSeeds; } });
43
- var create_e2e_app_module_1 = require("./create-e2e-app-module");
44
- Object.defineProperty(exports, "createE2eAppModule", { enumerable: true, get: function () { return create_e2e_app_module_1.createE2eAppModule; } });
45
- var define_e2e_host_1 = require("./define-e2e-host");
46
- Object.defineProperty(exports, "defineE2eHost", { enumerable: true, get: function () { return define_e2e_host_1.defineE2eHost; } });
47
- var e2e_env_1 = require("./e2e-env");
48
- Object.defineProperty(exports, "applyE2eEnvDefaults", { enumerable: true, get: function () { return e2e_env_1.applyE2eEnvDefaults; } });
49
- Object.defineProperty(exports, "clearE2eRuntime", { enumerable: true, get: function () { return e2e_env_1.clearE2eRuntime; } });
50
- Object.defineProperty(exports, "getE2eBaseUrl", { enumerable: true, get: function () { return e2e_env_1.getE2eBaseUrl; } });
51
- Object.defineProperty(exports, "getE2eOtpPhone", { enumerable: true, get: function () { return e2e_env_1.getE2eOtpPhone; } });
52
- Object.defineProperty(exports, "getE2eRuntimeFile", { enumerable: true, get: function () { return e2e_env_1.getE2eRuntimeFile; } });
53
- Object.defineProperty(exports, "readE2eRuntime", { enumerable: true, get: function () { return e2e_env_1.readE2eRuntime; } });
54
- Object.defineProperty(exports, "writeE2eRuntime", { enumerable: true, get: function () { return e2e_env_1.writeE2eRuntime; } });
55
- var http_1 = require("./http");
56
- Object.defineProperty(exports, "e2eFetch", { enumerable: true, get: function () { return http_1.e2eFetch; } });
57
- var listen_e2e_app_1 = require("./listen-e2e-app");
58
- Object.defineProperty(exports, "listenE2eApp", { enumerable: true, get: function () { return listen_e2e_app_1.listenE2eApp; } });
59
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/e2e/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAEH,uDAA0D;AAAjD,wGAAA,YAAY,OAAA;AAErB,yDAKkC;AAJjC,uHAAA,uBAAuB,OAAA;AACvB,oHAAA,oBAAoB,OAAA;AACpB,oHAAA,oBAAoB,OAAA;AACpB,sHAAA,sBAAsB,OAAA;AAGvB,qDAM2B;AAL1B,0HAAA,uBAAuB,OAAA;AACvB,oHAAA,iBAAiB,OAAA;AACjB,uHAAA,oBAAoB,OAAA;AACpB,mHAAA,gBAAgB,OAAA;AAChB,8GAAA,WAAW,OAAA;AAGZ,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAE3B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AAEtB,qCAQmB;AAPlB,8GAAA,mBAAmB,OAAA;AACnB,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,4GAAA,iBAAiB,OAAA;AACjB,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAGhB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AAEjB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA"}
@@ -1,15 +0,0 @@
1
- import type { Type } from '@nestjs/common';
2
- import type { NestExpressApplication } from '@nestjs/platform-express';
3
- import { type ApplyE2eEnvDefaultsOptions } from './e2e-env';
4
- export type ListenE2eAppOptions = ApplyE2eEnvDefaultsOptions & {
5
- /** Absolute path for e2e/.runtime.json. Defaults to `<cwd>/e2e/.runtime.json`. */
6
- runtimeFile?: string;
7
- /** Apply env defaults before boot (default true). */
8
- applyEnvDefaults?: boolean;
9
- };
10
- /**
11
- * Boot a Nest host with Colveor defaults, write runtime metadata, and keep the process alive
12
- * until SIGTERM/SIGINT (used as the child entry for Jest globalSetup).
13
- */
14
- export declare function listenE2eApp(appModule: Type<unknown>, options?: ListenE2eAppOptions): Promise<NestExpressApplication>;
15
- //# sourceMappingURL=listen-e2e-app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listen-e2e-app.d.ts","sourceRoot":"","sources":["../../src/e2e/listen-e2e-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAuB,KAAK,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAGjF,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG;IAC9D,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,YAAY,CACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,mBAAwB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAyCjC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listenE2eApp = listenE2eApp;
4
- const bootstrap_1 = require("../bootstrap");
5
- const e2e_env_1 = require("./e2e-env");
6
- const runtime_1 = require("./runtime");
7
- /**
8
- * Boot a Nest host with Colveor defaults, write runtime metadata, and keep the process alive
9
- * until SIGTERM/SIGINT (used as the child entry for Jest globalSetup).
10
- */
11
- async function listenE2eApp(appModule, options = {}) {
12
- if (options.applyEnvDefaults !== false) {
13
- (0, e2e_env_1.applyE2eEnvDefaults)({
14
- port: options.port,
15
- databaseName: options.databaseName,
16
- });
17
- }
18
- const app = await (0, bootstrap_1.bootstrapColveorApp)(appModule, {
19
- logger: ['error', 'warn'],
20
- });
21
- const address = app.getHttpServer().address();
22
- const port = typeof address === 'object' && address ? address.port : Number(process.env.PORT ?? 3101);
23
- const apiPrefix = (process.env.API_PREFIX ?? 'api/v1').replace(/^\/|\/$/g, '');
24
- const baseUrl = `http://127.0.0.1:${port}/${apiPrefix}`;
25
- const runtimeFile = options.runtimeFile ?? (0, runtime_1.getE2eRuntimeFile)();
26
- (0, runtime_1.writeE2eRuntime)({
27
- baseUrl,
28
- managed: true,
29
- pid: process.pid,
30
- port,
31
- }, runtimeFile);
32
- const shutdown = async () => {
33
- await app.close();
34
- process.exit(0);
35
- };
36
- process.on('SIGTERM', () => {
37
- void shutdown();
38
- });
39
- process.on('SIGINT', () => {
40
- void shutdown();
41
- });
42
- return app;
43
- }
44
- //# sourceMappingURL=listen-e2e-app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listen-e2e-app.js","sourceRoot":"","sources":["../../src/e2e/listen-e2e-app.ts"],"names":[],"mappings":";;AAkBA,oCA4CC;AA3DD,4CAAmD;AACnD,uCAAiF;AACjF,uCAA+D;AAS/D;;;GAGG;AACI,KAAK,UAAU,YAAY,CACjC,SAAwB,EACxB,UAA+B,EAAE;IAEjC,IAAI,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;QACxC,IAAA,6BAAmB,EAAC;YACnB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,YAAY,EAAE,OAAO,CAAC,YAAY;SAClC,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,IAAA,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;
5
- port?: number;
6
- };
7
- /** Default runtime metadata path: `<cwd>/e2e/.runtime.json`. */
8
- export declare function getE2eRuntimeFile(packageRoot?: string): string;
9
- export declare function readE2eRuntime(runtimeFile?: string): E2eRuntime | undefined;
10
- export declare function writeE2eRuntime(runtime: E2eRuntime, runtimeFile?: string): void;
11
- export declare function clearE2eRuntime(runtimeFile?: string): void;
12
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/e2e/runtime.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,MAAsB,GAAG,MAAM,CAE7E;AAED,wBAAgB,cAAc,CAAC,WAAW,GAAE,MAA4B,GAAG,UAAU,GAAG,SAAS,CAGhG;AAED,wBAAgB,eAAe,CAC9B,OAAO,EAAE,UAAU,EACnB,WAAW,GAAE,MAA4B,GACvC,IAAI,CAEN;AAED,wBAAgB,eAAe,CAAC,WAAW,GAAE,MAA4B,GAAG,IAAI,CAE/E"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getE2eRuntimeFile = getE2eRuntimeFile;
4
- exports.readE2eRuntime = readE2eRuntime;
5
- exports.writeE2eRuntime = writeE2eRuntime;
6
- exports.clearE2eRuntime = clearE2eRuntime;
7
- const node_fs_1 = require("node:fs");
8
- const node_path_1 = require("node:path");
9
- /** Default runtime metadata path: `<cwd>/e2e/.runtime.json`. */
10
- function getE2eRuntimeFile(packageRoot = process.cwd()) {
11
- return (0, node_path_1.join)(packageRoot, 'e2e', '.runtime.json');
12
- }
13
- function readE2eRuntime(runtimeFile = getE2eRuntimeFile()) {
14
- if (!(0, node_fs_1.existsSync)(runtimeFile))
15
- return undefined;
16
- return JSON.parse((0, node_fs_1.readFileSync)(runtimeFile, 'utf8'));
17
- }
18
- function writeE2eRuntime(runtime, runtimeFile = getE2eRuntimeFile()) {
19
- (0, node_fs_1.writeFileSync)(runtimeFile, JSON.stringify(runtime, null, 2));
20
- }
21
- function clearE2eRuntime(runtimeFile = getE2eRuntimeFile()) {
22
- if ((0, node_fs_1.existsSync)(runtimeFile))
23
- (0, node_fs_1.unlinkSync)(runtimeFile);
24
- }
25
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/e2e/runtime.ts"],"names":[],"mappings":";;AAWA,8CAEC;AAED,wCAGC;AAED,0CAKC;AAED,0CAEC;AA7BD,qCAA8E;AAC9E,yCAAiC;AASjC,gEAAgE;AAChE,SAAgB,iBAAiB,CAAC,cAAsB,OAAO,CAAC,GAAG,EAAE;IACpE,OAAO,IAAA,gBAAI,EAAC,WAAW,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,cAAc,CAAC,cAAsB,iBAAiB,EAAE;IACvE,IAAI,CAAC,IAAA,oBAAU,EAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,WAAW,EAAE,MAAM,CAAC,CAAe,CAAC;AACpE,CAAC;AAED,SAAgB,eAAe,CAC9B,OAAmB,EACnB,cAAsB,iBAAiB,EAAE;IAEzC,IAAA,uBAAa,EAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAgB,eAAe,CAAC,cAAsB,iBAAiB,EAAE;IACxE,IAAI,IAAA,oBAAU,EAAC,WAAW,CAAC;QAAE,IAAA,oBAAU,EAAC,WAAW,CAAC,CAAC;AACtD,CAAC"}
@@ -1,9 +0,0 @@
1
- export interface UserDeviceToken {
2
- userId: string;
3
- fcmToken: string;
4
- deviceType: 'ios' | 'android' | 'web';
5
- deviceName?: string;
6
- isActive: boolean;
7
- lastUsedAt: Date;
8
- }
9
- //# sourceMappingURL=user-device-token.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-device-token.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/notifications/dto/user-device-token.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;CACjB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=user-device-token.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-device-token.dto.js","sourceRoot":"","sources":["../../../../src/modules/notifications/dto/user-device-token.dto.ts"],"names":[],"mappings":""}