@ogcio/building-blocks-sdk 0.0.1
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/.husky/commit-msg +1 -0
- package/.husky/pre-push +1 -0
- package/.nvmrc +1 -0
- package/.vscode/settings.json +20 -0
- package/biome.jsonc +45 -0
- package/commitlint.config.js +6 -0
- package/dist/client/auth/index.d.ts +4 -0
- package/dist/client/auth/index.d.ts.map +1 -0
- package/dist/client/auth/index.js +83 -0
- package/dist/client/auth/index.js.map +1 -0
- package/dist/client/base-client.d.ts +18 -0
- package/dist/client/base-client.d.ts.map +1 -0
- package/dist/client/base-client.js +71 -0
- package/dist/client/base-client.js.map +1 -0
- package/dist/client/clients/messaging/index.d.ts +2407 -0
- package/dist/client/clients/messaging/index.d.ts.map +1 -0
- package/dist/client/clients/messaging/index.js +430 -0
- package/dist/client/clients/messaging/index.js.map +1 -0
- package/dist/client/clients/messaging/schema.d.ts +3823 -0
- package/dist/client/clients/messaging/schema.d.ts.map +1 -0
- package/dist/client/clients/messaging/schema.js +2 -0
- package/dist/client/clients/messaging/schema.js.map +1 -0
- package/dist/client/clients/payments/index.d.ts +2294 -0
- package/dist/client/clients/payments/index.d.ts.map +1 -0
- package/dist/client/clients/payments/index.js +217 -0
- package/dist/client/clients/payments/index.js.map +1 -0
- package/dist/client/clients/payments/schema.d.ts +2534 -0
- package/dist/client/clients/payments/schema.d.ts.map +1 -0
- package/dist/client/clients/payments/schema.js +2 -0
- package/dist/client/clients/payments/schema.js.map +1 -0
- package/dist/client/clients/profile/index.d.ts +1364 -0
- package/dist/client/clients/profile/index.d.ts.map +1 -0
- package/dist/client/clients/profile/index.js +102 -0
- package/dist/client/clients/profile/index.js.map +1 -0
- package/dist/client/clients/profile/schema.d.ts +1429 -0
- package/dist/client/clients/profile/schema.d.ts.map +1 -0
- package/dist/client/clients/profile/schema.js +2 -0
- package/dist/client/clients/profile/schema.js.map +1 -0
- package/dist/client/clients/scheduler/index.d.ts +14 -0
- package/dist/client/clients/scheduler/index.d.ts.map +1 -0
- package/dist/client/clients/scheduler/index.js +14 -0
- package/dist/client/clients/scheduler/index.js.map +1 -0
- package/dist/client/clients/scheduler/schema.d.ts +114 -0
- package/dist/client/clients/scheduler/schema.d.ts.map +1 -0
- package/dist/client/clients/scheduler/schema.js +2 -0
- package/dist/client/clients/scheduler/schema.js.map +1 -0
- package/dist/client/clients/upload/index.d.ts +390 -0
- package/dist/client/clients/upload/index.d.ts.map +1 -0
- package/dist/client/clients/upload/index.js +93 -0
- package/dist/client/clients/upload/index.js.map +1 -0
- package/dist/client/clients/upload/schema.d.ts +564 -0
- package/dist/client/clients/upload/schema.d.ts.map +1 -0
- package/dist/client/clients/upload/schema.js +2 -0
- package/dist/client/clients/upload/schema.js.map +1 -0
- package/dist/client/utils/client-utils.d.ts +15 -0
- package/dist/client/utils/client-utils.d.ts.map +1 -0
- package/dist/client/utils/client-utils.js +14 -0
- package/dist/client/utils/client-utils.js.map +1 -0
- package/dist/clients-configurations/clients-configuration.json +92 -0
- package/dist/clients-configurations/read-configuration-file.d.ts +22 -0
- package/dist/clients-configurations/read-configuration-file.d.ts.map +1 -0
- package/dist/clients-configurations/read-configuration-file.js +47 -0
- package/dist/clients-configurations/read-configuration-file.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/get-absolute-path.d.ts +3 -0
- package/dist/utils/get-absolute-path.d.ts.map +1 -0
- package/dist/utils/get-absolute-path.js +8 -0
- package/dist/utils/get-absolute-path.js.map +1 -0
- package/package.json +44 -0
- package/src/cli/cli-utils.ts +25 -0
- package/src/cli/index.ts +13 -0
- package/src/cli/outdated-clients-command.ts +148 -0
- package/src/cli/update-clients-command.ts +298 -0
- package/src/client/auth/index.ts +131 -0
- package/src/client/base-client.ts +97 -0
- package/src/client/clients/messaging/index.ts +683 -0
- package/src/client/clients/messaging/open-api-definition.json +8394 -0
- package/src/client/clients/messaging/schema.ts +3822 -0
- package/src/client/clients/payments/index.ts +349 -0
- package/src/client/clients/payments/open-api-definition.json +6094 -0
- package/src/client/clients/payments/schema.ts +2533 -0
- package/src/client/clients/profile/index.ts +182 -0
- package/src/client/clients/profile/open-api-definition.json +2876 -0
- package/src/client/clients/profile/schema.ts +1428 -0
- package/src/client/clients/scheduler/index.ts +28 -0
- package/src/client/clients/scheduler/open-api-definition.json +120 -0
- package/src/client/clients/scheduler/schema.ts +113 -0
- package/src/client/clients/upload/index.ts +129 -0
- package/src/client/clients/upload/open-api-definition.json +985 -0
- package/src/client/clients/upload/schema.ts +563 -0
- package/src/client/utils/client-utils.ts +50 -0
- package/src/clients-configurations/clients-configuration.json +92 -0
- package/src/clients-configurations/read-configuration-file.ts +68 -0
- package/src/index.ts +43 -0
- package/src/logto-node.d.ts +12 -0
- package/src/types/index.ts +82 -0
- package/src/utils/get-absolute-path.ts +10 -0
- package/tsconfig.json +18 -0
- package/tsconfig.prod.json +4 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type createClient from "openapi-fetch";
|
|
2
|
+
import { PROFILE } from "../../../types/index.js";
|
|
3
|
+
import BaseClient from "../../base-client.js";
|
|
4
|
+
import type { paths } from "./schema.js";
|
|
5
|
+
|
|
6
|
+
class Profile extends BaseClient<paths> {
|
|
7
|
+
declare client: ReturnType<typeof createClient<paths>>;
|
|
8
|
+
protected serviceName = PROFILE;
|
|
9
|
+
|
|
10
|
+
async getAddresses() {
|
|
11
|
+
return this.client.GET("/api/v1/addresses/").then(
|
|
12
|
+
(response) => this.formatResponse(response),
|
|
13
|
+
(reason) => this.formatError(reason),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async getAddress(addressId: string) {
|
|
18
|
+
return this.client
|
|
19
|
+
.GET("/api/v1/addresses/{addressId}", {
|
|
20
|
+
params: { path: { addressId } },
|
|
21
|
+
})
|
|
22
|
+
.then(
|
|
23
|
+
(response) => this.formatResponse(response),
|
|
24
|
+
(reason) => this.formatError(reason),
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async createAddress(
|
|
29
|
+
data: paths["/api/v1/addresses/"]["post"]["requestBody"]["content"]["application/json"],
|
|
30
|
+
) {
|
|
31
|
+
return this.client
|
|
32
|
+
.POST("/api/v1/addresses/", {
|
|
33
|
+
body: data,
|
|
34
|
+
})
|
|
35
|
+
.then(
|
|
36
|
+
(response) => this.formatResponse(response),
|
|
37
|
+
(reason) => this.formatError(reason),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async patchAddress(
|
|
42
|
+
addressId: string,
|
|
43
|
+
data: NonNullable<
|
|
44
|
+
paths["/api/v1/addresses/{addressId}"]["patch"]["requestBody"]
|
|
45
|
+
>["content"]["application/json"],
|
|
46
|
+
) {
|
|
47
|
+
if (!data || Object.keys(data).length === 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return this.client
|
|
51
|
+
.PATCH("/api/v1/addresses/{addressId}", {
|
|
52
|
+
params: { path: { addressId } },
|
|
53
|
+
body: data,
|
|
54
|
+
})
|
|
55
|
+
.then(
|
|
56
|
+
(response) => this.formatResponse(response),
|
|
57
|
+
(reason) => this.formatError(reason),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async updateAddress(
|
|
62
|
+
addressId: string,
|
|
63
|
+
data: paths["/api/v1/addresses/{addressId}"]["put"]["requestBody"]["content"]["application/json"],
|
|
64
|
+
) {
|
|
65
|
+
return this.client
|
|
66
|
+
.PUT("/api/v1/addresses/{addressId}", {
|
|
67
|
+
params: { path: { addressId } },
|
|
68
|
+
body: data,
|
|
69
|
+
})
|
|
70
|
+
.then(
|
|
71
|
+
(response) => this.formatResponse(response),
|
|
72
|
+
(reason) => this.formatError(reason),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async deleteAddress(addressId: string) {
|
|
77
|
+
return this.client
|
|
78
|
+
.DELETE("/api/v1/addresses/{addressId}", {
|
|
79
|
+
params: { path: { addressId } },
|
|
80
|
+
})
|
|
81
|
+
.then(
|
|
82
|
+
(response) => this.formatResponse(response),
|
|
83
|
+
(reason) => this.formatError(reason),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async getEntitlements() {
|
|
88
|
+
return this.client.GET("/api/v1/entitlements/").then(
|
|
89
|
+
(response) => this.formatResponse(response),
|
|
90
|
+
(reason) => this.formatError(reason),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async getUser(userId: string) {
|
|
95
|
+
return this.client
|
|
96
|
+
.GET("/api/v1/users/{userId}", {
|
|
97
|
+
params: { path: { userId } },
|
|
98
|
+
})
|
|
99
|
+
.then(
|
|
100
|
+
(response) => this.formatResponse(response),
|
|
101
|
+
(reason) => this.formatError(reason),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async createUser(
|
|
106
|
+
data: paths["/api/v1/users/"]["post"]["requestBody"]["content"]["application/json"],
|
|
107
|
+
) {
|
|
108
|
+
return this.client
|
|
109
|
+
.POST("/api/v1/users/", {
|
|
110
|
+
body: data,
|
|
111
|
+
})
|
|
112
|
+
.then(
|
|
113
|
+
(response) => this.formatResponse(response),
|
|
114
|
+
(reason) => this.formatError(reason),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async updateUser(
|
|
119
|
+
userId: string,
|
|
120
|
+
data: paths["/api/v1/users/{userId}"]["put"]["requestBody"]["content"]["application/json"],
|
|
121
|
+
) {
|
|
122
|
+
return this.client
|
|
123
|
+
.PUT("/api/v1/users/{userId}", {
|
|
124
|
+
params: { path: { userId } },
|
|
125
|
+
body: data,
|
|
126
|
+
})
|
|
127
|
+
.then(
|
|
128
|
+
(response) => this.formatResponse(response),
|
|
129
|
+
(reason) => this.formatError(reason),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async patchUser(
|
|
134
|
+
userId: string,
|
|
135
|
+
data?: NonNullable<
|
|
136
|
+
paths["/api/v1/users/{userId}"]["patch"]["requestBody"]
|
|
137
|
+
>["content"]["application/json"],
|
|
138
|
+
) {
|
|
139
|
+
if (!data || Object.keys(data).length === 0) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
return this.client
|
|
143
|
+
.PATCH("/api/v1/users/{userId}", {
|
|
144
|
+
params: { path: { userId } },
|
|
145
|
+
body: data,
|
|
146
|
+
})
|
|
147
|
+
.then(
|
|
148
|
+
(response) => this.formatResponse(response),
|
|
149
|
+
(reason) => this.formatError(reason),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async findUser(
|
|
154
|
+
query: paths["/api/v1/users/find"]["get"]["parameters"]["query"],
|
|
155
|
+
) {
|
|
156
|
+
return this.client
|
|
157
|
+
.GET("/api/v1/users/find", {
|
|
158
|
+
params: {
|
|
159
|
+
query,
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
.then(
|
|
163
|
+
(response) => this.formatResponse(response),
|
|
164
|
+
(reason) => this.formatError(reason),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async selectUsers(
|
|
169
|
+
ids: paths["/api/v1/users/select"]["post"]["requestBody"]["content"]["application/json"]["ids"],
|
|
170
|
+
) {
|
|
171
|
+
return this.client
|
|
172
|
+
.POST("/api/v1/users/select", {
|
|
173
|
+
body: { ids },
|
|
174
|
+
})
|
|
175
|
+
.then(
|
|
176
|
+
(response) => this.formatResponse(response),
|
|
177
|
+
(reason) => this.formatError(reason),
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default Profile;
|