@openfort/openfort-node 0.6.78 → 0.7.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 +6 -0
- package/Makefile +75 -0
- package/README.md +174 -65
- package/biome.json +34 -4
- package/dist/index.d.mts +8871 -14863
- package/dist/index.d.ts +8871 -14863
- package/dist/index.js +4978 -24180
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4677 -23904
- package/dist/index.mjs.map +1 -1
- package/examples/.env.example +16 -0
- package/examples/README.md +154 -0
- package/examples/contracts/createContract.ts +25 -0
- package/examples/contracts/listContracts.ts +18 -0
- package/examples/contracts/readContract.ts +29 -0
- package/examples/evm/accounts/createAccount.ts +18 -0
- package/examples/evm/accounts/exportAccount.ts +39 -0
- package/examples/evm/accounts/getAccount.ts +30 -0
- package/examples/evm/accounts/importAccount.ts +31 -0
- package/examples/evm/accounts/listAccounts.ts +32 -0
- package/examples/evm/signing/signHash.ts +28 -0
- package/examples/evm/signing/signMessage.ts +32 -0
- package/examples/evm/signing/signTransaction.ts +42 -0
- package/examples/evm/signing/signTypedData.ts +71 -0
- package/examples/exchange/createSwap.ts +49 -0
- package/examples/exchange/quoteSwap.ts +34 -0
- package/examples/iam/deleteUser.ts +22 -0
- package/examples/iam/getSession.ts +30 -0
- package/examples/iam/getUser.ts +32 -0
- package/examples/iam/listUsers.ts +18 -0
- package/examples/iam/pregenerateUser.ts +33 -0
- package/examples/package.json +31 -0
- package/examples/pnpm-lock.yaml +1231 -0
- package/examples/policies/createPolicy.ts +25 -0
- package/examples/policies/createPolicyRule.ts +43 -0
- package/examples/policies/disableEnablePolicy.ts +29 -0
- package/examples/policies/getPolicy.ts +30 -0
- package/examples/policies/listPolicies.ts +17 -0
- package/examples/policies/listPolicyRules.ts +37 -0
- package/examples/policies/updatePolicy.ts +29 -0
- package/examples/solana/accounts/createAccount.ts +18 -0
- package/examples/solana/accounts/exportAccount.ts +29 -0
- package/examples/solana/accounts/getAccount.ts +24 -0
- package/examples/solana/accounts/importAccount.ts +28 -0
- package/examples/solana/accounts/listAccounts.ts +32 -0
- package/examples/solana/signing/signMessage.ts +22 -0
- package/examples/solana/signing/signTransaction.ts +41 -0
- package/examples/transactions/createTransactionIntent.ts +49 -0
- package/examples/transactions/estimateGas.ts +52 -0
- package/examples/transactions/getTransactionIntent.ts +54 -0
- package/examples/transactions/listTransactionIntents.ts +31 -0
- package/examples/tsconfig.json +15 -0
- package/examples/webhook/index.ts +43 -0
- package/openapi-auth.json +6526 -0
- package/openapi.json +20425 -0
- package/orval.config.ts +41 -0
- package/package.json +22 -12
- package/pnpm-workspace.yaml +2 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +20 -0
- package/updateGeneratedCode.sh +0 -8
package/orval.config.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineConfig } from 'orval'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
openfort: {
|
|
5
|
+
input: {
|
|
6
|
+
target: './openapi.json',
|
|
7
|
+
},
|
|
8
|
+
output: {
|
|
9
|
+
clean: true,
|
|
10
|
+
target: './generated',
|
|
11
|
+
mode: 'tags-split',
|
|
12
|
+
mock: false,
|
|
13
|
+
override: {
|
|
14
|
+
mutator: {
|
|
15
|
+
path: './openfortApiClient.ts',
|
|
16
|
+
name: 'openfortApiClient',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
workspace: './src/openapi-client',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
openfortAuth: {
|
|
23
|
+
input: {
|
|
24
|
+
target: './openapi-auth.json',
|
|
25
|
+
},
|
|
26
|
+
output: {
|
|
27
|
+
clean: false,
|
|
28
|
+
target: './generated/auth',
|
|
29
|
+
mode: 'tags-split',
|
|
30
|
+
mock: false,
|
|
31
|
+
baseUrl: '/iam/v2/auth',
|
|
32
|
+
override: {
|
|
33
|
+
mutator: {
|
|
34
|
+
path: './openfortApiClient.ts',
|
|
35
|
+
name: 'openfortApiClient',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
workspace: './src/openapi-client',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfort/openfort-node",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Openfort Node SDK",
|
|
5
5
|
"author": "Openfort",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/openfort-xyz/openfort-node.git"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
11
|
-
"fetch",
|
|
12
|
-
"typescript",
|
|
13
|
-
"openapi-client",
|
|
14
|
-
"openapi-generator"
|
|
15
|
-
],
|
|
16
10
|
"license": "MIT",
|
|
17
11
|
"main": "./dist/index.js",
|
|
18
12
|
"module": "./dist/index.mjs",
|
|
@@ -45,23 +39,32 @@
|
|
|
45
39
|
"registry": "https://registry.npmjs.org/"
|
|
46
40
|
},
|
|
47
41
|
"dependencies": {
|
|
48
|
-
"@openfort/shield-js": "^0.1.
|
|
42
|
+
"@openfort/shield-js": "^0.1.33",
|
|
49
43
|
"@types/node": "*",
|
|
50
44
|
"@types/node-fetch": "^2.5.7",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
45
|
+
"axios": "^1.7.0",
|
|
46
|
+
"axios-retry": "^4.5.0",
|
|
47
|
+
"bs58": "^6.0.0",
|
|
48
|
+
"jose": "^5.2.0",
|
|
49
|
+
"node-fetch": "^2.6.0",
|
|
50
|
+
"viem": "^2.21.0"
|
|
53
51
|
},
|
|
54
52
|
"simple-git-hooks": {
|
|
55
53
|
"pre-commit": "pnpm check"
|
|
56
54
|
},
|
|
57
55
|
"devDependencies": {
|
|
56
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
58
57
|
"@biomejs/biome": "^2.3.6",
|
|
59
58
|
"@changesets/changelog-github": "^0.4.8",
|
|
60
59
|
"@changesets/cli": "^2.29.7",
|
|
60
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
61
61
|
"knip": "^5.70.1",
|
|
62
|
+
"orval": "^7.6.0",
|
|
63
|
+
"publint": "^0.2.12",
|
|
62
64
|
"simple-git-hooks": "^2.13.1",
|
|
63
65
|
"tsup": "^8.5.1",
|
|
64
|
-
"typescript": "^5.4.3"
|
|
66
|
+
"typescript": "^5.4.3",
|
|
67
|
+
"vitest": "^3.0.0"
|
|
65
68
|
},
|
|
66
69
|
"scripts": {
|
|
67
70
|
"prebuild": "node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').version) + ';\\nexport const PACKAGE = ' + JSON.stringify(require('./package.json').name) + ';'\" > src/version.ts",
|
|
@@ -72,7 +75,14 @@
|
|
|
72
75
|
"changeset:prepublish": "pnpm build",
|
|
73
76
|
"check": "biome check --write --unsafe",
|
|
74
77
|
"check:types": "tsc --noEmit",
|
|
78
|
+
"check:exports": "attw --pack . --ignore-rules false-esm",
|
|
75
79
|
"lint": "biome lint",
|
|
80
|
+
"test": "vitest run",
|
|
81
|
+
"test:ci": "vitest run --reporter=verbose",
|
|
82
|
+
"test:cov": "vitest run --coverage",
|
|
83
|
+
"test:build": "publint --strict && attw --pack . --ignore-rules false-esm",
|
|
84
|
+
"orval": "make check-openapi || echo 'NOTE: A newer OpenAPI spec is available. Run pnpm orval:update to update.'; orval --config orval.config.ts",
|
|
85
|
+
"orval:update": "make update-openapi && orval --config orval.config.ts",
|
|
76
86
|
"docs": "typedoc --entryPoints src/index.ts --out docs/ --includes src/**/*.ts",
|
|
77
87
|
"docs:json": "typedoc --entryPoints src/index.ts --includes src/**/*.ts --json docs/spec.json --excludeExternals"
|
|
78
88
|
}
|
package/tsconfig.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"moduleResolution": "bundler",
|
|
9
9
|
"types": ["node"],
|
|
10
10
|
"target": "es2021",
|
|
11
|
-
"lib": ["es2021", "esnext.disposable"],
|
|
11
|
+
"lib": ["es2021", "esnext.disposable", "dom"],
|
|
12
12
|
"typeRoots": ["node_modules/@types", "./typings"],
|
|
13
13
|
"downlevelIteration": true,
|
|
14
14
|
"experimentalDecorators": true,
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
passWithNoTests: true,
|
|
6
|
+
coverage: {
|
|
7
|
+
provider: 'v8',
|
|
8
|
+
reporter: process.env.CI ? ['lcov'] : ['text', 'json', 'html'],
|
|
9
|
+
exclude: [
|
|
10
|
+
'**/node_modules/**',
|
|
11
|
+
'**/dist/**',
|
|
12
|
+
'**/*.d.ts',
|
|
13
|
+
'**/openapi-client/generated/**',
|
|
14
|
+
'**/version.ts',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
testTimeout: 60_000,
|
|
18
|
+
hookTimeout: 60_000,
|
|
19
|
+
},
|
|
20
|
+
})
|
package/updateGeneratedCode.sh
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
cd src/generated
|
|
2
|
-
rm -rf *
|
|
3
|
-
cp -r ../../../api/sdk/typescript-node/models .
|
|
4
|
-
cp -r ../../../api/sdk/typescript-node/types .
|
|
5
|
-
cp -r ../../../api/sdk/typescript-node/apis .
|
|
6
|
-
cp -r ../../../api/sdk/typescript-node/auth .
|
|
7
|
-
cp -r ../../../api/sdk/typescript-node/http .
|
|
8
|
-
cp -r ../../../api/sdk/typescript-node/*.ts .
|