@ogcio/building-blocks-sdk 0.2.51 → 0.2.53
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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/client/auth/index.d.ts.map +1 -1
- package/dist/client/clients/journey/index.d.ts +1 -2
- package/dist/client/clients/journey/index.d.ts.map +1 -1
- package/dist/client/clients/journey/schema.d.ts +1 -2
- package/dist/client/clients/journey/schema.d.ts.map +1 -1
- package/dist/client/clients/messaging/index.d.ts.map +1 -1
- package/dist/client/clients/profile/citizen.d.ts +191 -40
- package/dist/client/clients/profile/citizen.d.ts.map +1 -1
- package/dist/client/clients/profile/citizen.js +31 -10
- package/dist/client/clients/profile/citizen.js.map +1 -1
- package/dist/client/clients/profile/index.d.ts +77 -8
- package/dist/client/clients/profile/index.d.ts.map +1 -1
- package/dist/client/clients/profile/index.js +4 -4
- package/dist/client/clients/profile/index.js.map +1 -1
- package/dist/client/clients/profile/organisation.d.ts +861 -21
- package/dist/client/clients/profile/organisation.d.ts.map +1 -1
- package/dist/client/clients/profile/organisation.js +64 -4
- package/dist/client/clients/profile/organisation.js.map +1 -1
- package/dist/client/clients/profile/schema.d.ts +1773 -595
- package/dist/client/clients/profile/schema.d.ts.map +1 -1
- package/dist/client/clients/upload/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/client/clients/journey/open-api-definition.json +3 -8
- package/src/client/clients/journey/schema.ts +1 -2
- package/src/client/clients/profile/citizen.ts +54 -14
- package/src/client/clients/profile/index.ts +13 -5
- package/src/client/clients/profile/open-api-definition.json +6812 -3375
- package/src/client/clients/profile/organisation.ts +117 -5
- package/src/client/clients/profile/schema.ts +1773 -595
|
@@ -1,16 +1,128 @@
|
|
|
1
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";
|
|
2
8
|
import type { paths } from "./schema.js";
|
|
3
9
|
|
|
4
10
|
export class ProfileOrganisation {
|
|
5
11
|
constructor(
|
|
6
12
|
private readonly client: ReturnType<typeof createClient<paths>>,
|
|
13
|
+
private readonly serviceName: string,
|
|
14
|
+
private readonly logger: Logger | undefined,
|
|
7
15
|
) {}
|
|
8
16
|
|
|
9
|
-
async
|
|
10
|
-
query: paths["/api/v1/organisations/consent-statements/
|
|
17
|
+
async getCurrentConsentStatement(
|
|
18
|
+
query: paths["/api/v1/organisations/consent-statements/current"]["get"]["parameters"]["query"],
|
|
11
19
|
) {
|
|
12
|
-
return this.client
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
return this.client
|
|
21
|
+
.GET("/api/v1/organisations/consent-statements/current", {
|
|
22
|
+
params: { query },
|
|
23
|
+
})
|
|
24
|
+
.then(
|
|
25
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
26
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async createConsentStatement(
|
|
31
|
+
data: NonNullable<
|
|
32
|
+
paths["/api/v1/organisations/consent-statements/"]["post"]["requestBody"]
|
|
33
|
+
>["content"]["application/json"],
|
|
34
|
+
) {
|
|
35
|
+
return this.client
|
|
36
|
+
.POST("/api/v1/organisations/consent-statements/", {
|
|
37
|
+
body: data,
|
|
38
|
+
})
|
|
39
|
+
.then(
|
|
40
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
41
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async updateConsentStatement(
|
|
46
|
+
id: string,
|
|
47
|
+
data: NonNullable<
|
|
48
|
+
paths["/api/v1/organisations/consent-statements/{id}"]["put"]["requestBody"]
|
|
49
|
+
>["content"]["application/json"],
|
|
50
|
+
) {
|
|
51
|
+
throwIfEmpty(id);
|
|
52
|
+
|
|
53
|
+
return this.client
|
|
54
|
+
.PUT("/api/v1/organisations/consent-statements/{id}", {
|
|
55
|
+
params: { path: { id } },
|
|
56
|
+
body: data,
|
|
57
|
+
})
|
|
58
|
+
.then(
|
|
59
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
60
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async listConsentStatements(
|
|
65
|
+
query: paths["/api/v1/organisations/consent-statements/"]["get"]["parameters"]["query"],
|
|
66
|
+
) {
|
|
67
|
+
return this.client
|
|
68
|
+
.GET("/api/v1/organisations/consent-statements/", {
|
|
69
|
+
params: { query },
|
|
70
|
+
})
|
|
71
|
+
.then(
|
|
72
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
73
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async getConsentStatement(id: string) {
|
|
78
|
+
throwIfEmpty(id);
|
|
79
|
+
|
|
80
|
+
return this.client
|
|
81
|
+
.GET("/api/v1/organisations/consent-statements/{id}", {
|
|
82
|
+
params: { path: { id } },
|
|
83
|
+
})
|
|
84
|
+
.then(
|
|
85
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
86
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async disableConsentStatement(id: string) {
|
|
91
|
+
throwIfEmpty(id);
|
|
92
|
+
|
|
93
|
+
return this.client
|
|
94
|
+
.PATCH("/api/v1/organisations/consent-statements/{id}/disable", {
|
|
95
|
+
params: { path: { id } },
|
|
96
|
+
})
|
|
97
|
+
.then(
|
|
98
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
99
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async listConsents(
|
|
104
|
+
query: paths["/api/v1/organisations/consents/"]["get"]["parameters"]["query"],
|
|
105
|
+
) {
|
|
106
|
+
return this.client
|
|
107
|
+
.GET("/api/v1/organisations/consents/", {
|
|
108
|
+
params: { query },
|
|
109
|
+
})
|
|
110
|
+
.then(
|
|
111
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
112
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async listLatestConsents(
|
|
117
|
+
query: paths["/api/v1/organisations/consents/latest"]["get"]["parameters"]["query"],
|
|
118
|
+
) {
|
|
119
|
+
return this.client
|
|
120
|
+
.GET("/api/v1/organisations/consents/latest", {
|
|
121
|
+
params: { query },
|
|
122
|
+
})
|
|
123
|
+
.then(
|
|
124
|
+
(response) => formatResponse(response, this.serviceName, this.logger),
|
|
125
|
+
(reason) => formatError(reason, this.serviceName, this.logger),
|
|
126
|
+
);
|
|
15
127
|
}
|
|
16
128
|
}
|