@api-ts/response
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,40 +0,3 @@ | ||
export declare type Status = 'ok' | 'invalidRequest' | 'unauthenticated' | 'permissionDenied' | 'notFound' | 'rateLimitExceeded' | 'internalError' | 'serviceUnavailable'; | ||
export declare type Response = { | ||
type: Status; | ||
payload: unknown; | ||
}; | ||
export declare const Response: { | ||
ok: <T>(payload: T) => { | ||
type: "ok"; | ||
payload: T; | ||
}; | ||
invalidRequest: <T_1>(payload: T_1) => { | ||
type: "invalidRequest"; | ||
payload: T_1; | ||
}; | ||
unauthenticated: <T_2>(payload: T_2) => { | ||
type: "unauthenticated"; | ||
payload: T_2; | ||
}; | ||
permissionDenied: <T_3>(payload: T_3) => { | ||
type: "permissionDenied"; | ||
payload: T_3; | ||
}; | ||
notFound: <T_4>(payload: T_4) => { | ||
type: "notFound"; | ||
payload: T_4; | ||
}; | ||
rateLimitExceeded: <T_5>(payload: T_5) => { | ||
type: "rateLimitExceeded"; | ||
payload: T_5; | ||
}; | ||
internalError: <T_6>(payload: T_6) => { | ||
type: "internalError"; | ||
payload: T_6; | ||
}; | ||
serviceUnavailable: <T_7>(payload: T_7) => { | ||
type: "serviceUnavailable"; | ||
payload: T_7; | ||
}; | ||
}; | ||
export * from './response'; | ||
export * from './keyed-response'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Response = void 0; | ||
const responseFunction = (status) => (payload) => ({ type: status, payload }); | ||
exports.Response = { | ||
ok: responseFunction('ok'), | ||
invalidRequest: responseFunction('invalidRequest'), | ||
unauthenticated: responseFunction('unauthenticated'), | ||
permissionDenied: responseFunction('permissionDenied'), | ||
notFound: responseFunction('notFound'), | ||
rateLimitExceeded: responseFunction('rateLimitExceeded'), | ||
internalError: responseFunction('internalError'), | ||
serviceUnavailable: responseFunction('serviceUnavailable'), | ||
}; | ||
__exportStar(require("./response"), exports); | ||
__exportStar(require("./keyed-response"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@api-ts/response", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Types for representing responses", | ||
@@ -5,0 +5,0 @@ "author": "Patrick McLaughlin <patrickmclaughlin@bitgo.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8160
14
136
1