@or-sdk/idw 2.0.8 → 2.0.9-beta.1656.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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdwDbApi = void 0;
4
+ var helpres_1 = require("../helpres");
5
+ var IdwDbApi = (function () {
6
+ function IdwDbApi(providers) {
7
+ this.providers = providers;
8
+ }
9
+ IdwDbApi.prototype.isDbExist = function () {
10
+ return this.providers.makeRequest({
11
+ route: (0, helpres_1.buildRoute)('db'),
12
+ method: 'GET',
13
+ });
14
+ };
15
+ IdwDbApi.prototype.prepareDb = function () {
16
+ return this.providers.makeRequest({
17
+ route: (0, helpres_1.buildRoute)('db'),
18
+ method: 'POST',
19
+ });
20
+ };
21
+ return IdwDbApi;
22
+ }());
23
+ exports.IdwDbApi = IdwDbApi;
24
+ //# sourceMappingURL=idwDbApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwDbApi.js","sourceRoot":"","sources":["../../../src/api/idwDbApi.ts"],"names":[],"mappings":";;;AACA,sCAAwC;AAExC;IACE,kBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAKJ,4BAAS,GAAT;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,IAAI,CAAC;YACvB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,4BAAS,GAAT;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,IAAI,CAAC;YACvB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IACH,eAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,4BAAQ"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdwInfoApi = exports.MigrationApi = exports.SkillApi = void 0;
3
+ exports.IdwDbApi = exports.IdwInfoApi = exports.MigrationApi = exports.SkillApi = void 0;
4
4
  var skillApi_1 = require("./skillApi");
5
5
  Object.defineProperty(exports, "SkillApi", { enumerable: true, get: function () { return skillApi_1.SkillApi; } });
6
6
  var migrationApi_1 = require("./migrationApi");
7
7
  Object.defineProperty(exports, "MigrationApi", { enumerable: true, get: function () { return migrationApi_1.MigrationApi; } });
8
8
  var idwInfoApi_1 = require("./idwInfoApi");
9
9
  Object.defineProperty(exports, "IdwInfoApi", { enumerable: true, get: function () { return idwInfoApi_1.IdwInfoApi; } });
10
+ var idwDbApi_1 = require("./idwDbApi");
11
+ Object.defineProperty(exports, "IdwDbApi", { enumerable: true, get: function () { return idwDbApi_1.IdwDbApi; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
@@ -14,6 +14,7 @@ var IdwApi = (function () {
14
14
  this.skillApi = new api_1.SkillApi(provider);
15
15
  this.migrationApi = new api_1.MigrationApi(provider);
16
16
  this.idwInfoApi = new api_1.IdwInfoApi(provider);
17
+ this.idwDbApi = new api_1.IdwDbApi(provider);
17
18
  }
18
19
  return IdwApi;
19
20
  }());
@@ -1 +1 @@
1
- {"version":3,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AAjBY,wBAAM"}
@@ -0,0 +1,19 @@
1
+ import { buildRoute } from '../helpres';
2
+ export class IdwDbApi {
3
+ constructor(providers) {
4
+ this.providers = providers;
5
+ }
6
+ isDbExist() {
7
+ return this.providers.makeRequest({
8
+ route: buildRoute('db'),
9
+ method: 'GET',
10
+ });
11
+ }
12
+ prepareDb() {
13
+ return this.providers.makeRequest({
14
+ route: buildRoute('db'),
15
+ method: 'POST',
16
+ });
17
+ }
18
+ }
19
+ //# sourceMappingURL=idwDbApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwDbApi.js","sourceRoot":"","sources":["../../../src/api/idwDbApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,OAAO,QAAQ;IACnB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAKJ,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC;YACvB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC;YACvB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
+ export { IdwDbApi } from './idwDbApi';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import { IdwInfoApi, MigrationApi, SkillApi } from './api';
1
+ import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
2
2
  import { Providers } from '@or-sdk/providers';
3
3
  export class IdwApi {
4
4
  constructor({ providerAccountId, emUrl, token }) {
@@ -10,6 +10,7 @@ export class IdwApi {
10
10
  this.skillApi = new SkillApi(provider);
11
11
  this.migrationApi = new MigrationApi(provider);
12
12
  this.idwInfoApi = new IdwInfoApi(provider);
13
+ this.idwDbApi = new IdwDbApi(provider);
13
14
  }
14
15
  }
15
16
  //# sourceMappingURL=idwApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAIjB,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAiB;QAC5D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC;YAC7B,KAAK;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF"}
1
+ {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAKjB,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAiB;QAC5D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC;YAC7B,KAAK;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ export declare class IdwDbApi {
3
+ private readonly providers;
4
+ constructor(providers: Providers);
5
+ isDbExist(): Promise<boolean>;
6
+ prepareDb(): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=idwDbApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwDbApi.d.ts","sourceRoot":"","sources":["../../../src/api/idwDbApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,qBAAa,QAAQ;IAEjB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAMvC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAU7B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAM3B"}
@@ -1,4 +1,5 @@
1
1
  export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
+ export { IdwDbApi } from './idwDbApi';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { IdwInfoApi, MigrationApi, SkillApi } from './api';
2
+ import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
3
3
  export declare class IdwApi {
4
4
  readonly skillApi: SkillApi;
5
5
  readonly migrationApi: MigrationApi;
6
6
  readonly idwInfoApi: IdwInfoApi;
7
+ readonly idwDbApi: IdwDbApi;
7
8
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig);
8
9
  }
9
10
  //# sourceMappingURL=idwApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.d.ts","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG3D,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;gBACpB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAW/D"}
1
+ {"version":3,"file":"idwApi.d.ts","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrE,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAChB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAY/D"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.8",
2
+ "version": "2.0.9-beta.1656.0",
3
3
  "name": "@or-sdk/idw",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -33,6 +33,5 @@
33
33
  "@or-sdk/settings": "^0.24.11",
34
34
  "@or-sdk/users": "^0.30.2",
35
35
  "axios": "^0.24.0"
36
- },
37
- "gitHead": "59ff58c5dfaa44614ed310fef162728a6a6f30a5"
36
+ }
38
37
  }
@@ -0,0 +1,28 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ import { buildRoute } from '../helpres';
3
+
4
+ export class IdwDbApi {
5
+ constructor(
6
+ private readonly providers: Providers
7
+ ) {}
8
+
9
+ /**
10
+ * Check if db exist
11
+ */
12
+ isDbExist(): Promise<boolean> {
13
+ return this.providers.makeRequest({
14
+ route: buildRoute('db'),
15
+ method: 'GET',
16
+ });
17
+ }
18
+
19
+ /**
20
+ * Check if db exist. If not, create db and run all pending migrations
21
+ */
22
+ prepareDb(): Promise<void> {
23
+ return this.providers.makeRequest({
24
+ route: buildRoute('db'),
25
+ method: 'POST',
26
+ });
27
+ }
28
+ }
package/src/api/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
+ export { IdwDbApi } from './idwDbApi';
package/src/idwApi.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { IdwInfoApi, MigrationApi, SkillApi } from './api';
2
+ import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
3
3
  import { Providers } from '@or-sdk/providers';
4
4
 
5
5
  export class IdwApi {
6
6
  readonly skillApi: SkillApi;
7
7
  readonly migrationApi: MigrationApi;
8
8
  readonly idwInfoApi: IdwInfoApi;
9
+ readonly idwDbApi: IdwDbApi;
9
10
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig) {
10
11
  const provider = new Providers({
11
12
  token,
@@ -16,5 +17,6 @@ export class IdwApi {
16
17
  this.skillApi = new SkillApi(provider);
17
18
  this.migrationApi = new MigrationApi(provider);
18
19
  this.idwInfoApi = new IdwInfoApi(provider);
20
+ this.idwDbApi = new IdwDbApi(provider);
19
21
  }
20
22
  }