@wishknish/knishio-client-ts 0.7.4 → 0.7.7
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.cjs +2702 -1033
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +339 -106
- package/dist/index.d.ts +339 -106
- package/dist/index.iife.js +22052 -19964
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +2699 -1034
- package/dist/index.js.map +1 -1
- package/package.json +10 -4
- package/src/AuthToken.ts +8 -2
- package/src/KnishIOClient.ts +346 -51
- package/src/constants.ts +5 -3
- package/src/core/Atom.ts +167 -100
- package/src/core/AtomMeta.ts +11 -28
- package/src/core/Meta.ts +18 -15
- package/src/core/Molecule.ts +607 -141
- package/src/core/Wallet.ts +19 -24
- package/src/index.ts +8 -0
- package/src/instance/rules/Rule.ts +128 -19
- package/src/libraries/CheckMolecule.ts +88 -1
- package/src/libraries/crypto.ts +14 -30
- package/src/libraries/strings.ts +26 -25
- package/src/mutation/MutationAppendRequest.ts +52 -0
- package/src/mutation/MutationCreateRule.ts +2 -2
- package/src/mutation/MutationPeering.ts +37 -0
- package/src/mutation/MutationRequestAuthorization.ts +3 -3
- package/src/query/QueryActiveSession.ts +0 -1
- package/src/query/QueryContinuId.ts +8 -0
- package/src/query/QueryMetaTypeViaMolecule.ts +221 -0
- package/src/query/QueryWalletList.ts +2 -2
- package/src/response/ResponseAppendRequest.ts +17 -0
- package/src/response/ResponseBalance.ts +8 -3
- package/src/response/ResponseContinuId.ts +1 -1
- package/src/response/ResponseMetaType.ts +32 -19
- package/src/response/ResponseMetaTypeViaMolecule.ts +224 -0
- package/src/response/ResponsePeering.ts +17 -0
- package/src/response/ResponsePolicy.ts +2 -3
- package/src/response/ResponseProposeMolecule.ts +0 -1
- package/src/response/ResponseRequestAuthorization.ts +32 -2
- package/src/response/ResponseRequestAuthorizationGuest.ts +25 -1
- package/src/response/ResponseWalletList.ts +1 -1
- package/src/types/guards.ts +18 -5
- package/src/types/index.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wishknish/knishio-client-ts",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"productName": "Knish.IO TypeScript SDK Client",
|
|
5
5
|
"description": "TypeScript implementation of the Knish.IO SDK to consume Knish.IO GraphQL APIs with enhanced type safety.",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -58,24 +58,30 @@
|
|
|
58
58
|
"fips-203"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@noble/post-quantum": "^0.5.
|
|
61
|
+
"@noble/post-quantum": "^0.5.4",
|
|
62
62
|
"@thumbmarkjs/thumbmarkjs": "^0.19.1",
|
|
63
63
|
"@urql/core": "^5.2.0",
|
|
64
64
|
"graphql": "^16.11.0",
|
|
65
|
-
"graphql-ws": "^6.0.
|
|
65
|
+
"graphql-ws": "^6.0.7",
|
|
66
66
|
"isomorphic-fetch": "^3.0.0",
|
|
67
67
|
"jssha": "^3.3.1",
|
|
68
|
+
"tslib": "^2.8.1",
|
|
68
69
|
"wonka": "^6.3.5",
|
|
69
70
|
"zod": "^3.23.8"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
74
|
+
"@types/jest": "^30.0.0",
|
|
73
75
|
"@types/jssha": "^3.0.0",
|
|
74
76
|
"@types/node": "^22.8.1",
|
|
77
|
+
"@types/pg": "^8.10.0",
|
|
75
78
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
76
79
|
"@typescript-eslint/parser": "^8.15.0",
|
|
77
80
|
"eslint": "^9.16.0",
|
|
81
|
+
"jest": "^30.2.0",
|
|
82
|
+
"pg": "^8.11.0",
|
|
78
83
|
"prettier": "^3.4.2",
|
|
84
|
+
"ts-jest": "^29.4.6",
|
|
79
85
|
"tsup": "^8.3.5",
|
|
80
86
|
"tsx": "^4.20.5",
|
|
81
87
|
"typescript": "^5.6.3",
|
|
@@ -109,7 +115,7 @@
|
|
|
109
115
|
"README.md",
|
|
110
116
|
"LICENSE"
|
|
111
117
|
],
|
|
112
|
-
"packageManager": "yarn@4.
|
|
118
|
+
"packageManager": "yarn@4.6.0",
|
|
113
119
|
"engines": {
|
|
114
120
|
"node": ">=18.0.0"
|
|
115
121
|
}
|
package/src/AuthToken.ts
CHANGED
|
@@ -162,12 +162,18 @@ export default class AuthToken {
|
|
|
162
162
|
return this.$__encrypt
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Get expire interval in milliseconds (matching JS SDK pattern)
|
|
167
|
+
*/
|
|
168
|
+
getExpireInterval(): number {
|
|
169
|
+
return (this.$__expiresAt * 1000) - Date.now()
|
|
170
|
+
}
|
|
171
|
+
|
|
165
172
|
/**
|
|
166
173
|
* Check if token is expired
|
|
167
174
|
*/
|
|
168
175
|
isExpired(): boolean {
|
|
169
|
-
|
|
170
|
-
return now >= this.$__expiresAt
|
|
176
|
+
return !this.$__expiresAt || this.getExpireInterval() < 0
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
/**
|