UNPKG

29.6 kBTypeScriptView Raw
1export declare const schema: {
2 "$schema": string;
3 "definitions": {
4 "FunctionRunnerSize": {
5 "enum": string[];
6 "type": string;
7 };
8 "Session": {
9 "type": string;
10 "properties": {
11 "accountId": {
12 "minLength": number;
13 "type": string;
14 };
15 "principal": {
16 "minLength": number;
17 "type": string;
18 };
19 };
20 "propertyOrder": string[];
21 "required": string[];
22 };
23 "ServerOnlyContext": {
24 "type": string;
25 "properties": {
26 "tags": {
27 "type": string;
28 "additionalProperties": {
29 "type": string;
30 };
31 "propertyOrder": never[];
32 };
33 "logLevel": {
34 "type": string;
35 };
36 "logExtra": {
37 "type": string;
38 "additionalProperties": {};
39 "propertyOrder": never[];
40 };
41 "sampleRate": {
42 "type": string;
43 };
44 "debugId": {
45 "type": string;
46 };
47 "session": {
48 "$ref": string;
49 };
50 };
51 "propertyOrder": string[];
52 "required": string[];
53 };
54 "UnauthorizedError": {
55 "type": string;
56 "properties": {
57 "name": {
58 "type": string;
59 };
60 "message": {
61 "type": string;
62 };
63 "stack": {
64 "type": string;
65 };
66 };
67 "propertyOrder": string[];
68 "required": string[];
69 };
70 "NotFoundError": {
71 "type": string;
72 "properties": {
73 "name": {
74 "type": string;
75 };
76 "message": {
77 "type": string;
78 };
79 "stack": {
80 "type": string;
81 };
82 };
83 "propertyOrder": string[];
84 "required": string[];
85 };
86 "ExistsError": {
87 "type": string;
88 "properties": {
89 "name": {
90 "type": string;
91 };
92 "message": {
93 "type": string;
94 };
95 "stack": {
96 "type": string;
97 };
98 };
99 "propertyOrder": string[];
100 "required": string[];
101 };
102 "SubDomain": {
103 "type": string;
104 "properties": {
105 "type": {
106 "type": string;
107 "enum": string[];
108 };
109 "name": {
110 "type": string;
111 };
112 };
113 "propertyOrder": string[];
114 "required": string[];
115 };
116 "CNameDomain": {
117 "type": string;
118 "properties": {
119 "type": {
120 "type": string;
121 "enum": string[];
122 };
123 "name": {
124 "format": string;
125 "type": string;
126 };
127 "certificate": {
128 "minLength": number;
129 "type": string;
130 };
131 };
132 "propertyOrder": string[];
133 "required": string[];
134 };
135 "Domain": {
136 "anyOf": {
137 "$ref": string;
138 }[];
139 };
140 "TemplateSource": {
141 "type": string;
142 "properties": {
143 "downloadDir": {
144 "description": string;
145 "type": string;
146 };
147 "downloadUrl": {
148 "description": string;
149 "type": string;
150 };
151 "githubUrl": {
152 "description": string;
153 "type": string;
154 };
155 "targetDir": {
156 "description": string;
157 "type": string;
158 };
159 "zipUrl": {
160 "description": string;
161 "type": string;
162 };
163 };
164 "propertyOrder": string[];
165 "required": string[];
166 };
167 "Environment": {
168 "type": string;
169 "properties": {
170 "name": {
171 "pattern": string;
172 "type": string;
173 };
174 "domains": {
175 "type": string;
176 "items": {
177 "anyOf": {
178 "$ref": string;
179 }[];
180 };
181 };
182 };
183 "propertyOrder": string[];
184 "required": string[];
185 };
186 "Application": {
187 "type": string;
188 "properties": {
189 "accountId": {
190 "minLength": number;
191 "type": string;
192 };
193 "id": {
194 "minLength": number;
195 "type": string;
196 };
197 "name": {
198 "description": string;
199 "minLength": number;
200 "type": string;
201 };
202 "createdAt": {
203 "description": string;
204 "type": string;
205 "format": string;
206 "coerce-date": boolean;
207 };
208 "updatedAt": {
209 "description": string;
210 "type": string;
211 "format": string;
212 "coerce-date": boolean;
213 };
214 "source": {
215 "description": string;
216 "$ref": string;
217 };
218 "environments": {
219 "type": string;
220 "items": {
221 "$ref": string;
222 };
223 };
224 };
225 "propertyOrder": string[];
226 "required": string[];
227 };
228 "Template": {
229 "type": string;
230 "properties": {
231 "id": {
232 "minLength": number;
233 "type": string;
234 };
235 "name": {
236 "minLength": number;
237 "type": string;
238 };
239 "previewImageUrl": {
240 "format": string;
241 "type": string;
242 };
243 "githubUrl": {
244 "format": string;
245 "type": string;
246 };
247 "license": {
248 "minLength": number;
249 "type": string;
250 };
251 "author": {
252 "minLength": number;
253 "type": string;
254 };
255 "description": {
256 "minLength": number;
257 "type": string;
258 };
259 "similarTemplatesIds": {
260 "type": string;
261 "items": {
262 "type": string;
263 };
264 };
265 };
266 "propertyOrder": string[];
267 "required": string[];
268 };
269 "ExternalAccount": {
270 "type": string;
271 "properties": {
272 "source": {
273 "description": string;
274 "minLength": number;
275 "type": string;
276 };
277 "id": {
278 "minLength": number;
279 "type": string;
280 };
281 };
282 "propertyOrder": string[];
283 "required": string[];
284 };
285 "User": {
286 "type": string;
287 "properties": {
288 "id": {
289 "minLength": number;
290 "type": string;
291 };
292 "fullName": {
293 "minLength": number;
294 "type": string;
295 };
296 "email": {
297 "format": string;
298 "type": string;
299 };
300 "avatarUrl": {
301 "format": string;
302 "type": string;
303 };
304 "externalAccounts": {
305 "type": string;
306 "items": {
307 "$ref": string;
308 };
309 };
310 };
311 "propertyOrder": string[];
312 "required": string[];
313 };
314 "TimePeriod": {
315 "description": string;
316 "minLength": number;
317 "type": string;
318 };
319 "InvocationDetails": {
320 "type": string;
321 "properties": {
322 "durUs": {
323 "type": string;
324 };
325 "reqid": {
326 "type": string;
327 };
328 };
329 "propertyOrder": string[];
330 "required": string[];
331 };
332 "LogRecord": {
333 "type": string;
334 "properties": {
335 "source": {
336 "type": string;
337 };
338 "msg": {
339 "type": string;
340 };
341 "isErr": {
342 "type": string;
343 };
344 "time": {
345 "description": string;
346 "type": string;
347 "format": string;
348 "coerce-date": boolean;
349 };
350 "invocation": {
351 "$ref": string;
352 };
353 };
354 "propertyOrder": string[];
355 "required": string[];
356 };
357 "LogReadOpts": {
358 "type": string;
359 "properties": {
360 "since": {
361 "description": string;
362 "type": string;
363 "format": string;
364 "coerce-date": boolean;
365 };
366 "limit": {
367 "minimum": number;
368 "maximum": number;
369 "type": string;
370 };
371 "follow": {
372 "type": string;
373 };
374 "nextToken": {
375 "description": string;
376 "minLength": number;
377 "type": string;
378 };
379 };
380 "propertyOrder": string[];
381 "required": string[];
382 };
383 "LogsResponse": {
384 "type": string;
385 "properties": {
386 "records": {
387 "type": string;
388 "items": {
389 "$ref": string;
390 };
391 };
392 "nextToken": {
393 "minLength": number;
394 "type": string;
395 };
396 };
397 "propertyOrder": string[];
398 "required": string[];
399 };
400 "CreateTicketResponse": {
401 "type": string;
402 "properties": {
403 "ticket": {
404 "minLength": number;
405 "type": string;
406 };
407 "expires": {
408 "description": string;
409 "minLength": number;
410 "type": string;
411 };
412 };
413 "propertyOrder": string[];
414 "required": string[];
415 };
416 "TryTemplateResponse": {
417 "type": string;
418 "properties": {
419 "token": {
420 "minLength": number;
421 "type": string;
422 };
423 "expiresAt": {
424 "description": string;
425 "type": string;
426 "format": string;
427 "coerce-date": boolean;
428 };
429 "domain": {
430 "minLength": number;
431 "type": string;
432 };
433 };
434 "propertyOrder": string[];
435 "required": string[];
436 };
437 "Lycan": {
438 "type": string;
439 "properties": {
440 "createTicket": {
441 "description": string;
442 "type": string;
443 "properties": {
444 "params": {
445 "type": string;
446 "properties": {};
447 };
448 "returns": {
449 "$ref": string;
450 };
451 };
452 "propertyOrder": string[];
453 "required": string[];
454 };
455 "claimTicket": {
456 "description": string;
457 "type": string;
458 "properties": {
459 "params": {
460 "type": string;
461 "properties": {
462 "ticket": {
463 "type": string;
464 };
465 };
466 "propertyOrder": string[];
467 "required": string[];
468 };
469 "throws": {
470 "$ref": string;
471 };
472 "returns": {
473 "type": string;
474 };
475 };
476 "propertyOrder": string[];
477 "required": string[];
478 };
479 "listTemplates": {
480 "type": string;
481 "properties": {
482 "params": {
483 "type": string;
484 "properties": {};
485 };
486 "returns": {
487 "type": string;
488 "items": {
489 "$ref": string;
490 };
491 };
492 };
493 "propertyOrder": string[];
494 "required": string[];
495 };
496 "tryTemplate": {
497 "description": string;
498 "type": string;
499 "properties": {
500 "params": {
501 "type": string;
502 "properties": {
503 "id": {
504 "minLength": number;
505 "type": string;
506 };
507 };
508 "propertyOrder": string[];
509 "required": string[];
510 };
511 "throws": {
512 "$ref": string;
513 };
514 "returns": {
515 "$ref": string;
516 };
517 };
518 "propertyOrder": string[];
519 "required": string[];
520 };
521 "whoami": {
522 "type": string;
523 "properties": {
524 "params": {
525 "type": string;
526 "properties": {};
527 };
528 "returns": {
529 "$ref": string;
530 };
531 "throws": {
532 "$ref": string;
533 };
534 };
535 "propertyOrder": string[];
536 "required": string[];
537 };
538 "listApps": {
539 "type": string;
540 "properties": {
541 "params": {
542 "type": string;
543 "properties": {};
544 };
545 "throws": {
546 "$ref": string;
547 };
548 "returns": {
549 "type": string;
550 "items": {
551 "$ref": string;
552 };
553 };
554 };
555 "propertyOrder": string[];
556 "required": string[];
557 };
558 "getApp": {
559 "type": string;
560 "properties": {
561 "params": {
562 "type": string;
563 "properties": {
564 "id": {
565 "minLength": number;
566 "type": string;
567 };
568 };
569 "propertyOrder": string[];
570 "required": string[];
571 };
572 "throws": {
573 "$ref": string;
574 };
575 "returns": {
576 "$ref": string;
577 };
578 };
579 "propertyOrder": string[];
580 "required": string[];
581 };
582 "deployInitial": {
583 "type": string;
584 "properties": {
585 "params": {
586 "type": string;
587 "properties": {
588 "env": {
589 "pattern": string;
590 "type": string;
591 };
592 "name": {
593 "minLength": number;
594 "type": string;
595 };
596 "digest": {
597 "minLength": number;
598 "type": string;
599 };
600 "envVars": {
601 "type": string;
602 "items": {
603 "type": string;
604 "items": {
605 "type": string;
606 }[];
607 "minItems": number;
608 "additionalItems": {
609 "anyOf": {
610 "type": string;
611 }[];
612 };
613 };
614 };
615 };
616 "propertyOrder": string[];
617 "required": string[];
618 };
619 "throws": {
620 "anyOf": {
621 "$ref": string;
622 }[];
623 };
624 "returns": {
625 "$ref": string;
626 };
627 };
628 "propertyOrder": string[];
629 "required": string[];
630 };
631 "deploy": {
632 "type": string;
633 "properties": {
634 "params": {
635 "type": string;
636 "properties": {
637 "appId": {
638 "minLength": number;
639 "type": string;
640 };
641 "env": {
642 "pattern": string;
643 "type": string;
644 };
645 "digest": {
646 "minLength": number;
647 "type": string;
648 };
649 "envVars": {
650 "type": string;
651 "items": {
652 "type": string;
653 "items": {
654 "type": string;
655 }[];
656 "minItems": number;
657 "additionalItems": {
658 "anyOf": {
659 "type": string;
660 }[];
661 };
662 };
663 };
664 };
665 "propertyOrder": string[];
666 "required": string[];
667 };
668 "throws": {
669 "anyOf": {
670 "$ref": string;
671 }[];
672 };
673 "returns": {
674 "$ref": string;
675 };
676 };
677 "propertyOrder": string[];
678 "required": string[];
679 };
680 "claimApp": {
681 "description": string;
682 "type": string;
683 "properties": {
684 "params": {
685 "type": string;
686 "properties": {
687 "token": {
688 "minLength": number;
689 "type": string;
690 };
691 };
692 "propertyOrder": string[];
693 "required": string[];
694 };
695 "throws": {
696 "anyOf": {
697 "$ref": string;
698 }[];
699 };
700 "returns": {
701 "$ref": string;
702 };
703 };
704 "propertyOrder": string[];
705 "required": string[];
706 };
707 "getLogs": {
708 "type": string;
709 "properties": {
710 "params": {
711 "type": string;
712 "properties": {
713 "appId": {
714 "minLength": number;
715 "type": string;
716 };
717 "env": {
718 "pattern": string;
719 "type": string;
720 };
721 "opts": {
722 "$ref": string;
723 };
724 };
725 "propertyOrder": string[];
726 "required": string[];
727 };
728 "throws": {
729 "anyOf": {
730 "$ref": string;
731 }[];
732 };
733 "returns": {
734 "$ref": string;
735 };
736 };
737 "propertyOrder": string[];
738 "required": string[];
739 };
740 "destroyApp": {
741 "type": string;
742 "properties": {
743 "params": {
744 "type": string;
745 "properties": {
746 "appId": {
747 "minLength": number;
748 "type": string;
749 };
750 };
751 "propertyOrder": string[];
752 "required": string[];
753 };
754 "throws": {
755 "anyOf": {
756 "$ref": string;
757 }[];
758 };
759 "returns": {
760 "type": string;
761 };
762 };
763 "propertyOrder": string[];
764 "required": string[];
765 };
766 };
767 "propertyOrder": string[];
768 "required": string[];
769 };
770 };
771};
772export declare class InternalServerError extends Error {
773 readonly name = "InternalServerError";
774}
775export declare class UnauthorizedError extends Error {
776 readonly name = "UnauthorizedError";
777}
778export declare class NotFoundError extends Error {
779 readonly name = "NotFoundError";
780}
781export declare class ExistsError extends Error {
782 readonly name = "ExistsError";
783}
784export declare enum FunctionRunnerSize {
785 M128MIB = "m128MiB",
786 M1GIB = "m1GiB",
787 M256MIB = "m256MiB",
788 M2GIB = "m2GiB",
789 M512MIB = "m512MiB"
790}
791export declare type Domain = (SubDomain) | (CNameDomain);
792export interface Session {
793 readonly accountId: string;
794 readonly principal: string;
795}
796export interface ServerOnlyContext {
797 readonly tags?: {};
798 readonly logLevel?: string;
799 readonly logExtra?: {};
800 readonly sampleRate?: number;
801 readonly debugId: string;
802 readonly session?: Session;
803}
804export interface SubDomain {
805 readonly type: "subdomain";
806 readonly name: string;
807}
808export interface CNameDomain {
809 readonly type: "cname";
810 readonly name: string;
811 readonly certificate: string;
812}
813export interface TemplateSource {
814 readonly downloadDir: string;
815 readonly downloadUrl: string;
816 readonly githubUrl: string;
817 readonly targetDir: string;
818 readonly zipUrl: string;
819}
820export interface Environment {
821 readonly name: string;
822 readonly domains: Array<(SubDomain) | (CNameDomain)>;
823}
824export interface Application {
825 readonly accountId: string;
826 readonly id: string;
827 readonly name: string;
828 readonly createdAt: Date;
829 readonly updatedAt: Date;
830 readonly source?: TemplateSource;
831 readonly environments: Array<Environment>;
832}
833export interface Template {
834 readonly id: string;
835 readonly name: string;
836 readonly previewImageUrl: string;
837 readonly githubUrl: string;
838 readonly license: string;
839 readonly author: string;
840 readonly description: string;
841 readonly similarTemplatesIds: Array<string>;
842}
843export interface ExternalAccount {
844 readonly source: string;
845 readonly id: string;
846}
847export interface User {
848 readonly id: string;
849 readonly fullName: string;
850 readonly email: string;
851 readonly avatarUrl?: string;
852 readonly externalAccounts: Array<ExternalAccount>;
853}
854export interface InvocationDetails {
855 readonly durUs: number;
856 readonly reqid: string;
857}
858export interface LogRecord {
859 readonly source: string;
860 readonly msg: string;
861 readonly isErr: boolean;
862 readonly time: Date;
863 readonly invocation?: InvocationDetails;
864}
865export interface LogReadOpts {
866 readonly since: Date;
867 readonly limit: number;
868 readonly follow: boolean;
869 readonly nextToken?: string;
870}
871export interface LogsResponse {
872 readonly records: Array<LogRecord>;
873 readonly nextToken?: string;
874}
875export interface CreateTicketResponse {
876 readonly ticket: string;
877 readonly expires: string;
878}
879export interface TryTemplateResponse {
880 readonly token: string;
881 readonly expiresAt: Date;
882 readonly domain: string;
883}
884export interface Lycan {
885 createTicket(): Promise<CreateTicketResponse>;
886 claimTicket(ticket: string): Promise<string>;
887 listTemplates(): Promise<Array<Template>>;
888 tryTemplate(id: string): Promise<TryTemplateResponse>;
889 whoami(): Promise<User>;
890 listApps(): Promise<Array<Application>>;
891 getApp(id: string): Promise<Application>;
892 deployInitial(env: string, name: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
893 deploy(appId: string, env: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
894 claimApp(token: string): Promise<Application>;
895 getLogs(appId: string, env: string, opts: LogReadOpts): Promise<LogsResponse>;
896 destroyApp(appId: string): Promise<void>;
897}