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

apibuilder-js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apibuilder-js - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

dist/generated/types/apibuilder-generator.d.ts

18

dist/language/FullyQualifiedName.d.ts

@@ -45,7 +45,7 @@ import { AstNode } from './ast';

*/
readonly fullName: string;
get fullName(): string;
/**
* This property holds the base name of the type.
*/
readonly baseTypeName: string;
get baseTypeName(): string;
/**

@@ -57,3 +57,3 @@ * This property holds the nested type. A nested type is a type defined

*/
readonly nestedTypeName: string;
get nestedTypeName(): string;
/**

@@ -63,15 +63,15 @@ * This property holds the base short name, that is the type name

*/
readonly shortName: string;
get shortName(): string;
/**
* This property holds the package name.
*/
readonly packageName: string;
get packageName(): string;
/**
* This property holds whether this is an array.
*/
readonly isArrayType: boolean;
get isArrayType(): boolean;
/**
* This property holds whether this is a map.
*/
readonly isMapType: boolean;
get isMapType(): boolean;
/**

@@ -83,8 +83,8 @@ * This property holds whether this type is an enclosing type. An enclosing

*/
readonly isEnclosingType: boolean;
get isEnclosingType(): boolean;
/**
* This property holds whether this is a primitive type.
*/
readonly isPrimitiveType: boolean;
get isPrimitiveType(): boolean;
toString(): string;
}
{
"name": "apibuilder-js",
"version": "0.0.8",
"version": "0.0.9",
"description": "A reference implementation of API Builder for JavaScript",

@@ -8,6 +8,6 @@ "main": "dist/index.js",

"scripts": {
"build": "tsc",
"build": "tsc --project ./tsconfig.build.json",
"clean": "rm -rf dist",
"coverage": "jest --coverage",
"lint": "tslint -c tslint.json -p tsconfig.json './src/**/*.{js,ts}'",
"lint": "tslint -c tslint.json -p tsconfig.json",
"prepublishOnly": "run-s clean build",

@@ -37,6 +37,6 @@ "test": "jest"

"devDependencies": {
"@types/faker": "^4.1.5",
"@types/invariant": "^2.2.30",
"@types/jest": "^24.0.18",
"@types/lodash": "^4.14.141",
"@types/faker": "^4.1.9",
"@types/invariant": "^2.2.31",
"@types/jest": "^24.0.25",
"@types/lodash": "^4.14.149",
"@types/node": "^10.14.19",

@@ -47,7 +47,7 @@ "@types/pluralize": "0.0.29",

"npm-run-all": "^4.1.5",
"ts-jest": "^24.1.0",
"tslint": "^5.20.0",
"ts-jest": "^24.3.0",
"tslint": "^5.20.1",
"tslint-config-airbnb": "^5.11.2",
"typescript": "^3.6.3"
"typescript": "^3.7.4"
}
}

@@ -6,6 +6,6 @@ import faker from 'faker';

import { createMockDeprecation, createMockEnum } from '../helpers/mocks';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const enumerations = keyBy(apidocApiJson.enums, 'name');
const service = new ApiBuilderService(apidocApi);
const enumerations = keyBy(apidocApi.enums, 'name');

@@ -12,0 +12,0 @@ describe('ApiBuilderEnum', () => {

@@ -5,5 +5,5 @@ import faker from 'faker';

import { createMockDeprecation, createMockField } from '../helpers/mocks';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const service = new ApiBuilderService(apidocApi);

@@ -10,0 +10,0 @@ describe('ApiBuilderField', () => {

import keyBy from 'lodash/keyBy';
import { ApiBuilderImport, ApiBuilderService, isEnumType, isModelType, isUnionType } from '../../src';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const imports = keyBy(apidocApiJson.imports, 'namespace');
const service = new ApiBuilderService(apidocApi);
const imports = keyBy(apidocApi.imports, 'namespace');
const subject = new ApiBuilderImport(imports['com.bryzek.apidoc.spec.v0'], service);

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

import keyBy from 'lodash/keyBy';
import { ApiBuilderModel, ApiBuilderService } from '../../src';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const models = keyBy(apidocApiJson.models, 'name');
const service = new ApiBuilderService(apidocApi);
const models = keyBy(apidocApi.models, 'name');

@@ -9,0 +9,0 @@ describe('ApiBuilderModel', () => {

import { ApiBuilderService } from '../../src';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';

@@ -7,11 +7,11 @@ describe('ApiBuilderOperation', () => {

test('returns type matching response code', () => {
const service = new ApiBuilderService(apidocApiJson);
const service = new ApiBuilderService(apidocApi);
const resource = service.resources
.find(resource => resource.typeName === 'application');
const operation = resource.operations
const operation = resource?.operations
.find(operation => operation.path === '/:orgKey' && operation.method === 'GET');
const type = operation.getResponseTypeByCode(200);
expect(type.toString()).toEqual('[com.bryzek.apidoc.api.v0.models.application]');
const type = operation?.getResponseTypeByCode(200);
expect(type?.toString()).toEqual('[com.bryzek.apidoc.api.v0.models.application]');
});
});
});
import { ApiBuilderService } from '../../src';
import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const service = new ApiBuilderService(apidocApi);
describe('ApiBuilderService', () => {
test('should have property with name', () => {
expect(service).toHaveProperty('name', apidocApiJson.name);
expect(service).toHaveProperty('name', apidocApi.name);
});
test('should have property with organization key', () => {
expect(service).toHaveProperty('organizationKey', apidocApiJson.organization.key);
expect(service).toHaveProperty('organizationKey', apidocApi.organization.key);
});
test('should have property with namespace', () => {
expect(service).toHaveProperty('namespace', apidocApiJson.namespace);
expect(service).toHaveProperty('namespace', apidocApi.namespace);
});
test('should have property with version', () => {
expect(service).toHaveProperty('version', apidocApiJson.version);
expect(service).toHaveProperty('version', apidocApi.version);
});
});

@@ -13,5 +13,5 @@ import {

import apidocApiJson from '../fixtures/apidoc-api.json';
import apidocApi from '../fixtures/apidocApi';
const service = new ApiBuilderService(apidocApiJson);
const service = new ApiBuilderService(apidocApi);

@@ -18,0 +18,0 @@ describe('typeFromAst', () => {

{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["es2016", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"resolveJsonModule": true,
"strict": true,
"target": "es5"
},
"extends": "./tsconfig.settings.json",
"include": [
"src/**/*.ts"
"**/*.ts"
],
"exclude": [
"node_modules",
"dist"
"./dist",
"./node_modules"
]
}
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