@certik/skynet 0.19.2 → 0.20.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/.vscode/settings.json +5 -0
- package/CHANGELOG.md +22 -0
- package/examples/api.ts +0 -0
- package/examples/indexer.ts +0 -0
- package/examples/mode-indexer.ts +0 -0
- package/package.json +23 -22
- package/patches/@databricks%2Fsql@1.9.0.patch +21 -0
- package/search.ts +2 -1
- package/bun.lockb +0 -0
- package/snowflake.ts +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
- Fix databricks with bun (extra step needed for projects using the lib):
|
|
6
|
+
|
|
7
|
+
- Copy the patch file `patches/@databricks%2Fsql@1.9.0.patch`
|
|
8
|
+
- Add the following configs to your `package.json`:
|
|
9
|
+
|
|
10
|
+
```json
|
|
11
|
+
"patchedDependencies": {
|
|
12
|
+
"@databricks/sql@1.9.0": "patches/@databricks%2Fsql@1.9.0.patch"
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- BREAKING: Remove support for snowflake
|
|
17
|
+
|
|
18
|
+
## 0.19.3
|
|
19
|
+
|
|
20
|
+
- Fix elastic search not working in bun
|
|
21
|
+
- Update packages
|
|
22
|
+
|
|
3
23
|
## 0.19.2
|
|
24
|
+
|
|
4
25
|
- Updated: type of `apiKey` in `Serve` and `ServeDefinition` types
|
|
5
26
|
|
|
6
27
|
## 0.19.1
|
|
28
|
+
|
|
7
29
|
- Fixed: the domain that nomad api prints in console on start
|
|
8
30
|
|
|
9
31
|
## 0.19.0
|
package/examples/api.ts
CHANGED
|
File without changes
|
package/examples/indexer.ts
CHANGED
|
File without changes
|
package/examples/mode-indexer.ts
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certik/skynet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Skynet Shared JS library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -15,40 +15,41 @@
|
|
|
15
15
|
"node": ">= 18"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
19
|
-
"@aws-sdk/client-s3": "^3.
|
|
20
|
-
"@aws-sdk/client-sqs": "^3.
|
|
21
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
18
|
+
"@aws-sdk/client-dynamodb": "^3.758.0",
|
|
19
|
+
"@aws-sdk/client-s3": "^3.758.0",
|
|
20
|
+
"@aws-sdk/client-sqs": "^3.758.0",
|
|
21
|
+
"@aws-sdk/lib-dynamodb": "^3.758.0",
|
|
22
22
|
"@databricks/sql": "^1.9.0",
|
|
23
|
-
"@elastic/elasticsearch": "^8.
|
|
24
|
-
"@slack/web-api": "^6.
|
|
25
|
-
"chalk": "^5.
|
|
26
|
-
"execa": "^9.
|
|
23
|
+
"@elastic/elasticsearch": "^8.17.1",
|
|
24
|
+
"@slack/web-api": "^6.13.0",
|
|
25
|
+
"chalk": "^5.4.1",
|
|
26
|
+
"execa": "^9.5.2",
|
|
27
27
|
"express": "^4.21.2",
|
|
28
28
|
"md5": "^2.3.0",
|
|
29
29
|
"meow": "^13.2.0",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"which": "^4.0.0"
|
|
30
|
+
"type-fest": "^4.35.0",
|
|
31
|
+
"web3": "^4.16.0",
|
|
32
|
+
"which": "^5.0.0"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@eslint/js": "^9.
|
|
37
|
-
"@types/bun": "^1.
|
|
35
|
+
"@eslint/js": "^9.21.0",
|
|
36
|
+
"@types/bun": "^1.2.4",
|
|
38
37
|
"@types/express": "^5.0.0",
|
|
39
38
|
"@types/md5": "^2.3.5",
|
|
40
39
|
"@types/which": "^3.0.4",
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"eslint-plugin-import": "^2.
|
|
40
|
+
"eslint": "^9.21.0",
|
|
41
|
+
"eslint-plugin-import": "^2.31.0",
|
|
43
42
|
"eslint-plugin-md": "^1.0.19",
|
|
44
|
-
"eslint-plugin-prettier": "^5.
|
|
45
|
-
"prettier": "^3.
|
|
46
|
-
"
|
|
47
|
-
"typescript": "^
|
|
48
|
-
"typescript-eslint": "^8.18.1"
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
44
|
+
"prettier": "^3.5.2",
|
|
45
|
+
"typescript": "^5.8.2",
|
|
46
|
+
"typescript-eslint": "^8.25.0"
|
|
49
47
|
},
|
|
50
48
|
"license": "MIT",
|
|
51
49
|
"publishConfig": {
|
|
52
50
|
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"patchedDependencies": {
|
|
53
|
+
"@databricks/sql@1.9.0": "patches/@databricks%2Fsql@1.9.0.patch"
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
diff --git a/dist/utils/lz4.js b/dist/utils/lz4.js
|
|
2
|
+
index d61c9bce9bfd4a85e1eec1c03070e6fdbc9771e5..fe440516e86f428446afe3c78ab0211a5a5b139c 100644
|
|
3
|
+
--- a/dist/utils/lz4.js
|
|
4
|
+
+++ b/dist/utils/lz4.js
|
|
5
|
+
@@ -1,15 +1,7 @@
|
|
6
|
+
"use strict";
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
function tryLoadLZ4Module() {
|
|
9
|
+
- try {
|
|
10
|
+
- return require('lz4'); // eslint-disable-line global-require
|
|
11
|
+
- }
|
|
12
|
+
- catch (err) {
|
|
13
|
+
- const isModuleNotFoundError = err instanceof Error && 'code' in err && err.code === 'MODULE_NOT_FOUND';
|
|
14
|
+
- if (!isModuleNotFoundError) {
|
|
15
|
+
- throw err;
|
|
16
|
+
- }
|
|
17
|
+
- }
|
|
18
|
+
+ return undefined;
|
|
19
|
+
}
|
|
20
|
+
exports.default = tryLoadLZ4Module();
|
|
21
|
+
//# sourceMappingURL=lz4.js.map
|
package/search.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isProduction } from "./env.ts";
|
|
2
2
|
import { inline } from "./log.ts";
|
|
3
|
-
import { Client } from "@elastic/elasticsearch";
|
|
3
|
+
import { Client, HttpConnection } from "@elastic/elasticsearch";
|
|
4
4
|
import osModule from "os";
|
|
5
5
|
|
|
6
6
|
type ElasticSearchRecord = {
|
|
@@ -15,6 +15,7 @@ export async function sendToSearch(indexPrefix: string, record: ElasticSearchRec
|
|
|
15
15
|
const client = new Client({
|
|
16
16
|
cloud: { id: process.env["SKYNET_ELASTICSEARCH_CLOUD_ID"] },
|
|
17
17
|
auth: { apiKey: process.env["SKYNET_ELASTICSEARCH_API_KEY"] },
|
|
18
|
+
Connection: HttpConnection, // bun compatibility, see https://github.com/oven-sh/bun/issues/7920
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
const now = new Date();
|
package/bun.lockb
DELETED
|
Binary file
|
package/snowflake.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import snowflake from "snowflake-sdk";
|
|
2
|
-
import type { ConnectionOptions, Connection, Binds } from "snowflake-sdk";
|
|
3
|
-
import { ensureAndGet } from "./env.js";
|
|
4
|
-
|
|
5
|
-
async function getConnection(options: Partial<ConnectionOptions>) {
|
|
6
|
-
const account = ensureAndGet("SKYNET_SNOWFLAKE_ACCOUNT");
|
|
7
|
-
const username = ensureAndGet("SKYNET_SNOWFLAKE_USERNAME");
|
|
8
|
-
const password = ensureAndGet("SKYNET_SNOWFLAKE_PASSWORD");
|
|
9
|
-
|
|
10
|
-
if (!account || !username || !password) {
|
|
11
|
-
throw new Error("missing snowflake credentials");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const connection = snowflake.createConnection({
|
|
15
|
-
account,
|
|
16
|
-
username,
|
|
17
|
-
password,
|
|
18
|
-
...options,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return new Promise<Connection>((resolve, reject) => {
|
|
22
|
-
connection.connect((err, conn) => {
|
|
23
|
-
if (err) {
|
|
24
|
-
reject(err);
|
|
25
|
-
} else {
|
|
26
|
-
resolve(conn);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function executeSql<T>(options: ConnectionOptions, sql: string, binds?: Binds) {
|
|
33
|
-
const connection = await getConnection(options);
|
|
34
|
-
|
|
35
|
-
return await new Promise<T[] | undefined>((resolve, reject) => {
|
|
36
|
-
connection.execute({
|
|
37
|
-
sqlText: sql,
|
|
38
|
-
binds: binds,
|
|
39
|
-
complete: (err, statement, rows) => {
|
|
40
|
-
// console.log(statement.getSqlText());
|
|
41
|
-
if (err) {
|
|
42
|
-
reject(err);
|
|
43
|
-
} else {
|
|
44
|
-
resolve(rows);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { getConnection, executeSql };
|