@forge/cli-shared 9.7.0-next.1-experimental-13c2f8d → 9.7.0-next.11

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 (40) hide show
  1. package/CHANGELOG.md +55 -7
  2. package/out/ari/ari.d.ts +5 -0
  3. package/out/ari/ari.d.ts.map +1 -1
  4. package/out/ari/ari.js +13 -1
  5. package/out/graphql/graphql-types.d.ts +3196 -228
  6. package/out/graphql/graphql-types.d.ts.map +1 -1
  7. package/out/graphql/graphql-types.js +422 -104
  8. package/out/http-client/file-uploader.d.ts.map +1 -1
  9. package/out/http-client/file-uploader.js +2 -1
  10. package/out/http-client/node-request.d.ts +2 -0
  11. package/out/http-client/node-request.d.ts.map +1 -1
  12. package/out/http-client/node-request.js +4 -3
  13. package/out/tunnel/docker-compose-lifecycle.d.ts +0 -3
  14. package/out/tunnel/docker-compose-lifecycle.d.ts.map +1 -1
  15. package/out/tunnel/docker-compose-lifecycle.js +8 -10
  16. package/out/tunnel/index.d.ts +0 -1
  17. package/out/tunnel/index.d.ts.map +1 -1
  18. package/out/tunnel/index.js +0 -1
  19. package/out/tunnel/tunnel-options.d.ts +0 -2
  20. package/out/tunnel/tunnel-options.d.ts.map +1 -1
  21. package/out/ui/command-line-ui.d.ts +7 -3
  22. package/out/ui/command-line-ui.d.ts.map +1 -1
  23. package/out/ui/command-line-ui.js +62 -13
  24. package/out/ui/index.d.ts +1 -0
  25. package/out/ui/index.d.ts.map +1 -1
  26. package/out/ui/index.js +1 -0
  27. package/out/ui/table-prompt.d.ts.map +1 -1
  28. package/out/ui/table-prompt.js +2 -2
  29. package/out/ui/table.d.ts +9 -0
  30. package/out/ui/table.d.ts.map +1 -0
  31. package/out/ui/table.js +57 -0
  32. package/out/ui/text.d.ts +72 -66
  33. package/out/ui/text.d.ts.map +1 -1
  34. package/out/ui/text.js +82 -66
  35. package/out/ui/ui.d.ts +6 -1
  36. package/out/ui/ui.d.ts.map +1 -1
  37. package/package.json +3 -3
  38. package/out/tunnel/compose-project-lifecycle.d.ts +0 -39
  39. package/out/tunnel/compose-project-lifecycle.d.ts.map +0 -1
  40. package/out/tunnel/compose-project-lifecycle.js +0 -105
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseComposePs = exports.ComposeProjectLifecycle = void 0;
4
- const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
6
- const docker_compose_1 = require("docker-compose");
7
- const docker_compose_lifecycle_1 = require("./docker-compose-lifecycle");
8
- const defaultAdapter = {
9
- pullOne: (service, options) => (0, docker_compose_1.pullOne)(service, options),
10
- exec: (command, args, options) => (0, docker_compose_1.execCompose)(command, args, options),
11
- down: (options) => (0, docker_compose_1.downAll)(options)
12
- };
13
- class ComposeProjectLifecycle {
14
- configPath;
15
- projectName;
16
- logger;
17
- adapter;
18
- constructor(configPath, projectName, logger, adapter = defaultAdapter) {
19
- this.configPath = configPath;
20
- this.projectName = projectName;
21
- this.logger = logger;
22
- this.adapter = adapter;
23
- }
24
- options(log = false) {
25
- return {
26
- cwd: path.dirname(this.configPath),
27
- log,
28
- config: this.configPath,
29
- composeOptions: [`-p${this.projectName}`],
30
- callback: (0, docker_compose_lifecycle_1.createDockerLifecycleLogFilter)(this.logger)
31
- };
32
- }
33
- async pull(services) {
34
- for (const service of services) {
35
- try {
36
- await this.adapter.pullOne(service, this.options());
37
- }
38
- catch (error) {
39
- throw new Error(`Unable to pull the ${service} image: ${(0, docker_compose_lifecycle_1.getDockerComposeErrorMessage)(error)}`);
40
- }
41
- }
42
- }
43
- async up(services) {
44
- try {
45
- await this.adapter.exec('up', ['--detach', '--no-build', '--remove-orphans', ...services], this.options());
46
- }
47
- catch (error) {
48
- throw new Error(`Unable to start the Docker Compose project: ${(0, docker_compose_lifecycle_1.getDockerComposeErrorMessage)(error)}`);
49
- }
50
- }
51
- async down() {
52
- try {
53
- await this.adapter.down(this.options());
54
- }
55
- catch (error) {
56
- throw new Error(`Unable to stop the Docker Compose project: ${(0, docker_compose_lifecycle_1.getDockerComposeErrorMessage)(error)}`);
57
- }
58
- }
59
- async states() {
60
- try {
61
- const result = await this.adapter.exec('ps', ['--all', '--format', 'json'], this.options());
62
- return (0, exports.parseComposePs)(result.out ?? '');
63
- }
64
- catch (error) {
65
- throw new Error(`Unable to inspect the Docker Compose project: ${(0, docker_compose_lifecycle_1.getDockerComposeErrorMessage)(error)}`);
66
- }
67
- }
68
- async logs(service, lines = 80) {
69
- try {
70
- const result = await this.adapter.exec('logs', ['--no-color', '--tail', lines.toString(), service], this.options());
71
- return [result.out, result.err].filter(Boolean).join('\n').trim();
72
- }
73
- catch (error) {
74
- return (0, docker_compose_lifecycle_1.getDockerComposeErrorMessage)(error);
75
- }
76
- }
77
- }
78
- exports.ComposeProjectLifecycle = ComposeProjectLifecycle;
79
- const parseComposePs = (output) => {
80
- const trimmed = output.trim();
81
- if (!trimmed)
82
- return [];
83
- const records = (() => {
84
- try {
85
- const parsed = JSON.parse(trimmed);
86
- return Array.isArray(parsed) ? parsed : [parsed];
87
- }
88
- catch {
89
- return trimmed
90
- .split('\n')
91
- .filter(Boolean)
92
- .map((line) => JSON.parse(line));
93
- }
94
- })();
95
- return records.map((item) => {
96
- const value = item;
97
- return {
98
- name: String(value.Name ?? value.name ?? ''),
99
- service: String(value.Service ?? value.service ?? ''),
100
- state: String(value.State ?? value.state ?? ''),
101
- health: value.Health == null && value.health == null ? undefined : String(value.Health ?? value.health)
102
- };
103
- });
104
- };
105
- exports.parseComposePs = parseComposePs;