@xyo-network/bridge-http-express 4.3.0 → 5.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpBridge.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/HttpBridge.spec.ts"],"names":[],"mappings":"AAGA,OAAO,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"HttpBridge.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/HttpBridge.spec.ts"],"names":[],"mappings":"AAGA,OAAO,yBAAyB,CAAA;AAIhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AA6B/E,eAAO,MAAM,YAAY,QAAO,SAE/B,CAAA;AAED,eAAO,MAAM,YAAY,GAAU,SAAQ,SAA0B,KAAG,OAAO,CAAC,2BAA2B,CAE1G,CAAA;AAED,eAAO,MAAM,eAAe,GAAU,SAAQ,SAA0B,KAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAYzH,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/bridge-http-express",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -36,36 +36,37 @@
|
|
|
36
36
|
"package.json"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xylabs/assert": "^
|
|
40
|
-
"@xylabs/exists": "^
|
|
41
|
-
"@xylabs/express": "^
|
|
42
|
-
"@xylabs/hex": "^
|
|
43
|
-
"@xylabs/object": "^
|
|
44
|
-
"@xyo-network/boundwitness-model": "^
|
|
45
|
-
"@xyo-network/bridge-http": "^
|
|
46
|
-
"@xyo-network/bridge-model": "^
|
|
47
|
-
"@xyo-network/module-model": "^
|
|
48
|
-
"@xyo-network/payload-model": "^
|
|
39
|
+
"@xylabs/assert": "^5.0.0",
|
|
40
|
+
"@xylabs/exists": "^5.0.0",
|
|
41
|
+
"@xylabs/express": "^5.0.0",
|
|
42
|
+
"@xylabs/hex": "^5.0.0",
|
|
43
|
+
"@xylabs/object": "^5.0.0",
|
|
44
|
+
"@xyo-network/boundwitness-model": "^5.0.0",
|
|
45
|
+
"@xyo-network/bridge-http": "^5.0.0",
|
|
46
|
+
"@xyo-network/bridge-model": "^5.0.0",
|
|
47
|
+
"@xyo-network/module-model": "^5.0.0",
|
|
48
|
+
"@xyo-network/payload-model": "^5.0.0",
|
|
49
49
|
"express": "^5.1.0",
|
|
50
50
|
"http-status-codes": "^2.3.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/express": "^5.0.3",
|
|
54
54
|
"@types/node": "^24.1.0",
|
|
55
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.
|
|
56
|
-
"@xylabs/tsconfig": "^7.0.
|
|
57
|
-
"@xylabs/
|
|
58
|
-
"@
|
|
59
|
-
"@xyo-network/
|
|
60
|
-
"@xyo-network/
|
|
61
|
-
"@xyo-network/bridge-
|
|
62
|
-
"@xyo-network/
|
|
63
|
-
"@xyo-network/
|
|
64
|
-
"@xyo-network/
|
|
65
|
-
"@xyo-network/node-
|
|
66
|
-
"@xyo-network/
|
|
67
|
-
"@xyo-network/payload-
|
|
68
|
-
"@xyo-network/
|
|
55
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.2",
|
|
56
|
+
"@xylabs/tsconfig": "^7.0.2",
|
|
57
|
+
"@xylabs/typeof": "^5.0.0",
|
|
58
|
+
"@xylabs/vitest-extended": "^5.0.0",
|
|
59
|
+
"@xyo-network/api-models": "^5.0.0",
|
|
60
|
+
"@xyo-network/archivist-model": "^5.0.0",
|
|
61
|
+
"@xyo-network/bridge-abstract": "^5.0.0",
|
|
62
|
+
"@xyo-network/bridge-pub-sub": "^5.0.0",
|
|
63
|
+
"@xyo-network/diviner-model": "^5.0.0",
|
|
64
|
+
"@xyo-network/module-resolver": "^5.0.0",
|
|
65
|
+
"@xyo-network/node-memory": "^5.0.0",
|
|
66
|
+
"@xyo-network/node-model": "^5.0.0",
|
|
67
|
+
"@xyo-network/payload-builder": "^5.0.0",
|
|
68
|
+
"@xyo-network/payload-wrapper": "^5.0.0",
|
|
69
|
+
"@xyo-network/wallet": "^5.0.0",
|
|
69
70
|
"get-port-please": "^3.2.0",
|
|
70
71
|
"typescript": "^5.8.3",
|
|
71
72
|
"vitest": "^3.2.4"
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import '@xylabs/vitest-extended'
|
|
5
5
|
|
|
6
6
|
import { assertEx } from '@xylabs/assert'
|
|
7
|
+
import { isString } from '@xylabs/typeof'
|
|
7
8
|
import type { ApiConfig } from '@xyo-network/api-models'
|
|
8
9
|
import type { AttachableArchivistInstance } from '@xyo-network/archivist-model'
|
|
9
10
|
import {
|
|
@@ -35,7 +36,7 @@ const schema = HttpBridgeExpressConfigSchema
|
|
|
35
36
|
const security = { allowAnonymous: true }
|
|
36
37
|
|
|
37
38
|
export const getApiConfig = (): ApiConfig => {
|
|
38
|
-
return { apiDomain: process.env.ARCHIVIST_API_DOMAIN
|
|
39
|
+
return { apiDomain: process.env.ARCHIVIST_API_DOMAIN ?? 'https://beta.api.archivist.xyo.network' }
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
export const getArchivist = async (config: ApiConfig = getApiConfig()): Promise<AttachableArchivistInstance> => {
|
|
@@ -43,7 +44,7 @@ export const getArchivist = async (config: ApiConfig = getApiConfig()): Promise<
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export const tryGetArchivist = async (config: ApiConfig = getApiConfig()): Promise<AttachableArchivistInstance | undefined> => {
|
|
46
|
-
const url = config.root ? `${config.apiDomain}/${config.root}` : config.apiDomain
|
|
47
|
+
const url = isString(config.root) ? `${config.apiDomain}/${config.root}` : config.apiDomain
|
|
47
48
|
const account = await HDWallet.random()
|
|
48
49
|
const bridge = await HttpBridgeExpress.create({
|
|
49
50
|
account,
|