@ogcio/building-blocks-sdk 0.1.18 → 0.2.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.
Files changed (37) hide show
  1. package/.gitleaksignore +2 -0
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +18 -0
  4. package/dist/client/clients/featureFlags/schema.d.ts +205 -63
  5. package/dist/client/clients/featureFlags/schema.d.ts.map +1 -1
  6. package/dist/client/clients/messaging/index.d.ts +109 -1960
  7. package/dist/client/clients/messaging/index.d.ts.map +1 -1
  8. package/dist/client/clients/messaging/index.js +3 -179
  9. package/dist/client/clients/messaging/index.js.map +1 -1
  10. package/dist/client/clients/messaging/schema.d.ts +1689 -3486
  11. package/dist/client/clients/messaging/schema.d.ts.map +1 -1
  12. package/dist/client/clients/payments/index.d.ts +93 -7
  13. package/dist/client/clients/payments/index.d.ts.map +1 -1
  14. package/dist/client/clients/payments/index.js +11 -0
  15. package/dist/client/clients/payments/index.js.map +1 -1
  16. package/dist/client/clients/payments/schema.d.ts +113 -7
  17. package/dist/client/clients/payments/schema.d.ts.map +1 -1
  18. package/dist/client/clients/profile/index.d.ts +882 -440
  19. package/dist/client/clients/profile/index.d.ts.map +1 -1
  20. package/dist/client/clients/profile/index.js +88 -54
  21. package/dist/client/clients/profile/index.js.map +1 -1
  22. package/dist/client/clients/profile/schema.d.ts +1257 -1114
  23. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  24. package/dist/clients-configurations/clients-configuration.json +7 -6
  25. package/package.json +1 -1
  26. package/src/client/clients/featureFlags/open-api-definition.json +184 -95
  27. package/src/client/clients/featureFlags/schema.ts +205 -63
  28. package/src/client/clients/messaging/index.ts +2 -278
  29. package/src/client/clients/messaging/open-api-definition.json +419 -4558
  30. package/src/client/clients/messaging/schema.ts +1689 -3486
  31. package/src/client/clients/payments/index.ts +17 -0
  32. package/src/client/clients/payments/open-api-definition.json +314 -0
  33. package/src/client/clients/payments/schema.ts +113 -7
  34. package/src/client/clients/profile/index.ts +140 -84
  35. package/src/client/clients/profile/open-api-definition.json +1925 -1343
  36. package/src/client/clients/profile/schema.ts +1257 -1114
  37. package/src/clients-configurations/clients-configuration.json +7 -6
@@ -349,6 +349,23 @@ export class Payments extends BaseClient<paths> {
349
349
  );
350
350
  }
351
351
 
352
+ async cancelPayment(
353
+ transactionId: paths["/api/v1/transactions/{transactionId}/cancel-payment"]["post"]["parameters"]["path"]["transactionId"],
354
+ ) {
355
+ return this.client
356
+ .POST("/api/v1/transactions/{transactionId}/cancel-payment", {
357
+ params: {
358
+ path: {
359
+ transactionId,
360
+ },
361
+ },
362
+ })
363
+ .then(
364
+ (response) => formatResponse(response, this.serviceName, this.logger),
365
+ (reason) => formatError(reason, this.serviceName, this.logger),
366
+ );
367
+ }
368
+
352
369
  /**
353
370
  * Citizen
354
371
  */
@@ -3413,11 +3413,29 @@
3413
3413
  "cancelled"
3414
3414
  ]
3415
3415
  },
3416
+ {
3417
+ "type": "string",
3418
+ "enum": [
3419
+ "cancellation_requested"
3420
+ ]
3421
+ },
3416
3422
  {
3417
3423
  "type": "string",
3418
3424
  "enum": [
3419
3425
  "failed"
3420
3426
  ]
3427
+ },
3428
+ {
3429
+ "type": "string",
3430
+ "enum": [
3431
+ "refunded"
3432
+ ]
3433
+ },
3434
+ {
3435
+ "type": "string",
3436
+ "enum": [
3437
+ "refund_failed"
3438
+ ]
3421
3439
  }
3422
3440
  ]
3423
3441
  },
@@ -3662,11 +3680,29 @@
3662
3680
  "cancelled"
3663
3681
  ]
3664
3682
  },
3683
+ {
3684
+ "type": "string",
3685
+ "enum": [
3686
+ "cancellation_requested"
3687
+ ]
3688
+ },
3665
3689
  {
3666
3690
  "type": "string",
3667
3691
  "enum": [
3668
3692
  "failed"
3669
3693
  ]
3694
+ },
3695
+ {
3696
+ "type": "string",
3697
+ "enum": [
3698
+ "refunded"
3699
+ ]
3700
+ },
3701
+ {
3702
+ "type": "string",
3703
+ "enum": [
3704
+ "refund_failed"
3705
+ ]
3670
3706
  }
3671
3707
  ]
3672
3708
  },
@@ -3920,11 +3956,29 @@
3920
3956
  "cancelled"
3921
3957
  ]
3922
3958
  },
3959
+ {
3960
+ "type": "string",
3961
+ "enum": [
3962
+ "cancellation_requested"
3963
+ ]
3964
+ },
3923
3965
  {
3924
3966
  "type": "string",
3925
3967
  "enum": [
3926
3968
  "failed"
3927
3969
  ]
3970
+ },
3971
+ {
3972
+ "type": "string",
3973
+ "enum": [
3974
+ "refunded"
3975
+ ]
3976
+ },
3977
+ {
3978
+ "type": "string",
3979
+ "enum": [
3980
+ "refund_failed"
3981
+ ]
3928
3982
  }
3929
3983
  ]
3930
3984
  }
@@ -4224,11 +4278,29 @@
4224
4278
  "cancelled"
4225
4279
  ]
4226
4280
  },
4281
+ {
4282
+ "type": "string",
4283
+ "enum": [
4284
+ "cancellation_requested"
4285
+ ]
4286
+ },
4227
4287
  {
4228
4288
  "type": "string",
4229
4289
  "enum": [
4230
4290
  "failed"
4231
4291
  ]
4292
+ },
4293
+ {
4294
+ "type": "string",
4295
+ "enum": [
4296
+ "refunded"
4297
+ ]
4298
+ },
4299
+ {
4300
+ "type": "string",
4301
+ "enum": [
4302
+ "refund_failed"
4303
+ ]
4232
4304
  }
4233
4305
  ]
4234
4306
  },
@@ -5104,11 +5176,29 @@
5104
5176
  "cancelled"
5105
5177
  ]
5106
5178
  },
5179
+ {
5180
+ "type": "string",
5181
+ "enum": [
5182
+ "cancellation_requested"
5183
+ ]
5184
+ },
5107
5185
  {
5108
5186
  "type": "string",
5109
5187
  "enum": [
5110
5188
  "failed"
5111
5189
  ]
5190
+ },
5191
+ {
5192
+ "type": "string",
5193
+ "enum": [
5194
+ "refunded"
5195
+ ]
5196
+ },
5197
+ {
5198
+ "type": "string",
5199
+ "enum": [
5200
+ "refund_failed"
5201
+ ]
5112
5202
  }
5113
5203
  ]
5114
5204
  },
@@ -5964,6 +6054,194 @@
5964
6054
  }
5965
6055
  }
5966
6056
  },
6057
+ "/api/v1/transactions/{transactionId}/cancel-payment": {
6058
+ "post": {
6059
+ "parameters": [
6060
+ {
6061
+ "schema": {
6062
+ "type": "string"
6063
+ },
6064
+ "in": "path",
6065
+ "name": "transactionId",
6066
+ "required": true
6067
+ }
6068
+ ],
6069
+ "responses": {
6070
+ "200": {
6071
+ "description": "Default Response",
6072
+ "content": {
6073
+ "application/json": {
6074
+ "schema": {
6075
+ "type": "object",
6076
+ "properties": {
6077
+ "data": {
6078
+ "type": "object",
6079
+ "properties": {
6080
+ "success": {
6081
+ "type": "boolean"
6082
+ }
6083
+ },
6084
+ "required": [
6085
+ "success"
6086
+ ]
6087
+ },
6088
+ "metadata": {
6089
+ "type": "object",
6090
+ "properties": {
6091
+ "links": {
6092
+ "description": "Object containing the links to the related endpoints",
6093
+ "type": "object",
6094
+ "properties": {
6095
+ "self": {
6096
+ "type": "object",
6097
+ "properties": {
6098
+ "href": {
6099
+ "description": "URL pointing to the request itself",
6100
+ "type": "string"
6101
+ }
6102
+ }
6103
+ },
6104
+ "next": {
6105
+ "type": "object",
6106
+ "properties": {
6107
+ "href": {
6108
+ "description": "URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted",
6109
+ "type": "string"
6110
+ }
6111
+ }
6112
+ },
6113
+ "prev": {
6114
+ "type": "object",
6115
+ "properties": {
6116
+ "href": {
6117
+ "description": "URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted",
6118
+ "type": "string"
6119
+ }
6120
+ }
6121
+ },
6122
+ "first": {
6123
+ "type": "object",
6124
+ "properties": {
6125
+ "href": {
6126
+ "description": "URL pointing to the first page of results in a paginated response",
6127
+ "type": "string"
6128
+ }
6129
+ }
6130
+ },
6131
+ "last": {
6132
+ "type": "object",
6133
+ "properties": {
6134
+ "href": {
6135
+ "description": "URL pointing to the first page of results in a paginated response",
6136
+ "type": "string"
6137
+ }
6138
+ }
6139
+ },
6140
+ "pages": {
6141
+ "description": "It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2'",
6142
+ "type": "object",
6143
+ "additionalProperties": {
6144
+ "type": "object",
6145
+ "properties": {
6146
+ "href": {
6147
+ "type": "string"
6148
+ }
6149
+ }
6150
+ }
6151
+ }
6152
+ },
6153
+ "required": [
6154
+ "self",
6155
+ "first",
6156
+ "last",
6157
+ "pages"
6158
+ ]
6159
+ },
6160
+ "totalCount": {
6161
+ "description": "Number representing the total number of available items",
6162
+ "type": "number"
6163
+ }
6164
+ }
6165
+ }
6166
+ },
6167
+ "required": [
6168
+ "data"
6169
+ ]
6170
+ }
6171
+ }
6172
+ }
6173
+ },
6174
+ "401": {
6175
+ "description": "Default Response",
6176
+ "content": {
6177
+ "application/json": {
6178
+ "schema": {
6179
+ "type": "object",
6180
+ "properties": {
6181
+ "code": {
6182
+ "type": "string"
6183
+ },
6184
+ "detail": {
6185
+ "type": "string"
6186
+ },
6187
+ "requestId": {
6188
+ "type": "string"
6189
+ },
6190
+ "name": {
6191
+ "type": "string"
6192
+ },
6193
+ "validation": {},
6194
+ "validationContext": {
6195
+ "type": "string"
6196
+ }
6197
+ },
6198
+ "required": [
6199
+ "code",
6200
+ "detail",
6201
+ "requestId",
6202
+ "name"
6203
+ ]
6204
+ }
6205
+ }
6206
+ }
6207
+ },
6208
+ "500": {
6209
+ "description": "Default Response",
6210
+ "content": {
6211
+ "application/json": {
6212
+ "schema": {
6213
+ "type": "object",
6214
+ "properties": {
6215
+ "code": {
6216
+ "type": "string"
6217
+ },
6218
+ "detail": {
6219
+ "type": "string"
6220
+ },
6221
+ "requestId": {
6222
+ "type": "string"
6223
+ },
6224
+ "name": {
6225
+ "type": "string"
6226
+ },
6227
+ "validation": {},
6228
+ "validationContext": {
6229
+ "type": "string"
6230
+ }
6231
+ },
6232
+ "required": [
6233
+ "code",
6234
+ "detail",
6235
+ "requestId",
6236
+ "name"
6237
+ ]
6238
+ }
6239
+ }
6240
+ }
6241
+ }
6242
+ }
6243
+ }
6244
+ },
5967
6245
  "/api/v1/citizen/transactions": {
5968
6246
  "get": {
5969
6247
  "tags": [
@@ -6035,11 +6313,29 @@
6035
6313
  "cancelled"
6036
6314
  ]
6037
6315
  },
6316
+ {
6317
+ "type": "string",
6318
+ "enum": [
6319
+ "cancellation_requested"
6320
+ ]
6321
+ },
6038
6322
  {
6039
6323
  "type": "string",
6040
6324
  "enum": [
6041
6325
  "failed"
6042
6326
  ]
6327
+ },
6328
+ {
6329
+ "type": "string",
6330
+ "enum": [
6331
+ "refunded"
6332
+ ]
6333
+ },
6334
+ {
6335
+ "type": "string",
6336
+ "enum": [
6337
+ "refund_failed"
6338
+ ]
6043
6339
  }
6044
6340
  ]
6045
6341
  },
@@ -6314,11 +6610,29 @@
6314
6610
  "cancelled"
6315
6611
  ]
6316
6612
  },
6613
+ {
6614
+ "type": "string",
6615
+ "enum": [
6616
+ "cancellation_requested"
6617
+ ]
6618
+ },
6317
6619
  {
6318
6620
  "type": "string",
6319
6621
  "enum": [
6320
6622
  "failed"
6321
6623
  ]
6624
+ },
6625
+ {
6626
+ "type": "string",
6627
+ "enum": [
6628
+ "refunded"
6629
+ ]
6630
+ },
6631
+ {
6632
+ "type": "string",
6633
+ "enum": [
6634
+ "refund_failed"
6635
+ ]
6322
6636
  }
6323
6637
  ]
6324
6638
  },
@@ -1349,7 +1349,7 @@ export interface paths {
1349
1349
  "application/json": {
1350
1350
  data: {
1351
1351
  transactionId: string;
1352
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
1352
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
1353
1353
  amount: number;
1354
1354
  extPaymentId: string;
1355
1355
  paymentProviderId: string;
@@ -1461,7 +1461,7 @@ export interface paths {
1461
1461
  "application/json": {
1462
1462
  data: {
1463
1463
  transactionId: string;
1464
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
1464
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
1465
1465
  amount: number;
1466
1466
  extPaymentId: string;
1467
1467
  paymentProviderId: string;
@@ -1555,7 +1555,7 @@ export interface paths {
1555
1555
  requestBody: {
1556
1556
  content: {
1557
1557
  "application/json": {
1558
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
1558
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
1559
1559
  };
1560
1560
  };
1561
1561
  };
@@ -1707,7 +1707,7 @@ export interface paths {
1707
1707
  "application/json": {
1708
1708
  data: {
1709
1709
  transactionId: string;
1710
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
1710
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
1711
1711
  amount: number;
1712
1712
  extPaymentId: string;
1713
1713
  paymentProviderId: string;
@@ -2126,7 +2126,7 @@ export interface paths {
2126
2126
  extReferenceCode: string;
2127
2127
  paymentMethod: string;
2128
2128
  paymentProviderName: string;
2129
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
2129
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
2130
2130
  createdAt: string;
2131
2131
  updatedAt: string;
2132
2132
  };
@@ -2529,6 +2529,112 @@ export interface paths {
2529
2529
  patch?: never;
2530
2530
  trace?: never;
2531
2531
  };
2532
+ "/api/v1/transactions/{transactionId}/cancel-payment": {
2533
+ parameters: {
2534
+ query?: never;
2535
+ header?: never;
2536
+ path?: never;
2537
+ cookie?: never;
2538
+ };
2539
+ get?: never;
2540
+ put?: never;
2541
+ post: {
2542
+ parameters: {
2543
+ query?: never;
2544
+ header?: never;
2545
+ path: {
2546
+ transactionId: string;
2547
+ };
2548
+ cookie?: never;
2549
+ };
2550
+ requestBody?: never;
2551
+ responses: {
2552
+ /** @description Default Response */
2553
+ 200: {
2554
+ headers: {
2555
+ [name: string]: unknown;
2556
+ };
2557
+ content: {
2558
+ "application/json": {
2559
+ data: {
2560
+ success: boolean;
2561
+ };
2562
+ metadata?: {
2563
+ /** @description Object containing the links to the related endpoints */
2564
+ links?: {
2565
+ self: {
2566
+ /** @description URL pointing to the request itself */
2567
+ href?: string;
2568
+ };
2569
+ next?: {
2570
+ /** @description URL pointing to the next page of results in a paginated response. If there are no more results, this field may be omitted */
2571
+ href?: string;
2572
+ };
2573
+ prev?: {
2574
+ /** @description URL pointing to the previous page of results in a paginated response. If there are no more results, this field may be omitted */
2575
+ href?: string;
2576
+ };
2577
+ first: {
2578
+ /** @description URL pointing to the first page of results in a paginated response */
2579
+ href?: string;
2580
+ };
2581
+ last: {
2582
+ /** @description URL pointing to the first page of results in a paginated response */
2583
+ href?: string;
2584
+ };
2585
+ /** @description It may contain a list of other useful URLs, e.g. one entry for page:'page 1', 'page 2' */
2586
+ pages: {
2587
+ [key: string]: {
2588
+ href?: string;
2589
+ };
2590
+ };
2591
+ };
2592
+ /** @description Number representing the total number of available items */
2593
+ totalCount?: number;
2594
+ };
2595
+ };
2596
+ };
2597
+ };
2598
+ /** @description Default Response */
2599
+ 401: {
2600
+ headers: {
2601
+ [name: string]: unknown;
2602
+ };
2603
+ content: {
2604
+ "application/json": {
2605
+ code: string;
2606
+ detail: string;
2607
+ requestId: string;
2608
+ name: string;
2609
+ validation?: unknown;
2610
+ validationContext?: string;
2611
+ };
2612
+ };
2613
+ };
2614
+ /** @description Default Response */
2615
+ 500: {
2616
+ headers: {
2617
+ [name: string]: unknown;
2618
+ };
2619
+ content: {
2620
+ "application/json": {
2621
+ code: string;
2622
+ detail: string;
2623
+ requestId: string;
2624
+ name: string;
2625
+ validation?: unknown;
2626
+ validationContext?: string;
2627
+ };
2628
+ };
2629
+ };
2630
+ };
2631
+ };
2632
+ delete?: never;
2633
+ options?: never;
2634
+ head?: never;
2635
+ patch?: never;
2636
+ trace?: never;
2637
+ };
2532
2638
  "/api/v1/citizen/transactions": {
2533
2639
  parameters: {
2534
2640
  query?: never;
@@ -2557,7 +2663,7 @@ export interface paths {
2557
2663
  "application/json": {
2558
2664
  data: {
2559
2665
  transactionId: string;
2560
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
2666
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
2561
2667
  title: string;
2562
2668
  updatedAt: string;
2563
2669
  extPaymentId: string;
@@ -2684,7 +2790,7 @@ export interface paths {
2684
2790
  "application/json": {
2685
2791
  data: {
2686
2792
  transactionId: string;
2687
- status: "initiated" | "pending" | "succeeded" | "cancelled" | "failed";
2793
+ status: "initiated" | "pending" | "succeeded" | "cancelled" | "cancellation_requested" | "failed" | "refunded" | "refund_failed";
2688
2794
  amount: number;
2689
2795
  extPaymentId: string;
2690
2796
  paymentProviderId: string;