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

@digitalroute/bagger

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalroute/bagger - npm Package Compare versions

Comparing version 0.0.1 to 0.1.1

dist/bagger.es5.js

15

dist/bagger.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.x = 'foo';
var response_1 = require("./response");
var request_1 = require("./request");
__export(require("./compile"));
function response(httpCode) {
return new response_1.BaggerResponse(httpCode);
}
exports.response = response;
function request() {
return new request_1.BaggerRequest();
}
exports.request = request;

@@ -1,1 +0,5 @@

export declare const x: 'foo' | 'bar';
import { BaggerResponse } from './response';
import { BaggerRequest } from './request';
export * from './compile';
export declare function response(httpCode: number): BaggerResponse;
export declare function request(): BaggerRequest;

102

package.json
{
"name": "@digitalroute/bagger",
"version": "0.0.1",
"version": "0.1.1",
"description": "",
"main": "dist/bagger.js",
"typings": "dist/types/bagger.d.ts",
"files": [
"dist"
],
"main": "dist/bagger.umd.js",
"module": "dist/bagger.es5.js",
"typings": "dist/types/bagger.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=9.11.2"
},
"scripts": {
"test": "ava",
"test:watch": "ava --watch",
"tsc": "tsc"
"commit": "git-cz",
"eslint": "eslint -c .eslintrc.json 'lib/**/*.ts' 'test/**/*.ts'",
"test": "jest --coverage",
"test:watch": "jest --watch",
"test:prod": "npm run lint && npm run test -- --no-cache",
"semantic-release": "semantic-release",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts",
"prettier": "prettier --write \"*.{js,json,md,yml}\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/juliuscc/bagger.git"
"url": "git+https://github.com/digitalroute/bagger.git"
},

@@ -32,22 +42,72 @@ "keywords": [

"bugs": {
"url": "https://github.com/juliuscc/bagger/issues"
"url": "https://github.com/digitalroute/bagger/issues"
},
"homepage": "https://github.com/juliuscc/bagger#readme",
"homepage": "https://github.com/digitalroute/bagger#readme",
"dependencies": {
"@hapi/joi": ">=15.0.0"
"@types/hapi__joi": "^15.0.3",
"joi": "^14.3.1",
"joi-to-swagger": "^3.2.0",
"json-schema-to-openapi-schema": "^0.3.0",
"openapi3-ts": "^1.3.0"
},
"devDependencies": {
"ava": "^2.2.0",
"ts-node": "^8.3.0",
"@hapi/joi": "^15.1.0",
"@types/jest": "^24.0.17",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"commitizen": "^4.0.3",
"cz-conventional-changelog": "^3.0.2",
"eslint": "^6.1.0",
"eslint-config-nodejs": "^2.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.15.1",
"husky": "^3.0.3",
"jest": "^24.8.0",
"jest-config": "^24.8.0",
"latest-version-or-tag": "^1.2.0",
"lint-staged": "^9.2.1",
"lodash.camelcase": "^4.3.0",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"rollup": "^0.67.0",
"rollup-plugin-commonjs": "^9.1.8",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-typescript2": "^0.22.1",
"semantic-release": "^15.13.19",
"ts-jest": "^24.0.2",
"typescript": "^3.5.3"
},
"ava": {
"compileEnhancements": false,
"extensions": [
"ts"
"jest": {
"transform": {
".ts": "ts-jest"
},
"testEnvironment": "node",
"testRegex": ".*\\.test\\.(ts)$",
"testPathIgnorePatterns": [
"/node_modules/",
"/dist/"
],
"require": [
"ts-node/register"
"collectCoverageFrom": [
"lib/*/**.{ts}"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,md,yml}": [
"prettier --write",
"git add"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
}
}

@@ -1,1 +0,58 @@

# bagger
# Bagger
[![npm (scoped)](https://img.shields.io/npm/v/@digitalroute/bagger?style=flat-square)](https://www.npmjs.com/package/@digitalroute/bagger)
[![npm](https://img.shields.io/npm/dm/@digitalroute/bagger)](https://www.npmjs.com/package/@digitalroute/bagger)
[![CircleCI](https://img.shields.io/circleci/build/github/digitalroute/bagger/master?style=flat-square)](https://circleci.com/gh/digitalroute/workflows/bagger)
[![license](https://img.shields.io/github/license/digitalroute/bagger.svg?style=flat-square)](https://github.com/digitalroute/bagger/blob/master/LICENSE)
A joi-compatible tool for building swagger definitions. It enables developers use the same joi schemas for validation and documentation, ensuring that API documentation never becomes stale.
## Features
- 🔨 **Builder pattern:** Dead simple api to create complex Swagger definitions.
- ✨ **joi compatibility:** Enables developers to use the same schemas for validation and documentation.
- 🔎 **Intellisense:** Really nice intellisense suggestions, and TypeScript definitions.
## Table of Contents
WIP
## Example
```js
const bagger = require('bagger');
const joi = require('@hapi/joi');
const getBags = bagger
.request()
.method('get')
.path('/bags')
.tag('bags')
.tag('build')
.responses([
bagger
.response(200)
.description('Successfully fetched all bags')
.content(
'application/json',
joi
.array()
.items(joi.string())
.example(['handbag', 'backpack'])
)
]);
const swaggerConfig = {
title: 'Bagger API',
version: 'v1',
description: 'Provides resources for building swagger definitions'
};
const swaggerDefinition = bagger.compile(swaggerConfig, [getBags]);
```
## Installation
Install bagger using `npm`:
`npm install bagger`

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