@wishknish/knishio-client-ts 0.8.2 → 0.9.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.
Files changed (38) hide show
  1. package/dist/index.cjs +425 -263
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +44 -17
  4. package/dist/index.d.ts +44 -17
  5. package/dist/index.iife.js +425 -265
  6. package/dist/index.iife.js.map +1 -1
  7. package/dist/index.js +447 -285
  8. package/dist/index.js.map +1 -1
  9. package/package.json +6 -9
  10. package/src/KnishIOClient.ts +180 -57
  11. package/src/constants.ts +1 -2
  12. package/src/core/Molecule.ts +53 -0
  13. package/src/core/Wallet.ts +84 -3
  14. package/src/libraries/Decimal.ts +1 -1
  15. package/src/libraries/GraphQLClient.ts +83 -0
  16. package/src/libraries/Hex.ts +4 -3
  17. package/src/libraries/UrqlClientWrapper.ts +13 -13
  18. package/src/libraries/crypto.ts +4 -4
  19. package/src/mutation/MutationClaimShadowWallet.ts +3 -1
  20. package/src/mutation/MutationTransferTokens.ts +18 -0
  21. package/src/query/QueryActiveSession.ts +0 -1
  22. package/src/query/QueryPolicy.ts +0 -1
  23. package/src/response/ResponseAuthorizationGuest.ts +2 -2
  24. package/src/response/ResponseBalance.ts +9 -6
  25. package/src/response/ResponseLinkIdentifier.ts +1 -1
  26. package/src/response/ResponseRequestAuthorizationGuest.ts +2 -2
  27. package/src/schemas/index.ts +2 -1
  28. package/src/subscribe/Subscribe.ts +3 -2
  29. package/src/types/assertions.ts +1 -6
  30. package/src/types/client.ts +12 -19
  31. package/src/types/guards.ts +2 -3
  32. package/src/types/index.ts +6 -0
  33. package/src/validation/UNIVERSAL_CONFIGURATION_INTERFACES.ts +3 -5
  34. package/src/validation/ValidationService.ts +6 -15
  35. package/src/validation/schemas.ts +5 -1
  36. package/src/versions/HashAtom.ts +11 -9
  37. package/src/query/QueryUserActivity.ts +0 -153
  38. package/src/response/ResponseQueryUserActivity.ts +0 -89
@@ -1,153 +0,0 @@
1
- /*
2
- (
3
- (/(
4
- (//(
5
- (///(
6
- (/////(
7
- (//////( )
8
- (////////( (/)
9
- (////////( (///)
10
- (//////////( (////)
11
- (//////////( (//////)
12
- (////////////( (///////)
13
- (/////////////( (/////////)
14
- (//////////////( (///////////)
15
- (///////////////( (/////////////)
16
- (////////////////( (//////////////)
17
- ((((((((((((((((((( (((((((((((((((
18
- ((((((((((((((((((( ((((((((((((((
19
- ((((((((((((((((((( ((((((((((((((
20
- (((((((((((((((((((( (((((((((((((
21
- (((((((((((((((((((( ((((((((((((
22
- ((((((((((((((((((( ((((((((((((
23
- ((((((((((((((((((( ((((((((((
24
- ((((((((((((((((((/ (((((((((
25
- (((((((((((((((((( ((((((((
26
- ((((((((((((((((( (((((((
27
- (((((((((((((((((( (((((
28
- ################# ##
29
- ################ #
30
- ################# ##
31
- %################ ###
32
- ###############( ####
33
- ############### ####
34
- ############### ######
35
- %#############( (#######
36
- %############# #########
37
- ############( ##########
38
- ########### #############
39
- ######### ##############
40
- %######
41
-
42
- Powered by Knish.IO: Connecting a Decentralized World
43
-
44
- Please visit https://github.com/WishKnish/KnishIO-Client-TS for information.
45
-
46
- License: https://github.com/WishKnish/KnishIO-Client-TS/blob/master/LICENSE
47
- */
48
-
49
- import Query from './Query'
50
- import ResponseQueryUserActivity from '@/response/ResponseQueryUserActivity'
51
- import { gql } from '@urql/core'
52
- import type { GraphQLClient as IGraphQLClient } from '@/types'
53
- import type KnishIOClient from '@/KnishIOClient'
54
- import type { BundleHash, MetaType, MetaId } from '@/types'
55
-
56
- /**
57
- * Query for retrieving information about user activity
58
- */
59
- export default class QueryUserActivity extends Query {
60
- /**
61
- * Constructor
62
- */
63
- constructor(graphQLClient: IGraphQLClient, knishIOClient: KnishIOClient) {
64
- super(graphQLClient, knishIOClient)
65
-
66
- this.$__query = gql`
67
- query UserActivity(
68
- $bundleHash: String
69
- $metaType: String
70
- $metaId: String
71
- $ipAddress: String
72
- $browser: String
73
- $osCpu: String
74
- $resolution: String
75
- $timeZone: String
76
- $countBy: [CountByUserActivity]
77
- $interval: span
78
- ) {
79
- UserActivity(
80
- bundleHash: $bundleHash
81
- metaType: $metaType
82
- metaId: $metaId
83
- ipAddress: $ipAddress
84
- browser: $browser
85
- osCpu: $osCpu
86
- resolution: $resolution
87
- timeZone: $timeZone
88
- countBy: $countBy
89
- interval: $interval
90
- ) {
91
- createdAt
92
- bundleHash
93
- metaType
94
- metaId
95
- instances {
96
- bundleHash
97
- metaType
98
- metaId
99
- jsonData
100
- createdAt
101
- updatedAt
102
- }
103
- instanceCount {
104
- ...SubFields
105
- ...Recursive
106
- }
107
- }
108
- }
109
-
110
- fragment SubFields on InstanceCountType {
111
- id
112
- count
113
- }
114
-
115
- fragment Recursive on InstanceCountType {
116
- instances {
117
- ...SubFields
118
- instances {
119
- ...SubFields
120
- instances {
121
- ...SubFields
122
- instances {
123
- ...SubFields
124
- instances {
125
- ...SubFields
126
- instances {
127
- ...SubFields
128
- instances {
129
- ...SubFields
130
- instances {
131
- ...SubFields
132
- }
133
- }
134
- }
135
- }
136
- }
137
- }
138
- }
139
- }
140
- }
141
- `
142
- }
143
-
144
- /**
145
- * Returns a Response object
146
- */
147
- override createResponse(json: Record<string, any>): ResponseQueryUserActivity {
148
- return new ResponseQueryUserActivity({
149
- query: this,
150
- json
151
- })
152
- }
153
- }
@@ -1,89 +0,0 @@
1
- /*
2
- (
3
- (/(
4
- (//(
5
- (///(
6
- (/////(
7
- (//////( )
8
- (////////( (/)
9
- (////////( (///)
10
- (//////////( (////)
11
- (//////////( (//////)
12
- (////////////( (///////)
13
- (/////////////( (/////////)
14
- (//////////////( (///////////)
15
- (///////////////( (/////////////)
16
- (////////////////( (//////////////)
17
- ((((((((((((((((((( (((((((((((((((
18
- ((((((((((((((((((( ((((((((((((((
19
- ((((((((((((((((((( ((((((((((((((
20
- (((((((((((((((((((( (((((((((((((
21
- (((((((((((((((((((( ((((((((((((
22
- ((((((((((((((((((( ((((((((((((
23
- ((((((((((((((((((( ((((((((((
24
- ((((((((((((((((((/ (((((((((
25
- (((((((((((((((((( ((((((((
26
- ((((((((((((((((( (((((((
27
- (((((((((((((((((( (((((
28
- ################# ##
29
- ################ #
30
- ################# ##
31
- %################ ###
32
- ###############( ####
33
- ############### ####
34
- ############### ######
35
- %#############( (#######
36
- %############# #########
37
- ############( ##########
38
- ########### #############
39
- ######### ##############
40
- %######
41
-
42
- Powered by Knish.IO: Connecting a Decentralized World
43
-
44
- Please visit https://github.com/WishKnish/KnishIO-Client-TS for information.
45
-
46
- License: https://github.com/WishKnish/KnishIO-Client-TS/blob/master/LICENSE
47
- */
48
-
49
- import Response from './Response'
50
- import type Query from '@/query/Query'
51
-
52
- /**
53
- * Response for QueryUserActivity
54
- */
55
- export default class ResponseQueryUserActivity extends Response {
56
- /**
57
- * Constructor
58
- */
59
- constructor({
60
- query,
61
- json
62
- }: {
63
- query: Query
64
- json: Record<string, any>
65
- }) {
66
- super({
67
- query,
68
- json,
69
- dataKey: 'data.UserActivity'
70
- })
71
- }
72
-
73
- /**
74
- * Returns processed user activity data
75
- */
76
- override payload(): any {
77
- const data = JSON.parse(JSON.stringify(this.data()))
78
-
79
- if (data.instances) {
80
- for (const datum of data.instances) {
81
- if (datum.jsonData) {
82
- datum.jsonData = JSON.parse(datum.jsonData)
83
- }
84
- }
85
- }
86
-
87
- return data
88
- }
89
- }