wapi-client 0.15.8 → 0.16.0-beta.1
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/api/base-client.browser.cjs +62 -41
- package/dist/api/base-client.browser.js +62 -41
- package/dist/api/base-client.cjs +62 -41
- package/dist/api/base-client.js +62 -41
- package/dist/api/http-client.browser.cjs +13 -13
- package/dist/api/http-client.browser.js +14 -14
- package/dist/api/http-client.cjs +13 -13
- package/dist/api/http-client.js +14 -14
- package/dist/api/ws-client.browser.cjs +2 -2
- package/dist/api/ws-client.browser.js +2 -2
- package/dist/api/ws-client.cjs +2 -2
- package/dist/api/ws-client.js +2 -2
- package/dist/client-options.schema.zod.browser.cjs +12 -17
- package/dist/client-options.schema.zod.browser.js +12 -17
- package/dist/client-options.schema.zod.cjs +15 -21
- package/dist/client-options.schema.zod.js +12 -17
- package/dist/client.browser.cjs +19 -5
- package/dist/client.browser.js +19 -5
- package/dist/client.cjs +19 -5
- package/dist/client.js +19 -5
- package/dist/lib/env.browser.cjs +1 -1
- package/dist/lib/env.browser.js +1 -1
- package/dist/lib/env.cjs +1 -1
- package/dist/lib/env.js +1 -1
- package/dist/lib/errors.browser.cjs +5 -0
- package/dist/lib/errors.browser.js +5 -0
- package/dist/lib/errors.cjs +5 -0
- package/dist/lib/errors.js +5 -0
- package/dist/lib/utils.browser.cjs +10 -4
- package/dist/lib/utils.browser.js +10 -4
- package/dist/lib/utils.cjs +11 -4
- package/dist/lib/utils.js +10 -4
- package/dist/types/wapi-client.d.ts +79 -52
- package/dist/wapi-client-web.iife.js +7 -7
- package/dist/wapi-client.browser.cjs +4 -6
- package/dist/wapi-client.browser.js +5 -10
- package/dist/wapi-client.cjs +4 -6
- package/dist/wapi-client.iife.js +7 -7
- package/dist/wapi-client.js +5 -10
- package/package.json +2 -2
package/dist/wapi-client.js
CHANGED
|
@@ -4,10 +4,7 @@ import {
|
|
|
4
4
|
createClientWithHttp,
|
|
5
5
|
createClientWithWS
|
|
6
6
|
} from "./client.js";
|
|
7
|
-
import {
|
|
8
|
-
httpsConnectionSchema,
|
|
9
|
-
wsConnectionSchema
|
|
10
|
-
} from "./client-options.schema.zod.js";
|
|
7
|
+
import { connectionSchema } from "./client-options.schema.zod.js";
|
|
11
8
|
import {
|
|
12
9
|
ERROR_MESSAGES as ErrorMessage,
|
|
13
10
|
ERROR_TYPES as ErrorType,
|
|
@@ -30,21 +27,19 @@ import { AggregateQueryBuilder } from "./lib/query-builder/aggregate-query-build
|
|
|
30
27
|
import { ReverseQueryBuilder } from "./lib/query-builder/reverse-query-builder.js";
|
|
31
28
|
import { UpdateQueryBuilder } from "./lib/query-builder/update-query-builder.js";
|
|
32
29
|
initPolyfills();
|
|
33
|
-
var
|
|
34
|
-
var zodHTTPSConnectionValidator = getValidator(httpsConnectionSchema);
|
|
30
|
+
var connectionValidator = getValidator(connectionSchema);
|
|
35
31
|
var WapiClientType = {
|
|
36
32
|
ws: "ws",
|
|
37
33
|
https: "https"
|
|
38
34
|
};
|
|
39
35
|
function create(options) {
|
|
40
36
|
const { config, client, connection } = options;
|
|
37
|
+
const validatedConnection = connectionValidator.validateInput(connection);
|
|
41
38
|
if ((client != null ? client : WapiClientType.ws) === WapiClientType.ws) {
|
|
42
|
-
|
|
43
|
-
return createClientWithWS(wsConnection, config);
|
|
39
|
+
return createClientWithWS(validatedConnection, config);
|
|
44
40
|
}
|
|
45
41
|
if (client === WapiClientType.https) {
|
|
46
|
-
|
|
47
|
-
return createClientWithHttp(httpsConnection, config);
|
|
42
|
+
return createClientWithHttp(validatedConnection, config);
|
|
48
43
|
}
|
|
49
44
|
throw new TypeError("Invalid client type");
|
|
50
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wapi-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0-beta.1",
|
|
4
4
|
"description": "Client library to to access WAPI ledgering services",
|
|
5
5
|
"main": "dist/wapi-client.cjs",
|
|
6
6
|
"module": "dist/wapi-client.js",
|
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
"esbuild": "^0.25.9",
|
|
65
65
|
"typescript": "^5.8.2"
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
}
|