@autifyhq/autify-sdk 0.1.0-beta.2 → 0.1.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.
@@ -1,11 +1,12 @@
1
1
  import { AxiosRequestConfig } from "axios";
2
2
  import { RunTestPlan201Response, RunTestPlanRequest, UploadBuild201Response } from "./openapi";
3
- export { BASE_PATH } from "./openapi/base";
3
+ export { BASE_PATH as MOBILE_BASE_PATH } from "./openapi/base";
4
4
  declare type Options = Readonly<{
5
5
  basePath?: string;
6
6
  userAgent?: string;
7
7
  }>;
8
- export declare class Client {
8
+ export declare class MobileClient {
9
+ readonly version: string;
9
10
  constructor(accessToken: string, { basePath, userAgent }?: Options);
10
11
  private readonly buildsApi;
11
12
  /**
@@ -1,23 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = exports.BASE_PATH = void 0;
3
+ exports.MobileClient = exports.MOBILE_BASE_PATH = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const form_data_1 = tslib_1.__importDefault(require("form-data"));
6
6
  const fs_1 = require("fs");
7
7
  const openapi_1 = require("./openapi");
8
8
  var base_1 = require("./openapi/base");
9
- Object.defineProperty(exports, "BASE_PATH", { enumerable: true, get: function () { return base_1.BASE_PATH; } });
9
+ Object.defineProperty(exports, "MOBILE_BASE_PATH", { enumerable: true, get: function () { return base_1.BASE_PATH; } });
10
10
  class CustomFormData extends form_data_1.default {
11
11
  append(key, filename) {
12
12
  const blob = (0, fs_1.readFileSync)(filename);
13
13
  super.append(key, blob, { filename });
14
14
  }
15
15
  }
16
- class Client {
16
+ class MobileClient {
17
17
  constructor(accessToken, { basePath, userAgent } = {}) {
18
18
  if (!accessToken) {
19
19
  throw new Error("accessToken is required.");
20
20
  }
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+ this.version = require("../../../package.json").version;
21
23
  const baseOptions = {
22
24
  ...(userAgent && {
23
25
  headers: {
@@ -59,4 +61,4 @@ class Client {
59
61
  return this.testPlansApi.runTestPlan(testPlanId, runTestPlanRequest, options);
60
62
  }
61
63
  }
62
- exports.Client = Client;
64
+ exports.MobileClient = MobileClient;
@@ -1,11 +1,12 @@
1
1
  import { AxiosRequestConfig } from "axios";
2
2
  import { CapabilityOption, CreateUrlReplacementRequest, DescribeResult200Response, ExecuteScenariosRequest, ExecuteScenariosResult, ExecuteSchedule200Response, Story, TestPlanResult, UpdateUrlReplacementRequest, UrlReplacement } from "./openapi";
3
- export { BASE_PATH } from "./openapi/base";
3
+ export { BASE_PATH as WEB_BASE_PATH } from "./openapi/base";
4
4
  declare type Options = Readonly<{
5
5
  basePath?: string;
6
6
  userAgent?: string;
7
7
  }>;
8
- export declare class Client {
8
+ export declare class WebClient {
9
+ readonly version: string;
9
10
  constructor(accessToken: string, { basePath, userAgent }?: Options);
10
11
  private readonly capabilityApi;
11
12
  /**
@@ -1,23 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = exports.BASE_PATH = void 0;
3
+ exports.WebClient = exports.WEB_BASE_PATH = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const form_data_1 = tslib_1.__importDefault(require("form-data"));
6
6
  const fs_1 = require("fs");
7
7
  const openapi_1 = require("./openapi");
8
8
  var base_1 = require("./openapi/base");
9
- Object.defineProperty(exports, "BASE_PATH", { enumerable: true, get: function () { return base_1.BASE_PATH; } });
9
+ Object.defineProperty(exports, "WEB_BASE_PATH", { enumerable: true, get: function () { return base_1.BASE_PATH; } });
10
10
  class CustomFormData extends form_data_1.default {
11
11
  append(key, filename) {
12
12
  const blob = (0, fs_1.readFileSync)(filename);
13
13
  super.append(key, blob, { filename });
14
14
  }
15
15
  }
16
- class Client {
16
+ class WebClient {
17
17
  constructor(accessToken, { basePath, userAgent } = {}) {
18
18
  if (!accessToken) {
19
19
  throw new Error("accessToken is required.");
20
20
  }
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+ this.version = require("../../../package.json").version;
21
23
  const baseOptions = {
22
24
  ...(userAgent && {
23
25
  headers: {
@@ -162,4 +164,4 @@ class Client {
162
164
  return this.urlReplacementApi.updateUrlReplacement(testPlanId, urlReplacementId, updateUrlReplacementRequest, options);
163
165
  }
164
166
  }
165
- exports.Client = Client;
167
+ exports.WebClient = WebClient;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import "./debug";
2
- export { Client as WebClient, BASE_PATH as WEB_BASE_PATH, } from "./generated/web/client";
3
- export { Client as MobileClient, BASE_PATH as MOBILE_BASE_PATH, } from "./generated/mobile/client";
2
+ export { WebClient, WEB_BASE_PATH } from "./generated/web/client";
3
+ export { MobileClient, MOBILE_BASE_PATH } from "./generated/mobile/client";
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MOBILE_BASE_PATH = exports.MobileClient = exports.WEB_BASE_PATH = exports.WebClient = void 0;
4
4
  require("./debug");
5
5
  var client_1 = require("./generated/web/client");
6
- Object.defineProperty(exports, "WebClient", { enumerable: true, get: function () { return client_1.Client; } });
7
- Object.defineProperty(exports, "WEB_BASE_PATH", { enumerable: true, get: function () { return client_1.BASE_PATH; } });
6
+ Object.defineProperty(exports, "WebClient", { enumerable: true, get: function () { return client_1.WebClient; } });
7
+ Object.defineProperty(exports, "WEB_BASE_PATH", { enumerable: true, get: function () { return client_1.WEB_BASE_PATH; } });
8
8
  var client_2 = require("./generated/mobile/client");
9
- Object.defineProperty(exports, "MobileClient", { enumerable: true, get: function () { return client_2.Client; } });
10
- Object.defineProperty(exports, "MOBILE_BASE_PATH", { enumerable: true, get: function () { return client_2.BASE_PATH; } });
9
+ Object.defineProperty(exports, "MobileClient", { enumerable: true, get: function () { return client_2.MobileClient; } });
10
+ Object.defineProperty(exports, "MOBILE_BASE_PATH", { enumerable: true, get: function () { return client_2.MOBILE_BASE_PATH; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autifyhq/autify-sdk",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0",
4
4
  "description": "Autify SDK for JavaScript",
5
5
  "author": "Autify",
6
6
  "homepage": "https://github.com/autifyhq/autify-sdk-js",
@@ -25,17 +25,21 @@
25
25
  "devDependencies": {
26
26
  "@openapitools/openapi-generator-cli": "^2.5.1",
27
27
  "@types/debug": "^4.1.7",
28
- "@types/node": "^16.11.39",
28
+ "@types/jest": "^28.1.1",
29
+ "@types/node": "^18.0.0",
29
30
  "@typescript-eslint/eslint-plugin": "^5.27.1",
30
31
  "@typescript-eslint/parser": "^5.27.1",
32
+ "axios-mock-adapter": "^1.21.1",
31
33
  "eslint": "^8.17.0",
32
34
  "eslint-config-prettier": "^8.5.0",
33
35
  "eslint-plugin-unused-imports": "^2.0.0",
34
36
  "husky": "^8.0.1",
37
+ "jest": "^28.1.1",
35
38
  "lint-staged": "^13.0.1",
36
39
  "prettier": "^2.6.2",
37
40
  "shx": "^0.3.4",
38
- "ts-morph": "^14.0.0",
41
+ "ts-jest": "^28.0.5",
42
+ "ts-morph": "^15.1.0",
39
43
  "ts-node": "^10.8.1",
40
44
  "typescript": "^4.7.3"
41
45
  },
@@ -48,13 +52,16 @@
48
52
  "generate": "npm run generate:client:web && npm run generate:client:mobile && npm run lint && npm run format",
49
53
  "build": "shx rm -rf dist && tsc -b",
50
54
  "prepack": "npm run build",
51
- "lint": "eslint . --ext .ts --fix",
52
- "format": "prettier --write .",
55
+ "lint": "eslint . --ext .ts",
56
+ "format": "prettier --write '**/*.{md,json,yml,js,cjs,ts}'",
53
57
  "prepare": "husky install",
54
- "test": "true"
58
+ "test": "jest test"
55
59
  },
56
60
  "lint-staged": {
57
- "**/*": "prettier --write --ignore-unknown",
58
- "**/*.ts": "eslint --fix"
61
+ "**/*.{md,json,yml,js,cjs}": "prettier --write",
62
+ "**/*.ts": [
63
+ "eslint",
64
+ "prettier --write"
65
+ ]
59
66
  }
60
67
  }