@or-sdk/hitl 0.34.10-beta.2009.0 → 0.34.10
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/CHANGELOG.md +9 -0
- package/dist/cjs/api/Migrations.js +35 -5
- package/dist/cjs/api/Migrations.js.map +1 -1
- package/dist/cjs/types/migrations.js +3 -0
- package/dist/cjs/types/migrations.js.map +1 -1
- package/dist/esm/api/Migrations.js +28 -4
- package/dist/esm/api/Migrations.js.map +1 -1
- package/dist/esm/types/migrations.js +2 -1
- package/dist/esm/types/migrations.js.map +1 -1
- package/dist/types/api/Migrations.d.ts +5 -3
- package/dist/types/api/Migrations.d.ts.map +1 -1
- package/dist/types/types/migrations.d.ts +7 -2
- package/dist/types/types/migrations.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/api/Migrations.ts +32 -4
- package/src/types/migrations.ts +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.34.10](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.34.9...@or-sdk/hitl@0.34.10) (2023-11-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **hitl:** add tables default data endpoints - get and sync ([56244a2](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/56244a28f4b53660a4ab6343cbade1b48d9ce90d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [0.34.9](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.34.8...@or-sdk/hitl@0.34.9) (2023-10-27)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @or-sdk/hitl
|
|
@@ -117,12 +117,39 @@ var Migrations = (function (_super) {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
|
+
Migrations.getMigrationsInfo = function () {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var baseUrl, route;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
baseUrl = this.getBaseUrl({});
|
|
125
|
+
route = new urijs_1.default(baseUrl).segment(this.MIGRATIONS_INFO_URL).href();
|
|
126
|
+
return [2, this.request({
|
|
127
|
+
route: route,
|
|
128
|
+
})];
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
Migrations.getTableDefaultRecords = function (options) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var baseUrl, route, params;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
baseUrl = this.getBaseUrl({});
|
|
137
|
+
route = new urijs_1.default(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
138
|
+
params = lodash_1.default.pick(options, ['tableName']);
|
|
139
|
+
return [2, this.request({
|
|
140
|
+
route: route,
|
|
141
|
+
method: 'GET',
|
|
142
|
+
params: params,
|
|
143
|
+
})];
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
120
147
|
Migrations.createTableDefaultRecords = function () {
|
|
121
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
122
149
|
var baseUrl, route;
|
|
123
150
|
return __generator(this, function (_a) {
|
|
124
151
|
baseUrl = this.getBaseUrl({});
|
|
125
|
-
route = new urijs_1.default(baseUrl).segment(this.
|
|
152
|
+
route = new urijs_1.default(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
126
153
|
return [2, this.request({
|
|
127
154
|
route: route,
|
|
128
155
|
method: 'POST',
|
|
@@ -130,20 +157,23 @@ var Migrations = (function (_super) {
|
|
|
130
157
|
});
|
|
131
158
|
});
|
|
132
159
|
};
|
|
133
|
-
Migrations.
|
|
160
|
+
Migrations.syncTableDefaultRecords = function (options) {
|
|
134
161
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var baseUrl, route;
|
|
162
|
+
var baseUrl, route, params;
|
|
136
163
|
return __generator(this, function (_a) {
|
|
137
164
|
baseUrl = this.getBaseUrl({});
|
|
138
|
-
route = new urijs_1.default(baseUrl).segment(this.
|
|
165
|
+
route = new urijs_1.default(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
166
|
+
params = lodash_1.default.pick(options, ['tableName']);
|
|
139
167
|
return [2, this.request({
|
|
140
168
|
route: route,
|
|
169
|
+
method: 'PUT',
|
|
170
|
+
params: params,
|
|
141
171
|
})];
|
|
142
172
|
});
|
|
143
173
|
});
|
|
144
174
|
};
|
|
145
175
|
Migrations.MODULE_URL = 'migrations';
|
|
146
|
-
Migrations.
|
|
176
|
+
Migrations.DEFAULT_RECORDS_URL = 'default-records';
|
|
147
177
|
Migrations.MIGRATIONS_INFO_URL = 'info';
|
|
148
178
|
Migrations.MIGRATIONS_LOCK_URL = 'lock';
|
|
149
179
|
Migrations.MIGRATIONS_STATUS_URL = 'status';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migrations.js","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAuB;
|
|
1
|
+
{"version":3,"file":"Migrations.js","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAuB;AAcvB,uCAAsC;AACtC,gDAAwB;AAExB;IAAgC,8BAAQ;IAAxC;;IA6FA,CAAC;IAtFqB,8BAAmB,GAAvC,UACE,OAAkC;QAAlC,wBAAA,EAAA,YAAkC;;;;gBAE5B,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;g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OAAO,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;gBAE9C,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,KAAK,OAAA;wBACL,MAAM,EAAE,KAAK;wBACb,MAAM,QAAA;qBACP,CAAC,EAAC;;;KACJ;IA3FyB,qBAAU,GAAG,YAAY,CAAC;IACnC,8BAAmB,GAAG,iBAAiB,CAAC;IACxC,8BAAmB,GAAG,MAAM,CAAC;IAC7B,8BAAmB,GAAG,MAAM,CAAC;IAC7B,gCAAqB,GAAG,QAAQ,CAAC;IAwFpD,iBAAC;CAAA,AA7FD,CAAgC,mBAAQ,GA6FvC;AA7FY,gCAAU"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_DATA_TABLE_NAME = void 0;
|
|
4
|
+
var types_hitl_api_1 = require("@onereach/types-hitl-api");
|
|
5
|
+
Object.defineProperty(exports, "DEFAULT_DATA_TABLE_NAME", { enumerable: true, get: function () { return types_hitl_api_1.DEFAULT_DATA_TABLE_NAME; } });
|
|
3
6
|
//# sourceMappingURL=migrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":";;;AAAA,2DAA+E;AAgBtE,wGAhBY,wCAAuB,OAgBZ"}
|
|
@@ -51,28 +51,52 @@ export class Migrations extends HITLBase {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
static getMigrationsInfo() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const baseUrl = this.getBaseUrl({});
|
|
57
|
+
const route = new URI(baseUrl).segment(this.MIGRATIONS_INFO_URL).href();
|
|
58
|
+
return this.request({
|
|
59
|
+
route,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
static getTableDefaultRecords(options) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const baseUrl = this.getBaseUrl({});
|
|
66
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
67
|
+
const params = _.pick(options, ['tableName']);
|
|
68
|
+
return this.request({
|
|
69
|
+
route,
|
|
70
|
+
method: 'GET',
|
|
71
|
+
params,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
54
75
|
static createTableDefaultRecords() {
|
|
55
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
77
|
const baseUrl = this.getBaseUrl({});
|
|
57
|
-
const route = new URI(baseUrl).segment(this.
|
|
78
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
58
79
|
return this.request({
|
|
59
80
|
route,
|
|
60
81
|
method: 'POST',
|
|
61
82
|
});
|
|
62
83
|
});
|
|
63
84
|
}
|
|
64
|
-
static
|
|
85
|
+
static syncTableDefaultRecords(options) {
|
|
65
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
87
|
const baseUrl = this.getBaseUrl({});
|
|
67
|
-
const route = new URI(baseUrl).segment(this.
|
|
88
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
89
|
+
const params = _.pick(options, ['tableName']);
|
|
68
90
|
return this.request({
|
|
69
91
|
route,
|
|
92
|
+
method: 'PUT',
|
|
93
|
+
params,
|
|
70
94
|
});
|
|
71
95
|
});
|
|
72
96
|
}
|
|
73
97
|
}
|
|
74
98
|
Migrations.MODULE_URL = 'migrations';
|
|
75
|
-
Migrations.
|
|
99
|
+
Migrations.DEFAULT_RECORDS_URL = 'default-records';
|
|
76
100
|
Migrations.MIGRATIONS_INFO_URL = 'info';
|
|
77
101
|
Migrations.MIGRATIONS_LOCK_URL = 'lock';
|
|
78
102
|
Migrations.MIGRATIONS_STATUS_URL = 'status';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migrations.js","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Migrations.js","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAcvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,MAAM,OAAO,UAAW,SAAQ,QAAQ;IAO/B,MAAM,CAAO,mBAAmB,CACrC,UAAgC,EAAE;;YAElC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YAE/C,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;IAEM,MAAM,CAAO,gBAAgB,CAClC,UAAgC,EAAE;;YAElC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;YAEjE,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK;gBACL,MAAM,EAAE,MAAM;gBACd,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;IAEM,MAAM,CAAO,sBAAsB;;YACxC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACpC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,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,MAAM,CAAO,yBAAyB;;YAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACpC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC;YAExE,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK;gBACL,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;QACL,CAAC;KAAA;IAEM,MAAM,CAAO,uBAAuB,CAAC,OAAkC;;YAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACpC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC;YACxE,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;YAE9C,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK;gBACL,MAAM,EAAE,KAAK;gBACb,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;;AA3FyB,qBAAU,GAAG,YAAY,CAAC;AACnC,8BAAmB,GAAG,iBAAiB,CAAC;AACxC,8BAAmB,GAAG,MAAM,CAAC;AAC7B,8BAAmB,GAAG,MAAM,CAAC;AAC7B,gCAAqB,GAAG,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAgB/E,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GetMigrationsOptions, GetMigrationsResponse, RunMigrationsOptions, RunMigrationsResponse, CreateDefaultRecordsResponse, GetMigrationsInfoResponse, GetRunMigrationsStatusResponse } from '../types/migrations';
|
|
1
|
+
import { GetMigrationsOptions, GetMigrationsResponse, RunMigrationsOptions, RunMigrationsResponse, CreateDefaultRecordsResponse, GetMigrationsInfoResponse, GetRunMigrationsStatusResponse, GetDefaultRecordsOptions, GetDefaultRecordsResponse, SyncDefaultRecordsOptions, SyncDefaultRecordsResponse } from '../types/migrations';
|
|
2
2
|
import { HITLBase } from './HITLBase';
|
|
3
3
|
export declare class Migrations extends HITLBase {
|
|
4
4
|
protected static readonly MODULE_URL = "migrations";
|
|
5
|
-
protected static
|
|
5
|
+
protected static DEFAULT_RECORDS_URL: string;
|
|
6
6
|
protected static MIGRATIONS_INFO_URL: string;
|
|
7
7
|
protected static MIGRATIONS_LOCK_URL: string;
|
|
8
8
|
protected static MIGRATIONS_STATUS_URL: string;
|
|
@@ -10,7 +10,9 @@ export declare class Migrations extends HITLBase {
|
|
|
10
10
|
static runAllMigrations(options?: RunMigrationsOptions): Promise<RunMigrationsResponse>;
|
|
11
11
|
static getRunMigrationsStatus(): Promise<GetRunMigrationsStatusResponse>;
|
|
12
12
|
static deleteMigrationsTableLock(): Promise<unknown>;
|
|
13
|
-
static createTableDefaultRecords(): Promise<CreateDefaultRecordsResponse>;
|
|
14
13
|
static getMigrationsInfo(): Promise<GetMigrationsInfoResponse>;
|
|
14
|
+
static getTableDefaultRecords(options: GetDefaultRecordsOptions): Promise<GetDefaultRecordsResponse>;
|
|
15
|
+
static createTableDefaultRecords(): Promise<CreateDefaultRecordsResponse>;
|
|
16
|
+
static syncTableDefaultRecords(options: SyncDefaultRecordsOptions): Promise<SyncDefaultRecordsResponse>;
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=Migrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migrations.d.ts","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,yBAAyB,EACzB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"Migrations.d.ts","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,qBAAa,UAAW,SAAQ,QAAQ;IACtC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IACpD,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAqB;IACzD,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAU;IAC9C,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAU;IAC9C,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAY;WAE9B,mBAAmB,CACrC,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,qBAAqB,CAAC;WAUb,gBAAgB,CAClC,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,qBAAqB,CAAC;WAWb,sBAAsB,IAAI,OAAO,CAAC,8BAA8B,CAAC;WASjE,yBAAyB;WAUzB,iBAAiB,IAAI,OAAO,CAAC,yBAAyB,CAAC;WASvD,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;WAY7F,yBAAyB,IAAI,OAAO,CAAC,4BAA4B,CAAC;WAUlE,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAWrH"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Migrations } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Migrations, DEFAULT_DATA_TABLE_NAME } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions, NoAccountId } from './common';
|
|
3
3
|
export type GetMigrationsOptions = ApiVersionOptions & NoAccountId<Migrations.IGetMigrationsQuery>;
|
|
4
4
|
export type GetMigrationsResponse = Migrations.IGetMigrationsResponse;
|
|
5
5
|
export type RunMigrationsOptions = ApiVersionOptions & NoAccountId<Migrations.IRunMigrationsQuery>;
|
|
6
6
|
export type RunMigrationsResponse = Migrations.IMigrationResult;
|
|
7
7
|
export type GetRunMigrationsStatusResponse = Migrations.IGetRunMigrationsStatusResponse;
|
|
8
|
-
export type CreateDefaultRecordsResponse = Migrations.ICreateDefaultRecordsResponse;
|
|
9
8
|
export type Migration = Migrations.IMigration;
|
|
10
9
|
export type GetMigrationsInfoResponse = Migrations.IGetMigrationsInfoResponse;
|
|
10
|
+
export type GetDefaultRecordsOptions = ApiVersionOptions & Migrations.IGetDefaultRecordsQuery;
|
|
11
|
+
export type GetDefaultRecordsResponse = Migrations.IGetDefaultRecordsResponse;
|
|
12
|
+
export type CreateDefaultRecordsResponse = Migrations.ICreateDefaultRecordsResponse;
|
|
13
|
+
export type SyncDefaultRecordsOptions = ApiVersionOptions & NoAccountId<Migrations.ISyncDefaultRecordsQuery>;
|
|
14
|
+
export type SyncDefaultRecordsResponse = Migrations.ISyncDefaultRecordsResponse;
|
|
15
|
+
export { DEFAULT_DATA_TABLE_NAME };
|
|
11
16
|
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/types/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACnG,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,sBAAsB,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACnG,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAChE,MAAM,MAAM,8BAA8B,GAAG,UAAU,CAAC,+BAA+B,CAAC;AACxF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC;AAC9C,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,0BAA0B,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,GAAG,UAAU,CAAC,uBAAuB,CAAC;AAC9F,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,0BAA0B,CAAC;AAC9E,MAAM,MAAM,4BAA4B,GAAG,UAAU,CAAC,6BAA6B,CAAC;AACpF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG,WAAW,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;AAC7G,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,2BAA2B,CAAC;AAEhF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/hitl",
|
|
3
|
-
"version": "0.34.10
|
|
3
|
+
"version": "0.34.10",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dev": "pnpm build:watch:esm"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@onereach/types-hitl-api": "0.0.
|
|
20
|
+
"@onereach/types-hitl-api": "0.0.54-rc.1",
|
|
21
21
|
"@or-sdk/base": "^0.29.0",
|
|
22
22
|
"@types/lodash": "^4.14.191",
|
|
23
23
|
"@types/urijs": "^1.19.18",
|
|
@@ -29,5 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"gitHead": "8d6fadc1c3fcc77da5121c328872b5b1af268193"
|
|
33
34
|
}
|
package/src/api/Migrations.ts
CHANGED
|
@@ -7,13 +7,17 @@ import {
|
|
|
7
7
|
CreateDefaultRecordsResponse,
|
|
8
8
|
GetMigrationsInfoResponse,
|
|
9
9
|
GetRunMigrationsStatusResponse,
|
|
10
|
+
GetDefaultRecordsOptions,
|
|
11
|
+
GetDefaultRecordsResponse,
|
|
12
|
+
SyncDefaultRecordsOptions,
|
|
13
|
+
SyncDefaultRecordsResponse,
|
|
10
14
|
} from '../types/migrations';
|
|
11
15
|
import { HITLBase } from './HITLBase';
|
|
12
16
|
import URI from 'urijs';
|
|
13
17
|
|
|
14
18
|
export class Migrations extends HITLBase {
|
|
15
19
|
protected static readonly MODULE_URL = 'migrations';
|
|
16
|
-
protected static
|
|
20
|
+
protected static DEFAULT_RECORDS_URL = 'default-records';
|
|
17
21
|
protected static MIGRATIONS_INFO_URL = 'info';
|
|
18
22
|
protected static MIGRATIONS_LOCK_URL = 'lock';
|
|
19
23
|
protected static MIGRATIONS_STATUS_URL = 'status';
|
|
@@ -62,9 +66,30 @@ export class Migrations extends HITLBase {
|
|
|
62
66
|
});
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
public static async getMigrationsInfo(): Promise<GetMigrationsInfoResponse> {
|
|
70
|
+
const baseUrl = this.getBaseUrl({});
|
|
71
|
+
const route = new URI(baseUrl).segment(this.MIGRATIONS_INFO_URL).href();
|
|
72
|
+
|
|
73
|
+
return this.request({
|
|
74
|
+
route,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public static async getTableDefaultRecords(options: GetDefaultRecordsOptions): Promise<GetDefaultRecordsResponse> {
|
|
79
|
+
const baseUrl = this.getBaseUrl({});
|
|
80
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
81
|
+
const params = _.pick(options, ['tableName']);
|
|
82
|
+
|
|
83
|
+
return this.request({
|
|
84
|
+
route,
|
|
85
|
+
method: 'GET',
|
|
86
|
+
params,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
65
90
|
public static async createTableDefaultRecords(): Promise<CreateDefaultRecordsResponse> {
|
|
66
91
|
const baseUrl = this.getBaseUrl({});
|
|
67
|
-
const route = new URI(baseUrl).segment(this.
|
|
92
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
68
93
|
|
|
69
94
|
return this.request({
|
|
70
95
|
route,
|
|
@@ -72,12 +97,15 @@ export class Migrations extends HITLBase {
|
|
|
72
97
|
});
|
|
73
98
|
}
|
|
74
99
|
|
|
75
|
-
public static async
|
|
100
|
+
public static async syncTableDefaultRecords(options: SyncDefaultRecordsOptions): Promise<SyncDefaultRecordsResponse> {
|
|
76
101
|
const baseUrl = this.getBaseUrl({});
|
|
77
|
-
const route = new URI(baseUrl).segment(this.
|
|
102
|
+
const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
|
|
103
|
+
const params = _.pick(options, ['tableName']);
|
|
78
104
|
|
|
79
105
|
return this.request({
|
|
80
106
|
route,
|
|
107
|
+
method: 'PUT',
|
|
108
|
+
params,
|
|
81
109
|
});
|
|
82
110
|
}
|
|
83
111
|
}
|
package/src/types/migrations.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Migrations } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Migrations, DEFAULT_DATA_TABLE_NAME } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions, NoAccountId } from './common';
|
|
3
3
|
|
|
4
4
|
export type GetMigrationsOptions = ApiVersionOptions & NoAccountId<Migrations.IGetMigrationsQuery>;
|
|
@@ -6,7 +6,12 @@ export type GetMigrationsResponse = Migrations.IGetMigrationsResponse;
|
|
|
6
6
|
export type RunMigrationsOptions = ApiVersionOptions & NoAccountId<Migrations.IRunMigrationsQuery>;
|
|
7
7
|
export type RunMigrationsResponse = Migrations.IMigrationResult;
|
|
8
8
|
export type GetRunMigrationsStatusResponse = Migrations.IGetRunMigrationsStatusResponse;
|
|
9
|
-
export type CreateDefaultRecordsResponse = Migrations.ICreateDefaultRecordsResponse;
|
|
10
9
|
export type Migration = Migrations.IMigration;
|
|
11
10
|
export type GetMigrationsInfoResponse = Migrations.IGetMigrationsInfoResponse;
|
|
11
|
+
export type GetDefaultRecordsOptions = ApiVersionOptions & Migrations.IGetDefaultRecordsQuery;
|
|
12
|
+
export type GetDefaultRecordsResponse = Migrations.IGetDefaultRecordsResponse;
|
|
13
|
+
export type CreateDefaultRecordsResponse = Migrations.ICreateDefaultRecordsResponse;
|
|
14
|
+
export type SyncDefaultRecordsOptions = ApiVersionOptions & NoAccountId<Migrations.ISyncDefaultRecordsQuery>;
|
|
15
|
+
export type SyncDefaultRecordsResponse = Migrations.ISyncDefaultRecordsResponse;
|
|
12
16
|
|
|
17
|
+
export { DEFAULT_DATA_TABLE_NAME };
|