aeria-sdk 0.0.84 → 0.0.86
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/bin/index.js +1 -1
- package/dist/auth.d.ts +5 -1
- package/dist/auth.js +3 -4
- package/dist/auth.mjs +4 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -10
- package/dist/index.mjs +1 -9
- package/package.json +3 -3
package/bin/index.js
CHANGED
package/dist/auth.d.ts
CHANGED
|
@@ -11,5 +11,9 @@ export type AuthenticationPayload = {
|
|
|
11
11
|
password: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const authMemo: AuthenticationResult;
|
|
14
|
-
export declare const authenticate: (config: InstanceConfig) => (payload: AuthenticationPayload) => Promise<
|
|
14
|
+
export declare const authenticate: (config: InstanceConfig) => (payload: AuthenticationPayload) => Promise<{
|
|
15
|
+
readonly _tag: "Error";
|
|
16
|
+
readonly error: any;
|
|
17
|
+
readonly result: undefined;
|
|
18
|
+
}>;
|
|
15
19
|
export declare const signout: (config: InstanceConfig) => () => Promise<void>;
|
package/dist/auth.js
CHANGED
|
@@ -8,12 +8,11 @@ const storage_js_1 = require("./storage.js");
|
|
|
8
8
|
exports.authMemo = {};
|
|
9
9
|
const authenticate = (config) => async (payload) => {
|
|
10
10
|
const response = await (0, http_js_1.request)(config, `${(0, utils_js_1.publicUrl)(config)}/user/authenticate`, payload);
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
const result = (0, common_1.unwrapEither)(resultEither);
|
|
11
|
+
const { error, value: result } = response.data;
|
|
12
|
+
if (result) {
|
|
14
13
|
(0, storage_js_1.getStorage)(config).set('auth', result);
|
|
15
14
|
}
|
|
16
|
-
return
|
|
15
|
+
return common_1.Result.error(error);
|
|
17
16
|
};
|
|
18
17
|
exports.authenticate = authenticate;
|
|
19
18
|
const signout = (config) => async () => {
|
package/dist/auth.mjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import {
|
|
2
|
+
import { Result } from "@aeriajs/common";
|
|
3
3
|
import { request } from "./http.mjs";
|
|
4
4
|
import { publicUrl } from "./utils.mjs";
|
|
5
5
|
import { getStorage } from "./storage.mjs";
|
|
6
6
|
export const authMemo = {};
|
|
7
7
|
export const authenticate = (config) => async (payload) => {
|
|
8
8
|
const response = await request(config, `${publicUrl(config)}/user/authenticate`, payload);
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const result = unwrapEither(resultEither);
|
|
9
|
+
const { error, value: result } = response.data;
|
|
10
|
+
if (result) {
|
|
12
11
|
getStorage(config).set("auth", result);
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return Result.error(error);
|
|
15
14
|
};
|
|
16
15
|
export const signout = (config) => async () => {
|
|
17
16
|
getStorage(config).remove("auth");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Result, throwIfError, } from '@aeriajs/common';
|
|
2
2
|
export * from './auth.js';
|
|
3
3
|
export * from './topLevel.js';
|
|
4
4
|
export * from './constants.js';
|
package/dist/index.js
CHANGED
|
@@ -14,17 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.throwIfError = exports.
|
|
17
|
+
exports.throwIfError = exports.Result = void 0;
|
|
18
18
|
var common_1 = require("@aeriajs/common");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "right", { enumerable: true, get: function () { return common_1.right; } });
|
|
21
|
-
Object.defineProperty(exports, "isLeft", { enumerable: true, get: function () { return common_1.isLeft; } });
|
|
22
|
-
Object.defineProperty(exports, "isRight", { enumerable: true, get: function () { return common_1.isRight; } });
|
|
23
|
-
Object.defineProperty(exports, "unwrapEither", { enumerable: true, get: function () { return common_1.unwrapEither; } });
|
|
24
|
-
Object.defineProperty(exports, "error", { enumerable: true, get: function () { return common_1.error; } });
|
|
25
|
-
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return common_1.isError; } });
|
|
26
|
-
Object.defineProperty(exports, "unwrapError", { enumerable: true, get: function () { return common_1.unwrapError; } });
|
|
27
|
-
Object.defineProperty(exports, "throwIfLeft", { enumerable: true, get: function () { return common_1.throwIfLeft; } });
|
|
19
|
+
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return common_1.Result; } });
|
|
28
20
|
Object.defineProperty(exports, "throwIfError", { enumerable: true, get: function () { return common_1.throwIfError; } });
|
|
29
21
|
__exportStar(require("./auth.js"), exports);
|
|
30
22
|
__exportStar(require("./topLevel.js"), exports);
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aeria-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.86",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@aeriajs/types": "link:../types"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@aeriajs/common": "^0.0.
|
|
64
|
-
"@aeriajs/types": "^0.0.
|
|
63
|
+
"@aeriajs/common": "^0.0.61",
|
|
64
|
+
"@aeriajs/types": "^0.0.57"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"test": "echo skipping",
|