Skip to content

Commit

Permalink
fix: minor problems
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed May 28, 2018
1 parent 4f65f15 commit 245458f
Show file tree
Hide file tree
Showing 8 changed files with 6,115 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
coverage/
src/generator/
api_call_test.ts
/**/*.js
/**/*.map
node_modules/
*.tgz
/**/*.d.ts
_readme.md
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ install:
script:
- npm run cover
after_success:
- npm run build
- npm run codeclimate:report
- npm run semantic-release
42 changes: 42 additions & 0 deletions APIMaker.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export interface SMethod {
Name: string;
fnName: string;
QueryParameters: any[];
PathParameters: any[];
HeaderParameters: any[];
RequiredArgs: number;
TotalArgs: number;
Verb: string;
Keep: boolean;
RelativeRoute: any;
}
export interface SNode {
FormatName: string;
Class: SNode;
Properties: SNode[];
Methods: SMethod[];
Route: string;
PathParameter: string[];
}
export interface IAPICall {
verb: string;
route: string;
query?: string;
body?: any;
headers: any;
}
export declare type APIPreSend = (data: IAPICall) => Promise<any>;
export declare class APIService {
private server;
private personalKey;
private preSend;
fnHandler(route: string, method: SMethod, personalKey: string, ...args: any[]): Promise<any>;
send(data: IAPICall): Promise<any>;
constructor(server: string, personalKey: string, API: SNode, preSend?: APIPreSend);
checkListArgs(args: any[]): any[];
validateArgs(fnName: string, args: any[], required: number, total: number): any[];
getQuery(method: string, QueryParameters: string[], args: any[]): any;
getHeaders(method: string, HeaderParameters: string[], args: any[]): {};
getRoute(route: string, method: SMethod, args: any): string;
toFinal(node: SNode, route: string): any;
}
133 changes: 133 additions & 0 deletions APIMaker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { IAccount, IDomains, IImages, ILinode, ILongview, IManaged, INetworking, INodebalancers, IProfile, IRegions, ISupport, IVolumes } from './interfaces';
import { APIPreSend } from "./APIMaker";
declare class Linodev4 {
account: IAccount;
domains: IDomains;
images: IImages;
linode: ILinode;
longview: ILongview;
managed: IManaged;
networking: INetworking;
nodebalancers: INodebalancers;
profile: IProfile;
regions: IRegions;
support: ISupport;
volumes: IVolumes;
constructor(key: string, fn?: APIPreSend);
}
export { Linodev4, Linodev4 as default };
12 changes: 12 additions & 0 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 245458f

Please sign in to comment.