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

@web3api/core-js

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3api/core-js - npm Package Compare versions

Comparing version 0.0.1-prealpha.71 to 0.0.1-prealpha.72

build/manifest/formats/web3api.app/0.0.1-prealpha.2.d.ts

2

build/manifest/formats/web3api.app/deserialize.d.ts

@@ -7,2 +7,2 @@ /**

import { DeserializeManifestOptions } from "../../";
export declare const deserializeAppManifest: (manifest: string, options?: DeserializeManifestOptions | undefined) => import("./0.0.1-prealpha.1").AppManifest;
export declare const deserializeAppManifest: (manifest: string, options?: DeserializeManifestOptions | undefined) => import("./0.0.1-prealpha.2").AppManifest;

@@ -7,11 +7,13 @@ /**

import { AppManifest as AppManifest0_0_1_prealpha_1 } from "./0.0.1-prealpha.1";
export { AppManifest0_0_1_prealpha_1, };
import { AppManifest as AppManifest0_0_1_prealpha_2 } from "./0.0.1-prealpha.2";
export { AppManifest0_0_1_prealpha_1, AppManifest0_0_1_prealpha_2, };
export declare enum AppManifestFormats {
"0.0.1-prealpha.1" = "0.0.1-prealpha.1"
"0.0.1-prealpha.1" = "0.0.1-prealpha.1",
"0.0.1-prealpha.2" = "0.0.1-prealpha.2"
}
export declare type AnyAppManifest = AppManifest0_0_1_prealpha_1;
export declare type AppManifest = AppManifest0_0_1_prealpha_1;
export declare const latestAppManifestFormat = AppManifestFormats["0.0.1-prealpha.1"];
export declare type AnyAppManifest = AppManifest0_0_1_prealpha_1 | AppManifest0_0_1_prealpha_2;
export declare type AppManifest = AppManifest0_0_1_prealpha_2;
export declare const latestAppManifestFormat = AppManifestFormats["0.0.1-prealpha.2"];
export { migrateAppManifest } from "./migrate";
export { deserializeAppManifest } from "./deserialize";
export { validateAppManifest } from "./validate";

@@ -13,4 +13,5 @@ "use strict";

AppManifestFormats["0.0.1-prealpha.1"] = "0.0.1-prealpha.1";
AppManifestFormats["0.0.1-prealpha.2"] = "0.0.1-prealpha.2";
})(AppManifestFormats = exports.AppManifestFormats || (exports.AppManifestFormats = {}));
exports.latestAppManifestFormat = AppManifestFormats["0.0.1-prealpha.1"];
exports.latestAppManifestFormat = AppManifestFormats["0.0.1-prealpha.2"];
var migrate_1 = require("./migrate");

@@ -17,0 +18,0 @@ Object.defineProperty(exports, "migrateAppManifest", { enumerable: true, get: function () { return migrate_1.migrateAppManifest; } });

@@ -11,3 +11,3 @@ /**

export declare const migrators: Migrator;
export declare const migrateAppManifest: (manifest: import("./0.0.1-prealpha.1").AppManifest, to: AppManifestFormats) => import("./0.0.1-prealpha.1").AppManifest;
export declare const migrateAppManifest: (manifest: AnyAppManifest, to: AppManifestFormats) => import("./0.0.1-prealpha.2").AppManifest;
export {};

@@ -11,4 +11,7 @@ "use strict";

var _1 = require(".");
var _0_0_1_prealpha_1_to_0_0_1_prealpha_2_1 = require("./migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2");
var tracing_js_1 = require("@web3api/tracing-js");
exports.migrators = {};
exports.migrators = {
"0.0.1-prealpha.1": _0_0_1_prealpha_1_to_0_0_1_prealpha_2_1.migrate,
};
exports.migrateAppManifest = tracing_js_1.Tracer.traceFunc("core: migrateAppManifest", function (manifest, to) {

@@ -22,4 +25,8 @@ var from = manifest.format;

}
throw new Error("This should never happen, AppManifest migrators is empty. from: " + from + ", to: " + to);
var migrator = exports.migrators[from];
if (!migrator) {
throw new Error("Migrator from AppManifestFormat \"" + from + "\" to \"" + to + "\" is not available");
}
return migrator(manifest);
});
//# sourceMappingURL=migrate.js.map

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

/**
* This file was automatically generated by scripts/manifest/validate-ts.mustache.
* DO NOT MODIFY IT BY HAND. Instead, modify scripts/manifest/validate-ts.mustache,
* and run node ./scripts/manifest/generateFormatTypes.js to regenerate this file.
*/
import { AnyAppManifest } from ".";
import { Schema } from "jsonschema";
export declare const validateAppManifest: (manifest: import("./0.0.1-prealpha.1").AppManifest, extSchema?: Schema | undefined) => void;
export declare const validateAppManifest: (manifest: AnyAppManifest, extSchema?: Schema | undefined) => void;

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

var _0_0_1_prealpha_1_json_1 = __importDefault(require("@web3api/manifest-schemas/formats/web3api.app/0.0.1-prealpha.1.json"));
var _0_0_1_prealpha_2_json_1 = __importDefault(require("@web3api/manifest-schemas/formats/web3api.app/0.0.1-prealpha.2.json"));
var tracing_js_1 = require("@web3api/tracing-js");

@@ -53,2 +54,3 @@ var jsonschema_1 = require("jsonschema");

"0.0.1-prealpha.1": _0_0_1_prealpha_1_json_1.default,
"0.0.1-prealpha.2": _0_0_1_prealpha_2_json_1.default,
};

@@ -60,2 +62,3 @@ var validator = new jsonschema_1.Validator();

jsonschema_1.Validator.prototype.customFormats.schemaFile = Validators.schemaFile;
jsonschema_1.Validator.prototype.customFormats.packageName = Validators.packageName;
exports.validateAppManifest = tracing_js_1.Tracer.traceFunc("core: validateAppManifest", function (manifest, extSchema) {

@@ -62,0 +65,0 @@ if (extSchema === void 0) { extSchema = undefined; }

@@ -7,2 +7,2 @@ /**

import { DeserializeManifestOptions } from "../../";
export declare const deserializePluginManifest: (manifest: string, options?: DeserializeManifestOptions | undefined) => import("./0.0.1-prealpha.1").PluginManifest;
export declare const deserializePluginManifest: (manifest: string, options?: DeserializeManifestOptions | undefined) => import("./0.0.1-prealpha.2").PluginManifest;

@@ -7,11 +7,13 @@ /**

import { PluginManifest as PluginManifest0_0_1_prealpha_1 } from "./0.0.1-prealpha.1";
export { PluginManifest0_0_1_prealpha_1, };
import { PluginManifest as PluginManifest0_0_1_prealpha_2 } from "./0.0.1-prealpha.2";
export { PluginManifest0_0_1_prealpha_1, PluginManifest0_0_1_prealpha_2, };
export declare enum PluginManifestFormats {
"0.0.1-prealpha.1" = "0.0.1-prealpha.1"
"0.0.1-prealpha.1" = "0.0.1-prealpha.1",
"0.0.1-prealpha.2" = "0.0.1-prealpha.2"
}
export declare type AnyPluginManifest = PluginManifest0_0_1_prealpha_1;
export declare type PluginManifest = PluginManifest0_0_1_prealpha_1;
export declare const latestPluginManifestFormat = PluginManifestFormats["0.0.1-prealpha.1"];
export declare type AnyPluginManifest = PluginManifest0_0_1_prealpha_1 | PluginManifest0_0_1_prealpha_2;
export declare type PluginManifest = PluginManifest0_0_1_prealpha_2;
export declare const latestPluginManifestFormat = PluginManifestFormats["0.0.1-prealpha.2"];
export { migratePluginManifest } from "./migrate";
export { deserializePluginManifest } from "./deserialize";
export { validatePluginManifest } from "./validate";

@@ -13,4 +13,5 @@ "use strict";

PluginManifestFormats["0.0.1-prealpha.1"] = "0.0.1-prealpha.1";
PluginManifestFormats["0.0.1-prealpha.2"] = "0.0.1-prealpha.2";
})(PluginManifestFormats = exports.PluginManifestFormats || (exports.PluginManifestFormats = {}));
exports.latestPluginManifestFormat = PluginManifestFormats["0.0.1-prealpha.1"];
exports.latestPluginManifestFormat = PluginManifestFormats["0.0.1-prealpha.2"];
var migrate_1 = require("./migrate");

@@ -17,0 +18,0 @@ Object.defineProperty(exports, "migratePluginManifest", { enumerable: true, get: function () { return migrate_1.migratePluginManifest; } });

@@ -11,3 +11,3 @@ /**

export declare const migrators: Migrator;
export declare const migratePluginManifest: (manifest: import("./0.0.1-prealpha.1").PluginManifest, to: PluginManifestFormats) => import("./0.0.1-prealpha.1").PluginManifest;
export declare const migratePluginManifest: (manifest: AnyPluginManifest, to: PluginManifestFormats) => import("./0.0.1-prealpha.2").PluginManifest;
export {};

@@ -11,4 +11,7 @@ "use strict";

var _1 = require(".");
var _0_0_1_prealpha_1_to_0_0_1_prealpha_2_1 = require("./migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2");
var tracing_js_1 = require("@web3api/tracing-js");
exports.migrators = {};
exports.migrators = {
"0.0.1-prealpha.1": _0_0_1_prealpha_1_to_0_0_1_prealpha_2_1.migrate,
};
exports.migratePluginManifest = tracing_js_1.Tracer.traceFunc("core: migratePluginManifest", function (manifest, to) {

@@ -22,4 +25,8 @@ var from = manifest.format;

}
throw new Error("This should never happen, PluginManifest migrators is empty. from: " + from + ", to: " + to);
var migrator = exports.migrators[from];
if (!migrator) {
throw new Error("Migrator from PluginManifestFormat \"" + from + "\" to \"" + to + "\" is not available");
}
return migrator(manifest);
});
//# sourceMappingURL=migrate.js.map

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

/**
* This file was automatically generated by scripts/manifest/validate-ts.mustache.
* DO NOT MODIFY IT BY HAND. Instead, modify scripts/manifest/validate-ts.mustache,
* and run node ./scripts/manifest/generateFormatTypes.js to regenerate this file.
*/
import { AnyPluginManifest } from ".";
import { Schema } from "jsonschema";
export declare const validatePluginManifest: (manifest: import("./0.0.1-prealpha.1").PluginManifest, extSchema?: Schema | undefined) => void;
export declare const validatePluginManifest: (manifest: AnyPluginManifest, extSchema?: Schema | undefined) => void;

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

var _0_0_1_prealpha_1_json_1 = __importDefault(require("@web3api/manifest-schemas/formats/web3api.plugin/0.0.1-prealpha.1.json"));
var _0_0_1_prealpha_2_json_1 = __importDefault(require("@web3api/manifest-schemas/formats/web3api.plugin/0.0.1-prealpha.2.json"));
var tracing_js_1 = require("@web3api/tracing-js");

@@ -53,2 +54,3 @@ var jsonschema_1 = require("jsonschema");

"0.0.1-prealpha.1": _0_0_1_prealpha_1_json_1.default,
"0.0.1-prealpha.2": _0_0_1_prealpha_2_json_1.default,
};

@@ -58,2 +60,4 @@ var validator = new jsonschema_1.Validator();

jsonschema_1.Validator.prototype.customFormats.file = Validators.file;
jsonschema_1.Validator.prototype.customFormats.packageName = Validators.packageName;
jsonschema_1.Validator.prototype.customFormats.graphqlFile = Validators.graphqlFile;
exports.validatePluginManifest = tracing_js_1.Tracer.traceFunc("core: validatePluginManifest", function (manifest, extSchema) {

@@ -60,0 +64,0 @@ if (extSchema === void 0) { extSchema = undefined; }

@@ -10,19 +10,22 @@ import { Uri, Client, InvokableModules, MaybeAsync } from ".";

*/
export declare type PluginMethod = (input: Record<string, unknown>, client: Client) => MaybeAsync<unknown>;
/**
* A plugin "module" is a named map of [[PluginMethod | invocable methods]].
* The names of these methods map 1:1 with the schema's query methods.
*/
export declare type PluginModule = Record<string, PluginMethod>;
/** @ignore */
declare type PluginModulesType = {
export declare type PluginMethod<TInput extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (input: TInput, client: Client) => MaybeAsync<TResult>;
export declare abstract class PluginModule<TConfig extends Record<string, unknown> = Record<string, unknown>, TEnv extends Record<string, unknown> = Record<string, unknown>, TClientEnv extends Record<string, unknown> = TEnv> {
private _env;
private _config;
constructor(config: TConfig);
get env(): TEnv;
get config(): TConfig;
_w3_load_env(env: TEnv): void;
_w3_sanitize_env(clientEnv: TClientEnv, client: Client): Promise<TEnv>;
_w3_invoke<TInput extends Record<string, unknown> = Record<string, unknown>, TResult = unknown>(method: string, input: TInput, client: Client): Promise<TResult>;
getMethod<TInput extends Record<string, unknown> = Record<string, unknown>, TResult = unknown>(method: string): PluginMethod<TInput, TResult> | undefined;
}
/** The plugin's query "modules" */
export declare type PluginModules = {
[module in InvokableModules]?: PluginModule;
};
/** The plugin's query "modules" */
export declare type PluginModules = PluginModulesType;
/**
* The plugin instance.
*/
export declare abstract class Plugin {
private _env;
export interface Plugin {
/**

@@ -34,20 +37,3 @@ * Get an instance of this plugin's modules.

*/
abstract getModules(client: Client): PluginModules;
/**
* Sanitize plugin environment.
* This can optionally implemented by plugin
*
* @param env Module environment to be sanitized
*/
sanitizeEnv?(env: Record<string, unknown>): Promise<Record<string, unknown>>;
/**
* Load module enviroment to be used
*
* @param env module enviroment to be set inside plugin
*/
loadEnv(env: Record<string, unknown>, module: InvokableModules): void;
/**
* Get module environment
*/
getEnv(module: InvokableModules): Record<string, unknown>;
getModules(): PluginModules;
}

@@ -66,2 +52,1 @@ /** The plugin package's manifest */

export declare type PluginFactory<TOpts> = (opts: TOpts) => PluginPackage;
export {};
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Plugin = void 0;
/**
* The plugin instance.
*/
var Plugin = /** @class */ (function () {
function Plugin() {
this._env = {
query: {},
mutation: {},
};
exports.PluginModule = void 0;
/* eslint-disable @typescript-eslint/naming-convention */
var _1 = require(".");
var PluginModule = /** @class */ (function () {
function PluginModule(config) {
this._config = config;
}
/**
* Load module enviroment to be used
*
* @param env module enviroment to be set inside plugin
*/
Plugin.prototype.loadEnv = function (env, module) {
this._env[module] = env;
Object.defineProperty(PluginModule.prototype, "env", {
get: function () {
return this._env;
},
enumerable: false,
configurable: true
});
Object.defineProperty(PluginModule.prototype, "config", {
get: function () {
return this._config;
},
enumerable: false,
configurable: true
});
PluginModule.prototype._w3_load_env = function (env) {
this._env = env;
};
/**
* Get module environment
*/
Plugin.prototype.getEnv = function (module) {
return this._env[module];
PluginModule.prototype._w3_sanitize_env = function (clientEnv, client) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (this.getMethod("sanitizeEnv")) {
return [2 /*return*/, this._w3_invoke("sanitizeEnv", clientEnv, client)];
}
else {
return [2 /*return*/, Promise.resolve(clientEnv)];
}
return [2 /*return*/];
});
});
};
return Plugin;
PluginModule.prototype._w3_invoke = function (method, input, client) {
return __awaiter(this, void 0, void 0, function () {
var fn;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
fn = this.getMethod(method);
if (!fn) {
throw Error("TODO: missing function");
}
if (typeof fn !== "function") {
throw Error("TODO: ${method} must be a function");
}
return [4 /*yield*/, _1.executeMaybeAsyncFunction(fn.bind(this, input, client))];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
PluginModule.prototype.getMethod = function (method) {
var fn = this[method];
return fn;
};
return PluginModule;
}());
exports.Plugin = Plugin;
exports.PluginModule = PluginModule;
//# sourceMappingURL=Plugin.js.map
{
"name": "@web3api/core-js",
"description": "Web3API Javascript Core",
"version": "0.0.1-prealpha.71",
"version": "0.0.1-prealpha.72",
"license": "MIT",

@@ -24,4 +24,4 @@ "repository": {

"@msgpack/msgpack": "2.7.2",
"@web3api/manifest-schemas": "0.0.1-prealpha.71",
"@web3api/tracing-js": "0.0.1-prealpha.71",
"@web3api/manifest-schemas": "0.0.1-prealpha.72",
"@web3api/tracing-js": "0.0.1-prealpha.72",
"graphql": "15.5.0",

@@ -36,3 +36,3 @@ "graphql-tag": "2.10.4",

"@types/semver": "7.3.8",
"@web3api/os-js": "0.0.1-prealpha.71",
"@web3api/os-js": "0.0.1-prealpha.72",
"jest": "26.6.3",

@@ -46,3 +46,3 @@ "json-schema-to-typescript": "10.1.3",

},
"gitHead": "daa694fd5d7e77c907307c38a40ca388ab23b5cc",
"gitHead": "5f7c91449b10e023aaa9f70981291001aae011cf",
"publishConfig": {

@@ -49,0 +49,0 @@ "access": "public"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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