@ogcio/building-blocks-sdk 0.2.88 → 0.2.90

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 (50) 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.map +1 -1
  17. package/dist/client/clients/profile/index.d.ts.map +1 -1
  18. package/dist/client/clients/profile/index.js +1 -1
  19. package/dist/client/clients/profile/index.js.map +1 -1
  20. package/dist/client/clients/profile/organisation.d.ts.map +1 -1
  21. package/dist/client/clients/profile/schema.d.ts +298 -0
  22. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  23. package/dist/client/clients/profile/support.d.ts +187 -0
  24. package/dist/client/clients/profile/support.d.ts.map +1 -1
  25. package/dist/client/clients/profile/support.js +14 -0
  26. package/dist/client/clients/profile/support.js.map +1 -1
  27. package/dist/client/clients/scheduler/schema.d.ts +1 -1
  28. package/dist/client/clients/scheduler/schema.d.ts.map +1 -1
  29. package/dist/client/clients/upload/index.d.ts +1 -1
  30. package/dist/client/clients/upload/index.d.ts.map +1 -1
  31. package/dist/client/clients/upload/schema.d.ts +4 -4
  32. package/dist/client/clients/upload/schema.d.ts.map +1 -1
  33. package/dist/client/clients/upload/support.d.ts +1 -1
  34. package/dist/client/clients/upload/support.d.ts.map +1 -1
  35. package/dist/clients-configurations/clients-configuration.json +7 -7
  36. package/package.json +7 -7
  37. package/renovate.json +1 -0
  38. package/src/client/clients/messaging/index.ts +39 -2
  39. package/src/client/clients/messaging/open-api-definition.json +3113 -1242
  40. package/src/client/clients/messaging/schema.ts +877 -2
  41. package/src/client/clients/messaging/tags.ts +86 -0
  42. package/src/client/clients/profile/index.ts +1 -1
  43. package/src/client/clients/profile/open-api-definition.json +49 -0
  44. package/src/client/clients/profile/schema.ts +298 -0
  45. package/src/client/clients/profile/support.ts +26 -0
  46. package/src/client/clients/scheduler/open-api-definition.json +33 -32
  47. package/src/client/clients/scheduler/schema.ts +1 -1
  48. package/src/client/clients/upload/open-api-definition.json +10 -6
  49. package/src/client/clients/upload/schema.ts +4 -4
  50. package/src/clients-configurations/clients-configuration.json +7 -7
@@ -0,0 +1,86 @@
1
+ import type createClient from "openapi-fetch";
2
+ import type { Logger } from "../../../types/index.js";
3
+ import {
4
+ formatError,
5
+ formatResponse,
6
+ throwIfEmpty,
7
+ } from "../../utils/client-utils.js";
8
+ import type { paths } from "./schema.js";
9
+
10
+ export class MessagingTags {
11
+ constructor(
12
+ private readonly client: ReturnType<typeof createClient<paths>>,
13
+ private readonly serviceName: string,
14
+ private readonly logger: Logger | undefined,
15
+ ) {}
16
+
17
+ async assignToMessages(
18
+ body: paths["/api/v1/messages/tags"]["post"]["requestBody"]["content"]["application/json"],
19
+ ) {
20
+ return this.client
21
+ .POST("/api/v1/messages/tags", {
22
+ body,
23
+ })
24
+ .then(
25
+ (response) => formatResponse(response, this.serviceName, this.logger),
26
+ (reason) => formatError(reason, this.serviceName, this.logger),
27
+ );
28
+ }
29
+
30
+ async getAll() {
31
+ return this.client.GET("/api/v1/tags/", {}).then(
32
+ (response) => formatResponse(response, this.serviceName, this.logger),
33
+ (reason) => formatError(reason, this.serviceName, this.logger),
34
+ );
35
+ }
36
+
37
+ async getTree() {
38
+ return this.client.GET("/api/v1/tags/tree", {}).then(
39
+ (response) => formatResponse(response, this.serviceName, this.logger),
40
+ (reason) => formatError(reason, this.serviceName, this.logger),
41
+ );
42
+ }
43
+
44
+ async create(
45
+ body: paths["/api/v1/tags/"]["post"]["requestBody"]["content"]["application/json"],
46
+ ) {
47
+ return this.client
48
+ .POST("/api/v1/tags/", {
49
+ body,
50
+ })
51
+ .then(
52
+ (response) => formatResponse(response, this.serviceName, this.logger),
53
+ (reason) => formatError(reason, this.serviceName, this.logger),
54
+ );
55
+ }
56
+
57
+ async update(
58
+ tagId: paths["/api/v1/tags/{tagId}"]["patch"]["parameters"]["path"]["tagId"],
59
+ body: paths["/api/v1/tags/{tagId}"]["patch"]["requestBody"]["content"]["application/json"],
60
+ ) {
61
+ throwIfEmpty(tagId);
62
+ return this.client
63
+ .PATCH("/api/v1/tags/{tagId}", {
64
+ params: { path: { tagId } },
65
+ body,
66
+ })
67
+ .then(
68
+ (response) => formatResponse(response, this.serviceName, this.logger),
69
+ (reason) => formatError(reason, this.serviceName, this.logger),
70
+ );
71
+ }
72
+
73
+ async delete(
74
+ tagId: paths["/api/v1/tags/{tagId}"]["delete"]["parameters"]["path"]["tagId"],
75
+ ) {
76
+ throwIfEmpty(tagId);
77
+ return this.client
78
+ .DELETE("/api/v1/tags/{tagId}", {
79
+ params: { path: { tagId } },
80
+ })
81
+ .then(
82
+ (response) => formatResponse(response, this.serviceName, this.logger),
83
+ (reason) => formatError(reason, this.serviceName, this.logger),
84
+ );
85
+ }
86
+ }
@@ -238,7 +238,7 @@ export class Profile extends BaseClient<paths> {
238
238
  params: { query },
239
239
  bodySerializer: (body: unknown) => {
240
240
  const parsed = body as { file?: File } | undefined;
241
- if (!parsed || !parsed.file) {
241
+ if (!parsed?.file) {
242
242
  throw createError.BadRequest("File is missing!");
243
243
  }
244
244
  const formData = new FormData();
@@ -5719,6 +5719,55 @@
5719
5719
  }
5720
5720
  }
5721
5721
  },
5722
+ "/api/v1/onboarding/": {
5723
+ "post": {
5724
+ "tags": [
5725
+ "Onboarding"
5726
+ ],
5727
+ "description": "Check SAFE level and assign the onboarded-citizen role to the authenticated user",
5728
+ "responses": {
5729
+ "200": {
5730
+ "description": "Default Response",
5731
+ "content": {
5732
+ "application/json": {
5733
+ "schema": {
5734
+ "type": "object",
5735
+ "properties": {
5736
+ "success": {
5737
+ "type": "boolean"
5738
+ },
5739
+ "safeLevel": {
5740
+ "type": "number"
5741
+ }
5742
+ }
5743
+ }
5744
+ }
5745
+ }
5746
+ },
5747
+ "403": {
5748
+ "description": "Default Response",
5749
+ "content": {
5750
+ "application/json": {
5751
+ "schema": {
5752
+ "type": "object",
5753
+ "properties": {
5754
+ "error": {
5755
+ "type": "string"
5756
+ },
5757
+ "safeLevel": {
5758
+ "type": "number"
5759
+ },
5760
+ "required": {
5761
+ "type": "number"
5762
+ }
5763
+ }
5764
+ }
5765
+ }
5766
+ }
5767
+ }
5768
+ }
5769
+ }
5770
+ },
5722
5771
  "/api/v1/organisations/profiles/{profileId}": {
5723
5772
  "patch": {
5724
5773
  "operationId": "adminProfilesPatch",
@@ -172,6 +172,40 @@ export interface paths {
172
172
  patch?: never;
173
173
  trace?: never;
174
174
  };
175
+ "/api/v1/support/consents/latest": {
176
+ parameters: {
177
+ query?: never;
178
+ header?: never;
179
+ path?: never;
180
+ cookie?: never;
181
+ };
182
+ /** @description Get the latest consent for all available subjects for a user */
183
+ get: operations["supportLatestConsent"];
184
+ put?: never;
185
+ post?: never;
186
+ delete?: never;
187
+ options?: never;
188
+ head?: never;
189
+ patch?: never;
190
+ trace?: never;
191
+ };
192
+ "/api/v1/support/consents/": {
193
+ parameters: {
194
+ query?: never;
195
+ header?: never;
196
+ path?: never;
197
+ cookie?: never;
198
+ };
199
+ get?: never;
200
+ put?: never;
201
+ /** @description Submit consents for the logged in user */
202
+ post: operations["supportSubmitConsents"];
203
+ delete?: never;
204
+ options?: never;
205
+ head?: never;
206
+ patch?: never;
207
+ trace?: never;
208
+ };
175
209
  "/api/v1/jobs/import-profiles/{profileImportId}": {
176
210
  parameters: {
177
211
  query?: never;
@@ -307,6 +341,58 @@ export interface paths {
307
341
  patch?: never;
308
342
  trace?: never;
309
343
  };
344
+ "/api/v1/onboarding/": {
345
+ parameters: {
346
+ query?: never;
347
+ header?: never;
348
+ path?: never;
349
+ cookie?: never;
350
+ };
351
+ get?: never;
352
+ put?: never;
353
+ /** @description Check SAFE level and assign the onboarded-citizen role to the authenticated user */
354
+ post: {
355
+ parameters: {
356
+ query?: never;
357
+ header?: never;
358
+ path?: never;
359
+ cookie?: never;
360
+ };
361
+ requestBody?: never;
362
+ responses: {
363
+ /** @description Default Response */
364
+ 200: {
365
+ headers: {
366
+ [name: string]: unknown;
367
+ };
368
+ content: {
369
+ "application/json": {
370
+ success?: boolean;
371
+ safeLevel?: number;
372
+ };
373
+ };
374
+ };
375
+ /** @description Default Response */
376
+ 403: {
377
+ headers: {
378
+ [name: string]: unknown;
379
+ };
380
+ content: {
381
+ "application/json": {
382
+ error?: string;
383
+ safeLevel?: number;
384
+ required?: number;
385
+ };
386
+ };
387
+ };
388
+ };
389
+ };
390
+ delete?: never;
391
+ options?: never;
392
+ head?: never;
393
+ patch?: never;
394
+ trace?: never;
395
+ };
310
396
  "/api/v1/organisations/profiles/{profileId}": {
311
397
  parameters: {
312
398
  query?: never;
@@ -2268,6 +2354,218 @@ export interface operations {
2268
2354
  };
2269
2355
  };
2270
2356
  };
2357
+ supportLatestConsent: {
2358
+ parameters: {
2359
+ query: {
2360
+ profileId: string;
2361
+ };
2362
+ header?: never;
2363
+ path?: never;
2364
+ cookie?: never;
2365
+ };
2366
+ requestBody?: never;
2367
+ responses: {
2368
+ /** @description Default Response */
2369
+ 200: {
2370
+ headers: {
2371
+ [name: string]: unknown;
2372
+ };
2373
+ content: {
2374
+ "application/json": {
2375
+ data: {
2376
+ availableSubjects: string[];
2377
+ consents: {
2378
+ /** Format: uuid */
2379
+ id: string;
2380
+ profileId: string;
2381
+ status: "pending" | "undefined" | "pre-approved" | "opted-out" | "opted-in";
2382
+ subject: string;
2383
+ createdAt: string;
2384
+ /** Format: uuid */
2385
+ consentStatementId: string;
2386
+ }[];
2387
+ };
2388
+ metadata?: {
2389
+ /** @description Object containing the links to the related endpoints */
2390
+ links?: {
2391
+ self: {
2392
+ /** @description URL pointing to the request itself */
2393
+ href?: string;
2394
+ };
2395
+ next?: {
2396
+ /** @description URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted */
2397
+ href?: string;
2398
+ };
2399
+ prev?: {
2400
+ /** @description URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted */
2401
+ href?: string;
2402
+ };
2403
+ first: {
2404
+ /** @description URL pointing to the first page of results in a paginated response */
2405
+ href?: string;
2406
+ };
2407
+ last: {
2408
+ /** @description URL pointing to the first page of results in a paginated response */
2409
+ href?: string;
2410
+ };
2411
+ /** @description It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2' */
2412
+ pages: {
2413
+ [key: string]: {
2414
+ href?: string;
2415
+ };
2416
+ };
2417
+ };
2418
+ /** @description Number representing the total number of available items */
2419
+ totalCount?: number;
2420
+ };
2421
+ };
2422
+ };
2423
+ };
2424
+ /** @description Default Response */
2425
+ "4XX": {
2426
+ headers: {
2427
+ [name: string]: unknown;
2428
+ };
2429
+ content: {
2430
+ "application/json": {
2431
+ /** @description Code used to categorize the error */
2432
+ code: string;
2433
+ /** @description Description of the error */
2434
+ detail: string;
2435
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2436
+ requestId: string;
2437
+ /** @description Name of the error type */
2438
+ name: string;
2439
+ /** @description List of the validation errors */
2440
+ validation?: {
2441
+ fieldName: string;
2442
+ message: string;
2443
+ }[];
2444
+ validationContext?: string;
2445
+ statusCode: number;
2446
+ };
2447
+ };
2448
+ };
2449
+ /** @description Default Response */
2450
+ "5XX": {
2451
+ headers: {
2452
+ [name: string]: unknown;
2453
+ };
2454
+ content: {
2455
+ "application/json": {
2456
+ /** @description Code used to categorize the error */
2457
+ code: string;
2458
+ /** @description Description of the error */
2459
+ detail: string;
2460
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2461
+ requestId: string;
2462
+ /** @description Name of the error type */
2463
+ name: string;
2464
+ /** @description List of the validation errors */
2465
+ validation?: {
2466
+ fieldName: string;
2467
+ message: string;
2468
+ }[];
2469
+ validationContext?: string;
2470
+ statusCode: number;
2471
+ };
2472
+ };
2473
+ };
2474
+ };
2475
+ };
2476
+ supportSubmitConsents: {
2477
+ parameters: {
2478
+ query?: never;
2479
+ header?: never;
2480
+ path?: never;
2481
+ cookie?: never;
2482
+ };
2483
+ requestBody: {
2484
+ content: {
2485
+ "application/json": {
2486
+ profileId: string;
2487
+ consents: {
2488
+ subject: string;
2489
+ status: "pending" | "undefined" | "pre-approved" | "opted-out" | "opted-in";
2490
+ }[];
2491
+ };
2492
+ };
2493
+ };
2494
+ responses: {
2495
+ /** @description Default Response */
2496
+ 201: {
2497
+ headers: {
2498
+ [name: string]: unknown;
2499
+ };
2500
+ content: {
2501
+ "application/json": {
2502
+ data: {
2503
+ /** Format: uuid */
2504
+ id: string;
2505
+ subject: string;
2506
+ status: "pending" | "undefined" | "pre-approved" | "opted-out" | "opted-in";
2507
+ /** Format: date-time */
2508
+ submittedAt: string;
2509
+ /** Format: uuid */
2510
+ consentStatementId: string;
2511
+ statementVersion: number;
2512
+ isLatestStatement: boolean;
2513
+ }[];
2514
+ };
2515
+ };
2516
+ };
2517
+ /** @description Default Response */
2518
+ "4XX": {
2519
+ headers: {
2520
+ [name: string]: unknown;
2521
+ };
2522
+ content: {
2523
+ "application/json": {
2524
+ /** @description Code used to categorize the error */
2525
+ code: string;
2526
+ /** @description Description of the error */
2527
+ detail: string;
2528
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2529
+ requestId: string;
2530
+ /** @description Name of the error type */
2531
+ name: string;
2532
+ /** @description List of the validation errors */
2533
+ validation?: {
2534
+ fieldName: string;
2535
+ message: string;
2536
+ }[];
2537
+ validationContext?: string;
2538
+ statusCode: number;
2539
+ };
2540
+ };
2541
+ };
2542
+ /** @description Default Response */
2543
+ "5XX": {
2544
+ headers: {
2545
+ [name: string]: unknown;
2546
+ };
2547
+ content: {
2548
+ "application/json": {
2549
+ /** @description Code used to categorize the error */
2550
+ code: string;
2551
+ /** @description Description of the error */
2552
+ detail: string;
2553
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2554
+ requestId: string;
2555
+ /** @description Name of the error type */
2556
+ name: string;
2557
+ /** @description List of the validation errors */
2558
+ validation?: {
2559
+ fieldName: string;
2560
+ message: string;
2561
+ }[];
2562
+ validationContext?: string;
2563
+ statusCode: number;
2564
+ };
2565
+ };
2566
+ };
2567
+ };
2568
+ };
2271
2569
  getLifecycleTasks: {
2272
2570
  parameters: {
2273
2571
  query?: never;
@@ -22,4 +22,30 @@ export class ProfileSupport {
22
22
  (reason) => formatError(reason, this.serviceName, this.logger),
23
23
  );
24
24
  }
25
+
26
+ async getLatestConsents(
27
+ query: paths["/api/v1/support/consents/latest"]["get"]["parameters"]["query"],
28
+ ) {
29
+ return this.client
30
+ .GET("/api/v1/support/consents/latest", {
31
+ params: { query },
32
+ })
33
+ .then(
34
+ (response) => formatResponse(response, this.serviceName, this.logger),
35
+ (reason) => formatError(reason, this.serviceName, this.logger),
36
+ );
37
+ }
38
+
39
+ async submitConsents(
40
+ body: paths["/api/v1/support/consents/"]["post"]["requestBody"]["content"]["application/json"],
41
+ ) {
42
+ return this.client
43
+ .POST("/api/v1/support/consents/", {
44
+ body,
45
+ })
46
+ .then(
47
+ (response) => formatResponse(response, this.serviceName, this.logger),
48
+ (reason) => formatError(reason, this.serviceName, this.logger),
49
+ );
50
+ }
25
51
  }
@@ -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 */