link2aws 1.0.23 → 1.0.24

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 (2) hide show
  1. package/link2aws.js +8 -3
  2. package/package.json +1 -1
package/link2aws.js CHANGED
@@ -57,8 +57,13 @@ class ARN {
57
57
  }
58
58
  }
59
59
 
60
- // ...:resource-type/resource-id (resource-id can contain slashes!)
61
- else if (typeof (tokens[5]) != 'undefined' && tokens[5].indexOf('/') > 0) {
60
+ // ...:resource-type/resource-id (common case)
61
+ // ...:/resource-type/resource-id (apigateway)
62
+ // resource-id can contain slashes.
63
+ else if (typeof (tokens[5]) != 'undefined' && tokens[5].slice(1).indexOf('/') >= 0) {
64
+ if (tokens[5].startsWith('/')) {
65
+ tokens[5] = tokens[5].slice(1);
66
+ }
62
67
  this.resource_type = tokens[5].slice(0, tokens[5].indexOf('/'));
63
68
  this.resource = tokens[5].slice(tokens[5].indexOf('/') + 1, tokens[5].length);
64
69
  this.hasPath = true;
@@ -182,7 +187,7 @@ class ARN {
182
187
  },
183
188
  },
184
189
  "apigateway": { // Manage Amazon API Gateway
185
- "": null,
190
+ "restapis": () => `https://${this.region}.${this.console}/apigateway/main/apis/${this.resource}/resources?api=${this.resource}&region=${this.region}`,
186
191
  },
187
192
  "appconfig": { // AWS AppConfig
188
193
  "application": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "link2aws",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Convert ARN (Amazon Resource Name) to AWS Console link",
5
5
  "main": "link2aws.js",
6
6
  "directories": {