@ogcio/building-blocks-sdk 0.2.87 → 0.2.89

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.
@@ -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;
@@ -470,6 +556,22 @@ export interface paths {
470
556
  patch?: never;
471
557
  trace?: never;
472
558
  };
559
+ "/api/v1/support/profiles/search": {
560
+ parameters: {
561
+ query?: never;
562
+ header?: never;
563
+ path?: never;
564
+ cookie?: never;
565
+ };
566
+ get?: never;
567
+ put?: never;
568
+ post: operations["searchSupportProfiles"];
569
+ delete?: never;
570
+ options?: never;
571
+ head?: never;
572
+ patch?: never;
573
+ trace?: never;
574
+ };
473
575
  "/user-login-wh": {
474
576
  parameters: {
475
577
  query?: never;
@@ -2252,6 +2354,218 @@ export interface operations {
2252
2354
  };
2253
2355
  };
2254
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
+ };
2255
2569
  getLifecycleTasks: {
2256
2570
  parameters: {
2257
2571
  query?: never;
@@ -4485,6 +4799,177 @@ export interface operations {
4485
4799
  };
4486
4800
  };
4487
4801
  };
4802
+ searchSupportProfiles: {
4803
+ parameters: {
4804
+ query?: never;
4805
+ header?: never;
4806
+ path?: never;
4807
+ cookie?: never;
4808
+ };
4809
+ requestBody: {
4810
+ content: {
4811
+ "application/json": {
4812
+ /** @default [] */
4813
+ name?: string[];
4814
+ /** @default [] */
4815
+ email?: string[];
4816
+ /** @default [] */
4817
+ ppsn?: string[];
4818
+ /** @default [] */
4819
+ dateOfBirth?: {
4820
+ /**
4821
+ * Format: date
4822
+ * @description If set, the endpoint searches for users whose date of birth is from this date (inclusive)
4823
+ */
4824
+ from?: string;
4825
+ /**
4826
+ * Format: date
4827
+ * @description If set, the endpoint searches for users whose date of birth is to this date (inclusive)
4828
+ */
4829
+ to?: string;
4830
+ }[];
4831
+ /** @default [] */
4832
+ id?: string[];
4833
+ /** @default and */
4834
+ logicalOperator?: "and" | "or";
4835
+ /**
4836
+ * @description Indicates where to start fetching data or how many records to skip, defining the initial position within the list
4837
+ * @default 0
4838
+ */
4839
+ offset?: string;
4840
+ /**
4841
+ * @description Indicates the maximum number (100) of items that will be returned in a single request
4842
+ * @default 20
4843
+ */
4844
+ limit?: string;
4845
+ };
4846
+ };
4847
+ };
4848
+ responses: {
4849
+ /** @description Default Response */
4850
+ 200: {
4851
+ headers: {
4852
+ [name: string]: unknown;
4853
+ };
4854
+ content: {
4855
+ "application/json": {
4856
+ data: {
4857
+ id: string;
4858
+ publicName: string;
4859
+ email: string;
4860
+ organisationId: string | null;
4861
+ ppsn: string | null;
4862
+ dateOfBirth: string | null;
4863
+ primaryUserId: string;
4864
+ /** Format: date-time */
4865
+ createdAt: string;
4866
+ /** Format: date-time */
4867
+ updatedAt: string;
4868
+ deletedAt: string | null;
4869
+ /** @description The preferred language of the user, in ISO 639-1 format */
4870
+ preferredLanguage: string;
4871
+ /** @description The status of the user, either 'active' or 'disabled' or 'deleted' */
4872
+ status: string;
4873
+ /** @description The safe level of the user */
4874
+ safeLevel: number;
4875
+ consentStatuses: {
4876
+ [key: string]: {
4877
+ status: "pending" | "undefined" | "pre-approved" | "opted-out" | "opted-in";
4878
+ /** Format: uuid */
4879
+ consent_statement_id: string;
4880
+ };
4881
+ };
4882
+ firstName: string | null;
4883
+ lastName: string | null;
4884
+ }[];
4885
+ metadata?: {
4886
+ /** @description Object containing the links to the related endpoints */
4887
+ links?: {
4888
+ self: {
4889
+ /** @description URL pointing to the request itself */
4890
+ href?: string;
4891
+ };
4892
+ next?: {
4893
+ /** @description URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted */
4894
+ href?: string;
4895
+ };
4896
+ prev?: {
4897
+ /** @description URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted */
4898
+ href?: string;
4899
+ };
4900
+ first: {
4901
+ /** @description URL pointing to the first page of results in a paginated response */
4902
+ href?: string;
4903
+ };
4904
+ last: {
4905
+ /** @description URL pointing to the first page of results in a paginated response */
4906
+ href?: string;
4907
+ };
4908
+ /** @description It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2' */
4909
+ pages: {
4910
+ [key: string]: {
4911
+ href?: string;
4912
+ };
4913
+ };
4914
+ };
4915
+ /** @description Number representing the total number of available items */
4916
+ totalCount?: number;
4917
+ };
4918
+ };
4919
+ };
4920
+ };
4921
+ /** @description Default Response */
4922
+ "4XX": {
4923
+ headers: {
4924
+ [name: string]: unknown;
4925
+ };
4926
+ content: {
4927
+ "application/json": {
4928
+ /** @description Code used to categorize the error */
4929
+ code: string;
4930
+ /** @description Description of the error */
4931
+ detail: string;
4932
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
4933
+ requestId: string;
4934
+ /** @description Name of the error type */
4935
+ name: string;
4936
+ /** @description List of the validation errors */
4937
+ validation?: {
4938
+ fieldName: string;
4939
+ message: string;
4940
+ }[];
4941
+ validationContext?: string;
4942
+ statusCode: number;
4943
+ };
4944
+ };
4945
+ };
4946
+ /** @description Default Response */
4947
+ "5XX": {
4948
+ headers: {
4949
+ [name: string]: unknown;
4950
+ };
4951
+ content: {
4952
+ "application/json": {
4953
+ /** @description Code used to categorize the error */
4954
+ code: string;
4955
+ /** @description Description of the error */
4956
+ detail: string;
4957
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
4958
+ requestId: string;
4959
+ /** @description Name of the error type */
4960
+ name: string;
4961
+ /** @description List of the validation errors */
4962
+ validation?: {
4963
+ fieldName: string;
4964
+ message: string;
4965
+ }[];
4966
+ validationContext?: string;
4967
+ statusCode: number;
4968
+ };
4969
+ };
4970
+ };
4971
+ };
4972
+ };
4488
4973
  logtoUserCreated: {
4489
4974
  parameters: {
4490
4975
  query?: never;
@@ -0,0 +1,51 @@
1
+ import type createClient from "openapi-fetch";
2
+ import type { Logger } from "../../../types/index.js";
3
+ import { formatError, formatResponse } from "../../utils/client-utils.js";
4
+ import type { paths } from "./schema.js";
5
+
6
+ export class ProfileSupport {
7
+ constructor(
8
+ private readonly client: ReturnType<typeof createClient<paths>>,
9
+ private readonly serviceName: string,
10
+ private readonly logger: Logger | undefined,
11
+ ) {}
12
+
13
+ async postProfileSearch(
14
+ body: paths["/api/v1/support/profiles/search"]["post"]["requestBody"]["content"]["application/json"],
15
+ ) {
16
+ return this.client
17
+ .POST("/api/v1/support/profiles/search", {
18
+ body,
19
+ })
20
+ .then(
21
+ (response) => formatResponse(response, this.serviceName, this.logger),
22
+ (reason) => formatError(reason, this.serviceName, this.logger),
23
+ );
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
+ }
51
+ }
@@ -22,7 +22,7 @@
22
22
  "messaging:template:*",
23
23
  "messaging:event:read"
24
24
  ],
25
- "updateDefinitions": true
25
+ "updateDefinitions": false
26
26
  },
27
27
  {
28
28
  "name": "upload",
@@ -30,7 +30,7 @@
30
30
  "openApiDefinitionFormat": "yaml",
31
31
  "citizenPermissions": ["upload:file.self:write", "upload:file.self:read"],
32
32
  "publicServantPermissions": ["upload:file:*", "profile:user:read"],
33
- "updateDefinitions": true
33
+ "updateDefinitions": false
34
34
  },
35
35
  {
36
36
  "name": "payments",
@@ -56,11 +56,11 @@
56
56
  "openApiDefinitionFormat": "yaml",
57
57
  "citizenPermissions": ["scheduler:jobs:write"],
58
58
  "publicServantPermissions": ["scheduler:jobs:write"],
59
- "updateDefinitions": true
59
+ "updateDefinitions": false
60
60
  },
61
61
  {
62
62
  "name": "profile",
63
- "openApiDefinitionUrl": "https://raw.githubusercontent.com/ogcio/govie-services-profile/refs/heads/dev/apps/profile-api/openapi-definition.yml",
63
+ "openApiDefinitionUrl": "http://localhost:8003/docs/yaml",
64
64
  "openApiDefinitionFormat": "yaml",
65
65
  "citizenPermissions": [
66
66
  "profile:user.self:read",
@@ -75,7 +75,7 @@
75
75
  "openApiDefinitionFormat": "json",
76
76
  "citizenPermissions": [],
77
77
  "publicServantPermissions": [],
78
- "updateDefinitions": true
78
+ "updateDefinitions": false
79
79
  },
80
80
  {
81
81
  "name": "journey",
@@ -91,7 +91,7 @@
91
91
  "integrator:step:*",
92
92
  "integrator:run:read"
93
93
  ],
94
- "updateDefinitions": true
94
+ "updateDefinitions": false
95
95
  },
96
96
  {
97
97
  "name": "auditCollector",
@@ -99,7 +99,7 @@
99
99
  "openApiDefinitionFormat": "yaml",
100
100
  "citizenPermissions": [],
101
101
  "publicServantPermissions": [],
102
- "updateDefinitions": true
102
+ "updateDefinitions": false
103
103
  }
104
104
  ]
105
105
  }
@@ -45,7 +45,7 @@ export async function readConfigurationFile(
45
45
  const { default: rawConfigurationFile } = await import(
46
46
  configurationFilePath,
47
47
  {
48
- assert: {
48
+ with: {
49
49
  type: "json",
50
50
  },
51
51
  }