@certik/skynet 0.20.2 → 0.22.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.
- package/CHANGELOG.md +17 -0
- package/abi.ts +2 -4
- package/api.ts +7 -7
- package/app.ts +6 -12
- package/availability.ts +37 -7
- package/bun.lockb +0 -0
- package/const.ts +1 -1
- package/date.ts +1 -1
- package/deploy.ts +4 -4
- package/dist/abi.d.ts +112 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +616 -0
- package/dist/address.d.ts +3 -0
- package/dist/address.d.ts.map +1 -0
- package/dist/address.js +69 -0
- package/dist/api.d.ts +32 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +35174 -0
- package/dist/app.d.ts +102 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +71714 -0
- package/dist/availability.d.ts +24 -0
- package/dist/availability.d.ts.map +1 -0
- package/dist/availability.js +926 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +86 -0
- package/dist/const.d.ts +35 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +207 -0
- package/dist/databricks.d.ts +4 -0
- package/dist/databricks.d.ts.map +1 -0
- package/dist/databricks.js +84920 -0
- package/dist/date.d.ts +6 -0
- package/dist/date.d.ts.map +1 -0
- package/dist/date.js +101 -0
- package/dist/deploy.d.ts +76 -0
- package/dist/deploy.d.ts.map +1 -0
- package/dist/deploy.js +17506 -0
- package/dist/dynamodb.d.ts +17 -0
- package/dist/dynamodb.d.ts.map +1 -0
- package/dist/dynamodb.js +27365 -0
- package/dist/env.d.ts +7 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +71 -0
- package/dist/graphql.d.ts +6 -0
- package/dist/graphql.d.ts.map +1 -0
- package/dist/graphql.js +73 -0
- package/dist/indexer.d.ts +70 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +36979 -0
- package/dist/log.d.ts +14 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +108 -0
- package/dist/object-hash.d.ts +2 -0
- package/dist/object-hash.d.ts.map +1 -0
- package/dist/object-hash.js +446 -0
- package/dist/opsgenie.d.ts +21 -0
- package/dist/opsgenie.d.ts.map +1 -0
- package/dist/opsgenie.js +320 -0
- package/dist/por.d.ts +38 -0
- package/dist/por.d.ts.map +1 -0
- package/dist/por.js +164 -0
- package/dist/s3.d.ts +21 -0
- package/dist/s3.d.ts.map +1 -0
- package/dist/s3.js +28878 -0
- package/dist/search.d.ts +6 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +37754 -0
- package/dist/selector.d.ts +18 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +89 -0
- package/dist/slack.d.ts +9 -0
- package/dist/slack.d.ts.map +1 -0
- package/dist/slack.js +16844 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +72 -0
- package/dist/xxhash.win32-x64-msvc-hrdz34v7.node +0 -0
- package/examples/api.ts +1 -1
- package/examples/indexer.ts +1 -1
- package/examples/mode-indexer.ts +1 -1
- package/indexer.ts +11 -11
- package/log.ts +22 -4
- package/object-hash.ts +66 -0
- package/package.json +102 -4
- package/por.ts +181 -0
- package/search.ts +2 -2
- package/tsconfig.build.json +24 -0
- package/tsconfig.json +5 -5
- package/web3.ts +0 -41
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function print(o: unknown): string;
|
|
2
|
+
declare function getLine(params: unknown[]): string;
|
|
3
|
+
declare const inline: {
|
|
4
|
+
debug: (...args: unknown[]) => void;
|
|
5
|
+
log: (...args: unknown[]) => void;
|
|
6
|
+
error: (...args: unknown[]) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const logger: {
|
|
9
|
+
debug: (...args: unknown[]) => void;
|
|
10
|
+
log: (...args: unknown[]) => void;
|
|
11
|
+
error: (...args: unknown[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export { print, getLine, inline, logger };
|
|
14
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../log.ts"],"names":[],"mappings":"AAIA,iBAAS,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAYjC;AAED,iBAAS,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,UAWjC;AAMD,QAAA,MAAM,MAAM;qBACgB,OAAO,EAAE;mBAKX,OAAO,EAAE;qBAKP,OAAO,EAAE;CAKpC,CAAC;AAEF,QAAA,MAAM,MAAM;qBACgB,OAAO,EAAE;mBAKX,OAAO,EAAE;qBAKP,OAAO,EAAE;CAKpC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/log.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
+
for (let key of __getOwnPropNames(mod))
|
|
12
|
+
if (!__hasOwnProp.call(to, key))
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: () => mod[key],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
20
|
+
var __toCommonJS = (from) => {
|
|
21
|
+
var entry = __moduleCache.get(from), desc;
|
|
22
|
+
if (entry)
|
|
23
|
+
return entry;
|
|
24
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
26
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
27
|
+
get: () => from[key],
|
|
28
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
+
}));
|
|
30
|
+
__moduleCache.set(from, entry);
|
|
31
|
+
return entry;
|
|
32
|
+
};
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, {
|
|
37
|
+
get: all[name],
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
set: (newValue) => all[name] = () => newValue
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
44
|
+
var __require = import.meta.require;
|
|
45
|
+
|
|
46
|
+
// log.ts
|
|
47
|
+
function isObject(a) {
|
|
48
|
+
return !!a && a.constructor === Object;
|
|
49
|
+
}
|
|
50
|
+
function print(o) {
|
|
51
|
+
if (Array.isArray(o)) {
|
|
52
|
+
return `[${o.map(print).join(", ")}]`;
|
|
53
|
+
}
|
|
54
|
+
if (isObject(o)) {
|
|
55
|
+
return `{${Object.keys(o).map((k) => `${k}: ${o[k]}`).join(", ")}}`;
|
|
56
|
+
}
|
|
57
|
+
return `${o}`;
|
|
58
|
+
}
|
|
59
|
+
function getLine(params) {
|
|
60
|
+
let line = "";
|
|
61
|
+
for (let i = 0, l = params.length;i < l; i++) {
|
|
62
|
+
line += `${print(params[i])} `.replace(/\n/gm, "\t");
|
|
63
|
+
}
|
|
64
|
+
return line.trim();
|
|
65
|
+
}
|
|
66
|
+
function timestamp() {
|
|
67
|
+
return new Date().toISOString();
|
|
68
|
+
}
|
|
69
|
+
var inline = {
|
|
70
|
+
debug: function(...args) {
|
|
71
|
+
if (true) {
|
|
72
|
+
console.log(`${timestamp()} ${getLine(args)}`);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
log: function(...args) {
|
|
76
|
+
if (true) {
|
|
77
|
+
console.log(`${timestamp()} ${getLine(args)}`);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
error: function(...args) {
|
|
81
|
+
if (true) {
|
|
82
|
+
console.error(`${timestamp()} ${getLine(args)}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var logger = {
|
|
87
|
+
debug: function(...args) {
|
|
88
|
+
if (true) {
|
|
89
|
+
console.log(`[${timestamp()}]`, ...args);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
log: function(...args) {
|
|
93
|
+
if (true) {
|
|
94
|
+
console.log(`[${timestamp()}]`, ...args);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
error: function(...args) {
|
|
98
|
+
if (true) {
|
|
99
|
+
console.error(`[${timestamp()}]`, ...args);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
print,
|
|
105
|
+
logger,
|
|
106
|
+
inline,
|
|
107
|
+
getLine
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-hash.d.ts","sourceRoot":"","sources":["../object-hash.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,UAInC"}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
+
for (let key of __getOwnPropNames(mod))
|
|
12
|
+
if (!__hasOwnProp.call(to, key))
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: () => mod[key],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
20
|
+
var __toCommonJS = (from) => {
|
|
21
|
+
var entry = __moduleCache.get(from), desc;
|
|
22
|
+
if (entry)
|
|
23
|
+
return entry;
|
|
24
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
26
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
27
|
+
get: () => from[key],
|
|
28
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
+
}));
|
|
30
|
+
__moduleCache.set(from, entry);
|
|
31
|
+
return entry;
|
|
32
|
+
};
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, {
|
|
37
|
+
get: all[name],
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
set: (newValue) => all[name] = () => newValue
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
44
|
+
var __require = import.meta.require;
|
|
45
|
+
|
|
46
|
+
// node_modules/@node-rs/xxhash-win32-x64-msvc/xxhash.win32-x64-msvc.node
|
|
47
|
+
var require_xxhash_win32_x64_msvc = __commonJS((exports, module) => {
|
|
48
|
+
module.exports = __require("./xxhash.win32-x64-msvc-hrdz34v7.node");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// node_modules/@node-rs/xxhash/index.js
|
|
52
|
+
var require_xxhash = __commonJS((exports, module) => {
|
|
53
|
+
var __filename = "G:\\certik\\certik-skynet\\lib-skynet\\node_modules\\@node-rs\\xxhash\\index.js";
|
|
54
|
+
var { createRequire } = __require("module");
|
|
55
|
+
__require = createRequire(__filename);
|
|
56
|
+
var { readFileSync } = __require("fs");
|
|
57
|
+
var nativeBinding = null;
|
|
58
|
+
var loadErrors = [];
|
|
59
|
+
var isMusl = () => {
|
|
60
|
+
let musl = false;
|
|
61
|
+
if (process.platform === "linux") {
|
|
62
|
+
musl = isMuslFromFilesystem();
|
|
63
|
+
if (musl === null) {
|
|
64
|
+
musl = isMuslFromReport();
|
|
65
|
+
}
|
|
66
|
+
if (musl === null) {
|
|
67
|
+
musl = isMuslFromChildProcess();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return musl;
|
|
71
|
+
};
|
|
72
|
+
var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
73
|
+
var isMuslFromFilesystem = () => {
|
|
74
|
+
try {
|
|
75
|
+
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var isMuslFromReport = () => {
|
|
81
|
+
const report = typeof process.report.getReport === "function" ? process.report.getReport() : null;
|
|
82
|
+
if (!report) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (report.header && report.header.glibcVersionRuntime) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
89
|
+
if (report.sharedObjects.some(isFileMusl)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
};
|
|
95
|
+
var isMuslFromChildProcess = () => {
|
|
96
|
+
try {
|
|
97
|
+
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
98
|
+
} catch (e) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function requireNative() {
|
|
103
|
+
if (process.platform === "android") {
|
|
104
|
+
if (process.arch === "arm64") {
|
|
105
|
+
try {
|
|
106
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.android-arm64.node");})();
|
|
107
|
+
} catch (e) {
|
|
108
|
+
loadErrors.push(e);
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-android-arm64");})();
|
|
112
|
+
} catch (e) {
|
|
113
|
+
loadErrors.push(e);
|
|
114
|
+
}
|
|
115
|
+
} else if (process.arch === "arm") {
|
|
116
|
+
try {
|
|
117
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.android-arm-eabi.node");})();
|
|
118
|
+
} catch (e) {
|
|
119
|
+
loadErrors.push(e);
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-android-arm-eabi");})();
|
|
123
|
+
} catch (e) {
|
|
124
|
+
loadErrors.push(e);
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
128
|
+
}
|
|
129
|
+
} else if (process.platform === "win32") {
|
|
130
|
+
if (process.arch === "x64") {
|
|
131
|
+
try {
|
|
132
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.win32-x64-msvc.node");})();
|
|
133
|
+
} catch (e) {
|
|
134
|
+
loadErrors.push(e);
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
return require_xxhash_win32_x64_msvc();
|
|
138
|
+
} catch (e) {
|
|
139
|
+
loadErrors.push(e);
|
|
140
|
+
}
|
|
141
|
+
} else if (process.arch === "ia32") {
|
|
142
|
+
try {
|
|
143
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.win32-ia32-msvc.node");})();
|
|
144
|
+
} catch (e) {
|
|
145
|
+
loadErrors.push(e);
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-win32-ia32-msvc");})();
|
|
149
|
+
} catch (e) {
|
|
150
|
+
loadErrors.push(e);
|
|
151
|
+
}
|
|
152
|
+
} else if (process.arch === "arm64") {
|
|
153
|
+
try {
|
|
154
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.win32-arm64-msvc.node");})();
|
|
155
|
+
} catch (e) {
|
|
156
|
+
loadErrors.push(e);
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-win32-arm64-msvc");})();
|
|
160
|
+
} catch (e) {
|
|
161
|
+
loadErrors.push(e);
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
165
|
+
}
|
|
166
|
+
} else if (process.platform === "darwin") {
|
|
167
|
+
try {
|
|
168
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.darwin-universal.node");})();
|
|
169
|
+
} catch (e) {
|
|
170
|
+
loadErrors.push(e);
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-darwin-universal");})();
|
|
174
|
+
} catch (e) {
|
|
175
|
+
loadErrors.push(e);
|
|
176
|
+
}
|
|
177
|
+
if (process.arch === "x64") {
|
|
178
|
+
try {
|
|
179
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.darwin-x64.node");})();
|
|
180
|
+
} catch (e) {
|
|
181
|
+
loadErrors.push(e);
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-darwin-x64");})();
|
|
185
|
+
} catch (e) {
|
|
186
|
+
loadErrors.push(e);
|
|
187
|
+
}
|
|
188
|
+
} else if (process.arch === "arm64") {
|
|
189
|
+
try {
|
|
190
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.darwin-arm64.node");})();
|
|
191
|
+
} catch (e) {
|
|
192
|
+
loadErrors.push(e);
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-darwin-arm64");})();
|
|
196
|
+
} catch (e) {
|
|
197
|
+
loadErrors.push(e);
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
201
|
+
}
|
|
202
|
+
} else if (process.platform === "freebsd") {
|
|
203
|
+
if (process.arch === "x64") {
|
|
204
|
+
try {
|
|
205
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.freebsd-x64.node");})();
|
|
206
|
+
} catch (e) {
|
|
207
|
+
loadErrors.push(e);
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-freebsd-x64");})();
|
|
211
|
+
} catch (e) {
|
|
212
|
+
loadErrors.push(e);
|
|
213
|
+
}
|
|
214
|
+
} else if (process.arch === "arm64") {
|
|
215
|
+
try {
|
|
216
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.freebsd-arm64.node");})();
|
|
217
|
+
} catch (e) {
|
|
218
|
+
loadErrors.push(e);
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-freebsd-arm64");})();
|
|
222
|
+
} catch (e) {
|
|
223
|
+
loadErrors.push(e);
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
227
|
+
}
|
|
228
|
+
} else if (process.platform === "linux") {
|
|
229
|
+
if (process.arch === "x64") {
|
|
230
|
+
if (isMusl()) {
|
|
231
|
+
try {
|
|
232
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-x64-musl.node");})();
|
|
233
|
+
} catch (e) {
|
|
234
|
+
loadErrors.push(e);
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-x64-musl");})();
|
|
238
|
+
} catch (e) {
|
|
239
|
+
loadErrors.push(e);
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
try {
|
|
243
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-x64-gnu.node");})();
|
|
244
|
+
} catch (e) {
|
|
245
|
+
loadErrors.push(e);
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-x64-gnu");})();
|
|
249
|
+
} catch (e) {
|
|
250
|
+
loadErrors.push(e);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
} else if (process.arch === "arm64") {
|
|
254
|
+
if (isMusl()) {
|
|
255
|
+
try {
|
|
256
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-arm64-musl.node");})();
|
|
257
|
+
} catch (e) {
|
|
258
|
+
loadErrors.push(e);
|
|
259
|
+
}
|
|
260
|
+
try {
|
|
261
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-arm64-musl");})();
|
|
262
|
+
} catch (e) {
|
|
263
|
+
loadErrors.push(e);
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
try {
|
|
267
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-arm64-gnu.node");})();
|
|
268
|
+
} catch (e) {
|
|
269
|
+
loadErrors.push(e);
|
|
270
|
+
}
|
|
271
|
+
try {
|
|
272
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-arm64-gnu");})();
|
|
273
|
+
} catch (e) {
|
|
274
|
+
loadErrors.push(e);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} else if (process.arch === "arm") {
|
|
278
|
+
if (isMusl()) {
|
|
279
|
+
try {
|
|
280
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-arm-musleabihf.node");})();
|
|
281
|
+
} catch (e) {
|
|
282
|
+
loadErrors.push(e);
|
|
283
|
+
}
|
|
284
|
+
try {
|
|
285
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-arm-musleabihf");})();
|
|
286
|
+
} catch (e) {
|
|
287
|
+
loadErrors.push(e);
|
|
288
|
+
}
|
|
289
|
+
} else {
|
|
290
|
+
try {
|
|
291
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-arm-gnueabihf.node");})();
|
|
292
|
+
} catch (e) {
|
|
293
|
+
loadErrors.push(e);
|
|
294
|
+
}
|
|
295
|
+
try {
|
|
296
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-arm-gnueabihf");})();
|
|
297
|
+
} catch (e) {
|
|
298
|
+
loadErrors.push(e);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
} else if (process.arch === "riscv64") {
|
|
302
|
+
if (isMusl()) {
|
|
303
|
+
try {
|
|
304
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-riscv64-musl.node");})();
|
|
305
|
+
} catch (e) {
|
|
306
|
+
loadErrors.push(e);
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-riscv64-musl");})();
|
|
310
|
+
} catch (e) {
|
|
311
|
+
loadErrors.push(e);
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
try {
|
|
315
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-riscv64-gnu.node");})();
|
|
316
|
+
} catch (e) {
|
|
317
|
+
loadErrors.push(e);
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-riscv64-gnu");})();
|
|
321
|
+
} catch (e) {
|
|
322
|
+
loadErrors.push(e);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} else if (process.arch === "ppc64") {
|
|
326
|
+
try {
|
|
327
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-ppc64-gnu.node");})();
|
|
328
|
+
} catch (e) {
|
|
329
|
+
loadErrors.push(e);
|
|
330
|
+
}
|
|
331
|
+
try {
|
|
332
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-ppc64-gnu");})();
|
|
333
|
+
} catch (e) {
|
|
334
|
+
loadErrors.push(e);
|
|
335
|
+
}
|
|
336
|
+
} else if (process.arch === "s390x") {
|
|
337
|
+
try {
|
|
338
|
+
return (()=>{throw new Error("Cannot require module "+"./xxhash.linux-s390x-gnu.node");})();
|
|
339
|
+
} catch (e) {
|
|
340
|
+
loadErrors.push(e);
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
return (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-linux-s390x-gnu");})();
|
|
344
|
+
} catch (e) {
|
|
345
|
+
loadErrors.push(e);
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
nativeBinding = requireNative();
|
|
355
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
356
|
+
try {
|
|
357
|
+
nativeBinding = (()=>{throw new Error("Cannot require module "+"./xxhash.wasi.cjs");})();
|
|
358
|
+
} catch (err) {
|
|
359
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
360
|
+
loadErrors.push(err);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (!nativeBinding) {
|
|
364
|
+
try {
|
|
365
|
+
nativeBinding = (()=>{throw new Error("Cannot require module "+"@node-rs/xxhash-wasm32-wasi");})();
|
|
366
|
+
} catch (err) {
|
|
367
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
368
|
+
loadErrors.push(err);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (!nativeBinding) {
|
|
374
|
+
if (loadErrors.length > 0) {
|
|
375
|
+
throw new Error("Failed to load native binding", { cause: loadErrors });
|
|
376
|
+
}
|
|
377
|
+
throw new Error(`Failed to load native binding`);
|
|
378
|
+
}
|
|
379
|
+
exports.Xxh32 = nativeBinding.Xxh32;
|
|
380
|
+
exports.Xxh64 = nativeBinding.Xxh64;
|
|
381
|
+
exports.xxh32 = nativeBinding.xxh32;
|
|
382
|
+
exports.xxh64 = nativeBinding.xxh64;
|
|
383
|
+
exports.xxh3 = nativeBinding.xxh3;
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// object-hash.ts
|
|
387
|
+
var import_xxhash = __toESM(require_xxhash(), 1);
|
|
388
|
+
function getHash(obj) {
|
|
389
|
+
const xxh3 = import_xxhash.default.xxh3.Xxh3.withSeed();
|
|
390
|
+
hash(obj, xxh3);
|
|
391
|
+
return xxh3.digest().toString(16);
|
|
392
|
+
}
|
|
393
|
+
function hash(obj, xxh3) {
|
|
394
|
+
if (obj === null) {
|
|
395
|
+
xxh3.update("null");
|
|
396
|
+
} else if (obj === undefined) {
|
|
397
|
+
xxh3.update("undefined");
|
|
398
|
+
} else if (typeof obj === "string") {
|
|
399
|
+
xxh3.update(obj);
|
|
400
|
+
} else if (typeof obj === "number") {
|
|
401
|
+
xxh3.update(obj.toString());
|
|
402
|
+
} else if (typeof obj === "boolean") {
|
|
403
|
+
xxh3.update(obj.toString());
|
|
404
|
+
} else if (typeof obj === "bigint") {
|
|
405
|
+
xxh3.update(obj.toString());
|
|
406
|
+
} else if (obj instanceof Date) {
|
|
407
|
+
xxh3.update(obj.toISOString());
|
|
408
|
+
} else if (Array.isArray(obj)) {
|
|
409
|
+
arrayHash(obj, xxh3);
|
|
410
|
+
} else if (obj instanceof Set) {
|
|
411
|
+
setHash(obj, xxh3);
|
|
412
|
+
} else if (obj instanceof Map) {
|
|
413
|
+
mapHash(obj, xxh3);
|
|
414
|
+
} else if (typeof obj === "object") {
|
|
415
|
+
objectHash(obj, xxh3);
|
|
416
|
+
} else {
|
|
417
|
+
throw new Error(`Unsupported type: ${obj}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function arrayHash(array, xxh3) {
|
|
421
|
+
xxh3.update("[");
|
|
422
|
+
for (const obj of array) {
|
|
423
|
+
hash(obj, xxh3);
|
|
424
|
+
}
|
|
425
|
+
xxh3.update("]");
|
|
426
|
+
}
|
|
427
|
+
function setHash(_set, _xxh3) {
|
|
428
|
+
throw new Error("Set hashing not implemented");
|
|
429
|
+
}
|
|
430
|
+
function mapHash(map, xxh3) {
|
|
431
|
+
const array = Array.from(map.entries()).sort(([aKey], [bKey]) => aKey.localeCompare(bKey));
|
|
432
|
+
for (const [key, value] of array) {
|
|
433
|
+
hash(key, xxh3);
|
|
434
|
+
hash(value, xxh3);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function objectHash(obj, xxh3) {
|
|
438
|
+
const array = Object.entries(obj).sort(([aKey], [bKey]) => aKey.localeCompare(bKey));
|
|
439
|
+
for (const [key, value] of array) {
|
|
440
|
+
hash(key, xxh3);
|
|
441
|
+
hash(value, xxh3);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
export {
|
|
445
|
+
getHash
|
|
446
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type OpsgenieResponse = {
|
|
2
|
+
data: {
|
|
3
|
+
success: boolean;
|
|
4
|
+
action: string;
|
|
5
|
+
processedAt: string;
|
|
6
|
+
integrationId: string;
|
|
7
|
+
isSuccess: boolean;
|
|
8
|
+
status: string;
|
|
9
|
+
alertId: string;
|
|
10
|
+
alias: string;
|
|
11
|
+
};
|
|
12
|
+
took: number;
|
|
13
|
+
requestId: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function postGenieMessage(body: {
|
|
16
|
+
alias?: string;
|
|
17
|
+
message: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
}, apiKey?: string, verbose?: boolean): Promise<OpsgenieResponse>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=opsgenie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opsgenie.d.ts","sourceRoot":"","sources":["../opsgenie.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAUF,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IACJ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,EACD,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,6BAoClB"}
|