hereya-cli 0.89.1 → 0.91.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.
Files changed (67) hide show
  1. package/README.md +88 -75
  2. package/dist/backend/cloud/cloud-backend/apps-deploy.d.ts +69 -0
  3. package/dist/backend/cloud/cloud-backend/apps-deploy.js +94 -0
  4. package/dist/backend/cloud/cloud-backend/apps-versions.d.ts +69 -0
  5. package/dist/backend/cloud/cloud-backend/apps-versions.js +113 -0
  6. package/dist/backend/cloud/cloud-backend/executor-broker.d.ts +25 -0
  7. package/dist/backend/cloud/cloud-backend/executor-broker.js +38 -0
  8. package/dist/backend/cloud/cloud-backend/executor-jobs.d.ts +75 -0
  9. package/dist/backend/cloud/cloud-backend/executor-jobs.js +110 -0
  10. package/dist/backend/cloud/cloud-backend/misc.d.ts +5 -0
  11. package/dist/backend/cloud/cloud-backend/misc.js +78 -0
  12. package/dist/backend/cloud/cloud-backend/packages-publish.d.ts +3 -0
  13. package/dist/backend/cloud/cloud-backend/packages-publish.js +99 -0
  14. package/dist/backend/cloud/cloud-backend/packages-registry.d.ts +6 -0
  15. package/dist/backend/cloud/cloud-backend/packages-registry.js +146 -0
  16. package/dist/backend/cloud/cloud-backend/packages-workspace.d.ts +4 -0
  17. package/dist/backend/cloud/cloud-backend/packages-workspace.js +50 -0
  18. package/dist/backend/cloud/cloud-backend/projects.d.ts +7 -0
  19. package/dist/backend/cloud/cloud-backend/projects.js +122 -0
  20. package/dist/backend/cloud/cloud-backend/state.d.ts +6 -0
  21. package/dist/backend/cloud/cloud-backend/state.js +86 -0
  22. package/dist/backend/cloud/cloud-backend/utils.d.ts +55 -0
  23. package/dist/backend/cloud/cloud-backend/utils.js +56 -0
  24. package/dist/backend/cloud/cloud-backend/workspace-env.d.ts +5 -0
  25. package/dist/backend/cloud/cloud-backend/workspace-env.js +63 -0
  26. package/dist/backend/cloud/cloud-backend/workspaces.d.ts +7 -0
  27. package/dist/backend/cloud/cloud-backend/workspaces.js +124 -0
  28. package/dist/backend/cloud/cloud-backend.d.ts +59 -126
  29. package/dist/backend/cloud/cloud-backend.js +100 -1087
  30. package/dist/backend/cloud/cloud-backend.test.setup.d.ts +13 -0
  31. package/dist/backend/cloud/cloud-backend.test.setup.js +14 -0
  32. package/dist/backend/common.d.ts +2 -2
  33. package/dist/backend/local.setup.d.ts +10 -0
  34. package/dist/backend/local.setup.js +20 -0
  35. package/dist/commands/executor/start/index.d.ts +4 -11
  36. package/dist/commands/executor/start/index.js +118 -520
  37. package/dist/commands/workspace/executor/install/index.d.ts +3 -0
  38. package/dist/commands/workspace/executor/install/index.js +210 -76
  39. package/dist/commands/workspace/executor/uninstall/index.d.ts +1 -0
  40. package/dist/commands/workspace/executor/uninstall/index.js +30 -4
  41. package/dist/executor/local.d.ts +0 -1
  42. package/dist/executor/local.js +10 -62
  43. package/dist/executor/resolve-env.d.ts +88 -0
  44. package/dist/executor/resolve-env.js +77 -0
  45. package/dist/index.d.ts +3 -0
  46. package/dist/index.js +7 -0
  47. package/dist/infrastructure/index.d.ts +12 -16
  48. package/dist/infrastructure/index.js +18 -25
  49. package/dist/infrastructure/registry.d.ts +38 -0
  50. package/dist/infrastructure/registry.js +61 -0
  51. package/dist/lib/env/test.setup.d.ts +7 -0
  52. package/dist/lib/env/test.setup.js +18 -0
  53. package/dist/lib/executor-start/auth.d.ts +2 -0
  54. package/dist/lib/executor-start/auth.js +21 -0
  55. package/dist/lib/executor-start/execute-app-job.d.ts +13 -0
  56. package/dist/lib/executor-start/execute-app-job.js +146 -0
  57. package/dist/lib/executor-start/execute-deploy-job.d.ts +14 -0
  58. package/dist/lib/executor-start/execute-deploy-job.js +64 -0
  59. package/dist/lib/executor-start/execute-init-job.d.ts +14 -0
  60. package/dist/lib/executor-start/execute-init-job.js +135 -0
  61. package/dist/lib/executor-start/format.d.ts +13 -0
  62. package/dist/lib/executor-start/format.js +22 -0
  63. package/dist/lib/executor-start/job-dispatch.d.ts +15 -0
  64. package/dist/lib/executor-start/job-dispatch.js +89 -0
  65. package/dist/lib/package/index.d.ts +25 -25
  66. package/oclif.manifest.json +43 -3
  67. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ import nock from 'nock';
2
+ import { CloudBackend } from './cloud-backend.js';
3
+ export declare const cloudConfig: {
4
+ accessToken: string;
5
+ clientId: string;
6
+ refreshToken: string;
7
+ url: string;
8
+ };
9
+ export interface CloudBackendTestContext {
10
+ backend: CloudBackend;
11
+ scope: nock.Scope;
12
+ }
13
+ export declare function setupCloudBackendTest(): CloudBackendTestContext;
@@ -0,0 +1,14 @@
1
+ import nock from 'nock';
2
+ import { CloudBackend } from './cloud-backend.js';
3
+ export const cloudConfig = {
4
+ accessToken: 'test-token',
5
+ clientId: 'test-client-id',
6
+ refreshToken: 'test-refresh-token',
7
+ url: 'http://test.com',
8
+ };
9
+ export function setupCloudBackendTest() {
10
+ return {
11
+ backend: new CloudBackend(cloudConfig),
12
+ scope: nock(cloudConfig.url),
13
+ };
14
+ }
@@ -61,11 +61,11 @@ export declare const WorkspaceSchema: z.ZodObject<{
61
61
  name: string;
62
62
  id: string;
63
63
  env?: Record<string, string> | undefined;
64
+ profile?: string | undefined;
64
65
  packages?: Record<string, {
65
66
  version: string;
66
67
  parameters?: Record<string, any> | undefined;
67
68
  }> | undefined;
68
- profile?: string | undefined;
69
69
  hasExecutor?: boolean | undefined;
70
70
  isDeploy?: boolean | undefined;
71
71
  mirrorOf?: string | undefined;
@@ -77,11 +77,11 @@ export declare const WorkspaceSchema: z.ZodObject<{
77
77
  name: string;
78
78
  id: string;
79
79
  env?: Record<string, string> | undefined;
80
+ profile?: string | undefined;
80
81
  packages?: Record<string, {
81
82
  version: string;
82
83
  parameters?: Record<string, any> | undefined;
83
84
  }> | undefined;
84
- profile?: string | undefined;
85
85
  hasExecutor?: boolean | undefined;
86
86
  isDeploy?: boolean | undefined;
87
87
  mirrorOf?: string | undefined;
@@ -0,0 +1,10 @@
1
+ export interface LocalBackendTestContext {
2
+ homeDir: string;
3
+ }
4
+ /**
5
+ * Shared setup helpers for LocalFileBackend tests. Each split test file calls
6
+ * `setupLocalBackendTest()` from its `beforeEach` and uses the returned context
7
+ * to access the temp homeDir. Stubbing of `os.homedir` is restored by sinon.
8
+ */
9
+ export declare function setupLocalBackendTest(): Promise<LocalBackendTestContext>;
10
+ export declare function teardownLocalBackendTest(context: LocalBackendTestContext): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import fs from 'node:fs/promises';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import * as sinon from 'sinon';
6
+ /**
7
+ * Shared setup helpers for LocalFileBackend tests. Each split test file calls
8
+ * `setupLocalBackendTest()` from its `beforeEach` and uses the returned context
9
+ * to access the temp homeDir. Stubbing of `os.homedir` is restored by sinon.
10
+ */
11
+ export async function setupLocalBackendTest() {
12
+ const homeDir = path.join(os.tmpdir(), 'hereya-test', randomUUID());
13
+ sinon.stub(os, 'homedir').returns(homeDir);
14
+ await fs.mkdir(path.join(homeDir, '.hereya', 'state', 'workspaces'), { recursive: true });
15
+ return { homeDir };
16
+ }
17
+ export async function teardownLocalBackendTest(context) {
18
+ sinon.restore();
19
+ await fs.rm(context.homeDir, { force: true, recursive: true });
20
+ }
@@ -1,23 +1,16 @@
1
1
  import { Command } from '@oclif/core';
2
- /**
3
- * Strip credentials from log strings before flushing them to the cloud.
4
- * Removes:
5
- * - any occurrence of the actual hereyaGitPassword value
6
- * - userinfo from URLs (https://user:pass@host -> https://host)
7
- */
8
- export declare function redactCredentials(str: string, password?: string): string;
2
+ export { redactCredentials } from '../../../lib/executor-start/format.js';
9
3
  export default class ExecutorStart extends Command {
10
4
  static description: string;
11
5
  static examples: string[];
12
6
  static flags: {
13
7
  concurrency: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
+ idleTimeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
9
  workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
10
  };
16
11
  run(): Promise<void>;
17
12
  private executeAppJob;
18
- private executeDeployJob;
19
13
  private executeInitJob;
20
- private executeJob;
21
- private markAppDeploymentFailed;
22
- private patchAppFinalState;
14
+ private handleUnauthorizedPoll;
15
+ private runPollIteration;
23
16
  }