Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ajustee/cc-frontoffice-browser

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ajustee/cc-frontoffice-browser - npm Package Compare versions

Comparing version 0.1.9 to 0.2.0

8

lib/index.d.ts

@@ -15,7 +15,7 @@ export declare const enum CcDataType {

private readonly url;
private headers?;
appId?: string;
constructor(url: string, headers?: Record<string, string> | undefined);
getConfigKeys(path?: string, headers?: Record<string, string>): Promise<CcKey[]>;
appId?: string | undefined;
defaultParams?: Record<string, string> | undefined;
constructor(url: string, appId?: string | undefined, defaultParams?: Record<string, string> | undefined);
getConfigKeys(path?: string, additionalParams?: Record<string, string>): Promise<CcKey[]>;
private getConfigKeys2;
}

@@ -6,15 +6,16 @@ "use strict";

class CcFrontOffice {
constructor(url, headers) {
constructor(url, appId, defaultParams) {
this.url = url;
this.headers = headers;
this.appId = appId;
this.defaultParams = defaultParams;
}
;
async getConfigKeys(path, headers) {
async getConfigKeys(path, additionalParams) {
if (!this.appId)
throw new Error('App id is not defined.');
const requestHeaders = { [appIdHeader]: this.appId };
if (this.headers)
Object.assign(requestHeaders, this.headers);
if (headers)
Object.assign(requestHeaders, headers);
if (this.defaultParams)
Object.assign(requestHeaders, this.defaultParams);
if (additionalParams)
Object.assign(requestHeaders, additionalParams);
const response = await fetch(`${this.url}/${path ? `configurationKeys?path=${path}` : 'configurationKeys'}`, {

@@ -30,10 +31,10 @@ method: CcLambdaMethod,

}
async getConfigKeys2(path, headers) {
async getConfigKeys2(path, additionalParams) {
if (!this.appId)
throw new Error('App id is not defined.');
const requestHeaders = { [appIdHeader]: this.appId };
if (this.headers)
Object.assign(requestHeaders, this.headers);
if (headers)
Object.assign(requestHeaders, headers);
if (this.defaultParams)
Object.assign(requestHeaders, this.defaultParams);
if (additionalParams)
Object.assign(requestHeaders, additionalParams);
const response = await fetch(`${this.url}/${path ? `config/${path}` : 'config'}`, {

@@ -40,0 +41,0 @@ method: CcLambdaMethod,

{
"name": "@ajustee/cc-frontoffice-browser",
"version": "0.1.9",
"version": "0.2.0",
"description": "Ajustee Config Center FrontOffice Browser API",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc