Socket
Socket
Sign inDemoInstall

@fluree/fluree-client

Package Overview
Dependencies
Maintainers
9
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluree/fluree-client - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/utils/contextHandler.d.ts

5

dist/core/FlureeClient.d.ts

@@ -5,2 +5,3 @@ import { IFlureeConfig } from '../interfaces/IFlureeConfig';

import { IFlureeTransaction } from '../interfaces/IFlureeTransaction';
import { ContextStatement } from '../types/ContextTypes';
import { HistoryQueryInstance } from './HistoryQueryInstance';

@@ -35,2 +36,6 @@ import { QueryInstance } from './QueryInstance';

getPublicKey(): string | undefined;
getDid(): string | undefined;
setContext(context: ContextStatement): FlureeClient;
addToContext(context: ContextStatement): FlureeClient;
getContext(): ContextStatement | undefined;
}

@@ -19,2 +19,3 @@ "use strict";

exports.FlureeClient = void 0;
const contextHandler_1 = require("../utils/contextHandler");
const FlureeError_1 = require("./FlureeError");

@@ -49,2 +50,7 @@ const HistoryQueryInstance_1 = require("./HistoryQueryInstance");

const mergedConfig = Object.assign(Object.assign({}, this.config), config);
if (config.defaultContext) {
if (this.config.defaultContext) {
mergedConfig.defaultContext = (0, contextHandler_1.mergeContexts)(this.config.defaultContext, config.defaultContext);
}
}
this.config = mergedConfig;

@@ -151,2 +157,22 @@ __classPrivateFieldGet(this, _FlureeClient_instances, "m", _FlureeClient_checkConfig).call(this);

}
getDid() {
return this.config.did;
}
setContext(context) {
this.configure({ defaultContext: context });
return this;
}
addToContext(context) {
if (this.config.defaultContext) {
const newContext = (0, contextHandler_1.mergeContexts)(this.config.defaultContext, context);
this.configure({ defaultContext: newContext });
}
else {
this.configure({ defaultContext: context });
}
return this;
}
getContext() {
return this.config.defaultContext;
}
}

@@ -153,0 +179,0 @@ exports.FlureeClient = FlureeClient;

@@ -13,2 +13,3 @@ "use strict";

exports.QueryInstance = void 0;
const contextHandler_1 = require("../utils/contextHandler");
const FlureeError_1 = require("./FlureeError");

@@ -21,2 +22,7 @@ const crypto_1 = require("@fluree/crypto");

this.config = config;
if (this.config.defaultContext || this.query['@context']) {
const defaultContext = this.config.defaultContext || {};
const queryContext = this.query['@context'] || {};
this.query['@context'] = (0, contextHandler_1.mergeContexts)(defaultContext, queryContext);
}
if (config.signMessages) {

@@ -46,2 +52,3 @@ this.sign();

// }
debugger;
return response.json();

@@ -48,0 +55,0 @@ })

@@ -13,2 +13,3 @@ "use strict";

exports.TransactionInstance = void 0;
const contextHandler_1 = require("../utils/contextHandler");
const FlureeError_1 = require("./FlureeError");

@@ -21,2 +22,7 @@ const crypto_1 = require("@fluree/crypto");

this.config = config;
if (this.config.defaultContext || this.transaction['@context']) {
const defaultContext = this.config.defaultContext || {};
const transactionContext = this.transaction['@context'] || {};
this.transaction['@context'] = (0, contextHandler_1.mergeContexts)(defaultContext, transactionContext);
}
if (config.signMessages) {

@@ -46,2 +52,3 @@ this.sign();

// }
debugger;
return response.json();

@@ -48,0 +55,0 @@ })

2

dist/interfaces/IFlureeConfig.d.ts

@@ -0,1 +1,2 @@

import { ContextStatement } from '../types/ContextTypes';
export interface IFlureeConfig {

@@ -11,2 +12,3 @@ ledger?: string;

signMessages?: boolean;
defaultContext?: ContextStatement;
}

4

dist/types/ContextTypes.d.ts
type ContextString = string;
type ContextValue = string | Record<string, string>;
type ContextMap = {
export type ContextValue = string | Record<string, string>;
export type ContextMap = {
[key: string]: ContextValue;

@@ -5,0 +5,0 @@ };

type InsertObject = {
[key: string]: string | InsertStatement;
[key: string]: string | string[] | InsertStatement;
};

@@ -4,0 +4,0 @@ type InsertArray = Array<InsertObject>;

{
"name": "@fluree/fluree-client",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -40,3 +40,3 @@ "main": "dist/index.js",

"dependencies": {
"@fluree/crypto": "./crypto",
"@fluree/crypto": "^3.0.0-alpha1",
"@types/uuid": "^9.0.8",

@@ -43,0 +43,0 @@ "uuid": "^9.0.1"

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