@apimatic/cli 1.0.2-alpha.2 → 1.1.0-alpha.1

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
@@ -15,7 +15,7 @@ The official CLI for APIMatic.
15
15
  # Usage
16
16
  <!-- usage -->
17
17
  ```sh-session
18
- $ npm install -g @apimatic/cli
18
+ $ npm install -g @apimatic/cli@1.0.1-alpha.3
19
19
  $ apimatic COMMAND
20
20
  running command...
21
21
  $ apimatic (-v|--version|version)
@@ -58,13 +58,16 @@ class Transform extends command_1.Command {
58
58
  this.error(JSON.parse(apiError.body)["dto.FileUrl"][0]);
59
59
  }
60
60
  else if (apiError.statusCode === 401 && apiError.body && typeof apiError.body === "string") {
61
- this.error(apiError.body);
61
+ this.error("You are not authorized to perform this action");
62
62
  }
63
63
  else if (apiError.statusCode === 500) {
64
64
  this.error(apiError.message);
65
65
  }
66
66
  }
67
- else if (error.statusCode === 401 &&
67
+ else if (error.statusCode === 401) {
68
+ this.error("You are not authorized to perform this action");
69
+ }
70
+ else if (error.statusCode === 402 &&
68
71
  error.body &&
69
72
  typeof error.body === "string") {
70
73
  this.error(error.body);
@@ -35,12 +35,20 @@ class Validate extends command_1.Command {
35
35
  this.error(utils_1.replaceHTML(result.modelState["exception Error"][0]));
36
36
  }
37
37
  else if (error.body && apiError.statusCode === 401) {
38
- this.error(error.body);
38
+ this.error("You are not authorized to perform this action");
39
39
  }
40
40
  else {
41
41
  this.error(error.message);
42
42
  }
43
43
  }
44
+ else if (error.statusCode === 401) {
45
+ this.error("You are not authorized to perform this action");
46
+ }
47
+ else if (error.statusCode === 402 &&
48
+ error.body &&
49
+ typeof error.body === "string") {
50
+ this.error(error.body);
51
+ }
44
52
  else {
45
53
  this.error(`${error.message}`);
46
54
  }
@@ -59,16 +59,24 @@ class PortalGenerate extends command_1.Command {
59
59
  }
60
60
  }
61
61
  else if (apiResponse.status === 401 && responseData.length > 0) {
62
- this.error(utils_1.replaceHTML(responseData));
62
+ this.error("You are not authorized to perform this action");
63
63
  }
64
64
  else if (apiResponse.status === 403 && apiResponse.statusText) {
65
- return this.error(utils_1.replaceHTML(apiResponse.statusText));
65
+ return this.error("Your subscription does not allow on premise portal generation");
66
66
  }
67
67
  else {
68
68
  return this.error(apiError.message);
69
69
  }
70
70
  }
71
71
  }
72
+ else if (error.statusCode === 401) {
73
+ this.error("You are not authorized to perform this action");
74
+ }
75
+ else if (error.statusCode === 402 &&
76
+ error.body &&
77
+ typeof error.body === "string") {
78
+ this.error(error.body);
79
+ }
72
80
  else {
73
81
  this.error(`${error.message}`);
74
82
  }
@@ -54,7 +54,7 @@ class SdkGenerate extends command_1.Command {
54
54
  }
55
55
  }
56
56
  else if (apiError.statusCode === 401 && apiError.body && typeof apiError.body === "string") {
57
- this.error(apiError.body);
57
+ this.error("You are not authorized to perform this action");
58
58
  }
59
59
  else if (apiError.statusCode === 500 &&
60
60
  apiError.body &&
@@ -72,6 +72,14 @@ class SdkGenerate extends command_1.Command {
72
72
  this.error(utils_1.replaceHTML(result.message));
73
73
  }
74
74
  }
75
+ else if (error.statusCode === 401) {
76
+ this.error("You are not authorized to perform this action");
77
+ }
78
+ else if (error.statusCode === 402 &&
79
+ error.body &&
80
+ typeof error.body === "string") {
81
+ this.error(utils_1.replaceHTML(error.body));
82
+ }
75
83
  else {
76
84
  this.error(`${error.message}`);
77
85
  }
@@ -1 +1 @@
1
- export declare const baseURL = "https://apimaticio-test.azurewebsites.net/api";
1
+ export declare const baseURL = "https://www.apimatic.io/api";
package/lib/config/env.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.baseURL = void 0;
4
- exports.baseURL = "https://apimaticio-test.azurewebsites.net/api";
4
+ exports.baseURL = "https://www.apimatic.io/api";
@@ -1,9 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  import { TransformationController } from "@apimatic/sdk";
3
- export declare type AuthenticationError = {
4
- statusCode: number;
5
- body: string;
6
- };
7
3
  export declare type TransformationIdParams = {
8
4
  file: string;
9
5
  url: string;
@@ -8,3 +8,7 @@ export declare type loggers = {
8
8
  warn: (message: string) => void;
9
9
  error: (message: string) => void;
10
10
  };
11
+ export declare type AuthenticationError = {
12
+ statusCode: number;
13
+ body: string;
14
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apimatic/cli",
3
3
  "description": "The official CLI for APIMatic.",
4
- "version": "1.0.2-alpha.2",
4
+ "version": "1.1.0-alpha.1",
5
5
  "author": "APIMatic",
6
6
  "bin": {
7
7
  "apimatic": "./bin/run"
@@ -43,7 +43,7 @@
43
43
  "lint:fix": "eslint --fix \"src/**/*.{js,ts}\" --quiet"
44
44
  },
45
45
  "dependencies": {
46
- "@apimatic/sdk": "^0.0.1-alpha.8",
46
+ "@apimatic/sdk": "^0.0.1-alpha.10",
47
47
  "@oclif/command": "^1.8.0",
48
48
  "@oclif/config": "^1.17.0",
49
49
  "@oclif/plugin-autocomplete": "^0.3.0",