Socket
Socket
Sign inDemoInstall

aspida

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspida - npm Package Compare versions

Comparing version 0.14.7 to 0.15.0

4

dist/buildTemplate.d.ts
import { BaseConfig } from './getConfig';
export interface Template {
export declare type Template = {
text: string;
filePath: string;
}
};
declare const _default: ({ input, baseURL, trailingSlash }: BaseConfig) => Template;
export default _default;
//# sourceMappingURL=buildTemplate.d.ts.map

@@ -14,9 +14,9 @@ import { BaseConfig } from '../getConfig';

}
interface BuildCommand {
declare type BuildCommand = {
run(config: BaseConfig, io: BuildIO): void;
}
export interface BuildIO {
};
export declare type BuildIO = {
write(template: Template): void;
watch(input: string, callback: () => void): void;
}
};
export declare class Build implements BuildCommand {

@@ -23,0 +23,0 @@ run(config: BaseConfig, io: BuildIO): void;

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

export interface Command {
export declare type Command = {
exec(): void;
}
};
export declare const nullCommand: Command;
//# sourceMappingURL=command.d.ts.map

@@ -1,8 +0,8 @@

export interface BaseConfig {
export declare type BaseConfig = {
input: string;
baseURL: string;
trailingSlash: boolean;
}
};
declare const _default: (configPath?: string) => BaseConfig[];
export default _default;
//# sourceMappingURL=getConfig.d.ts.map

@@ -5,3 +5,3 @@ export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS';

declare type BasicHeaders = Record<string, string>;
export interface AspidaRequest<Config = any> {
export declare type AspidaRequest<Config = any> = {
query?: any;

@@ -12,4 +12,4 @@ headers?: any;

config?: Config;
}
export interface AspidaResponse<T, U> {
};
export declare type AspidaResponse<T, U> = {
status: number;

@@ -19,4 +19,4 @@ headers: U;

data: T;
}
export interface AspidaParams<Config = any> {
};
export declare type AspidaParams<Config = any> = {
query?: any;

@@ -26,4 +26,4 @@ headers?: any;

config?: Config;
}
export interface AspidaClient<Config> {
};
export declare type AspidaClient<Config> = {
baseURL: string | undefined;

@@ -38,7 +38,7 @@ fetch: <T, U = BasicHeaders>(prefix: string, path: string, method: HttpMethod, params?: AspidaParams<Config>, type?: RequestType) => {

};
}
};
export declare const headersToObject: (headers: Headers) => any;
export declare const dataToURLString: (data: Record<string, any>) => string;
export declare const optionToRequest: (option?: AspidaParams<any> | undefined, type?: "string" | "ArrayBuffer" | "any" | "FormData" | "URLSearchParams" | "Blob" | undefined) => AspidaRequest<any> | undefined;
export interface AspidaMethodParams {
export declare type AspidaMethodParams = {
query?: any;

@@ -50,3 +50,3 @@ reqHeaders?: any;

resBody?: any;
}
};
export declare type AspidaMethods = {

@@ -53,0 +53,0 @@ [method in LowerHttpMethod]?: AspidaMethodParams;

@@ -7,8 +7,8 @@ import { LowerHttpMethod, AspidaMethodParams } from './';

};
export interface Method {
export declare type Method = {
name: LowerHttpMethod;
props: Partial<Record<MethodsProperties, Prop>>;
}
};
declare const _default: (text: string, name: string) => Method[] | null;
export default _default;
//# sourceMappingURL=parseInterface.d.ts.map

@@ -204,8 +204,9 @@ "use strict";

exports.default = (function (text, name) {
var interfaceRegExp = new RegExp("(^|\n)export interface " + name + " ?{");
var interfaceRegExp = new RegExp("(^|\n)export (interface " + name + "|type " + name + " ?=) ?{");
if (!interfaceRegExp.test(text))
return null;
var methods = parseMethods(text.split(interfaceRegExp)[2]);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
var methods = parseMethods(text.split(interfaceRegExp).pop());
return methods.length ? methods : null;
});
//# sourceMappingURL=parseInterface.js.map
{
"name": "aspida",
"version": "0.14.7",
"version": "0.15.0",
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js",

@@ -27,5 +27,5 @@ "author": "m-mitsuhide <m.mitsuhide@amatelus.com>",

"dependencies": {
"chokidar": "^3.3.1",
"chokidar": "^3.4.0",
"minimist": "^1.2.5"
}
}

@@ -63,3 +63,3 @@ | aspida | [aspida-mock] | [openapi2aspida] | [pathpida] |

1. Reproduce the endpoint directory structure in the apis directory
1. Export Methods interface with TS file
1. Export a Type alias named "Methods"
1. Call 'aspida --build' with npm scripts

@@ -98,3 +98,3 @@ 1. API type definition file 'apis/\$api.ts' will be generated, so import the application and make an HTTP request

```typescript
interface User {
type User = {
id: number

@@ -104,3 +104,3 @@ name: string

export interface Methods {
export type Methods = {
get: {

@@ -133,3 +133,3 @@ query?: {

```typescript
interface User {
type User = {
id: number

@@ -139,3 +139,3 @@ name: string

export interface Methods {
export type Methods = {
get: {

@@ -262,3 +262,3 @@ resBody: User

```typescript
export interface Methods {
export type Methods = {
post: {

@@ -305,3 +305,3 @@ reqFormat: FormData

```typescript
export interface Methods {
export type Methods = {
post: {

@@ -342,3 +342,3 @@ reqFormat: URLSearchParams

```typescript
export interface Methods {
export type Methods = {
get: {

@@ -345,0 +345,0 @@ query: {

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

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