@cuby-ui/api 0.0.348 → 0.0.349
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/esm2022/shared/services/frame-api.service.mjs +15 -17
- package/esm2022/shared/services/node-checklist-api.service.mjs +19 -21
- package/esm2022/shared/services/tree-struct-api.service.mjs +9 -11
- package/esm2022/shared/services/tree-struct-navigator-api.service.mjs +19 -21
- package/esm2022/tokens/api-url-context.mjs +1 -1
- package/fesm2022/cuby-ui-api.mjs +59 -83
- package/fesm2022/cuby-ui-api.mjs.map +1 -1
- package/package.json +1 -1
- package/shared/services/frame-api.service.d.ts +8 -8
- package/shared/services/node-checklist-api.service.d.ts +10 -10
- package/shared/services/tree-struct-api.service.d.ts +5 -5
- package/shared/services/tree-struct-navigator-api.service.d.ts +10 -10
- package/tokens/api-url-context.d.ts +6 -2
- package/esm2022/shared/services/shared-api.service.mjs +0 -24
- package/shared/services/shared-api.service.d.ts +0 -12
package/fesm2022/cuby-ui-api.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpContextToken, HttpContext, HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { inject, Injectable } from '@angular/core';
|
|
4
4
|
import { map } from 'rxjs';
|
|
5
5
|
|
|
6
6
|
const X_NDJSON_CONFIG_OPTIONS = {
|
|
@@ -50,60 +50,39 @@ var SubjectType;
|
|
|
50
50
|
SubjectType["Equipment"] = "EQUIPMENT";
|
|
51
51
|
})(SubjectType || (SubjectType = {}));
|
|
52
52
|
|
|
53
|
-
class
|
|
53
|
+
class CuiFrameApiService {
|
|
54
54
|
constructor() {
|
|
55
|
-
this.CONTEXT_URL = "cuby-construction" /* CuiApiUrl.Construction */;
|
|
56
|
-
this.SHARED_HTTP_OPTIONS = {
|
|
57
|
-
context: new HttpContext().set(CUI_API_URL_CONTEXT, this.CONTEXT_URL)
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
setContextUrl(context) {
|
|
61
|
-
this.CONTEXT_URL = context;
|
|
62
|
-
}
|
|
63
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiSharedApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
64
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiSharedApiService, providedIn: 'root' }); }
|
|
65
|
-
}
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiSharedApiService, decorators: [{
|
|
67
|
-
type: Injectable,
|
|
68
|
-
args: [{
|
|
69
|
-
providedIn: 'root'
|
|
70
|
-
}]
|
|
71
|
-
}] });
|
|
72
|
-
|
|
73
|
-
class CuiFrameApiService extends CuiSharedApiService {
|
|
74
|
-
constructor() {
|
|
75
|
-
super(...arguments);
|
|
76
55
|
this.http = inject(HttpClient);
|
|
77
56
|
this.FRAMER_URL = 'framer';
|
|
78
57
|
this.FRAGMENT_URL = 'fragment';
|
|
79
58
|
}
|
|
80
|
-
getFrame(frameId) {
|
|
81
|
-
return this.http.get(`${this.FRAMER_URL}/${frameId}`,
|
|
59
|
+
getFrame(frameId, context) {
|
|
60
|
+
return this.http.get(`${this.FRAMER_URL}/${frameId}`, context);
|
|
82
61
|
}
|
|
83
|
-
createFrame() {
|
|
84
|
-
return this.http.post(this.FRAMER_URL, {},
|
|
62
|
+
createFrame(context) {
|
|
63
|
+
return this.http.post(this.FRAMER_URL, {}, context);
|
|
85
64
|
}
|
|
86
|
-
createFragment(frameId, type) {
|
|
65
|
+
createFragment(frameId, type, context) {
|
|
87
66
|
return this.http.post(`${this.FRAMER_URL}/${frameId}/${this.FRAGMENT_URL}`, {
|
|
88
67
|
type_operations: type
|
|
89
|
-
},
|
|
68
|
+
}, context);
|
|
90
69
|
}
|
|
91
|
-
deleteFragment(frameId, fragmentId) {
|
|
92
|
-
return this.http.delete(`${this.FRAMER_URL}/${frameId}/${this.FRAGMENT_URL}/${fragmentId}`,
|
|
70
|
+
deleteFragment(frameId, fragmentId, context) {
|
|
71
|
+
return this.http.delete(`${this.FRAMER_URL}/${frameId}/${this.FRAGMENT_URL}/${fragmentId}`, context);
|
|
93
72
|
}
|
|
94
|
-
uploadResource(body, frameId, fragmentId) {
|
|
73
|
+
uploadResource(body, frameId, fragmentId, context) {
|
|
95
74
|
return this.http.post(`${this.FRAMER_URL}/data_resource`, body, {
|
|
96
|
-
...
|
|
75
|
+
...context,
|
|
97
76
|
params: { frameContainerId: frameId, dataResourceContainerId: fragmentId }
|
|
98
77
|
});
|
|
99
78
|
}
|
|
100
|
-
deleteResource(frameId, fragmentId) {
|
|
79
|
+
deleteResource(frameId, fragmentId, context) {
|
|
101
80
|
return this.http.delete(`${this.FRAMER_URL}/data_resource/content`, {
|
|
102
|
-
...
|
|
81
|
+
...context,
|
|
103
82
|
params: { frameContainerId: frameId, dataResourceContainerId: fragmentId }
|
|
104
83
|
});
|
|
105
84
|
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiFrameApiService, deps:
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiFrameApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
107
86
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiFrameApiService, providedIn: 'root' }); }
|
|
108
87
|
}
|
|
109
88
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiFrameApiService, decorators: [{
|
|
@@ -113,25 +92,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
113
92
|
}]
|
|
114
93
|
}] });
|
|
115
94
|
|
|
116
|
-
class CuiTreeStructApiService
|
|
95
|
+
class CuiTreeStructApiService {
|
|
117
96
|
constructor() {
|
|
118
|
-
super(...arguments);
|
|
119
97
|
this.httpClient = inject(HttpClient);
|
|
120
98
|
this.TREE_STRUCT_URL = 'tree_struct';
|
|
121
99
|
}
|
|
122
|
-
getById(id) {
|
|
123
|
-
return this.httpClient.get(`${this.TREE_STRUCT_URL}/${id}`,
|
|
100
|
+
getById(id, context) {
|
|
101
|
+
return this.httpClient.get(`${this.TREE_STRUCT_URL}/${id}`, context);
|
|
124
102
|
}
|
|
125
|
-
getStageStoragesByParent(parentId) {
|
|
103
|
+
getStageStoragesByParent(parentId, context) {
|
|
126
104
|
return this.httpClient.get(`${this.TREE_STRUCT_URL}/${parentId}/children`, {
|
|
127
105
|
...X_NDJSON_CONFIG_OPTIONS,
|
|
128
|
-
...
|
|
106
|
+
...context
|
|
129
107
|
});
|
|
130
108
|
}
|
|
131
|
-
deleteTreeStructElement(treeStructId, elementId) {
|
|
132
|
-
return this.httpClient.delete(`${this.TREE_STRUCT_URL}/${treeStructId}/element/${elementId}`,
|
|
109
|
+
deleteTreeStructElement(treeStructId, elementId, context) {
|
|
110
|
+
return this.httpClient.delete(`${this.TREE_STRUCT_URL}/${treeStructId}/element/${elementId}`, context);
|
|
133
111
|
}
|
|
134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructApiService, deps:
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
135
113
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructApiService, providedIn: 'root' }); }
|
|
136
114
|
}
|
|
137
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructApiService, decorators: [{
|
|
@@ -141,27 +119,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
141
119
|
}]
|
|
142
120
|
}] });
|
|
143
121
|
|
|
144
|
-
class CuiNodeChecklistApiService
|
|
122
|
+
class CuiNodeChecklistApiService {
|
|
145
123
|
constructor() {
|
|
146
|
-
super(...arguments);
|
|
147
124
|
this.httpClient = inject(HttpClient);
|
|
148
125
|
this.MAIN_URL = 'checklist/node';
|
|
149
126
|
}
|
|
150
|
-
addNodeCheckListItem(data) {
|
|
151
|
-
return this.httpClient.post(`${this.MAIN_URL}`, data,
|
|
127
|
+
addNodeCheckListItem(data, context) {
|
|
128
|
+
return this.httpClient.post(`${this.MAIN_URL}`, data, context);
|
|
152
129
|
}
|
|
153
|
-
updateNodeCheckListItemTitle(id, title) {
|
|
154
|
-
return this.httpClient.post(`${this.MAIN_URL}/${id}/title`, {}, { ...
|
|
130
|
+
updateNodeCheckListItemTitle(id, title, context) {
|
|
131
|
+
return this.httpClient.post(`${this.MAIN_URL}/${id}/title`, {}, { ...context, params: { title } });
|
|
155
132
|
}
|
|
156
|
-
updateNodeCheckListItemActionContent(data) {
|
|
157
|
-
return this.httpClient.patch(`${this.MAIN_URL}/content_action`, data,
|
|
133
|
+
updateNodeCheckListItemActionContent(data, context) {
|
|
134
|
+
return this.httpClient.patch(`${this.MAIN_URL}/content_action`, data, context);
|
|
158
135
|
}
|
|
159
|
-
updateNodeCheckListItemIsConsideredCorrect(data) {
|
|
160
|
-
return this.httpClient.patch(`${this.MAIN_URL}/content/button/consider_correct`, data,
|
|
136
|
+
updateNodeCheckListItemIsConsideredCorrect(data, context) {
|
|
137
|
+
return this.httpClient.patch(`${this.MAIN_URL}/content/button/consider_correct`, data, context);
|
|
161
138
|
}
|
|
162
|
-
updateNodeCheckListItemSwitchContent({ nodeCheckListId, listEvaluationId, movingElementId, targetItemId, pointer }) {
|
|
139
|
+
updateNodeCheckListItemSwitchContent({ nodeCheckListId, listEvaluationId, movingElementId, targetItemId, pointer }, context) {
|
|
163
140
|
return this.httpClient.patch(`${this.MAIN_URL}/${nodeCheckListId}/content/list_evaluation/${listEvaluationId}/moving`, {}, {
|
|
164
|
-
...
|
|
141
|
+
...context,
|
|
165
142
|
params: {
|
|
166
143
|
movingElementId,
|
|
167
144
|
targetItemId,
|
|
@@ -169,28 +146,28 @@ class CuiNodeChecklistApiService extends CuiSharedApiService {
|
|
|
169
146
|
}
|
|
170
147
|
});
|
|
171
148
|
}
|
|
172
|
-
addEvaluationCriteriaItem(id, listId, criteria, evaluation) {
|
|
149
|
+
addEvaluationCriteriaItem(id, listId, criteria, evaluation, context) {
|
|
173
150
|
return this.httpClient.post(`${this.MAIN_URL}/${id}/content/list_evaluation/${listId}`, {}, {
|
|
174
|
-
...
|
|
151
|
+
...context,
|
|
175
152
|
params: {
|
|
176
153
|
criteria,
|
|
177
154
|
evaluation
|
|
178
155
|
}
|
|
179
156
|
});
|
|
180
157
|
}
|
|
181
|
-
updateEvaluationCriteriaItem(id, listId, criteriaId, criteria, evaluation) {
|
|
158
|
+
updateEvaluationCriteriaItem(id, listId, criteriaId, criteria, evaluation, context) {
|
|
182
159
|
return this.httpClient.patch(`${this.MAIN_URL}/${id}/content/list_evaluation/${listId}/${criteriaId}`, {}, {
|
|
183
|
-
...
|
|
160
|
+
...context,
|
|
184
161
|
params: {
|
|
185
162
|
criteria,
|
|
186
163
|
evaluation
|
|
187
164
|
}
|
|
188
165
|
});
|
|
189
166
|
}
|
|
190
|
-
deleteEvaluationCriteriaItem(id, listId, criteriaId) {
|
|
191
|
-
return this.httpClient.delete(`${this.MAIN_URL}/${id}/content/list_evaluation/${criteriaId}/${listId}`,
|
|
167
|
+
deleteEvaluationCriteriaItem(id, listId, criteriaId, context) {
|
|
168
|
+
return this.httpClient.delete(`${this.MAIN_URL}/${id}/content/list_evaluation/${criteriaId}/${listId}`, context);
|
|
192
169
|
}
|
|
193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiNodeChecklistApiService, deps:
|
|
170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiNodeChecklistApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
194
171
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiNodeChecklistApiService, providedIn: 'root' }); }
|
|
195
172
|
}
|
|
196
173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiNodeChecklistApiService, decorators: [{
|
|
@@ -200,48 +177,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
200
177
|
}]
|
|
201
178
|
}] });
|
|
202
179
|
|
|
203
|
-
class CuiTreeStructNavigatorApiService
|
|
180
|
+
class CuiTreeStructNavigatorApiService {
|
|
204
181
|
constructor() {
|
|
205
|
-
super(...arguments);
|
|
206
182
|
this.httpClient = inject(HttpClient);
|
|
207
183
|
this.TREE_STRUCT_NAVIGATOR_URL = 'tree_struct';
|
|
208
184
|
this.CONSTRUCTION_TECHNOLOGY_URL = 'construction_technology';
|
|
209
185
|
}
|
|
210
|
-
createStageStorage(title, type) {
|
|
211
|
-
return this.httpClient.post(this.TREE_STRUCT_NAVIGATOR_URL, {}, { ...
|
|
186
|
+
createStageStorage(title, type, context) {
|
|
187
|
+
return this.httpClient.post(this.TREE_STRUCT_NAVIGATOR_URL, {}, { ...context, params: { type, title } });
|
|
212
188
|
}
|
|
213
|
-
createStageStorageToParent(parentId, title) {
|
|
214
|
-
return this.httpClient.put(`${this.TREE_STRUCT_NAVIGATOR_URL}/children`, {}, { ...
|
|
189
|
+
createStageStorageToParent(parentId, title, context) {
|
|
190
|
+
return this.httpClient.put(`${this.TREE_STRUCT_NAVIGATOR_URL}/children`, {}, { ...context, params: { parentId, title } });
|
|
215
191
|
}
|
|
216
|
-
getStageStorages(type) {
|
|
192
|
+
getStageStorages(type, context) {
|
|
217
193
|
return this.httpClient.get(this.TREE_STRUCT_NAVIGATOR_URL, {
|
|
218
194
|
...X_NDJSON_CONFIG_OPTIONS,
|
|
219
|
-
...
|
|
195
|
+
...context,
|
|
220
196
|
params: { type }
|
|
221
197
|
});
|
|
222
198
|
}
|
|
223
|
-
getStageStoragesByParent(parentId) {
|
|
199
|
+
getStageStoragesByParent(parentId, context) {
|
|
224
200
|
return this.httpClient.get(`${this.TREE_STRUCT_NAVIGATOR_URL}/${parentId}/children`, {
|
|
225
201
|
...X_NDJSON_CONFIG_OPTIONS,
|
|
226
|
-
...
|
|
202
|
+
...context
|
|
227
203
|
});
|
|
228
204
|
}
|
|
229
|
-
updateTitle(treeStructId, title) {
|
|
230
|
-
return this.httpClient.patch(`${this.TREE_STRUCT_NAVIGATOR_URL}/title`, {}, { ...
|
|
205
|
+
updateTitle(treeStructId, title, context) {
|
|
206
|
+
return this.httpClient.patch(`${this.TREE_STRUCT_NAVIGATOR_URL}/title`, {}, { ...context, params: { treeStructId, title } });
|
|
231
207
|
}
|
|
232
|
-
move(body) {
|
|
233
|
-
return this.httpClient.patch(`${this.CONSTRUCTION_TECHNOLOGY_URL}/stage/moving`, body,
|
|
208
|
+
move(body, context) {
|
|
209
|
+
return this.httpClient.patch(`${this.CONSTRUCTION_TECHNOLOGY_URL}/stage/moving`, body, context);
|
|
234
210
|
}
|
|
235
|
-
moveElement(body) {
|
|
236
|
-
return this.httpClient.patch(`${this.TREE_STRUCT_NAVIGATOR_URL}/moving/element`, body,
|
|
211
|
+
moveElement(body, context) {
|
|
212
|
+
return this.httpClient.patch(`${this.TREE_STRUCT_NAVIGATOR_URL}/moving/element`, body, context);
|
|
237
213
|
}
|
|
238
|
-
getCategory(id, type) {
|
|
214
|
+
getCategory(id, type, context) {
|
|
239
215
|
return this.httpClient.get(`${this.TREE_STRUCT_NAVIGATOR_URL}/base/element/${id}`, {
|
|
240
|
-
...
|
|
216
|
+
...context,
|
|
241
217
|
params: { type }
|
|
242
218
|
});
|
|
243
219
|
}
|
|
244
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructNavigatorApiService, deps:
|
|
220
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructNavigatorApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
245
221
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructNavigatorApiService, providedIn: 'root' }); }
|
|
246
222
|
}
|
|
247
223
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiTreeStructNavigatorApiService, decorators: [{
|