@aloma.io/integration-sdk 3.6.5 → 3.7.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 (32) hide show
  1. package/build/builder/index.d.mts +1 -1
  2. package/build/builder/index.mjs +13 -16
  3. package/build/builder/runtime-context.mjs +3 -2
  4. package/build/cli.mjs +15 -4
  5. package/build/internal/dispatcher/index.d.mts +11 -17
  6. package/build/internal/dispatcher/index.mjs +12 -1
  7. package/build/internal/fetcher/fetcher.d.mts +15 -0
  8. package/build/internal/fetcher/fetcher.mjs +97 -0
  9. package/build/internal/fetcher/index.d.mts +1 -0
  10. package/build/internal/fetcher/index.mjs +1 -0
  11. package/build/internal/fetcher/oauth-fetcher.d.mts +32 -0
  12. package/build/internal/fetcher/oauth-fetcher.mjs +114 -0
  13. package/build/internal/index.d.mts +8 -7
  14. package/build/internal/index.mjs +14 -241
  15. package/build/internal/util/index.d.mts +5 -0
  16. package/build/internal/util/index.mjs +45 -0
  17. package/build/internal/util/jwe/index.d.mts +5 -8
  18. package/build/internal/util/jwe/index.mjs +3 -0
  19. package/build/transform/index.d.mts +5 -0
  20. package/build/transform/index.mjs +79 -0
  21. package/package.json +1 -1
  22. package/src/builder/index.mts +14 -17
  23. package/src/builder/runtime-context.mts +4 -1
  24. package/src/cli.mts +19 -4
  25. package/src/internal/dispatcher/{index.mjs → index.mts} +14 -2
  26. package/src/internal/fetcher/fetcher.mts +126 -0
  27. package/src/internal/fetcher/oauth-fetcher.mts +147 -0
  28. package/src/internal/{index.mjs → index.mts} +18 -317
  29. package/src/internal/util/index.mts +57 -0
  30. package/src/internal/util/jwe/{index.mjs → index.mts} +7 -4
  31. /package/src/internal/util/jwe/{cli.mjs → cli.mts} +0 -0
  32. /package/src/{builder/transform → transform}/index.mts +0 -0
@@ -1,6 +1,9 @@
1
1
  import * as jose from "jose";
2
2
 
3
3
  class JWE {
4
+ issuer: string;
5
+ algorithm: string;
6
+ pair?: jose.GenerateKeyPairResult<jose.KeyLike>;
4
7
  constructor({ algorithm = "PS256" }) {
5
8
  this.issuer = "home.aloma.io";
6
9
  this.algorithm = algorithm;
@@ -12,8 +15,8 @@ class JWE {
12
15
 
13
16
  async exportPair() {
14
17
  return {
15
- publicKey: await jose.exportSPKI(this.pair.publicKey),
16
- privateKey: await jose.exportPKCS8(this.pair.privateKey),
18
+ publicKey: await jose.exportSPKI(this.pair!.publicKey),
19
+ privateKey: await jose.exportPKCS8(this.pair!.privateKey),
17
20
  };
18
21
  }
19
22
 
@@ -53,13 +56,13 @@ class JWE {
53
56
 
54
57
  if (expiration && expiration !== "none") item.setExpirationTime(expiration);
55
58
 
56
- return await item.encrypt(this.pair.publicKey);
59
+ return await item.encrypt(this.pair!.publicKey);
57
60
  }
58
61
 
59
62
  async decrypt(what, audience) {
60
63
  const { payload, protectedHeader } = await jose.jwtDecrypt(
61
64
  what,
62
- this.pair.privateKey,
65
+ this.pair!.privateKey,
63
66
  {
64
67
  issuer: this.issuer,
65
68
  audience,
File without changes
File without changes