@ogcio/building-blocks-sdk 0.2.89 → 0.2.91

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 (51) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/biome.jsonc +1 -1
  4. package/dist/client/clients/messaging/index.d.ts +86 -2
  5. package/dist/client/clients/messaging/index.d.ts.map +1 -1
  6. package/dist/client/clients/messaging/index.js +25 -2
  7. package/dist/client/clients/messaging/index.js.map +1 -1
  8. package/dist/client/clients/messaging/schema.d.ts +877 -2
  9. package/dist/client/clients/messaging/schema.d.ts.map +1 -1
  10. package/dist/client/clients/messaging/support.d.ts +2 -0
  11. package/dist/client/clients/messaging/support.d.ts.map +1 -1
  12. package/dist/client/clients/messaging/tags.d.ts +587 -0
  13. package/dist/client/clients/messaging/tags.d.ts.map +1 -0
  14. package/dist/client/clients/messaging/tags.js +49 -0
  15. package/dist/client/clients/messaging/tags.js.map +1 -0
  16. package/dist/client/clients/profile/citizen.d.ts +230 -0
  17. package/dist/client/clients/profile/citizen.d.ts.map +1 -1
  18. package/dist/client/clients/profile/citizen.js +20 -0
  19. package/dist/client/clients/profile/citizen.js.map +1 -1
  20. package/dist/client/clients/profile/index.d.ts.map +1 -1
  21. package/dist/client/clients/profile/index.js +1 -1
  22. package/dist/client/clients/profile/index.js.map +1 -1
  23. package/dist/client/clients/profile/organisation.d.ts.map +1 -1
  24. package/dist/client/clients/profile/schema.d.ts +888 -0
  25. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  26. package/dist/client/clients/profile/support.d.ts +678 -0
  27. package/dist/client/clients/profile/support.d.ts.map +1 -1
  28. package/dist/client/clients/profile/support.js +42 -0
  29. package/dist/client/clients/profile/support.js.map +1 -1
  30. package/dist/client/clients/scheduler/schema.d.ts +1 -1
  31. package/dist/client/clients/scheduler/schema.d.ts.map +1 -1
  32. package/dist/client/clients/upload/index.d.ts +1 -1
  33. package/dist/client/clients/upload/index.d.ts.map +1 -1
  34. package/dist/client/clients/upload/schema.d.ts +4 -4
  35. package/dist/client/clients/upload/schema.d.ts.map +1 -1
  36. package/dist/client/clients/upload/support.d.ts +1 -1
  37. package/dist/client/clients/upload/support.d.ts.map +1 -1
  38. package/package.json +7 -7
  39. package/src/client/clients/messaging/index.ts +39 -2
  40. package/src/client/clients/messaging/open-api-definition.json +3113 -1242
  41. package/src/client/clients/messaging/schema.ts +877 -2
  42. package/src/client/clients/messaging/tags.ts +86 -0
  43. package/src/client/clients/profile/citizen.ts +39 -0
  44. package/src/client/clients/profile/index.ts +1 -1
  45. package/src/client/clients/profile/open-api-definition.json +4192 -1310
  46. package/src/client/clients/profile/schema.ts +888 -0
  47. package/src/client/clients/profile/support.ts +81 -0
  48. package/src/client/clients/scheduler/open-api-definition.json +33 -32
  49. package/src/client/clients/scheduler/schema.ts +1 -1
  50. package/src/client/clients/upload/open-api-definition.json +10 -6
  51. package/src/client/clients/upload/schema.ts +4 -4
@@ -3,6 +3,31 @@ import type { Logger } from "../../../types/index.js";
3
3
  import { formatError, formatResponse } from "../../utils/client-utils.js";
4
4
  import type { paths } from "./schema.js";
5
5
 
6
+ type ListAnnouncementsQuery =
7
+ paths["/api/v1/support/announcements/"]["get"]["parameters"]["query"];
8
+ type BooleanListAnnouncementsQuery = Omit<
9
+ ListAnnouncementsQuery,
10
+ "isEnabled"
11
+ > & {
12
+ isEnabled: boolean;
13
+ };
14
+
15
+ type CreateAnnouncementBody =
16
+ paths["/api/v1/support/announcements/"]["post"]["requestBody"]["content"]["application/json"];
17
+ type TypedCreateAnnouncementBody = Omit<
18
+ CreateAnnouncementBody,
19
+ "isEnabled" | "publishDate"
20
+ > & {
21
+ isEnabled: boolean;
22
+ publishDate: Date;
23
+ };
24
+
25
+ type ToggleEnabledBody =
26
+ paths["/api/v1/support/announcements/{id}/enabled"]["patch"]["requestBody"]["content"]["application/json"];
27
+ type TypedToggleEnabledBody = Omit<ToggleEnabledBody, "isEnabled"> & {
28
+ isEnabled: boolean;
29
+ };
30
+
6
31
  export class ProfileSupport {
7
32
  constructor(
8
33
  private readonly client: ReturnType<typeof createClient<paths>>,
@@ -48,4 +73,60 @@ export class ProfileSupport {
48
73
  (reason) => formatError(reason, this.serviceName, this.logger),
49
74
  );
50
75
  }
76
+
77
+ public readonly announcements = {
78
+ list: async (queryParams: BooleanListAnnouncementsQuery) => {
79
+ let isEnabled: undefined | "true" | "false";
80
+ if (queryParams.isEnabled !== undefined) {
81
+ isEnabled = queryParams.isEnabled ? "true" : "false";
82
+ }
83
+
84
+ return this.client
85
+ .GET("/api/v1/support/announcements/", {
86
+ params: { query: { ...queryParams, isEnabled } },
87
+ })
88
+ .then(
89
+ (response) => formatResponse(response, this.serviceName, this.logger),
90
+ (reason) => formatError(reason, this.serviceName, this.logger),
91
+ );
92
+ },
93
+ create: async (body: TypedCreateAnnouncementBody) => {
94
+ return this.client
95
+ .POST("/api/v1/support/announcements/", {
96
+ body: {
97
+ ...body,
98
+ isEnabled: body.isEnabled ? "true" : "false",
99
+ publishDate: body.publishDate.toISOString(),
100
+ },
101
+ })
102
+ .then(
103
+ (response) => formatResponse(response, this.serviceName, this.logger),
104
+ (reason) => formatError(reason, this.serviceName, this.logger),
105
+ );
106
+ },
107
+ toggleEnabled: async (id: string, body: TypedToggleEnabledBody) => {
108
+ return this.client
109
+ .PATCH("/api/v1/support/announcements/{id}/enabled", {
110
+ params: { path: { id } },
111
+ body: {
112
+ ...body,
113
+ isEnabled: body.isEnabled ? "true" : "false",
114
+ },
115
+ })
116
+ .then(
117
+ (response) => formatResponse(response, this.serviceName, this.logger),
118
+ (reason) => formatError(reason, this.serviceName, this.logger),
119
+ );
120
+ },
121
+ get: async (id: string) => {
122
+ return this.client
123
+ .GET("/api/v1/support/announcements/{id}", {
124
+ params: { path: { id } },
125
+ })
126
+ .then(
127
+ (response) => formatResponse(response, this.serviceName, this.logger),
128
+ (reason) => formatError(reason, this.serviceName, this.logger),
129
+ );
130
+ },
131
+ };
51
132
  }
@@ -24,30 +24,31 @@
24
24
  "Tasks"
25
25
  ],
26
26
  "requestBody": {
27
+ "required": true,
27
28
  "content": {
28
29
  "application/json": {
29
30
  "schema": {
30
31
  "type": "array",
31
32
  "items": {
32
33
  "type": "object",
34
+ "required": [
35
+ "webhookUrl",
36
+ "webhookAuth",
37
+ "executeAt"
38
+ ],
33
39
  "properties": {
34
40
  "webhookUrl": {
35
- "format": "uri",
36
- "type": "string"
41
+ "type": "string",
42
+ "format": "uri"
37
43
  },
38
44
  "webhookAuth": {
39
45
  "type": "string"
40
46
  },
41
47
  "executeAt": {
42
- "format": "date-time",
43
- "type": "string"
48
+ "type": "string",
49
+ "format": "date-time"
44
50
  }
45
- },
46
- "required": [
47
- "webhookUrl",
48
- "webhookAuth",
49
- "executeAt"
50
- ]
51
+ }
51
52
  }
52
53
  }
53
54
  }
@@ -63,28 +64,37 @@
63
64
  "application/json": {
64
65
  "schema": {
65
66
  "type": "object",
67
+ "required": [
68
+ "code",
69
+ "detail",
70
+ "requestId",
71
+ "name"
72
+ ],
66
73
  "properties": {
67
74
  "code": {
68
- "description": "Code used to categorize the error",
69
- "type": "string"
75
+ "type": "string",
76
+ "description": "Code used to categorize the error"
70
77
  },
71
78
  "detail": {
72
- "description": "Description of the error",
73
- "type": "string"
79
+ "type": "string",
80
+ "description": "Description of the error"
74
81
  },
75
82
  "requestId": {
76
- "description": "Unique request id. This one will be used to troubleshoot the problems",
77
- "type": "string"
83
+ "type": "string",
84
+ "description": "Unique request id. This one will be used to troubleshoot the problems"
78
85
  },
79
86
  "name": {
80
- "description": "Name of the error type",
81
- "type": "string"
87
+ "type": "string",
88
+ "description": "Name of the error type"
82
89
  },
83
90
  "validation": {
84
- "description": "List of the validation errors",
85
91
  "type": "array",
86
92
  "items": {
87
93
  "type": "object",
94
+ "required": [
95
+ "fieldName",
96
+ "message"
97
+ ],
88
98
  "properties": {
89
99
  "fieldName": {
90
100
  "type": "string"
@@ -92,23 +102,14 @@
92
102
  "message": {
93
103
  "type": "string"
94
104
  }
95
- },
96
- "required": [
97
- "fieldName",
98
- "message"
99
- ]
100
- }
105
+ }
106
+ },
107
+ "description": "List of the validation errors"
101
108
  },
102
109
  "validationContext": {
103
110
  "type": "string"
104
111
  }
105
- },
106
- "required": [
107
- "code",
108
- "detail",
109
- "requestId",
110
- "name"
111
- ]
112
+ }
112
113
  }
113
114
  }
114
115
  }
@@ -48,7 +48,7 @@ export interface paths {
48
48
  path?: never;
49
49
  cookie?: never;
50
50
  };
51
- requestBody?: {
51
+ requestBody: {
52
52
  content: {
53
53
  "application/json": {
54
54
  /** Format: uri */
@@ -15,6 +15,7 @@
15
15
  "Files"
16
16
  ],
17
17
  "requestBody": {
18
+ "required": true,
18
19
  "content": {
19
20
  "multipart/form-data": {
20
21
  "schema": {
@@ -227,6 +228,7 @@
227
228
  "SupportFiles"
228
229
  ],
229
230
  "requestBody": {
231
+ "required": true,
230
232
  "content": {
231
233
  "multipart/form-data": {
232
234
  "schema": {
@@ -342,6 +344,7 @@
342
344
  "SupportFiles"
343
345
  ],
344
346
  "requestBody": {
347
+ "required": true,
345
348
  "content": {
346
349
  "application/json": {
347
350
  "schema": {
@@ -365,8 +368,7 @@
365
368
  }
366
369
  }
367
370
  }
368
- },
369
- "required": true
371
+ }
370
372
  },
371
373
  "responses": {
372
374
  "200": {
@@ -623,6 +625,7 @@
623
625
  "Metadata"
624
626
  ],
625
627
  "requestBody": {
628
+ "required": true,
626
629
  "content": {
627
630
  "application/json": {
628
631
  "schema": {
@@ -637,8 +640,7 @@
637
640
  }
638
641
  }
639
642
  }
640
- },
641
- "required": true
643
+ }
642
644
  },
643
645
  "responses": {
644
646
  "200": {
@@ -1069,6 +1071,7 @@
1069
1071
  "Permissions"
1070
1072
  ],
1071
1073
  "requestBody": {
1074
+ "required": true,
1072
1075
  "content": {
1073
1076
  "application/json": {
1074
1077
  "schema": {
@@ -1245,6 +1248,7 @@
1245
1248
  "Permissions"
1246
1249
  ],
1247
1250
  "requestBody": {
1251
+ "required": true,
1248
1252
  "content": {
1249
1253
  "application/json": {
1250
1254
  "schema": {
@@ -1263,8 +1267,7 @@
1263
1267
  }
1264
1268
  }
1265
1269
  }
1266
- },
1267
- "required": true
1270
+ }
1268
1271
  },
1269
1272
  "responses": {
1270
1273
  "4XX": {
@@ -1462,6 +1465,7 @@
1462
1465
  "SupportPermissions"
1463
1466
  ],
1464
1467
  "requestBody": {
1468
+ "required": true,
1465
1469
  "content": {
1466
1470
  "application/json": {
1467
1471
  "schema": {
@@ -15,7 +15,7 @@ export interface paths {
15
15
  path?: never;
16
16
  cookie?: never;
17
17
  };
18
- requestBody?: {
18
+ requestBody: {
19
19
  content: {
20
20
  "multipart/form-data": unknown | unknown;
21
21
  };
@@ -159,7 +159,7 @@ export interface paths {
159
159
  path?: never;
160
160
  cookie?: never;
161
161
  };
162
- requestBody?: {
162
+ requestBody: {
163
163
  content: {
164
164
  "multipart/form-data": unknown | unknown;
165
165
  };
@@ -687,7 +687,7 @@ export interface paths {
687
687
  path?: never;
688
688
  cookie?: never;
689
689
  };
690
- requestBody?: {
690
+ requestBody: {
691
691
  content: {
692
692
  "application/json": {
693
693
  fileId: string;
@@ -821,7 +821,7 @@ export interface paths {
821
821
  path?: never;
822
822
  cookie?: never;
823
823
  };
824
- requestBody?: {
824
+ requestBody: {
825
825
  content: {
826
826
  "application/json": {
827
827
  fileId: string;