UNPKG

36.5 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3// tslint:disable
4exports.schema = {
5 "$schema": "http://json-schema.org/draft-07/schema#",
6 "definitions": {
7 "FunctionRunnerSize": {
8 "enum": [
9 "m128MiB",
10 "m1GiB",
11 "m256MiB",
12 "m2GiB",
13 "m512MiB"
14 ],
15 "type": "string"
16 },
17 "Session": {
18 "type": "object",
19 "properties": {
20 "accountId": {
21 "minLength": 1,
22 "type": "string"
23 },
24 "principal": {
25 "minLength": 1,
26 "type": "string"
27 }
28 },
29 "propertyOrder": [
30 "accountId",
31 "principal"
32 ],
33 "required": [
34 "accountId",
35 "principal"
36 ]
37 },
38 "ServerOnlyContext": {
39 "type": "object",
40 "properties": {
41 "tags": {
42 "type": "object",
43 "additionalProperties": {
44 "type": "string"
45 },
46 "propertyOrder": []
47 },
48 "logLevel": {
49 "type": "string"
50 },
51 "logExtra": {
52 "type": "object",
53 "additionalProperties": {},
54 "propertyOrder": []
55 },
56 "sampleRate": {
57 "type": "number"
58 },
59 "debugId": {
60 "type": "string"
61 },
62 "session": {
63 "$ref": "#/definitions/Session"
64 }
65 },
66 "propertyOrder": [
67 "tags",
68 "logLevel",
69 "logExtra",
70 "sampleRate",
71 "debugId",
72 "session"
73 ],
74 "required": [
75 "debugId"
76 ]
77 },
78 "UnauthorizedError": {
79 "type": "object",
80 "properties": {
81 "name": {
82 "type": "string"
83 },
84 "message": {
85 "type": "string"
86 },
87 "stack": {
88 "type": "string"
89 }
90 },
91 "propertyOrder": [
92 "name",
93 "message",
94 "stack"
95 ],
96 "required": [
97 "message",
98 "name"
99 ]
100 },
101 "NotFoundError": {
102 "type": "object",
103 "properties": {
104 "name": {
105 "type": "string"
106 },
107 "message": {
108 "type": "string"
109 },
110 "stack": {
111 "type": "string"
112 }
113 },
114 "propertyOrder": [
115 "name",
116 "message",
117 "stack"
118 ],
119 "required": [
120 "message",
121 "name"
122 ]
123 },
124 "ExistsError": {
125 "type": "object",
126 "properties": {
127 "name": {
128 "type": "string"
129 },
130 "message": {
131 "type": "string"
132 },
133 "stack": {
134 "type": "string"
135 }
136 },
137 "propertyOrder": [
138 "name",
139 "message",
140 "stack"
141 ],
142 "required": [
143 "message",
144 "name"
145 ]
146 },
147 "SubDomain": {
148 "type": "object",
149 "properties": {
150 "type": {
151 "type": "string",
152 "enum": [
153 "subdomain"
154 ]
155 },
156 "name": {
157 "type": "string"
158 }
159 },
160 "propertyOrder": [
161 "type",
162 "name"
163 ],
164 "required": [
165 "name",
166 "type"
167 ]
168 },
169 "CNameDomain": {
170 "type": "object",
171 "properties": {
172 "type": {
173 "type": "string",
174 "enum": [
175 "cname"
176 ]
177 },
178 "name": {
179 "format": "hostname",
180 "type": "string"
181 },
182 "certificate": {
183 "minLength": 1,
184 "type": "string"
185 }
186 },
187 "propertyOrder": [
188 "type",
189 "name",
190 "certificate"
191 ],
192 "required": [
193 "certificate",
194 "name",
195 "type"
196 ]
197 },
198 "Domain": {
199 "anyOf": [
200 {
201 "$ref": "#/definitions/SubDomain"
202 },
203 {
204 "$ref": "#/definitions/CNameDomain"
205 }
206 ]
207 },
208 "Environment": {
209 "type": "object",
210 "properties": {
211 "name": {
212 "pattern": "^[A-Za-z][A-Za-z_\\d]{0,49}$",
213 "type": "string"
214 },
215 "domains": {
216 "type": "array",
217 "items": {
218 "anyOf": [
219 {
220 "$ref": "#/definitions/SubDomain"
221 },
222 {
223 "$ref": "#/definitions/CNameDomain"
224 }
225 ]
226 }
227 }
228 },
229 "propertyOrder": [
230 "name",
231 "domains"
232 ],
233 "required": [
234 "domains",
235 "name"
236 ]
237 },
238 "Application": {
239 "type": "object",
240 "properties": {
241 "accountId": {
242 "minLength": 1,
243 "type": "string"
244 },
245 "id": {
246 "minLength": 1,
247 "type": "string"
248 },
249 "name": {
250 "description": "Non-unique user friendly name to identify this app",
251 "minLength": 1,
252 "type": "string"
253 },
254 "createdAt": {
255 "description": "Enables basic storage and retrieval of dates and times.",
256 "type": "string",
257 "format": "date-time",
258 "coerce-date": true
259 },
260 "updatedAt": {
261 "description": "Enables basic storage and retrieval of dates and times.",
262 "type": "string",
263 "format": "date-time",
264 "coerce-date": true
265 },
266 "sourceUrl": {
267 "description": "If cloned from template, will hold the template github URL (including the git tag | digest).\nCould be used in the future to track a github repo.",
268 "format": "uri",
269 "type": "string"
270 },
271 "environments": {
272 "type": "array",
273 "items": {
274 "$ref": "#/definitions/Environment"
275 }
276 }
277 },
278 "propertyOrder": [
279 "accountId",
280 "id",
281 "name",
282 "createdAt",
283 "updatedAt",
284 "sourceUrl",
285 "environments"
286 ],
287 "required": [
288 "accountId",
289 "createdAt",
290 "environments",
291 "id",
292 "name",
293 "updatedAt"
294 ]
295 },
296 "Template": {
297 "type": "object",
298 "properties": {
299 "id": {
300 "minLength": 1,
301 "type": "string"
302 },
303 "name": {
304 "minLength": 1,
305 "type": "string"
306 },
307 "previewImageUrl": {
308 "format": "uri",
309 "type": "string"
310 },
311 "githubUrl": {
312 "format": "uri",
313 "type": "string"
314 }
315 },
316 "propertyOrder": [
317 "id",
318 "name",
319 "previewImageUrl",
320 "githubUrl"
321 ],
322 "required": [
323 "githubUrl",
324 "id",
325 "name",
326 "previewImageUrl"
327 ]
328 },
329 "ExternalAccount": {
330 "type": "object",
331 "properties": {
332 "source": {
333 "description": "e.g. github",
334 "minLength": 1,
335 "type": "string"
336 },
337 "id": {
338 "minLength": 1,
339 "type": "string"
340 }
341 },
342 "propertyOrder": [
343 "source",
344 "id"
345 ],
346 "required": [
347 "id",
348 "source"
349 ]
350 },
351 "User": {
352 "type": "object",
353 "properties": {
354 "id": {
355 "minLength": 1,
356 "type": "string"
357 },
358 "fullName": {
359 "minLength": 1,
360 "type": "string"
361 },
362 "email": {
363 "format": "email",
364 "type": "string"
365 },
366 "avatarUrl": {
367 "format": "uri",
368 "type": "string"
369 },
370 "externalAccounts": {
371 "type": "array",
372 "items": {
373 "$ref": "#/definitions/ExternalAccount"
374 }
375 }
376 },
377 "propertyOrder": [
378 "id",
379 "fullName",
380 "email",
381 "avatarUrl",
382 "externalAccounts"
383 ],
384 "required": [
385 "email",
386 "externalAccounts",
387 "fullName",
388 "id"
389 ]
390 },
391 "TimePeriod": {
392 "description": "Pattern as supported by the ms package",
393 "minLength": 1,
394 "type": "string"
395 },
396 "InvocationDetails": {
397 "type": "object",
398 "properties": {
399 "durUs": {
400 "type": "number"
401 },
402 "reqid": {
403 "type": "string"
404 }
405 },
406 "propertyOrder": [
407 "durUs",
408 "reqid"
409 ],
410 "required": [
411 "durUs",
412 "reqid"
413 ]
414 },
415 "LogRecord": {
416 "type": "object",
417 "properties": {
418 "source": {
419 "type": "string"
420 },
421 "msg": {
422 "type": "string"
423 },
424 "isErr": {
425 "type": "boolean"
426 },
427 "time": {
428 "description": "Enables basic storage and retrieval of dates and times.",
429 "type": "string",
430 "format": "date-time",
431 "coerce-date": true
432 },
433 "invocation": {
434 "$ref": "#/definitions/InvocationDetails"
435 }
436 },
437 "propertyOrder": [
438 "source",
439 "msg",
440 "isErr",
441 "time",
442 "invocation"
443 ],
444 "required": [
445 "isErr",
446 "msg",
447 "source",
448 "time"
449 ]
450 },
451 "LogReadOpts": {
452 "type": "object",
453 "properties": {
454 "since": {
455 "description": "Enables basic storage and retrieval of dates and times.",
456 "type": "string",
457 "format": "date-time",
458 "coerce-date": true
459 },
460 "limit": {
461 "minimum": 1,
462 "maximum": 10000,
463 "type": "number"
464 },
465 "follow": {
466 "type": "boolean"
467 },
468 "nextToken": {
469 "description": "Continuation token (received in response)",
470 "minLength": 1,
471 "type": "string"
472 }
473 },
474 "propertyOrder": [
475 "since",
476 "limit",
477 "follow",
478 "nextToken"
479 ],
480 "required": [
481 "follow",
482 "limit",
483 "since"
484 ]
485 },
486 "LogsResponse": {
487 "type": "object",
488 "properties": {
489 "records": {
490 "type": "array",
491 "items": {
492 "$ref": "#/definitions/LogRecord"
493 }
494 },
495 "nextToken": {
496 "minLength": 1,
497 "type": "string"
498 }
499 },
500 "propertyOrder": [
501 "records",
502 "nextToken"
503 ],
504 "required": [
505 "records"
506 ]
507 },
508 "CreateTicketResponse": {
509 "type": "object",
510 "properties": {
511 "ticket": {
512 "minLength": 1,
513 "type": "string"
514 },
515 "expires": {
516 "description": "Pattern as supported by the ms package",
517 "minLength": 1,
518 "type": "string"
519 }
520 },
521 "propertyOrder": [
522 "ticket",
523 "expires"
524 ],
525 "required": [
526 "expires",
527 "ticket"
528 ]
529 },
530 "TryTemplateResponse": {
531 "type": "object",
532 "properties": {
533 "token": {
534 "minLength": 1,
535 "type": "string"
536 },
537 "expiresAt": {
538 "description": "Enables basic storage and retrieval of dates and times.",
539 "type": "string",
540 "format": "date-time",
541 "coerce-date": true
542 },
543 "domain": {
544 "minLength": 1,
545 "type": "string"
546 }
547 },
548 "propertyOrder": [
549 "token",
550 "expiresAt",
551 "domain"
552 ],
553 "required": [
554 "domain",
555 "expiresAt",
556 "token"
557 ]
558 },
559 "Lycan": {
560 "type": "object",
561 "properties": {
562 "createTicket": {
563 "description": "Create a ticket for claiming an API key",
564 "type": "object",
565 "properties": {
566 "params": {
567 "type": "object",
568 "properties": {}
569 },
570 "returns": {
571 "$ref": "#/definitions/CreateTicketResponse"
572 }
573 },
574 "propertyOrder": [
575 "params",
576 "returns"
577 ],
578 "required": [
579 "params",
580 "returns"
581 ]
582 },
583 "claimTicket": {
584 "description": "Returns an API key in exchange for a valid ticket",
585 "type": "object",
586 "properties": {
587 "params": {
588 "type": "object",
589 "properties": {
590 "ticket": {
591 "type": "string"
592 }
593 },
594 "propertyOrder": [
595 "ticket"
596 ],
597 "required": [
598 "ticket"
599 ]
600 },
601 "throws": {
602 "$ref": "#/definitions/NotFoundError"
603 },
604 "returns": {
605 "type": "string"
606 }
607 },
608 "propertyOrder": [
609 "params",
610 "throws",
611 "returns"
612 ],
613 "required": [
614 "params",
615 "returns",
616 "throws"
617 ]
618 },
619 "listTemplates": {
620 "type": "object",
621 "properties": {
622 "params": {
623 "type": "object",
624 "properties": {}
625 },
626 "returns": {
627 "type": "array",
628 "items": {
629 "$ref": "#/definitions/Template"
630 }
631 }
632 },
633 "propertyOrder": [
634 "params",
635 "returns"
636 ],
637 "required": [
638 "params",
639 "returns"
640 ]
641 },
642 "tryTemplate": {
643 "description": "Returns a JWT token for claiming the live template\nwith claimApp",
644 "type": "object",
645 "properties": {
646 "params": {
647 "type": "object",
648 "properties": {
649 "id": {
650 "minLength": 1,
651 "type": "string"
652 }
653 },
654 "propertyOrder": [
655 "id"
656 ],
657 "required": [
658 "id"
659 ]
660 },
661 "throws": {
662 "$ref": "#/definitions/NotFoundError"
663 },
664 "returns": {
665 "$ref": "#/definitions/TryTemplateResponse"
666 }
667 },
668 "propertyOrder": [
669 "params",
670 "throws",
671 "returns"
672 ],
673 "required": [
674 "params",
675 "returns",
676 "throws"
677 ]
678 },
679 "whoami": {
680 "type": "object",
681 "properties": {
682 "params": {
683 "type": "object",
684 "properties": {}
685 },
686 "returns": {
687 "$ref": "#/definitions/User"
688 },
689 "throws": {
690 "$ref": "#/definitions/UnauthorizedError"
691 }
692 },
693 "propertyOrder": [
694 "params",
695 "returns",
696 "throws"
697 ],
698 "required": [
699 "params",
700 "returns",
701 "throws"
702 ]
703 },
704 "listApps": {
705 "type": "object",
706 "properties": {
707 "params": {
708 "type": "object",
709 "properties": {}
710 },
711 "throws": {
712 "$ref": "#/definitions/UnauthorizedError"
713 },
714 "returns": {
715 "type": "array",
716 "items": {
717 "$ref": "#/definitions/Application"
718 }
719 }
720 },
721 "propertyOrder": [
722 "params",
723 "throws",
724 "returns"
725 ],
726 "required": [
727 "params",
728 "returns",
729 "throws"
730 ]
731 },
732 "deployInitial": {
733 "type": "object",
734 "properties": {
735 "params": {
736 "type": "object",
737 "properties": {
738 "env": {
739 "pattern": "^[A-Za-z][A-Za-z_\\d]{0,49}$",
740 "type": "string"
741 },
742 "name": {
743 "minLength": 1,
744 "type": "string"
745 },
746 "digest": {
747 "minLength": 1,
748 "type": "string"
749 },
750 "envVars": {
751 "type": "array",
752 "items": {
753 "type": "array",
754 "items": [
755 {
756 "type": "string"
757 },
758 {
759 "type": "string"
760 }
761 ],
762 "minItems": 2,
763 "additionalItems": {
764 "anyOf": [
765 {
766 "type": "string"
767 },
768 {
769 "type": "string"
770 }
771 ]
772 }
773 }
774 }
775 },
776 "propertyOrder": [
777 "env",
778 "name",
779 "digest",
780 "envVars"
781 ],
782 "required": [
783 "digest",
784 "env",
785 "envVars",
786 "name"
787 ]
788 },
789 "throws": {
790 "anyOf": [
791 {
792 "$ref": "#/definitions/UnauthorizedError"
793 },
794 {
795 "$ref": "#/definitions/ExistsError"
796 }
797 ]
798 },
799 "returns": {
800 "$ref": "#/definitions/Application"
801 }
802 },
803 "propertyOrder": [
804 "params",
805 "throws",
806 "returns"
807 ],
808 "required": [
809 "params",
810 "returns",
811 "throws"
812 ]
813 },
814 "deploy": {
815 "type": "object",
816 "properties": {
817 "params": {
818 "type": "object",
819 "properties": {
820 "appId": {
821 "minLength": 1,
822 "type": "string"
823 },
824 "env": {
825 "pattern": "^[A-Za-z][A-Za-z_\\d]{0,49}$",
826 "type": "string"
827 },
828 "digest": {
829 "minLength": 1,
830 "type": "string"
831 },
832 "envVars": {
833 "type": "array",
834 "items": {
835 "type": "array",
836 "items": [
837 {
838 "type": "string"
839 },
840 {
841 "type": "string"
842 }
843 ],
844 "minItems": 2,
845 "additionalItems": {
846 "anyOf": [
847 {
848 "type": "string"
849 },
850 {
851 "type": "string"
852 }
853 ]
854 }
855 }
856 }
857 },
858 "propertyOrder": [
859 "appId",
860 "env",
861 "digest",
862 "envVars"
863 ],
864 "required": [
865 "appId",
866 "digest",
867 "env",
868 "envVars"
869 ]
870 },
871 "throws": {
872 "anyOf": [
873 {
874 "$ref": "#/definitions/UnauthorizedError"
875 },
876 {
877 "$ref": "#/definitions/NotFoundError"
878 }
879 ]
880 },
881 "returns": {
882 "$ref": "#/definitions/Application"
883 }
884 },
885 "propertyOrder": [
886 "params",
887 "throws",
888 "returns"
889 ],
890 "required": [
891 "params",
892 "returns",
893 "throws"
894 ]
895 },
896 "claimApp": {
897 "description": "Claim an anonymously deployed app into the user account\nusing the token received from tryTemplate",
898 "type": "object",
899 "properties": {
900 "params": {
901 "type": "object",
902 "properties": {
903 "token": {
904 "minLength": 1,
905 "type": "string"
906 }
907 },
908 "propertyOrder": [
909 "token"
910 ],
911 "required": [
912 "token"
913 ]
914 },
915 "throws": {
916 "anyOf": [
917 {
918 "$ref": "#/definitions/UnauthorizedError"
919 },
920 {
921 "$ref": "#/definitions/NotFoundError"
922 }
923 ]
924 },
925 "returns": {
926 "$ref": "#/definitions/Application"
927 }
928 },
929 "propertyOrder": [
930 "params",
931 "throws",
932 "returns"
933 ],
934 "required": [
935 "params",
936 "returns",
937 "throws"
938 ]
939 },
940 "getLogs": {
941 "type": "object",
942 "properties": {
943 "params": {
944 "type": "object",
945 "properties": {
946 "appId": {
947 "minLength": 1,
948 "type": "string"
949 },
950 "env": {
951 "pattern": "^[A-Za-z][A-Za-z_\\d]{0,49}$",
952 "type": "string"
953 },
954 "opts": {
955 "$ref": "#/definitions/LogReadOpts"
956 }
957 },
958 "propertyOrder": [
959 "appId",
960 "env",
961 "opts"
962 ],
963 "required": [
964 "appId",
965 "env",
966 "opts"
967 ]
968 },
969 "throws": {
970 "anyOf": [
971 {
972 "$ref": "#/definitions/UnauthorizedError"
973 },
974 {
975 "$ref": "#/definitions/NotFoundError"
976 }
977 ]
978 },
979 "returns": {
980 "$ref": "#/definitions/LogsResponse"
981 }
982 },
983 "propertyOrder": [
984 "params",
985 "throws",
986 "returns"
987 ],
988 "required": [
989 "params",
990 "returns",
991 "throws"
992 ]
993 },
994 "destroyApp": {
995 "type": "object",
996 "properties": {
997 "params": {
998 "type": "object",
999 "properties": {
1000 "appId": {
1001 "minLength": 1,
1002 "type": "string"
1003 }
1004 },
1005 "propertyOrder": [
1006 "appId"
1007 ],
1008 "required": [
1009 "appId"
1010 ]
1011 },
1012 "throws": {
1013 "anyOf": [
1014 {
1015 "$ref": "#/definitions/UnauthorizedError"
1016 },
1017 {
1018 "$ref": "#/definitions/NotFoundError"
1019 }
1020 ]
1021 },
1022 "returns": {
1023 "type": "null"
1024 }
1025 },
1026 "propertyOrder": [
1027 "params",
1028 "throws",
1029 "returns"
1030 ],
1031 "required": [
1032 "params",
1033 "returns",
1034 "throws"
1035 ]
1036 }
1037 },
1038 "propertyOrder": [
1039 "createTicket",
1040 "claimTicket",
1041 "listTemplates",
1042 "tryTemplate",
1043 "whoami",
1044 "listApps",
1045 "deployInitial",
1046 "deploy",
1047 "claimApp",
1048 "getLogs",
1049 "destroyApp"
1050 ],
1051 "required": [
1052 "claimApp",
1053 "claimTicket",
1054 "createTicket",
1055 "deploy",
1056 "deployInitial",
1057 "destroyApp",
1058 "getLogs",
1059 "listApps",
1060 "listTemplates",
1061 "tryTemplate",
1062 "whoami"
1063 ]
1064 }
1065 }
1066};
1067class InternalServerError extends Error {
1068 constructor() {
1069 super(...arguments);
1070 this.name = 'InternalServerError';
1071 }
1072}
1073exports.InternalServerError = InternalServerError;
1074class UnauthorizedError extends Error {
1075 constructor() {
1076 super(...arguments);
1077 this.name = 'UnauthorizedError';
1078 }
1079}
1080exports.UnauthorizedError = UnauthorizedError;
1081class NotFoundError extends Error {
1082 constructor() {
1083 super(...arguments);
1084 this.name = 'NotFoundError';
1085 }
1086}
1087exports.NotFoundError = NotFoundError;
1088class ExistsError extends Error {
1089 constructor() {
1090 super(...arguments);
1091 this.name = 'ExistsError';
1092 }
1093}
1094exports.ExistsError = ExistsError;
1095var FunctionRunnerSize;
1096(function (FunctionRunnerSize) {
1097 FunctionRunnerSize["M128MIB"] = "m128MiB";
1098 FunctionRunnerSize["M1GIB"] = "m1GiB";
1099 FunctionRunnerSize["M256MIB"] = "m256MiB";
1100 FunctionRunnerSize["M2GIB"] = "m2GiB";
1101 FunctionRunnerSize["M512MIB"] = "m512MiB";
1102})(FunctionRunnerSize = exports.FunctionRunnerSize || (exports.FunctionRunnerSize = {}));
1103//# sourceMappingURL=interfaces.js.map
\No newline at end of file