1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10 | };
|
11 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12 | return function (target, key) { decorator(target, key, paramIndex); }
|
13 | };
|
14 | Object.defineProperty(exports, "__esModule", { value: true });
|
15 | const APILove_1 = require("../APILove");
|
16 | class SampleAPI {
|
17 | constructor() {
|
18 | this.blah = "yo!sddf";
|
19 | }
|
20 | static staticFunc(what,
|
21 | data,
|
22 | req,
|
23 | res
|
24 | ) {
|
25 | return new Promise((resolve, reject) => {
|
26 | resolve(data);
|
27 | });
|
28 | }
|
29 | instanceFunc(what,
|
30 | data,
|
31 | req,
|
32 | res
|
33 | ) {
|
34 | return new Promise((resolve, reject) => {
|
35 | resolve(data);
|
36 | });
|
37 | }
|
38 | }
|
39 | __decorate([
|
40 | APILove_1.APIEndpoint({
|
41 | method: "POST",
|
42 | path: "/foo/:what"
|
43 | }),
|
44 | __param(0, APILove_1.APIParameter({
|
45 | optional: true
|
46 | })),
|
47 | __metadata("design:type", Function),
|
48 | __metadata("design:paramtypes", [String, Object, Object, Object]),
|
49 | __metadata("design:returntype", Promise)
|
50 | ], SampleAPI.prototype, "instanceFunc", null);
|
51 | __decorate([
|
52 | APILove_1.APIEndpoint({
|
53 | method: "POST",
|
54 | path: "/foo/:what"
|
55 | }),
|
56 | __param(1, APILove_1.APIParameter({
|
57 | optional: true
|
58 | })),
|
59 | __metadata("design:type", Function),
|
60 | __metadata("design:paramtypes", [String, Object, Object, Object]),
|
61 | __metadata("design:returntype", Promise)
|
62 | ], SampleAPI, "staticFunc", null);
|
63 | exports.SampleAPI = SampleAPI;
|
64 |
|
\ | No newline at end of file |