@pgds/api-interface 1.6.1 → 1.6.3

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.
Files changed (66) hide show
  1. package/api/notes/createNoteEndpoint.d.ts +8 -0
  2. package/api/notes/getNoteByIdEndpoint.d.ts +7 -0
  3. package/api/notes/getNotesByReferenceIdEndpoint.d.ts +7 -0
  4. package/api/notes/removeNoteEndpoint.d.ts +7 -0
  5. package/api/notes/updateNoteEndpoint.d.ts +7 -0
  6. package/api/prescriptions/createPrescriptionEndpoint.d.ts +7 -0
  7. package/api/prescriptions/getAllPrescriptionsByOrganizationIdEndpoint.d.ts +7 -0
  8. package/api/prescriptions/getAllPrescriptionsEndpoint.d.ts +7 -0
  9. package/api/prescriptions/getPrescriptionByIdEndpoint.d.ts +7 -0
  10. package/api/prescriptions/removePrescriptionEndpoint.d.ts +7 -0
  11. package/api/prescriptions/updatePrescriptionEndpoint.d.ts +7 -0
  12. package/api/productTypes/createProductTypeEndpoint.d.ts +7 -0
  13. package/api/productTypes/customization/getThingProductTypeCustomizationEndpoint.d.ts +7 -0
  14. package/api/productTypes/customization/updateOrganizationIdForProductTypeCustomizationsEndpoint.d.ts +7 -0
  15. package/api/productTypes/customization/upsertProductTypeCustomizationEndpoint.d.ts +7 -0
  16. package/api/productTypes/getAvailableProductTypesEndpoint.d.ts +7 -0
  17. package/api/productTypes/getProductTypeByIdOrCodeEndpoint.d.ts +7 -0
  18. package/api/productTypes/getProductTypeByThingIdEndpoint.d.ts +7 -0
  19. package/api/productTypes/getProductTypesEndpoint.d.ts +7 -0
  20. package/api/productTypes/internal/deleteProductTypeCustomizationsByQueryEndpoint.d.ts +7 -0
  21. package/api/productTypes/internal/getProductTypesAndCustomizationsEndpoint.d.ts +7 -0
  22. package/api/productTypes/removeProductTypeEndpoint.d.ts +7 -0
  23. package/api/productTypes/sharing/createProductTypeSharingEndpoint.d.ts +7 -0
  24. package/api/productTypes/sharing/getAllProductTypeSharingEndpoint.d.ts +7 -0
  25. package/api/productTypes/sharing/getProductTypeAclsByShareIdEndpoint.d.ts +7 -0
  26. package/api/productTypes/sharing/getProductTypeSharingByIdEndpoint.d.ts +7 -0
  27. package/api/productTypes/sharing/removeProductTypeSharingEndpoint.d.ts +7 -0
  28. package/api/productTypes/updateProductTypeCapabilitiesEndpoint.d.ts +7 -0
  29. package/api/productTypes/updateProductTypeEndpoint.d.ts +7 -0
  30. package/api/routes.d.ts +1 -0
  31. package/api/schemas/notes/createNoteSchema.d.ts +28 -0
  32. package/api/schemas/notes/getNotesByReferenceIdSchema.d.ts +36 -0
  33. package/api/schemas/notes/getNotesByUserIdSchema.d.ts +40 -0
  34. package/api/schemas/notes/notesSchemasShared.d.ts +5 -0
  35. package/api/schemas/notes/updateNoteSchema.d.ts +12 -0
  36. package/api/schemas/notes/updateOrganizationIdRequestSchema.d.ts +15 -0
  37. package/api/schemas/prescriptions/createPrescriptionSchema.d.ts +36 -0
  38. package/api/schemas/prescriptions/prescriptionIdSchema.d.ts +11 -0
  39. package/api/schemas/prescriptions/updatePrescriptionSchema.d.ts +39 -0
  40. package/api/schemas/productTypes/createProductTypeSchema.d.ts +63 -0
  41. package/api/schemas/productTypes/createProductTypeSharingSchema.d.ts +31 -0
  42. package/api/schemas/productTypes/customization/productTypeCustomizationSchema.d.ts +59 -0
  43. package/api/schemas/productTypes/customization/updateOrganizationIdSchema.d.ts +15 -0
  44. package/api/schemas/productTypes/customization/upsertProductTypeCustomizationSchema.d.ts +68 -0
  45. package/api/schemas/productTypes/productTypesSchemasShared.d.ts +84 -0
  46. package/api/schemas/productTypes/updateCapabilitiesSchema.d.ts +344 -0
  47. package/api/schemas/productTypes/updateProductTypeSchema.d.ts +60 -0
  48. package/api/schemas/schemasShared.d.ts +9 -0
  49. package/lib/generator/index.d.ts +19 -0
  50. package/lib/generator/index.js +165 -0
  51. package/lib/generator/index.js.map +1 -0
  52. package/lib/generator/utils/generatorUtils.d.ts +11 -0
  53. package/lib/generator/utils/generatorUtils.js +135 -0
  54. package/lib/generator/utils/generatorUtils.js.map +1 -0
  55. package/lib/repositories/organizationHierarchyRepo.d.ts +4 -1
  56. package/lib/repositories/organizationHierarchyRepo.js +15 -5
  57. package/lib/repositories/organizationHierarchyRepo.js.map +1 -1
  58. package/lib/schemas/TestRequestSchema.d.ts +4 -0
  59. package/lib/schemas/TestRequestSchema.js +3 -0
  60. package/lib/schemas/TestRequestSchema.js.map +1 -0
  61. package/lib/schemas/TestResponseSchema.d.ts +6 -0
  62. package/lib/schemas/TestResponseSchema.js +5 -0
  63. package/lib/schemas/TestResponseSchema.js.map +1 -0
  64. package/lib/server/server.js +14 -7
  65. package/lib/server/server.js.map +1 -1
  66. package/package.json +2 -2
@@ -0,0 +1,15 @@
1
+ export declare const UpdateOrganizationIdRequestBodySchema: {
2
+ type: string;
3
+ properties: {
4
+ thingIds: {
5
+ type: string;
6
+ items: {
7
+ type: string;
8
+ };
9
+ };
10
+ newOrganizationId: {
11
+ type: string;
12
+ };
13
+ };
14
+ required: string[];
15
+ };
@@ -0,0 +1,68 @@
1
+ export declare const upsertProductTypeCustomizationSchema: {
2
+ type: string;
3
+ oneOf: ({
4
+ properties: {
5
+ organizationId: {
6
+ type: string;
7
+ };
8
+ customization: {
9
+ type: string;
10
+ properties: {
11
+ name: {
12
+ type: string[];
13
+ minLength: number;
14
+ };
15
+ heartbeat: {
16
+ type: string;
17
+ properties: {
18
+ interval: {
19
+ type: string[];
20
+ default: number;
21
+ };
22
+ timeout: {
23
+ type: string[];
24
+ default: number;
25
+ };
26
+ };
27
+ additionalProperties: boolean;
28
+ };
29
+ };
30
+ additionalProperties: boolean;
31
+ };
32
+ thingId?: undefined;
33
+ };
34
+ required: string[];
35
+ additionalProperties: boolean;
36
+ } | {
37
+ properties: {
38
+ thingId: {
39
+ type: string;
40
+ };
41
+ organizationId: {
42
+ type: string;
43
+ };
44
+ customization: {
45
+ type: string;
46
+ properties: {
47
+ heartbeat: {
48
+ type: string;
49
+ properties: {
50
+ interval: {
51
+ type: string[];
52
+ default: number;
53
+ };
54
+ timeout: {
55
+ type: string[];
56
+ default: number;
57
+ };
58
+ };
59
+ additionalProperties: boolean;
60
+ };
61
+ };
62
+ additionalProperties: boolean;
63
+ };
64
+ };
65
+ required: string[];
66
+ additionalProperties: boolean;
67
+ })[];
68
+ };
@@ -0,0 +1,84 @@
1
+ export declare const heartbeat: {
2
+ type: string;
3
+ properties: {
4
+ interval: {
5
+ type: string[];
6
+ default: number;
7
+ };
8
+ timeout: {
9
+ type: string[];
10
+ default: number;
11
+ };
12
+ };
13
+ additionalProperties: boolean;
14
+ };
15
+ export declare const productTypeShareIdSchema: {
16
+ type: string;
17
+ properties: {
18
+ shareId: {
19
+ type: string;
20
+ minLength: number;
21
+ };
22
+ productTypeId: {
23
+ type: string;
24
+ minLength: number;
25
+ };
26
+ };
27
+ required: string[];
28
+ additionalProperties: boolean;
29
+ };
30
+ export declare const productTypeIdSchema: {
31
+ type: string;
32
+ properties: {
33
+ productTypeId: {
34
+ type: string;
35
+ minLength: number;
36
+ };
37
+ };
38
+ required: string[];
39
+ additionalProperties: boolean;
40
+ };
41
+ export declare const thingCustomization: {
42
+ type: string;
43
+ properties: {
44
+ heartbeat: {
45
+ type: string;
46
+ properties: {
47
+ interval: {
48
+ type: string[];
49
+ default: number;
50
+ };
51
+ timeout: {
52
+ type: string[];
53
+ default: number;
54
+ };
55
+ };
56
+ additionalProperties: boolean;
57
+ };
58
+ };
59
+ additionalProperties: boolean;
60
+ };
61
+ export declare const organizationCustomization: {
62
+ type: string;
63
+ properties: {
64
+ name: {
65
+ type: string[];
66
+ minLength: number;
67
+ };
68
+ heartbeat: {
69
+ type: string;
70
+ properties: {
71
+ interval: {
72
+ type: string[];
73
+ default: number;
74
+ };
75
+ timeout: {
76
+ type: string[];
77
+ default: number;
78
+ };
79
+ };
80
+ additionalProperties: boolean;
81
+ };
82
+ };
83
+ additionalProperties: boolean;
84
+ };
@@ -0,0 +1,344 @@
1
+ import { CapabilityCanBeTriggeredBy, CapabilityType } from "../../../constants/constants";
2
+ declare enum SupportedDerivedValues {
3
+ AbsoluteHumidity = "absoluteHumidity",
4
+ MixingRatio = "mixingRatio",
5
+ DewPoint = "dewPoint",
6
+ SpecificHumidity = "specificHumidity",
7
+ Wme = "wme"
8
+ }
9
+ export declare const updateCapabilitiesSchema: {
10
+ type: string;
11
+ items: {
12
+ oneOf: ({
13
+ type: string;
14
+ properties: {
15
+ name: {
16
+ type: string;
17
+ minLength: number;
18
+ description: string;
19
+ };
20
+ v1_datafieldName: {
21
+ type: string;
22
+ description: string;
23
+ };
24
+ type: {
25
+ type: string;
26
+ enum: CapabilityType[];
27
+ };
28
+ metadata: {
29
+ type: string;
30
+ description: string;
31
+ properties: {
32
+ unit: {
33
+ type: string;
34
+ description: string;
35
+ };
36
+ thingPage: {
37
+ type: string;
38
+ properties: {
39
+ statusBar: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ graph: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ stateIndicator: {
48
+ type: string;
49
+ description: string;
50
+ oneOf: {
51
+ type: string;
52
+ properties: {
53
+ type: {
54
+ type: string;
55
+ enum: string[];
56
+ };
57
+ thresholds: {
58
+ type: string;
59
+ items: {
60
+ type: string;
61
+ };
62
+ minItems: number;
63
+ maxItems: number;
64
+ };
65
+ };
66
+ required: string[];
67
+ additionalProperties: boolean;
68
+ }[];
69
+ };
70
+ };
71
+ additionalProperties: boolean;
72
+ };
73
+ enum: {
74
+ type: string;
75
+ patternProperties: {
76
+ "^-?\\d+$": {
77
+ type: string;
78
+ minProperties: number;
79
+ description: string;
80
+ additionalProperties: {
81
+ type: string;
82
+ };
83
+ };
84
+ };
85
+ additionalProperties: boolean;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ required: string[];
91
+ additionalProperties: boolean;
92
+ } | {
93
+ type: string;
94
+ properties: {
95
+ name: {
96
+ type: string;
97
+ minLength: number;
98
+ description: string;
99
+ };
100
+ type: {
101
+ type: string;
102
+ enum: CapabilityType[];
103
+ };
104
+ metadata: {
105
+ type: string;
106
+ description: string;
107
+ properties: {
108
+ unit: {
109
+ type: string;
110
+ description: string;
111
+ };
112
+ thingPage: {
113
+ type: string;
114
+ properties: {
115
+ statusBar: {
116
+ type: string;
117
+ description: string;
118
+ };
119
+ graph: {
120
+ type: string;
121
+ description: string;
122
+ };
123
+ stateIndicator: {
124
+ type: string;
125
+ description: string;
126
+ oneOf: {
127
+ type: string;
128
+ properties: {
129
+ type: {
130
+ type: string;
131
+ enum: string[];
132
+ };
133
+ thresholds: {
134
+ type: string;
135
+ items: {
136
+ type: string;
137
+ };
138
+ minItems: number;
139
+ maxItems: number;
140
+ };
141
+ };
142
+ required: string[];
143
+ additionalProperties: boolean;
144
+ }[];
145
+ };
146
+ };
147
+ additionalProperties: boolean;
148
+ };
149
+ enum: {
150
+ type: string;
151
+ patternProperties: {
152
+ "^-?\\d+$": {
153
+ type: string;
154
+ minProperties: number;
155
+ description: string;
156
+ additionalProperties: {
157
+ type: string;
158
+ };
159
+ };
160
+ };
161
+ additionalProperties: boolean;
162
+ };
163
+ values: {
164
+ type: string;
165
+ description: string;
166
+ properties: {
167
+ temperature: {
168
+ type: string;
169
+ description: string;
170
+ };
171
+ humidity: {
172
+ type: string;
173
+ description: string;
174
+ };
175
+ pressure: {
176
+ type: string;
177
+ description: string;
178
+ };
179
+ resistance: {
180
+ type: string;
181
+ description: string;
182
+ };
183
+ };
184
+ additionalProperties: boolean;
185
+ };
186
+ translations: {
187
+ type: string;
188
+ minProperties: number;
189
+ description: string;
190
+ additionalProperties: {
191
+ type: string;
192
+ };
193
+ };
194
+ calculationType: {
195
+ type: string;
196
+ enum: SupportedDerivedValues[];
197
+ };
198
+ };
199
+ required: string[];
200
+ };
201
+ };
202
+ required: string[];
203
+ additionalProperties: boolean;
204
+ } | {
205
+ type: string;
206
+ properties: {
207
+ name: {
208
+ type: string;
209
+ minLength: number;
210
+ description: string;
211
+ };
212
+ type: {
213
+ type: string;
214
+ enum: CapabilityType[];
215
+ };
216
+ command: {};
217
+ metadata: {
218
+ type: string;
219
+ description: string;
220
+ properties: {
221
+ thingPage: {
222
+ type: string;
223
+ properties: {
224
+ canBeTriggeredBy: {
225
+ type: string;
226
+ items: {
227
+ type: string;
228
+ enum: CapabilityCanBeTriggeredBy[];
229
+ };
230
+ };
231
+ };
232
+ required: string[];
233
+ };
234
+ translations: {
235
+ type: string;
236
+ minProperties: number;
237
+ description: string;
238
+ additionalProperties: {
239
+ type: string;
240
+ };
241
+ };
242
+ commandSchema: {
243
+ type: string;
244
+ description: string;
245
+ };
246
+ };
247
+ required: string[];
248
+ additionalProperties: boolean;
249
+ };
250
+ };
251
+ required: string[];
252
+ additionalProperties: boolean;
253
+ } | {
254
+ type: string;
255
+ properties: {
256
+ name: {
257
+ type: string;
258
+ minLength: number;
259
+ description: string;
260
+ };
261
+ type: {
262
+ type: string;
263
+ enum: CapabilityType[];
264
+ };
265
+ metadata: {
266
+ type: string;
267
+ properties: {
268
+ value: {
269
+ type: string;
270
+ };
271
+ interval: {
272
+ type: string;
273
+ pattern: string;
274
+ description: string;
275
+ };
276
+ thingPage: {
277
+ type: string;
278
+ properties: {
279
+ statusBar: {
280
+ type: string;
281
+ description: string;
282
+ };
283
+ graph: {
284
+ type: string;
285
+ description: string;
286
+ };
287
+ stateIndicator: {
288
+ type: string;
289
+ description: string;
290
+ oneOf: {
291
+ type: string;
292
+ properties: {
293
+ type: {
294
+ type: string;
295
+ enum: string[];
296
+ };
297
+ thresholds: {
298
+ type: string;
299
+ items: {
300
+ type: string;
301
+ };
302
+ minItems: number;
303
+ maxItems: number;
304
+ };
305
+ };
306
+ required: string[];
307
+ additionalProperties: boolean;
308
+ }[];
309
+ };
310
+ };
311
+ additionalProperties: boolean;
312
+ };
313
+ enum: {
314
+ type: string;
315
+ patternProperties: {
316
+ "^-?\\d+$": {
317
+ type: string;
318
+ minProperties: number;
319
+ description: string;
320
+ additionalProperties: {
321
+ type: string;
322
+ };
323
+ };
324
+ };
325
+ additionalProperties: boolean;
326
+ };
327
+ translations: {
328
+ type: string;
329
+ minProperties: number;
330
+ description: string;
331
+ additionalProperties: {
332
+ type: string;
333
+ };
334
+ };
335
+ };
336
+ required: string[];
337
+ };
338
+ };
339
+ required: string[];
340
+ additionalProperties: boolean;
341
+ })[];
342
+ };
343
+ };
344
+ export {};
@@ -0,0 +1,60 @@
1
+ import { ThingVersion } from "../../../constants/constants";
2
+ export declare const updateProductTypeSchema: {
3
+ type: string;
4
+ properties: {
5
+ name: {
6
+ type: string;
7
+ minLength: number;
8
+ };
9
+ description: {
10
+ type: string;
11
+ };
12
+ dashboardUri: {
13
+ type: string;
14
+ };
15
+ productImageUrl: {
16
+ type: string;
17
+ };
18
+ category: {
19
+ enum: readonly ["sensor", "property", "health", "other", "waterSwitch", "waterMeter", "waterSensor", "weatherSensor"];
20
+ default: "sensor";
21
+ };
22
+ manufacturer: {
23
+ type: string;
24
+ };
25
+ heartbeat: {
26
+ type: string;
27
+ properties: {
28
+ interval: {
29
+ type: string[];
30
+ default: number;
31
+ };
32
+ timeout: {
33
+ type: string[];
34
+ default: number;
35
+ };
36
+ };
37
+ additionalProperties: boolean;
38
+ };
39
+ canOnlyBeAddedByGlobal: {
40
+ type: string;
41
+ };
42
+ serialNumberPrefix: {
43
+ type: string;
44
+ maxLength: number;
45
+ };
46
+ serialNumberQrRegex: {
47
+ type: string;
48
+ maxLength: number;
49
+ };
50
+ supportedThingVersions: {
51
+ type: string;
52
+ items: {
53
+ type: string;
54
+ enum: ThingVersion[];
55
+ };
56
+ default: ThingVersion[];
57
+ };
58
+ };
59
+ additionalProperties: boolean;
60
+ };
@@ -0,0 +1,9 @@
1
+ export declare const idSchema: {
2
+ type: string;
3
+ minLength: number;
4
+ };
5
+ export declare const userSchema: {
6
+ type: string;
7
+ };
8
+ /** https://en.wikipedia.org/wiki/E.164 */
9
+ export declare const e164number = "^\\+?[1-9]\\d{1,14}$";
@@ -0,0 +1,19 @@
1
+ import { Method, Request } from "..";
2
+ import { JsonResponse } from "../models/JsonResponse";
3
+ interface RequestBody {
4
+ /**
5
+ * A map of endpoints to include in the generated API client.
6
+ * The keys are HTTP methods (e.g., "get", "post", etc.),
7
+ * and the values are arrays of endpoint paths.
8
+ * For example:
9
+ * {
10
+ * "get": ["/users", "/users/:userId"],
11
+ * "post": ["/users", "/users/:userId/follow"],
12
+ * }
13
+ */
14
+ endpointsToInclude: {
15
+ [key in Method]?: string[];
16
+ };
17
+ }
18
+ export declare function generateApiClientEndpoint(req: Request<RequestBody>): Promise<JsonResponse<string>>;
19
+ export {};