anymal-protocol 1.0.103 → 1.0.105
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -4
- package/dist/index.mjs +9 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ declare function useVerifyWeb3AuthSession(): (idToken: string, publicKey: string
|
|
|
10
10
|
|
|
11
11
|
declare function useCreateWeb3Account(): (idToken: string, publicKey: string, userPid: string, authServiceBaseUrl: string) => Promise<any>;
|
|
12
12
|
|
|
13
|
-
declare function useFetchUserData(): (dbAuthToken: string, endpoint: string,
|
|
13
|
+
declare function useFetchUserData(): (dbAuthToken: string, endpoint: string, pid: string) => Promise<any>;
|
|
14
14
|
|
|
15
15
|
declare function useUpdateUserEmail(): (dbAuthToken: string, docID: string, email: string, endpoint: string) => Promise<void>;
|
|
16
16
|
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function useVerifyWeb3AuthSession(): (idToken: string, publicKey: string
|
|
|
10
10
|
|
|
11
11
|
declare function useCreateWeb3Account(): (idToken: string, publicKey: string, userPid: string, authServiceBaseUrl: string) => Promise<any>;
|
|
12
12
|
|
|
13
|
-
declare function useFetchUserData(): (dbAuthToken: string, endpoint: string,
|
|
13
|
+
declare function useFetchUserData(): (dbAuthToken: string, endpoint: string, pid: string) => Promise<any>;
|
|
14
14
|
|
|
15
15
|
declare function useUpdateUserEmail(): (dbAuthToken: string, docID: string, email: string, endpoint: string) => Promise<void>;
|
|
16
16
|
|
package/dist/index.js
CHANGED
|
@@ -146,11 +146,11 @@ function useCreateWeb3Account() {
|
|
|
146
146
|
var import_react4 = require("react");
|
|
147
147
|
function useFetchUserData() {
|
|
148
148
|
return (0, import_react4.useCallback)(
|
|
149
|
-
async (dbAuthToken, endpoint,
|
|
149
|
+
async (dbAuthToken, endpoint, pid) => {
|
|
150
150
|
try {
|
|
151
151
|
const query = `
|
|
152
|
-
query User {
|
|
153
|
-
User(filter:
|
|
152
|
+
query User($filter: UserFilterArg) {
|
|
153
|
+
User(filter: $filter) {
|
|
154
154
|
_docID
|
|
155
155
|
pid
|
|
156
156
|
email
|
|
@@ -162,13 +162,18 @@ function useFetchUserData() {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
`;
|
|
165
|
+
const variables = {
|
|
166
|
+
filter: {
|
|
167
|
+
pid: { _eq: pid }
|
|
168
|
+
}
|
|
169
|
+
};
|
|
165
170
|
const response = await fetch(endpoint, {
|
|
166
171
|
method: "POST",
|
|
167
172
|
headers: {
|
|
168
173
|
"Content-Type": "application/json",
|
|
169
174
|
Authorization: `Bearer ${dbAuthToken}`
|
|
170
175
|
},
|
|
171
|
-
body: JSON.stringify({ query })
|
|
176
|
+
body: JSON.stringify({ query, variables })
|
|
172
177
|
});
|
|
173
178
|
if (!response.ok) {
|
|
174
179
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
package/dist/index.mjs
CHANGED
|
@@ -83,11 +83,11 @@ function useCreateWeb3Account() {
|
|
|
83
83
|
import { useCallback as useCallback4 } from "react";
|
|
84
84
|
function useFetchUserData() {
|
|
85
85
|
return useCallback4(
|
|
86
|
-
async (dbAuthToken, endpoint,
|
|
86
|
+
async (dbAuthToken, endpoint, pid) => {
|
|
87
87
|
try {
|
|
88
88
|
const query = `
|
|
89
|
-
query User {
|
|
90
|
-
User(filter:
|
|
89
|
+
query User($filter: UserFilterArg) {
|
|
90
|
+
User(filter: $filter) {
|
|
91
91
|
_docID
|
|
92
92
|
pid
|
|
93
93
|
email
|
|
@@ -99,13 +99,18 @@ function useFetchUserData() {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
`;
|
|
102
|
+
const variables = {
|
|
103
|
+
filter: {
|
|
104
|
+
pid: { _eq: pid }
|
|
105
|
+
}
|
|
106
|
+
};
|
|
102
107
|
const response = await fetch(endpoint, {
|
|
103
108
|
method: "POST",
|
|
104
109
|
headers: {
|
|
105
110
|
"Content-Type": "application/json",
|
|
106
111
|
Authorization: `Bearer ${dbAuthToken}`
|
|
107
112
|
},
|
|
108
|
-
body: JSON.stringify({ query })
|
|
113
|
+
body: JSON.stringify({ query, variables })
|
|
109
114
|
});
|
|
110
115
|
if (!response.ok) {
|
|
111
116
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
package/package.json
CHANGED