@or-sdk/idw 2.0.4 → 2.0.5-beta.1634.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,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SkillApi = void 0;
3
+ 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
+ var migrationApi_1 = require("./migrationApi");
7
+ Object.defineProperty(exports, "MigrationApi", { enumerable: true, get: function () { return migrationApi_1.MigrationApi; } });
6
8
  //# 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"}
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"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrationApi = void 0;
4
+ var MigrationApi = (function () {
5
+ function MigrationApi(providers) {
6
+ this.providers = providers;
7
+ }
8
+ MigrationApi.prototype.migrationsStatus = function () {
9
+ return this.providers.makeRequest({
10
+ route: 'migration',
11
+ method: 'GET',
12
+ });
13
+ };
14
+ MigrationApi.prototype.migrationsRun = function () {
15
+ return this.providers.makeRequest({
16
+ route: 'migration',
17
+ method: 'POST',
18
+ });
19
+ };
20
+ MigrationApi.prototype.revertLatest = function () {
21
+ return this.providers.makeRequest({
22
+ route: 'migration',
23
+ method: 'DELETE',
24
+ });
25
+ };
26
+ return MigrationApi;
27
+ }());
28
+ exports.MigrationApi = MigrationApi;
29
+ //# sourceMappingURL=migrationApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrationApi.js","sourceRoot":"","sources":["../../../src/api/migrationApi.ts"],"names":[],"mappings":";;;AAEA;IACE,sBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,uCAAgB,GAAhB;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,oCAAa,GAAb;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAKD,mCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;IACH,mBAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,oCAAY"}
@@ -12,6 +12,7 @@ var IdwApi = (function () {
12
12
  providersAccountId: providerAccountId,
13
13
  });
14
14
  this.skillApi = new api_1.SkillApi(provider);
15
+ this.migrationApi = new api_1.MigrationApi(provider);
15
16
  }
16
17
  return IdwApi;
17
18
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":";;;AACA,6BAAiC;AACjC,+CAA8C;AAE9C;IAEE,gBAAY,EAAkD;YAAhD,iBAAiB,uBAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;QAC3C,IAAM,QAAQ,GAAG,IAAI,qBAAS,CAAC;YAC7B,KAAK,OAAA;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IACH,aAAC;AAAD,CAAC,AAXD,IAWC;AAXY,wBAAM"}
1
+ {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":";;;AACA,6BAA+C;AAC/C,+CAA8C;AAE9C;IAGE,gBAAY,EAAkD;YAAhD,iBAAiB,uBAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;QAC3C,IAAM,QAAQ,GAAG,IAAI,qBAAS,CAAC;YAC7B,KAAK,OAAA;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,kBAAY,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IACH,aAAC;AAAD,CAAC,AAbD,IAaC;AAbY,wBAAM"}
@@ -1,2 +1,3 @@
1
1
  export { SkillApi } from './skillApi';
2
+ export { MigrationApi } from './migrationApi';
2
3
  //# 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"}
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"}
@@ -0,0 +1,24 @@
1
+ export class MigrationApi {
2
+ constructor(providers) {
3
+ this.providers = providers;
4
+ }
5
+ migrationsStatus() {
6
+ return this.providers.makeRequest({
7
+ route: 'migration',
8
+ method: 'GET',
9
+ });
10
+ }
11
+ migrationsRun() {
12
+ return this.providers.makeRequest({
13
+ route: 'migration',
14
+ method: 'POST',
15
+ });
16
+ }
17
+ revertLatest() {
18
+ return this.providers.makeRequest({
19
+ route: 'migration',
20
+ method: 'DELETE',
21
+ });
22
+ }
23
+ }
24
+ //# sourceMappingURL=migrationApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrationApi.js","sourceRoot":"","sources":["../../../src/api/migrationApi.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,YAAY;IACvB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,gBAAgB;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,aAAa;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAKD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import { SkillApi } from './api';
1
+ import { MigrationApi, SkillApi } from './api';
2
2
  import { Providers } from '@or-sdk/providers';
3
3
  export class IdwApi {
4
4
  constructor({ providerAccountId, emUrl, token }) {
@@ -8,6 +8,7 @@ export class IdwApi {
8
8
  providersAccountId: providerAccountId,
9
9
  });
10
10
  this.skillApi = new SkillApi(provider);
11
+ this.migrationApi = new MigrationApi(provider);
11
12
  }
12
13
  }
13
14
  //# sourceMappingURL=idwApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAEjB,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;IACzC,CAAC;CACF"}
1
+ {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAGjB,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;IACjD,CAAC;CACF"}
@@ -1,2 +1,3 @@
1
1
  export { SkillApi } from './skillApi';
2
+ export { MigrationApi } from './migrationApi';
2
3
  //# 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"}
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"}
@@ -0,0 +1,9 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ export declare class MigrationApi {
3
+ private readonly providers;
4
+ constructor(providers: Providers);
5
+ migrationsStatus(): Promise<boolean>;
6
+ migrationsRun(): Promise<void>;
7
+ revertLatest(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=migrationApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrationApi.d.ts","sourceRoot":"","sources":["../../../src/api/migrationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAOvC,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAUpC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAM9B"}
@@ -1,7 +1,8 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { SkillApi } from './api';
2
+ import { MigrationApi, SkillApi } from './api';
3
3
  export declare class IdwApi {
4
4
  readonly skillApi: SkillApi;
5
+ readonly migrationApi: MigrationApi;
5
6
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig);
6
7
  }
7
8
  //# 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,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAChB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAS/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,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG/C,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBACxB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAU/D"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.4",
2
+ "version": "2.0.5-beta.1634.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": "5b4e47a5df11b0e13c5c775b8ae773a6ed2b5ed0"
36
+ }
38
37
  }
package/src/api/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { SkillApi } from './skillApi';
2
+ export { MigrationApi } from './migrationApi';
@@ -0,0 +1,38 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+
3
+ export class MigrationApi {
4
+ constructor(
5
+ private readonly providers: Providers
6
+ ) {}
7
+
8
+ /**
9
+ * Check if there are any pending migrations.
10
+ * @return true if there are pending migrations
11
+ */
12
+ migrationsStatus(): Promise<boolean> {
13
+ return this.providers.makeRequest({
14
+ route: 'migration',
15
+ method: 'GET',
16
+ });
17
+ }
18
+
19
+ /**
20
+ * Run pending migrations
21
+ */
22
+ migrationsRun(): Promise<void> {
23
+ return this.providers.makeRequest({
24
+ route: 'migration',
25
+ method: 'POST',
26
+ });
27
+ }
28
+
29
+ /**
30
+ * Revert latest migrations
31
+ */
32
+ revertLatest(): Promise<void> {
33
+ return this.providers.makeRequest({
34
+ route: 'migration',
35
+ method: 'DELETE',
36
+ });
37
+ }
38
+ }
package/src/idwApi.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { SkillApi } from './api';
2
+ import { 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
+ readonly migrationApi: MigrationApi;
7
8
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig) {
8
9
  const provider = new Providers({
9
10
  token,
@@ -12,5 +13,6 @@ export class IdwApi {
12
13
  });
13
14
 
14
15
  this.skillApi = new SkillApi(provider);
16
+ this.migrationApi = new MigrationApi(provider);
15
17
  }
16
18
  }