@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
@@ -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
+ }
@@ -7,6 +7,15 @@ import {
7
7
  } from "../../utils/client-utils.js";
8
8
  import type { paths } from "./schema.js";
9
9
 
10
+ type ListAnnouncementsQuery =
11
+ paths["/api/v1/citizens/announcements/"]["get"]["parameters"]["query"];
12
+ type BooleanListAnnouncementsQuery = Omit<
13
+ ListAnnouncementsQuery,
14
+ "new_only"
15
+ > & {
16
+ newOnly?: boolean;
17
+ };
18
+
10
19
  export class ProfileCitizen {
11
20
  constructor(
12
21
  private readonly client: ReturnType<typeof createClient<paths>>,
@@ -79,4 +88,34 @@ export class ProfileCitizen {
79
88
  (reason) => formatError(reason, this.serviceName, this.logger),
80
89
  );
81
90
  }
91
+
92
+ public readonly announcements = {
93
+ list: async (queryParams: BooleanListAnnouncementsQuery) => {
94
+ let newOnly: undefined | "true" | "false";
95
+ if (queryParams.newOnly !== undefined) {
96
+ newOnly = queryParams.newOnly ? "true" : "false";
97
+ }
98
+
99
+ return this.client
100
+ .GET("/api/v1/citizens/announcements/", {
101
+ params: { query: { ...queryParams, new_only: newOnly } },
102
+ })
103
+ .then(
104
+ (response) => formatResponse(response, this.serviceName, this.logger),
105
+ (reason) => formatError(reason, this.serviceName, this.logger),
106
+ );
107
+ },
108
+ setAsSeen: async (
109
+ body: paths["/api/v1/citizens/announcements/acknowledgements"]["post"]["requestBody"]["content"]["application/json"],
110
+ ) => {
111
+ return this.client
112
+ .POST("/api/v1/citizens/announcements/acknowledgements", {
113
+ body,
114
+ })
115
+ .then(
116
+ (response) => formatResponse(response, this.serviceName, this.logger),
117
+ (reason) => formatError(reason, this.serviceName, this.logger),
118
+ );
119
+ },
120
+ };
82
121
  }
@@ -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();