drapcode-developer-sdk 1.0.12 → 1.0.13

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/build/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export declare class DrapcodeApis {
26
26
  private version?;
27
27
  private protocol;
28
28
  constructor(projectSeoName: string, opts?: DrapcodeApiOptions);
29
+ constructor(project_seo_name: string, xApiKey: string, authorization: string, environment: Environment | string);
29
30
  setProjectSeoName(seo_name: string): void;
30
31
  getProjectSeoName(): string;
31
32
  setXApiKey(apiKey: string): void;
package/build/index.js CHANGED
@@ -69,9 +69,7 @@ var Environment;
69
69
  Environment["ALPHA"] = "ALPHA";
70
70
  })(Environment = exports.Environment || (exports.Environment = {}));
71
71
  var DrapcodeApis = /** @class */ (function () {
72
- // private protocol: string = "http";
73
- function DrapcodeApis(projectSeoName, opts) {
74
- if (opts === void 0) { opts = {}; }
72
+ function DrapcodeApis(projectSeoName, opts, authorization, environment) {
75
73
  var _a;
76
74
  //Network/URL Related
77
75
  this.API_PATH = "drapcode.io/api";
@@ -80,14 +78,22 @@ var DrapcodeApis = /** @class */ (function () {
80
78
  this.version = 1;
81
79
  this.protocol = "https";
82
80
  this.seoName = projectSeoName;
83
- this.xApiKey = opts.xApiKey;
84
- this.xTenantId = opts.xTenantId;
85
- this.xSubTenantId = opts.xSubTenantId;
86
- this.authorization = opts.authorization;
87
- this.environment =
88
- (_a = opts.environment) !== null && _a !== void 0 ? _a : Environment.PRODUCTION;
89
- this.builderKey = opts.builderKey;
90
- this.version = opts.version;
81
+ if (typeof opts === "object" && opts != null) {
82
+ this.xApiKey = opts.xApiKey;
83
+ this.xTenantId = opts.xTenantId;
84
+ this.xSubTenantId = opts.xSubTenantId;
85
+ this.authorization = opts.authorization;
86
+ this.environment =
87
+ (_a = opts.environment) !== null && _a !== void 0 ? _a : Environment.PRODUCTION;
88
+ this.builderKey = opts.builderKey;
89
+ this.version = opts.version;
90
+ }
91
+ else {
92
+ this.xApiKey = opts;
93
+ this.authorization = authorization;
94
+ this.environment = environment !== null && environment !== void 0 ? environment : Environment.PRODUCTION;
95
+ this.version = 1;
96
+ }
91
97
  }
92
98
  DrapcodeApis.prototype.setProjectSeoName = function (seo_name) {
93
99
  this.seoName = seo_name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drapcode-developer-sdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "files": [