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 2.0.0 to 2.1.0

242

dist/src/keyed-response.d.ts

@@ -1,2 +0,2 @@

export declare type KeyedStatus = 'ok' | 'invalidRequest' | 'unauthenticated' | 'permissionDenied' | 'notFound' | 'conflict' | 'rateLimitExceeded' | 'internalError' | 'serviceUnavailable';
export declare type KeyedStatus = 'continue' | 'switchingProtocols' | 'processing' | 'ok' | 'created' | 'accepted' | 'nonAuthoritativeInformation' | 'noContent' | 'resetContent' | 'partialContent' | 'multiStatus' | 'alreadyReported' | 'imUsed' | 'multipleChoices' | 'movedPermanently' | 'found' | 'seeOther' | 'notModified' | 'temporaryRedirect' | 'permanentRedirect' | 'invalidRequest' | 'unauthenticated' | 'paymentRequired' | 'permissionDenied' | 'notFound' | 'methodNotAllowed' | 'notAcceptable' | 'proxyAuthenticationRequired' | 'requestTimeout' | 'conflict' | 'gone' | 'lengthRequired' | 'preconditionFailed' | 'contentTooLarge' | 'uriTooLong' | 'unsupportedMediaType' | 'rangeNotSatisfiable' | 'exceptionFailed' | 'imATeapot' | 'misdirectedRequest' | 'unprocessableContent' | 'locked' | 'failedDependency' | 'tooEarly' | 'upgradeRequired' | 'preconditionRequired' | 'rateLimitExceeded' | 'requestHeaderFieldsTooLarge' | 'unavailableForLegalReasons' | 'internalError' | 'notImplemented' | 'badGateway' | 'serviceUnavailable' | 'gatewayTimeout' | 'httpVersionNotSupported' | 'variantAlsoNegotiates' | 'insufficientStorage' | 'loopDetected' | 'notExtended' | 'networkAuthenticationRequired';
export declare type KeyedResponse = {

@@ -7,39 +7,243 @@ type: KeyedStatus;

export declare const KeyedResponse: {
ok: <T>(payload: T) => {
type: "ok";
continue: <T>(payload: T) => {
type: "continue";
payload: T;
};
invalidRequest: <T_1>(payload: T_1) => {
type: "invalidRequest";
switchingProtocols: <T_1>(payload: T_1) => {
type: "switchingProtocols";
payload: T_1;
};
unauthenticated: <T_2>(payload: T_2) => {
type: "unauthenticated";
processing: <T_2>(payload: T_2) => {
type: "processing";
payload: T_2;
};
permissionDenied: <T_3>(payload: T_3) => {
type: "permissionDenied";
ok: <T_3>(payload: T_3) => {
type: "ok";
payload: T_3;
};
notFound: <T_4>(payload: T_4) => {
type: "notFound";
created: <T_4>(payload: T_4) => {
type: "created";
payload: T_4;
};
conflict: <T_5>(payload: T_5) => {
type: "conflict";
accepted: <T_5>(payload: T_5) => {
type: "accepted";
payload: T_5;
};
rateLimitExceeded: <T_6>(payload: T_6) => {
type: "rateLimitExceeded";
nonAuthoritativeInformation: <T_6>(payload: T_6) => {
type: "nonAuthoritativeInformation";
payload: T_6;
};
internalError: <T_7>(payload: T_7) => {
type: "internalError";
noContent: <T_7>(payload: T_7) => {
type: "noContent";
payload: T_7;
};
serviceUnavailable: <T_8>(payload: T_8) => {
type: "serviceUnavailable";
resetContent: <T_8>(payload: T_8) => {
type: "resetContent";
payload: T_8;
};
partialContent: <T_9>(payload: T_9) => {
type: "partialContent";
payload: T_9;
};
multiStatus: <T_10>(payload: T_10) => {
type: "multiStatus";
payload: T_10;
};
alreadyReported: <T_11>(payload: T_11) => {
type: "alreadyReported";
payload: T_11;
};
imUsed: <T_12>(payload: T_12) => {
type: "imUsed";
payload: T_12;
};
multipleChoices: <T_13>(payload: T_13) => {
type: "multipleChoices";
payload: T_13;
};
movedPermanently: <T_14>(payload: T_14) => {
type: "movedPermanently";
payload: T_14;
};
found: <T_15>(payload: T_15) => {
type: "found";
payload: T_15;
};
seeOther: <T_16>(payload: T_16) => {
type: "seeOther";
payload: T_16;
};
notModified: <T_17>(payload: T_17) => {
type: "notModified";
payload: T_17;
};
temporaryRedirect: <T_18>(payload: T_18) => {
type: "temporaryRedirect";
payload: T_18;
};
permanentRedirect: <T_19>(payload: T_19) => {
type: "permanentRedirect";
payload: T_19;
};
invalidRequest: <T_20>(payload: T_20) => {
type: "invalidRequest";
payload: T_20;
};
unauthenticated: <T_21>(payload: T_21) => {
type: "unauthenticated";
payload: T_21;
};
paymentRequired: <T_22>(payload: T_22) => {
type: "paymentRequired";
payload: T_22;
};
permissionDenied: <T_23>(payload: T_23) => {
type: "permissionDenied";
payload: T_23;
};
notFound: <T_24>(payload: T_24) => {
type: "notFound";
payload: T_24;
};
methodNotAllowed: <T_25>(payload: T_25) => {
type: "methodNotAllowed";
payload: T_25;
};
notAcceptable: <T_26>(payload: T_26) => {
type: "notAcceptable";
payload: T_26;
};
proxyAuthenticationRequired: <T_27>(payload: T_27) => {
type: "proxyAuthenticationRequired";
payload: T_27;
};
requestTimeout: <T_28>(payload: T_28) => {
type: "requestTimeout";
payload: T_28;
};
conflict: <T_29>(payload: T_29) => {
type: "conflict";
payload: T_29;
};
gone: <T_30>(payload: T_30) => {
type: "gone";
payload: T_30;
};
lengthRequired: <T_31>(payload: T_31) => {
type: "lengthRequired";
payload: T_31;
};
preconditionFailed: <T_32>(payload: T_32) => {
type: "preconditionFailed";
payload: T_32;
};
contentTooLarge: <T_33>(payload: T_33) => {
type: "contentTooLarge";
payload: T_33;
};
uriTooLong: <T_34>(payload: T_34) => {
type: "uriTooLong";
payload: T_34;
};
unsupportedMediaType: <T_35>(payload: T_35) => {
type: "unsupportedMediaType";
payload: T_35;
};
rangeNotSatisfiable: <T_36>(payload: T_36) => {
type: "rangeNotSatisfiable";
payload: T_36;
};
exceptionFailed: <T_37>(payload: T_37) => {
type: "exceptionFailed";
payload: T_37;
};
imATeapot: <T_38>(payload: T_38) => {
type: "imATeapot";
payload: T_38;
};
misdirectedRequest: <T_39>(payload: T_39) => {
type: "misdirectedRequest";
payload: T_39;
};
unprocessableContent: <T_40>(payload: T_40) => {
type: "unprocessableContent";
payload: T_40;
};
locked: <T_41>(payload: T_41) => {
type: "locked";
payload: T_41;
};
failedDependency: <T_42>(payload: T_42) => {
type: "failedDependency";
payload: T_42;
};
tooEarly: <T_43>(payload: T_43) => {
type: "tooEarly";
payload: T_43;
};
upgradeRequired: <T_44>(payload: T_44) => {
type: "upgradeRequired";
payload: T_44;
};
preconditionRequired: <T_45>(payload: T_45) => {
type: "preconditionRequired";
payload: T_45;
};
rateLimitExceeded: <T_46>(payload: T_46) => {
type: "rateLimitExceeded";
payload: T_46;
};
requestHeaderFieldsTooLarge: <T_47>(payload: T_47) => {
type: "requestHeaderFieldsTooLarge";
payload: T_47;
};
unavailableForLegalReasons: <T_48>(payload: T_48) => {
type: "unavailableForLegalReasons";
payload: T_48;
};
internalError: <T_49>(payload: T_49) => {
type: "internalError";
payload: T_49;
};
notImplemented: <T_50>(payload: T_50) => {
type: "notImplemented";
payload: T_50;
};
badGateway: <T_51>(payload: T_51) => {
type: "badGateway";
payload: T_51;
};
serviceUnavailable: <T_52>(payload: T_52) => {
type: "serviceUnavailable";
payload: T_52;
};
gatewayTimeout: <T_53>(payload: T_53) => {
type: "gatewayTimeout";
payload: T_53;
};
httpVersionNotSupported: <T_54>(payload: T_54) => {
type: "httpVersionNotSupported";
payload: T_54;
};
variantAlsoNegotiates: <T_55>(payload: T_55) => {
type: "variantAlsoNegotiates";
payload: T_55;
};
insufficientStorage: <T_56>(payload: T_56) => {
type: "insufficientStorage";
payload: T_56;
};
loopDetected: <T_57>(payload: T_57) => {
type: "loopDetected";
payload: T_57;
};
notExtended: <T_58>(payload: T_58) => {
type: "notExtended";
payload: T_58;
};
networkAuthenticationRequired: <T_59>(payload: T_59) => {
type: "networkAuthenticationRequired";
payload: T_59;
};
};
//# sourceMappingURL=keyed-response.d.ts.map

@@ -6,12 +6,63 @@ "use strict";

exports.KeyedResponse = {
continue: responseFunction('continue'),
switchingProtocols: responseFunction('switchingProtocols'),
processing: responseFunction('processing'),
ok: responseFunction('ok'),
created: responseFunction('created'),
accepted: responseFunction('accepted'),
nonAuthoritativeInformation: responseFunction('nonAuthoritativeInformation'),
noContent: responseFunction('noContent'),
resetContent: responseFunction('resetContent'),
partialContent: responseFunction('partialContent'),
multiStatus: responseFunction('multiStatus'),
alreadyReported: responseFunction('alreadyReported'),
imUsed: responseFunction('imUsed'),
multipleChoices: responseFunction('multipleChoices'),
movedPermanently: responseFunction('movedPermanently'),
found: responseFunction('found'),
seeOther: responseFunction('seeOther'),
notModified: responseFunction('notModified'),
temporaryRedirect: responseFunction('temporaryRedirect'),
permanentRedirect: responseFunction('permanentRedirect'),
invalidRequest: responseFunction('invalidRequest'),
unauthenticated: responseFunction('unauthenticated'),
paymentRequired: responseFunction('paymentRequired'),
permissionDenied: responseFunction('permissionDenied'),
notFound: responseFunction('notFound'),
methodNotAllowed: responseFunction('methodNotAllowed'),
notAcceptable: responseFunction('notAcceptable'),
proxyAuthenticationRequired: responseFunction('proxyAuthenticationRequired'),
requestTimeout: responseFunction('requestTimeout'),
conflict: responseFunction('conflict'),
gone: responseFunction('gone'),
lengthRequired: responseFunction('lengthRequired'),
preconditionFailed: responseFunction('preconditionFailed'),
contentTooLarge: responseFunction('contentTooLarge'),
uriTooLong: responseFunction('uriTooLong'),
unsupportedMediaType: responseFunction('unsupportedMediaType'),
rangeNotSatisfiable: responseFunction('rangeNotSatisfiable'),
exceptionFailed: responseFunction('exceptionFailed'),
imATeapot: responseFunction('imATeapot'),
misdirectedRequest: responseFunction('misdirectedRequest'),
unprocessableContent: responseFunction('unprocessableContent'),
locked: responseFunction('locked'),
failedDependency: responseFunction('failedDependency'),
tooEarly: responseFunction('tooEarly'),
upgradeRequired: responseFunction('upgradeRequired'),
preconditionRequired: responseFunction('preconditionRequired'),
rateLimitExceeded: responseFunction('rateLimitExceeded'),
requestHeaderFieldsTooLarge: responseFunction('requestHeaderFieldsTooLarge'),
unavailableForLegalReasons: responseFunction('unavailableForLegalReasons'),
internalError: responseFunction('internalError'),
notImplemented: responseFunction('notImplemented'),
badGateway: responseFunction('badGateway'),
serviceUnavailable: responseFunction('serviceUnavailable'),
gatewayTimeout: responseFunction('gatewayTimeout'),
httpVersionNotSupported: responseFunction('httpVersionNotSupported'),
variantAlsoNegotiates: responseFunction('variantAlsoNegotiates'),
insufficientStorage: responseFunction('insufficientStorage'),
loopDetected: responseFunction('loopDetected'),
notExtended: responseFunction('notExtended'),
networkAuthenticationRequired: responseFunction('networkAuthenticationRequired'),
};
//# sourceMappingURL=keyed-response.js.map

@@ -1,2 +0,2 @@

export declare type Status = 200 | 400 | 401 | 403 | 404 | 409 | 429 | 500 | 503;
export declare type Status = 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
export declare type Response = {

@@ -7,39 +7,243 @@ type: Status;

export declare const Response: {
ok: <T>(payload: T) => {
type: 200;
continue: <T>(payload: T) => {
type: 100;
payload: T;
};
invalidRequest: <T_1>(payload: T_1) => {
type: 400;
switchingProtocols: <T_1>(payload: T_1) => {
type: 101;
payload: T_1;
};
unauthenticated: <T_2>(payload: T_2) => {
type: 401;
processing: <T_2>(payload: T_2) => {
type: 102;
payload: T_2;
};
permissionDenied: <T_3>(payload: T_3) => {
type: 403;
ok: <T_3>(payload: T_3) => {
type: 200;
payload: T_3;
};
notFound: <T_4>(payload: T_4) => {
type: 404;
created: <T_4>(payload: T_4) => {
type: 201;
payload: T_4;
};
conflict: <T_5>(payload: T_5) => {
type: 409;
accepted: <T_5>(payload: T_5) => {
type: 202;
payload: T_5;
};
rateLimitExceeded: <T_6>(payload: T_6) => {
type: 429;
nonAuthoritativeInformation: <T_6>(payload: T_6) => {
type: 203;
payload: T_6;
};
internalError: <T_7>(payload: T_7) => {
type: 500;
noContent: <T_7>(payload: T_7) => {
type: 204;
payload: T_7;
};
serviceUnavailable: <T_8>(payload: T_8) => {
type: 503;
resetContent: <T_8>(payload: T_8) => {
type: 205;
payload: T_8;
};
partialContent: <T_9>(payload: T_9) => {
type: 206;
payload: T_9;
};
multiStatus: <T_10>(payload: T_10) => {
type: 207;
payload: T_10;
};
alreadyReported: <T_11>(payload: T_11) => {
type: 208;
payload: T_11;
};
imUsed: <T_12>(payload: T_12) => {
type: 226;
payload: T_12;
};
multipleChoices: <T_13>(payload: T_13) => {
type: 300;
payload: T_13;
};
movedPermanently: <T_14>(payload: T_14) => {
type: 301;
payload: T_14;
};
found: <T_15>(payload: T_15) => {
type: 302;
payload: T_15;
};
seeOther: <T_16>(payload: T_16) => {
type: 303;
payload: T_16;
};
notModified: <T_17>(payload: T_17) => {
type: 304;
payload: T_17;
};
temporaryRedirect: <T_18>(payload: T_18) => {
type: 307;
payload: T_18;
};
permanentRedirect: <T_19>(payload: T_19) => {
type: 308;
payload: T_19;
};
invalidRequest: <T_20>(payload: T_20) => {
type: 400;
payload: T_20;
};
unauthenticated: <T_21>(payload: T_21) => {
type: 401;
payload: T_21;
};
paymentRequired: <T_22>(payload: T_22) => {
type: 402;
payload: T_22;
};
permissionDenied: <T_23>(payload: T_23) => {
type: 403;
payload: T_23;
};
notFound: <T_24>(payload: T_24) => {
type: 404;
payload: T_24;
};
methodNotAllowed: <T_25>(payload: T_25) => {
type: 405;
payload: T_25;
};
notAcceptable: <T_26>(payload: T_26) => {
type: 406;
payload: T_26;
};
proxyAuthenticationRequired: <T_27>(payload: T_27) => {
type: 407;
payload: T_27;
};
requestTimeout: <T_28>(payload: T_28) => {
type: 408;
payload: T_28;
};
conflict: <T_29>(payload: T_29) => {
type: 409;
payload: T_29;
};
gone: <T_30>(payload: T_30) => {
type: 410;
payload: T_30;
};
lengthRequired: <T_31>(payload: T_31) => {
type: 411;
payload: T_31;
};
preconditionFailed: <T_32>(payload: T_32) => {
type: 412;
payload: T_32;
};
contentTooLarge: <T_33>(payload: T_33) => {
type: 413;
payload: T_33;
};
uriTooLong: <T_34>(payload: T_34) => {
type: 414;
payload: T_34;
};
unsupportedMediaType: <T_35>(payload: T_35) => {
type: 415;
payload: T_35;
};
rangeNotSatisfiable: <T_36>(payload: T_36) => {
type: 416;
payload: T_36;
};
exceptionFailed: <T_37>(payload: T_37) => {
type: 417;
payload: T_37;
};
imATeapot: <T_38>(payload: T_38) => {
type: 418;
payload: T_38;
};
misdirectedRequest: <T_39>(payload: T_39) => {
type: 421;
payload: T_39;
};
unprocessableContent: <T_40>(payload: T_40) => {
type: 422;
payload: T_40;
};
locked: <T_41>(payload: T_41) => {
type: 423;
payload: T_41;
};
failedDependency: <T_42>(payload: T_42) => {
type: 424;
payload: T_42;
};
tooEarly: <T_43>(payload: T_43) => {
type: 425;
payload: T_43;
};
upgradeRequired: <T_44>(payload: T_44) => {
type: 426;
payload: T_44;
};
preconditionRequired: <T_45>(payload: T_45) => {
type: 428;
payload: T_45;
};
rateLimitExceeded: <T_46>(payload: T_46) => {
type: 429;
payload: T_46;
};
requestHeaderFieldsTooLarge: <T_47>(payload: T_47) => {
type: 431;
payload: T_47;
};
unavailableForLegalReasons: <T_48>(payload: T_48) => {
type: 451;
payload: T_48;
};
internalError: <T_49>(payload: T_49) => {
type: 500;
payload: T_49;
};
notImplemented: <T_50>(payload: T_50) => {
type: 501;
payload: T_50;
};
badGateway: <T_51>(payload: T_51) => {
type: 502;
payload: T_51;
};
serviceUnavailable: <T_52>(payload: T_52) => {
type: 503;
payload: T_52;
};
gatewayTimeout: <T_53>(payload: T_53) => {
type: 504;
payload: T_53;
};
httpVersionNotSupported: <T_54>(payload: T_54) => {
type: 505;
payload: T_54;
};
variantAlsoNegotiates: <T_55>(payload: T_55) => {
type: 506;
payload: T_55;
};
insufficientStorage: <T_56>(payload: T_56) => {
type: 507;
payload: T_56;
};
loopDetected: <T_57>(payload: T_57) => {
type: 508;
payload: T_57;
};
notExtended: <T_58>(payload: T_58) => {
type: 510;
payload: T_58;
};
networkAuthenticationRequired: <T_59>(payload: T_59) => {
type: 511;
payload: T_59;
};
};
//# sourceMappingURL=response.d.ts.map

@@ -6,12 +6,63 @@ "use strict";

exports.Response = {
continue: ResponseFunction(100),
switchingProtocols: ResponseFunction(101),
processing: ResponseFunction(102),
ok: ResponseFunction(200),
created: ResponseFunction(201),
accepted: ResponseFunction(202),
nonAuthoritativeInformation: ResponseFunction(203),
noContent: ResponseFunction(204),
resetContent: ResponseFunction(205),
partialContent: ResponseFunction(206),
multiStatus: ResponseFunction(207),
alreadyReported: ResponseFunction(208),
imUsed: ResponseFunction(226),
multipleChoices: ResponseFunction(300),
movedPermanently: ResponseFunction(301),
found: ResponseFunction(302),
seeOther: ResponseFunction(303),
notModified: ResponseFunction(304),
temporaryRedirect: ResponseFunction(307),
permanentRedirect: ResponseFunction(308),
invalidRequest: ResponseFunction(400),
unauthenticated: ResponseFunction(401),
paymentRequired: ResponseFunction(402),
permissionDenied: ResponseFunction(403),
notFound: ResponseFunction(404),
methodNotAllowed: ResponseFunction(405),
notAcceptable: ResponseFunction(406),
proxyAuthenticationRequired: ResponseFunction(407),
requestTimeout: ResponseFunction(408),
conflict: ResponseFunction(409),
gone: ResponseFunction(410),
lengthRequired: ResponseFunction(411),
preconditionFailed: ResponseFunction(412),
contentTooLarge: ResponseFunction(413),
uriTooLong: ResponseFunction(414),
unsupportedMediaType: ResponseFunction(415),
rangeNotSatisfiable: ResponseFunction(416),
exceptionFailed: ResponseFunction(417),
imATeapot: ResponseFunction(418),
misdirectedRequest: ResponseFunction(421),
unprocessableContent: ResponseFunction(422),
locked: ResponseFunction(423),
failedDependency: ResponseFunction(424),
tooEarly: ResponseFunction(425),
upgradeRequired: ResponseFunction(426),
preconditionRequired: ResponseFunction(428),
rateLimitExceeded: ResponseFunction(429),
requestHeaderFieldsTooLarge: ResponseFunction(431),
unavailableForLegalReasons: ResponseFunction(451),
internalError: ResponseFunction(500),
notImplemented: ResponseFunction(501),
badGateway: ResponseFunction(502),
serviceUnavailable: ResponseFunction(503),
gatewayTimeout: ResponseFunction(504),
httpVersionNotSupported: ResponseFunction(505),
variantAlsoNegotiates: ResponseFunction(506),
insufficientStorage: ResponseFunction(507),
loopDetected: ResponseFunction(508),
notExtended: ResponseFunction(510),
networkAuthenticationRequired: ResponseFunction(511),
};
//# sourceMappingURL=response.js.map

2

package.json
{
"name": "@api-ts/response",
"version": "2.0.0",
"version": "2.1.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

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