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

@appland/appmap-validate

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appland/appmap-validate - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

schema/1-7-0.js

12

bin/index.js
#!/usr/bin/env node
const { AppmapError } = require("../lib/assert.js");
const { validate } = require("../lib/index.js");
const { readFileSync } = require("fs");
const { AppmapError } = require('../lib/assert.js');
const { validate } = require('../lib/index.js');
const { readFileSync } = require('fs');

@@ -17,9 +17,9 @@ const failure = (message) => {

if (process.argv.length !== 3) {
failure("usage: npx appmap-validate path/to/file.appmap.json\n");
failure('usage: npx appmap-validate path/to/file.appmap.json\n');
} else {
try {
success(`Valid ${validate(JSON.parse(readFileSync(process.argv[2], "utf8")))} appmap${"\n"}`);
success(`Valid ${validate(JSON.parse(readFileSync(process.argv[2], 'utf8')))} appmap${'\n'}`);
} catch (error) {
if (error instanceof AppmapError) {
failure(`Invalid appmap:${"\n"}${error.message}${"\n"}`);
failure(`Invalid appmap:${'\n'}${error.message}${'\n'}`);
} else {

@@ -26,0 +26,0 @@ throw error;

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

# [@appland/appmap-validate-v2.2.0](https://github.com/applandinc/appmap-js/compare/@appland/appmap-validate-v2.1.0...@appland/appmap-validate-v2.2.0) (2022-07-06)
### Features
* validate eventUpdates from 1.8.0 ([edf21fe](https://github.com/applandinc/appmap-js/commit/edf21fe8ea69429f3353e4fe9fc2b581639fa8ff))
# [@appland/appmap-validate-v2.1.0](https://github.com/applandinc/appmap-js/compare/@appland/appmap-validate-v2.0.0...@appland/appmap-validate-v2.1.0) (2021-12-06)

@@ -2,0 +9,0 @@

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

const format = require("format-util");
const format = require('format-util');

@@ -3,0 +3,0 @@ exports.AppmapError = class AppmapError extends Error {

@@ -1,11 +0,13 @@

const Ajv = require("ajv");
const { asTree } = require("treeify");
const { structureAJVErrorArray, summarizeAJVErrorTree } = require("ajv-error-tree");
const { AppmapError, InputError, assert } = require("./assert.js");
const { schema: schema_1_2_0 } = require("../schema/1-2-0.js");
const { schema: schema_1_3_0 } = require("../schema/1-3-0.js");
const { schema: schema_1_4_0 } = require("../schema/1-4-0.js");
const { schema: schema_1_5_0 } = require("../schema/1-5-0.js");
const { schema: schema_1_5_1 } = require("../schema/1-5-1.js");
const { schema: schema_1_6_0 } = require("../schema/1-6-0.js");
const Ajv = require('ajv');
const { asTree } = require('treeify');
const { structureAJVErrorArray, summarizeAJVErrorTree } = require('ajv-error-tree');
const { AppmapError, InputError, assert } = require('./assert.js');
const { schema: schema_1_2_0 } = require('../schema/1-2-0.js');
const { schema: schema_1_3_0 } = require('../schema/1-3-0.js');
const { schema: schema_1_4_0 } = require('../schema/1-4-0.js');
const { schema: schema_1_5_0 } = require('../schema/1-5-0.js');
const { schema: schema_1_5_1 } = require('../schema/1-5-1.js');
const { schema: schema_1_6_0 } = require('../schema/1-6-0.js');
const { schema: schema_1_7_0 } = require('../schema/1-7-0.js');
const { schema: schema_1_8_0 } = require('../schema/1-8-0.js');

@@ -18,8 +20,10 @@ const ajv = new Ajv({

const versions = new Map([
["1.2.0", ajv.compile(schema_1_2_0)],
["1.3.0", ajv.compile(schema_1_3_0)],
["1.4.0", ajv.compile(schema_1_4_0)],
["1.5.0", ajv.compile(schema_1_5_0)],
["1.5.1", ajv.compile(schema_1_5_1)],
["1.6.0", ajv.compile(schema_1_6_0)],
['1.2.0', ajv.compile(schema_1_2_0)],
['1.3.0', ajv.compile(schema_1_3_0)],
['1.4.0', ajv.compile(schema_1_4_0)],
['1.5.0', ajv.compile(schema_1_5_0)],
['1.5.1', ajv.compile(schema_1_5_1)],
['1.6.0', ajv.compile(schema_1_6_0)],
['1.7.0', ajv.compile(schema_1_7_0)],
['1.8.0', ajv.compile(schema_1_8_0)],
]);

@@ -31,36 +35,159 @@

/* c8 ignore start */
const hasOwnProperty =
Reflect.getOwnPropertyDescriptor(Object, 'hasOwn') !== undefined
? Object.hasOwn
: (object, key) => Reflect.getOwnPropertyDescriptor(object, key) !== undefined;
/* c8 ignore stop */
const getCallTag = (event) => {
assert(event.event === "call", Error, "expected a call event");
if (Reflect.getOwnPropertyDescriptor(event, "method_id") !== undefined) {
return "function";
assert(event.event === 'call', Error, 'expected a call event');
if (hasOwnProperty(event, 'method_id')) {
return 'function';
} else if (hasOwnProperty(event, 'http_client_request')) {
return 'http-client';
} else if (hasOwnProperty(event, 'http_server_request')) {
return 'http-server';
} else if (hasOwnProperty(event, 'sql_query')) {
return 'sql';
} /* c8 ignore start */ else {
throw new Error('invalid event should not have satisfied the schema');
} /* c8 ignore stop */
};
const getReturnTag = (event) => {
assert(event.event === 'return', Error, 'expected a return event');
if (hasOwnProperty(event, 'return_value') || hasOwnProperty(event, 'exceptions')) {
return 'function';
} else if (hasOwnProperty(event, 'http_client_response')) {
return 'http-client';
} else if (hasOwnProperty(event, 'http_server_response')) {
return 'http-server';
} else {
return 'sql|function';
}
if (Reflect.getOwnPropertyDescriptor(event, "http_client_request") !== undefined) {
return "http-client";
};
const stringifyTree = (tree, options) => {
if (options['schema-depth'] === 0 && options['instance-depth'] === 0) {
return typeof tree === 'string' ? tree : asTree(tree, true);
} else {
return JSON.stringify(tree, null, 2);
}
if (Reflect.getOwnPropertyDescriptor(event, "http_server_request") !== undefined) {
return "http-server";
};
const checkSchema = (data, options) => {
const validate = versions.get(options.version);
if (!validate(data)) {
const tree1 = structureAJVErrorArray(validate.errors);
const tree2 = summarizeAJVErrorTree(tree1, options);
throw new AppmapError(stringifyTree(tree2, options), { list: validate.errors, tree: tree1 });
}
if (Reflect.getOwnPropertyDescriptor(event, "sql_query") !== undefined) {
return "sql";
};
const collectDesignator = (designators, entity, parent, path1) => {
if (entity.type === 'function') {
assert(parent !== null, Error, 'top-level function should not have satisfied the schema');
if (hasOwnProperty(entity, 'location') && entity.location !== null) {
let path2 = entity.location;
let lineno = null;
if (path2 !== null && /:[0-9]+$/u.test(path2)) {
[, path2, lineno] = /^([\s\S]*):([0-9]+)$/.exec(entity.location);
}
// assert(
// path1.toLowerCase().startsWith(path2.toLowerCase()),
// AppmapError,
// "path should be a prefix of %o for function code object %o",
// path1,
// entity
// );
const designator = makeDesignator([
parent.name,
path2,
parseInt(lineno),
entity.static,
entity.name,
]);
assert(
!designators.has(designator),
AppmapError,
'detected a function code object clash in the classMap: %o',
entity
);
designators.add(designator);
}
} else {
const path2 = `${path1}${entity.name}/`;
for (let child of entity.children) {
collectDesignator(designators, child, entity, path2);
}
}
/* c8 ignore start */
assert(false, Error, "invalid event");
/* c8 ignore stop */
};
const getReturnTag = (event) => {
assert(event.event === "return", Error, "expected a return event");
if (
Reflect.getOwnPropertyDescriptor(event, "return_value") !== undefined ||
Reflect.getOwnPropertyDescriptor(event, "exceptions") !== undefined
) {
return "function";
const checkClassMapConflict = (classmap) => {
const designators = new Set();
for (let entity of classmap) {
collectDesignator(designators, entity, null, '');
}
if (Reflect.getOwnPropertyDescriptor(event, "http_client_response") !== undefined) {
return "http-client";
};
const checkPerThreadFifoOrdering = (events) => {
const threads = new Map();
let max = 0;
for (let index = 0; index < events.length; index += 1) {
const event = events[index];
assert(
event.id > max,
AppmapError,
'non-monotonous event id between #%i and #%i',
event.id,
max
);
max = event.id;
if (!threads.has(event.thread_id)) {
threads.set(event.thread_id, []);
}
const thread = threads.get(event.thread_id);
if (event.event === 'call') {
// console.log(new Array(thread.length).join("."), event.id);
thread.push(event);
} else {
const parent = thread.pop();
// console.log(new Array(thread.length).join("."), event.id, event.parent_id);
assert(
parent.id === event.parent_id,
AppmapError,
'expected parent id of return event #%i to be %i but got %i',
event.id,
parent.id,
event.parent_id
);
const tag1 = getCallTag(parent);
const tag2 = getReturnTag(event);
assert(
tag2.includes(tag1),
AppmapError,
'incompatible event type between #%i and #%i, expected a %s but got a %s',
event.id,
event.parent_id,
tag1,
tag2
);
}
}
if (Reflect.getOwnPropertyDescriptor(event, "http_server_response") !== undefined) {
return "http-server";
};
const updateEventArray = (events, updates) => {
for (const key of Reflect.ownKeys(updates)) {
const id = parseInt(key);
assert(
events.find((event) => event.id === id),
AppmapError,
'event update #%i has no corresponding event',
id
);
}
return "sql|function";
return events.map((event) =>
hasOwnProperty(updates, String(event.id)) ? updates[event.id] : event
);
};

@@ -75,4 +202,4 @@

options = {
"schema-depth": 0,
"instance-depth": 0,
'schema-depth': 0,
'instance-depth': 0,
version: null,

@@ -83,135 +210,22 @@ ...options,

assert(
typeof data === "object" &&
data !== null &&
Reflect.getOwnPropertyDescriptor(data, "version") !== undefined,
typeof data === 'object' && data !== null && hasOwnProperty(data, 'version'),
AppmapError,
"could not extract version from appmap"
'could not extract version from appmap'
);
options.version = data.version;
}
if (/^[0-9]+\.[0-9]+$/.test(options.version)) {
options.version = `${options.version}.0`;
}
assert(
versions.has(options.version),
InputError,
"unsupported appmap version %o; expected one of %o",
'unsupported appmap version %o; expected one of %o',
options.version,
keys
);
// Validate against json schema //
const validate = versions.get(options.version);
if (!validate(data)) {
const tree1 = structureAJVErrorArray(validate.errors);
const tree2 = summarizeAJVErrorTree(tree1, options);
let message;
if (options["schema-depth"] === 0 && options["instance-depth"] === 0) {
message = typeof tree2 === "string" ? tree2 : asTree(tree2, true);
} else {
message = JSON.stringify(tree2, null, 2);
}
throw new AppmapError(message, { list: validate.errors, tree: tree1 });
checkSchema(data, options);
checkClassMapConflict(data.classMap);
checkPerThreadFifoOrdering(data.events);
if (hasOwnProperty(data, 'eventUpdates')) {
checkPerThreadFifoOrdering(updateEventArray(data.events, data.eventUpdates));
}
const events = data.events;
// Verify the unicity of code object //
const designators = new Set();
const collectDesignator = (entity, parent, path1) => {
if (entity.type === "function") {
assert(
parent !== null,
Error,
"this appmap should not have passed ajv (function code objects should not appear at the top-level)"
);
if (
Reflect.getOwnPropertyDescriptor(entity, "location") !== undefined &&
entity.location !== null
) {
let path2 = entity.location;
let lineno = null;
if (path2 !== null && /:[0-9]+$/u.test(path2)) {
[, path2, lineno] = /^([\s\S]*):([0-9]+)$/.exec(entity.location);
}
// assert(
// path1.toLowerCase().startsWith(path2.toLowerCase()),
// AppmapError,
// "path should be a prefix of %o for function code object %o",
// path1,
// entity
// );
const designator = makeDesignator([
parent.name,
path2,
parseInt(lineno),
entity.static,
entity.name,
]);
assert(
!designators.has(designator),
AppmapError,
"detected a function code object clash in the classMap: %o",
entity
);
designators.add(designator);
}
} else {
path1 = `${path1}${entity.name}/`;
for (let child of entity.children) {
collectDesignator(child, entity, path1);
}
}
};
for (let entity of data.classMap) {
collectDesignator(entity, null, "");
}
// Verify the per thread fifo ordering //
{
const threads = new Map();
const ids = new Map();
let max = 0;
for (let index = 0; index < events.length; index += 1) {
const event = events[index];
assert(
event.id > max,
AppmapError,
"non-monotonous event id between #%i and #%i",
event.id,
max
);
max = event.id;
ids.set(event.id, index);
let thread = threads.get(event.thread_id);
if (thread === undefined) {
thread = [];
threads.set(event.thread_id, thread);
}
if (event.event === "call") {
// console.log(new Array(thread.length).join("."), event.id);
thread.push(event);
} else {
const parent = thread.pop();
// console.log(new Array(thread.length).join("."), event.id, event.parent_id);
assert(
parent.id === event.parent_id,
AppmapError,
"expected parent id of return event #%i to be %i but got %i",
event.id,
parent.id,
event.parent_id
);
const tag1 = getCallTag(parent);
const tag2 = getReturnTag(event);
assert(
tag2.includes(tag1),
AppmapError,
"incompatible event type between #%i and #%i, expected a %s but got a %s",
event.id,
event.parent_id,
tag1,
tag2
);
}
}
}
// Return //
return options.version;
};
{
"name": "@appland/appmap-validate",
"version": "2.1.0",
"version": "2.2.0",
"scripts": {

@@ -9,4 +9,4 @@ "start": "node bin/index.js",

"test-html": "npx c8 --reporter=html node test/smoke.js && open coverage/index.html",
"format": "npx prettier --write 'lib/*.js' 'test/*.js' 'src/*.js' 'schema/*.js'",
"lint": "npx eslint 'lib/*.js' 'test/*.js' 'src/*.js' 'schema/*.js'"
"format": "npx prettier --write 'bin/*.js' 'lib/*.js' 'test/*.js' 'src/*.js' 'schema/*.js'",
"lint": "npx eslint 'bin/*.js' 'lib/*.js' 'test/*.js' 'src/*.js' 'schema/*.js'"
},

@@ -13,0 +13,0 @@ "publishConfig": {

@@ -28,23 +28,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -294,2 +284,24 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -368,2 +380,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -588,5 +605,3 @@ "type": "object",

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -593,0 +608,0 @@ "mime_type": {

@@ -28,23 +28,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -302,2 +292,24 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -376,2 +388,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -596,5 +613,3 @@ "type": "object",

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -601,0 +616,0 @@ "mime_type": {

@@ -28,23 +28,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -302,2 +292,24 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -376,2 +388,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -600,5 +617,3 @@ "type": "object",

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -605,0 +620,0 @@ "mime_type": {

@@ -27,23 +27,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -301,2 +291,24 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -375,2 +387,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -601,5 +618,3 @@ "type": "object",

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -606,0 +621,0 @@ "mime_type": {

@@ -28,29 +28,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -308,2 +292,30 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -382,2 +394,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -585,13 +602,7 @@ "type": "object",

"properties": {
"status_code": {
"$ref": "#/definitions/status"
},
"headers": {
"$ref": "#/definitions/headers"
},
"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"mime_type": {
"type": "string",
"nullable": true
}

@@ -691,5 +702,3 @@ }

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -696,0 +705,0 @@ "mime_type": {

@@ -27,29 +27,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -307,2 +291,30 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -381,2 +393,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -584,13 +601,7 @@ "type": "object",

"properties": {
"status_code": {
"$ref": "#/definitions/status"
},
"headers": {
"$ref": "#/definitions/headers"
},
"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"mime_type": {
"type": "string",
"nullable": true
}

@@ -690,5 +701,3 @@ }

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},

@@ -695,0 +704,0 @@ "mime_type": {

@@ -28,29 +28,13 @@ exports.schema = {

"items": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
"$ref": "#/definitions/event"
}
},
"eventUpdates": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/event"
}
}
}

@@ -331,2 +315,30 @@ },

},
"event": {
"anyOf": [
{
"$ref": "#/definitions/function-call"
},
{
"$ref": "#/definitions/function-return"
},
{
"$ref": "#/definitions/http-client-request"
},
{
"$ref": "#/definitions/http-client-response"
},
{
"$ref": "#/definitions/http-server-request"
},
{
"$ref": "#/definitions/http-server-response"
},
{
"$ref": "#/definitions/sql-query"
},
{
"$ref": "#/definitions/sql-result"
}
]
},
"call": {

@@ -405,2 +417,7 @@ "type": "object",

},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"parameter": {

@@ -608,13 +625,7 @@ "type": "object",

"properties": {
"status_code": {
"$ref": "#/definitions/status"
},
"headers": {
"$ref": "#/definitions/headers"
},
"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"mime_type": {
"type": "string",
"nullable": true
}

@@ -652,10 +663,2 @@ }

},
"authorization": {
"type": "string",
"nullable": true
},
"mime_type": {
"type": "string",
"nullable": true
},
"request_method": {

@@ -715,9 +718,6 @@ "$ref": "#/definitions/verb"

"status_code": {
"type": "integer",
"minimum": 100,
"maximum": 599
"$ref": "#/definitions/status"
},
"mime_type": {
"type": "string",
"nullable": true
"headers": {
"$ref": "#/definitions/headers"
}

@@ -724,0 +724,0 @@ }

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