hereya-cli 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
20
20
  $ hereya COMMAND
21
21
  running command...
22
22
  $ hereya (--version)
23
- hereya-cli/0.3.0 linux-x64 node-v20.13.1
23
+ hereya-cli/0.3.2 linux-x64 node-v20.13.1
24
24
  $ hereya --help [COMMAND]
25
25
  USAGE
26
26
  $ hereya COMMAND
@@ -68,7 +68,7 @@ EXAMPLES
68
68
  $ hereya add cloudy/docker_postgres
69
69
  ```
70
70
 
71
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/add/index.ts)_
71
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/add/index.ts)_
72
72
 
73
73
  ## `hereya bootstrap INFRASTRUCTURETYPE`
74
74
 
@@ -93,7 +93,7 @@ EXAMPLES
93
93
  $ hereya bootstrap local
94
94
  ```
95
95
 
96
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/bootstrap/index.ts)_
96
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/bootstrap/index.ts)_
97
97
 
98
98
  ## `hereya down`
99
99
 
@@ -114,7 +114,7 @@ EXAMPLES
114
114
  $ hereya down
115
115
  ```
116
116
 
117
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/down/index.ts)_
117
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/down/index.ts)_
118
118
 
119
119
  ## `hereya env`
120
120
 
@@ -137,7 +137,7 @@ EXAMPLES
137
137
  $ hereya env -w dev
138
138
  ```
139
139
 
140
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/env/index.ts)_
140
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/env/index.ts)_
141
141
 
142
142
  ## `hereya help [COMMAND]`
143
143
 
@@ -183,7 +183,7 @@ EXAMPLES
183
183
  $ hereya init myProject -w=defaultWorkspace --chdir=./myProject
184
184
  ```
185
185
 
186
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/init/index.ts)_
186
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/init/index.ts)_
187
187
 
188
188
  ## `hereya remote exec [PKGPATH]`
189
189
 
@@ -206,7 +206,7 @@ EXAMPLES
206
206
  $ hereya remote exec
207
207
  ```
208
208
 
209
- _See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/remote/exec/index.ts)_
209
+ _See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/remote/exec/index.ts)_
210
210
 
211
211
  ## `hereya remove PACKAGE`
212
212
 
@@ -229,7 +229,7 @@ EXAMPLES
229
229
  $ hereya remove cloudy/docker_postgres
230
230
  ```
231
231
 
232
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/remove/index.ts)_
232
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/remove/index.ts)_
233
233
 
234
234
  ## `hereya run CMD`
235
235
 
@@ -255,7 +255,7 @@ EXAMPLES
255
255
  $ hereya run -w uat -- node index.js
256
256
  ```
257
257
 
258
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/run/index.ts)_
258
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/run/index.ts)_
259
259
 
260
260
  ## `hereya up`
261
261
 
@@ -276,7 +276,7 @@ EXAMPLES
276
276
  $ hereya up
277
277
  ```
278
278
 
279
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/up/index.ts)_
279
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/up/index.ts)_
280
280
 
281
281
  ## `hereya workspace create NAME`
282
282
 
@@ -296,7 +296,7 @@ EXAMPLES
296
296
  $ hereya workspace create dev
297
297
  ```
298
298
 
299
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/workspace/create/index.ts)_
299
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/workspace/create/index.ts)_
300
300
 
301
301
  ## `hereya workspace delete NAME`
302
302
 
@@ -316,7 +316,7 @@ EXAMPLES
316
316
  $ hereya workspace delete dev
317
317
  ```
318
318
 
319
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/workspace/delete/index.ts)_
319
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/workspace/delete/index.ts)_
320
320
 
321
321
  ## `hereya workspace env`
322
322
 
@@ -336,7 +336,7 @@ EXAMPLES
336
336
  $ hereya workspace env -w dev
337
337
  ```
338
338
 
339
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/workspace/env/index.ts)_
339
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/workspace/env/index.ts)_
340
340
 
341
341
  ## `hereya workspace install PACKAGE`
342
342
 
@@ -362,7 +362,7 @@ EXAMPLES
362
362
  $ hereya workspace install hereya/aws-cognito
363
363
  ```
364
364
 
365
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/workspace/install/index.ts)_
365
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/workspace/install/index.ts)_
366
366
 
367
367
  ## `hereya workspace uninstall PACKAGE`
368
368
 
@@ -388,5 +388,5 @@ EXAMPLES
388
388
  $ hereya workspace uninstall hereya/aws-cognito
389
389
  ```
390
390
 
391
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.0/src/commands/workspace/uninstall/index.ts)_
391
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.3.2/src/commands/workspace/uninstall/index.ts)_
392
392
  <!-- commandsstop -->
@@ -3,7 +3,7 @@ export declare class AwsInfrastructure implements Infrastructure {
3
3
  bootstrap(_: BootstrapInput): Promise<void>;
4
4
  destroy(input: DestroyInput): Promise<DestroyOutput>;
5
5
  provision(input: ProvisionInput): Promise<ProvisionOutput>;
6
- resolveEnv(_: ResolveEnvInput): Promise<ResolveEnvOutput>;
6
+ resolveEnv(input: ResolveEnvInput): Promise<ResolveEnvOutput>;
7
7
  saveEnv(input: SaveEnvInput): Promise<SaveEnvOutput>;
8
8
  private getEnv;
9
9
  private runCdkBuild;
@@ -33,8 +33,17 @@ export class AwsInfrastructure {
33
33
  const env = await this.getEnv(input.id);
34
34
  return { env, success: true };
35
35
  }
36
- async resolveEnv(_) {
37
- throw new Error('Method not implemented.');
36
+ async resolveEnv(input) {
37
+ const parameterStoreArnPattern = /^arn:aws:ssm:[\da-z-]+:\d{12}:parameter\/[\w./-]+$/;
38
+ const ssmClient = new SSMClient({});
39
+ if (parameterStoreArnPattern.test(input.value)) {
40
+ const response = await ssmClient.send(new GetParameterCommand({
41
+ Name: input.value,
42
+ WithDecryption: true,
43
+ }));
44
+ return { value: response.Parameter?.Value ?? input.value };
45
+ }
46
+ return { value: input.value };
38
47
  }
39
48
  async saveEnv(input) {
40
49
  const key = `/hereya/${input.id}`;
@@ -18,6 +18,12 @@ export class ParameterManager {
18
18
  return { parameters };
19
19
  }
20
20
  async savePackageParameters(input) {
21
+ if (Object.keys(input.parameters ?? {}).length === 0) {
22
+ return {
23
+ filePath: null,
24
+ saved: false,
25
+ };
26
+ }
21
27
  const pkgName = getPackageCanonicalName(input.package);
22
28
  const paramFilesExist = await Promise.all([
23
29
  [`${pkgName}.yaml`, `${pkgName}.yml`],
@@ -606,5 +606,5 @@
606
606
  ]
607
607
  }
608
608
  },
609
- "version": "0.3.0"
609
+ "version": "0.3.2"
610
610
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Developer's Package Manager for Seamless Infrastructure Integration.",
4
- "version": "0.3.0",
4
+ "version": "0.3.2",
5
5
  "author": "The Hereya team",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"