@nocobase/license-kit 0.0.6 → 0.2.2

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/Cargo.toml CHANGED
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
9
9
  [dependencies]
10
10
  base64 = "0.22.1"
11
11
  # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
12
- napi = { version = "2.12.2", default-features = false, features = ["napi4"] }
12
+ napi = { version = "2.12.2", default-features = false, features = ["napi4", "async"] }
13
13
  napi-derive = "2.12.2"
14
14
  ring = "0.17.14"
15
15
  rsa = { version = "0.9.8", features = ["sha2"] }
@@ -20,8 +20,10 @@ sysinfo = "0.33.1"
20
20
  mac_address = "1.1.8"
21
21
  serde = { version = "1.0", features = ["derive"] }
22
22
  dotenv = "0.15.0"
23
- postgres = "0.19.10"
24
- mysql = "26.0.0"
23
+ reqwest = { version = "0.12.15", features = ["json", "rustls-tls"], default-features = false }
24
+ tokio-postgres = "0.7.13"
25
+ tokio = "1.44.1"
26
+ mysql_async = "0.35.1"
25
27
 
26
28
  [build-dependencies]
27
29
  napi-build = "2.0.1"
package/README.md CHANGED
@@ -10,5 +10,5 @@ kit for nocobase license
10
10
 
11
11
  ## release
12
12
 
13
-
14
- gcmsg "x.x.x" && git push
13
+ 1. npm version minor
14
+ 2. git push
package/index.d.ts CHANGED
@@ -3,6 +3,10 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
+ export interface ContainerInfo {
7
+ name: string
8
+ id: string
9
+ }
6
10
  export interface Config {
7
11
  dbDialect: string
8
12
  dbHost: string
@@ -12,6 +16,7 @@ export interface Config {
12
16
  dbPassword: string
13
17
  }
14
18
  export interface DatabaseConfig {
19
+ type: string
15
20
  name: string
16
21
  oid: number
17
22
  ver: string
@@ -23,10 +28,11 @@ export interface Env {
23
28
  hostname: string
24
29
  mac: string
25
30
  db: DatabaseConfig
31
+ container: ContainerInfo
26
32
  }
27
- export declare function getEnv(): Env
28
- export declare function genInstanceIdWithPublicKey(publicKey: string): string
29
- export declare function genInstanceId(): string
33
+ export declare function getEnvAsync(): Promise<Env>
34
+ export declare function getInstanceIdWithPublicKeyAsync(publicKey: string): Promise<string>
35
+ export declare function getInstanceIdAsync(): Promise<string>
30
36
  export declare function instanceIdDecrypt(encryptedData: string, privateKey: string): string
31
37
  export interface Pair {
32
38
  privateKey: string
package/index.js CHANGED
@@ -310,11 +310,11 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { getEnv, genInstanceIdWithPublicKey, genInstanceId, instanceIdDecrypt, createKeyPair, encryptWithPublicKey, decryptWithPrivateKey, createSignature, verifySignature, keyEncrypt, keyDecrypt } = nativeBinding
313
+ const { getEnvAsync, getInstanceIdWithPublicKeyAsync, getInstanceIdAsync, instanceIdDecrypt, createKeyPair, encryptWithPublicKey, decryptWithPrivateKey, createSignature, verifySignature, keyEncrypt, keyDecrypt } = nativeBinding
314
314
 
315
- module.exports.getEnv = getEnv
316
- module.exports.genInstanceIdWithPublicKey = genInstanceIdWithPublicKey
317
- module.exports.genInstanceId = genInstanceId
315
+ module.exports.getEnvAsync = getEnvAsync
316
+ module.exports.getInstanceIdWithPublicKeyAsync = getInstanceIdWithPublicKeyAsync
317
+ module.exports.getInstanceIdAsync = getInstanceIdAsync
318
318
  module.exports.instanceIdDecrypt = instanceIdDecrypt
319
319
  module.exports.createKeyPair = createKeyPair
320
320
  module.exports.encryptWithPublicKey = encryptWithPublicKey
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/license-kit",
3
- "version": "0.0.6",
3
+ "version": "0.2.2",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -40,6 +40,9 @@
40
40
  "build:debug": "napi build --platform",
41
41
  "prepublishOnly": "napi prepublish -t npm",
42
42
  "test": "ava",
43
+ "test:db": "ava __test__/db.spec.mjs",
44
+ "test:docker": "docker build -f __test__/container/docker.yml -t license-kit .",
45
+ "test:d": "node read.js",
43
46
  "universal": "napi universal",
44
47
  "version": "napi version",
45
48
  "build:pkg": "npm run build && rm -rf ./crypto-utils && mkdir ./crypto-utils && cp index.js index.d.ts *.node ./crypto-utils/",
@@ -51,21 +54,21 @@
51
54
  },
52
55
  "repository": "https://github.com/nocobase/license-kit",
53
56
  "optionalDependencies": {
54
- "@nocobase/license-kit-win32-x64-msvc": "0.0.6",
55
- "@nocobase/license-kit-darwin-x64": "0.0.6",
56
- "@nocobase/license-kit-linux-x64-gnu": "0.0.6",
57
- "@nocobase/license-kit-darwin-arm64": "0.0.6",
58
- "@nocobase/license-kit-android-arm64": "0.0.6",
59
- "@nocobase/license-kit-linux-arm64-gnu": "0.0.6",
60
- "@nocobase/license-kit-linux-arm64-musl": "0.0.6",
61
- "@nocobase/license-kit-win32-arm64-msvc": "0.0.6",
62
- "@nocobase/license-kit-linux-arm-gnueabihf": "0.0.6",
63
- "@nocobase/license-kit-linux-arm-musleabihf": "0.0.6",
64
- "@nocobase/license-kit-linux-x64-musl": "0.0.6",
65
- "@nocobase/license-kit-freebsd-x64": "0.0.6",
66
- "@nocobase/license-kit-win32-ia32-msvc": "0.0.6",
67
- "@nocobase/license-kit-android-arm-eabi": "0.0.6",
68
- "@nocobase/license-kit-darwin-universal": "0.0.6",
69
- "@nocobase/license-kit-linux-riscv64-gnu": "0.0.6"
57
+ "@nocobase/license-kit-win32-x64-msvc": "0.2.2",
58
+ "@nocobase/license-kit-darwin-x64": "0.2.2",
59
+ "@nocobase/license-kit-linux-x64-gnu": "0.2.2",
60
+ "@nocobase/license-kit-darwin-arm64": "0.2.2",
61
+ "@nocobase/license-kit-android-arm64": "0.2.2",
62
+ "@nocobase/license-kit-linux-arm64-gnu": "0.2.2",
63
+ "@nocobase/license-kit-linux-arm64-musl": "0.2.2",
64
+ "@nocobase/license-kit-win32-arm64-msvc": "0.2.2",
65
+ "@nocobase/license-kit-linux-arm-gnueabihf": "0.2.2",
66
+ "@nocobase/license-kit-linux-arm-musleabihf": "0.2.2",
67
+ "@nocobase/license-kit-linux-x64-musl": "0.2.2",
68
+ "@nocobase/license-kit-freebsd-x64": "0.2.2",
69
+ "@nocobase/license-kit-win32-ia32-msvc": "0.2.2",
70
+ "@nocobase/license-kit-android-arm-eabi": "0.2.2",
71
+ "@nocobase/license-kit-darwin-universal": "0.2.2",
72
+ "@nocobase/license-kit-linux-riscv64-gnu": "0.2.2"
70
73
  }
71
74
  }