@ogcio/building-blocks-sdk 0.2.83 → 0.2.85

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 (42) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/dist/client/clients/messaging/index.d.ts +8 -0
  4. package/dist/client/clients/messaging/index.d.ts.map +1 -1
  5. package/dist/client/clients/messaging/index.js +7 -1
  6. package/dist/client/clients/messaging/index.js.map +1 -1
  7. package/dist/client/clients/messaging/schema.d.ts +154 -0
  8. package/dist/client/clients/messaging/schema.d.ts.map +1 -1
  9. package/dist/client/clients/messaging/support.d.ts +125 -0
  10. package/dist/client/clients/messaging/support.d.ts.map +1 -0
  11. package/dist/client/clients/messaging/support.js +20 -0
  12. package/dist/client/clients/messaging/support.js.map +1 -0
  13. package/dist/client/clients/profile/citizen.d.ts.map +1 -1
  14. package/dist/client/clients/profile/index.d.ts +13 -79
  15. package/dist/client/clients/profile/index.d.ts.map +1 -1
  16. package/dist/client/clients/profile/index.js +13 -20
  17. package/dist/client/clients/profile/index.js.map +1 -1
  18. package/dist/client/clients/profile/organisation.d.ts.map +1 -1
  19. package/dist/client/clients/profile/schema.d.ts +3 -89
  20. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  21. package/dist/client/clients/upload/index.d.ts +8 -0
  22. package/dist/client/clients/upload/index.d.ts.map +1 -1
  23. package/dist/client/clients/upload/index.js +7 -1
  24. package/dist/client/clients/upload/index.js.map +1 -1
  25. package/dist/client/clients/upload/schema.d.ts +321 -0
  26. package/dist/client/clients/upload/schema.d.ts.map +1 -1
  27. package/dist/client/clients/upload/support.d.ts +224 -0
  28. package/dist/client/clients/upload/support.d.ts.map +1 -0
  29. package/dist/client/clients/upload/support.js +89 -0
  30. package/dist/client/clients/upload/support.js.map +1 -0
  31. package/package.json +1 -1
  32. package/src/client/clients/messaging/index.ts +20 -1
  33. package/src/client/clients/messaging/open-api-definition.json +355 -0
  34. package/src/client/clients/messaging/schema.ts +154 -0
  35. package/src/client/clients/messaging/support.ts +27 -0
  36. package/src/client/clients/profile/index.ts +33 -35
  37. package/src/client/clients/profile/open-api-definition.json +23 -160
  38. package/src/client/clients/profile/schema.ts +3 -89
  39. package/src/client/clients/upload/index.ts +21 -1
  40. package/src/client/clients/upload/open-api-definition.json +621 -41
  41. package/src/client/clients/upload/schema.ts +321 -0
  42. package/src/client/clients/upload/support.ts +128 -0
@@ -0,0 +1,27 @@
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 MessagingSupport {
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 postMessagesSearch(
14
+ query: paths["/api/v1/support/messages/search"]["post"]["parameters"]["query"],
15
+ body: paths["/api/v1/support/messages/search"]["post"]["requestBody"]["content"]["application/json"],
16
+ ) {
17
+ return this.client
18
+ .POST("/api/v1/support/messages/search", {
19
+ params: { query },
20
+ body,
21
+ })
22
+ .then(
23
+ (response) => formatResponse(response, this.serviceName, this.logger),
24
+ (reason) => formatError(reason, this.serviceName, this.logger),
25
+ );
26
+ }
27
+ }
@@ -337,12 +337,17 @@ export class Profile extends BaseClient<paths> {
337
337
  "type"
338
338
  >,
339
339
  ) {
340
- return this.client.POST("/api/v1/lifecycle-tasks/", {
341
- body: { ...params, type: "export_user_data" },
342
- headers: {
343
- "Content-Type": "application/json",
344
- },
345
- });
340
+ return this.client
341
+ .POST("/api/v1/lifecycle-tasks/", {
342
+ body: { ...params, type: "export_user_data" },
343
+ headers: {
344
+ "Content-Type": "application/json",
345
+ },
346
+ })
347
+ .then(
348
+ (response) => formatResponse(response, this.serviceName, this.logger),
349
+ (reason) => formatError(reason, this.serviceName, this.logger),
350
+ );
346
351
  }
347
352
 
348
353
  async createDeleteProfileLifecycleTask(
@@ -351,39 +356,32 @@ export class Profile extends BaseClient<paths> {
351
356
  "type"
352
357
  >,
353
358
  ) {
354
- return this.client.POST("/api/v1/lifecycle-tasks/", {
355
- body: { ...params, type: "delete_profile" },
356
- headers: {
357
- "Content-Type": "application/json",
358
- },
359
- });
359
+ return this.client
360
+ .POST("/api/v1/lifecycle-tasks/", {
361
+ body: { ...params, type: "delete_profile" },
362
+ headers: {
363
+ "Content-Type": "application/json",
364
+ },
365
+ })
366
+ .then(
367
+ (response) => formatResponse(response, this.serviceName, this.logger),
368
+ (reason) => formatError(reason, this.serviceName, this.logger),
369
+ );
360
370
  }
361
371
 
362
372
  async getLifecycleTasks(
363
- params: paths["/api/v1/lifecycle-tasks/search"]["post"]["requestBody"]["content"]["application/json"] = {},
373
+ params: paths["/api/v1/lifecycle-tasks/search"]["post"]["requestBody"]["content"]["application/json"],
364
374
  ) {
365
- return this.client.POST("/api/v1/lifecycle-tasks/search", {
366
- body: params,
367
- headers: {
368
- "Content-Type": "application/json",
369
- },
370
- });
371
- }
372
-
373
- async downloadLifecycleTaskContext(params: {
374
- profileId: string;
375
- lifecycleTaskId: string;
376
- }) {
377
- return this.client.GET("/api/v1/lifecycle-tasks/{id}/action", {
378
- params: {
379
- path: {
380
- id: params.lifecycleTaskId,
381
- },
382
- query: {
383
- profileId: params.profileId,
384
- q: "download",
375
+ return this.client
376
+ .POST("/api/v1/lifecycle-tasks/search", {
377
+ body: params,
378
+ headers: {
379
+ "Content-Type": "application/json",
385
380
  },
386
- },
387
- });
381
+ })
382
+ .then(
383
+ (response) => formatResponse(response, this.serviceName, this.logger),
384
+ (reason) => formatError(reason, this.serviceName, this.logger),
385
+ );
388
386
  }
389
387
  }
@@ -5271,6 +5271,22 @@
5271
5271
  "properties": {
5272
5272
  "profileId": {
5273
5273
  "type": "string"
5274
+ },
5275
+ "taskType": {
5276
+ "anyOf": [
5277
+ {
5278
+ "type": "string",
5279
+ "enum": [
5280
+ "delete_profile"
5281
+ ]
5282
+ },
5283
+ {
5284
+ "type": "string",
5285
+ "enum": [
5286
+ "export_user_data"
5287
+ ]
5288
+ }
5289
+ ]
5274
5290
  }
5275
5291
  }
5276
5292
  }
@@ -5363,6 +5379,9 @@
5363
5379
  "expiresAt": {
5364
5380
  "format": "date-time",
5365
5381
  "type": "string"
5382
+ },
5383
+ "uploadId": {
5384
+ "type": "string"
5366
5385
  }
5367
5386
  }
5368
5387
  },
@@ -5539,6 +5558,10 @@
5539
5558
  },
5540
5559
  "profileId": {
5541
5560
  "type": "string"
5561
+ },
5562
+ "requesterUserId": {
5563
+ "minLength": 1,
5564
+ "type": "string"
5542
5565
  }
5543
5566
  }
5544
5567
  }
@@ -5696,166 +5719,6 @@
5696
5719
  }
5697
5720
  }
5698
5721
  },
5699
- "/api/v1/lifecycle-tasks/{id}/action": {
5700
- "get": {
5701
- "operationId": "getDownload",
5702
- "tags": [
5703
- "Lifecycle Tasks"
5704
- ],
5705
- "parameters": [
5706
- {
5707
- "schema": {
5708
- "type": "string"
5709
- },
5710
- "in": "query",
5711
- "name": "profileId",
5712
- "required": true
5713
- },
5714
- {
5715
- "schema": {
5716
- "type": "string"
5717
- },
5718
- "in": "query",
5719
- "name": "q",
5720
- "required": true
5721
- },
5722
- {
5723
- "schema": {
5724
- "format": "uuid",
5725
- "type": "string"
5726
- },
5727
- "in": "path",
5728
- "name": "id",
5729
- "required": true
5730
- }
5731
- ],
5732
- "responses": {
5733
- "302": {
5734
- "description": "Default Response"
5735
- },
5736
- "4XX": {
5737
- "description": "Default Response",
5738
- "content": {
5739
- "application/json": {
5740
- "schema": {
5741
- "type": "object",
5742
- "required": [
5743
- "code",
5744
- "detail",
5745
- "requestId",
5746
- "name",
5747
- "statusCode"
5748
- ],
5749
- "properties": {
5750
- "code": {
5751
- "description": "Code used to categorize the error",
5752
- "type": "string"
5753
- },
5754
- "detail": {
5755
- "description": "Description of the error",
5756
- "type": "string"
5757
- },
5758
- "requestId": {
5759
- "description": "Unique request id. This one will be used to troubleshoot the problems",
5760
- "type": "string"
5761
- },
5762
- "name": {
5763
- "description": "Name of the error type",
5764
- "type": "string"
5765
- },
5766
- "validation": {
5767
- "description": "List of the validation errors",
5768
- "type": "array",
5769
- "items": {
5770
- "type": "object",
5771
- "required": [
5772
- "fieldName",
5773
- "message"
5774
- ],
5775
- "properties": {
5776
- "fieldName": {
5777
- "type": "string"
5778
- },
5779
- "message": {
5780
- "type": "string"
5781
- }
5782
- }
5783
- }
5784
- },
5785
- "validationContext": {
5786
- "type": "string"
5787
- },
5788
- "statusCode": {
5789
- "type": "number"
5790
- }
5791
- }
5792
- }
5793
- }
5794
- }
5795
- },
5796
- "5XX": {
5797
- "description": "Default Response",
5798
- "content": {
5799
- "application/json": {
5800
- "schema": {
5801
- "type": "object",
5802
- "required": [
5803
- "code",
5804
- "detail",
5805
- "requestId",
5806
- "name",
5807
- "statusCode"
5808
- ],
5809
- "properties": {
5810
- "code": {
5811
- "description": "Code used to categorize the error",
5812
- "type": "string"
5813
- },
5814
- "detail": {
5815
- "description": "Description of the error",
5816
- "type": "string"
5817
- },
5818
- "requestId": {
5819
- "description": "Unique request id. This one will be used to troubleshoot the problems",
5820
- "type": "string"
5821
- },
5822
- "name": {
5823
- "description": "Name of the error type",
5824
- "type": "string"
5825
- },
5826
- "validation": {
5827
- "description": "List of the validation errors",
5828
- "type": "array",
5829
- "items": {
5830
- "type": "object",
5831
- "required": [
5832
- "fieldName",
5833
- "message"
5834
- ],
5835
- "properties": {
5836
- "fieldName": {
5837
- "type": "string"
5838
- },
5839
- "message": {
5840
- "type": "string"
5841
- }
5842
- }
5843
- }
5844
- },
5845
- "validationContext": {
5846
- "type": "string"
5847
- },
5848
- "statusCode": {
5849
- "type": "number"
5850
- }
5851
- }
5852
- }
5853
- }
5854
- }
5855
- }
5856
- }
5857
- }
5858
- },
5859
5722
  "/api/v1/organisations/profiles/{profileId}": {
5860
5723
  "patch": {
5861
5724
  "operationId": "adminProfilesPatch",
@@ -307,22 +307,6 @@ export interface paths {
307
307
  patch?: never;
308
308
  trace?: never;
309
309
  };
310
- "/api/v1/lifecycle-tasks/{id}/action": {
311
- parameters: {
312
- query?: never;
313
- header?: never;
314
- path?: never;
315
- cookie?: never;
316
- };
317
- get: operations["getDownload"];
318
- put?: never;
319
- post?: never;
320
- delete?: never;
321
- options?: never;
322
- head?: never;
323
- patch?: never;
324
- trace?: never;
325
- };
326
310
  "/api/v1/organisations/profiles/{profileId}": {
327
311
  parameters: {
328
312
  query?: never;
@@ -2279,6 +2263,7 @@ export interface operations {
2279
2263
  content: {
2280
2264
  "application/json": {
2281
2265
  profileId?: string;
2266
+ taskType?: "delete_profile" | "export_user_data";
2282
2267
  };
2283
2268
  };
2284
2269
  };
@@ -2299,6 +2284,7 @@ export interface operations {
2299
2284
  metadata: {
2300
2285
  /** Format: date-time */
2301
2286
  expiresAt?: string;
2287
+ uploadId?: string;
2302
2288
  } | null;
2303
2289
  }[];
2304
2290
  };
@@ -2369,6 +2355,7 @@ export interface operations {
2369
2355
  "application/json": {
2370
2356
  type: "delete_profile" | "export_user_data";
2371
2357
  profileId: string;
2358
+ requesterUserId?: string;
2372
2359
  };
2373
2360
  };
2374
2361
  };
@@ -2439,79 +2426,6 @@ export interface operations {
2439
2426
  };
2440
2427
  };
2441
2428
  };
2442
- getDownload: {
2443
- parameters: {
2444
- query: {
2445
- profileId: string;
2446
- q: string;
2447
- };
2448
- header?: never;
2449
- path: {
2450
- id: string;
2451
- };
2452
- cookie?: never;
2453
- };
2454
- requestBody?: never;
2455
- responses: {
2456
- /** @description Default Response */
2457
- 302: {
2458
- headers: {
2459
- [name: string]: unknown;
2460
- };
2461
- content?: never;
2462
- };
2463
- /** @description Default Response */
2464
- "4XX": {
2465
- headers: {
2466
- [name: string]: unknown;
2467
- };
2468
- content: {
2469
- "application/json": {
2470
- /** @description Code used to categorize the error */
2471
- code: string;
2472
- /** @description Description of the error */
2473
- detail: string;
2474
- /** @description Unique request id. This one will be used to troubleshoot the problems */
2475
- requestId: string;
2476
- /** @description Name of the error type */
2477
- name: string;
2478
- /** @description List of the validation errors */
2479
- validation?: {
2480
- fieldName: string;
2481
- message: string;
2482
- }[];
2483
- validationContext?: string;
2484
- statusCode: number;
2485
- };
2486
- };
2487
- };
2488
- /** @description Default Response */
2489
- "5XX": {
2490
- headers: {
2491
- [name: string]: unknown;
2492
- };
2493
- content: {
2494
- "application/json": {
2495
- /** @description Code used to categorize the error */
2496
- code: string;
2497
- /** @description Description of the error */
2498
- detail: string;
2499
- /** @description Unique request id. This one will be used to troubleshoot the problems */
2500
- requestId: string;
2501
- /** @description Name of the error type */
2502
- name: string;
2503
- /** @description List of the validation errors */
2504
- validation?: {
2505
- fieldName: string;
2506
- message: string;
2507
- }[];
2508
- validationContext?: string;
2509
- statusCode: number;
2510
- };
2511
- };
2512
- };
2513
- };
2514
- };
2515
2429
  adminProfilesPatch: {
2516
2430
  parameters: {
2517
2431
  query?: never;
@@ -1,5 +1,9 @@
1
1
  import type createClient from "openapi-fetch";
2
- import { UPLOAD } from "../../../types/index.js";
2
+ import {
3
+ type Logger,
4
+ type TokenFunction,
5
+ UPLOAD,
6
+ } from "../../../types/index.js";
3
7
  import { BaseClient } from "../../base-client.js";
4
8
  import {
5
9
  formatError,
@@ -7,11 +11,27 @@ import {
7
11
  throwIfEmpty,
8
12
  } from "../../utils/client-utils.js";
9
13
  import type { paths } from "./schema.js";
14
+ import { UploadSupport } from "./support.js";
10
15
 
11
16
  export class Upload extends BaseClient<paths> {
12
17
  protected declare client: ReturnType<typeof createClient<paths>>;
13
18
  protected serviceName = UPLOAD;
14
19
 
20
+ public readonly support: UploadSupport;
21
+
22
+ constructor(params: {
23
+ baseUrl: string;
24
+ getTokenFn?: TokenFunction;
25
+ logger?: Logger;
26
+ }) {
27
+ super(params);
28
+ this.support = new UploadSupport(
29
+ this.client,
30
+ this.serviceName,
31
+ this.logger,
32
+ );
33
+ }
34
+
15
35
  getFilesMetadata({
16
36
  organizationId,
17
37
  userId,