@rpcbase/client 0.162.0 → 0.163.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/{rpc_post.js → helpers/postRPC.js} +6 -6
- package/package.json +1 -1
- package/page.js +8 -0
|
@@ -6,9 +6,9 @@ import _set from "lodash/set"
|
|
|
6
6
|
|
|
7
7
|
import get_txn_id from "@rpcbase/std/get_txn_id"
|
|
8
8
|
|
|
9
|
-
import getBaseUrl from "
|
|
10
|
-
import getTenantId from "
|
|
11
|
-
import {add_local_txn} from "
|
|
9
|
+
import getBaseUrl from "../getBaseUrl"
|
|
10
|
+
import getTenantId from "../auth/getTenantId"
|
|
11
|
+
import {add_local_txn} from "../rts/rts"
|
|
12
12
|
|
|
13
13
|
const TENANT_ID_HEADER = "rb-tenant-id"
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ const client = axios.create({
|
|
|
19
19
|
},
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const postRPC = async(url, payload, options = {}) => {
|
|
23
23
|
if (!options?.headers?.["rts-txn-id"]) {
|
|
24
24
|
_set(options, ["headers", "rts-txn-id"], get_txn_id())
|
|
25
25
|
}
|
|
@@ -33,10 +33,10 @@ const rpc_post = async(url, payload, options = {}) => {
|
|
|
33
33
|
const res = await client.post(`${getBaseUrl()}${url}`, payload, options)
|
|
34
34
|
|
|
35
35
|
if (res.data === "") {
|
|
36
|
-
console.warn("
|
|
36
|
+
console.warn("postRPC:error: got empty res", res)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return res.data
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export default
|
|
42
|
+
export default postRPC
|
package/package.json
CHANGED