@or-sdk/contacts 3.0.2 → 3.0.3-beta.1123.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.
- package/dist/cjs/api/fieldSchemaApi.js +29 -7
- package/dist/cjs/api/fieldSchemaApi.js.map +1 -1
- package/dist/esm/api/fieldSchemaApi.js +30 -6
- package/dist/esm/api/fieldSchemaApi.js.map +1 -1
- package/dist/types/api/fieldSchemaApi.d.ts +3 -0
- package/dist/types/api/fieldSchemaApi.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/api/fieldSchemaApi.ts +37 -6
|
@@ -31,34 +31,56 @@ var utils_1 = require("../utils");
|
|
|
31
31
|
var FieldSchemaApi = (function (_super) {
|
|
32
32
|
__extends(FieldSchemaApi, _super);
|
|
33
33
|
function FieldSchemaApi() {
|
|
34
|
-
|
|
34
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
_this.apiBasePath = 'field-schema';
|
|
36
|
+
return _this;
|
|
35
37
|
}
|
|
36
38
|
FieldSchemaApi.prototype.getSchema = function (id) {
|
|
37
39
|
return this.apiCall({
|
|
38
40
|
method: 'GET',
|
|
39
|
-
route: "
|
|
41
|
+
route: "".concat(this.apiBasePath, "/").concat(id),
|
|
40
42
|
});
|
|
41
43
|
};
|
|
42
44
|
FieldSchemaApi.prototype.listSchemas = function (params) {
|
|
43
45
|
return this.apiCall({
|
|
44
46
|
method: 'GET',
|
|
45
|
-
route:
|
|
47
|
+
route: "".concat(this.apiBasePath),
|
|
46
48
|
params: __assign({}, (0, utils_1.adaptListParams)(params)),
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
51
|
FieldSchemaApi.prototype.isMachineNameExist = function (machineName) {
|
|
50
52
|
return this.apiCall({
|
|
51
53
|
method: 'GET',
|
|
52
|
-
route:
|
|
54
|
+
route: "".concat(this.apiBasePath, "/machine-name-exist"),
|
|
53
55
|
params: {
|
|
54
56
|
machine_name: machineName,
|
|
55
57
|
},
|
|
56
58
|
});
|
|
57
59
|
};
|
|
60
|
+
FieldSchemaApi.prototype.lockFields = function (fields) {
|
|
61
|
+
return this.apiCall({
|
|
62
|
+
method: 'PATCH',
|
|
63
|
+
route: "".concat(this.apiBasePath, "/readonly"),
|
|
64
|
+
data: {
|
|
65
|
+
readonly: true,
|
|
66
|
+
fields: fields,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
FieldSchemaApi.prototype.unlockFields = function (fields) {
|
|
71
|
+
return this.apiCall({
|
|
72
|
+
method: 'PATCH',
|
|
73
|
+
route: "".concat(this.apiBasePath, "/readonly"),
|
|
74
|
+
data: {
|
|
75
|
+
readonly: false,
|
|
76
|
+
fields: fields,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
};
|
|
58
80
|
FieldSchemaApi.prototype.updateSchema = function (id, data) {
|
|
59
81
|
return this.apiCall({
|
|
60
82
|
method: 'PATCH',
|
|
61
|
-
route: "
|
|
83
|
+
route: "".concat(this.apiBasePath, "/").concat(id),
|
|
62
84
|
data: data,
|
|
63
85
|
});
|
|
64
86
|
};
|
|
@@ -66,14 +88,14 @@ var FieldSchemaApi = (function (_super) {
|
|
|
66
88
|
if (data === void 0) { data = {}; }
|
|
67
89
|
return this.apiCall({
|
|
68
90
|
method: 'DELETE',
|
|
69
|
-
route: "
|
|
91
|
+
route: "".concat(this.apiBasePath, "/").concat(id),
|
|
70
92
|
data: data,
|
|
71
93
|
});
|
|
72
94
|
};
|
|
73
95
|
FieldSchemaApi.prototype.createSchema = function (data) {
|
|
74
96
|
return this.apiCall({
|
|
75
97
|
method: 'POST',
|
|
76
|
-
route:
|
|
98
|
+
route: "".concat(this.apiBasePath),
|
|
77
99
|
data: data,
|
|
78
100
|
});
|
|
79
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldSchemaApi.js","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAUpC,kCAA2C;AAE3C;IAA4C,kCAAO;IAAnD;;
|
|
1
|
+
{"version":3,"file":"fieldSchemaApi.js","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAUpC,kCAA2C;AAE3C;IAA4C,kCAAO;IAAnD;QAAA,qEA0GC;QAzGkB,iBAAW,GAAG,cAAc,CAAC;;IAyGhD,CAAC;IApGC,kCAAS,GAAT,UAAU,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,EAAE,CAAE;SACnC,CAAC,CAAC;IACL,CAAC;IAKD,oCAAW,GAAX,UAAY,MAAmD;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;YAC5B,MAAM,eACD,IAAA,uBAAe,EAAC,MAAM,CAAC,CAC3B;SACF,CAAC,CAAC;IACL,CAAC;IAKD,2CAAkB,GAAlB,UAAmB,WAAmB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,wBAAqB;YAC/C,MAAM,EAAE;gBACN,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAMD,mCAAU,GAAV,UAAW,MAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAW;YACrC,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI;gBACd,MAAM,QAAA;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAMD,qCAAY,GAAZ,UAAa,MAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAW;YACrC,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;gBACf,MAAM,QAAA;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAOD,qCAAY,GAAZ,UAAa,EAAU,EAAE,IAA0B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,EAAE,CAAE;YAClC,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAOD,qCAAY,GAAZ,UAAa,EAAU,EAAE,IAAqC;QAArC,qBAAA,EAAA,SAAqC;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,EAAE,CAAE;YAClC,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAMD,qCAAY,GAAZ,UAAa,IAA0B;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;YAC5B,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AA1GD,CAA4C,iBAAO,GA0GlD"}
|
|
@@ -1,46 +1,70 @@
|
|
|
1
1
|
import { BaseApi } from './baseApi';
|
|
2
2
|
import { adaptListParams } from '../utils';
|
|
3
3
|
export default class FieldSchemaApi extends BaseApi {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.apiBasePath = 'field-schema';
|
|
7
|
+
}
|
|
4
8
|
getSchema(id) {
|
|
5
9
|
return this.apiCall({
|
|
6
10
|
method: 'GET',
|
|
7
|
-
route:
|
|
11
|
+
route: `${this.apiBasePath}/${id}`,
|
|
8
12
|
});
|
|
9
13
|
}
|
|
10
14
|
listSchemas(params) {
|
|
11
15
|
return this.apiCall({
|
|
12
16
|
method: 'GET',
|
|
13
|
-
route:
|
|
17
|
+
route: `${this.apiBasePath}`,
|
|
14
18
|
params: Object.assign({}, adaptListParams(params)),
|
|
15
19
|
});
|
|
16
20
|
}
|
|
17
21
|
isMachineNameExist(machineName) {
|
|
18
22
|
return this.apiCall({
|
|
19
23
|
method: 'GET',
|
|
20
|
-
route:
|
|
24
|
+
route: `${this.apiBasePath}/machine-name-exist`,
|
|
21
25
|
params: {
|
|
22
26
|
machine_name: machineName,
|
|
23
27
|
},
|
|
24
28
|
});
|
|
25
29
|
}
|
|
30
|
+
lockFields(fields) {
|
|
31
|
+
return this.apiCall({
|
|
32
|
+
method: 'PATCH',
|
|
33
|
+
route: `${this.apiBasePath}/readonly`,
|
|
34
|
+
data: {
|
|
35
|
+
readonly: true,
|
|
36
|
+
fields,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
unlockFields(fields) {
|
|
41
|
+
return this.apiCall({
|
|
42
|
+
method: 'PATCH',
|
|
43
|
+
route: `${this.apiBasePath}/readonly`,
|
|
44
|
+
data: {
|
|
45
|
+
readonly: false,
|
|
46
|
+
fields,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
26
50
|
updateSchema(id, data) {
|
|
27
51
|
return this.apiCall({
|
|
28
52
|
method: 'PATCH',
|
|
29
|
-
route:
|
|
53
|
+
route: `${this.apiBasePath}/${id}`,
|
|
30
54
|
data,
|
|
31
55
|
});
|
|
32
56
|
}
|
|
33
57
|
deleteSchema(id, data = {}) {
|
|
34
58
|
return this.apiCall({
|
|
35
59
|
method: 'DELETE',
|
|
36
|
-
route:
|
|
60
|
+
route: `${this.apiBasePath}/${id}`,
|
|
37
61
|
data,
|
|
38
62
|
});
|
|
39
63
|
}
|
|
40
64
|
createSchema(data) {
|
|
41
65
|
return this.apiCall({
|
|
42
66
|
method: 'POST',
|
|
43
|
-
route:
|
|
67
|
+
route: `${this.apiBasePath}`,
|
|
44
68
|
data,
|
|
45
69
|
});
|
|
46
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldSchemaApi.js","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;
|
|
1
|
+
{"version":3,"file":"fieldSchemaApi.js","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IAAnD;;QACmB,gBAAW,GAAG,cAAc,CAAC;IAyGhD,CAAC;IApGC,SAAS,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;IAKD,WAAW,CAAC,MAAmD;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;YAC5B,MAAM,oBACD,eAAe,CAAC,MAAM,CAAC,CAC3B;SACF,CAAC,CAAC;IACL,CAAC;IAKD,kBAAkB,CAAC,WAAmB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,qBAAqB;YAC/C,MAAM,EAAE;gBACN,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAMD,UAAU,CAAC,MAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,WAAW;YACrC,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI;gBACd,MAAM;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAMD,YAAY,CAAC,MAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,WAAW;YACrC,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;gBACf,MAAM;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAOD,YAAY,CAAC,EAAU,EAAE,IAA0B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE;YAClC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAOD,YAAY,CAAC,EAAU,EAAE,OAAmC,EAAE;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE;YAClC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAMD,YAAY,CAAC,IAA0B;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;YAC5B,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -3,9 +3,12 @@ import { FieldSchemaResponseDto, UpdateFieldSchemaDto, CreateFieldSchemaDto, Fie
|
|
|
3
3
|
import { List } from '@or-sdk/base';
|
|
4
4
|
import { AdaptedListParams } from '../types';
|
|
5
5
|
export default class FieldSchemaApi extends BaseApi {
|
|
6
|
+
private readonly apiBasePath;
|
|
6
7
|
getSchema(id: string): Promise<FieldSchemaResponseDto>;
|
|
7
8
|
listSchemas(params: AdaptedListParams<FieldSchemaListParamsDto>): Promise<List<FieldSchemaResponseDto>>;
|
|
8
9
|
isMachineNameExist(machineName: string): Promise<boolean>;
|
|
10
|
+
lockFields(fields: string[]): Promise<void>;
|
|
11
|
+
unlockFields(fields: string[]): Promise<void>;
|
|
9
12
|
updateSchema(id: string, data: UpdateFieldSchemaDto): Promise<FieldSchemaResponseDto>;
|
|
10
13
|
deleteSchema(id: string, data?: FieldSchemaDeleteParamsDto): Promise<void>;
|
|
11
14
|
createSchema(data: CreateFieldSchemaDto): Promise<FieldSchemaResponseDto>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldSchemaApi.d.ts","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;
|
|
1
|
+
{"version":3,"file":"fieldSchemaApi.d.ts","sourceRoot":"","sources":["../../../src/api/fieldSchemaApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;IAK9C,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAUtD,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAavG,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAczD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAe3C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB7C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAarF,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,0BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9E,YAAY,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAO1E"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.0.
|
|
2
|
+
"version": "3.0.3-beta.1123.0",
|
|
3
3
|
"name": "@or-sdk/contacts",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onereach/types-contacts-api": "2.2.8-beta.
|
|
27
|
+
"@onereach/types-contacts-api": "2.2.8-beta.1654.0",
|
|
28
28
|
"@or-sdk/base": "^0.28.1"
|
|
29
|
-
}
|
|
30
|
-
"gitHead": "6a4bbc24ba2355a8944c159e89c57b483fa4be37"
|
|
29
|
+
}
|
|
31
30
|
}
|
|
@@ -11,6 +11,7 @@ import { AdaptedListParams } from '../types';
|
|
|
11
11
|
import { adaptListParams } from '../utils';
|
|
12
12
|
|
|
13
13
|
export default class FieldSchemaApi extends BaseApi {
|
|
14
|
+
private readonly apiBasePath = 'field-schema';
|
|
14
15
|
/**
|
|
15
16
|
* @description Get specific field schema
|
|
16
17
|
* @param id
|
|
@@ -18,7 +19,7 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
18
19
|
getSchema(id: string): Promise<FieldSchemaResponseDto> {
|
|
19
20
|
return this.apiCall({
|
|
20
21
|
method: 'GET',
|
|
21
|
-
route:
|
|
22
|
+
route: `${this.apiBasePath}/${id}`,
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -28,7 +29,7 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
28
29
|
listSchemas(params: AdaptedListParams<FieldSchemaListParamsDto>): Promise<List<FieldSchemaResponseDto>> {
|
|
29
30
|
return this.apiCall({
|
|
30
31
|
method: 'GET',
|
|
31
|
-
route:
|
|
32
|
+
route: `${this.apiBasePath}`,
|
|
32
33
|
params: {
|
|
33
34
|
...adaptListParams(params),
|
|
34
35
|
},
|
|
@@ -41,13 +42,43 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
41
42
|
isMachineNameExist(machineName: string): Promise<boolean> {
|
|
42
43
|
return this.apiCall({
|
|
43
44
|
method: 'GET',
|
|
44
|
-
route:
|
|
45
|
+
route: `${this.apiBasePath}/machine-name-exist`,
|
|
45
46
|
params: {
|
|
46
47
|
machine_name: machineName,
|
|
47
48
|
},
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Lock "fieldSchema" from being updated
|
|
54
|
+
* @param fields
|
|
55
|
+
*/
|
|
56
|
+
lockFields(fields: string[]): Promise<void> {
|
|
57
|
+
return this.apiCall({
|
|
58
|
+
method: 'PATCH',
|
|
59
|
+
route: `${this.apiBasePath}/readonly`,
|
|
60
|
+
data: {
|
|
61
|
+
readonly: true,
|
|
62
|
+
fields,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Unlock "fieldSchema" to be able to update
|
|
69
|
+
* @param fields
|
|
70
|
+
*/
|
|
71
|
+
unlockFields(fields: string[]): Promise<void> {
|
|
72
|
+
return this.apiCall({
|
|
73
|
+
method: 'PATCH',
|
|
74
|
+
route: `${this.apiBasePath}/readonly`,
|
|
75
|
+
data: {
|
|
76
|
+
readonly: false,
|
|
77
|
+
fields,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
51
82
|
/**
|
|
52
83
|
* @description Update field schema
|
|
53
84
|
* @param data
|
|
@@ -56,7 +87,7 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
56
87
|
updateSchema(id: string, data: UpdateFieldSchemaDto): Promise<FieldSchemaResponseDto> {
|
|
57
88
|
return this.apiCall({
|
|
58
89
|
method: 'PATCH',
|
|
59
|
-
route:
|
|
90
|
+
route: `${this.apiBasePath}/${id}`,
|
|
60
91
|
data,
|
|
61
92
|
});
|
|
62
93
|
}
|
|
@@ -69,7 +100,7 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
69
100
|
deleteSchema(id: string, data: FieldSchemaDeleteParamsDto = {}): Promise<void> {
|
|
70
101
|
return this.apiCall({
|
|
71
102
|
method: 'DELETE',
|
|
72
|
-
route:
|
|
103
|
+
route: `${this.apiBasePath}/${id}`,
|
|
73
104
|
data,
|
|
74
105
|
});
|
|
75
106
|
}
|
|
@@ -81,7 +112,7 @@ export default class FieldSchemaApi extends BaseApi {
|
|
|
81
112
|
createSchema(data: CreateFieldSchemaDto): Promise<FieldSchemaResponseDto> {
|
|
82
113
|
return this.apiCall({
|
|
83
114
|
method: 'POST',
|
|
84
|
-
route:
|
|
115
|
+
route: `${this.apiBasePath}`,
|
|
85
116
|
data,
|
|
86
117
|
});
|
|
87
118
|
}
|