UNPKG

26.9 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 "Environment": {
141 "type": string;
142 "properties": {
143 "name": {
144 "pattern": string;
145 "type": string;
146 };
147 "domains": {
148 "type": string;
149 "items": {
150 "anyOf": {
151 "$ref": string;
152 }[];
153 };
154 };
155 };
156 "propertyOrder": string[];
157 "required": string[];
158 };
159 "Application": {
160 "type": string;
161 "properties": {
162 "accountId": {
163 "minLength": number;
164 "type": string;
165 };
166 "id": {
167 "minLength": number;
168 "type": string;
169 };
170 "name": {
171 "description": string;
172 "minLength": number;
173 "type": string;
174 };
175 "createdAt": {
176 "description": string;
177 "type": string;
178 "format": string;
179 "coerce-date": boolean;
180 };
181 "updatedAt": {
182 "description": string;
183 "type": string;
184 "format": string;
185 "coerce-date": boolean;
186 };
187 "sourceUrl": {
188 "description": string;
189 "format": string;
190 "type": string;
191 };
192 "environments": {
193 "type": string;
194 "items": {
195 "$ref": string;
196 };
197 };
198 };
199 "propertyOrder": string[];
200 "required": string[];
201 };
202 "Template": {
203 "type": string;
204 "properties": {
205 "id": {
206 "minLength": number;
207 "type": string;
208 };
209 "name": {
210 "minLength": number;
211 "type": string;
212 };
213 "previewImageUrl": {
214 "format": string;
215 "type": string;
216 };
217 "githubUrl": {
218 "format": string;
219 "type": string;
220 };
221 };
222 "propertyOrder": string[];
223 "required": string[];
224 };
225 "ExternalAccount": {
226 "type": string;
227 "properties": {
228 "source": {
229 "description": string;
230 "minLength": number;
231 "type": string;
232 };
233 "id": {
234 "minLength": number;
235 "type": string;
236 };
237 };
238 "propertyOrder": string[];
239 "required": string[];
240 };
241 "User": {
242 "type": string;
243 "properties": {
244 "id": {
245 "minLength": number;
246 "type": string;
247 };
248 "fullName": {
249 "minLength": number;
250 "type": string;
251 };
252 "email": {
253 "format": string;
254 "type": string;
255 };
256 "avatarUrl": {
257 "format": string;
258 "type": string;
259 };
260 "externalAccounts": {
261 "type": string;
262 "items": {
263 "$ref": string;
264 };
265 };
266 };
267 "propertyOrder": string[];
268 "required": string[];
269 };
270 "TimePeriod": {
271 "description": string;
272 "minLength": number;
273 "type": string;
274 };
275 "InvocationDetails": {
276 "type": string;
277 "properties": {
278 "durUs": {
279 "type": string;
280 };
281 "reqid": {
282 "type": string;
283 };
284 };
285 "propertyOrder": string[];
286 "required": string[];
287 };
288 "LogRecord": {
289 "type": string;
290 "properties": {
291 "source": {
292 "type": string;
293 };
294 "msg": {
295 "type": string;
296 };
297 "isErr": {
298 "type": string;
299 };
300 "time": {
301 "description": string;
302 "type": string;
303 "format": string;
304 "coerce-date": boolean;
305 };
306 "invocation": {
307 "$ref": string;
308 };
309 };
310 "propertyOrder": string[];
311 "required": string[];
312 };
313 "LogReadOpts": {
314 "type": string;
315 "properties": {
316 "since": {
317 "description": string;
318 "type": string;
319 "format": string;
320 "coerce-date": boolean;
321 };
322 "limit": {
323 "minimum": number;
324 "maximum": number;
325 "type": string;
326 };
327 "follow": {
328 "type": string;
329 };
330 "nextToken": {
331 "description": string;
332 "minLength": number;
333 "type": string;
334 };
335 };
336 "propertyOrder": string[];
337 "required": string[];
338 };
339 "LogsResponse": {
340 "type": string;
341 "properties": {
342 "records": {
343 "type": string;
344 "items": {
345 "$ref": string;
346 };
347 };
348 "nextToken": {
349 "minLength": number;
350 "type": string;
351 };
352 };
353 "propertyOrder": string[];
354 "required": string[];
355 };
356 "CreateTicketResponse": {
357 "type": string;
358 "properties": {
359 "ticket": {
360 "minLength": number;
361 "type": string;
362 };
363 "expires": {
364 "description": string;
365 "minLength": number;
366 "type": string;
367 };
368 };
369 "propertyOrder": string[];
370 "required": string[];
371 };
372 "TryTemplateResponse": {
373 "type": string;
374 "properties": {
375 "token": {
376 "minLength": number;
377 "type": string;
378 };
379 "expiresAt": {
380 "description": string;
381 "type": string;
382 "format": string;
383 "coerce-date": boolean;
384 };
385 "domain": {
386 "minLength": number;
387 "type": string;
388 };
389 };
390 "propertyOrder": string[];
391 "required": string[];
392 };
393 "Lycan": {
394 "type": string;
395 "properties": {
396 "createTicket": {
397 "description": string;
398 "type": string;
399 "properties": {
400 "params": {
401 "type": string;
402 "properties": {};
403 };
404 "returns": {
405 "$ref": string;
406 };
407 };
408 "propertyOrder": string[];
409 "required": string[];
410 };
411 "claimTicket": {
412 "description": string;
413 "type": string;
414 "properties": {
415 "params": {
416 "type": string;
417 "properties": {
418 "ticket": {
419 "type": string;
420 };
421 };
422 "propertyOrder": string[];
423 "required": string[];
424 };
425 "throws": {
426 "$ref": string;
427 };
428 "returns": {
429 "type": string;
430 };
431 };
432 "propertyOrder": string[];
433 "required": string[];
434 };
435 "listTemplates": {
436 "type": string;
437 "properties": {
438 "params": {
439 "type": string;
440 "properties": {};
441 };
442 "returns": {
443 "type": string;
444 "items": {
445 "$ref": string;
446 };
447 };
448 };
449 "propertyOrder": string[];
450 "required": string[];
451 };
452 "tryTemplate": {
453 "description": string;
454 "type": string;
455 "properties": {
456 "params": {
457 "type": string;
458 "properties": {
459 "id": {
460 "minLength": number;
461 "type": string;
462 };
463 };
464 "propertyOrder": string[];
465 "required": string[];
466 };
467 "throws": {
468 "$ref": string;
469 };
470 "returns": {
471 "$ref": string;
472 };
473 };
474 "propertyOrder": string[];
475 "required": string[];
476 };
477 "whoami": {
478 "type": string;
479 "properties": {
480 "params": {
481 "type": string;
482 "properties": {};
483 };
484 "returns": {
485 "$ref": string;
486 };
487 "throws": {
488 "$ref": string;
489 };
490 };
491 "propertyOrder": string[];
492 "required": string[];
493 };
494 "listApps": {
495 "type": string;
496 "properties": {
497 "params": {
498 "type": string;
499 "properties": {};
500 };
501 "throws": {
502 "$ref": string;
503 };
504 "returns": {
505 "type": string;
506 "items": {
507 "$ref": string;
508 };
509 };
510 };
511 "propertyOrder": string[];
512 "required": string[];
513 };
514 "deployInitial": {
515 "type": string;
516 "properties": {
517 "params": {
518 "type": string;
519 "properties": {
520 "env": {
521 "pattern": string;
522 "type": string;
523 };
524 "name": {
525 "minLength": number;
526 "type": string;
527 };
528 "digest": {
529 "minLength": number;
530 "type": string;
531 };
532 "envVars": {
533 "type": string;
534 "items": {
535 "type": string;
536 "items": {
537 "type": string;
538 }[];
539 "minItems": number;
540 "additionalItems": {
541 "anyOf": {
542 "type": string;
543 }[];
544 };
545 };
546 };
547 };
548 "propertyOrder": string[];
549 "required": string[];
550 };
551 "throws": {
552 "anyOf": {
553 "$ref": string;
554 }[];
555 };
556 "returns": {
557 "$ref": string;
558 };
559 };
560 "propertyOrder": string[];
561 "required": string[];
562 };
563 "deploy": {
564 "type": string;
565 "properties": {
566 "params": {
567 "type": string;
568 "properties": {
569 "appId": {
570 "minLength": number;
571 "type": string;
572 };
573 "env": {
574 "pattern": string;
575 "type": string;
576 };
577 "digest": {
578 "minLength": number;
579 "type": string;
580 };
581 "envVars": {
582 "type": string;
583 "items": {
584 "type": string;
585 "items": {
586 "type": string;
587 }[];
588 "minItems": number;
589 "additionalItems": {
590 "anyOf": {
591 "type": string;
592 }[];
593 };
594 };
595 };
596 };
597 "propertyOrder": string[];
598 "required": string[];
599 };
600 "throws": {
601 "anyOf": {
602 "$ref": string;
603 }[];
604 };
605 "returns": {
606 "$ref": string;
607 };
608 };
609 "propertyOrder": string[];
610 "required": string[];
611 };
612 "claimApp": {
613 "description": string;
614 "type": string;
615 "properties": {
616 "params": {
617 "type": string;
618 "properties": {
619 "token": {
620 "minLength": number;
621 "type": string;
622 };
623 };
624 "propertyOrder": string[];
625 "required": string[];
626 };
627 "throws": {
628 "anyOf": {
629 "$ref": string;
630 }[];
631 };
632 "returns": {
633 "$ref": string;
634 };
635 };
636 "propertyOrder": string[];
637 "required": string[];
638 };
639 "getLogs": {
640 "type": string;
641 "properties": {
642 "params": {
643 "type": string;
644 "properties": {
645 "appId": {
646 "minLength": number;
647 "type": string;
648 };
649 "env": {
650 "pattern": string;
651 "type": string;
652 };
653 "opts": {
654 "$ref": string;
655 };
656 };
657 "propertyOrder": string[];
658 "required": string[];
659 };
660 "throws": {
661 "anyOf": {
662 "$ref": string;
663 }[];
664 };
665 "returns": {
666 "$ref": string;
667 };
668 };
669 "propertyOrder": string[];
670 "required": string[];
671 };
672 "destroyApp": {
673 "type": string;
674 "properties": {
675 "params": {
676 "type": string;
677 "properties": {
678 "appId": {
679 "minLength": number;
680 "type": string;
681 };
682 };
683 "propertyOrder": string[];
684 "required": string[];
685 };
686 "throws": {
687 "anyOf": {
688 "$ref": string;
689 }[];
690 };
691 "returns": {
692 "type": string;
693 };
694 };
695 "propertyOrder": string[];
696 "required": string[];
697 };
698 };
699 "propertyOrder": string[];
700 "required": string[];
701 };
702 };
703};
704export declare class InternalServerError extends Error {
705 readonly name = "InternalServerError";
706}
707export declare class UnauthorizedError extends Error {
708 readonly name = "UnauthorizedError";
709}
710export declare class NotFoundError extends Error {
711 readonly name = "NotFoundError";
712}
713export declare class ExistsError extends Error {
714 readonly name = "ExistsError";
715}
716export declare enum FunctionRunnerSize {
717 M128MIB = "m128MiB",
718 M1GIB = "m1GiB",
719 M256MIB = "m256MiB",
720 M2GIB = "m2GiB",
721 M512MIB = "m512MiB"
722}
723export declare type Domain = (SubDomain) | (CNameDomain);
724export interface Session {
725 readonly accountId: string;
726 readonly principal: string;
727}
728export interface ServerOnlyContext {
729 readonly tags?: {};
730 readonly logLevel?: string;
731 readonly logExtra?: {};
732 readonly sampleRate?: number;
733 readonly debugId: string;
734 readonly session?: Session;
735}
736export interface SubDomain {
737 readonly type: "subdomain";
738 readonly name: string;
739}
740export interface CNameDomain {
741 readonly type: "cname";
742 readonly name: string;
743 readonly certificate: string;
744}
745export interface Environment {
746 readonly name: string;
747 readonly domains: Array<(SubDomain) | (CNameDomain)>;
748}
749export interface Application {
750 readonly accountId: string;
751 readonly id: string;
752 readonly name: string;
753 readonly createdAt: Date;
754 readonly updatedAt: Date;
755 readonly sourceUrl?: string;
756 readonly environments: Array<Environment>;
757}
758export interface Template {
759 readonly id: string;
760 readonly name: string;
761 readonly previewImageUrl: string;
762 readonly githubUrl: string;
763}
764export interface ExternalAccount {
765 readonly source: string;
766 readonly id: string;
767}
768export interface User {
769 readonly id: string;
770 readonly fullName: string;
771 readonly email: string;
772 readonly avatarUrl?: string;
773 readonly externalAccounts: Array<ExternalAccount>;
774}
775export interface InvocationDetails {
776 readonly durUs: number;
777 readonly reqid: string;
778}
779export interface LogRecord {
780 readonly source: string;
781 readonly msg: string;
782 readonly isErr: boolean;
783 readonly time: Date;
784 readonly invocation?: InvocationDetails;
785}
786export interface LogReadOpts {
787 readonly since: Date;
788 readonly limit: number;
789 readonly follow: boolean;
790 readonly nextToken?: string;
791}
792export interface LogsResponse {
793 readonly records: Array<LogRecord>;
794 readonly nextToken?: string;
795}
796export interface CreateTicketResponse {
797 readonly ticket: string;
798 readonly expires: string;
799}
800export interface TryTemplateResponse {
801 readonly token: string;
802 readonly expiresAt: Date;
803 readonly domain: string;
804}
805export interface Lycan {
806 createTicket(): Promise<CreateTicketResponse>;
807 claimTicket(ticket: string): Promise<string>;
808 listTemplates(): Promise<Array<Template>>;
809 tryTemplate(id: string): Promise<TryTemplateResponse>;
810 whoami(): Promise<User>;
811 listApps(): Promise<Array<Application>>;
812 deployInitial(env: string, name: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
813 deploy(appId: string, env: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
814 claimApp(token: string): Promise<Application>;
815 getLogs(appId: string, env: string, opts: LogReadOpts): Promise<LogsResponse>;
816 destroyApp(appId: string): Promise<void>;
817}