UNPKG

24.8 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 "externalAccounts": {
257 "type": string;
258 "items": {
259 "$ref": string;
260 };
261 };
262 };
263 "propertyOrder": string[];
264 "required": string[];
265 };
266 "TimePeriod": {
267 "description": string;
268 "minLength": number;
269 "type": string;
270 };
271 "LogRecord": {
272 "type": string;
273 "properties": {
274 "source": {
275 "type": string;
276 };
277 "msg": {
278 "type": string;
279 };
280 "isErr": {
281 "type": string;
282 };
283 "time": {
284 "description": string;
285 "type": string;
286 "format": string;
287 "coerce-date": boolean;
288 };
289 "durUs": {
290 "type": string;
291 };
292 "reqid": {
293 "type": string;
294 };
295 };
296 "propertyOrder": string[];
297 "required": string[];
298 };
299 "LogReadOpts": {
300 "type": string;
301 "properties": {
302 "since": {
303 "description": string;
304 "type": string;
305 "format": string;
306 "coerce-date": boolean;
307 };
308 "limit": {
309 "minimum": number;
310 "maximum": number;
311 "type": string;
312 };
313 "follow": {
314 "type": string;
315 };
316 "nextToken": {
317 "description": string;
318 "minLength": number;
319 "type": string;
320 };
321 };
322 "propertyOrder": string[];
323 "required": string[];
324 };
325 "LogsResponse": {
326 "type": string;
327 "properties": {
328 "records": {
329 "type": string;
330 "items": {
331 "$ref": string;
332 };
333 };
334 "nextToken": {
335 "minLength": number;
336 "type": string;
337 };
338 };
339 "propertyOrder": string[];
340 "required": string[];
341 };
342 "CreateTicketResponse": {
343 "type": string;
344 "properties": {
345 "ticket": {
346 "minLength": number;
347 "type": string;
348 };
349 "expires": {
350 "description": string;
351 "minLength": number;
352 "type": string;
353 };
354 };
355 "propertyOrder": string[];
356 "required": string[];
357 };
358 "Lycan": {
359 "type": string;
360 "properties": {
361 "createTicket": {
362 "description": string;
363 "type": string;
364 "properties": {
365 "params": {
366 "type": string;
367 "properties": {};
368 };
369 "returns": {
370 "$ref": string;
371 };
372 };
373 "propertyOrder": string[];
374 "required": string[];
375 };
376 "claimTicket": {
377 "description": string;
378 "type": string;
379 "properties": {
380 "params": {
381 "type": string;
382 "properties": {
383 "ticket": {
384 "type": string;
385 };
386 };
387 "propertyOrder": string[];
388 "required": string[];
389 };
390 "throws": {
391 "$ref": string;
392 };
393 "returns": {
394 "type": string;
395 };
396 };
397 "propertyOrder": string[];
398 "required": string[];
399 };
400 "listTemplates": {
401 "type": string;
402 "properties": {
403 "params": {
404 "type": string;
405 "properties": {};
406 };
407 "returns": {
408 "type": string;
409 "items": {
410 "$ref": string;
411 };
412 };
413 };
414 "propertyOrder": string[];
415 "required": string[];
416 };
417 "tryTemplate": {
418 "type": string;
419 "properties": {
420 "params": {
421 "type": string;
422 "properties": {
423 "id": {
424 "minLength": number;
425 "type": string;
426 };
427 };
428 "propertyOrder": string[];
429 "required": string[];
430 };
431 "throws": {
432 "$ref": string;
433 };
434 "returns": {
435 "$ref": string;
436 };
437 };
438 "propertyOrder": string[];
439 "required": string[];
440 };
441 "whoami": {
442 "type": string;
443 "properties": {
444 "params": {
445 "type": string;
446 "properties": {};
447 };
448 "returns": {
449 "$ref": string;
450 };
451 "throws": {
452 "$ref": string;
453 };
454 };
455 "propertyOrder": string[];
456 "required": string[];
457 };
458 "listApps": {
459 "type": string;
460 "properties": {
461 "params": {
462 "type": string;
463 "properties": {};
464 };
465 "throws": {
466 "$ref": string;
467 };
468 "returns": {
469 "type": string;
470 "items": {
471 "$ref": string;
472 };
473 };
474 };
475 "propertyOrder": string[];
476 "required": string[];
477 };
478 "deployInitial": {
479 "type": string;
480 "properties": {
481 "params": {
482 "type": string;
483 "properties": {
484 "env": {
485 "pattern": string;
486 "type": string;
487 };
488 "name": {
489 "minLength": number;
490 "type": string;
491 };
492 "digest": {
493 "minLength": number;
494 "type": string;
495 };
496 "envVars": {
497 "type": string;
498 "items": {
499 "type": string;
500 "items": {
501 "type": string;
502 }[];
503 "minItems": number;
504 "additionalItems": {
505 "anyOf": {
506 "type": string;
507 }[];
508 };
509 };
510 };
511 };
512 "propertyOrder": string[];
513 "required": string[];
514 };
515 "throws": {
516 "anyOf": {
517 "$ref": string;
518 }[];
519 };
520 "returns": {
521 "$ref": string;
522 };
523 };
524 "propertyOrder": string[];
525 "required": string[];
526 };
527 "deploy": {
528 "type": string;
529 "properties": {
530 "params": {
531 "type": string;
532 "properties": {
533 "appId": {
534 "minLength": number;
535 "type": string;
536 };
537 "env": {
538 "pattern": string;
539 "type": string;
540 };
541 "digest": {
542 "minLength": number;
543 "type": string;
544 };
545 "envVars": {
546 "type": string;
547 "items": {
548 "type": string;
549 "items": {
550 "type": string;
551 }[];
552 "minItems": number;
553 "additionalItems": {
554 "anyOf": {
555 "type": string;
556 }[];
557 };
558 };
559 };
560 };
561 "propertyOrder": string[];
562 "required": string[];
563 };
564 "throws": {
565 "anyOf": {
566 "$ref": string;
567 }[];
568 };
569 "returns": {
570 "$ref": string;
571 };
572 };
573 "propertyOrder": string[];
574 "required": string[];
575 };
576 "claimApp": {
577 "description": string;
578 "type": string;
579 "properties": {
580 "params": {
581 "type": string;
582 "properties": {
583 "accountId": {
584 "minLength": number;
585 "type": string;
586 };
587 "appId": {
588 "minLength": number;
589 "type": string;
590 };
591 };
592 "propertyOrder": string[];
593 "required": string[];
594 };
595 "throws": {
596 "anyOf": {
597 "$ref": string;
598 }[];
599 };
600 "returns": {
601 "type": string;
602 };
603 };
604 "propertyOrder": string[];
605 "required": string[];
606 };
607 "getLogs": {
608 "type": string;
609 "properties": {
610 "params": {
611 "type": string;
612 "properties": {
613 "appId": {
614 "minLength": number;
615 "type": string;
616 };
617 "env": {
618 "pattern": string;
619 "type": string;
620 };
621 "opts": {
622 "$ref": string;
623 };
624 };
625 "propertyOrder": string[];
626 "required": string[];
627 };
628 "throws": {
629 "anyOf": {
630 "$ref": string;
631 }[];
632 };
633 "returns": {
634 "$ref": string;
635 };
636 };
637 "propertyOrder": string[];
638 "required": string[];
639 };
640 };
641 "propertyOrder": string[];
642 "required": string[];
643 };
644 };
645};
646export declare class InternalServerError extends Error {
647 readonly name = "InternalServerError";
648}
649export declare class UnauthorizedError extends Error {
650 readonly name = "UnauthorizedError";
651}
652export declare class NotFoundError extends Error {
653 readonly name = "NotFoundError";
654}
655export declare class ExistsError extends Error {
656 readonly name = "ExistsError";
657}
658export declare enum FunctionRunnerSize {
659 M128MIB = "m128MiB",
660 M1GIB = "m1GiB",
661 M256MIB = "m256MiB",
662 M2GIB = "m2GiB",
663 M512MIB = "m512MiB"
664}
665export declare type Domain = (SubDomain) | (CNameDomain);
666export interface Session {
667 readonly accountId: string;
668 readonly principal: string;
669}
670export interface ServerOnlyContext {
671 readonly tags?: {};
672 readonly logLevel?: string;
673 readonly logExtra?: {};
674 readonly sampleRate?: number;
675 readonly debugId: string;
676 readonly session?: Session;
677}
678export interface SubDomain {
679 readonly type: "subdomain";
680 readonly name: string;
681}
682export interface CNameDomain {
683 readonly type: "cname";
684 readonly name: string;
685 readonly certificate: string;
686}
687export interface Environment {
688 readonly name: string;
689 readonly domains: Array<(SubDomain) | (CNameDomain)>;
690}
691export interface Application {
692 readonly accountId: string;
693 readonly id: string;
694 readonly name: string;
695 readonly createdAt: Date;
696 readonly updatedAt: Date;
697 readonly sourceUrl?: string;
698 readonly environments: Array<Environment>;
699}
700export interface Template {
701 readonly id: string;
702 readonly name: string;
703 readonly previewImageUrl: string;
704 readonly githubUrl: string;
705}
706export interface ExternalAccount {
707 readonly source: string;
708 readonly id: string;
709}
710export interface User {
711 readonly id: string;
712 readonly fullName: string;
713 readonly email: string;
714 readonly externalAccounts: Array<ExternalAccount>;
715}
716export interface LogRecord {
717 readonly source: string;
718 readonly msg: string;
719 readonly isErr: boolean;
720 readonly time: Date;
721 readonly durUs?: number;
722 readonly reqid?: string;
723}
724export interface LogReadOpts {
725 readonly since: Date;
726 readonly limit: number;
727 readonly follow: boolean;
728 readonly nextToken?: string;
729}
730export interface LogsResponse {
731 readonly records: Array<LogRecord>;
732 readonly nextToken?: string;
733}
734export interface CreateTicketResponse {
735 readonly ticket: string;
736 readonly expires: string;
737}
738export interface Lycan {
739 createTicket(): Promise<CreateTicketResponse>;
740 claimTicket(ticket: string): Promise<string>;
741 listTemplates(): Promise<Array<Template>>;
742 tryTemplate(id: string): Promise<Application>;
743 whoami(): Promise<User>;
744 listApps(): Promise<Array<Application>>;
745 deployInitial(env: string, name: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
746 deploy(appId: string, env: string, digest: string, envVars: Array<[string, string]>): Promise<Application>;
747 claimApp(accountId: string, appId: string): Promise<void>;
748 getLogs(appId: string, env: string, opts: LogReadOpts): Promise<LogsResponse>;
749}