@milaboratories/pl-client 2.16.13 → 2.16.15
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/__external/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3 → @rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3}/__external/tslib/tslib.es6.cjs.map +1 -1
- package/dist/__external/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3 → @rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3}/__external/tslib/tslib.es6.js.map +1 -1
- package/dist/core/client.cjs +31 -16
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +3 -2
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +31 -16
- package/dist/core/client.js.map +1 -1
- package/dist/core/default_client.cjs +1 -1
- package/dist/core/default_client.cjs.map +1 -1
- package/dist/core/default_client.js +1 -1
- package/dist/core/default_client.js.map +1 -1
- package/dist/core/errors.cjs +71 -26
- package/dist/core/errors.cjs.map +1 -1
- package/dist/core/errors.d.ts +10 -3
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +68 -27
- package/dist/core/errors.js.map +1 -1
- package/dist/core/ll_client.cjs +48 -18
- package/dist/core/ll_client.cjs.map +1 -1
- package/dist/core/ll_client.d.ts +12 -3
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/core/ll_client.js +49 -19
- package/dist/core/ll_client.js.map +1 -1
- package/dist/core/transaction.cjs +1 -1
- package/dist/core/transaction.js +1 -1
- package/dist/core/unauth_client.cjs +6 -2
- package/dist/core/unauth_client.cjs.map +1 -1
- package/dist/core/unauth_client.d.ts +2 -1
- package/dist/core/unauth_client.d.ts.map +1 -1
- package/dist/core/unauth_client.js +6 -2
- package/dist/core/unauth_client.js.map +1 -1
- package/dist/core/websocket_stream.cjs +23 -2
- package/dist/core/websocket_stream.cjs.map +1 -1
- package/dist/core/websocket_stream.d.ts.map +1 -1
- package/dist/core/websocket_stream.js +23 -2
- package/dist/core/websocket_stream.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/proto-rest/index.cjs +1 -1
- package/dist/proto-rest/index.cjs.map +1 -1
- package/dist/proto-rest/index.js +2 -2
- package/dist/proto-rest/index.js.map +1 -1
- package/dist/test/test_config.cjs +13 -3
- package/dist/test/test_config.cjs.map +1 -1
- package/dist/test/test_config.d.ts +4 -0
- package/dist/test/test_config.d.ts.map +1 -1
- package/dist/test/test_config.js +12 -4
- package/dist/test/test_config.js.map +1 -1
- package/package.json +10 -8
- package/src/core/client.ts +40 -21
- package/src/core/default_client.ts +1 -1
- package/src/core/errors.ts +61 -34
- package/src/core/ll_client.test.ts +18 -3
- package/src/core/ll_client.ts +63 -22
- package/src/core/unauth_client.test.ts +4 -4
- package/src/core/unauth_client.ts +7 -2
- package/src/core/websocket_stream.ts +22 -1
- package/src/proto-rest/index.ts +2 -2
- package/src/test/test_config.ts +13 -4
- /package/dist/__external/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3 → @rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3}/__external/tslib/tslib.es6.cjs +0 -0
- /package/dist/__external/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3 → @rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3}/__external/tslib/tslib.es6.js +0 -0
package/src/test/test_config.ts
CHANGED
|
@@ -54,6 +54,16 @@ export function getTestConfig(): TestConfig {
|
|
|
54
54
|
return conf as TestConfig;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/** Default request timeout for tests (ms) */
|
|
58
|
+
export const TEST_REQUEST_TIMEOUT = 500;
|
|
59
|
+
|
|
60
|
+
/** Returns PlClientConfig with reduced timeout for tests */
|
|
61
|
+
export function plAddressToTestConfig(address: string): PlClientConfig {
|
|
62
|
+
const plConf = plAddressToConfig(address);
|
|
63
|
+
plConf.defaultRequestTimeout = TEST_REQUEST_TIMEOUT;
|
|
64
|
+
return plConf;
|
|
65
|
+
}
|
|
66
|
+
|
|
57
67
|
interface AuthCache {
|
|
58
68
|
/** To check if config changed */
|
|
59
69
|
conf: TestConfig;
|
|
@@ -109,9 +119,8 @@ export async function getTestClientConf(): Promise<{ conf: PlClientConfig; auth:
|
|
|
109
119
|
}
|
|
110
120
|
}
|
|
111
121
|
|
|
112
|
-
const plConf =
|
|
113
|
-
|
|
114
|
-
const uClient = new UnauthenticatedPlClient(plConf);
|
|
122
|
+
const plConf = plAddressToTestConfig(tConf.address);
|
|
123
|
+
const uClient = await UnauthenticatedPlClient.build(plConf);
|
|
115
124
|
|
|
116
125
|
const requireAuth = await uClient.requireAuth();
|
|
117
126
|
|
|
@@ -147,7 +156,7 @@ export async function getTestClientConf(): Promise<{ conf: PlClientConfig; auth:
|
|
|
147
156
|
|
|
148
157
|
export async function getTestLLClient(confOverrides: Partial<PlClientConfig> = {}) {
|
|
149
158
|
const { conf, auth } = await getTestClientConf();
|
|
150
|
-
return
|
|
159
|
+
return await LLPlClient.build({ ...conf, ...confOverrides }, { auth });
|
|
151
160
|
}
|
|
152
161
|
|
|
153
162
|
export async function getTestClient(
|
|
File without changes
|