@ogcio/building-blocks-sdk 0.2.84 → 0.2.86

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 (52) 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 +7 -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 +1 -89
  20. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  21. package/dist/client/clients/upload/index.d.ts +23 -0
  22. package/dist/client/clients/upload/index.d.ts.map +1 -1
  23. package/dist/client/clients/upload/index.js +26 -36
  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/shared.d.ts +47 -0
  28. package/dist/client/clients/upload/shared.d.ts.map +1 -0
  29. package/dist/client/clients/upload/shared.js +72 -0
  30. package/dist/client/clients/upload/shared.js.map +1 -0
  31. package/dist/client/clients/upload/support.d.ts +239 -0
  32. package/dist/client/clients/upload/support.d.ts.map +1 -0
  33. package/dist/client/clients/upload/support.js +73 -0
  34. package/dist/client/clients/upload/support.js.map +1 -0
  35. package/dist/client/utils/client-utils.d.ts +9 -0
  36. package/dist/client/utils/client-utils.d.ts.map +1 -1
  37. package/dist/client/utils/client-utils.js +43 -0
  38. package/dist/client/utils/client-utils.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/client/clients/messaging/index.ts +20 -1
  41. package/src/client/clients/messaging/open-api-definition.json +355 -0
  42. package/src/client/clients/messaging/schema.ts +154 -0
  43. package/src/client/clients/messaging/support.ts +27 -0
  44. package/src/client/clients/profile/index.ts +33 -35
  45. package/src/client/clients/profile/open-api-definition.json +3 -163
  46. package/src/client/clients/profile/schema.ts +1 -89
  47. package/src/client/clients/upload/index.ts +56 -37
  48. package/src/client/clients/upload/open-api-definition.json +621 -41
  49. package/src/client/clients/upload/schema.ts +321 -0
  50. package/src/client/clients/upload/shared.ts +122 -0
  51. package/src/client/clients/upload/support.ts +127 -0
  52. package/src/client/utils/client-utils.ts +59 -0
@@ -5864,6 +5864,361 @@
5864
5864
  }
5865
5865
  }
5866
5866
  }
5867
+ },
5868
+ "/api/v1/support/messages/search": {
5869
+ "post": {
5870
+ "operationId": "SupportListMessagesPost",
5871
+ "tags": [
5872
+ "Messages Support"
5873
+ ],
5874
+ "description": "Returns all the messages for the requested organisation or the requested recipient",
5875
+ "requestBody": {
5876
+ "required": true,
5877
+ "content": {
5878
+ "application/json": {
5879
+ "schema": {
5880
+ "type": "object",
5881
+ "required": [
5882
+ "recipientUserIds"
5883
+ ],
5884
+ "properties": {
5885
+ "recipientUserIds": {
5886
+ "type": "array",
5887
+ "items": {
5888
+ "type": "string",
5889
+ "description": "Unique id of the recipient"
5890
+ },
5891
+ "description": "Filter messages by recipient user ids",
5892
+ "minItems": 1,
5893
+ "maxItems": 10
5894
+ }
5895
+ }
5896
+ }
5897
+ }
5898
+ }
5899
+ },
5900
+ "parameters": [
5901
+ {
5902
+ "schema": {
5903
+ "type": "string",
5904
+ "pattern": "^[0-9][0-9]*|undefined$",
5905
+ "default": "0"
5906
+ },
5907
+ "in": "query",
5908
+ "name": "offset",
5909
+ "required": false,
5910
+ "description": "Indicates where to start fetching data or how many records to skip, defining the initial position within the list"
5911
+ },
5912
+ {
5913
+ "schema": {
5914
+ "type": "string",
5915
+ "default": "20",
5916
+ "pattern": "^([1-9]|100)|undefined$"
5917
+ },
5918
+ "in": "query",
5919
+ "name": "limit",
5920
+ "required": false,
5921
+ "description": "Indicates the maximum number (100) of items that will be returned in a single request"
5922
+ }
5923
+ ],
5924
+ "responses": {
5925
+ "200": {
5926
+ "description": "Default Response",
5927
+ "content": {
5928
+ "application/json": {
5929
+ "schema": {
5930
+ "type": "object",
5931
+ "required": [
5932
+ "data"
5933
+ ],
5934
+ "properties": {
5935
+ "data": {
5936
+ "type": "array",
5937
+ "items": {
5938
+ "type": "object",
5939
+ "required": [
5940
+ "id",
5941
+ "organisationId",
5942
+ "recipientUserId",
5943
+ "threadName",
5944
+ "isSeen",
5945
+ "subject",
5946
+ "richText",
5947
+ "plainText",
5948
+ "createdAt",
5949
+ "scheduledAt",
5950
+ "attachmentIds"
5951
+ ],
5952
+ "properties": {
5953
+ "id": {
5954
+ "type": "string",
5955
+ "description": "Unique Id of the message"
5956
+ },
5957
+ "organisationId": {
5958
+ "type": "string",
5959
+ "description": "Organisation sender id"
5960
+ },
5961
+ "recipientUserId": {
5962
+ "type": "string",
5963
+ "description": "Unique id of the recipient"
5964
+ },
5965
+ "threadName": {
5966
+ "anyOf": [
5967
+ {
5968
+ "type": "string",
5969
+ "description": "Thread Name used to group messages"
5970
+ },
5971
+ {
5972
+ "type": "null"
5973
+ }
5974
+ ]
5975
+ },
5976
+ "isSeen": {
5977
+ "type": "boolean",
5978
+ "description": "Whether the message has been seen"
5979
+ },
5980
+ "subject": {
5981
+ "type": "string",
5982
+ "description": "Subject"
5983
+ },
5984
+ "richText": {
5985
+ "anyOf": [
5986
+ {
5987
+ "type": "string",
5988
+ "description": "Rich text content of the message"
5989
+ },
5990
+ {
5991
+ "type": "null"
5992
+ }
5993
+ ]
5994
+ },
5995
+ "plainText": {
5996
+ "type": "string",
5997
+ "description": "Plain text content of the message"
5998
+ },
5999
+ "createdAt": {
6000
+ "type": "string",
6001
+ "description": "Creation date time"
6002
+ },
6003
+ "scheduledAt": {
6004
+ "type": "string",
6005
+ "description": "Scheduled date time"
6006
+ },
6007
+ "attachmentIds": {
6008
+ "type": "array",
6009
+ "items": {
6010
+ "type": "string",
6011
+ "description": "Attachment Ids"
6012
+ }
6013
+ }
6014
+ }
6015
+ }
6016
+ },
6017
+ "metadata": {
6018
+ "type": "object",
6019
+ "properties": {
6020
+ "links": {
6021
+ "type": "object",
6022
+ "required": [
6023
+ "self",
6024
+ "first",
6025
+ "last",
6026
+ "pages"
6027
+ ],
6028
+ "properties": {
6029
+ "self": {
6030
+ "type": "object",
6031
+ "properties": {
6032
+ "href": {
6033
+ "type": "string",
6034
+ "description": "URL pointing to the request itself"
6035
+ }
6036
+ }
6037
+ },
6038
+ "next": {
6039
+ "type": "object",
6040
+ "properties": {
6041
+ "href": {
6042
+ "type": "string",
6043
+ "description": "URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted"
6044
+ }
6045
+ }
6046
+ },
6047
+ "prev": {
6048
+ "type": "object",
6049
+ "properties": {
6050
+ "href": {
6051
+ "type": "string",
6052
+ "description": "URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted"
6053
+ }
6054
+ }
6055
+ },
6056
+ "first": {
6057
+ "type": "object",
6058
+ "properties": {
6059
+ "href": {
6060
+ "type": "string",
6061
+ "description": "URL pointing to the first page of results in a paginated response"
6062
+ }
6063
+ }
6064
+ },
6065
+ "last": {
6066
+ "type": "object",
6067
+ "properties": {
6068
+ "href": {
6069
+ "type": "string",
6070
+ "description": "URL pointing to the first page of results in a paginated response"
6071
+ }
6072
+ }
6073
+ },
6074
+ "pages": {
6075
+ "type": "object",
6076
+ "description": "It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2'",
6077
+ "additionalProperties": {
6078
+ "type": "object",
6079
+ "properties": {
6080
+ "href": {
6081
+ "type": "string"
6082
+ }
6083
+ }
6084
+ }
6085
+ }
6086
+ },
6087
+ "description": "Object containing the links to the related endpoints"
6088
+ },
6089
+ "totalCount": {
6090
+ "type": "number",
6091
+ "description": "Number representing the total number of available items"
6092
+ }
6093
+ }
6094
+ }
6095
+ }
6096
+ }
6097
+ }
6098
+ }
6099
+ },
6100
+ "4XX": {
6101
+ "description": "Default Response",
6102
+ "content": {
6103
+ "application/json": {
6104
+ "schema": {
6105
+ "type": "object",
6106
+ "required": [
6107
+ "code",
6108
+ "detail",
6109
+ "requestId",
6110
+ "name",
6111
+ "statusCode"
6112
+ ],
6113
+ "properties": {
6114
+ "code": {
6115
+ "type": "string",
6116
+ "description": "Code used to categorize the error"
6117
+ },
6118
+ "detail": {
6119
+ "type": "string",
6120
+ "description": "Description of the error"
6121
+ },
6122
+ "requestId": {
6123
+ "type": "string",
6124
+ "description": "Unique request id. This one will be used to troubleshoot the problems"
6125
+ },
6126
+ "name": {
6127
+ "type": "string",
6128
+ "description": "Name of the error type"
6129
+ },
6130
+ "validation": {
6131
+ "type": "array",
6132
+ "items": {
6133
+ "type": "object",
6134
+ "required": [
6135
+ "fieldName",
6136
+ "message"
6137
+ ],
6138
+ "properties": {
6139
+ "fieldName": {
6140
+ "type": "string"
6141
+ },
6142
+ "message": {
6143
+ "type": "string"
6144
+ }
6145
+ }
6146
+ },
6147
+ "description": "List of the validation errors"
6148
+ },
6149
+ "validationContext": {
6150
+ "type": "string"
6151
+ },
6152
+ "statusCode": {
6153
+ "type": "number"
6154
+ }
6155
+ }
6156
+ }
6157
+ }
6158
+ }
6159
+ },
6160
+ "5XX": {
6161
+ "description": "Default Response",
6162
+ "content": {
6163
+ "application/json": {
6164
+ "schema": {
6165
+ "type": "object",
6166
+ "required": [
6167
+ "code",
6168
+ "detail",
6169
+ "requestId",
6170
+ "name",
6171
+ "statusCode"
6172
+ ],
6173
+ "properties": {
6174
+ "code": {
6175
+ "type": "string",
6176
+ "description": "Code used to categorize the error"
6177
+ },
6178
+ "detail": {
6179
+ "type": "string",
6180
+ "description": "Description of the error"
6181
+ },
6182
+ "requestId": {
6183
+ "type": "string",
6184
+ "description": "Unique request id. This one will be used to troubleshoot the problems"
6185
+ },
6186
+ "name": {
6187
+ "type": "string",
6188
+ "description": "Name of the error type"
6189
+ },
6190
+ "validation": {
6191
+ "type": "array",
6192
+ "items": {
6193
+ "type": "object",
6194
+ "required": [
6195
+ "fieldName",
6196
+ "message"
6197
+ ],
6198
+ "properties": {
6199
+ "fieldName": {
6200
+ "type": "string"
6201
+ },
6202
+ "message": {
6203
+ "type": "string"
6204
+ }
6205
+ }
6206
+ },
6207
+ "description": "List of the validation errors"
6208
+ },
6209
+ "validationContext": {
6210
+ "type": "string"
6211
+ },
6212
+ "statusCode": {
6213
+ "type": "number"
6214
+ }
6215
+ }
6216
+ }
6217
+ }
6218
+ }
6219
+ }
6220
+ }
6221
+ }
5867
6222
  }
5868
6223
  },
5869
6224
  "security": [
@@ -917,6 +917,23 @@ export interface paths {
917
917
  patch?: never;
918
918
  trace?: never;
919
919
  };
920
+ "/api/v1/support/messages/search": {
921
+ parameters: {
922
+ query?: never;
923
+ header?: never;
924
+ path?: never;
925
+ cookie?: never;
926
+ };
927
+ get?: never;
928
+ put?: never;
929
+ /** @description Returns all the messages for the requested organisation or the requested recipient */
930
+ post: operations["SupportListMessagesPost"];
931
+ delete?: never;
932
+ options?: never;
933
+ head?: never;
934
+ patch?: never;
935
+ trace?: never;
936
+ };
920
937
  }
921
938
  export type webhooks = Record<string, never>;
922
939
  export interface components {
@@ -2679,4 +2696,141 @@ export interface operations {
2679
2696
  };
2680
2697
  };
2681
2698
  };
2699
+ SupportListMessagesPost: {
2700
+ parameters: {
2701
+ query?: {
2702
+ /** @description Indicates where to start fetching data or how many records to skip, defining the initial position within the list */
2703
+ offset?: string;
2704
+ /** @description Indicates the maximum number (100) of items that will be returned in a single request */
2705
+ limit?: string;
2706
+ };
2707
+ header?: never;
2708
+ path?: never;
2709
+ cookie?: never;
2710
+ };
2711
+ requestBody: {
2712
+ content: {
2713
+ "application/json": {
2714
+ /** @description Filter messages by recipient user ids */
2715
+ recipientUserIds: string[];
2716
+ };
2717
+ };
2718
+ };
2719
+ responses: {
2720
+ /** @description Default Response */
2721
+ 200: {
2722
+ headers: {
2723
+ [name: string]: unknown;
2724
+ };
2725
+ content: {
2726
+ "application/json": {
2727
+ data: {
2728
+ /** @description Unique Id of the message */
2729
+ id: string;
2730
+ /** @description Organisation sender id */
2731
+ organisationId: string;
2732
+ /** @description Unique id of the recipient */
2733
+ recipientUserId: string;
2734
+ threadName: string | null;
2735
+ /** @description Whether the message has been seen */
2736
+ isSeen: boolean;
2737
+ /** @description Subject */
2738
+ subject: string;
2739
+ richText: string | null;
2740
+ /** @description Plain text content of the message */
2741
+ plainText: string;
2742
+ /** @description Creation date time */
2743
+ createdAt: string;
2744
+ /** @description Scheduled date time */
2745
+ scheduledAt: string;
2746
+ attachmentIds: string[];
2747
+ }[];
2748
+ metadata?: {
2749
+ /** @description Object containing the links to the related endpoints */
2750
+ links?: {
2751
+ self: {
2752
+ /** @description URL pointing to the request itself */
2753
+ href?: string;
2754
+ };
2755
+ next?: {
2756
+ /** @description URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted */
2757
+ href?: string;
2758
+ };
2759
+ prev?: {
2760
+ /** @description URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted */
2761
+ href?: string;
2762
+ };
2763
+ first: {
2764
+ /** @description URL pointing to the first page of results in a paginated response */
2765
+ href?: string;
2766
+ };
2767
+ last: {
2768
+ /** @description URL pointing to the first page of results in a paginated response */
2769
+ href?: string;
2770
+ };
2771
+ /** @description It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2' */
2772
+ pages: {
2773
+ [key: string]: {
2774
+ href?: string;
2775
+ };
2776
+ };
2777
+ };
2778
+ /** @description Number representing the total number of available items */
2779
+ totalCount?: number;
2780
+ };
2781
+ };
2782
+ };
2783
+ };
2784
+ /** @description Default Response */
2785
+ "4XX": {
2786
+ headers: {
2787
+ [name: string]: unknown;
2788
+ };
2789
+ content: {
2790
+ "application/json": {
2791
+ /** @description Code used to categorize the error */
2792
+ code: string;
2793
+ /** @description Description of the error */
2794
+ detail: string;
2795
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2796
+ requestId: string;
2797
+ /** @description Name of the error type */
2798
+ name: string;
2799
+ /** @description List of the validation errors */
2800
+ validation?: {
2801
+ fieldName: string;
2802
+ message: string;
2803
+ }[];
2804
+ validationContext?: string;
2805
+ statusCode: number;
2806
+ };
2807
+ };
2808
+ };
2809
+ /** @description Default Response */
2810
+ "5XX": {
2811
+ headers: {
2812
+ [name: string]: unknown;
2813
+ };
2814
+ content: {
2815
+ "application/json": {
2816
+ /** @description Code used to categorize the error */
2817
+ code: string;
2818
+ /** @description Description of the error */
2819
+ detail: string;
2820
+ /** @description Unique request id. This one will be used to troubleshoot the problems */
2821
+ requestId: string;
2822
+ /** @description Name of the error type */
2823
+ name: string;
2824
+ /** @description List of the validation errors */
2825
+ validation?: {
2826
+ fieldName: string;
2827
+ message: string;
2828
+ }[];
2829
+ validationContext?: string;
2830
+ statusCode: number;
2831
+ };
2832
+ };
2833
+ };
2834
+ };
2835
+ };
2682
2836
  }
@@ -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
  }