authup 0.42.0 → 0.45.2

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 (145) hide show
  1. package/dist/commands/api.d.ts +3 -0
  2. package/dist/commands/api.d.ts.map +1 -0
  3. package/dist/commands/api.js +54 -0
  4. package/dist/commands/api.js.map +1 -0
  5. package/dist/commands/index.d.ts +5 -0
  6. package/dist/commands/index.d.ts.map +1 -0
  7. package/dist/commands/index.js +27 -0
  8. package/dist/commands/index.js.map +1 -0
  9. package/dist/commands/info.d.ts +3 -0
  10. package/dist/commands/info.d.ts.map +1 -0
  11. package/dist/commands/info.js +32 -0
  12. package/dist/commands/info.js.map +1 -0
  13. package/dist/commands/start.d.ts +3 -0
  14. package/dist/commands/start.d.ts.map +1 -0
  15. package/dist/commands/start.js +56 -0
  16. package/dist/commands/start.js.map +1 -0
  17. package/dist/commands/ui.d.ts +3 -0
  18. package/dist/commands/ui.d.ts.map +1 -0
  19. package/dist/commands/ui.js +53 -0
  20. package/dist/commands/ui.js.map +1 -0
  21. package/dist/config/index.d.ts +3 -0
  22. package/dist/config/index.d.ts.map +1 -0
  23. package/dist/config/index.js +25 -0
  24. package/dist/config/index.js.map +1 -0
  25. package/dist/config/module.d.ts +3 -0
  26. package/dist/config/module.d.ts.map +1 -0
  27. package/dist/config/module.js +34 -0
  28. package/dist/config/module.js.map +1 -0
  29. package/dist/config/type.d.ts +7 -0
  30. package/dist/config/type.d.ts.map +1 -0
  31. package/dist/config/type.js +9 -0
  32. package/dist/config/type.js.map +1 -0
  33. package/dist/index.d.ts +3 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +22 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/packages/api/commands/index.d.ts +6 -0
  38. package/dist/packages/api/commands/index.d.ts.map +1 -0
  39. package/dist/packages/api/commands/index.js +28 -0
  40. package/dist/packages/api/commands/index.js.map +1 -0
  41. package/dist/packages/api/commands/module.d.ts +6 -0
  42. package/dist/packages/api/commands/module.d.ts.map +1 -0
  43. package/dist/packages/api/commands/module.js +50 -0
  44. package/dist/packages/api/commands/module.js.map +1 -0
  45. package/dist/packages/api/commands/reset.d.ts +5 -0
  46. package/dist/packages/api/commands/reset.d.ts.map +1 -0
  47. package/dist/packages/api/commands/reset.js +25 -0
  48. package/dist/packages/api/commands/reset.js.map +1 -0
  49. package/dist/packages/api/commands/start.d.ts +3 -0
  50. package/dist/packages/api/commands/start.d.ts.map +1 -0
  51. package/dist/packages/api/commands/start.js +25 -0
  52. package/dist/packages/api/commands/start.js.map +1 -0
  53. package/dist/packages/api/commands/type.d.ts +6 -0
  54. package/dist/packages/api/commands/type.d.ts.map +1 -0
  55. package/dist/packages/api/commands/type.js +9 -0
  56. package/dist/packages/api/commands/type.js.map +1 -0
  57. package/dist/packages/api/commands/utils.d.ts +4 -0
  58. package/dist/packages/api/commands/utils.d.ts.map +1 -0
  59. package/dist/packages/api/commands/utils.js +27 -0
  60. package/dist/packages/api/commands/utils.js.map +1 -0
  61. package/dist/packages/api/constants.d.ts +5 -0
  62. package/dist/packages/api/constants.d.ts.map +1 -0
  63. package/dist/packages/api/constants.js +15 -0
  64. package/dist/packages/api/constants.js.map +1 -0
  65. package/dist/packages/api/env.d.ts +3 -0
  66. package/dist/packages/api/env.d.ts.map +1 -0
  67. package/dist/packages/api/env.js +23 -0
  68. package/dist/packages/api/env.js.map +1 -0
  69. package/dist/packages/api/index.d.ts +4 -0
  70. package/dist/packages/api/index.d.ts.map +1 -0
  71. package/dist/packages/api/index.js +26 -0
  72. package/dist/packages/api/index.js.map +1 -0
  73. package/dist/packages/constants.d.ts +5 -0
  74. package/dist/packages/constants.d.ts.map +1 -0
  75. package/dist/packages/constants.js +15 -0
  76. package/dist/packages/constants.js.map +1 -0
  77. package/dist/packages/index.d.ts +5 -0
  78. package/dist/packages/index.d.ts.map +1 -0
  79. package/dist/packages/index.js +27 -0
  80. package/dist/packages/index.js.map +1 -0
  81. package/dist/packages/type.d.ts +6 -0
  82. package/dist/packages/type.d.ts.map +1 -0
  83. package/dist/packages/type.js +9 -0
  84. package/dist/packages/type.js.map +1 -0
  85. package/dist/packages/ui/commands/index.d.ts +4 -0
  86. package/dist/packages/ui/commands/index.d.ts.map +1 -0
  87. package/dist/packages/ui/commands/index.js +26 -0
  88. package/dist/packages/ui/commands/index.js.map +1 -0
  89. package/dist/packages/ui/commands/module.d.ts +6 -0
  90. package/dist/packages/ui/commands/module.d.ts.map +1 -0
  91. package/dist/packages/ui/commands/module.js +56 -0
  92. package/dist/packages/ui/commands/module.js.map +1 -0
  93. package/dist/packages/ui/commands/start.d.ts +5 -0
  94. package/dist/packages/ui/commands/start.d.ts.map +1 -0
  95. package/dist/packages/ui/commands/start.js +34 -0
  96. package/dist/packages/ui/commands/start.js.map +1 -0
  97. package/dist/packages/ui/commands/type.d.ts +8 -0
  98. package/dist/packages/ui/commands/type.d.ts.map +1 -0
  99. package/dist/packages/ui/commands/type.js +9 -0
  100. package/dist/packages/ui/commands/type.js.map +1 -0
  101. package/dist/packages/ui/config/env.d.ts +3 -0
  102. package/dist/packages/ui/config/env.d.ts.map +1 -0
  103. package/dist/packages/ui/config/env.js +51 -0
  104. package/dist/packages/ui/config/env.js.map +1 -0
  105. package/dist/packages/ui/config/index.d.ts +4 -0
  106. package/dist/packages/ui/config/index.d.ts.map +1 -0
  107. package/dist/packages/ui/config/index.js +26 -0
  108. package/dist/packages/ui/config/index.js.map +1 -0
  109. package/dist/packages/ui/config/module.d.ts +3 -0
  110. package/dist/packages/ui/config/module.d.ts.map +1 -0
  111. package/dist/packages/ui/config/module.js +35 -0
  112. package/dist/packages/ui/config/module.js.map +1 -0
  113. package/dist/packages/ui/config/type.d.ts +10 -0
  114. package/dist/packages/ui/config/type.d.ts.map +1 -0
  115. package/dist/packages/ui/config/type.js +9 -0
  116. package/dist/packages/ui/config/type.js.map +1 -0
  117. package/dist/packages/ui/constants.d.ts +4 -0
  118. package/dist/packages/ui/constants.d.ts.map +1 -0
  119. package/dist/packages/ui/constants.js +14 -0
  120. package/dist/packages/ui/constants.js.map +1 -0
  121. package/dist/packages/ui/index.d.ts +4 -0
  122. package/dist/packages/ui/index.d.ts.map +1 -0
  123. package/dist/packages/ui/index.js +26 -0
  124. package/dist/packages/ui/index.js.map +1 -0
  125. package/dist/utils/index.d.ts +5 -0
  126. package/dist/utils/index.d.ts.map +1 -0
  127. package/dist/utils/index.js +27 -0
  128. package/dist/utils/index.js.map +1 -0
  129. package/dist/utils/line-breaks.d.ts +2 -0
  130. package/dist/utils/line-breaks.d.ts.map +1 -0
  131. package/dist/utils/line-breaks.js +14 -0
  132. package/dist/utils/line-breaks.js.map +1 -0
  133. package/dist/utils/modules-path.d.ts +2 -0
  134. package/dist/utils/modules-path.d.ts.map +1 -0
  135. package/dist/utils/modules-path.js +18 -0
  136. package/dist/utils/modules-path.js.map +1 -0
  137. package/dist/utils/process-output.d.ts +2 -0
  138. package/dist/utils/process-output.d.ts.map +1 -0
  139. package/dist/utils/process-output.js +42 -0
  140. package/dist/utils/process-output.js.map +1 -0
  141. package/dist/utils/stringify-object-args.d.ts +2 -0
  142. package/dist/utils/stringify-object-args.d.ts.map +1 -0
  143. package/dist/utils/stringify-object-args.js +19 -0
  144. package/dist/utils/stringify-object-args.js.map +1 -0
  145. package/package.json +6 -7
@@ -0,0 +1,3 @@
1
+ import type { CAC } from 'cac';
2
+ export declare function buildServerCommand(cac: CAC): void;
3
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAQ/B,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,QAmC1C"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildServerCommand = void 0;
13
+ const node_process_1 = __importDefault(require("node:process"));
14
+ const consola_1 = __importDefault(require("consola"));
15
+ const chalk_1 = __importDefault(require("chalk"));
16
+ const config_1 = require("../config");
17
+ const packages_1 = require("../packages");
18
+ function buildServerCommand(cac) {
19
+ cac.command('api <cmd>', 'Run a specific command.')
20
+ .action(async (command) => {
21
+ const root = node_process_1.default.cwd();
22
+ const config = await (0, config_1.createConfig)();
23
+ switch (command) {
24
+ case packages_1.ServerCommand.START: {
25
+ await (0, packages_1.startServer)({
26
+ args: {
27
+ root,
28
+ },
29
+ env: {
30
+ PORT: config.api.get('port'),
31
+ WRITABLE_DIRECTORY_PATH: config.api.get('writableDirectoryPath'),
32
+ },
33
+ envFromProcess: true,
34
+ });
35
+ break;
36
+ }
37
+ case packages_1.ServerCommand.RESET: {
38
+ await (0, packages_1.resetServer)({
39
+ args: {
40
+ root,
41
+ },
42
+ envFromProcess: true,
43
+ });
44
+ break;
45
+ }
46
+ default: {
47
+ consola_1.default.warn(`The command ${chalk_1.default.red(command)} was not recognized.`);
48
+ break;
49
+ }
50
+ }
51
+ });
52
+ }
53
+ exports.buildServerCommand = buildServerCommand;
54
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,gEAAmC;AAEnC,sDAA8B;AAC9B,kDAA0B;AAC1B,sCAAyC;AACzC,0CAEqB;AAErB,SAAgB,kBAAkB,CAAC,GAAQ;IACvC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,yBAAyB,CAAC;SAC9C,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,sBAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;QAEpC,QAAQ,OAAO,EAAE;YACb,KAAK,wBAAa,CAAC,KAAK,CAAC,CAAC;gBACtB,MAAM,IAAA,sBAAW,EAAC;oBACd,IAAI,EAAE;wBACF,IAAI;qBACP;oBACD,GAAG,EAAE;wBACD,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;wBAC5B,uBAAuB,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC;qBACnE;oBACD,cAAc,EAAE,IAAI;iBACvB,CAAC,CAAC;gBACH,MAAM;aACT;YACD,KAAK,wBAAa,CAAC,KAAK,CAAC,CAAC;gBACtB,MAAM,IAAA,sBAAW,EAAC;oBACd,IAAI,EAAE;wBACF,IAAI;qBACP;oBACD,cAAc,EAAE,IAAI;iBACvB,CAAC,CAAC;gBACH,MAAM;aACT;YACD,OAAO,CAAC,CAAC;gBACL,iBAAO,CAAC,IAAI,CAAC,eAAe,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBACtE,MAAM;aACT;SACJ;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAnCD,gDAmCC"}
@@ -0,0 +1,5 @@
1
+ export * from './info';
2
+ export * from './api';
3
+ export * from './start';
4
+ export * from './ui';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ __exportStar(require("./info"), exports);
24
+ __exportStar(require("./api"), exports);
25
+ __exportStar(require("./start"), exports);
26
+ __exportStar(require("./ui"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,wCAAsB;AACtB,0CAAwB;AACxB,uCAAqB"}
@@ -0,0 +1,3 @@
1
+ import type { CAC } from 'cac';
2
+ export declare function buildInfoCommand(cac: CAC): void;
3
+ //# sourceMappingURL=info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI/B,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,QAgBxC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildInfoCommand = void 0;
13
+ const consola_1 = __importDefault(require("consola"));
14
+ const config_1 = require("../config");
15
+ function buildInfoCommand(cac) {
16
+ cac.command('info', 'Get information about the configuration.')
17
+ .action(async () => {
18
+ const config = await (0, config_1.createConfig)();
19
+ consola_1.default.info(`Environment: ${config.api.get('env')}`);
20
+ consola_1.default.info(`RootPath: ${config.api.get('rootPath')}`);
21
+ consola_1.default.info(`WritableDirectoryPath: ${config.api.get('writableDirectoryPath')}`);
22
+ consola_1.default.info(`UI Host: ${config.ui.get('host')}`);
23
+ consola_1.default.info(`UI Port: ${config.ui.get('port')}`);
24
+ consola_1.default.info(`Server Host: ${config.api.get('host')}`);
25
+ consola_1.default.info(`Server Port: ${config.api.get('port')}`);
26
+ consola_1.default.info('Report an issue: https://github.com/authup/authup/issues/new');
27
+ consola_1.default.info('Suggest an improvement: https://github.com/authup/authup/discussions/new');
28
+ consola_1.default.info('Read documentation: https://authup.org');
29
+ });
30
+ }
31
+ exports.buildInfoCommand = buildInfoCommand;
32
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAGH,sDAA8B;AAC9B,sCAAyC;AAEzC,SAAgB,gBAAgB,CAAC,GAAQ;IACrC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,0CAA0C,CAAC;SAC1D,MAAM,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;QAEpC,iBAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtD,iBAAO,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACxD,iBAAO,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;QAClF,iBAAO,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClD,iBAAO,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClD,iBAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACvD,iBAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACvD,iBAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC7E,iBAAO,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;QACzF,iBAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACX,CAAC;AAhBD,4CAgBC"}
@@ -0,0 +1,3 @@
1
+ import type { CAC } from 'cac';
2
+ export declare function buildStartCommand(cac: CAC): void;
3
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAS/B,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,QA2CzC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildStartCommand = void 0;
13
+ const node_process_1 = __importDefault(require("node:process"));
14
+ const config_1 = require("../config");
15
+ const packages_1 = require("../packages");
16
+ function buildStartCommand(cac) {
17
+ cac
18
+ .command('start [...services]', 'Start one or many services.')
19
+ .action(async (services) => {
20
+ if (services.length === 0) {
21
+ services = Object.values(packages_1.ServiceName);
22
+ }
23
+ const root = node_process_1.default.cwd();
24
+ const config = await (0, config_1.createConfig)();
25
+ if (services.indexOf(packages_1.ServiceName.API) !== -1) {
26
+ const ctx = {
27
+ args: {
28
+ root,
29
+ },
30
+ env: {
31
+ PORT: config.api.get('port'),
32
+ WRITABLE_DIRECTORY_PATH: config.api.get('writableDirectoryPath'),
33
+ },
34
+ };
35
+ await (0, packages_1.startServer)(ctx);
36
+ }
37
+ if (services.indexOf(packages_1.ServiceName.UI) !== -1) {
38
+ const ctx = {
39
+ args: {
40
+ root,
41
+ },
42
+ env: {
43
+ PORT: config.ui.get('port'),
44
+ HOST: config.ui.get('host'),
45
+ PUBLIC_URL: config.ui.get('publicUrl'),
46
+ API_URL: config.ui.has('apiUrl') ?
47
+ config.ui.get('apiUrl') :
48
+ config.api.get('publicUrl'),
49
+ },
50
+ };
51
+ await (0, packages_1.startUI)(ctx);
52
+ }
53
+ });
54
+ }
55
+ exports.buildStartCommand = buildStartCommand;
56
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,gEAAmC;AAEnC,sCAAyC;AAEzC,0CAIqB;AAErB,SAAgB,iBAAiB,CAAC,GAAQ;IACtC,GAAG;SACE,OAAO,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;SAC7D,MAAM,CAAC,KAAK,EAAE,QAAkB,EAAE,EAAE;QACjC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,CAAC,CAAC;SACzC;QAED,MAAM,IAAI,GAAG,sBAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;QAEpC,IAAI,QAAQ,CAAC,OAAO,CAAC,sBAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC1C,MAAM,GAAG,GAA4B;gBACjC,IAAI,EAAE;oBACF,IAAI;iBACP;gBACD,GAAG,EAAE;oBACD,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;oBAC5B,uBAAuB,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC;iBACnE;aACJ,CAAC;YAEF,MAAM,IAAA,sBAAW,EAAC,GAAG,CAAC,CAAC;SAC1B;QAED,IAAI,QAAQ,CAAC,OAAO,CAAC,sBAAW,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YACzC,MAAM,GAAG,GAA2B;gBAChC,IAAI,EAAE;oBACF,IAAI;iBACP;gBACD,GAAG,EAAE;oBACD,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;oBAC3B,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;oBAC3B,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC;oBACtC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAC9B,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACzB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;iBAClC;aACJ,CAAC;YAEF,MAAM,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;SACtB;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AA3CD,8CA2CC"}
@@ -0,0 +1,3 @@
1
+ import type { CAC } from 'cac';
2
+ export declare function buildUiCommand(cac: CAC): void;
3
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAM/B,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,QAsCtC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildUiCommand = void 0;
13
+ const chalk_1 = __importDefault(require("chalk"));
14
+ const consola_1 = __importDefault(require("consola"));
15
+ const config_1 = require("../config");
16
+ const packages_1 = require("../packages");
17
+ function buildUiCommand(cac) {
18
+ cac
19
+ .command('ui <cmd>', 'Run a specific command')
20
+ .option('-p, --port [port]', 'Specify the port for starting the application.')
21
+ .option('-h, --host [host]', 'Specify the host for starting a specific application.')
22
+ .option('-d, --apiUrl [apiUrl]', 'Specify the apiUrl of the backend application.')
23
+ .action(async (command, ctx) => {
24
+ const config = await (0, config_1.createConfig)();
25
+ let { apiUrl } = ctx;
26
+ if (!apiUrl && config.ui.has('apiUrl')) {
27
+ apiUrl = config.ui.get('apiUrl');
28
+ }
29
+ if (!apiUrl) {
30
+ apiUrl = config.api.get('publicUrl');
31
+ }
32
+ switch (command) {
33
+ case packages_1.UICommand.START: {
34
+ await (0, packages_1.startUI)({
35
+ env: {
36
+ PORT: ctx.port || config.ui.get('port'),
37
+ HOST: ctx.host || config.ui.get('host'),
38
+ PUBLIC_URL: config.ui.get('publicUrl'),
39
+ API_URL: apiUrl,
40
+ },
41
+ envFromProcess: true,
42
+ });
43
+ break;
44
+ }
45
+ default: {
46
+ consola_1.default.warn(`The command ${chalk_1.default.red(command)} was not recognized.`);
47
+ break;
48
+ }
49
+ }
50
+ });
51
+ }
52
+ exports.buildUiCommand = buildUiCommand;
53
+ //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAGH,kDAA0B;AAC1B,sDAA8B;AAC9B,sCAAyC;AACzC,0CAAiD;AAEjD,SAAgB,cAAc,CAAC,GAAQ;IACnC,GAAG;SACE,OAAO,CAAC,UAAU,EAAE,wBAAwB,CAAC;SAC7C,MAAM,CAAC,mBAAmB,EAAE,gDAAgD,CAAC;SAC7E,MAAM,CAAC,mBAAmB,EAAE,uDAAuD,CAAC;SACpF,MAAM,CAAC,uBAAuB,EAAE,gDAAgD,CAAC;SACjF,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,GAAwB,EAAE,EAAE;QACxD,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;QAEpC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAErB,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SACxC;QAED,QAAQ,OAAO,EAAE;YACb,KAAK,oBAAS,CAAC,KAAK,CAAC,CAAC;gBAClB,MAAM,IAAA,kBAAO,EAAC;oBACV,GAAG,EAAE;wBACD,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;wBACvC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;wBACvC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC;wBACtC,OAAO,EAAE,MAAM;qBAClB;oBACD,cAAc,EAAE,IAAI;iBACvB,CAAC,CAAC;gBACH,MAAM;aACT;YACD,OAAO,CAAC,CAAC;gBACL,iBAAO,CAAC,IAAI,CAAC,eAAe,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBACtE,MAAM;aACT;SACJ;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAtCD,wCAsCC"}
@@ -0,0 +1,3 @@
1
+ export * from './module';
2
+ export * from './type';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ __exportStar(require("./module"), exports);
24
+ __exportStar(require("./type"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yCAAuB"}
@@ -0,0 +1,3 @@
1
+ import type { Config } from './type';
2
+ export declare function createConfig(): Promise<Config>;
3
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/config/module.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,wBAAsB,YAAY,IAAK,OAAO,CAAC,MAAM,CAAC,CAwBrD"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createConfig = void 0;
10
+ const core_1 = require("@authup/core");
11
+ const server_api_1 = require("@authup/server-api");
12
+ const server_core_1 = require("@authup/server-core");
13
+ const packages_1 = require("../packages");
14
+ async function createConfig() {
15
+ const global = await (0, server_core_1.readConfigFile)();
16
+ const api = (0, server_api_1.createConfig)();
17
+ const ui = (0, packages_1.createUIConfig)();
18
+ api.setRaw(global.api || {});
19
+ ui.setRaw(global.ui || {});
20
+ if (!ui.has('apiUrl') && api.has('publicUrl')) {
21
+ ui.setRaw('apiUrl', (0, core_1.makeURLPublicAccessible)(api.get('publicUrl')));
22
+ }
23
+ if (!ui.has('publicUrl') && api.has('authorizeRedirectUrl')) {
24
+ ui.set('publicUrl', api.get('authorizeRedirectUrl'));
25
+ }
26
+ (0, packages_1.extendServerConfigWithEnv)(api);
27
+ (0, packages_1.extendUIConfigWithEnv)(ui);
28
+ return {
29
+ api,
30
+ ui,
31
+ };
32
+ }
33
+ exports.createConfig = createConfig;
34
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/config/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAuD;AACvD,mDAAqE;AACrE,qDAAqD;AACrD,0CAA+F;AAGxF,KAAK,UAAU,YAAY;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAc,GAAE,CAAC;IAEtC,MAAM,GAAG,GAAG,IAAA,yBAAe,GAAE,CAAC;IAC9B,MAAM,EAAE,GAAG,IAAA,yBAAc,GAAE,CAAC;IAE5B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IAC7B,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QAC3C,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAA,8BAAuB,EAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE;QACzD,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC;KACxD;IAED,IAAA,oCAAyB,EAAC,GAAG,CAAC,CAAC;IAC/B,IAAA,gCAAqB,EAAC,EAAE,CAAC,CAAC;IAE1B,OAAO;QACH,GAAG;QACH,EAAE;KACL,CAAC;AACN,CAAC;AAxBD,oCAwBC"}
@@ -0,0 +1,7 @@
1
+ import type { Config as APiConfig } from '@authup/server-api';
2
+ import type { UIConfig } from '../packages';
3
+ export type Config = {
4
+ api: APiConfig;
5
+ ui: UIConfig;
6
+ };
7
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/config/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,MAAM,GAAG;IACjB,GAAG,EAAE,SAAS,CAAC;IACf,EAAE,EAAE,QAAQ,CAAA;CACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/config/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /*
4
+ * Copyright (c) 2022.
5
+ * Author Peter Placzek (tada5hi)
6
+ * For the full copyright and license information,
7
+ * view the LICENSE file that was distributed with this source code.
8
+ */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ const cac_1 = __importDefault(require("cac"));
14
+ const commands_1 = require("./commands");
15
+ const cli = (0, cac_1.default)();
16
+ (0, commands_1.buildInfoCommand)(cli);
17
+ (0, commands_1.buildStartCommand)(cli);
18
+ (0, commands_1.buildServerCommand)(cli);
19
+ (0, commands_1.buildUiCommand)(cli);
20
+ cli.help();
21
+ cli.parse();
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA;;;;;GAKG;;;;;AAEH,8CAAsB;AAEtB,yCAKoB;AAEpB,MAAM,GAAG,GAAG,IAAA,aAAG,GAAE,CAAC;AAElB,IAAA,2BAAgB,EAAC,GAAG,CAAC,CAAC;AACtB,IAAA,4BAAiB,EAAC,GAAG,CAAC,CAAC;AACvB,IAAA,6BAAkB,EAAC,GAAG,CAAC,CAAC;AACxB,IAAA,yBAAc,EAAC,GAAG,CAAC,CAAC;AAEpB,GAAG,CAAC,IAAI,EAAE,CAAC;AAEX,GAAG,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './module';
2
+ export * from './reset';
3
+ export * from './start';
4
+ export * from './type';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/api/commands/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ __exportStar(require("./module"), exports);
24
+ __exportStar(require("./reset"), exports);
25
+ __exportStar(require("./start"), exports);
26
+ __exportStar(require("./type"), exports);
27
+ __exportStar(require("./utils"), exports);
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packages/api/commands/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ import type { ChildProcess } from 'node:child_process';
3
+ import type { CommandExecutionContext } from '../../type';
4
+ import type { ServerCommand } from '../constants';
5
+ export declare function executeServerCommand(command: `${ServerCommand}`, ctx?: CommandExecutionContext): Promise<ChildProcess>;
6
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/packages/api/commands/module.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,wBAAsB,oBAAoB,CACtC,OAAO,EAAE,GAAG,aAAa,EAAE,EAC3B,GAAG,CAAC,EAAE,uBAAuB,GAC7B,OAAO,CAAC,YAAY,CAAC,CAiCxB"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022-2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.executeServerCommand = void 0;
13
+ const node_child_process_1 = require("node:child_process");
14
+ const node_path_1 = __importDefault(require("node:path"));
15
+ const node_process_1 = __importDefault(require("node:process"));
16
+ const consola_1 = __importDefault(require("consola"));
17
+ const resolve_package_path_1 = __importDefault(require("resolve-package-path"));
18
+ const utils_1 = require("../../../utils");
19
+ async function executeServerCommand(command, ctx) {
20
+ ctx = ctx || {};
21
+ ctx.env = ctx.env || {};
22
+ ctx.args = ctx.args || {};
23
+ return new Promise((resolve, reject) => {
24
+ let base = 'npx @authup/server-api';
25
+ const modulePath = (0, resolve_package_path_1.default)('@authup/server-api', node_process_1.default.cwd()) ||
26
+ (0, resolve_package_path_1.default)('@authup/server-api', (0, utils_1.getClosestNodeModulesPath)());
27
+ if (typeof modulePath === 'string') {
28
+ const directory = node_path_1.default.dirname(modulePath);
29
+ const outputPath = node_path_1.default.join(directory, 'dist', 'cli', 'index.js');
30
+ base = `node ${outputPath}`;
31
+ }
32
+ const childProcess = (0, node_child_process_1.exec)(`${base} ${command} ${(0, utils_1.stringifyObjectArgs)(ctx.args)}`, {
33
+ env: {
34
+ PATH: node_process_1.default.env.PATH,
35
+ ...(ctx.envFromProcess ? node_process_1.default.env : {}),
36
+ ...ctx.env,
37
+ },
38
+ });
39
+ childProcess.on('spawn', () => {
40
+ resolve(childProcess);
41
+ });
42
+ childProcess.stderr.setEncoding('utf-8');
43
+ childProcess.stderr.on('data', (data) => {
44
+ consola_1.default.warn(data);
45
+ reject(data);
46
+ });
47
+ });
48
+ }
49
+ exports.executeServerCommand = executeServerCommand;
50
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../src/packages/api/commands/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAGH,2DAA0C;AAC1C,0DAA6B;AAC7B,gEAAmC;AACnC,sDAA8B;AAC9B,gFAAqD;AACrD,0CAAgF;AAIzE,KAAK,UAAU,oBAAoB,CACtC,OAA2B,EAC3B,GAA6B;IAE7B,GAAG,GAAG,GAAG,IAAI,EAAE,CAAC;IAChB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;IACxB,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;IAE1B,OAAO,IAAI,OAAO,CAAe,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjD,IAAI,IAAI,GAAG,wBAAwB,CAAC;QACpC,MAAM,UAAU,GAAG,IAAA,8BAAiB,EAAC,oBAAoB,EAAE,sBAAO,CAAC,GAAG,EAAE,CAAC;YACrE,IAAA,8BAAiB,EAAC,oBAAoB,EAAE,IAAA,iCAAyB,GAAE,CAAC,CAAC;QAEzE,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAChC,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAC3C,MAAM,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;YACnE,IAAI,GAAG,QAAQ,UAAU,EAAE,CAAC;SAC/B;QAED,MAAM,YAAY,GAAG,IAAA,yBAAI,EAAC,GAAG,IAAI,IAAI,OAAO,IAAI,IAAA,2BAAmB,EAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE;YAC7E,GAAG,EAAE;gBACD,IAAI,EAAE,sBAAO,CAAC,GAAG,CAAC,IAAI;gBACtB,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,sBAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1C,GAAG,GAAG,CAAC,GAAG;aACb;SACJ,CAAC,CAAC;QACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC1B,OAAO,CAAC,YAAY,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACpC,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AApCD,oDAoCC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ import type { ChildProcess } from 'node:child_process';
3
+ import type { CommandExecutionContext } from '../../type';
4
+ export declare function resetServer(ctx?: CommandExecutionContext): Promise<ChildProcess>;
5
+ //# sourceMappingURL=reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../../src/packages/api/commands/reset.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAK1D,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,uBAAuB,GAAI,OAAO,CAAC,YAAY,CAAC,CAQvF"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.resetServer = void 0;
13
+ const consola_1 = __importDefault(require("consola"));
14
+ const constants_1 = require("../constants");
15
+ const module_1 = require("./module");
16
+ const utils_1 = require("./utils");
17
+ async function resetServer(ctx) {
18
+ consola_1.default.info('Server: Cleanup configuration, database, ...');
19
+ const childProcess = await (0, module_1.executeServerCommand)(constants_1.ServerCommand.RESET, ctx);
20
+ consola_1.default.success('Server: Cleaned up');
21
+ (0, utils_1.handleServerCommandOutput)(childProcess);
22
+ return childProcess;
23
+ }
24
+ exports.resetServer = resetServer;
25
+ //# sourceMappingURL=reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.js","sourceRoot":"","sources":["../../../../src/packages/api/commands/reset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAGH,sDAA8B;AAE9B,4CAA6C;AAC7C,qCAAgD;AAChD,mCAAoD;AAE7C,KAAK,UAAU,WAAW,CAAC,GAA6B;IAC3D,iBAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAoB,EAAC,yBAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1E,iBAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEtC,IAAA,iCAAyB,EAAC,YAAY,CAAC,CAAC;IAExC,OAAO,YAAY,CAAC;AACxB,CAAC;AARD,kCAQC"}
@@ -0,0 +1,3 @@
1
+ import type { ApiStartCommandContext } from './type';
2
+ export declare function startServer(ctx: ApiStartCommandContext): Promise<void>;
3
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../../src/packages/api/commands/start.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGrD,wBAAsB,WAAW,CAAC,GAAG,EAAE,sBAAsB,iBAQ5D"}