test: make better stack first when creating a connection
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
import verifyCredentials from './verify-credentials';
|
import verifyCredentials from './verify-credentials.js';
|
||||||
import isStillVerified from './is-still-verified';
|
import isStillVerified from './is-still-verified.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
key: 'screenName',
|
key: 'screenName',
|
||||||
label: 'Screen Name',
|
label: 'Screen Name',
|
||||||
type: 'string' as const,
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
value: null,
|
value: null,
|
||||||
@@ -18,7 +18,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: 'apiKey',
|
key: 'apiKey',
|
||||||
label: 'API Key',
|
label: 'API Key',
|
||||||
type: 'string' as const,
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
value: null,
|
value: null,
|
@@ -0,0 +1,8 @@
|
|||||||
|
import verifyCredentials from './verify-credentials.js';
|
||||||
|
|
||||||
|
const isStillVerified = async ($) => {
|
||||||
|
await verifyCredentials($);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default isStillVerified;
|
@@ -1,9 +0,0 @@
|
|||||||
import { IGlobalVariable } from '@automatisch/types';
|
|
||||||
import verifyCredentials from './verify-credentials';
|
|
||||||
|
|
||||||
const isStillVerified = async ($: IGlobalVariable) => {
|
|
||||||
await verifyCredentials($);
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default isStillVerified;
|
|
@@ -1,6 +1,4 @@
|
|||||||
import { IGlobalVariable } from '@automatisch/types';
|
const verifyCredentials = async ($) => {
|
||||||
|
|
||||||
const verifyCredentials = async ($: IGlobalVariable) => {
|
|
||||||
await $.http.get('/v2/metadata');
|
await $.http.get('/v2/metadata');
|
||||||
|
|
||||||
await $.auth.set({
|
await $.auth.set({
|
@@ -1,6 +1,4 @@
|
|||||||
import { TBeforeRequest } from '@automatisch/types';
|
const addAuthHeader = ($, requestConfig) => {
|
||||||
|
|
||||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
|
||||||
if ($.auth.data?.apiKey) {
|
if ($.auth.data?.apiKey) {
|
||||||
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
|
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
|
||||||
}
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
import defineApp from '../../helpers/define-app';
|
import defineApp from '../../helpers/define-app.js';
|
||||||
import addAuthHeader from './common/add-auth-header';
|
import addAuthHeader from './common/add-auth-header.js';
|
||||||
import auth from './auth';
|
import auth from './auth/index.js';
|
||||||
|
|
||||||
export default defineApp({
|
export default defineApp({
|
||||||
name: 'Better Stack',
|
name: 'Better Stack',
|
Reference in New Issue
Block a user