Comparing version 1.9.1 to 1.10.0
import { Doc } from './parseInterface'; | ||
declare const _default: (indent: string, doc?: Doc, props?: (Partial<Record<keyof import(".").AspidaMethodParams, { | ||
declare const _default: (indent: string, doc?: Doc, props?: (Partial<Record<"status" | "polymorph" | "reqHeaders" | "reqFormat" | "reqBody" | "query" | "resHeaders" | "resBody", { | ||
value: string; | ||
@@ -7,3 +7,3 @@ hasQuestion: boolean; | ||
}>> & { | ||
polymorph?: Partial<Record<keyof import(".").AspidaMethodParams, { | ||
polymorph?: Partial<Record<"status" | "polymorph" | "reqHeaders" | "reqFormat" | "reqBody" | "query" | "resHeaders" | "resBody", { | ||
value: string; | ||
@@ -10,0 +10,0 @@ hasQuestion: boolean; |
@@ -32,3 +32,3 @@ "use strict"; | ||
.map(function (dirent) { | ||
var _a, _b; | ||
var _a; | ||
var filename = dirent.name; | ||
@@ -67,3 +67,3 @@ var basename = dirent.isDir ? filename : filename.replace(/\.ts$/, ''); | ||
var methodsOfIndexTsFile_1 = (_a = tree.children.find(function (c) { return c.name === "".concat(filename, ".ts"); })) !== null && _a !== void 0 ? _a : dirent.tree.children.find(function (c) { return c.name === 'index.ts'; }); | ||
return fallbackSpecialCharsProp(createApiString(dirent.tree, "".concat(importBasePath, "/").concat(filename), "".concat(indent).concat(hasVal ? ' ' : '', " "), dirDeps + 1, newPrefix, newUrl, "".concat((0, createDocComment_1.default)(indent, (_b = methodsOfIndexTsFile_1) === null || _b === void 0 ? void 0 : _b.doc)).concat(valFn.replace('<% next %>', '<% props %>')), (methodsOfIndexTsFile_1 === null || methodsOfIndexTsFile_1 === void 0 ? void 0 : methodsOfIndexTsFile_1.isDir) === false | ||
return fallbackSpecialCharsProp(createApiString(dirent.tree, "".concat(importBasePath, "/").concat(filename), "".concat(indent).concat(hasVal ? ' ' : '', " "), dirDeps + 1, newPrefix, newUrl, "".concat((0, createDocComment_1.default)(indent, methodsOfIndexTsFile_1 === null || methodsOfIndexTsFile_1 === void 0 ? void 0 : methodsOfIndexTsFile_1.doc)).concat(valFn.replace('<% next %>', '<% props %>')), (methodsOfIndexTsFile_1 === null || methodsOfIndexTsFile_1 === void 0 ? void 0 : methodsOfIndexTsFile_1.isDir) === false | ||
? getMethodsString("".concat(importBasePath, "/").concat(filename), methodsOfIndexTsFile_1.methods, "".concat(indent).concat(hasVal ? ' ' : ''), newPrefix, newUrl) | ||
@@ -70,0 +70,0 @@ : undefined)); |
@@ -0,1 +1,3 @@ | ||
/// <reference types="node" /> | ||
import type { ReadStream } from 'fs'; | ||
export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS'; | ||
@@ -39,14 +41,30 @@ export declare type LowerHttpMethod = 'get' | 'post' | 'put' | 'delete' | 'head' | 'patch' | 'options'; | ||
export declare const optionToRequest: (option?: AspidaParams<any> | undefined, type?: RequestType | undefined) => AspidaRequest | undefined; | ||
export declare type AspidaMethodParams = { | ||
status?: number; | ||
query?: any; | ||
declare type AspidaMethodParamsReqOthers = { | ||
reqHeaders?: any; | ||
reqFormat?: FormData | URLSearchParams | ArrayBuffer | Blob | string | any; | ||
reqFormat?: URLSearchParams | ArrayBuffer | Blob | string; | ||
reqBody?: any; | ||
resHeaders?: any; | ||
resBody?: any; | ||
polymorph?: Array<AspidaMethodParamsOthers & Omit<AspidaMethodParamsReqOthers, 'polymorph'>>; | ||
}; | ||
export declare type AspidaMethods = { | ||
[method in LowerHttpMethod]?: AspidaMethodParams; | ||
declare type AspidaMethodParamsReqFormData = { | ||
reqHeaders?: any; | ||
reqFormat?: FormData; | ||
reqBody?: Record<string, string | number | File | ReadStream>; | ||
polymorph?: Array<AspidaMethodParamsOthers & Omit<AspidaMethodParamsReqFormData, 'polymorph'>>; | ||
}; | ||
declare type AspidaMethodParamsReq = AspidaMethodParamsReqOthers | AspidaMethodParamsReqFormData; | ||
declare type JSONValue = string | number | boolean | null | { | ||
[key: string]: JSONValue; | ||
} | Array<JSONValue>; | ||
declare type AspidaMethodParamsOthers = { | ||
status?: number; | ||
query?: Record<string, string | number | (string | number)[]>; | ||
resHeaders?: { | ||
[key: string]: string | undefined; | ||
}; | ||
resBody?: JSONValue | FormData | ArrayBuffer; | ||
}; | ||
export declare type AspidaMethodParams = AspidaMethodParamsReq & AspidaMethodParamsOthers; | ||
export declare type AspidaMethods = Partial<Record<LowerHttpMethod, AspidaMethodParams>>; | ||
export declare type DefineMethods<T extends AspidaMethods> = T; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -259,3 +259,3 @@ "use strict"; | ||
var _a; | ||
var interfaceRegExp = new RegExp("(^|\r?\n)(export )(interface ".concat(name, "|type ").concat(name, " ?=)( ?{)")); | ||
var interfaceRegExp = new RegExp("(^|\r?\n)(export[\\s]*)(interface[\\s]*".concat(name, "|type[\\s]*").concat(name, "[\\s]*=[\\s]*(\\w+<)?)(\\s?{)")); | ||
if (!interfaceRegExp.test(text)) | ||
@@ -262,0 +262,0 @@ return null; |
{ | ||
"name": "aspida", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "Solufa <solufa2020@gmail.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
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
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
116468
1148