@ubiquity-os/plugin-sdk 3.3.0 → 3.3.4

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.
package/dist/index.js CHANGED
@@ -62,7 +62,11 @@ var PluginRuntimeInfo = class _PluginRuntimeInfo {
62
62
  _PluginRuntimeInfo._instance = new CfRuntimeInfo(env);
63
63
  break;
64
64
  case "deno":
65
- _PluginRuntimeInfo._instance = new DenoRuntimeInfo(env);
65
+ if (process.env.CI) {
66
+ _PluginRuntimeInfo._instance = new NodeRuntimeInfo(env);
67
+ } else {
68
+ _PluginRuntimeInfo._instance = new DenoRuntimeInfo(env);
69
+ }
66
70
  break;
67
71
  case "node":
68
72
  _PluginRuntimeInfo._instance = new NodeRuntimeInfo(env);
package/dist/index.mjs CHANGED
@@ -23,7 +23,11 @@ var PluginRuntimeInfo = class _PluginRuntimeInfo {
23
23
  _PluginRuntimeInfo._instance = new CfRuntimeInfo(env);
24
24
  break;
25
25
  case "deno":
26
- _PluginRuntimeInfo._instance = new DenoRuntimeInfo(env);
26
+ if (process.env.CI) {
27
+ _PluginRuntimeInfo._instance = new NodeRuntimeInfo(env);
28
+ } else {
29
+ _PluginRuntimeInfo._instance = new DenoRuntimeInfo(env);
30
+ }
27
31
  break;
28
32
  case "node":
29
33
  _PluginRuntimeInfo._instance = new NodeRuntimeInfo(env);
package/dist/signature.js CHANGED
@@ -25,6 +25,16 @@ __export(signature_exports, {
25
25
  verifySignature: () => verifySignature
26
26
  });
27
27
  module.exports = __toCommonJS(signature_exports);
28
+
29
+ // src/helpers/compression.ts
30
+ var import_node_zlib = require("zlib");
31
+ function compressString(str) {
32
+ const input = Buffer.from(str, "utf8");
33
+ const compressed = (0, import_node_zlib.brotliCompressSync)(input);
34
+ return Buffer.from(compressed).toString("base64");
35
+ }
36
+
37
+ // src/signature.ts
28
38
  var PluginInput = class {
29
39
  _privateKey;
30
40
  stateId;
@@ -48,7 +58,7 @@ var PluginInput = class {
48
58
  const inputs = {
49
59
  stateId: this.stateId,
50
60
  eventName: this.eventName,
51
- eventPayload: JSON.stringify(this.eventPayload),
61
+ eventPayload: compressString(JSON.stringify(this.eventPayload)),
52
62
  settings: JSON.stringify(this.settings),
53
63
  authToken: this.authToken,
54
64
  ref: this.ref,
@@ -1,3 +1,11 @@
1
+ // src/helpers/compression.ts
2
+ import { brotliCompressSync, brotliDecompressSync } from "node:zlib";
3
+ function compressString(str) {
4
+ const input = Buffer.from(str, "utf8");
5
+ const compressed = brotliCompressSync(input);
6
+ return Buffer.from(compressed).toString("base64");
7
+ }
8
+
1
9
  // src/signature.ts
2
10
  var PluginInput = class {
3
11
  _privateKey;
@@ -22,7 +30,7 @@ var PluginInput = class {
22
30
  const inputs = {
23
31
  stateId: this.stateId,
24
32
  eventName: this.eventName,
25
- eventPayload: JSON.stringify(this.eventPayload),
33
+ eventPayload: compressString(JSON.stringify(this.eventPayload)),
26
34
  settings: JSON.stringify(this.settings),
27
35
  authToken: this.authToken,
28
36
  ref: this.ref,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubiquity-os/plugin-sdk",
3
- "version": "3.3.0",
3
+ "version": "3.3.4",
4
4
  "description": "SDK for plugin support.",
5
5
  "author": "Ubiquity DAO",
6
6
  "license": "MIT",