@ogcio/building-blocks-sdk 0.2.98 → 0.2.100

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 (41) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/dist/client/clients/journey/index.d.ts +36 -9
  4. package/dist/client/clients/journey/index.d.ts.map +1 -1
  5. package/dist/client/clients/journey/schema.d.ts +31 -8
  6. package/dist/client/clients/journey/schema.d.ts.map +1 -1
  7. package/dist/client/clients/messaging-public-api/citizen/index.d.ts +602 -0
  8. package/dist/client/clients/messaging-public-api/citizen/index.d.ts.map +1 -0
  9. package/dist/client/clients/messaging-public-api/citizen/index.js +34 -0
  10. package/dist/client/clients/messaging-public-api/citizen/index.js.map +1 -0
  11. package/dist/client/clients/messaging-public-api/index.d.ts +18 -0
  12. package/dist/client/clients/messaging-public-api/index.d.ts.map +1 -0
  13. package/dist/client/clients/messaging-public-api/index.js +15 -0
  14. package/dist/client/clients/messaging-public-api/index.js.map +1 -0
  15. package/dist/client/clients/messaging-public-api/organisation/index.d.ts +621 -0
  16. package/dist/client/clients/messaging-public-api/organisation/index.d.ts.map +1 -0
  17. package/dist/client/clients/messaging-public-api/organisation/index.js +49 -0
  18. package/dist/client/clients/messaging-public-api/organisation/index.js.map +1 -0
  19. package/dist/client/clients/messaging-public-api/schema.d.ts +2464 -0
  20. package/dist/client/clients/messaging-public-api/schema.d.ts.map +1 -0
  21. package/dist/client/clients/messaging-public-api/schema.js +2 -0
  22. package/dist/client/clients/messaging-public-api/schema.js.map +1 -0
  23. package/dist/clients-configurations/clients-configuration.json +17 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/types/index.d.ts +9 -3
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/index.js +2 -1
  30. package/dist/types/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/client/clients/journey/open-api-definition.json +221 -33
  33. package/src/client/clients/journey/schema.ts +31 -8
  34. package/src/client/clients/messaging-public-api/citizen/index.ts +57 -0
  35. package/src/client/clients/messaging-public-api/index.ts +35 -0
  36. package/src/client/clients/messaging-public-api/open-api-definition.json +4539 -0
  37. package/src/client/clients/messaging-public-api/organisation/index.ts +79 -0
  38. package/src/client/clients/messaging-public-api/schema.ts +2463 -0
  39. package/src/clients-configurations/clients-configuration.json +17 -1
  40. package/src/index.ts +7 -0
  41. package/src/types/index.ts +9 -0
@@ -1149,20 +1149,27 @@
1149
1149
  "en": "Return to Dashboard",
1150
1150
  "ga": "Filleadh ar an mPainéal Riaracháin"
1151
1151
  },
1152
- "returnUrl": "https://services.gov.ie/dashboard"
1152
+ "returnUrl": {
1153
+ "en": "https://services.gov.ie/en/dashboard",
1154
+ "ga": "https://services.gov.ie/ga/dashboard"
1155
+ }
1153
1156
  },
1154
1157
  {
1155
1158
  "buttonLabel": {
1156
1159
  "en": "Continue to Next Step",
1157
1160
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
1158
1161
  },
1159
- "returnUrl": "https://services.gov.ie/next-step"
1162
+ "returnUrl": {
1163
+ "en": "https://services.gov.ie/en/next-step"
1164
+ }
1160
1165
  },
1161
1166
  {
1162
1167
  "buttonLabel": {
1163
1168
  "en": "View Results"
1164
1169
  },
1165
- "returnUrl": "https://services.gov.ie/results"
1170
+ "returnUrl": {
1171
+ "en": "https://services.gov.ie/en/results"
1172
+ }
1166
1173
  }
1167
1174
  ],
1168
1175
  "type": "object",
@@ -1186,8 +1193,30 @@
1186
1193
  }
1187
1194
  },
1188
1195
  "returnUrl": {
1189
- "validator": "URLValidator",
1190
- "type": "string"
1196
+ "type": "object",
1197
+ "required": [
1198
+ "en"
1199
+ ],
1200
+ "properties": {
1201
+ "en": {
1202
+ "validator": {
1203
+ "name": "URLValidator",
1204
+ "options": {
1205
+ "parentField": "returnUrl"
1206
+ }
1207
+ },
1208
+ "type": "string"
1209
+ },
1210
+ "ga": {
1211
+ "validator": {
1212
+ "name": "URLValidator",
1213
+ "options": {
1214
+ "parentField": "returnUrl"
1215
+ }
1216
+ },
1217
+ "type": "string"
1218
+ }
1219
+ }
1191
1220
  }
1192
1221
  }
1193
1222
  },
@@ -3844,20 +3873,27 @@
3844
3873
  "en": "Return to Dashboard",
3845
3874
  "ga": "Filleadh ar an mPainéal Riaracháin"
3846
3875
  },
3847
- "returnUrl": "https://services.gov.ie/dashboard"
3876
+ "returnUrl": {
3877
+ "en": "https://services.gov.ie/en/dashboard",
3878
+ "ga": "https://services.gov.ie/ga/dashboard"
3879
+ }
3848
3880
  },
3849
3881
  {
3850
3882
  "buttonLabel": {
3851
3883
  "en": "Continue to Next Step",
3852
3884
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
3853
3885
  },
3854
- "returnUrl": "https://services.gov.ie/next-step"
3886
+ "returnUrl": {
3887
+ "en": "https://services.gov.ie/en/next-step"
3888
+ }
3855
3889
  },
3856
3890
  {
3857
3891
  "buttonLabel": {
3858
3892
  "en": "View Results"
3859
3893
  },
3860
- "returnUrl": "https://services.gov.ie/results"
3894
+ "returnUrl": {
3895
+ "en": "https://services.gov.ie/en/results"
3896
+ }
3861
3897
  }
3862
3898
  ],
3863
3899
  "type": "object",
@@ -3881,8 +3917,30 @@
3881
3917
  }
3882
3918
  },
3883
3919
  "returnUrl": {
3884
- "validator": "URLValidator",
3885
- "type": "string"
3920
+ "type": "object",
3921
+ "required": [
3922
+ "en"
3923
+ ],
3924
+ "properties": {
3925
+ "en": {
3926
+ "validator": {
3927
+ "name": "URLValidator",
3928
+ "options": {
3929
+ "parentField": "returnUrl"
3930
+ }
3931
+ },
3932
+ "type": "string"
3933
+ },
3934
+ "ga": {
3935
+ "validator": {
3936
+ "name": "URLValidator",
3937
+ "options": {
3938
+ "parentField": "returnUrl"
3939
+ }
3940
+ },
3941
+ "type": "string"
3942
+ }
3943
+ }
3886
3944
  }
3887
3945
  }
3888
3946
  },
@@ -4443,20 +4501,27 @@
4443
4501
  "en": "Return to Dashboard",
4444
4502
  "ga": "Filleadh ar an mPainéal Riaracháin"
4445
4503
  },
4446
- "returnUrl": "https://services.gov.ie/dashboard"
4504
+ "returnUrl": {
4505
+ "en": "https://services.gov.ie/en/dashboard",
4506
+ "ga": "https://services.gov.ie/ga/dashboard"
4507
+ }
4447
4508
  },
4448
4509
  {
4449
4510
  "buttonLabel": {
4450
4511
  "en": "Continue to Next Step",
4451
4512
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
4452
4513
  },
4453
- "returnUrl": "https://services.gov.ie/next-step"
4514
+ "returnUrl": {
4515
+ "en": "https://services.gov.ie/en/next-step"
4516
+ }
4454
4517
  },
4455
4518
  {
4456
4519
  "buttonLabel": {
4457
4520
  "en": "View Results"
4458
4521
  },
4459
- "returnUrl": "https://services.gov.ie/results"
4522
+ "returnUrl": {
4523
+ "en": "https://services.gov.ie/en/results"
4524
+ }
4460
4525
  }
4461
4526
  ],
4462
4527
  "type": "object",
@@ -4480,8 +4545,30 @@
4480
4545
  }
4481
4546
  },
4482
4547
  "returnUrl": {
4483
- "validator": "URLValidator",
4484
- "type": "string"
4548
+ "type": "object",
4549
+ "required": [
4550
+ "en"
4551
+ ],
4552
+ "properties": {
4553
+ "en": {
4554
+ "validator": {
4555
+ "name": "URLValidator",
4556
+ "options": {
4557
+ "parentField": "returnUrl"
4558
+ }
4559
+ },
4560
+ "type": "string"
4561
+ },
4562
+ "ga": {
4563
+ "validator": {
4564
+ "name": "URLValidator",
4565
+ "options": {
4566
+ "parentField": "returnUrl"
4567
+ }
4568
+ },
4569
+ "type": "string"
4570
+ }
4571
+ }
4485
4572
  }
4486
4573
  }
4487
4574
  },
@@ -4757,20 +4844,27 @@
4757
4844
  "en": "Return to Dashboard",
4758
4845
  "ga": "Filleadh ar an mPainéal Riaracháin"
4759
4846
  },
4760
- "returnUrl": "https://services.gov.ie/dashboard"
4847
+ "returnUrl": {
4848
+ "en": "https://services.gov.ie/en/dashboard",
4849
+ "ga": "https://services.gov.ie/ga/dashboard"
4850
+ }
4761
4851
  },
4762
4852
  {
4763
4853
  "buttonLabel": {
4764
4854
  "en": "Continue to Next Step",
4765
4855
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
4766
4856
  },
4767
- "returnUrl": "https://services.gov.ie/next-step"
4857
+ "returnUrl": {
4858
+ "en": "https://services.gov.ie/en/next-step"
4859
+ }
4768
4860
  },
4769
4861
  {
4770
4862
  "buttonLabel": {
4771
4863
  "en": "View Results"
4772
4864
  },
4773
- "returnUrl": "https://services.gov.ie/results"
4865
+ "returnUrl": {
4866
+ "en": "https://services.gov.ie/en/results"
4867
+ }
4774
4868
  }
4775
4869
  ],
4776
4870
  "type": "object",
@@ -4794,8 +4888,30 @@
4794
4888
  }
4795
4889
  },
4796
4890
  "returnUrl": {
4797
- "validator": "URLValidator",
4798
- "type": "string"
4891
+ "type": "object",
4892
+ "required": [
4893
+ "en"
4894
+ ],
4895
+ "properties": {
4896
+ "en": {
4897
+ "validator": {
4898
+ "name": "URLValidator",
4899
+ "options": {
4900
+ "parentField": "returnUrl"
4901
+ }
4902
+ },
4903
+ "type": "string"
4904
+ },
4905
+ "ga": {
4906
+ "validator": {
4907
+ "name": "URLValidator",
4908
+ "options": {
4909
+ "parentField": "returnUrl"
4910
+ }
4911
+ },
4912
+ "type": "string"
4913
+ }
4914
+ }
4799
4915
  }
4800
4916
  }
4801
4917
  },
@@ -5244,20 +5360,27 @@
5244
5360
  "en": "Return to Dashboard",
5245
5361
  "ga": "Filleadh ar an mPainéal Riaracháin"
5246
5362
  },
5247
- "returnUrl": "https://services.gov.ie/dashboard"
5363
+ "returnUrl": {
5364
+ "en": "https://services.gov.ie/en/dashboard",
5365
+ "ga": "https://services.gov.ie/ga/dashboard"
5366
+ }
5248
5367
  },
5249
5368
  {
5250
5369
  "buttonLabel": {
5251
5370
  "en": "Continue to Next Step",
5252
5371
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
5253
5372
  },
5254
- "returnUrl": "https://services.gov.ie/next-step"
5373
+ "returnUrl": {
5374
+ "en": "https://services.gov.ie/en/next-step"
5375
+ }
5255
5376
  },
5256
5377
  {
5257
5378
  "buttonLabel": {
5258
5379
  "en": "View Results"
5259
5380
  },
5260
- "returnUrl": "https://services.gov.ie/results"
5381
+ "returnUrl": {
5382
+ "en": "https://services.gov.ie/en/results"
5383
+ }
5261
5384
  }
5262
5385
  ],
5263
5386
  "type": "object",
@@ -5281,8 +5404,30 @@
5281
5404
  }
5282
5405
  },
5283
5406
  "returnUrl": {
5284
- "validator": "URLValidator",
5285
- "type": "string"
5407
+ "type": "object",
5408
+ "required": [
5409
+ "en"
5410
+ ],
5411
+ "properties": {
5412
+ "en": {
5413
+ "validator": {
5414
+ "name": "URLValidator",
5415
+ "options": {
5416
+ "parentField": "returnUrl"
5417
+ }
5418
+ },
5419
+ "type": "string"
5420
+ },
5421
+ "ga": {
5422
+ "validator": {
5423
+ "name": "URLValidator",
5424
+ "options": {
5425
+ "parentField": "returnUrl"
5426
+ }
5427
+ },
5428
+ "type": "string"
5429
+ }
5430
+ }
5286
5431
  }
5287
5432
  }
5288
5433
  },
@@ -5505,20 +5650,27 @@
5505
5650
  "en": "Return to Dashboard",
5506
5651
  "ga": "Filleadh ar an mPainéal Riaracháin"
5507
5652
  },
5508
- "returnUrl": "https://services.gov.ie/dashboard"
5653
+ "returnUrl": {
5654
+ "en": "https://services.gov.ie/en/dashboard",
5655
+ "ga": "https://services.gov.ie/ga/dashboard"
5656
+ }
5509
5657
  },
5510
5658
  {
5511
5659
  "buttonLabel": {
5512
5660
  "en": "Continue to Next Step",
5513
5661
  "ga": "Lean ar aghaidh chuig an gcéad chéim eile"
5514
5662
  },
5515
- "returnUrl": "https://services.gov.ie/next-step"
5663
+ "returnUrl": {
5664
+ "en": "https://services.gov.ie/en/next-step"
5665
+ }
5516
5666
  },
5517
5667
  {
5518
5668
  "buttonLabel": {
5519
5669
  "en": "View Results"
5520
5670
  },
5521
- "returnUrl": "https://services.gov.ie/results"
5671
+ "returnUrl": {
5672
+ "en": "https://services.gov.ie/en/results"
5673
+ }
5522
5674
  }
5523
5675
  ],
5524
5676
  "type": "object",
@@ -5542,8 +5694,30 @@
5542
5694
  }
5543
5695
  },
5544
5696
  "returnUrl": {
5545
- "validator": "URLValidator",
5546
- "type": "string"
5697
+ "type": "object",
5698
+ "required": [
5699
+ "en"
5700
+ ],
5701
+ "properties": {
5702
+ "en": {
5703
+ "validator": {
5704
+ "name": "URLValidator",
5705
+ "options": {
5706
+ "parentField": "returnUrl"
5707
+ }
5708
+ },
5709
+ "type": "string"
5710
+ },
5711
+ "ga": {
5712
+ "validator": {
5713
+ "name": "URLValidator",
5714
+ "options": {
5715
+ "parentField": "returnUrl"
5716
+ }
5717
+ },
5718
+ "type": "string"
5719
+ }
5720
+ }
5547
5721
  }
5548
5722
  }
5549
5723
  },
@@ -9822,8 +9996,20 @@
9822
9996
  }
9823
9997
  },
9824
9998
  "returnUrl": {
9825
- "validator": "URLValidator",
9826
- "type": "string"
9999
+ "type": "object",
10000
+ "required": [
10001
+ "en"
10002
+ ],
10003
+ "properties": {
10004
+ "en": {
10005
+ "validator": "URLValidator",
10006
+ "type": "string"
10007
+ },
10008
+ "ga": {
10009
+ "validator": "URLValidator",
10010
+ "type": "string"
10011
+ }
10012
+ }
9827
10013
  }
9828
10014
  },
9829
10015
  "example": {
@@ -9837,7 +10023,9 @@
9837
10023
  "en": "View Submission",
9838
10024
  "ga": "Féach ar an gCur isteach"
9839
10025
  },
9840
- "returnUrl": "https://services.gov.ie/dashboard/submissions/970B0547"
10026
+ "returnUrl": {
10027
+ "en": "https://services.gov.ie/en/dashboard/submissions/970B0547"
10028
+ }
9841
10029
  }
9842
10030
  },
9843
10031
  "metadata": {
@@ -942,7 +942,10 @@ export interface operations {
942
942
  en: string;
943
943
  ga?: string;
944
944
  };
945
- returnUrl: string;
945
+ returnUrl: {
946
+ en: string;
947
+ ga?: string;
948
+ };
946
949
  } | {
947
950
  uiConfig?: {
948
951
  setupPageVersion?: string;
@@ -1848,7 +1851,10 @@ export interface operations {
1848
1851
  en: string;
1849
1852
  ga?: string;
1850
1853
  };
1851
- returnUrl: string;
1854
+ returnUrl: {
1855
+ en: string;
1856
+ ga?: string;
1857
+ };
1852
1858
  } | {
1853
1859
  uiConfig?: {
1854
1860
  setupPageVersion?: string;
@@ -1951,7 +1957,10 @@ export interface operations {
1951
1957
  en: string;
1952
1958
  ga?: string;
1953
1959
  };
1954
- returnUrl: string;
1960
+ returnUrl: {
1961
+ en: string;
1962
+ ga?: string;
1963
+ };
1955
1964
  } | {
1956
1965
  uiConfig?: {
1957
1966
  setupPageVersion?: string;
@@ -2008,7 +2017,10 @@ export interface operations {
2008
2017
  en: string;
2009
2018
  ga?: string;
2010
2019
  };
2011
- returnUrl: string;
2020
+ returnUrl: {
2021
+ en: string;
2022
+ ga?: string;
2023
+ };
2012
2024
  } | {
2013
2025
  uiConfig?: {
2014
2026
  setupPageVersion?: string;
@@ -2209,7 +2221,10 @@ export interface operations {
2209
2221
  en: string;
2210
2222
  ga?: string;
2211
2223
  };
2212
- returnUrl: string;
2224
+ returnUrl: {
2225
+ en: string;
2226
+ ga?: string;
2227
+ };
2213
2228
  } | {
2214
2229
  uiConfig?: {
2215
2230
  setupPageVersion?: string;
@@ -2264,7 +2279,10 @@ export interface operations {
2264
2279
  en: string;
2265
2280
  ga?: string;
2266
2281
  };
2267
- returnUrl: string;
2282
+ returnUrl: {
2283
+ en: string;
2284
+ ga?: string;
2285
+ };
2268
2286
  } | {
2269
2287
  uiConfig?: {
2270
2288
  setupPageVersion?: string;
@@ -3590,7 +3608,9 @@ export interface operations {
3590
3608
  * "en": "View Submission",
3591
3609
  * "ga": "Féach ar an gCur isteach"
3592
3610
  * },
3593
- * "returnUrl": "https://services.gov.ie/dashboard/submissions/970B0547"
3611
+ * "returnUrl": {
3612
+ * "en": "https://services.gov.ie/en/dashboard/submissions/970B0547"
3613
+ * }
3594
3614
  * }
3595
3615
  */
3596
3616
  data: {
@@ -3604,7 +3624,10 @@ export interface operations {
3604
3624
  en: string;
3605
3625
  ga?: string;
3606
3626
  };
3607
- returnUrl: string;
3627
+ returnUrl: {
3628
+ en: string;
3629
+ ga?: string;
3630
+ };
3608
3631
  };
3609
3632
  metadata?: {
3610
3633
  links?: {
@@ -0,0 +1,57 @@
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 MessagingPublicApiCitizen {
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 getMessage(
18
+ messageId: paths["/api/v1/citizens/messages/{messageId}"]["get"]["parameters"]["path"]["messageId"],
19
+ query?: paths["/api/v1/citizens/messages/{messageId}"]["get"]["parameters"]["query"],
20
+ ) {
21
+ throwIfEmpty(messageId);
22
+ return this.client
23
+ .GET("/api/v1/citizens/messages/{messageId}", {
24
+ params: { path: { messageId }, query },
25
+ })
26
+ .then(
27
+ (response) => formatResponse(response, this.serviceName, this.logger),
28
+ (reason) => formatError(reason, this.serviceName, this.logger),
29
+ );
30
+ }
31
+
32
+ async getMessages(
33
+ query?: paths["/api/v1/citizens/messages/"]["get"]["parameters"]["query"],
34
+ ) {
35
+ return this.client
36
+ .GET("/api/v1/citizens/messages/", {
37
+ params: { query },
38
+ })
39
+ .then(
40
+ (response) => formatResponse(response, this.serviceName, this.logger),
41
+ (reason) => formatError(reason, this.serviceName, this.logger),
42
+ );
43
+ }
44
+
45
+ async submitConsent(
46
+ body: paths["/api/v1/citizens/messages/consent"]["post"]["requestBody"]["content"]["application/json"],
47
+ ) {
48
+ return this.client
49
+ .POST("/api/v1/citizens/messages/consent", {
50
+ body,
51
+ })
52
+ .then(
53
+ (response) => formatResponse(response, this.serviceName, this.logger),
54
+ (reason) => formatError(reason, this.serviceName, this.logger),
55
+ );
56
+ }
57
+ }
@@ -0,0 +1,35 @@
1
+ import type createClient from "openapi-fetch";
2
+ import {
3
+ type Logger,
4
+ MESSAGING_PUBLIC_API,
5
+ type TokenFunction,
6
+ } from "../../../types/index.js";
7
+ import { BaseClient } from "../../base-client.js";
8
+ import { MessagingPublicApiCitizen } from "./citizen/index.js";
9
+ import { MessagingPublicApiOrganisation } from "./organisation/index.js";
10
+ import type { paths } from "./schema.js";
11
+
12
+ export class MessagingPublicApi extends BaseClient<paths> {
13
+ protected declare client: ReturnType<typeof createClient<paths>>;
14
+ protected serviceName = MESSAGING_PUBLIC_API;
15
+ public readonly citizen: MessagingPublicApiCitizen;
16
+ public readonly organisation: MessagingPublicApiOrganisation;
17
+
18
+ constructor(params: {
19
+ baseUrl: string;
20
+ getTokenFn?: TokenFunction;
21
+ logger?: Logger;
22
+ }) {
23
+ super(params);
24
+ this.citizen = new MessagingPublicApiCitizen(
25
+ this.client,
26
+ this.serviceName,
27
+ this.logger,
28
+ );
29
+ this.organisation = new MessagingPublicApiOrganisation(
30
+ this.client,
31
+ this.serviceName,
32
+ this.logger,
33
+ );
34
+ }
35
+ }