@veilgroup/sdk-woro 0.1.1 → 0.1.3
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/README.md +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +2 -2
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { WoroClient, WORO_PRODUCTION_URL } from './client.js';
|
|
1
|
+
export { WoroClient, WORO_PRODUCTION_COGNITO, WORO_PRODUCTION_URL } from './client.js';
|
|
2
2
|
export type { AccountBalance, AccountOverview, CognitoConfig, CreatedSecret, CreatedWriteToken, ReadOptions, ReadSecret, SecretStatus, WriteOptions, WriteTokenRecord, WoroClientOptions, } from './client.js';
|
|
3
3
|
export { WoroApiError, WoroAuthError, WoroPayloadError } from './errors.js';
|
|
4
4
|
export { WORO_ENVELOPE_CONTENT_TYPE, WORO_MAX_PAYLOAD_BYTES, decodePayload, encodePayload, toBytes, } from './payload.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,OAAO,GACR,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2056,6 +2056,11 @@ function asArrayBuffer(bytes) {
|
|
|
2056
2056
|
|
|
2057
2057
|
// src/client.ts
|
|
2058
2058
|
var WORO_PRODUCTION_URL = "https://woro.veilgroup.au";
|
|
2059
|
+
var WORO_PRODUCTION_COGNITO = {
|
|
2060
|
+
region: "ap-southeast-2",
|
|
2061
|
+
userPoolId: "ap-southeast-2_Mk0DfTieu",
|
|
2062
|
+
appClientId: "3ctmf4jsgkeft10bj0uthu4jv1"
|
|
2063
|
+
};
|
|
2059
2064
|
var WoroClient = class {
|
|
2060
2065
|
baseUrl;
|
|
2061
2066
|
fetcher;
|
|
@@ -2067,7 +2072,7 @@ var WoroClient = class {
|
|
|
2067
2072
|
this.baseUrl = (options.baseUrl ?? WORO_PRODUCTION_URL).replace(/\/+$/, "");
|
|
2068
2073
|
this.writeToken = options.writeToken;
|
|
2069
2074
|
this.idToken = options.idToken;
|
|
2070
|
-
this.cognito = options.cognito;
|
|
2075
|
+
this.cognito = { ...WORO_PRODUCTION_COGNITO, ...options.cognito };
|
|
2071
2076
|
this.fetcher = options.fetch ?? fetch;
|
|
2072
2077
|
}
|
|
2073
2078
|
setWriteToken(token) {
|
|
@@ -2081,7 +2086,6 @@ var WoroClient = class {
|
|
|
2081
2086
|
this.setIdToken(void 0);
|
|
2082
2087
|
}
|
|
2083
2088
|
async signIn(username, password) {
|
|
2084
|
-
if (!this.cognito) throw new WoroAuthError("Cognito region, userPoolId, and appClientId are required for sign-in.");
|
|
2085
2089
|
if (!username || !password) throw new WoroAuthError("A Cognito username and password are required.");
|
|
2086
2090
|
const srp = new dist_default(this.cognito.userPoolId);
|
|
2087
2091
|
const endpoint = `https://cognito-idp.${this.cognito.region}.amazonaws.com/`;
|
|
@@ -2288,6 +2292,7 @@ function toArrayBuffer(bytes) {
|
|
|
2288
2292
|
export {
|
|
2289
2293
|
WORO_ENVELOPE_CONTENT_TYPE,
|
|
2290
2294
|
WORO_MAX_PAYLOAD_BYTES,
|
|
2295
|
+
WORO_PRODUCTION_COGNITO,
|
|
2291
2296
|
WORO_PRODUCTION_URL,
|
|
2292
2297
|
WoroApiError,
|
|
2293
2298
|
WoroAuthError,
|