@ogcio/building-blocks-sdk 0.1.18 → 0.2.0

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 (28) hide show
  1. package/.gitleaksignore +2 -0
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +11 -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 +2 -1835
  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 +2763 -2750
  11. package/dist/client/clients/messaging/schema.d.ts.map +1 -1
  12. package/dist/client/clients/profile/index.d.ts +852 -440
  13. package/dist/client/clients/profile/index.d.ts.map +1 -1
  14. package/dist/client/clients/profile/index.js +88 -54
  15. package/dist/client/clients/profile/index.js.map +1 -1
  16. package/dist/client/clients/profile/schema.d.ts +1237 -1114
  17. package/dist/client/clients/profile/schema.d.ts.map +1 -1
  18. package/dist/clients-configurations/clients-configuration.json +5 -4
  19. package/package.json +1 -1
  20. package/src/client/clients/featureFlags/open-api-definition.json +184 -95
  21. package/src/client/clients/featureFlags/schema.ts +205 -63
  22. package/src/client/clients/messaging/index.ts +2 -278
  23. package/src/client/clients/messaging/open-api-definition.json +30 -18
  24. package/src/client/clients/messaging/schema.ts +2763 -2750
  25. package/src/client/clients/profile/index.ts +140 -84
  26. package/src/client/clients/profile/open-api-definition.json +1825 -1323
  27. package/src/client/clients/profile/schema.ts +1237 -1114
  28. package/src/clients-configurations/clients-configuration.json +5 -4
@@ -328,248 +328,8 @@ export class Messaging extends BaseClient<paths> {
328
328
  async deleteEmailProvider(providerId: string) {
329
329
  return this.client
330
330
  .DELETE("/api/v1/providers/{providerId}", {
331
- params: { path: { providerId } },
332
- })
333
- .then(
334
- (response) => formatResponse(response, this.serviceName, this.logger),
335
- (reason) => formatError(reason, this.serviceName, this.logger),
336
- );
337
- }
338
-
339
- async getSmsProviders(
340
- params?: {
341
- primary?: boolean;
342
- } & PaginationParams,
343
- ) {
344
- const { primary } = params || {};
345
- const { error, data } = await this.client.GET("/api/v1/providers/", {
346
- params: {
347
- query: {
348
- type: "sms",
349
- ...preparePaginationParams(params),
350
- primary:
351
- primary !== undefined ? (primary ? "true" : "false") : undefined,
352
- },
353
- },
354
- });
355
-
356
- return {
357
- error,
358
- data: data?.data
359
- .filter((item: { type?: string }) => item.type === "sms")
360
- .map(
361
- (item: { id: string; providerName: string; isPrimary: boolean }) => ({
362
- id: item.id,
363
- providerName: item.providerName,
364
- isPrimary: item.isPrimary,
365
- }),
366
- ),
367
- };
368
- }
369
-
370
- async getSmsProvider(providerId: string) {
371
- const { data, error } = await this.client.GET(
372
- "/api/v1/providers/{providerId}",
373
- {
374
- params: { path: { providerId }, query: { type: "sms" } },
375
- },
376
- );
377
-
378
- // Let's do some type plumbing for the implementor
379
- if (data?.data.type === "sms") {
380
- return { data: data.data };
381
- }
382
-
383
- // Can we throw or return a new NotFoundError here?
384
- return { error };
385
- }
386
-
387
- async updateSmsProvider(provider: {
388
- id: string;
389
- providerName: string;
390
- isPrimary: boolean;
391
- // Union other config types
392
- config: {
393
- type: "AWS";
394
- accessKey: string;
395
- secretAccessKey: string;
396
- region: string;
397
- };
398
- }) {
399
- return this.client
400
- .PUT("/api/v1/providers/{providerId}", {
401
- params: { path: { providerId: provider.id } },
402
- body: {
403
- type: "sms",
404
- ...provider,
405
- },
406
- })
407
- .then(
408
- (response) => formatResponse(response, this.serviceName, this.logger),
409
- (reason) => formatError(reason, this.serviceName, this.logger),
410
- );
411
- }
412
-
413
- async createSmsProvider(provider: {
414
- providerName: string;
415
- isPrimary: boolean;
416
- // Union other config types
417
- config: {
418
- type: "AWS";
419
- accessKey: string;
420
- secretAccessKey: string;
421
- region: string;
422
- };
423
- }) {
424
- return this.client
425
- .POST("/api/v1/providers/", {
426
- body: {
427
- type: "sms",
428
- ...provider,
429
- },
430
- })
431
- .then(
432
- (response) => formatResponse(response, this.serviceName, this.logger),
433
- (reason) => formatError(reason, this.serviceName, this.logger),
434
- );
435
- }
436
-
437
- async deleteSmsProvider(providerId: string) {
438
- return this.client
439
- .DELETE("/api/v1/providers/{providerId}", {
440
- params: { path: { providerId } },
441
- })
442
- .then(
443
- (response) => formatResponse(response, this.serviceName, this.logger),
444
- (reason) => formatError(reason, this.serviceName, this.logger),
445
- );
446
- }
447
-
448
- async importUsers(toImport: { file?: File; records?: object[] }) {
449
- if (toImport.file) {
450
- const { data, error } = await this.client.POST("/api/v1/user-imports/", {
451
- body: {
452
- file: toImport.file,
453
- },
454
- bodySerializer: (body: unknown) => {
455
- const parsed = body as { file?: File } | undefined;
456
- if (!parsed || !parsed.file) {
457
- throw createError.BadRequest("File is missing!");
458
- }
459
- const formData = new FormData();
460
- formData.set("file", parsed.file);
461
- return formData;
462
- },
463
- });
464
- return { data: data?.data, error };
465
- }
466
-
467
- return this.client
468
- .POST("/api/v1/user-imports/", {
469
- body: toImport.records,
470
- })
471
- .then(
472
- (response) => formatResponse(response, this.serviceName, this.logger),
473
- (reason) => formatError(reason, this.serviceName, this.logger),
474
- );
475
- }
476
-
477
- async downloadUsersCsvTemplate() {
478
- return this.client
479
- .GET("/api/v1/user-imports/template-download", {
480
- parseAs: "blob",
481
- })
482
- .then(
483
- (response) => formatResponse(response, this.serviceName, this.logger),
484
- (reason) => formatError(reason, this.serviceName, this.logger),
485
- );
486
- }
487
-
488
- async getUsersImports(
489
- pagination: { limit: number; offset: number } = { limit: 100, offset: 0 },
490
- ) {
491
- return this.client
492
- .GET("/api/v1/user-imports/", {
493
- params: {
494
- query: {
495
- limit: toStringOrUndefined(pagination?.limit),
496
- offset: toStringOrUndefined(pagination?.offset),
497
- },
498
- },
499
- })
500
- .then(
501
- (response) => formatResponse(response, this.serviceName, this.logger),
502
- (reason) => formatError(reason, this.serviceName, this.logger),
503
- );
504
- }
505
-
506
- async getUsersImport(importId: string, includeUsersData?: boolean) {
507
- const includeImportedData =
508
- typeof includeUsersData === "undefined"
509
- ? undefined
510
- : includeUsersData
511
- ? "true"
512
- : "false";
513
- return this.client
514
- .GET("/api/v1/user-imports/{importId}", {
515
- params: {
516
- path: { importId },
517
- query: {
518
- includeImportedData,
519
- },
520
- },
521
- })
522
- .then(
523
- (response) => formatResponse(response, this.serviceName, this.logger),
524
- (reason) => formatError(reason, this.serviceName, this.logger),
525
- );
526
- }
527
-
528
- async getUsersForImport(importId: string, activeOnly: boolean) {
529
- return this.client
530
- .GET("/api/v1/users/", {
531
- params: { query: { importId, activeOnly: String(activeOnly) } },
532
- })
533
- .then(
534
- (response) => formatResponse(response, this.serviceName, this.logger),
535
- (reason) => formatError(reason, this.serviceName, this.logger),
536
- );
537
- }
538
-
539
- async getOrganisationsSettings(filter?: PaginationParams) {
540
- return this.client
541
- .GET("/api/v1/organisation-settings/", {
542
- params: {
543
- query: {
544
- ...preparePaginationParams(filter),
545
- },
546
- },
547
- })
548
- .then(
549
- (response) => formatResponse(response, this.serviceName, this.logger),
550
- (reason) => formatError(reason, this.serviceName, this.logger),
551
- );
552
- }
553
-
554
- async getOrganisationSettings(organisationSettingId: string) {
555
- return this.client
556
- .GET("/api/v1/organisation-settings/{organisationSettingId}", {
557
- params: { path: { organisationSettingId } },
558
- })
559
- .then(
560
- (response) => formatResponse(response, this.serviceName, this.logger),
561
- (reason) => formatError(reason, this.serviceName, this.logger),
562
- );
563
- }
564
-
565
- async updateOrganisationSettings(
566
- organisationSettingId: string,
567
- body: paths["/api/v1/organisation-settings/{organisationSettingId}"]["patch"]["requestBody"]["content"]["application/json"],
568
- ) {
569
- return this.client
570
- .PATCH("/api/v1/organisation-settings/{organisationSettingId}", {
571
- body,
572
- params: { path: { organisationSettingId } },
331
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
332
+ params: { path: { providerId }, query: { type: "email" } as any },
573
333
  })
574
334
  .then(
575
335
  (response) => formatResponse(response, this.serviceName, this.logger),
@@ -601,42 +361,6 @@ export class Messaging extends BaseClient<paths> {
601
361
  );
602
362
  }
603
363
 
604
- async getUsers(
605
- query?: paths["/api/v1/users/"]["get"]["parameters"]["query"],
606
- ) {
607
- return this.client
608
- .GET("/api/v1/users/", {
609
- params: {
610
- query: { ...query, ...preparePaginationParams(query) },
611
- },
612
- })
613
- .then(
614
- (response) => formatResponse(response, this.serviceName, this.logger),
615
- (reason) => formatError(reason, this.serviceName, this.logger),
616
- );
617
- }
618
-
619
- async getUser(
620
- userId: paths["/api/v1/users/{userId}"]["get"]["parameters"]["path"]["userId"],
621
- activeOnly: boolean,
622
- ) {
623
- return this.client
624
- .GET("/api/v1/users/{userId}", {
625
- params: {
626
- path: {
627
- userId,
628
- },
629
- query: {
630
- activeOnly: toStringOrUndefined(activeOnly),
631
- },
632
- },
633
- })
634
- .then(
635
- (response) => formatResponse(response, this.serviceName, this.logger),
636
- (reason) => formatError(reason, this.serviceName, this.logger),
637
- );
638
- }
639
-
640
364
  async seeMessage(messageId: string) {
641
365
  return this.client
642
366
  .PUT("/api/v1/message-actions/{messageId}", {
@@ -18,6 +18,7 @@
18
18
  "paths": {
19
19
  "/api/v1/messages/": {
20
20
  "get": {
21
+ "operationId": "ListMessages",
21
22
  "tags": [
22
23
  "Messages"
23
24
  ],
@@ -351,6 +352,7 @@
351
352
  }
352
353
  },
353
354
  "post": {
355
+ "operationId": "CreateMessage",
354
356
  "tags": [
355
357
  "Messages"
356
358
  ],
@@ -686,6 +688,7 @@
686
688
  },
687
689
  "/api/v1/messages/{messageId}": {
688
690
  "get": {
691
+ "operationId": "GetMessage",
689
692
  "tags": [
690
693
  "Messages"
691
694
  ],
@@ -983,6 +986,7 @@
983
986
  },
984
987
  "/api/v1/providers/": {
985
988
  "get": {
989
+ "operationId": "ListProviders",
986
990
  "tags": [
987
991
  "Providers"
988
992
  ],
@@ -1007,8 +1011,8 @@
1007
1011
  "schema": {
1008
1012
  "type": "string",
1009
1013
  "enum": [
1010
- "sms",
1011
- "email"
1014
+ "email",
1015
+ "sms"
1012
1016
  ]
1013
1017
  },
1014
1018
  "in": "query",
@@ -1068,8 +1072,8 @@
1068
1072
  "type": {
1069
1073
  "type": "string",
1070
1074
  "enum": [
1071
- "sms",
1072
- "email"
1075
+ "email",
1076
+ "sms"
1073
1077
  ],
1074
1078
  "description": "Provider types that can be manipulated"
1075
1079
  }
@@ -1283,6 +1287,7 @@
1283
1287
  }
1284
1288
  },
1285
1289
  "post": {
1290
+ "operationId": "CreateProvider",
1286
1291
  "tags": [
1287
1292
  "Providers"
1288
1293
  ],
@@ -1647,8 +1652,8 @@
1647
1652
  "schema": {
1648
1653
  "type": "string",
1649
1654
  "enum": [
1650
- "sms",
1651
- "email"
1655
+ "email",
1656
+ "sms"
1652
1657
  ]
1653
1658
  },
1654
1659
  "in": "query",
@@ -2007,6 +2012,7 @@
2007
2012
  }
2008
2013
  },
2009
2014
  "put": {
2015
+ "operationId": "UpdateProvider",
2010
2016
  "tags": [
2011
2017
  "Providers"
2012
2018
  ],
@@ -2381,6 +2387,7 @@
2381
2387
  }
2382
2388
  },
2383
2389
  "delete": {
2390
+ "operationId": "DeleteProvider",
2384
2391
  "tags": [
2385
2392
  "Providers"
2386
2393
  ],
@@ -2619,6 +2626,7 @@
2619
2626
  },
2620
2627
  "/api/v1/templates/": {
2621
2628
  "get": {
2629
+ "operationId": "ListTemplates",
2622
2630
  "tags": [
2623
2631
  "Templates"
2624
2632
  ],
@@ -2897,6 +2905,7 @@
2897
2905
  }
2898
2906
  },
2899
2907
  "post": {
2908
+ "operationId": "CreateTemplate",
2900
2909
  "tags": [
2901
2910
  "Templates"
2902
2911
  ],
@@ -3206,6 +3215,7 @@
3206
3215
  },
3207
3216
  "/api/v1/templates/{templateId}": {
3208
3217
  "get": {
3218
+ "operationId": "GetTemplate",
3209
3219
  "tags": [
3210
3220
  "Templates"
3211
3221
  ],
@@ -3503,6 +3513,7 @@
3503
3513
  }
3504
3514
  },
3505
3515
  "put": {
3516
+ "operationId": "UpdateTemplate",
3506
3517
  "tags": [
3507
3518
  "Templates"
3508
3519
  ],
@@ -3826,6 +3837,7 @@
3826
3837
  }
3827
3838
  },
3828
3839
  "delete": {
3840
+ "operationId": "DeleteTemplate",
3829
3841
  "tags": [
3830
3842
  "Templates"
3831
3843
  ],
@@ -4180,8 +4192,8 @@
4180
4192
  "items": {
4181
4193
  "type": "string",
4182
4194
  "enum": [
4183
- "sms",
4184
- "email"
4195
+ "email",
4196
+ "sms"
4185
4197
  ],
4186
4198
  "description": "Provider types that can be manipulated"
4187
4199
  }
@@ -4726,8 +4738,8 @@
4726
4738
  "items": {
4727
4739
  "type": "string",
4728
4740
  "enum": [
4729
- "sms",
4730
- "email"
4741
+ "email",
4742
+ "sms"
4731
4743
  ],
4732
4744
  "description": "Provider types that can be manipulated"
4733
4745
  }
@@ -5194,8 +5206,8 @@
5194
5206
  "items": {
5195
5207
  "type": "string",
5196
5208
  "enum": [
5197
- "sms",
5198
- "email"
5209
+ "email",
5210
+ "sms"
5199
5211
  ],
5200
5212
  "description": "Provider types that can be manipulated"
5201
5213
  }
@@ -5306,8 +5318,8 @@
5306
5318
  "items": {
5307
5319
  "type": "string",
5308
5320
  "enum": [
5309
- "sms",
5310
- "email"
5321
+ "email",
5322
+ "sms"
5311
5323
  ],
5312
5324
  "description": "Provider types that can be manipulated"
5313
5325
  }
@@ -7204,8 +7216,8 @@
7204
7216
  "items": {
7205
7217
  "type": "string",
7206
7218
  "enum": [
7207
- "sms",
7208
- "email"
7219
+ "email",
7220
+ "sms"
7209
7221
  ],
7210
7222
  "description": "Provider types that can be manipulated"
7211
7223
  }
@@ -7769,8 +7781,8 @@
7769
7781
  "items": {
7770
7782
  "type": "string",
7771
7783
  "enum": [
7772
- "sms",
7773
- "email"
7784
+ "email",
7785
+ "sms"
7774
7786
  ],
7775
7787
  "description": "Provider types that can be manipulated"
7776
7788
  }