@ogcio/building-blocks-sdk 0.1.1 → 0.1.2

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 (40) hide show
  1. package/.azure/pipeline.yaml +122 -0
  2. package/.azure/templates/pnpm-install.yaml +21 -0
  3. package/.gitleaksignore +3 -0
  4. package/.husky/pre-commit +6 -2
  5. package/.husky/pre-push +1 -1
  6. package/README.md +12 -7
  7. package/dist/__tests__/index.test.js +9 -1
  8. package/dist/__tests__/index.test.js.map +1 -1
  9. package/dist/client/clients/journey/index.d.ts +2105 -0
  10. package/dist/client/clients/journey/index.d.ts.map +1 -0
  11. package/dist/client/clients/journey/index.js +210 -0
  12. package/dist/client/clients/journey/index.js.map +1 -0
  13. package/dist/client/clients/journey/schema.d.ts +2418 -0
  14. package/dist/client/clients/journey/schema.d.ts.map +1 -0
  15. package/dist/client/clients/journey/schema.js +2 -0
  16. package/dist/client/clients/journey/schema.js.map +1 -0
  17. package/dist/client/clients/payments/index.d.ts +5 -0
  18. package/dist/client/clients/payments/index.d.ts.map +1 -1
  19. package/dist/client/clients/payments/schema.d.ts +4 -0
  20. package/dist/client/clients/payments/schema.d.ts.map +1 -1
  21. package/dist/clients-configurations/clients-configuration.json +16 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/types/index.d.ts +9 -3
  26. package/dist/types/index.d.ts.map +1 -1
  27. package/dist/types/index.js +2 -1
  28. package/dist/types/index.js.map +1 -1
  29. package/kics-config.json +8 -0
  30. package/package.json +5 -2
  31. package/src/__tests__/index.test.ts +10 -1
  32. package/src/client/clients/journey/index.ts +340 -0
  33. package/src/client/clients/journey/open-api-definition.json +5756 -0
  34. package/src/client/clients/journey/schema.ts +2417 -0
  35. package/src/client/clients/payments/open-api-definition.json +12 -0
  36. package/src/client/clients/payments/schema.ts +4 -0
  37. package/src/clients-configurations/clients-configuration.json +16 -0
  38. package/src/index.ts +2 -0
  39. package/src/types/index.ts +10 -1
  40. package/vitest.config.mts +1 -1
@@ -3782,6 +3782,9 @@
3782
3782
  },
3783
3783
  "journeyTitle": {
3784
3784
  "type": "string"
3785
+ },
3786
+ "redirectUrl": {
3787
+ "type": "string"
3785
3788
  }
3786
3789
  },
3787
3790
  "required": [
@@ -4332,6 +4335,9 @@
4332
4335
  },
4333
4336
  "journeyTitle": {
4334
4337
  "type": "string"
4338
+ },
4339
+ "redirectUrl": {
4340
+ "type": "string"
4335
4341
  }
4336
4342
  },
4337
4343
  "required": [
@@ -4603,6 +4609,9 @@
4603
4609
  },
4604
4610
  "journeyTitle": {
4605
4611
  "type": "string"
4612
+ },
4613
+ "redirectUrl": {
4614
+ "type": "string"
4606
4615
  }
4607
4616
  },
4608
4617
  "required": [
@@ -5907,6 +5916,9 @@
5907
5916
  },
5908
5917
  "journeyTitle": {
5909
5918
  "type": "string"
5919
+ },
5920
+ "redirectUrl": {
5921
+ "type": "string"
5910
5922
  }
5911
5923
  },
5912
5924
  "required": [
@@ -1521,6 +1521,7 @@ export interface paths {
1521
1521
  runId?: string;
1522
1522
  journeyId?: string;
1523
1523
  journeyTitle?: string;
1524
+ redirectUrl?: string;
1524
1525
  };
1525
1526
  description: string;
1526
1527
  providerName: string;
@@ -1763,6 +1764,7 @@ export interface paths {
1763
1764
  runId?: string;
1764
1765
  journeyId?: string;
1765
1766
  journeyTitle?: string;
1767
+ redirectUrl?: string;
1766
1768
  };
1767
1769
  description: string;
1768
1770
  providerName: string;
@@ -1877,6 +1879,7 @@ export interface paths {
1877
1879
  runId?: string;
1878
1880
  journeyId?: string;
1879
1881
  journeyTitle?: string;
1882
+ redirectUrl?: string;
1880
1883
  };
1881
1884
  };
1882
1885
  };
@@ -2508,6 +2511,7 @@ export interface paths {
2508
2511
  runId?: string;
2509
2512
  journeyId?: string;
2510
2513
  journeyTitle?: string;
2514
+ redirectUrl?: string;
2511
2515
  };
2512
2516
  description: string;
2513
2517
  providerName: string;
@@ -88,6 +88,22 @@
88
88
  "citizenPermissions": [],
89
89
  "publicServantPermissions": [],
90
90
  "updateDefinitions": true
91
+ },
92
+ {
93
+ "name": "journey",
94
+ "openApiDefinitionUrl": "https://raw.githubusercontent.com/ogcio/life-events/refs/heads/dev/apps/journey-api/openapi-definition.yml",
95
+ "openApiDefinitionFormat": "yaml",
96
+ "citizenPermissions": [
97
+ "integrator:journey.public:read",
98
+ "integrator:run.self:read",
99
+ "integrator:run.self:write"
100
+ ],
101
+ "publicServantPermissions": [
102
+ "integrator:journey:*",
103
+ "integrator:step:*",
104
+ "integrator:run:read"
105
+ ],
106
+ "updateDefinitions": true
91
107
  }
92
108
  ]
93
109
  }
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ import { Payments } from "./client/clients/payments/index.js";
6
6
  import { Profile } from "./client/clients/profile/index.js";
7
7
  import { Scheduler } from "./client/clients/scheduler/index.js";
8
8
  import { Upload } from "./client/clients/upload/index.js";
9
+ import { Journey } from "./client/clients/journey/index.js";
9
10
  export { getM2MTokenFn } from "./client/auth/index.js";
10
11
 
11
12
  import type {
@@ -52,6 +53,7 @@ export const getBuildingBlockSDK = <T extends BuildingBlockSDKParams>(
52
53
  services.featureFlags,
53
54
  getTokenFn,
54
55
  ),
56
+ journey: createService(Journey, services.journey, getTokenFn),
55
57
  };
56
58
 
57
59
  // Remove undefined services
@@ -6,6 +6,7 @@ import type { Payments } from "../client/clients/payments/index.js";
6
6
  import type { Profile } from "../client/clients/profile/index.js";
7
7
  import type { Scheduler } from "../client/clients/scheduler/index.js";
8
8
  import type { Upload } from "../client/clients/upload/index.js";
9
+ import type { Journey } from "../client/clients/journey/index.js";
9
10
 
10
11
  const ANALYTICS = "analytics" as const;
11
12
  const MESSAGING = "messaging" as const;
@@ -14,6 +15,7 @@ const PROFILE = "profile" as const;
14
15
  const SCHEDULER = "scheduler" as const;
15
16
  const UPLOAD = "upload" as const;
16
17
  const FEATURE_FLAGS = "featureFlags" as const;
18
+ const JOURNEY = "journey" as const;
17
19
 
18
20
  type SERVICE_NAME =
19
21
  | typeof ANALYTICS
@@ -22,7 +24,8 @@ type SERVICE_NAME =
22
24
  | typeof PROFILE
23
25
  | typeof SCHEDULER
24
26
  | typeof UPLOAD
25
- | typeof FEATURE_FLAGS;
27
+ | typeof FEATURE_FLAGS
28
+ | typeof JOURNEY;
26
29
 
27
30
  interface AnalyticsConfig extends AnalyticsOptions {}
28
31
 
@@ -36,6 +39,7 @@ interface ProfileConfig extends ServiceBaseConfig {}
36
39
  interface SchedulerConfig extends ServiceBaseConfig {}
37
40
  interface UploadConfig extends ServiceBaseConfig {}
38
41
  interface FeatureFlagsConfig extends ServiceBaseConfig {}
42
+ interface JourneyConfig extends ServiceBaseConfig {}
39
43
 
40
44
  interface Services {
41
45
  analytics?: AnalyticsConfig;
@@ -45,6 +49,7 @@ interface Services {
45
49
  scheduler?: SchedulerConfig;
46
50
  upload?: UploadConfig;
47
51
  featureFlags?: FeatureFlagsConfig;
52
+ journey?: JourneyConfig;
48
53
  }
49
54
 
50
55
  type TokenFunction = (serviceName: SERVICE_NAME) => Promise<string>;
@@ -95,6 +100,7 @@ interface BuildingBlocksSDK {
95
100
  scheduler: Scheduler;
96
101
  upload: Upload;
97
102
  featureFlags: FeatureFlags;
103
+ journey: Journey;
98
104
  }
99
105
 
100
106
  export {
@@ -105,6 +111,7 @@ export {
105
111
  SCHEDULER,
106
112
  UPLOAD,
107
113
  FEATURE_FLAGS,
114
+ JOURNEY,
108
115
  };
109
116
 
110
117
  export type {
@@ -124,6 +131,8 @@ export type {
124
131
  UploadConfig,
125
132
  FeatureFlags,
126
133
  FeatureFlagsConfig,
134
+ Journey,
135
+ JourneyConfig,
127
136
  Services,
128
137
  TokenFunction,
129
138
  SERVICE_NAME,
package/vitest.config.mts CHANGED
@@ -4,7 +4,7 @@ export default defineConfig({
4
4
  test: {
5
5
  reporters: "default",
6
6
  coverage: {
7
- reporter: ["text"],
7
+ reporter: ["text", "cobertura"],
8
8
  provider: "istanbul",
9
9
  },
10
10