@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,349 @@
|
|
|
1
|
+
import type createClient from "openapi-fetch";
|
|
2
|
+
import { PAYMENTS } from "../../../types/index.js";
|
|
3
|
+
import BaseClient from "../../base-client.js";
|
|
4
|
+
import type { paths } from "./schema.js";
|
|
5
|
+
|
|
6
|
+
class Payments extends BaseClient<paths> {
|
|
7
|
+
declare client: ReturnType<typeof createClient<paths>>;
|
|
8
|
+
protected serviceName = PAYMENTS;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* PROVIDERS
|
|
12
|
+
*/
|
|
13
|
+
async getProviders() {
|
|
14
|
+
return this.client.GET("/api/v1/providers/").then(
|
|
15
|
+
(response) => this.formatResponse(response),
|
|
16
|
+
(reason) => this.formatError(reason),
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async getProviderById(
|
|
21
|
+
providerId: paths["/api/v1/providers/{providerId}"]["get"]["parameters"]["path"]["providerId"],
|
|
22
|
+
) {
|
|
23
|
+
return this.client
|
|
24
|
+
.GET("/api/v1/providers/{providerId}", {
|
|
25
|
+
params: {
|
|
26
|
+
path: {
|
|
27
|
+
providerId,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
.then(
|
|
32
|
+
(response) => this.formatResponse(response),
|
|
33
|
+
(reason) => this.formatError(reason),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async createProvider(
|
|
38
|
+
data: paths["/api/v1/providers/"]["post"]["requestBody"]["content"]["application/json"],
|
|
39
|
+
) {
|
|
40
|
+
return this.client
|
|
41
|
+
.POST("/api/v1/providers/", {
|
|
42
|
+
body: data,
|
|
43
|
+
})
|
|
44
|
+
.then(
|
|
45
|
+
(response) => this.formatResponse(response),
|
|
46
|
+
(reason) => this.formatError(reason),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async updateProvider(
|
|
51
|
+
providerId: paths["/api/v1/providers/{providerId}"]["put"]["parameters"]["path"]["providerId"],
|
|
52
|
+
data: paths["/api/v1/providers/{providerId}"]["put"]["requestBody"]["content"]["application/json"],
|
|
53
|
+
) {
|
|
54
|
+
return this.client
|
|
55
|
+
.PUT("/api/v1/providers/{providerId}", {
|
|
56
|
+
params: {
|
|
57
|
+
path: {
|
|
58
|
+
providerId,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
body: data,
|
|
62
|
+
})
|
|
63
|
+
.then(
|
|
64
|
+
(response) => this.formatResponse(response),
|
|
65
|
+
(reason) => this.formatError(reason),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* PAYMENT REQUESTS
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
async getPaymentRequests(
|
|
74
|
+
query: paths["/api/v1/requests/"]["get"]["parameters"]["query"],
|
|
75
|
+
) {
|
|
76
|
+
return this.client
|
|
77
|
+
.GET("/api/v1/requests/", {
|
|
78
|
+
params: {
|
|
79
|
+
query,
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
.then(
|
|
83
|
+
(response) => this.formatResponse(response),
|
|
84
|
+
(reason) => this.formatError(reason),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async getPaymentRequest(
|
|
89
|
+
requestId: paths["/api/v1/requests/{requestId}"]["get"]["parameters"]["path"]["requestId"],
|
|
90
|
+
) {
|
|
91
|
+
return this.client
|
|
92
|
+
.GET("/api/v1/requests/{requestId}", {
|
|
93
|
+
params: {
|
|
94
|
+
path: {
|
|
95
|
+
requestId,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
.then(
|
|
100
|
+
(response) => this.formatResponse(response),
|
|
101
|
+
(reason) => this.formatError(reason),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async getPaymentRequestTransactions(
|
|
106
|
+
requestId: paths["/api/v1/requests/{requestId}/transactions"]["get"]["parameters"]["path"]["requestId"],
|
|
107
|
+
query: paths["/api/v1/requests/{requestId}/transactions"]["get"]["parameters"]["query"],
|
|
108
|
+
) {
|
|
109
|
+
return this.client
|
|
110
|
+
.GET("/api/v1/requests/{requestId}/transactions", {
|
|
111
|
+
params: {
|
|
112
|
+
path: {
|
|
113
|
+
requestId,
|
|
114
|
+
},
|
|
115
|
+
query,
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
.then(
|
|
119
|
+
(response) => this.formatResponse(response),
|
|
120
|
+
(reason) => this.formatError(reason),
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async createPaymentRequest(
|
|
125
|
+
data: paths["/api/v1/requests/"]["post"]["requestBody"]["content"]["application/json"],
|
|
126
|
+
) {
|
|
127
|
+
return this.client
|
|
128
|
+
.POST("/api/v1/requests/", {
|
|
129
|
+
body: data,
|
|
130
|
+
})
|
|
131
|
+
.then(
|
|
132
|
+
(response) => this.formatResponse(response),
|
|
133
|
+
(reason) => this.formatError(reason),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async getPaymentRequestPublicInfo(
|
|
138
|
+
requestId: paths["/api/v1/requests/{requestId}/public-info"]["get"]["parameters"]["path"]["requestId"],
|
|
139
|
+
) {
|
|
140
|
+
return this.client
|
|
141
|
+
.GET("/api/v1/requests/{requestId}/public-info", {
|
|
142
|
+
params: {
|
|
143
|
+
path: {
|
|
144
|
+
requestId,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
})
|
|
148
|
+
.then(
|
|
149
|
+
(response) => this.formatResponse(response),
|
|
150
|
+
(reason) => this.formatError(reason),
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async updatePaymentRequest(
|
|
155
|
+
data: paths["/api/v1/requests/"]["put"]["requestBody"]["content"]["application/json"],
|
|
156
|
+
) {
|
|
157
|
+
return this.client
|
|
158
|
+
.PUT("/api/v1/requests/", {
|
|
159
|
+
body: data,
|
|
160
|
+
})
|
|
161
|
+
.then(
|
|
162
|
+
(response) => this.formatResponse(response),
|
|
163
|
+
(reason) => this.formatError(reason),
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async deletePaymentRequest(
|
|
168
|
+
requestId: paths["/api/v1/requests/{requestId}"]["delete"]["parameters"]["path"]["requestId"],
|
|
169
|
+
) {
|
|
170
|
+
return this.client
|
|
171
|
+
.DELETE("/api/v1/requests/{requestId}", {
|
|
172
|
+
params: {
|
|
173
|
+
path: {
|
|
174
|
+
requestId,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
})
|
|
178
|
+
.then(
|
|
179
|
+
(response) => this.formatResponse(response),
|
|
180
|
+
(reason) => this.formatError(reason),
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* TRANSACTIONS
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
async getTransactions(
|
|
189
|
+
query: paths["/api/v1/transactions/"]["get"]["parameters"]["query"],
|
|
190
|
+
) {
|
|
191
|
+
return this.client
|
|
192
|
+
.GET("/api/v1/transactions/", {
|
|
193
|
+
params: {
|
|
194
|
+
query,
|
|
195
|
+
},
|
|
196
|
+
})
|
|
197
|
+
.then(
|
|
198
|
+
(response) => this.formatResponse(response),
|
|
199
|
+
(reason) => this.formatError(reason),
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async getTransactionDetails(transactionId: string) {
|
|
204
|
+
return this.client
|
|
205
|
+
.GET("/api/v1/transactions/{transactionId}", {
|
|
206
|
+
params: {
|
|
207
|
+
path: {
|
|
208
|
+
transactionId,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
})
|
|
212
|
+
.then(
|
|
213
|
+
(response) => this.formatResponse(response),
|
|
214
|
+
(reason) => this.formatError(reason),
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async updateTransaction(
|
|
219
|
+
transactionId: paths["/api/v1/transactions/{transactionId}"]["patch"]["parameters"]["path"]["transactionId"],
|
|
220
|
+
data: paths["/api/v1/transactions/{transactionId}"]["patch"]["requestBody"]["content"]["application/json"],
|
|
221
|
+
) {
|
|
222
|
+
return this.client
|
|
223
|
+
.PATCH("/api/v1/transactions/{transactionId}", {
|
|
224
|
+
params: {
|
|
225
|
+
path: {
|
|
226
|
+
transactionId,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
body: data,
|
|
230
|
+
})
|
|
231
|
+
.then(
|
|
232
|
+
(response) => this.formatResponse(response),
|
|
233
|
+
(reason) => this.formatError(reason),
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async createTransaction(
|
|
238
|
+
data: paths["/api/v1/transactions/"]["post"]["requestBody"]["content"]["application/json"],
|
|
239
|
+
) {
|
|
240
|
+
return this.client
|
|
241
|
+
.POST("/api/v1/transactions/", {
|
|
242
|
+
body: data,
|
|
243
|
+
})
|
|
244
|
+
.then(
|
|
245
|
+
(response) => this.formatResponse(response),
|
|
246
|
+
(reason) => this.formatError(reason),
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async generatePaymentIntentId() {
|
|
251
|
+
return this.client.GET("/api/v1/transactions/generatePaymentIntentId").then(
|
|
252
|
+
(response) => this.formatResponse(response),
|
|
253
|
+
(reason) => this.formatError(reason),
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async getRealexPaymentObject(
|
|
258
|
+
query: paths["/api/v1/realex/paymentObject"]["get"]["parameters"]["query"],
|
|
259
|
+
) {
|
|
260
|
+
return this.client
|
|
261
|
+
.GET("/api/v1/realex/paymentObject", {
|
|
262
|
+
params: {
|
|
263
|
+
query,
|
|
264
|
+
},
|
|
265
|
+
})
|
|
266
|
+
.then(
|
|
267
|
+
(response) => this.formatResponse(response),
|
|
268
|
+
(reason) => this.formatError(reason),
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Citizen
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
async getCitizenTransactions(
|
|
276
|
+
query: paths["/api/v1/citizen/transactions"]["get"]["parameters"]["query"],
|
|
277
|
+
) {
|
|
278
|
+
return this.client
|
|
279
|
+
.GET("/api/v1/citizen/transactions", {
|
|
280
|
+
params: {
|
|
281
|
+
query,
|
|
282
|
+
},
|
|
283
|
+
})
|
|
284
|
+
.then(
|
|
285
|
+
(response) => this.formatResponse(response),
|
|
286
|
+
(reason) => this.formatError(reason),
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
async getCitizenTransactionDetails(transactionId: string) {
|
|
291
|
+
return this.client
|
|
292
|
+
.GET("/api/v1/citizen/transactions/{transactionId}", {
|
|
293
|
+
params: {
|
|
294
|
+
path: {
|
|
295
|
+
transactionId,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
})
|
|
299
|
+
.then(
|
|
300
|
+
(response) => this.formatResponse(response),
|
|
301
|
+
(reason) => this.formatError(reason),
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* AUDIT LOGS
|
|
307
|
+
*/
|
|
308
|
+
|
|
309
|
+
async getAuditLogEvents(
|
|
310
|
+
query: paths["/api/v1/auditLogs/"]["get"]["parameters"]["query"],
|
|
311
|
+
) {
|
|
312
|
+
return this.client
|
|
313
|
+
.GET("/api/v1/auditLogs/", {
|
|
314
|
+
params: {
|
|
315
|
+
query,
|
|
316
|
+
},
|
|
317
|
+
})
|
|
318
|
+
.then(
|
|
319
|
+
(response) => this.formatResponse(response),
|
|
320
|
+
(reason) => this.formatError(reason),
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async getAuditLogDetails(
|
|
325
|
+
auditLogId: paths["/api/v1/auditLogs/{auditLogId}"]["get"]["parameters"]["path"]["auditLogId"],
|
|
326
|
+
) {
|
|
327
|
+
return this.client
|
|
328
|
+
.GET("/api/v1/auditLogs/{auditLogId}", {
|
|
329
|
+
params: {
|
|
330
|
+
path: {
|
|
331
|
+
auditLogId,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
})
|
|
335
|
+
.then(
|
|
336
|
+
(response) => this.formatResponse(response),
|
|
337
|
+
(reason) => this.formatError(reason),
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
async getAuditLogEventTypes() {
|
|
342
|
+
return this.client.GET("/api/v1/auditLogs/event-types").then(
|
|
343
|
+
(response) => this.formatResponse(response),
|
|
344
|
+
(reason) => this.formatError(reason),
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export default Payments;
|