New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-core

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-core - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

0

dist/index.d.ts

@@ -0,0 +0,0 @@ export { ApiEdgeDefinition, ApiEdge } from "./src/edge/ApiEdgeDefinition";

@@ -0,0 +0,0 @@ "use strict";

1

dist/src/Api.d.ts

@@ -15,2 +15,3 @@ import { ApiEdgeDefinition } from "./edge/ApiEdgeDefinition";

constructor(version: string, ...edges: ApiEdgeDefinition[]);
findEdge: (name: string | null | undefined) => ApiEdgeDefinition | undefined;
parseRequest: (requestParts: string[]) => ApiRequest;

@@ -17,0 +18,0 @@ buildQuery: (request: ApiRequest) => ApiQuery;

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

this.actions = [];
this.findEdge = function (name) {
return _this.edges.find(function (edge) { return edge.pluralName == name; });
};
this.parseRequest = function (requestParts) {

@@ -16,0 +19,0 @@ return _this.parser.parse(requestParts);

@@ -0,0 +0,0 @@ import { QueryStep, ApiQueryScope } from "../query/ApiQuery";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeRelation } from "../relations/ApiEdgeRelation";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiQueryScope } from "../query/ApiQuery";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeDefinition } from './ApiEdgeDefinition';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeQueryFilter, ApiEdgeQueryFilterType } from "./ApiEdgeQueryFilter";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare enum ApiEdgeQueryFilterType {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare class ApiEdgeQueryResponse {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare enum ApiEdgeQueryType {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare class ApiEdgeSchemaTransformation {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { QueryStep, ApiQueryScope } from "../query/ApiQuery";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare class ApiEdgeError {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeQueryContext } from "../edge/ApiEdgeQueryContext";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { QueryStep, ApiQueryScope, ApiQuery } from "./ApiQuery";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeDefinition } from "../edge/ApiEdgeDefinition";

"use strict";
//# sourceMappingURL=ApiEdgeRelation.js.map

@@ -0,0 +0,0 @@ import { ApiEdgeDefinition } from "../edge/ApiEdgeDefinition";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdgeDefinition } from "../edge/ApiEdgeDefinition";

@@ -0,0 +0,0 @@ "use strict";

4

dist/src/request/ApiRequest.d.ts

@@ -6,2 +6,3 @@ import { ApiEdgeDefinition } from "../edge/ApiEdgeDefinition";

import { ApiEdgeMethod } from "../edge/ApiEdgeMethod";
import { Api } from "../Api";
export declare class PathSegment {

@@ -53,2 +54,3 @@ edge: ApiEdgeDefinition;

export declare class ApiRequest {
api: Api;
type: ApiRequestType;

@@ -58,3 +60,3 @@ path: ApiRequestPath;

context: ApiEdgeQueryContext;
constructor();
constructor(api: Api);
}

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

var ApiRequest = (function () {
function ApiRequest() {
function ApiRequest(api) {
this.body = null;
this.api = api;
this.path = new ApiRequestPath();

@@ -104,0 +105,0 @@ this.type = ApiRequestType.Read;

@@ -0,0 +0,0 @@ import { ApiRequestPath, ApiRequest } from "./ApiRequest";

@@ -12,3 +12,3 @@ "use strict";

ApiRequestPathParser.prototype.findEdgeByName = function (name) {
return this.api.edges.find(function (edge) { return edge.pluralName === name; });
return this.api.findEdge(name);
};

@@ -96,3 +96,3 @@ ApiRequestPathParser.prototype.findRelationByName = function (edge, name) {

ApiRequestParser.prototype.parse = function (segments) {
var request = new ApiRequest_1.ApiRequest();
var request = new ApiRequest_1.ApiRequest(this.api);
request.path = this.pathParser.parse(segments);

@@ -99,0 +99,0 @@ return request;

@@ -0,0 +0,0 @@ import { Student } from "../model/Student";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ModelEdge } from "./ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ModelEdge } from "./ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ModelEdge } from "./ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ApiEdge } from "../../../src/edge/ApiEdgeDefinition";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ModelEdge } from "./ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Student } from "../model/Student";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Model } from "../edges/ModelEdge";

@@ -37,3 +37,3 @@ "use strict";

try {
var request = new ApiRequest_1.ApiRequest();
var request = new ApiRequest_1.ApiRequest(api);
request.type = ApiRequest_1.ApiRequestType.Any;

@@ -52,3 +52,3 @@ api.buildQuery(request);

try {
var request = new ApiRequest_1.ApiRequest();
var request = new ApiRequest_1.ApiRequest(api);
request.type = ApiRequest_1.ApiRequestType.Change;

@@ -55,0 +55,0 @@ api.buildQuery(request);

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

{
"name": "api-core",
"version": "0.4.2",
"version": "0.4.3",
"description": "Model-based dynamic multi-level APIs for any provider, plus multiple consumption channels",

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

@@ -27,2 +27,6 @@ import {ApiEdgeDefinition} from "./edge/ApiEdgeDefinition";

findEdge = (name: string|null|undefined) => {
return this.edges.find((edge: ApiEdgeDefinition) => edge.pluralName == name)
};
parseRequest = (requestParts: string[]) => {

@@ -29,0 +33,0 @@ return this.parser.parse(requestParts);

@@ -6,2 +6,3 @@ import {ApiEdgeDefinition} from "../edge/ApiEdgeDefinition";

import {ApiEdgeMethod} from "../edge/ApiEdgeMethod";
import {Api} from "../Api";

@@ -104,2 +105,3 @@ export class PathSegment {

export class ApiRequest {
api: Api;
type: ApiRequestType;

@@ -110,3 +112,4 @@ path: ApiRequestPath;

constructor() {
constructor(api: Api) {
this.api = api;
this.path = new ApiRequestPath();

@@ -113,0 +116,0 @@ this.type = ApiRequestType.Read;

@@ -21,3 +21,3 @@ import {ApiEdgeDefinition} from "../edge/ApiEdgeDefinition";

private findEdgeByName(name: string|null|undefined): ApiEdgeDefinition|undefined {
return this.api.edges.find((edge: ApiEdgeDefinition) => edge.pluralName === name);
return this.api.findEdge(name);
}

@@ -121,3 +121,3 @@

parse(segments: string[]): ApiRequest {
let request = new ApiRequest();
let request = new ApiRequest(this.api);
request.path = this.pathParser.parse(segments);

@@ -124,0 +124,0 @@ return request;

@@ -47,3 +47,3 @@ import {ApiEdgeError} from "../src/query/ApiEdgeError";

try {
let request = new ApiRequest();
let request = new ApiRequest(api);
request.type = ApiRequestType.Any;

@@ -63,3 +63,3 @@ api.buildQuery(request);

try {
let request = new ApiRequest();
let request = new ApiRequest(api);
request.type = ApiRequestType.Change;

@@ -66,0 +66,0 @@ api.buildQuery(request);

@@ -16,4 +16,5 @@ {

"exclude": [
"node_modules"
"node_modules",
"typings"
]
}

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