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

@api-ts/response

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@api-ts/response - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

dist/src/keyed-response.d.ts

41

dist/src/index.d.ts

@@ -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

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