@openfin/cloud-interop-core-api 0.0.1-alpha.ee112ff → 0.0.1-alpha.ee4dac8

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 (3) hide show
  1. package/index.cjs +5 -1
  2. package/index.mjs +5 -1
  3. package/package.json +5 -8
package/index.cjs CHANGED
@@ -1,8 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var buffer = require('buffer');
4
+ require('fs');
5
+ require('path');
4
6
  var mqtt = require('mqtt');
5
7
 
8
+ var u=n=>{let e=n.replaceAll("-","+").replaceAll("_","/");return e.padEnd(e.length+(4-e.length%4)%4,"=")};
9
+
6
10
  class CloudInteropAPIError extends Error {
7
11
  code;
8
12
  constructor(message = 'An unexpected error has occurred', code = 'UNEXPECTED_ERROR', cause) {
@@ -684,7 +688,7 @@ class CloudInteropAPI {
684
688
  }
685
689
  const payload = parts[1];
686
690
  // Decode base64url encoded payload
687
- const decodedBytes = buffer.Buffer.from(payload, 'base64url');
691
+ const decodedBytes = buffer.Buffer.from(u(payload), 'base64');
688
692
  const payloadJson = decodedBytes.toString('utf8');
689
693
  // Parse JSON to get the exp claim
690
694
  const claims = JSON.parse(payloadJson);
package/index.mjs CHANGED
@@ -1,6 +1,10 @@
1
1
  import { Buffer } from 'buffer';
2
+ import 'fs';
3
+ import 'path';
2
4
  import mqtt from 'mqtt';
3
5
 
6
+ var u=n=>{let e=n.replaceAll("-","+").replaceAll("_","/");return e.padEnd(e.length+(4-e.length%4)%4,"=")};
7
+
4
8
  class CloudInteropAPIError extends Error {
5
9
  code;
6
10
  constructor(message = 'An unexpected error has occurred', code = 'UNEXPECTED_ERROR', cause) {
@@ -682,7 +686,7 @@ class CloudInteropAPI {
682
686
  }
683
687
  const payload = parts[1];
684
688
  // Decode base64url encoded payload
685
- const decodedBytes = Buffer.from(payload, 'base64url');
689
+ const decodedBytes = Buffer.from(u(payload), 'base64');
686
690
  const payloadJson = decodedBytes.toString('utf8');
687
691
  // Parse JSON to get the exp claim
688
692
  const claims = JSON.parse(payloadJson);
package/package.json CHANGED
@@ -1,18 +1,15 @@
1
1
  {
2
2
  "name": "@openfin/cloud-interop-core-api",
3
- "version": "0.0.1-alpha.ee112ff",
4
- "type": "module",
3
+ "version": "0.0.1-alpha.ee4dac8",
5
4
  "description": "",
5
+ "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "browser": "./index.mjs",
8
8
  "types": "./bundle.d.ts",
9
- "author": "",
9
+ "author": "support@here.io",
10
10
  "license": "SEE LICENSE IN LICENSE.md",
11
11
  "dependencies": {
12
- "mqtt": "^5.13.0",
13
- "zod": "^3.24.4"
14
- },
15
- "optionalDependencies": {
16
- "@rollup/rollup-linux-x64-gnu": "*"
12
+ "mqtt": "^5.15.1",
13
+ "zod": "catalog:"
17
14
  }
18
15
  }