@extrahorizon/exh-cli 1.13.0-dev-184-fd0c8a4 → 1.13.0-dev-185-2ec8f03
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/build/exh.d.ts +0 -1
- package/build/exh.js +2 -15
- package/build/services/auth.js +6 -2
- package/package.json +1 -1
package/build/exh.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
2
|
-
export declare function sdkInitOnly(apiHost: string, consumerKey: string, consumerSecret: string): OAuth1Client;
|
|
3
2
|
export declare function sdkAuth(): Promise<OAuth1Client>;
|
|
4
3
|
export declare function getSdk(): OAuth1Client;
|
|
5
4
|
export declare function getNewSdkInstance(): OAuth1Client;
|
package/build/exh.js
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNewSdkInstance = exports.getSdk = exports.sdkAuth =
|
|
3
|
+
exports.getNewSdkInstance = exports.getSdk = exports.sdkAuth = void 0;
|
|
4
4
|
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
5
5
|
const util_1 = require("./helpers/util");
|
|
6
6
|
let sdk = null;
|
|
7
|
-
function sdkInitOnly(apiHost, consumerKey, consumerSecret) {
|
|
8
|
-
sdk = (0, javascript_sdk_1.createOAuth1Client)({
|
|
9
|
-
consumerKey,
|
|
10
|
-
consumerSecret,
|
|
11
|
-
host: apiHost,
|
|
12
|
-
});
|
|
13
|
-
return sdk;
|
|
14
|
-
}
|
|
15
|
-
exports.sdkInitOnly = sdkInitOnly;
|
|
16
7
|
async function sdkAuth() {
|
|
17
8
|
(0, util_1.loadAndAssertCredentials)();
|
|
18
|
-
sdk = (
|
|
19
|
-
host: process.env.API_HOST,
|
|
20
|
-
consumerKey: process.env.API_OAUTH_CONSUMER_KEY,
|
|
21
|
-
consumerSecret: process.env.API_OAUTH_CONSUMER_SECRET,
|
|
22
|
-
});
|
|
9
|
+
sdk = getNewSdkInstance();
|
|
23
10
|
try {
|
|
24
11
|
await sdk.auth.authenticate({
|
|
25
12
|
token: process.env.API_OAUTH_TOKEN,
|
package/build/services/auth.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.whoami = exports.login = void 0;
|
|
4
4
|
const fs = require("fs/promises");
|
|
5
|
+
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
5
6
|
const chalk = require("chalk");
|
|
6
7
|
const constants_1 = require("../constants");
|
|
7
|
-
const exh_1 = require("../exh");
|
|
8
8
|
const authRepository = require("../repositories/auth");
|
|
9
9
|
async function login(host, email, password, consumerKey, consumerSecret) {
|
|
10
|
-
const sdk = (0,
|
|
10
|
+
const sdk = (0, javascript_sdk_1.createOAuth1Client)({
|
|
11
|
+
consumerKey,
|
|
12
|
+
consumerSecret,
|
|
13
|
+
host,
|
|
14
|
+
});
|
|
11
15
|
const response = await sdk.auth.authenticate({
|
|
12
16
|
email,
|
|
13
17
|
password,
|