🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

appstash

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appstash - npm Package Compare versions

Comparing version
0.4.0
to
0.5.0
+6
-0
config-store.d.ts

@@ -0,4 +1,8 @@

export interface ContextTargetEndpoint {
endpoint: string;
}
export interface ContextConfig {
name: string;
endpoint: string;
targets?: Record<string, ContextTargetEndpoint>;
createdAt: string;

@@ -26,2 +30,3 @@ updatedAt: string;

endpoint: string;
targets?: Record<string, ContextTargetEndpoint>;
}): ContextConfig;

@@ -33,2 +38,3 @@ loadContext(name: string): ContextConfig | null;

setCurrentContext(name: string): boolean;
getTargetEndpoint(targetName: string, contextName?: string): string | null;
setCredentials(contextName: string, creds: ContextCredentials): void;

@@ -35,0 +41,0 @@ getCredentials(contextName: string): ContextCredentials | null;

@@ -92,2 +92,5 @@ "use strict";

};
if (options.targets) {
context.targets = options.targets;
}
writeJson(contextPath(name), context);

@@ -181,2 +184,17 @@ return context;

}
function getTargetEndpoint(targetName, contextName) {
let ctx;
if (contextName) {
ctx = loadContext(contextName);
}
else {
ctx = getCurrentContext();
}
if (!ctx)
return null;
if (ctx.targets && ctx.targets[targetName]) {
return ctx.targets[targetName].endpoint;
}
return ctx.endpoint;
}
return {

@@ -191,2 +209,3 @@ loadSettings,

setCurrentContext,
getTargetEndpoint,
setCredentials,

@@ -193,0 +212,0 @@ getCredentials,

@@ -0,4 +1,8 @@

export interface ContextTargetEndpoint {
endpoint: string;
}
export interface ContextConfig {
name: string;
endpoint: string;
targets?: Record<string, ContextTargetEndpoint>;
createdAt: string;

@@ -26,2 +30,3 @@ updatedAt: string;

endpoint: string;
targets?: Record<string, ContextTargetEndpoint>;
}): ContextConfig;

@@ -33,2 +38,3 @@ loadContext(name: string): ContextConfig | null;

setCurrentContext(name: string): boolean;
getTargetEndpoint(targetName: string, contextName?: string): string | null;
setCredentials(contextName: string, creds: ContextCredentials): void;

@@ -35,0 +41,0 @@ getCredentials(contextName: string): ContextCredentials | null;

@@ -56,2 +56,5 @@ import * as fs from 'fs';

};
if (options.targets) {
context.targets = options.targets;
}
writeJson(contextPath(name), context);

@@ -145,2 +148,17 @@ return context;

}
function getTargetEndpoint(targetName, contextName) {
let ctx;
if (contextName) {
ctx = loadContext(contextName);
}
else {
ctx = getCurrentContext();
}
if (!ctx)
return null;
if (ctx.targets && ctx.targets[targetName]) {
return ctx.targets[targetName].endpoint;
}
return ctx.endpoint;
}
return {

@@ -155,2 +173,3 @@ loadSettings,

setCurrentContext,
getTargetEndpoint,
setCredentials,

@@ -157,0 +176,0 @@ getCredentials,

+1
-1

@@ -101,2 +101,2 @@ /**

export { createConfigStore } from './config-store';
export type { ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, Credentials, GlobalSettings, } from './config-store';
export type { ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, ContextTargetEndpoint, Credentials, GlobalSettings, } from './config-store';

@@ -101,2 +101,2 @@ /**

export { createConfigStore } from './config-store';
export type { ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, Credentials, GlobalSettings, } from './config-store';
export type { ConfigStore, ConfigStoreOptions, ContextConfig, ContextCredentials, ContextTargetEndpoint, Credentials, GlobalSettings, } from './config-store';
{
"name": "appstash",
"version": "0.4.0",
"version": "0.5.0",
"author": "Constructive <developers@constructive.io>",

@@ -43,3 +43,3 @@ "description": "Simple, clean application directory resolution",

],
"gitHead": "de740970766f110cad481ea900880a9b3120f9d5"
"gitHead": "fd9721cb17389c4e2f9847169d5a42de2f9746dd"
}