UNPKG

280 kBJSONView Raw
1{
2 "metadata": {
3 "toolPackage": "@microsoft/api-extractor",
4 "toolVersion": "7.18.17",
5 "schemaVersion": 1004,
6 "oldestForwardsCompatibleVersion": 1001,
7 "tsdocConfig": {
8 "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
9 "noStandardTags": true,
10 "tagDefinitions": [
11 {
12 "tagName": "@alpha",
13 "syntaxKind": "modifier"
14 },
15 {
16 "tagName": "@beta",
17 "syntaxKind": "modifier"
18 },
19 {
20 "tagName": "@defaultValue",
21 "syntaxKind": "block"
22 },
23 {
24 "tagName": "@decorator",
25 "syntaxKind": "block",
26 "allowMultiple": true
27 },
28 {
29 "tagName": "@deprecated",
30 "syntaxKind": "block"
31 },
32 {
33 "tagName": "@eventProperty",
34 "syntaxKind": "modifier"
35 },
36 {
37 "tagName": "@example",
38 "syntaxKind": "block",
39 "allowMultiple": true
40 },
41 {
42 "tagName": "@experimental",
43 "syntaxKind": "modifier"
44 },
45 {
46 "tagName": "@inheritDoc",
47 "syntaxKind": "inline"
48 },
49 {
50 "tagName": "@internal",
51 "syntaxKind": "modifier"
52 },
53 {
54 "tagName": "@label",
55 "syntaxKind": "inline"
56 },
57 {
58 "tagName": "@link",
59 "syntaxKind": "inline",
60 "allowMultiple": true
61 },
62 {
63 "tagName": "@override",
64 "syntaxKind": "modifier"
65 },
66 {
67 "tagName": "@packageDocumentation",
68 "syntaxKind": "modifier"
69 },
70 {
71 "tagName": "@param",
72 "syntaxKind": "block",
73 "allowMultiple": true
74 },
75 {
76 "tagName": "@privateRemarks",
77 "syntaxKind": "block"
78 },
79 {
80 "tagName": "@public",
81 "syntaxKind": "modifier"
82 },
83 {
84 "tagName": "@readonly",
85 "syntaxKind": "modifier"
86 },
87 {
88 "tagName": "@remarks",
89 "syntaxKind": "block"
90 },
91 {
92 "tagName": "@returns",
93 "syntaxKind": "block"
94 },
95 {
96 "tagName": "@sealed",
97 "syntaxKind": "modifier"
98 },
99 {
100 "tagName": "@see",
101 "syntaxKind": "block"
102 },
103 {
104 "tagName": "@throws",
105 "syntaxKind": "block",
106 "allowMultiple": true
107 },
108 {
109 "tagName": "@typeParam",
110 "syntaxKind": "block",
111 "allowMultiple": true
112 },
113 {
114 "tagName": "@virtual",
115 "syntaxKind": "modifier"
116 },
117 {
118 "tagName": "@betaDocumentation",
119 "syntaxKind": "modifier"
120 },
121 {
122 "tagName": "@internalRemarks",
123 "syntaxKind": "block"
124 },
125 {
126 "tagName": "@preapproved",
127 "syntaxKind": "modifier"
128 }
129 ],
130 "supportForTags": {
131 "@alpha": true,
132 "@beta": true,
133 "@defaultValue": true,
134 "@decorator": true,
135 "@deprecated": true,
136 "@eventProperty": true,
137 "@example": true,
138 "@experimental": true,
139 "@inheritDoc": true,
140 "@internal": true,
141 "@label": true,
142 "@link": true,
143 "@override": true,
144 "@packageDocumentation": true,
145 "@param": true,
146 "@privateRemarks": true,
147 "@public": true,
148 "@readonly": true,
149 "@remarks": true,
150 "@returns": true,
151 "@sealed": true,
152 "@see": true,
153 "@throws": true,
154 "@typeParam": true,
155 "@virtual": true,
156 "@betaDocumentation": true,
157 "@internalRemarks": true,
158 "@preapproved": true
159 }
160 }
161 },
162 "kind": "Package",
163 "canonicalReference": "faastjs!",
164 "docComment": "/**\n * Faast.js transforms ordinary JavaScript modules into serverless cloud functions that can run on AWS Lambda and Google Cloud Functions.\n *\n * The main entry point to faast.js is the {@link faast} function, which returns an object that implements the {@link FaastModule} interface. The most common options are {@link CommonOptions}. Using faast.js requires writing two modules, one containing the functions to upload to the cloud, and the other that invokes faast.js and calls the resulting cloud functions.\n *\n * @packageDocumentation\n */\n",
165 "name": "faastjs",
166 "members": [
167 {
168 "kind": "EntryPoint",
169 "canonicalReference": "faastjs!",
170 "name": "",
171 "members": [
172 {
173 "kind": "TypeAlias",
174 "canonicalReference": "faastjs!Async:type",
175 "docComment": "/**\n * `Async<T>` maps regular values to Promises and Iterators to AsyncIterators, If `T` is already a Promise or an AsyncIterator, it remains the same. This type is used to infer the return value of cloud functions from the types of the functions in the user's input module.\n *\n * @public\n */\n",
176 "excerptTokens": [
177 {
178 "kind": "Content",
179 "text": "export declare type Async<T> = "
180 },
181 {
182 "kind": "Content",
183 "text": "T extends "
184 },
185 {
186 "kind": "Reference",
187 "text": "AsyncGenerator",
188 "canonicalReference": "!AsyncGenerator:interface"
189 },
190 {
191 "kind": "Content",
192 "text": "<infer R> ? "
193 },
194 {
195 "kind": "Reference",
196 "text": "AsyncGenerator",
197 "canonicalReference": "!AsyncGenerator:interface"
198 },
199 {
200 "kind": "Content",
201 "text": "<R> : T extends "
202 },
203 {
204 "kind": "Reference",
205 "text": "Generator",
206 "canonicalReference": "!Generator:interface"
207 },
208 {
209 "kind": "Content",
210 "text": "<infer R> ? "
211 },
212 {
213 "kind": "Reference",
214 "text": "AsyncGenerator",
215 "canonicalReference": "!AsyncGenerator:interface"
216 },
217 {
218 "kind": "Content",
219 "text": "<R> : T extends "
220 },
221 {
222 "kind": "Reference",
223 "text": "Promise",
224 "canonicalReference": "!Promise:interface"
225 },
226 {
227 "kind": "Content",
228 "text": "<infer R> ? "
229 },
230 {
231 "kind": "Reference",
232 "text": "Promise",
233 "canonicalReference": "!Promise:interface"
234 },
235 {
236 "kind": "Content",
237 "text": "<R> : "
238 },
239 {
240 "kind": "Reference",
241 "text": "Promise",
242 "canonicalReference": "!Promise:interface"
243 },
244 {
245 "kind": "Content",
246 "text": "<T>"
247 },
248 {
249 "kind": "Content",
250 "text": ";"
251 }
252 ],
253 "releaseTag": "Public",
254 "name": "Async",
255 "typeParameters": [
256 {
257 "typeParameterName": "T",
258 "constraintTokenRange": {
259 "startIndex": 0,
260 "endIndex": 0
261 },
262 "defaultTypeTokenRange": {
263 "startIndex": 0,
264 "endIndex": 0
265 }
266 }
267 ],
268 "typeTokenRange": {
269 "startIndex": 1,
270 "endIndex": 16
271 }
272 },
273 {
274 "kind": "TypeAlias",
275 "canonicalReference": "faastjs!AsyncDetail:type",
276 "docComment": "/**\n * `AsyncDetail<T>` is similar to {@link Async} except it maps retun values R to `Detail<R>`, which is the return value with additional information about each cloud function invocation.\n *\n * @public\n */\n",
277 "excerptTokens": [
278 {
279 "kind": "Content",
280 "text": "export declare type AsyncDetail<T> = "
281 },
282 {
283 "kind": "Content",
284 "text": "T extends "
285 },
286 {
287 "kind": "Reference",
288 "text": "AsyncGenerator",
289 "canonicalReference": "!AsyncGenerator:interface"
290 },
291 {
292 "kind": "Content",
293 "text": "<infer R> ? "
294 },
295 {
296 "kind": "Reference",
297 "text": "AsyncGenerator",
298 "canonicalReference": "!AsyncGenerator:interface"
299 },
300 {
301 "kind": "Content",
302 "text": "<"
303 },
304 {
305 "kind": "Reference",
306 "text": "Detail",
307 "canonicalReference": "faastjs!Detail:interface"
308 },
309 {
310 "kind": "Content",
311 "text": "<R>> : T extends "
312 },
313 {
314 "kind": "Reference",
315 "text": "Generator",
316 "canonicalReference": "!Generator:interface"
317 },
318 {
319 "kind": "Content",
320 "text": "<infer R> ? "
321 },
322 {
323 "kind": "Reference",
324 "text": "AsyncGenerator",
325 "canonicalReference": "!AsyncGenerator:interface"
326 },
327 {
328 "kind": "Content",
329 "text": "<"
330 },
331 {
332 "kind": "Reference",
333 "text": "Detail",
334 "canonicalReference": "faastjs!Detail:interface"
335 },
336 {
337 "kind": "Content",
338 "text": "<R>> : T extends "
339 },
340 {
341 "kind": "Reference",
342 "text": "Promise",
343 "canonicalReference": "!Promise:interface"
344 },
345 {
346 "kind": "Content",
347 "text": "<infer R> ? "
348 },
349 {
350 "kind": "Reference",
351 "text": "Promise",
352 "canonicalReference": "!Promise:interface"
353 },
354 {
355 "kind": "Content",
356 "text": "<"
357 },
358 {
359 "kind": "Reference",
360 "text": "Detail",
361 "canonicalReference": "faastjs!Detail:interface"
362 },
363 {
364 "kind": "Content",
365 "text": "<R>> : "
366 },
367 {
368 "kind": "Reference",
369 "text": "Promise",
370 "canonicalReference": "!Promise:interface"
371 },
372 {
373 "kind": "Content",
374 "text": "<"
375 },
376 {
377 "kind": "Reference",
378 "text": "Detail",
379 "canonicalReference": "faastjs!Detail:interface"
380 },
381 {
382 "kind": "Content",
383 "text": "<T>>"
384 },
385 {
386 "kind": "Content",
387 "text": ";"
388 }
389 ],
390 "releaseTag": "Public",
391 "name": "AsyncDetail",
392 "typeParameters": [
393 {
394 "typeParameterName": "T",
395 "constraintTokenRange": {
396 "startIndex": 0,
397 "endIndex": 0
398 },
399 "defaultTypeTokenRange": {
400 "startIndex": 0,
401 "endIndex": 0
402 }
403 }
404 ],
405 "typeTokenRange": {
406 "startIndex": 1,
407 "endIndex": 24
408 }
409 },
410 {
411 "kind": "TypeAlias",
412 "canonicalReference": "faastjs!AwsFaastModule:type",
413 "docComment": "/**\n * The return type of {@link faastAws}. See {@link FaastModuleProxy}.\n *\n * @public\n */\n",
414 "excerptTokens": [
415 {
416 "kind": "Content",
417 "text": "export declare type AwsFaastModule<M extends "
418 },
419 {
420 "kind": "Content",
421 "text": "object "
422 },
423 {
424 "kind": "Content",
425 "text": "= "
426 },
427 {
428 "kind": "Content",
429 "text": "object"
430 },
431 {
432 "kind": "Content",
433 "text": "> = "
434 },
435 {
436 "kind": "Reference",
437 "text": "FaastModuleProxy",
438 "canonicalReference": "faastjs!FaastModuleProxy:class"
439 },
440 {
441 "kind": "Content",
442 "text": "<M, "
443 },
444 {
445 "kind": "Reference",
446 "text": "AwsOptions",
447 "canonicalReference": "faastjs!AwsOptions:interface"
448 },
449 {
450 "kind": "Content",
451 "text": ", "
452 },
453 {
454 "kind": "Reference",
455 "text": "AwsState",
456 "canonicalReference": "faastjs!AwsState:interface"
457 },
458 {
459 "kind": "Content",
460 "text": ">"
461 },
462 {
463 "kind": "Content",
464 "text": ";"
465 }
466 ],
467 "releaseTag": "Public",
468 "name": "AwsFaastModule",
469 "typeParameters": [
470 {
471 "typeParameterName": "M",
472 "constraintTokenRange": {
473 "startIndex": 1,
474 "endIndex": 2
475 },
476 "defaultTypeTokenRange": {
477 "startIndex": 3,
478 "endIndex": 4
479 }
480 }
481 ],
482 "typeTokenRange": {
483 "startIndex": 5,
484 "endIndex": 11
485 }
486 },
487 {
488 "kind": "Interface",
489 "canonicalReference": "faastjs!AwsOptions:interface",
490 "docComment": "/**\n * AWS-specific options for {@link faastAws}.\n *\n * @public\n */\n",
491 "excerptTokens": [
492 {
493 "kind": "Content",
494 "text": "export interface AwsOptions extends "
495 },
496 {
497 "kind": "Reference",
498 "text": "CommonOptions",
499 "canonicalReference": "faastjs!CommonOptions:interface"
500 },
501 {
502 "kind": "Content",
503 "text": " "
504 }
505 ],
506 "releaseTag": "Public",
507 "name": "AwsOptions",
508 "members": [
509 {
510 "kind": "PropertySignature",
511 "canonicalReference": "faastjs!AwsOptions#awsConfig:member",
512 "docComment": "/**\n * Additional options to pass to all AWS services. See {@link https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html | AWS.Config}.\n *\n * @remarks\n *\n * If you need to specify AWS options such as credentials, you can pass set these options here. Note that faast.js will override some options even if they are specified here, specifically the options used to create the `Lambda` service, to ensure they allow for faast to function correctly. Options set in {@link CommonOptions} override those set here.\n *\n * Example of passing in credentials:\n * ```typescript\n * const credentials = { accessKeyId, secretAccessKey };\n * const m = await faastAws(funcs, { credentials });\n * ```\n *\n */\n",
513 "excerptTokens": [
514 {
515 "kind": "Content",
516 "text": "awsConfig?: "
517 },
518 {
519 "kind": "Reference",
520 "text": "ConfigurationOptions",
521 "canonicalReference": "aws-sdk!ConfigurationOptions:class"
522 },
523 {
524 "kind": "Content",
525 "text": ";"
526 }
527 ],
528 "isOptional": true,
529 "releaseTag": "Public",
530 "name": "awsConfig",
531 "propertyTypeTokenRange": {
532 "startIndex": 1,
533 "endIndex": 2
534 }
535 },
536 {
537 "kind": "PropertySignature",
538 "canonicalReference": "faastjs!AwsOptions#awsLambdaOptions:member",
539 "docComment": "/**\n * Additional options to pass to AWS Lambda creation. See {@link https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html | CreateFunction}.\n *\n * @remarks\n *\n * If you need specialized options, you can pass them to the AWS Lambda SDK directly. Note that if you override any settings set by faast.js, you may cause faast.js to not work:\n * ```typescript\n * const request: aws.Lambda.CreateFunctionRequest = {\n * FunctionName,\n * Role,\n * Runtime: \"nodejs14.x\",\n * Handler: \"index.trampoline\",\n * Code,\n * Description: \"faast trampoline function\",\n * Timeout,\n * MemorySize,\n * ...awsLambdaOptions\n * };\n * ```\n *\n */\n",
540 "excerptTokens": [
541 {
542 "kind": "Content",
543 "text": "awsLambdaOptions?: "
544 },
545 {
546 "kind": "Reference",
547 "text": "Partial",
548 "canonicalReference": "!Partial:type"
549 },
550 {
551 "kind": "Content",
552 "text": "<"
553 },
554 {
555 "kind": "Reference",
556 "text": "Lambda.CreateFunctionRequest",
557 "canonicalReference": "aws-sdk!~Lambda.CreateFunctionRequest:interface"
558 },
559 {
560 "kind": "Content",
561 "text": ">"
562 },
563 {
564 "kind": "Content",
565 "text": ";"
566 }
567 ],
568 "isOptional": true,
569 "releaseTag": "Public",
570 "name": "awsLambdaOptions",
571 "propertyTypeTokenRange": {
572 "startIndex": 1,
573 "endIndex": 5
574 }
575 },
576 {
577 "kind": "PropertySignature",
578 "canonicalReference": "faastjs!AwsOptions#region:member",
579 "docComment": "/**\n * The region to create resources in. Garbage collection is also limited to this region. Default: `\"us-west-2\"`.\n */\n",
580 "excerptTokens": [
581 {
582 "kind": "Content",
583 "text": "region?: "
584 },
585 {
586 "kind": "Reference",
587 "text": "AwsRegion",
588 "canonicalReference": "faastjs!AwsRegion:type"
589 },
590 {
591 "kind": "Content",
592 "text": ";"
593 }
594 ],
595 "isOptional": true,
596 "releaseTag": "Public",
597 "name": "region",
598 "propertyTypeTokenRange": {
599 "startIndex": 1,
600 "endIndex": 2
601 }
602 },
603 {
604 "kind": "PropertySignature",
605 "canonicalReference": "faastjs!AwsOptions#RoleName:member",
606 "docComment": "/**\n * The role that the lambda function will assume when executing user code. Default: `\"faast-cached-lambda-role\"`. Rarely used.\n *\n * @remarks\n *\n * When a lambda executes, it first assumes an {@link https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html | execution role} to grant access to resources.\n *\n * By default, faast.js creates this execution role for you and leaves it permanently in your account (the role is shared across all lambda functions created by faast.js). By default, faast.js grants administrator privileges to this role so your code can perform any AWS operation it requires.\n *\n * You can {@link https://console.aws.amazon.com/iam/home#/roles | create a custom role} that specifies more limited permissions if you prefer not to grant administrator privileges. Any role you assign for faast.js modules needs at least the following permissions:\n *\n * - Execution Role:\n * ```json\n * {\n * \"Version\": \"2012-10-17\",\n * \"Statement\": [\n * {\n * \"Effect\": \"Allow\",\n * \"Action\": [\"logs:*\"],\n * \"Resource\": \"arn:aws:logs:*:*:log-group:faast-*\"\n * },\n * {\n * \"Effect\": \"Allow\",\n * \"Action\": [\"sqs:*\"],\n * \"Resource\": \"arn:aws:sqs:*:*:faast-*\"\n * }\n * ]\n * }\n * ```\n *\n * - Trust relationship (also known as `AssumeRolePolicyDocument` in the AWS SDK):\n * ```json\n * {\n * \"Version\": \"2012-10-17\",\n * \"Statement\": [\n * {\n * \"Effect\": \"Allow\",\n * \"Principal\": {\n * \"Service\": \"lambda.amazonaws.com\"\n * },\n * \"Action\": \"sts:AssumeRole\"\n * }\n * ]\n * }\n * ```\n *\n */\n",
607 "excerptTokens": [
608 {
609 "kind": "Content",
610 "text": "RoleName?: "
611 },
612 {
613 "kind": "Content",
614 "text": "string"
615 },
616 {
617 "kind": "Content",
618 "text": ";"
619 }
620 ],
621 "isOptional": true,
622 "releaseTag": "Public",
623 "name": "RoleName",
624 "propertyTypeTokenRange": {
625 "startIndex": 1,
626 "endIndex": 2
627 }
628 }
629 ],
630 "extendsTokenRanges": [
631 {
632 "startIndex": 1,
633 "endIndex": 3
634 }
635 ]
636 },
637 {
638 "kind": "TypeAlias",
639 "canonicalReference": "faastjs!AwsRegion:type",
640 "docComment": "/**\n * Valid AWS {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html | regions}. Not all of these regions have Lambda support.\n *\n * @public\n */\n",
641 "excerptTokens": [
642 {
643 "kind": "Content",
644 "text": "export declare type AwsRegion = "
645 },
646 {
647 "kind": "Content",
648 "text": "\"us-east-1\" | \"us-east-2\" | \"us-west-1\" | \"us-west-2\" | \"ca-central-1\" | \"eu-central-1\" | \"eu-west-1\" | \"eu-west-2\" | \"eu-west-3\" | \"ap-northeast-1\" | \"ap-northeast-2\" | \"ap-northeast-3\" | \"ap-southeast-1\" | \"ap-southeast-2\" | \"ap-south-1\" | \"sa-east-1\""
649 },
650 {
651 "kind": "Content",
652 "text": ";"
653 }
654 ],
655 "releaseTag": "Public",
656 "name": "AwsRegion",
657 "typeTokenRange": {
658 "startIndex": 1,
659 "endIndex": 2
660 }
661 },
662 {
663 "kind": "Interface",
664 "canonicalReference": "faastjs!CleanupOptions:interface",
665 "docComment": "/**\n * Options that apply to the {@link FaastModule.cleanup} method.\n *\n * @public\n */\n",
666 "excerptTokens": [
667 {
668 "kind": "Content",
669 "text": "export interface CleanupOptions "
670 }
671 ],
672 "releaseTag": "Public",
673 "name": "CleanupOptions",
674 "members": [
675 {
676 "kind": "PropertySignature",
677 "canonicalReference": "faastjs!CleanupOptions#deleteCaches:member",
678 "docComment": "/**\n * If true, delete cached resources. Default: false.\n *\n * @remarks\n *\n * Some resources are cached persistently between calls for performance reasons. If this option is set to true, these cached resources are deleted when cleanup occurs, instead of being left behind for future use. For example, on AWS this includes the Lambda Layers that are created for {@link CommonOptions.packageJson} dependencies. Note that only the cached resources created by this instance of FaastModule are deleted, not cached resources from other FaastModules. This is similar to setting `useCachedDependencies` to `false` during function construction, except `deleteCaches` can be set at function cleanup time, and any other FaastModules created before cleanup may use the cached Layers.\n */\n",
679 "excerptTokens": [
680 {
681 "kind": "Content",
682 "text": "deleteCaches?: "
683 },
684 {
685 "kind": "Content",
686 "text": "boolean"
687 },
688 {
689 "kind": "Content",
690 "text": ";"
691 }
692 ],
693 "isOptional": true,
694 "releaseTag": "Public",
695 "name": "deleteCaches",
696 "propertyTypeTokenRange": {
697 "startIndex": 1,
698 "endIndex": 2
699 }
700 },
701 {
702 "kind": "PropertySignature",
703 "canonicalReference": "faastjs!CleanupOptions#deleteResources:member",
704 "docComment": "/**\n * If true, delete provider cloud resources. Default: true.\n *\n * @remarks\n *\n * The cleanup operation has two functions: stopping the faast.js runtime and deleting cloud resources that were instantiated. If `deleteResources` is false, then only the runtime is stopped and no cloud resources are deleted. This can be useful for debugging and examining the state of resources created by faast.js.\n *\n * It is supported to call {@link FaastModule.cleanup} twice: once with `deleteResources` set to `false`, which only stops the runtime, and then again set to `true` to delete resources. This can be useful for testing.\n */\n",
705 "excerptTokens": [
706 {
707 "kind": "Content",
708 "text": "deleteResources?: "
709 },
710 {
711 "kind": "Content",
712 "text": "boolean"
713 },
714 {
715 "kind": "Content",
716 "text": ";"
717 }
718 ],
719 "isOptional": true,
720 "releaseTag": "Public",
721 "name": "deleteResources",
722 "propertyTypeTokenRange": {
723 "startIndex": 1,
724 "endIndex": 2
725 }
726 },
727 {
728 "kind": "PropertySignature",
729 "canonicalReference": "faastjs!CleanupOptions#gcTimeout:member",
730 "docComment": "/**\n * Number of seconds to wait for garbage collection. Default: 10.\n *\n * @remarks\n *\n * Garbage collection can still be operating when cleanup is called; this option limits the amount of time faast waits for the garbage collector. If set to 0, the wait is unlimited.\n */\n",
731 "excerptTokens": [
732 {
733 "kind": "Content",
734 "text": "gcTimeout?: "
735 },
736 {
737 "kind": "Content",
738 "text": "number"
739 },
740 {
741 "kind": "Content",
742 "text": ";"
743 }
744 ],
745 "isOptional": true,
746 "releaseTag": "Public",
747 "name": "gcTimeout",
748 "propertyTypeTokenRange": {
749 "startIndex": 1,
750 "endIndex": 2
751 }
752 }
753 ],
754 "extendsTokenRanges": []
755 },
756 {
757 "kind": "Interface",
758 "canonicalReference": "faastjs!CommonOptions:interface",
759 "docComment": "/**\n * Options common across all faast.js providers. Used as argument to {@link faast}.\n *\n * @remarks\n *\n * There are also more specific options for each provider. See {@link AwsOptions}, {@link GoogleOptions}, and {@link LocalOptions}.\n *\n * @public\n */\n",
760 "excerptTokens": [
761 {
762 "kind": "Content",
763 "text": "export interface CommonOptions "
764 }
765 ],
766 "releaseTag": "Public",
767 "name": "CommonOptions",
768 "members": [
769 {
770 "kind": "PropertySignature",
771 "canonicalReference": "faastjs!CommonOptions#childProcess:member",
772 "docComment": "/**\n * If true, create a child process to isolate user code from faast scaffolding. Default: true.\n *\n * @remarks\n *\n * If a child process is not created, faast runs in the same node instance as the user code and may not execute in a timely fashion because user code may {@link https://nodejs.org/en/docs/guides/dont-block-the-event-loop/ | block the event loop}. Creating a child process for user code allows faast.js to continue executing even if user code never yields. This provides better reliability and functionality:\n *\n * - Detect timeout errors more reliably, even if the function doesn't relinquish the CPU. Not applicable to AWS, which sends separate failure messages in case of timeout. See {@link CommonOptions.timeout}.\n *\n * - CPU metrics used for detecting invocations with high latency, which can be used for automatically retrying calls to reduce tail latency.\n *\n * The cost of creating a child process is mainly in the memory overhead of creating another node process.\n */\n",
773 "excerptTokens": [
774 {
775 "kind": "Content",
776 "text": "childProcess?: "
777 },
778 {
779 "kind": "Content",
780 "text": "boolean"
781 },
782 {
783 "kind": "Content",
784 "text": ";"
785 }
786 ],
787 "isOptional": true,
788 "releaseTag": "Public",
789 "name": "childProcess",
790 "propertyTypeTokenRange": {
791 "startIndex": 1,
792 "endIndex": 2
793 }
794 },
795 {
796 "kind": "PropertySignature",
797 "canonicalReference": "faastjs!CommonOptions#concurrency:member",
798 "docComment": "/**\n * The maximum number of concurrent invocations to allow. Default: 100, except for the `local` provider, where the default is 10.\n *\n * @remarks\n *\n * The concurrency limit applies to all invocations of all of the faast functions summed together. It is not a per-function limit. To apply a per-function limit, use {@link throttle}. A value of 0 is equivalent to Infinity. A value of 1 ensures mutually exclusive invocations.\n */\n",
799 "excerptTokens": [
800 {
801 "kind": "Content",
802 "text": "concurrency?: "
803 },
804 {
805 "kind": "Content",
806 "text": "number"
807 },
808 {
809 "kind": "Content",
810 "text": ";"
811 }
812 ],
813 "isOptional": true,
814 "releaseTag": "Public",
815 "name": "concurrency",
816 "propertyTypeTokenRange": {
817 "startIndex": 1,
818 "endIndex": 2
819 }
820 },
821 {
822 "kind": "PropertySignature",
823 "canonicalReference": "faastjs!CommonOptions#description:member",
824 "docComment": "/**\n * A user-supplied description for this function, which may make it easier to track different functions when multiple functions are created.\n */\n",
825 "excerptTokens": [
826 {
827 "kind": "Content",
828 "text": "description?: "
829 },
830 {
831 "kind": "Content",
832 "text": "string"
833 },
834 {
835 "kind": "Content",
836 "text": ";"
837 }
838 ],
839 "isOptional": true,
840 "releaseTag": "Public",
841 "name": "description",
842 "propertyTypeTokenRange": {
843 "startIndex": 1,
844 "endIndex": 2
845 }
846 },
847 {
848 "kind": "PropertySignature",
849 "canonicalReference": "faastjs!CommonOptions#env:member",
850 "docComment": "/**\n * Environment variables available during serverless function execution. Default: \\{\\}.\n */\n",
851 "excerptTokens": [
852 {
853 "kind": "Content",
854 "text": "env?: "
855 },
856 {
857 "kind": "Content",
858 "text": "{\n [key: string]: string;\n }"
859 },
860 {
861 "kind": "Content",
862 "text": ";"
863 }
864 ],
865 "isOptional": true,
866 "releaseTag": "Public",
867 "name": "env",
868 "propertyTypeTokenRange": {
869 "startIndex": 1,
870 "endIndex": 2
871 }
872 },
873 {
874 "kind": "PropertySignature",
875 "canonicalReference": "faastjs!CommonOptions#exclude:member",
876 "docComment": "/**\n * Exclude a subset of files included by {@link CommonOptions.include}.\n *\n * @remarks\n *\n * The exclusion can be a directory or glob. Exclusions apply to all included entries.\n */\n",
877 "excerptTokens": [
878 {
879 "kind": "Content",
880 "text": "exclude?: "
881 },
882 {
883 "kind": "Content",
884 "text": "string[]"
885 },
886 {
887 "kind": "Content",
888 "text": ";"
889 }
890 ],
891 "isOptional": true,
892 "releaseTag": "Public",
893 "name": "exclude",
894 "propertyTypeTokenRange": {
895 "startIndex": 1,
896 "endIndex": 2
897 }
898 },
899 {
900 "kind": "PropertySignature",
901 "canonicalReference": "faastjs!CommonOptions#gc:member",
902 "docComment": "/**\n * Garbage collector mode. Default: `\"auto\"`.\n *\n * @remarks\n *\n * Garbage collection deletes resources that were created by previous instantiations of faast that were not cleaned up by {@link FaastModule.cleanup}, either because it was not called or because the process terminated and did not execute this cleanup step. In `\"auto\"` mode, garbage collection may be throttled to run up to once per hour no matter how many faast.js instances are created. In `\"force\"` mode, garbage collection is run without regard to whether another gc has already been performed recently. In `\"off\"` mode, garbage collection is skipped entirely. This can be useful for performance-sensitive tests, or for more control over when gc is performed.\n *\n * Garbage collection is cloud-specific, but in general garbage collection should not interfere with the behavior or performance of faast cloud functions. When {@link FaastModule.cleanup} runs, it waits for garbage collection to complete. Therefore the cleanup step can in some circumstances take a significant amount of time even after all invocations have returned.\n *\n * It is generally recommended to leave garbage collection in `\"auto\"` mode, otherwise garbage resources may accumulate over time and you will eventually hit resource limits on your account.\n *\n * Also see {@link CommonOptions.retentionInDays}.\n */\n",
903 "excerptTokens": [
904 {
905 "kind": "Content",
906 "text": "gc?: "
907 },
908 {
909 "kind": "Content",
910 "text": "\"auto\" | \"force\" | \"off\""
911 },
912 {
913 "kind": "Content",
914 "text": ";"
915 }
916 ],
917 "isOptional": true,
918 "releaseTag": "Public",
919 "name": "gc",
920 "propertyTypeTokenRange": {
921 "startIndex": 1,
922 "endIndex": 2
923 }
924 },
925 {
926 "kind": "PropertySignature",
927 "canonicalReference": "faastjs!CommonOptions#include:member",
928 "docComment": "/**\n * Include files to make available in the remote function. See {@link IncludeOption}.\n *\n * @remarks\n *\n * Each include entry is a directory or glob pattern. Paths can be specified as relative or absolute paths. Relative paths are resolved relative to the current working directory, or relative to the `cwd` option.\n *\n * If the include entry is a directory `\"foo/bar\"`, the directory `\"./foo/bar\"` will be available in the cloud function. Directories are recursively added.\n *\n * Glob patterns use the syntax of {@link https://github.com/isaacs/node-glob | node glob}.\n *\n * Also see {@link CommonOptions.exclude} for file exclusions.\n */\n",
929 "excerptTokens": [
930 {
931 "kind": "Content",
932 "text": "include?: "
933 },
934 {
935 "kind": "Content",
936 "text": "(string | "
937 },
938 {
939 "kind": "Reference",
940 "text": "IncludeOption",
941 "canonicalReference": "faastjs!IncludeOption:interface"
942 },
943 {
944 "kind": "Content",
945 "text": ")[]"
946 },
947 {
948 "kind": "Content",
949 "text": ";"
950 }
951 ],
952 "isOptional": true,
953 "releaseTag": "Public",
954 "name": "include",
955 "propertyTypeTokenRange": {
956 "startIndex": 1,
957 "endIndex": 4
958 }
959 },
960 {
961 "kind": "PropertySignature",
962 "canonicalReference": "faastjs!CommonOptions#maxRetries:member",
963 "docComment": "/**\n * Maximum number of times that faast will retry each invocation. Default: 2 (invocations can therefore be attemped 3 times in total).\n *\n * @remarks\n *\n * Retries are automatically attempted for transient infrastructure-level failures such as rate limits or netowrk failures. User-level exceptions are not retried automatically. In addition to retries performed by faast, some providers automatically attempt retries. These are not controllable by faast. But as a result, your function may be retried many more times than this setting suggests.\n */\n",
964 "excerptTokens": [
965 {
966 "kind": "Content",
967 "text": "maxRetries?: "
968 },
969 {
970 "kind": "Content",
971 "text": "number"
972 },
973 {
974 "kind": "Content",
975 "text": ";"
976 }
977 ],
978 "isOptional": true,
979 "releaseTag": "Public",
980 "name": "maxRetries",
981 "propertyTypeTokenRange": {
982 "startIndex": 1,
983 "endIndex": 2
984 }
985 },
986 {
987 "kind": "PropertySignature",
988 "canonicalReference": "faastjs!CommonOptions#memorySize:member",
989 "docComment": "/**\n * Memory limit for each function in MB. This setting has an effect on pricing. Default varies by provider.\n *\n * @remarks\n *\n * Each provider has different settings for memory size, and performance varies depending on the setting. By default faast picks a likely optimal value for each provider.\n *\n * - aws: 1728MB\n *\n * - google: 1024MB\n *\n * - local: 512MB (however, memory size limits aren't reliable in local mode.)\n */\n",
990 "excerptTokens": [
991 {
992 "kind": "Content",
993 "text": "memorySize?: "
994 },
995 {
996 "kind": "Content",
997 "text": "number"
998 },
999 {
1000 "kind": "Content",
1001 "text": ";"
1002 }
1003 ],
1004 "isOptional": true,
1005 "releaseTag": "Public",
1006 "name": "memorySize",
1007 "propertyTypeTokenRange": {
1008 "startIndex": 1,
1009 "endIndex": 2
1010 }
1011 },
1012 {
1013 "kind": "PropertySignature",
1014 "canonicalReference": "faastjs!CommonOptions#mode:member",
1015 "docComment": "/**\n * Specify invocation mode. Default: `\"auto\"`.\n *\n * @remarks\n *\n * Modes specify how invocations are triggered. In https mode, the functions are invoked through an https request or the provider's API. In queue mode, a provider-specific queue is used to invoke functions. Queue mode adds additional latency and (usually negligible) cost, but may scale better for some providers. In auto mode the best default is chosen for each provider depending on its particular performance characteristics.\n *\n * The defaults are:\n *\n * - aws: `\"auto\"` is `\"https\"`. In https mode, the AWS SDK api is used to invoke functions. In queue mode, an AWS SNS topic is created and triggers invocations. The AWS API Gateway service is never used by faast, as it incurs a higher cost and is not needed to trigger invocations.\n *\n * - google: `\"auto\"` is `\"https\"`. In https mode, a PUT request is made to invoke the cloud function. In queue mode, a PubSub topic is created to invoke functions.\n *\n * - local: The local provider ignores the mode setting and always uses an internal asynchronous queue to schedule calls.\n *\n * Size limits are affected by the choice of mode. On AWS the limit is 256kb for arguments and return values in `\"queue\"` mode, and 6MB for `\"https\"` mode. For Google the limit is 10MB regardless of mode. In Local mode messages are sent via node's IPC and are subject to OS IPC limits.\n *\n * Note that no matter which mode is selected, faast.js always creates a queue for sending back intermediate results for bookeeping and performance monitoring.\n */\n",
1016 "excerptTokens": [
1017 {
1018 "kind": "Content",
1019 "text": "mode?: "
1020 },
1021 {
1022 "kind": "Content",
1023 "text": "\"https\" | \"queue\" | \"auto\""
1024 },
1025 {
1026 "kind": "Content",
1027 "text": ";"
1028 }
1029 ],
1030 "isOptional": true,
1031 "releaseTag": "Public",
1032 "name": "mode",
1033 "propertyTypeTokenRange": {
1034 "startIndex": 1,
1035 "endIndex": 2
1036 }
1037 },
1038 {
1039 "kind": "PropertySignature",
1040 "canonicalReference": "faastjs!CommonOptions#packageJson:member",
1041 "docComment": "/**\n * Specify a package.json file to include with the code package.\n *\n * @remarks\n *\n * By default, faast.js will use webpack to bundle dependencies your remote module imports. In normal usage there is no need to specify a separate package.json, as webpack will statically analyze your imports and determine which files to bundle.\n *\n * However, there are some use cases where this is not enough. For example, some dependencies contain native code compiled during installation, and webpack cannot bundle these native modules. such as dependencies with native code. or are specifically not designed to work with webpack. In these cases, you can create a separate `package.json` for these dependencies and pass the filename as the `packageJson` option. If `packageJson` is an `object`, it is assumed to be a parsed JSON object with the same structure as a package.json file (useful for specifying a synthetic `package.json` directly in code).\n *\n * The way the `packageJson` is handled varies by provider:\n *\n * - local: Runs `npm install` in a temporary directory it prepares for the function.\n *\n * - google: uses Google Cloud Function's {@link https://cloud.google.com/functions/docs/writing/specifying-dependencies-nodejs | native support for package.json}.\n *\n * - aws: Recursively calls faast.js to run `npm install` inside a separate lambda function specifically created for this purpose. Faast.js uses lambda to install dependencies to ensure that native dependencies are compiled in an environment that can produce binaries linked against lambda's {@link https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/ | execution environment}. Packages are saved in a Lambda Layer.\n *\n * For AWS, if {@link CommonOptions.useDependencyCaching} is `true` (which is the default), then the Lambda Layer created will be reused in future function creation requests if the contents of `packageJson` are the same.\n *\n * The `FAAST_PACKAGE_DIR` environment variable can be useful for debugging `packageJson` issues.\n */\n",
1042 "excerptTokens": [
1043 {
1044 "kind": "Content",
1045 "text": "packageJson?: "
1046 },
1047 {
1048 "kind": "Content",
1049 "text": "string | object"
1050 },
1051 {
1052 "kind": "Content",
1053 "text": ";"
1054 }
1055 ],
1056 "isOptional": true,
1057 "releaseTag": "Public",
1058 "name": "packageJson",
1059 "propertyTypeTokenRange": {
1060 "startIndex": 1,
1061 "endIndex": 2
1062 }
1063 },
1064 {
1065 "kind": "PropertySignature",
1066 "canonicalReference": "faastjs!CommonOptions#rate:member",
1067 "docComment": "/**\n * Rate limit invocations (invocations/sec). Default: no rate limit.\n *\n * @remarks\n *\n * Some services cannot handle more than a certain number of requests per second, and it is easy to overwhelm them with a large number of cloud functions. Specify a rate limit in invocation/second to restrict how faast.js issues requests.\n */\n",
1068 "excerptTokens": [
1069 {
1070 "kind": "Content",
1071 "text": "rate?: "
1072 },
1073 {
1074 "kind": "Content",
1075 "text": "number"
1076 },
1077 {
1078 "kind": "Content",
1079 "text": ";"
1080 }
1081 ],
1082 "isOptional": true,
1083 "releaseTag": "Public",
1084 "name": "rate",
1085 "propertyTypeTokenRange": {
1086 "startIndex": 1,
1087 "endIndex": 2
1088 }
1089 },
1090 {
1091 "kind": "PropertySignature",
1092 "canonicalReference": "faastjs!CommonOptions#retentionInDays:member",
1093 "docComment": "/**\n * Specify how many days to wait before reclaiming cloud garbage. Default: 1.\n *\n * @remarks\n *\n * Garbage collection only deletes resources after they age beyond a certain number of days. This option specifies how many days old a resource needs to be before being considered garbage by the collector. Note that this setting is not recorded when the resources are created. For example, suppose this is the sequence of events:\n *\n * - Day 0: `faast()` is called with `retentionInDays` set to 5. Then, the function crashes (or omits the call to {@link FaastModule.cleanup}).\n *\n * - Day 1: `faast()` is called with `retentionInDays` set to 1.\n *\n * In this sequence of events, on Day 0 the garbage collector runs and removes resources with age older than 5 days. Then the function leaves new garbage behind because it crashed or did not complete cleanup. On Day 1, the garbage collector runs and deletes resources at least 1 day old, which includes garbage left behind from Day 0 (based on the creation timestamp of the resources). This deletion occurs even though retention was set to 5 days when resources were created on Day 0.\n *\n * On Google, logs are retained according to Google's default expiration policy (30 days) instead of being deleted by garbage collection.\n *\n * Note that if `retentionInDays` is set to 0, garbage collection will remove all resources, even ones that may be in use by other running faast instances. Not recommended.\n *\n * See {@link CommonOptions.gc}.\n */\n",
1094 "excerptTokens": [
1095 {
1096 "kind": "Content",
1097 "text": "retentionInDays?: "
1098 },
1099 {
1100 "kind": "Content",
1101 "text": "number"
1102 },
1103 {
1104 "kind": "Content",
1105 "text": ";"
1106 }
1107 ],
1108 "isOptional": true,
1109 "releaseTag": "Public",
1110 "name": "retentionInDays",
1111 "propertyTypeTokenRange": {
1112 "startIndex": 1,
1113 "endIndex": 2
1114 }
1115 },
1116 {
1117 "kind": "PropertySignature",
1118 "canonicalReference": "faastjs!CommonOptions#speculativeRetryThreshold:member",
1119 "docComment": "/**\n * Reduce tail latency by retrying invocations that take substantially longer than other invocations of the same function. Default: 3.\n *\n * @remarks\n *\n * faast.js automatically measures the mean and standard deviation (σ) of the time taken by invocations of each function. Retries are attempted when the time for an invocation exceeds the mean time by a certain threshold. `speculativeRetryThreshold` specifies how many multiples of σ an invocation needs to exceed the mean for a given function before retry is attempted.\n *\n * The default value of σ is 3. This means a call to a function is retried when the time to execute exceeds three standard deviations from the mean of all prior executions of the same function.\n *\n * This feature is experimental.\n *\n * @beta\n */\n",
1120 "excerptTokens": [
1121 {
1122 "kind": "Content",
1123 "text": "speculativeRetryThreshold?: "
1124 },
1125 {
1126 "kind": "Content",
1127 "text": "number"
1128 },
1129 {
1130 "kind": "Content",
1131 "text": ";"
1132 }
1133 ],
1134 "isOptional": true,
1135 "releaseTag": "Beta",
1136 "name": "speculativeRetryThreshold",
1137 "propertyTypeTokenRange": {
1138 "startIndex": 1,
1139 "endIndex": 2
1140 }
1141 },
1142 {
1143 "kind": "PropertySignature",
1144 "canonicalReference": "faastjs!CommonOptions#timeout:member",
1145 "docComment": "/**\n * Execution time limit for each invocation, in seconds. Default: 60.\n *\n * @remarks\n *\n * Each provider has a maximum time limit for how long invocations can run before being automatically terminated (or frozen). The following are the maximum time limits as of February 2019:\n *\n * - aws: {@link https://docs.aws.amazon.com/lambda/latest/dg/limits.html | 15 minutes}\n *\n * - google: {@link https://cloud.google.com/functions/quotas | 9 minutes}\n *\n * - local: unlimited\n *\n * Faast.js has a proactive timeout detection feature. It automatically attempts to detect when the time limit is about to be reached and proactively sends a timeout exception. Faast does this because not all providers reliably send timely feedback when timeouts occur, leaving developers to look through cloud logs. In general faast.js' timeout will be up to 5s earlier than the timeout specified, in order to give time to allow faast.js to send a timeout message. Proactive timeout detection only works with {@link CommonOptions.childProcess} set to `true` (the default).\n */\n",
1146 "excerptTokens": [
1147 {
1148 "kind": "Content",
1149 "text": "timeout?: "
1150 },
1151 {
1152 "kind": "Content",
1153 "text": "number"
1154 },
1155 {
1156 "kind": "Content",
1157 "text": ";"
1158 }
1159 ],
1160 "isOptional": true,
1161 "releaseTag": "Public",
1162 "name": "timeout",
1163 "propertyTypeTokenRange": {
1164 "startIndex": 1,
1165 "endIndex": 2
1166 }
1167 },
1168 {
1169 "kind": "PropertySignature",
1170 "canonicalReference": "faastjs!CommonOptions#useDependencyCaching:member",
1171 "docComment": "/**\n * Cache installed dependencies from {@link CommonOptions.packageJson}. Only applies to AWS. Default: true.\n *\n * @remarks\n *\n * If `useDependencyCaching` is `true`, The resulting `node_modules` folder is cached in a Lambda Layer with the name `faast-${key}`, where `key` is the SHA1 hash of the `packageJson` contents. These cache entries are removed by garbage collection, by default after 24h. Using caching reduces the need to install and upload dependencies every time a function is created. This is important for AWS because it creates an entirely separate lambda function to install dependencies remotely, which can substantially increase function deployment time.\n *\n * If `useDependencyCaching` is false, the lambda layer is created with the same name as the lambda function, and then is deleted when cleanup is run.\n */\n",
1172 "excerptTokens": [
1173 {
1174 "kind": "Content",
1175 "text": "useDependencyCaching?: "
1176 },
1177 {
1178 "kind": "Content",
1179 "text": "boolean"
1180 },
1181 {
1182 "kind": "Content",
1183 "text": ";"
1184 }
1185 ],
1186 "isOptional": true,
1187 "releaseTag": "Public",
1188 "name": "useDependencyCaching",
1189 "propertyTypeTokenRange": {
1190 "startIndex": 1,
1191 "endIndex": 2
1192 }
1193 },
1194 {
1195 "kind": "PropertySignature",
1196 "canonicalReference": "faastjs!CommonOptions#validateSerialization:member",
1197 "docComment": "/**\n * Check arguments and return values from cloud functions are serializable without losing information. Default: true.\n *\n * @remarks\n *\n * Arguments to cloud functions are automatically serialized with `JSON.stringify` with a custom replacer that handles built-in JavaScript types such as `Date` and `Buffer`. Return values go through the same process. Some JavaScript objects cannot be serialized. By default `validateSerialization` will verify that every argument and return value can be serialized and deserialized without losing information. A `FaastError` will be thrown if faast.js detects a problem according to the following procedure:\n *\n * 1. Serialize arguments and return values with `JSON.stringify` using a special `replacer` function.\n *\n * 2. Deserialize the values with `JSON.parse` with a special `reviver` function.\n *\n * 3. Use {@link https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message | assert.deepStringEqual} to compare the original object with the deserialized object from step 2.\n *\n * There is some overhead to this process because each argument is serialized and deserialized, which can be costly if arguments or return values are large.\n */\n",
1198 "excerptTokens": [
1199 {
1200 "kind": "Content",
1201 "text": "validateSerialization?: "
1202 },
1203 {
1204 "kind": "Content",
1205 "text": "boolean"
1206 },
1207 {
1208 "kind": "Content",
1209 "text": ";"
1210 }
1211 ],
1212 "isOptional": true,
1213 "releaseTag": "Public",
1214 "name": "validateSerialization",
1215 "propertyTypeTokenRange": {
1216 "startIndex": 1,
1217 "endIndex": 2
1218 }
1219 },
1220 {
1221 "kind": "PropertySignature",
1222 "canonicalReference": "faastjs!CommonOptions#webpackOptions:member",
1223 "docComment": "/**\n * Extra webpack options to use to bundle the code package.\n *\n * @remarks\n *\n * By default, faast.js uses webpack to bundle the code package. Webpack automatically handles finding and bundling dependencies, adding source mappings, etc. If you need specialized bundling, use this option to add or override the default webpack configuration. The library {@link https://github.com/survivejs/webpack-merge | webpack-merge} is used to combine configurations.\n * ```typescript\n * const config: webpack.Configuration = merge({\n * entry,\n * mode: \"development\",\n * output: {\n * path: \"/\",\n * filename: outputFilename,\n * libraryTarget: \"commonjs2\"\n * },\n * target: \"node\",\n * resolveLoader: { modules: [__dirname, `${__dirname}/dist}`] },\n * node: { global: true, __dirname: false, __filename: false }\n * },\n * webpackOptions);\n * ```\n *\n * Take care when setting the values of `entry`, `output`, or `resolveLoader`. If these options are overwritten, faast.js may fail to bundle your code. In particular, setting `entry` to an array value will help `webpack-merge` to concatenate its value instead of replacing the value that faast.js inserts for you.\n *\n * Default:\n *\n * - aws: `{ externals: [new RegExp(\"^aws-sdk/?\")] }`. In the lambda environment `\"aws-sdk\"` is available in the ambient environment and does not need to be bundled.\n *\n * - other providers: `{}`\n *\n * The `FAAST_PACKAGE_DIR` environment variable can be useful for debugging webpack issues.\n */\n",
1224 "excerptTokens": [
1225 {
1226 "kind": "Content",
1227 "text": "webpackOptions?: "
1228 },
1229 {
1230 "kind": "Reference",
1231 "text": "webpack.Configuration",
1232 "canonicalReference": "webpack!~Configuration:interface"
1233 },
1234 {
1235 "kind": "Content",
1236 "text": ";"
1237 }
1238 ],
1239 "isOptional": true,
1240 "releaseTag": "Public",
1241 "name": "webpackOptions",
1242 "propertyTypeTokenRange": {
1243 "startIndex": 1,
1244 "endIndex": 2
1245 }
1246 }
1247 ],
1248 "extendsTokenRanges": []
1249 },
1250 {
1251 "kind": "Namespace",
1252 "canonicalReference": "faastjs!CostAnalyzer:namespace",
1253 "docComment": "/**\n * Analyze the cost of a workload across many provider configurations.\n *\n * @public\n */\n",
1254 "excerptTokens": [
1255 {
1256 "kind": "Content",
1257 "text": "export declare namespace CostAnalyzer "
1258 }
1259 ],
1260 "releaseTag": "Public",
1261 "name": "CostAnalyzer",
1262 "members": [
1263 {
1264 "kind": "Function",
1265 "canonicalReference": "faastjs!CostAnalyzer.analyze:function(1)",
1266 "docComment": "/**\n * Estimate the cost of a workload using multiple configurations and providers.\n *\n * @remarks\n *\n * It can be deceptively difficult to set optimal parameters for AWS Lambda and similar services. On the surface there appears to be only one parameter: memory size. Choosing more memory also gives more CPU performance, but it's unclear how much. It's also unclear where single core performance stops getting better. The workload cost analyzer solves these problems by making it easy to run cost experiments.\n * ```text\n * (AWS)\n * ┌───────┐\n * ┌────▶│ 128MB │\n * │ └───────┘\n * │ ┌───────┐\n * ┌─────────────────┐ ├────▶│ 256MB │\n * ┌──────────────┐ │ │ │ └───────┘\n * │ workload │───▶│ │ │ ...\n * └──────────────┘ │ │ │ ┌───────┐\n * │ cost analyzer │─────┼────▶│3008MB │\n * ┌──────────────┐ │ │ │ └───────┘\n * │configurations│───▶│ │ │\n * └──────────────┘ │ │ │ (Google)\n * └─────────────────┘ │ ┌───────┐\n * ├────▶│ 128MB │\n * │ └───────┘\n * │ ┌───────┐\n * └────▶│ 256MB │\n * └───────┘\n * ```\n *\n * `costAnalyzer` is the entry point. It automatically runs this workload against multiple configurations in parallel. Then it uses faast.js' cost snapshot mechanism to automatically determine the price of running the workload with each configuration.\n *\n * Example:\n * ```typescript\n * // functions.ts\n * export function randomNumbers(n: number) {\n * let sum = 0;\n * for (let i = 0; i < n; i++) {\n * sum += Math.random();\n * }\n * return sum;\n * }\n *\n * // cost-analyzer-example.ts\n * import { writeFileSync } from \"fs\";\n * import { CostAnalyzer, FaastModule } from \"faastjs\";\n * import * as funcs from \"./functions\";\n *\n * async function work(faastModule: FaastModule<typeof funcs>) {\n * await faastModule.functions.randomNumbers(100000000);\n * }\n *\n * async function main() {\n * const results = await CostAnalyzer.analyze({ funcs, work });\n * writeFileSync(\"cost.csv\", results.csv());\n * }\n *\n * main();\n * ```\n *\n * Example output (this is printed to `console.log` unless the {@link CostAnalyzer.Workload.silent} is `true`):\n * ```text\n * ✔ aws 128MB queue 15.385s 0.274σ $0.00003921\n * ✔ aws 192MB queue 10.024s 0.230σ $0.00003576\n * ✔ aws 256MB queue 8.077s 0.204σ $0.00003779\n * ▲ ▲ ▲ ▲ ▲ ▲\n * │ │ │ │ │ │\n * provider │ mode │ stdev average\n * │ │ execution estimated\n * memory │ time cost\n * size │\n * average cloud\n * execution time\n * ```\n *\n * The output lists the provider, memory size, ({@link CommonOptions.mode}), average time of a single execution of the workload, the standard deviation (in seconds) of the execution time, and average estimated cost for a single run of the workload.\n *\n * The \"execution time\" referenced here is not wall clock time, but rather execution time in the cloud function. The execution time does not include any time the workload spends waiting locally. If the workload invokes multiple cloud functions, their execution times will be summed even if they happen concurrently. This ensures the execution time and cost are aligned.\n *\n * @param userWorkload - a {@link CostAnalyzer.Workload} object specifying the workload to run and additional parameters.\n *\n * @returns A promise for a {@link CostAnalyzer.Result}\n *\n * @public\n */\n",
1267 "excerptTokens": [
1268 {
1269 "kind": "Content",
1270 "text": "function analyze<T extends "
1271 },
1272 {
1273 "kind": "Content",
1274 "text": "object"
1275 },
1276 {
1277 "kind": "Content",
1278 "text": ", A extends "
1279 },
1280 {
1281 "kind": "Content",
1282 "text": "string"
1283 },
1284 {
1285 "kind": "Content",
1286 "text": ">(userWorkload: "
1287 },
1288 {
1289 "kind": "Reference",
1290 "text": "Workload",
1291 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface"
1292 },
1293 {
1294 "kind": "Content",
1295 "text": "<T, A>"
1296 },
1297 {
1298 "kind": "Content",
1299 "text": "): "
1300 },
1301 {
1302 "kind": "Reference",
1303 "text": "Promise",
1304 "canonicalReference": "!Promise:interface"
1305 },
1306 {
1307 "kind": "Content",
1308 "text": "<"
1309 },
1310 {
1311 "kind": "Reference",
1312 "text": "Result",
1313 "canonicalReference": "faastjs!CostAnalyzer.Result:class"
1314 },
1315 {
1316 "kind": "Content",
1317 "text": "<T, A>>"
1318 },
1319 {
1320 "kind": "Content",
1321 "text": ";"
1322 }
1323 ],
1324 "returnTypeTokenRange": {
1325 "startIndex": 8,
1326 "endIndex": 12
1327 },
1328 "releaseTag": "Public",
1329 "overloadIndex": 1,
1330 "parameters": [
1331 {
1332 "parameterName": "userWorkload",
1333 "parameterTypeTokenRange": {
1334 "startIndex": 5,
1335 "endIndex": 7
1336 }
1337 }
1338 ],
1339 "typeParameters": [
1340 {
1341 "typeParameterName": "T",
1342 "constraintTokenRange": {
1343 "startIndex": 1,
1344 "endIndex": 2
1345 },
1346 "defaultTypeTokenRange": {
1347 "startIndex": 0,
1348 "endIndex": 0
1349 }
1350 },
1351 {
1352 "typeParameterName": "A",
1353 "constraintTokenRange": {
1354 "startIndex": 3,
1355 "endIndex": 4
1356 },
1357 "defaultTypeTokenRange": {
1358 "startIndex": 0,
1359 "endIndex": 0
1360 }
1361 }
1362 ],
1363 "name": "analyze"
1364 },
1365 {
1366 "kind": "Variable",
1367 "canonicalReference": "faastjs!CostAnalyzer.awsConfigurations:var",
1368 "docComment": "/**\n * Default AWS cost analyzer configurations include all memory sizes for AWS Lambda.\n *\n * @remarks\n *\n * The default AWS cost analyzer configurations include every memory size from 128MB to 3008MB in 64MB increments. Each configuration has the following settings:\n * ```typescript\n * {\n * provider: \"aws\",\n * options: {\n * mode: \"https\",\n * memorySize,\n * timeout: 300,\n * gc: \"off\",\n * childProcess: true\n * }\n * }\n * ```\n *\n * Use `Array.map` to change or `Array.filter` to remove some of these configurations. For example:\n * ```typescript\n * const configsWithAtLeast1GB = awsConfigurations.filter(c => c.memorySize > 1024)\n * const shorterTimeout = awsConfigurations.map(c => ({...c, timeout: 60 }));\n * ```\n *\n * @public\n */\n",
1369 "excerptTokens": [
1370 {
1371 "kind": "Content",
1372 "text": "awsConfigurations: "
1373 },
1374 {
1375 "kind": "Reference",
1376 "text": "Configuration",
1377 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1378 },
1379 {
1380 "kind": "Content",
1381 "text": "[]"
1382 }
1383 ],
1384 "releaseTag": "Public",
1385 "name": "awsConfigurations",
1386 "variableTypeTokenRange": {
1387 "startIndex": 1,
1388 "endIndex": 3
1389 }
1390 },
1391 {
1392 "kind": "TypeAlias",
1393 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type",
1394 "docComment": "/**\n * An input to {@link CostAnalyzer.analyze}, specifying one configuration of faast.js to run against a workload. See {@link AwsOptions} and {@link GoogleOptions}.\n *\n * @public\n */\n",
1395 "excerptTokens": [
1396 {
1397 "kind": "Content",
1398 "text": "type Configuration = "
1399 },
1400 {
1401 "kind": "Content",
1402 "text": "{\n provider: \"aws\";\n options: "
1403 },
1404 {
1405 "kind": "Reference",
1406 "text": "AwsOptions",
1407 "canonicalReference": "faastjs!AwsOptions:interface"
1408 },
1409 {
1410 "kind": "Content",
1411 "text": ";\n } | {\n provider: \"google\";\n options: "
1412 },
1413 {
1414 "kind": "Reference",
1415 "text": "GoogleOptions",
1416 "canonicalReference": "faastjs!GoogleOptions:interface"
1417 },
1418 {
1419 "kind": "Content",
1420 "text": ";\n }"
1421 },
1422 {
1423 "kind": "Content",
1424 "text": ";"
1425 }
1426 ],
1427 "releaseTag": "Public",
1428 "name": "Configuration",
1429 "typeTokenRange": {
1430 "startIndex": 1,
1431 "endIndex": 6
1432 }
1433 },
1434 {
1435 "kind": "Interface",
1436 "canonicalReference": "faastjs!CostAnalyzer.Estimate:interface",
1437 "docComment": "/**\n * A cost estimate result for a specific cost analyzer configuration.\n *\n * @public\n */\n",
1438 "excerptTokens": [
1439 {
1440 "kind": "Content",
1441 "text": "interface Estimate<A extends "
1442 },
1443 {
1444 "kind": "Content",
1445 "text": "string"
1446 },
1447 {
1448 "kind": "Content",
1449 "text": "> "
1450 }
1451 ],
1452 "releaseTag": "Public",
1453 "typeParameters": [
1454 {
1455 "typeParameterName": "A",
1456 "constraintTokenRange": {
1457 "startIndex": 1,
1458 "endIndex": 2
1459 },
1460 "defaultTypeTokenRange": {
1461 "startIndex": 0,
1462 "endIndex": 0
1463 }
1464 }
1465 ],
1466 "name": "Estimate",
1467 "members": [
1468 {
1469 "kind": "PropertySignature",
1470 "canonicalReference": "faastjs!CostAnalyzer.Estimate#config:member",
1471 "docComment": "/**\n * The worload configuration that was analyzed. See {@link CostAnalyzer.Configuration}.\n */\n",
1472 "excerptTokens": [
1473 {
1474 "kind": "Content",
1475 "text": "config: "
1476 },
1477 {
1478 "kind": "Reference",
1479 "text": "Configuration",
1480 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1481 },
1482 {
1483 "kind": "Content",
1484 "text": ";"
1485 }
1486 ],
1487 "isOptional": false,
1488 "releaseTag": "Public",
1489 "name": "config",
1490 "propertyTypeTokenRange": {
1491 "startIndex": 1,
1492 "endIndex": 2
1493 }
1494 },
1495 {
1496 "kind": "PropertySignature",
1497 "canonicalReference": "faastjs!CostAnalyzer.Estimate#costSnapshot:member",
1498 "docComment": "/**\n * The cost snapshot for the cost analysis of the specific (workload, configuration) combination. See {@link CostSnapshot}.\n */\n",
1499 "excerptTokens": [
1500 {
1501 "kind": "Content",
1502 "text": "costSnapshot: "
1503 },
1504 {
1505 "kind": "Reference",
1506 "text": "CostSnapshot",
1507 "canonicalReference": "faastjs!CostSnapshot:class"
1508 },
1509 {
1510 "kind": "Content",
1511 "text": ";"
1512 }
1513 ],
1514 "isOptional": false,
1515 "releaseTag": "Public",
1516 "name": "costSnapshot",
1517 "propertyTypeTokenRange": {
1518 "startIndex": 1,
1519 "endIndex": 2
1520 }
1521 },
1522 {
1523 "kind": "PropertySignature",
1524 "canonicalReference": "faastjs!CostAnalyzer.Estimate#extraMetrics:member",
1525 "docComment": "/**\n * Additional workload metrics returned from the work function. See {@link CostAnalyzer.WorkloadAttribute}.\n */\n",
1526 "excerptTokens": [
1527 {
1528 "kind": "Content",
1529 "text": "extraMetrics: "
1530 },
1531 {
1532 "kind": "Reference",
1533 "text": "WorkloadAttribute",
1534 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
1535 },
1536 {
1537 "kind": "Content",
1538 "text": "<A>"
1539 },
1540 {
1541 "kind": "Content",
1542 "text": ";"
1543 }
1544 ],
1545 "isOptional": false,
1546 "releaseTag": "Public",
1547 "name": "extraMetrics",
1548 "propertyTypeTokenRange": {
1549 "startIndex": 1,
1550 "endIndex": 3
1551 }
1552 }
1553 ],
1554 "extendsTokenRanges": []
1555 },
1556 {
1557 "kind": "Variable",
1558 "canonicalReference": "faastjs!CostAnalyzer.googleConfigurations:var",
1559 "docComment": "/**\n * Default Google Cloud Functions cost analyzer configurations include all available memory sizes.\n *\n * @remarks\n *\n * Each google cost analyzer configuration follows this template:\n * ```typescript\n * {\n * provider: \"google\",\n * options: {\n * mode: \"https\",\n * memorySize,\n * timeout: 300,\n * gc: \"off\",\n * childProcess: true\n * }\n * }\n * ```\n *\n * where `memorySize` is in `[128, 256, 512, 1024, 2048]`.\n *\n * @public\n */\n",
1560 "excerptTokens": [
1561 {
1562 "kind": "Content",
1563 "text": "googleConfigurations: "
1564 },
1565 {
1566 "kind": "Reference",
1567 "text": "Configuration",
1568 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1569 },
1570 {
1571 "kind": "Content",
1572 "text": "[]"
1573 }
1574 ],
1575 "releaseTag": "Public",
1576 "name": "googleConfigurations",
1577 "variableTypeTokenRange": {
1578 "startIndex": 1,
1579 "endIndex": 3
1580 }
1581 },
1582 {
1583 "kind": "Class",
1584 "canonicalReference": "faastjs!CostAnalyzer.Result:class",
1585 "docComment": "/**\n * Cost analyzer results for each workload and configuration.\n *\n * @remarks\n *\n * The `estimates` property has the cost estimates for each configuration. See {@link CostAnalyzer.Estimate}.\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Result` class.\n *\n * @public\n */\n",
1586 "excerptTokens": [
1587 {
1588 "kind": "Content",
1589 "text": "class Result<T extends "
1590 },
1591 {
1592 "kind": "Content",
1593 "text": "object"
1594 },
1595 {
1596 "kind": "Content",
1597 "text": ", A extends "
1598 },
1599 {
1600 "kind": "Content",
1601 "text": "string"
1602 },
1603 {
1604 "kind": "Content",
1605 "text": "> "
1606 }
1607 ],
1608 "releaseTag": "Public",
1609 "typeParameters": [
1610 {
1611 "typeParameterName": "T",
1612 "constraintTokenRange": {
1613 "startIndex": 1,
1614 "endIndex": 2
1615 },
1616 "defaultTypeTokenRange": {
1617 "startIndex": 0,
1618 "endIndex": 0
1619 }
1620 },
1621 {
1622 "typeParameterName": "A",
1623 "constraintTokenRange": {
1624 "startIndex": 3,
1625 "endIndex": 4
1626 },
1627 "defaultTypeTokenRange": {
1628 "startIndex": 0,
1629 "endIndex": 0
1630 }
1631 }
1632 ],
1633 "name": "Result",
1634 "members": [
1635 {
1636 "kind": "Method",
1637 "canonicalReference": "faastjs!CostAnalyzer.Result#csv:member(1)",
1638 "docComment": "/**\n * Comma-separated output of cost analyzer. One line per cost analyzer configuration.\n *\n * @remarks\n *\n * The columns are:\n *\n * - `memory`: The memory size allocated.\n *\n * - `cloud`: The cloud provider.\n *\n * - `mode`: See {@link CommonOptions.mode}.\n *\n * - `options`: A string summarizing other faast.js options applied to the `workload`. See {@link CommonOptions}.\n *\n * - `completed`: Number of repetitions that successfully completed.\n *\n * - `errors`: Number of invocations that failed.\n *\n * - `retries`: Number of retries that were attempted.\n *\n * - `cost`: The average cost of executing the workload once.\n *\n * - `executionTime`: the aggregate time spent executing on the provider for all cloud function invocations in the workload. This is averaged across repetitions.\n *\n * - `executionTimeStdev`: The standard deviation of `executionTime`.\n *\n * - `billedTime`: the same as `exectionTime`, except rounded up to the next 100ms for each invocation. Usually very close to `executionTime`.\n */\n",
1639 "excerptTokens": [
1640 {
1641 "kind": "Content",
1642 "text": "csv(): "
1643 },
1644 {
1645 "kind": "Content",
1646 "text": "string"
1647 },
1648 {
1649 "kind": "Content",
1650 "text": ";"
1651 }
1652 ],
1653 "isOptional": false,
1654 "isStatic": false,
1655 "returnTypeTokenRange": {
1656 "startIndex": 1,
1657 "endIndex": 2
1658 },
1659 "releaseTag": "Public",
1660 "overloadIndex": 1,
1661 "parameters": [],
1662 "name": "csv"
1663 },
1664 {
1665 "kind": "Property",
1666 "canonicalReference": "faastjs!CostAnalyzer.Result#estimates:member",
1667 "docComment": "/**\n * Cost estimates for each configuration of the workload. See {@link CostAnalyzer.Estimate}.\n */\n",
1668 "excerptTokens": [
1669 {
1670 "kind": "Content",
1671 "text": "readonly estimates: "
1672 },
1673 {
1674 "kind": "Reference",
1675 "text": "Estimate",
1676 "canonicalReference": "faastjs!CostAnalyzer.Estimate:interface"
1677 },
1678 {
1679 "kind": "Content",
1680 "text": "<A>[]"
1681 },
1682 {
1683 "kind": "Content",
1684 "text": ";"
1685 }
1686 ],
1687 "isOptional": false,
1688 "releaseTag": "Public",
1689 "name": "estimates",
1690 "propertyTypeTokenRange": {
1691 "startIndex": 1,
1692 "endIndex": 3
1693 },
1694 "isStatic": false
1695 },
1696 {
1697 "kind": "Property",
1698 "canonicalReference": "faastjs!CostAnalyzer.Result#workload:member",
1699 "docComment": "/**\n * The workload analyzed.\n */\n",
1700 "excerptTokens": [
1701 {
1702 "kind": "Content",
1703 "text": "readonly workload: "
1704 },
1705 {
1706 "kind": "Reference",
1707 "text": "Required",
1708 "canonicalReference": "!Required:type"
1709 },
1710 {
1711 "kind": "Content",
1712 "text": "<"
1713 },
1714 {
1715 "kind": "Reference",
1716 "text": "Workload",
1717 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface"
1718 },
1719 {
1720 "kind": "Content",
1721 "text": "<T, A>>"
1722 },
1723 {
1724 "kind": "Content",
1725 "text": ";"
1726 }
1727 ],
1728 "isOptional": false,
1729 "releaseTag": "Public",
1730 "name": "workload",
1731 "propertyTypeTokenRange": {
1732 "startIndex": 1,
1733 "endIndex": 5
1734 },
1735 "isStatic": false
1736 }
1737 ],
1738 "implementsTokenRanges": []
1739 },
1740 {
1741 "kind": "Interface",
1742 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface",
1743 "docComment": "/**\n * A user-defined cost analyzer workload for {@link CostAnalyzer.analyze}.\n *\n * Example:\n *\n * @public\n */\n",
1744 "excerptTokens": [
1745 {
1746 "kind": "Content",
1747 "text": "interface Workload<T extends "
1748 },
1749 {
1750 "kind": "Content",
1751 "text": "object"
1752 },
1753 {
1754 "kind": "Content",
1755 "text": ", A extends "
1756 },
1757 {
1758 "kind": "Content",
1759 "text": "string"
1760 },
1761 {
1762 "kind": "Content",
1763 "text": "> "
1764 }
1765 ],
1766 "releaseTag": "Public",
1767 "typeParameters": [
1768 {
1769 "typeParameterName": "T",
1770 "constraintTokenRange": {
1771 "startIndex": 1,
1772 "endIndex": 2
1773 },
1774 "defaultTypeTokenRange": {
1775 "startIndex": 0,
1776 "endIndex": 0
1777 }
1778 },
1779 {
1780 "typeParameterName": "A",
1781 "constraintTokenRange": {
1782 "startIndex": 3,
1783 "endIndex": 4
1784 },
1785 "defaultTypeTokenRange": {
1786 "startIndex": 0,
1787 "endIndex": 0
1788 }
1789 }
1790 ],
1791 "name": "Workload",
1792 "members": [
1793 {
1794 "kind": "PropertySignature",
1795 "canonicalReference": "faastjs!CostAnalyzer.Workload#concurrency:member",
1796 "docComment": "/**\n * The amount of concurrency to allow. Concurrency can arise from multiple repetitions of the same configuration, or concurrenct executions of different configurations. This concurrency limit throttles the total number of concurrent workload executions across both of these sources of concurrency. Default: 64.\n */\n",
1797 "excerptTokens": [
1798 {
1799 "kind": "Content",
1800 "text": "concurrency?: "
1801 },
1802 {
1803 "kind": "Content",
1804 "text": "number"
1805 },
1806 {
1807 "kind": "Content",
1808 "text": ";"
1809 }
1810 ],
1811 "isOptional": true,
1812 "releaseTag": "Public",
1813 "name": "concurrency",
1814 "propertyTypeTokenRange": {
1815 "startIndex": 1,
1816 "endIndex": 2
1817 }
1818 },
1819 {
1820 "kind": "PropertySignature",
1821 "canonicalReference": "faastjs!CostAnalyzer.Workload#configurations:member",
1822 "docComment": "/**\n * An array of configurations to run the work function against (see {@link CostAnalyzer.Configuration}). For example, each entry in the array may specify a provider, memory size, and other options. Default: {@link CostAnalyzer.awsConfigurations}.\n */\n",
1823 "excerptTokens": [
1824 {
1825 "kind": "Content",
1826 "text": "configurations?: "
1827 },
1828 {
1829 "kind": "Reference",
1830 "text": "Configuration",
1831 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1832 },
1833 {
1834 "kind": "Content",
1835 "text": "[]"
1836 },
1837 {
1838 "kind": "Content",
1839 "text": ";"
1840 }
1841 ],
1842 "isOptional": true,
1843 "releaseTag": "Public",
1844 "name": "configurations",
1845 "propertyTypeTokenRange": {
1846 "startIndex": 1,
1847 "endIndex": 3
1848 }
1849 },
1850 {
1851 "kind": "PropertySignature",
1852 "canonicalReference": "faastjs!CostAnalyzer.Workload#format:member",
1853 "docComment": "/**\n * Format an attribute value for console output. This is displayed by the cost analyzer when all of the repetitions for a configuration have completed. The default returns `${attribute}:${value.toFixed(1)}`.\n */\n",
1854 "excerptTokens": [
1855 {
1856 "kind": "Content",
1857 "text": "format?: "
1858 },
1859 {
1860 "kind": "Content",
1861 "text": "(attr: A, value: number) => string"
1862 },
1863 {
1864 "kind": "Content",
1865 "text": ";"
1866 }
1867 ],
1868 "isOptional": true,
1869 "releaseTag": "Public",
1870 "name": "format",
1871 "propertyTypeTokenRange": {
1872 "startIndex": 1,
1873 "endIndex": 2
1874 }
1875 },
1876 {
1877 "kind": "PropertySignature",
1878 "canonicalReference": "faastjs!CostAnalyzer.Workload#formatCSV:member",
1879 "docComment": "/**\n * Format an attribute value for CSV. The default returns `value.toFixed(1)`.\n */\n",
1880 "excerptTokens": [
1881 {
1882 "kind": "Content",
1883 "text": "formatCSV?: "
1884 },
1885 {
1886 "kind": "Content",
1887 "text": "(attr: A, value: number) => string"
1888 },
1889 {
1890 "kind": "Content",
1891 "text": ";"
1892 }
1893 ],
1894 "isOptional": true,
1895 "releaseTag": "Public",
1896 "name": "formatCSV",
1897 "propertyTypeTokenRange": {
1898 "startIndex": 1,
1899 "endIndex": 2
1900 }
1901 },
1902 {
1903 "kind": "PropertySignature",
1904 "canonicalReference": "faastjs!CostAnalyzer.Workload#funcs:member",
1905 "docComment": "/**\n * The imported module that contains the cloud functions to test.\n */\n",
1906 "excerptTokens": [
1907 {
1908 "kind": "Content",
1909 "text": "funcs: "
1910 },
1911 {
1912 "kind": "Content",
1913 "text": "T"
1914 },
1915 {
1916 "kind": "Content",
1917 "text": ";"
1918 }
1919 ],
1920 "isOptional": false,
1921 "releaseTag": "Public",
1922 "name": "funcs",
1923 "propertyTypeTokenRange": {
1924 "startIndex": 1,
1925 "endIndex": 2
1926 }
1927 },
1928 {
1929 "kind": "PropertySignature",
1930 "canonicalReference": "faastjs!CostAnalyzer.Workload#repetitions:member",
1931 "docComment": "/**\n * The number of repetitions to run the workload for each cost analyzer configuration. Higher repetitions help reduce the jitter in the results. Repetitions execute in the same FaastModule instance. Default: 10.\n */\n",
1932 "excerptTokens": [
1933 {
1934 "kind": "Content",
1935 "text": "repetitions?: "
1936 },
1937 {
1938 "kind": "Content",
1939 "text": "number"
1940 },
1941 {
1942 "kind": "Content",
1943 "text": ";"
1944 }
1945 ],
1946 "isOptional": true,
1947 "releaseTag": "Public",
1948 "name": "repetitions",
1949 "propertyTypeTokenRange": {
1950 "startIndex": 1,
1951 "endIndex": 2
1952 }
1953 },
1954 {
1955 "kind": "PropertySignature",
1956 "canonicalReference": "faastjs!CostAnalyzer.Workload#silent:member",
1957 "docComment": "/**\n * If true, do not output live results to the console. Can be useful for running the cost analyzer as part of automated tests. Default: false.\n */\n",
1958 "excerptTokens": [
1959 {
1960 "kind": "Content",
1961 "text": "silent?: "
1962 },
1963 {
1964 "kind": "Content",
1965 "text": "boolean"
1966 },
1967 {
1968 "kind": "Content",
1969 "text": ";"
1970 }
1971 ],
1972 "isOptional": true,
1973 "releaseTag": "Public",
1974 "name": "silent",
1975 "propertyTypeTokenRange": {
1976 "startIndex": 1,
1977 "endIndex": 2
1978 }
1979 },
1980 {
1981 "kind": "PropertySignature",
1982 "canonicalReference": "faastjs!CostAnalyzer.Workload#summarize:member",
1983 "docComment": "/**\n * Combine {@link CostAnalyzer.WorkloadAttribute} instances returned from multiple workload executions (caused by value of {@link CostAnalyzer.Workload.repetitions}). The default is a function that takes the average of each attribute.\n */\n",
1984 "excerptTokens": [
1985 {
1986 "kind": "Content",
1987 "text": "summarize?: "
1988 },
1989 {
1990 "kind": "Content",
1991 "text": "(summaries: "
1992 },
1993 {
1994 "kind": "Reference",
1995 "text": "WorkloadAttribute",
1996 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
1997 },
1998 {
1999 "kind": "Content",
2000 "text": "<A>[]) => "
2001 },
2002 {
2003 "kind": "Reference",
2004 "text": "WorkloadAttribute",
2005 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
2006 },
2007 {
2008 "kind": "Content",
2009 "text": "<A>"
2010 },
2011 {
2012 "kind": "Content",
2013 "text": ";"
2014 }
2015 ],
2016 "isOptional": true,
2017 "releaseTag": "Public",
2018 "name": "summarize",
2019 "propertyTypeTokenRange": {
2020 "startIndex": 1,
2021 "endIndex": 6
2022 }
2023 },
2024 {
2025 "kind": "PropertySignature",
2026 "canonicalReference": "faastjs!CostAnalyzer.Workload#work:member",
2027 "docComment": "/**\n * A function that executes cloud functions on `faastModule.functions.*`. The work function should return `void` if there are no custom workload attributes. Otherwise, it should return a {@link CostAnalyzer.WorkloadAttribute} object which maps user-defined attribute names to numerical values for the workload. For example, this might measure bandwidth or some other metric not tracked by faast.js, but are relevant for evaluating the cost-performance tradeoff of the configurations analyzed by the cost analyzer.\n */\n",
2028 "excerptTokens": [
2029 {
2030 "kind": "Content",
2031 "text": "work: "
2032 },
2033 {
2034 "kind": "Content",
2035 "text": "(faastModule: "
2036 },
2037 {
2038 "kind": "Reference",
2039 "text": "FaastModule",
2040 "canonicalReference": "faastjs!FaastModule:interface"
2041 },
2042 {
2043 "kind": "Content",
2044 "text": "<T>) => "
2045 },
2046 {
2047 "kind": "Reference",
2048 "text": "Promise",
2049 "canonicalReference": "!Promise:interface"
2050 },
2051 {
2052 "kind": "Content",
2053 "text": "<"
2054 },
2055 {
2056 "kind": "Reference",
2057 "text": "WorkloadAttribute",
2058 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
2059 },
2060 {
2061 "kind": "Content",
2062 "text": "<A> | void>"
2063 },
2064 {
2065 "kind": "Content",
2066 "text": ";"
2067 }
2068 ],
2069 "isOptional": false,
2070 "releaseTag": "Public",
2071 "name": "work",
2072 "propertyTypeTokenRange": {
2073 "startIndex": 1,
2074 "endIndex": 8
2075 }
2076 }
2077 ],
2078 "extendsTokenRanges": []
2079 },
2080 {
2081 "kind": "TypeAlias",
2082 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type",
2083 "docComment": "/**\n * User-defined custom metrics for a workload. These are automatically summarized in the output; see {@link CostAnalyzer.Workload}.\n *\n * @public\n */\n",
2084 "excerptTokens": [
2085 {
2086 "kind": "Content",
2087 "text": "type WorkloadAttribute<A extends "
2088 },
2089 {
2090 "kind": "Content",
2091 "text": "string"
2092 },
2093 {
2094 "kind": "Content",
2095 "text": "> = "
2096 },
2097 {
2098 "kind": "Content",
2099 "text": "{\n [attr in A]: number;\n }"
2100 },
2101 {
2102 "kind": "Content",
2103 "text": ";"
2104 }
2105 ],
2106 "releaseTag": "Public",
2107 "name": "WorkloadAttribute",
2108 "typeParameters": [
2109 {
2110 "typeParameterName": "A",
2111 "constraintTokenRange": {
2112 "startIndex": 1,
2113 "endIndex": 2
2114 },
2115 "defaultTypeTokenRange": {
2116 "startIndex": 0,
2117 "endIndex": 0
2118 }
2119 }
2120 ],
2121 "typeTokenRange": {
2122 "startIndex": 3,
2123 "endIndex": 4
2124 }
2125 }
2126 ]
2127 },
2128 {
2129 "kind": "Class",
2130 "canonicalReference": "faastjs!CostMetric:class",
2131 "docComment": "/**\n * A line item in the cost estimate, including the resource usage metric measured and its pricing.\n *\n * @remarks\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `CostMetric` class.\n *\n * @public\n */\n",
2132 "excerptTokens": [
2133 {
2134 "kind": "Content",
2135 "text": "export declare class CostMetric "
2136 }
2137 ],
2138 "releaseTag": "Public",
2139 "name": "CostMetric",
2140 "members": [
2141 {
2142 "kind": "Property",
2143 "canonicalReference": "faastjs!CostMetric#comment:member",
2144 "docComment": "/**\n * An optional comment, usually providing a link to the provider's pricing page and other data.\n */\n",
2145 "excerptTokens": [
2146 {
2147 "kind": "Content",
2148 "text": "readonly comment?: "
2149 },
2150 {
2151 "kind": "Content",
2152 "text": "string"
2153 },
2154 {
2155 "kind": "Content",
2156 "text": ";"
2157 }
2158 ],
2159 "isOptional": true,
2160 "releaseTag": "Public",
2161 "name": "comment",
2162 "propertyTypeTokenRange": {
2163 "startIndex": 1,
2164 "endIndex": 2
2165 },
2166 "isStatic": false
2167 },
2168 {
2169 "kind": "Method",
2170 "canonicalReference": "faastjs!CostMetric#cost:member(1)",
2171 "docComment": "/**\n * The cost contribution of this cost metric. Equal to {@link CostMetric.pricing} * {@link CostMetric.measured}.\n */\n",
2172 "excerptTokens": [
2173 {
2174 "kind": "Content",
2175 "text": "cost(): "
2176 },
2177 {
2178 "kind": "Content",
2179 "text": "number"
2180 },
2181 {
2182 "kind": "Content",
2183 "text": ";"
2184 }
2185 ],
2186 "isOptional": false,
2187 "isStatic": false,
2188 "returnTypeTokenRange": {
2189 "startIndex": 1,
2190 "endIndex": 2
2191 },
2192 "releaseTag": "Public",
2193 "overloadIndex": 1,
2194 "parameters": [],
2195 "name": "cost"
2196 },
2197 {
2198 "kind": "Method",
2199 "canonicalReference": "faastjs!CostMetric#describeCostOnly:member(1)",
2200 "docComment": "/**\n * Return a string with the cost estimate for this metric, omitting comments.\n */\n",
2201 "excerptTokens": [
2202 {
2203 "kind": "Content",
2204 "text": "describeCostOnly(): "
2205 },
2206 {
2207 "kind": "Content",
2208 "text": "string"
2209 },
2210 {
2211 "kind": "Content",
2212 "text": ";"
2213 }
2214 ],
2215 "isOptional": false,
2216 "isStatic": false,
2217 "returnTypeTokenRange": {
2218 "startIndex": 1,
2219 "endIndex": 2
2220 },
2221 "releaseTag": "Public",
2222 "overloadIndex": 1,
2223 "parameters": [],
2224 "name": "describeCostOnly"
2225 },
2226 {
2227 "kind": "Property",
2228 "canonicalReference": "faastjs!CostMetric#informationalOnly:member",
2229 "docComment": "/**\n * True if this cost metric is only for informational purposes (e.g. AWS's `logIngestion`) and does not contribute cost.\n */\n",
2230 "excerptTokens": [
2231 {
2232 "kind": "Content",
2233 "text": "readonly informationalOnly?: "
2234 },
2235 {
2236 "kind": "Content",
2237 "text": "boolean"
2238 },
2239 {
2240 "kind": "Content",
2241 "text": ";"
2242 }
2243 ],
2244 "isOptional": true,
2245 "releaseTag": "Public",
2246 "name": "informationalOnly",
2247 "propertyTypeTokenRange": {
2248 "startIndex": 1,
2249 "endIndex": 2
2250 },
2251 "isStatic": false
2252 },
2253 {
2254 "kind": "Property",
2255 "canonicalReference": "faastjs!CostMetric#measured:member",
2256 "docComment": "/**\n * The measured value of the cost metric, in units.\n */\n",
2257 "excerptTokens": [
2258 {
2259 "kind": "Content",
2260 "text": "readonly measured: "
2261 },
2262 {
2263 "kind": "Content",
2264 "text": "number"
2265 },
2266 {
2267 "kind": "Content",
2268 "text": ";"
2269 }
2270 ],
2271 "isOptional": false,
2272 "releaseTag": "Public",
2273 "name": "measured",
2274 "propertyTypeTokenRange": {
2275 "startIndex": 1,
2276 "endIndex": 2
2277 },
2278 "isStatic": false
2279 },
2280 {
2281 "kind": "Property",
2282 "canonicalReference": "faastjs!CostMetric#name:member",
2283 "docComment": "/**\n * The name of the cost metric, e.g. `functionCallDuration`\n */\n",
2284 "excerptTokens": [
2285 {
2286 "kind": "Content",
2287 "text": "readonly name: "
2288 },
2289 {
2290 "kind": "Content",
2291 "text": "string"
2292 },
2293 {
2294 "kind": "Content",
2295 "text": ";"
2296 }
2297 ],
2298 "isOptional": false,
2299 "releaseTag": "Public",
2300 "name": "name",
2301 "propertyTypeTokenRange": {
2302 "startIndex": 1,
2303 "endIndex": 2
2304 },
2305 "isStatic": false
2306 },
2307 {
2308 "kind": "Property",
2309 "canonicalReference": "faastjs!CostMetric#pricing:member",
2310 "docComment": "/**\n * The price in USD per unit measured.\n */\n",
2311 "excerptTokens": [
2312 {
2313 "kind": "Content",
2314 "text": "readonly pricing: "
2315 },
2316 {
2317 "kind": "Content",
2318 "text": "number"
2319 },
2320 {
2321 "kind": "Content",
2322 "text": ";"
2323 }
2324 ],
2325 "isOptional": false,
2326 "releaseTag": "Public",
2327 "name": "pricing",
2328 "propertyTypeTokenRange": {
2329 "startIndex": 1,
2330 "endIndex": 2
2331 },
2332 "isStatic": false
2333 },
2334 {
2335 "kind": "Method",
2336 "canonicalReference": "faastjs!CostMetric#toString:member(1)",
2337 "docComment": "/**\n * Describe this cost metric, including comments.\n */\n",
2338 "excerptTokens": [
2339 {
2340 "kind": "Content",
2341 "text": "toString(): "
2342 },
2343 {
2344 "kind": "Content",
2345 "text": "string"
2346 },
2347 {
2348 "kind": "Content",
2349 "text": ";"
2350 }
2351 ],
2352 "isOptional": false,
2353 "isStatic": false,
2354 "returnTypeTokenRange": {
2355 "startIndex": 1,
2356 "endIndex": 2
2357 },
2358 "releaseTag": "Public",
2359 "overloadIndex": 1,
2360 "parameters": [],
2361 "name": "toString"
2362 },
2363 {
2364 "kind": "Property",
2365 "canonicalReference": "faastjs!CostMetric#unit:member",
2366 "docComment": "/**\n * The name of the units that pricing is measured in for this metric.\n */\n",
2367 "excerptTokens": [
2368 {
2369 "kind": "Content",
2370 "text": "readonly unit: "
2371 },
2372 {
2373 "kind": "Content",
2374 "text": "string"
2375 },
2376 {
2377 "kind": "Content",
2378 "text": ";"
2379 }
2380 ],
2381 "isOptional": false,
2382 "releaseTag": "Public",
2383 "name": "unit",
2384 "propertyTypeTokenRange": {
2385 "startIndex": 1,
2386 "endIndex": 2
2387 },
2388 "isStatic": false
2389 },
2390 {
2391 "kind": "Property",
2392 "canonicalReference": "faastjs!CostMetric#unitPlural:member",
2393 "docComment": "/**\n * The plural form of the unit name. By default the plural form will be the name of the unit with \"s\" appended at the end, unless the last letter is capitalized, in which case there is no plural form (e.g. \"GB\").\n */\n",
2394 "excerptTokens": [
2395 {
2396 "kind": "Content",
2397 "text": "readonly unitPlural?: "
2398 },
2399 {
2400 "kind": "Content",
2401 "text": "string"
2402 },
2403 {
2404 "kind": "Content",
2405 "text": ";"
2406 }
2407 ],
2408 "isOptional": true,
2409 "releaseTag": "Public",
2410 "name": "unitPlural",
2411 "propertyTypeTokenRange": {
2412 "startIndex": 1,
2413 "endIndex": 2
2414 },
2415 "isStatic": false
2416 }
2417 ],
2418 "implementsTokenRanges": []
2419 },
2420 {
2421 "kind": "Class",
2422 "canonicalReference": "faastjs!CostSnapshot:class",
2423 "docComment": "/**\n * A summary of the costs incurred by a faast.js module at a point in time. Output of {@link FaastModule.costSnapshot}.\n *\n * @remarks\n *\n * Cost information provided by faast.js is an estimate. It is derived from internal faast.js measurements and not by consulting data provided by your cloud provider.\n *\n * **Faast.js does not guarantee the accuracy of cost estimates.**\n *\n * **Use at your own risk.**\n *\n * Example using AWS:\n * ```typescript\n * const faastModule = await faast(\"aws\", m);\n * try {\n * // Invoke faastModule.functions.*\n * } finally {\n * await faastModule.cleanup();\n * console.log(`Cost estimate:`);\n * console.log(`${await faastModule.costSnapshot()}`);\n * }\n * ```\n *\n * AWS example output:\n * ```text\n * Cost estimate:\n * functionCallDuration $0.00002813/second 0.6 second $0.00001688 68.4% [1]\n * sqs $0.00000040/request 9 requests $0.00000360 14.6% [2]\n * sns $0.00000050/request 5 requests $0.00000250 10.1% [3]\n * functionCallRequests $0.00000020/request 5 requests $0.00000100 4.1% [4]\n * outboundDataTransfer $0.09000000/GB 0.00000769 GB $0.00000069 2.8% [5]\n * logIngestion $0.50000000/GB 0 GB $0 0.0% [6]\n * ---------------------------------------------------------------------------------------\n * $0.00002467 (USD)\n *\n * * Estimated using highest pricing tier for each service. Limitations apply.\n * ** Does not account for free tier.\n * [1]: https://aws.amazon.com/lambda/pricing (rate = 0.00001667/(GB*second) * 1.6875 GB = 0.00002813/second)\n * [2]: https://aws.amazon.com/sqs/pricing\n * [3]: https://aws.amazon.com/sns/pricing\n * [4]: https://aws.amazon.com/lambda/pricing\n * [5]: https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer\n * [6]: https://aws.amazon.com/cloudwatch/pricing/ - Log ingestion costs not currently included.\n * ```\n *\n * A cost snapshot contains several {@link CostMetric} values. Each `CostMetric` summarizes one component of the overall cost of executing the functions so far. Some cost metrics are common to all faast providers, and other metrics are provider-specific. The common metrics are:\n *\n * - `functionCallDuration`: the estimated billed CPU time (rounded to the next 100ms) consumed by completed cloud function calls. This is the metric that usually dominates cost.\n *\n * - `functionCallRequests`: the number of invocation requests made. Most providers charge for each invocation.\n *\n * Provider-specific metrics vary. For example, AWS has the following additional metrics:\n *\n * - `sqs`: AWS Simple Queueing Service. This metric captures the number of queue requests made to insert and retrieve queued results (each 64kb chunk is counted as an additional request). SQS is used even if {@link CommonOptions.mode} is not set to `\"queue\"`, because it is necessary for monitoring cloud function invocations.\n *\n * - `sns`: AWS Simple Notification Service. SNS is used to invoke Lambda functions when {@link CommonOptions.mode} is `\"queue\"`.\n *\n * - `outboundDataTransfer`: an estimate of the network data transferred out from the cloud provider for this faast.js module. This estimate only counts data returned from cloud function invocations and infrastructure that faast.js sets up. It does not count any outbound data sent by your cloud functions that are not known to faast.js. Note that if you run faast.js on EC2 in the same region (see {@link AwsOptions.region}), then the data transfer costs will be zero (however, the cost snapshot will not include EC2 costs). Also note that if your cloud function transfers data from/to S3 buckets in the same region, there is no cost as long as that data is not returned from the function.\n *\n * - `logIngestion`: this cost metric is always zero for AWS. It is present to remind the user that AWS charges for log data ingested by CloudWatch Logs that are not measured by faast.js. Log entries may arrive significantly after function execution completes, and there is no way for faast.js to know exactly how long to wait, therefore it does not attempt to measure this cost. In practice, if your cloud functions do not perform extensive logging on all invocations, log ingestion costs from faast.js are likely to be low or fall within the free tier.\n *\n * For Google, extra metrics include `outboundDataTransfer` similar to AWS, and `pubsub`, which combines costs that are split into `sns` and `sqs` on AWS.\n *\n * The Local provider has no extra metrics.\n *\n * Prices are retrieved dynamically from AWS and Google and cached locally. Cached prices expire after 24h. For each cost metric, faast.js uses the highest price tier to compute estimated pricing.\n *\n * Cost estimates do not take free tiers into account.\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `CostSnapshot` class.\n *\n * @public\n */\n",
2424 "excerptTokens": [
2425 {
2426 "kind": "Content",
2427 "text": "export declare class CostSnapshot "
2428 }
2429 ],
2430 "releaseTag": "Public",
2431 "name": "CostSnapshot",
2432 "members": [
2433 {
2434 "kind": "Property",
2435 "canonicalReference": "faastjs!CostSnapshot#costMetrics:member",
2436 "docComment": "/**\n * The cost metric components for this cost snapshot. See {@link CostMetric}.\n */\n",
2437 "excerptTokens": [
2438 {
2439 "kind": "Content",
2440 "text": "readonly costMetrics: "
2441 },
2442 {
2443 "kind": "Reference",
2444 "text": "CostMetric",
2445 "canonicalReference": "faastjs!CostMetric:class"
2446 },
2447 {
2448 "kind": "Content",
2449 "text": "[]"
2450 },
2451 {
2452 "kind": "Content",
2453 "text": ";"
2454 }
2455 ],
2456 "isOptional": false,
2457 "releaseTag": "Public",
2458 "name": "costMetrics",
2459 "propertyTypeTokenRange": {
2460 "startIndex": 1,
2461 "endIndex": 3
2462 },
2463 "isStatic": false
2464 },
2465 {
2466 "kind": "Method",
2467 "canonicalReference": "faastjs!CostSnapshot#csv:member(1)",
2468 "docComment": "/**\n * Comma separated value output for a cost snapshot.\n *\n * @remarks\n *\n * The format is \"metric,unit,pricing,measured,cost,percentage,comment\".\n *\n * Example output:\n * ```text\n * metric,unit,pricing,measured,cost,percentage,comment\n * functionCallDuration,second,0.00002813,0.60000000,0.00001688,64.1% ,\"https://aws.amazon.com/lambda/pricing (rate = 0.00001667/(GB*second) * 1.6875 GB = 0.00002813/second)\"\n * functionCallRequests,request,0.00000020,5,0.00000100,3.8% ,\"https://aws.amazon.com/lambda/pricing\"\n * outboundDataTransfer,GB,0.09000000,0.00000844,0.00000076,2.9% ,\"https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer\"\n * sqs,request,0.00000040,13,0.00000520,19.7% ,\"https://aws.amazon.com/sqs/pricing\"\n * sns,request,0.00000050,5,0.00000250,9.5% ,\"https://aws.amazon.com/sns/pricing\"\n * logIngestion,GB,0.50000000,0,0,0.0% ,\"https://aws.amazon.com/cloudwatch/pricing/ - Log ingestion costs not currently included.\"\n * ```\n *\n */\n",
2469 "excerptTokens": [
2470 {
2471 "kind": "Content",
2472 "text": "csv(): "
2473 },
2474 {
2475 "kind": "Content",
2476 "text": "string"
2477 },
2478 {
2479 "kind": "Content",
2480 "text": ";"
2481 }
2482 ],
2483 "isOptional": false,
2484 "isStatic": false,
2485 "returnTypeTokenRange": {
2486 "startIndex": 1,
2487 "endIndex": 2
2488 },
2489 "releaseTag": "Public",
2490 "overloadIndex": 1,
2491 "parameters": [],
2492 "name": "csv"
2493 },
2494 {
2495 "kind": "Method",
2496 "canonicalReference": "faastjs!CostSnapshot#find:member(1)",
2497 "docComment": "/**\n * Find a specific cost metric by name.\n *\n * @returns a {@link CostMetric} if found, otherwise `undefined`.\n */\n",
2498 "excerptTokens": [
2499 {
2500 "kind": "Content",
2501 "text": "find(name: "
2502 },
2503 {
2504 "kind": "Content",
2505 "text": "string"
2506 },
2507 {
2508 "kind": "Content",
2509 "text": "): "
2510 },
2511 {
2512 "kind": "Reference",
2513 "text": "CostMetric",
2514 "canonicalReference": "faastjs!CostMetric:class"
2515 },
2516 {
2517 "kind": "Content",
2518 "text": " | undefined"
2519 },
2520 {
2521 "kind": "Content",
2522 "text": ";"
2523 }
2524 ],
2525 "isOptional": false,
2526 "isStatic": false,
2527 "returnTypeTokenRange": {
2528 "startIndex": 3,
2529 "endIndex": 5
2530 },
2531 "releaseTag": "Public",
2532 "overloadIndex": 1,
2533 "parameters": [
2534 {
2535 "parameterName": "name",
2536 "parameterTypeTokenRange": {
2537 "startIndex": 1,
2538 "endIndex": 2
2539 }
2540 }
2541 ],
2542 "name": "find"
2543 },
2544 {
2545 "kind": "Property",
2546 "canonicalReference": "faastjs!CostSnapshot#options:member",
2547 "docComment": "/**\n * The options used to initialize the faast.js module where this cost snapshot was generated.\n */\n",
2548 "excerptTokens": [
2549 {
2550 "kind": "Content",
2551 "text": "readonly options: "
2552 },
2553 {
2554 "kind": "Reference",
2555 "text": "CommonOptions",
2556 "canonicalReference": "faastjs!CommonOptions:interface"
2557 },
2558 {
2559 "kind": "Content",
2560 "text": " | "
2561 },
2562 {
2563 "kind": "Reference",
2564 "text": "AwsOptions",
2565 "canonicalReference": "faastjs!AwsOptions:interface"
2566 },
2567 {
2568 "kind": "Content",
2569 "text": " | "
2570 },
2571 {
2572 "kind": "Reference",
2573 "text": "GoogleOptions",
2574 "canonicalReference": "faastjs!GoogleOptions:interface"
2575 },
2576 {
2577 "kind": "Content",
2578 "text": ";"
2579 }
2580 ],
2581 "isOptional": false,
2582 "releaseTag": "Public",
2583 "name": "options",
2584 "propertyTypeTokenRange": {
2585 "startIndex": 1,
2586 "endIndex": 6
2587 },
2588 "isStatic": false
2589 },
2590 {
2591 "kind": "Property",
2592 "canonicalReference": "faastjs!CostSnapshot#provider:member",
2593 "docComment": "/**\n * The {@link Provider}, e.g. \"aws\" or \"google\"\n */\n",
2594 "excerptTokens": [
2595 {
2596 "kind": "Content",
2597 "text": "readonly provider: "
2598 },
2599 {
2600 "kind": "Content",
2601 "text": "string"
2602 },
2603 {
2604 "kind": "Content",
2605 "text": ";"
2606 }
2607 ],
2608 "isOptional": false,
2609 "releaseTag": "Public",
2610 "name": "provider",
2611 "propertyTypeTokenRange": {
2612 "startIndex": 1,
2613 "endIndex": 2
2614 },
2615 "isStatic": false
2616 },
2617 {
2618 "kind": "Property",
2619 "canonicalReference": "faastjs!CostSnapshot#stats:member",
2620 "docComment": "/**\n * The function statistics that were used to compute prices.\n */\n",
2621 "excerptTokens": [
2622 {
2623 "kind": "Content",
2624 "text": "readonly stats: "
2625 },
2626 {
2627 "kind": "Reference",
2628 "text": "FunctionStats",
2629 "canonicalReference": "faastjs!FunctionStats:class"
2630 },
2631 {
2632 "kind": "Content",
2633 "text": ";"
2634 }
2635 ],
2636 "isOptional": false,
2637 "releaseTag": "Public",
2638 "name": "stats",
2639 "propertyTypeTokenRange": {
2640 "startIndex": 1,
2641 "endIndex": 2
2642 },
2643 "isStatic": false
2644 },
2645 {
2646 "kind": "Method",
2647 "canonicalReference": "faastjs!CostSnapshot#toString:member(1)",
2648 "docComment": "/**\n * A summary of all cost metrics and prices in this cost snapshot.\n */\n",
2649 "excerptTokens": [
2650 {
2651 "kind": "Content",
2652 "text": "toString(): "
2653 },
2654 {
2655 "kind": "Content",
2656 "text": "string"
2657 },
2658 {
2659 "kind": "Content",
2660 "text": ";"
2661 }
2662 ],
2663 "isOptional": false,
2664 "isStatic": false,
2665 "returnTypeTokenRange": {
2666 "startIndex": 1,
2667 "endIndex": 2
2668 },
2669 "releaseTag": "Public",
2670 "overloadIndex": 1,
2671 "parameters": [],
2672 "name": "toString"
2673 },
2674 {
2675 "kind": "Method",
2676 "canonicalReference": "faastjs!CostSnapshot#total:member(1)",
2677 "docComment": "/**\n * Sum of cost metrics.\n */\n",
2678 "excerptTokens": [
2679 {
2680 "kind": "Content",
2681 "text": "total(): "
2682 },
2683 {
2684 "kind": "Content",
2685 "text": "number"
2686 },
2687 {
2688 "kind": "Content",
2689 "text": ";"
2690 }
2691 ],
2692 "isOptional": false,
2693 "isStatic": false,
2694 "returnTypeTokenRange": {
2695 "startIndex": 1,
2696 "endIndex": 2
2697 },
2698 "releaseTag": "Public",
2699 "overloadIndex": 1,
2700 "parameters": [],
2701 "name": "total"
2702 }
2703 ],
2704 "implementsTokenRanges": []
2705 },
2706 {
2707 "kind": "Interface",
2708 "canonicalReference": "faastjs!Detail:interface",
2709 "docComment": "/**\n * A function return value with additional detailed information.\n *\n * @public\n */\n",
2710 "excerptTokens": [
2711 {
2712 "kind": "Content",
2713 "text": "export interface Detail<R> "
2714 }
2715 ],
2716 "releaseTag": "Public",
2717 "typeParameters": [
2718 {
2719 "typeParameterName": "R",
2720 "constraintTokenRange": {
2721 "startIndex": 0,
2722 "endIndex": 0
2723 },
2724 "defaultTypeTokenRange": {
2725 "startIndex": 0,
2726 "endIndex": 0
2727 }
2728 }
2729 ],
2730 "name": "Detail",
2731 "members": [
2732 {
2733 "kind": "PropertySignature",
2734 "canonicalReference": "faastjs!Detail#executionId:member",
2735 "docComment": "/**\n * If available, the provider-specific execution identifier for this invocation.\n *\n * @remarks\n *\n * This ID may be added to the log entries for this invocation by the cloud provider.\n */\n",
2736 "excerptTokens": [
2737 {
2738 "kind": "Content",
2739 "text": "executionId?: "
2740 },
2741 {
2742 "kind": "Content",
2743 "text": "string"
2744 },
2745 {
2746 "kind": "Content",
2747 "text": ";"
2748 }
2749 ],
2750 "isOptional": true,
2751 "releaseTag": "Public",
2752 "name": "executionId",
2753 "propertyTypeTokenRange": {
2754 "startIndex": 1,
2755 "endIndex": 2
2756 }
2757 },
2758 {
2759 "kind": "PropertySignature",
2760 "canonicalReference": "faastjs!Detail#instanceId:member",
2761 "docComment": "/**\n * If available, the provider-specific instance identifier for this invocation.\n *\n * @remarks\n *\n * This ID refers to the specific container or VM used to execute this function invocation. The instance may be reused across multiple invocations.\n */\n",
2762 "excerptTokens": [
2763 {
2764 "kind": "Content",
2765 "text": "instanceId?: "
2766 },
2767 {
2768 "kind": "Content",
2769 "text": "string"
2770 },
2771 {
2772 "kind": "Content",
2773 "text": ";"
2774 }
2775 ],
2776 "isOptional": true,
2777 "releaseTag": "Public",
2778 "name": "instanceId",
2779 "propertyTypeTokenRange": {
2780 "startIndex": 1,
2781 "endIndex": 2
2782 }
2783 },
2784 {
2785 "kind": "PropertySignature",
2786 "canonicalReference": "faastjs!Detail#logUrl:member",
2787 "docComment": "/**\n * The URL of the logs for the specific execution of this function call.\n *\n * @remarks\n *\n * This is different from the general logUrl from {@link FaastModule.logUrl}, which provides a link to the logs for all invocations of all functions within that module. Whereas this logUrl is only for this specific invocation.\n */\n",
2788 "excerptTokens": [
2789 {
2790 "kind": "Content",
2791 "text": "logUrl?: "
2792 },
2793 {
2794 "kind": "Content",
2795 "text": "string"
2796 },
2797 {
2798 "kind": "Content",
2799 "text": ";"
2800 }
2801 ],
2802 "isOptional": true,
2803 "releaseTag": "Public",
2804 "name": "logUrl",
2805 "propertyTypeTokenRange": {
2806 "startIndex": 1,
2807 "endIndex": 2
2808 }
2809 },
2810 {
2811 "kind": "PropertySignature",
2812 "canonicalReference": "faastjs!Detail#value:member",
2813 "docComment": "/**\n * A Promise for the function's return value.\n */\n",
2814 "excerptTokens": [
2815 {
2816 "kind": "Content",
2817 "text": "value: "
2818 },
2819 {
2820 "kind": "Content",
2821 "text": "R"
2822 },
2823 {
2824 "kind": "Content",
2825 "text": ";"
2826 }
2827 ],
2828 "isOptional": false,
2829 "releaseTag": "Public",
2830 "name": "value",
2831 "propertyTypeTokenRange": {
2832 "startIndex": 1,
2833 "endIndex": 2
2834 }
2835 }
2836 ],
2837 "extendsTokenRanges": []
2838 },
2839 {
2840 "kind": "Function",
2841 "canonicalReference": "faastjs!faast:function(1)",
2842 "docComment": "/**\n * The main entry point for faast with any provider and only common options.\n *\n * @remarks\n *\n * Example of usage:\n * ```typescript\n * import { faast } from \"faastjs\";\n * import * as mod from \"./path/to/module\";\n * (async () => {\n * const faastModule = await faast(\"aws\", mod);\n * try {\n * const result = await faastModule.functions.func(\"arg\");\n * } finally {\n * await faastModule.cleanup();\n * }\n * })();\n * ```\n *\n * @param provider - One of `\"aws\"`, `\"google\"`, or `\"local\"`. See {@link Provider}.\n *\n * @param fmodule - A module imported with `import * as X from \"Y\";`. Using `require` also works but loses type information.\n *\n * @param options - See {@link CommonOptions}.\n *\n * @returns See {@link FaastModule}.\n *\n * @public\n */\n",
2843 "excerptTokens": [
2844 {
2845 "kind": "Content",
2846 "text": "export declare function faast<M extends "
2847 },
2848 {
2849 "kind": "Content",
2850 "text": "object"
2851 },
2852 {
2853 "kind": "Content",
2854 "text": ">(provider: "
2855 },
2856 {
2857 "kind": "Reference",
2858 "text": "Provider",
2859 "canonicalReference": "faastjs!Provider:type"
2860 },
2861 {
2862 "kind": "Content",
2863 "text": ", fmodule: "
2864 },
2865 {
2866 "kind": "Content",
2867 "text": "M"
2868 },
2869 {
2870 "kind": "Content",
2871 "text": ", options?: "
2872 },
2873 {
2874 "kind": "Reference",
2875 "text": "CommonOptions",
2876 "canonicalReference": "faastjs!CommonOptions:interface"
2877 },
2878 {
2879 "kind": "Content",
2880 "text": "): "
2881 },
2882 {
2883 "kind": "Reference",
2884 "text": "Promise",
2885 "canonicalReference": "!Promise:interface"
2886 },
2887 {
2888 "kind": "Content",
2889 "text": "<"
2890 },
2891 {
2892 "kind": "Reference",
2893 "text": "FaastModule",
2894 "canonicalReference": "faastjs!FaastModule:interface"
2895 },
2896 {
2897 "kind": "Content",
2898 "text": "<M>>"
2899 },
2900 {
2901 "kind": "Content",
2902 "text": ";"
2903 }
2904 ],
2905 "returnTypeTokenRange": {
2906 "startIndex": 9,
2907 "endIndex": 13
2908 },
2909 "releaseTag": "Public",
2910 "overloadIndex": 1,
2911 "parameters": [
2912 {
2913 "parameterName": "provider",
2914 "parameterTypeTokenRange": {
2915 "startIndex": 3,
2916 "endIndex": 4
2917 }
2918 },
2919 {
2920 "parameterName": "fmodule",
2921 "parameterTypeTokenRange": {
2922 "startIndex": 5,
2923 "endIndex": 6
2924 }
2925 },
2926 {
2927 "parameterName": "options",
2928 "parameterTypeTokenRange": {
2929 "startIndex": 7,
2930 "endIndex": 8
2931 }
2932 }
2933 ],
2934 "typeParameters": [
2935 {
2936 "typeParameterName": "M",
2937 "constraintTokenRange": {
2938 "startIndex": 1,
2939 "endIndex": 2
2940 },
2941 "defaultTypeTokenRange": {
2942 "startIndex": 0,
2943 "endIndex": 0
2944 }
2945 }
2946 ],
2947 "name": "faast"
2948 },
2949 {
2950 "kind": "Function",
2951 "canonicalReference": "faastjs!faastAws:function(1)",
2952 "docComment": "/**\n * The main entry point for faast with AWS provider.\n *\n * @param fmodule - A module imported with `import * as X from \"Y\";`. Using `require` also works but loses type information.\n *\n * @param options - Most common options are in {@link CommonOptions}. Additional AWS-specific options are in {@link AwsOptions}.\n *\n * @public\n */\n",
2953 "excerptTokens": [
2954 {
2955 "kind": "Content",
2956 "text": "export declare function faastAws<M extends "
2957 },
2958 {
2959 "kind": "Content",
2960 "text": "object"
2961 },
2962 {
2963 "kind": "Content",
2964 "text": ">(fmodule: "
2965 },
2966 {
2967 "kind": "Content",
2968 "text": "M"
2969 },
2970 {
2971 "kind": "Content",
2972 "text": ", options?: "
2973 },
2974 {
2975 "kind": "Reference",
2976 "text": "AwsOptions",
2977 "canonicalReference": "faastjs!AwsOptions:interface"
2978 },
2979 {
2980 "kind": "Content",
2981 "text": "): "
2982 },
2983 {
2984 "kind": "Reference",
2985 "text": "Promise",
2986 "canonicalReference": "!Promise:interface"
2987 },
2988 {
2989 "kind": "Content",
2990 "text": "<"
2991 },
2992 {
2993 "kind": "Reference",
2994 "text": "AwsFaastModule",
2995 "canonicalReference": "faastjs!AwsFaastModule:type"
2996 },
2997 {
2998 "kind": "Content",
2999 "text": "<M>>"
3000 },
3001 {
3002 "kind": "Content",
3003 "text": ";"
3004 }
3005 ],
3006 "returnTypeTokenRange": {
3007 "startIndex": 7,
3008 "endIndex": 11
3009 },
3010 "releaseTag": "Public",
3011 "overloadIndex": 1,
3012 "parameters": [
3013 {
3014 "parameterName": "fmodule",
3015 "parameterTypeTokenRange": {
3016 "startIndex": 3,
3017 "endIndex": 4
3018 }
3019 },
3020 {
3021 "parameterName": "options",
3022 "parameterTypeTokenRange": {
3023 "startIndex": 5,
3024 "endIndex": 6
3025 }
3026 }
3027 ],
3028 "typeParameters": [
3029 {
3030 "typeParameterName": "M",
3031 "constraintTokenRange": {
3032 "startIndex": 1,
3033 "endIndex": 2
3034 },
3035 "defaultTypeTokenRange": {
3036 "startIndex": 0,
3037 "endIndex": 0
3038 }
3039 }
3040 ],
3041 "name": "faastAws"
3042 },
3043 {
3044 "kind": "Class",
3045 "canonicalReference": "faastjs!FaastError:class",
3046 "docComment": "/**\n * FaastError is a subclass of VError (https://github.com/joyent/node-verror). that is thrown by faast.js APIs and cloud function invocations.\n *\n * @remarks\n *\n * `FaastError` is a subclass of {@link https://github.com/joyent/node-verror | VError}, which provides an API for nested error handling. The main API is the same as the standard Error class, namely the err.message, err.name, and err.stack properties.\n *\n * Several static methods on {@link FaastError} are inherited from VError:\n *\n * FaastError.fullStack(err) - property provides a more detailed stack trace that include stack traces of causes in the causal chain.\n *\n * FaastError.info(err) - returns an object with fields `functionName`, `args`, and `logUrl`. The `logUrl` property is a URL pointing to the logs for a specific invocation that caused the error.`logUrl` will be surrounded by whitespace on both sides to ease parsing as a URL by IDEs.\n *\n * FaastError.hasCauseWithName(err, cause) - returns true if the FaastError or any of its causes includes an error with the given name, otherwise false. All of the available names are in the enum {@link FaastErrorNames}. For example, to detect if a FaastError was caused by a cloud function timeout:\n * ```typescript\n * FaastError.hasCauseWithName(err, FaastErrorNames.ETIMEOUT)\n * ```\n *\n * FaastError.findCauseByName(err, cause) - like FaastError.hasCauseWithName() except it returns the Error in the causal chain with the given name instead of a boolean, otherwise null.\n *\n * @public\n */\n",
3047 "excerptTokens": [
3048 {
3049 "kind": "Content",
3050 "text": "export declare class FaastError extends "
3051 },
3052 {
3053 "kind": "Reference",
3054 "text": "VError",
3055 "canonicalReference": "@types/verror!~VError.VError"
3056 },
3057 {
3058 "kind": "Content",
3059 "text": " "
3060 }
3061 ],
3062 "releaseTag": "Public",
3063 "name": "FaastError",
3064 "members": [],
3065 "extendsTokenRange": {
3066 "startIndex": 1,
3067 "endIndex": 3
3068 },
3069 "implementsTokenRanges": []
3070 },
3071 {
3072 "kind": "Enum",
3073 "canonicalReference": "faastjs!FaastErrorNames:enum",
3074 "docComment": "/**\n * Possible FaastError names. See {@link FaastError}. To test for errors matching these names, use the static method {@link FaastError}.hasCauseWithName().\n *\n * @public\n */\n",
3075 "excerptTokens": [
3076 {
3077 "kind": "Content",
3078 "text": "export declare enum FaastErrorNames "
3079 }
3080 ],
3081 "releaseTag": "Public",
3082 "name": "FaastErrorNames",
3083 "members": [
3084 {
3085 "kind": "EnumMember",
3086 "canonicalReference": "faastjs!FaastErrorNames.ECANCEL:member",
3087 "docComment": "/**\n * The function invocation was cancelled by user request.\n */\n",
3088 "excerptTokens": [
3089 {
3090 "kind": "Content",
3091 "text": "ECANCEL = "
3092 },
3093 {
3094 "kind": "Content",
3095 "text": "\"FaastCancelError\""
3096 }
3097 ],
3098 "releaseTag": "Public",
3099 "name": "ECANCEL",
3100 "initializerTokenRange": {
3101 "startIndex": 1,
3102 "endIndex": 2
3103 }
3104 },
3105 {
3106 "kind": "EnumMember",
3107 "canonicalReference": "faastjs!FaastErrorNames.ECONCURRENCY:member",
3108 "docComment": "/**\n * The remote cloud function failed to execute because of limited concurrency.\n */\n",
3109 "excerptTokens": [
3110 {
3111 "kind": "Content",
3112 "text": "ECONCURRENCY = "
3113 },
3114 {
3115 "kind": "Content",
3116 "text": "\"FaastConcurrencyError\""
3117 }
3118 ],
3119 "releaseTag": "Public",
3120 "name": "ECONCURRENCY",
3121 "initializerTokenRange": {
3122 "startIndex": 1,
3123 "endIndex": 2
3124 }
3125 },
3126 {
3127 "kind": "EnumMember",
3128 "canonicalReference": "faastjs!FaastErrorNames.ECREATE:member",
3129 "docComment": "/**\n * Could not create the remote cloud function or supporting infrastructure.\n */\n",
3130 "excerptTokens": [
3131 {
3132 "kind": "Content",
3133 "text": "ECREATE = "
3134 },
3135 {
3136 "kind": "Content",
3137 "text": "\"FaastCreateFunctionError\""
3138 }
3139 ],
3140 "releaseTag": "Public",
3141 "name": "ECREATE",
3142 "initializerTokenRange": {
3143 "startIndex": 1,
3144 "endIndex": 2
3145 }
3146 },
3147 {
3148 "kind": "EnumMember",
3149 "canonicalReference": "faastjs!FaastErrorNames.EEXCEPTION:member",
3150 "docComment": "/**\n * The exception was thrown by user's remote code, not by faast.js or the cloud provider.\n */\n",
3151 "excerptTokens": [
3152 {
3153 "kind": "Content",
3154 "text": "EEXCEPTION = "
3155 },
3156 {
3157 "kind": "Content",
3158 "text": "\"UserException\""
3159 }
3160 ],
3161 "releaseTag": "Public",
3162 "name": "EEXCEPTION",
3163 "initializerTokenRange": {
3164 "startIndex": 1,
3165 "endIndex": 2
3166 }
3167 },
3168 {
3169 "kind": "EnumMember",
3170 "canonicalReference": "faastjs!FaastErrorNames.EGENERIC:member",
3171 "docComment": "/**\n * Generic error. See {@link FaastError}.\n */\n",
3172 "excerptTokens": [
3173 {
3174 "kind": "Content",
3175 "text": "EGENERIC = "
3176 },
3177 {
3178 "kind": "Content",
3179 "text": "\"VError\""
3180 }
3181 ],
3182 "releaseTag": "Public",
3183 "name": "EGENERIC",
3184 "initializerTokenRange": {
3185 "startIndex": 1,
3186 "endIndex": 2
3187 }
3188 },
3189 {
3190 "kind": "EnumMember",
3191 "canonicalReference": "faastjs!FaastErrorNames.EMEMORY:member",
3192 "docComment": "/**\n * The remote cloud function exceeded memory limits.\n */\n",
3193 "excerptTokens": [
3194 {
3195 "kind": "Content",
3196 "text": "EMEMORY = "
3197 },
3198 {
3199 "kind": "Content",
3200 "text": "\"FaastOutOfMemoryError\""
3201 }
3202 ],
3203 "releaseTag": "Public",
3204 "name": "EMEMORY",
3205 "initializerTokenRange": {
3206 "startIndex": 1,
3207 "endIndex": 2
3208 }
3209 },
3210 {
3211 "kind": "EnumMember",
3212 "canonicalReference": "faastjs!FaastErrorNames.ESERIALIZE:member",
3213 "docComment": "/**\n * The arguments passed to the cloud function could not be serialized without losing information.\n */\n",
3214 "excerptTokens": [
3215 {
3216 "kind": "Content",
3217 "text": "ESERIALIZE = "
3218 },
3219 {
3220 "kind": "Content",
3221 "text": "\"FaastSerializationError\""
3222 }
3223 ],
3224 "releaseTag": "Public",
3225 "name": "ESERIALIZE",
3226 "initializerTokenRange": {
3227 "startIndex": 1,
3228 "endIndex": 2
3229 }
3230 },
3231 {
3232 "kind": "EnumMember",
3233 "canonicalReference": "faastjs!FaastErrorNames.ETIMEOUT:member",
3234 "docComment": "/**\n * The remote cloud function timed out.\n */\n",
3235 "excerptTokens": [
3236 {
3237 "kind": "Content",
3238 "text": "ETIMEOUT = "
3239 },
3240 {
3241 "kind": "Content",
3242 "text": "\"FaastTimeoutError\""
3243 }
3244 ],
3245 "releaseTag": "Public",
3246 "name": "ETIMEOUT",
3247 "initializerTokenRange": {
3248 "startIndex": 1,
3249 "endIndex": 2
3250 }
3251 }
3252 ]
3253 },
3254 {
3255 "kind": "Function",
3256 "canonicalReference": "faastjs!faastGoogle:function(1)",
3257 "docComment": "/**\n * The main entry point for faast with Google provider.\n *\n * @param fmodule - A module imported with `import * as X from \"Y\";`. Using `require` also works but loses type information.\n *\n * @param options - Most common options are in {@link CommonOptions}. Additional Google-specific options are in {@link GoogleOptions}.\n *\n * @public\n */\n",
3258 "excerptTokens": [
3259 {
3260 "kind": "Content",
3261 "text": "export declare function faastGoogle<M extends "
3262 },
3263 {
3264 "kind": "Content",
3265 "text": "object"
3266 },
3267 {
3268 "kind": "Content",
3269 "text": ">(fmodule: "
3270 },
3271 {
3272 "kind": "Content",
3273 "text": "M"
3274 },
3275 {
3276 "kind": "Content",
3277 "text": ", options?: "
3278 },
3279 {
3280 "kind": "Reference",
3281 "text": "GoogleOptions",
3282 "canonicalReference": "faastjs!GoogleOptions:interface"
3283 },
3284 {
3285 "kind": "Content",
3286 "text": "): "
3287 },
3288 {
3289 "kind": "Reference",
3290 "text": "Promise",
3291 "canonicalReference": "!Promise:interface"
3292 },
3293 {
3294 "kind": "Content",
3295 "text": "<"
3296 },
3297 {
3298 "kind": "Reference",
3299 "text": "GoogleFaastModule",
3300 "canonicalReference": "faastjs!GoogleFaastModule:type"
3301 },
3302 {
3303 "kind": "Content",
3304 "text": "<M>>"
3305 },
3306 {
3307 "kind": "Content",
3308 "text": ";"
3309 }
3310 ],
3311 "returnTypeTokenRange": {
3312 "startIndex": 7,
3313 "endIndex": 11
3314 },
3315 "releaseTag": "Public",
3316 "overloadIndex": 1,
3317 "parameters": [
3318 {
3319 "parameterName": "fmodule",
3320 "parameterTypeTokenRange": {
3321 "startIndex": 3,
3322 "endIndex": 4
3323 }
3324 },
3325 {
3326 "parameterName": "options",
3327 "parameterTypeTokenRange": {
3328 "startIndex": 5,
3329 "endIndex": 6
3330 }
3331 }
3332 ],
3333 "typeParameters": [
3334 {
3335 "typeParameterName": "M",
3336 "constraintTokenRange": {
3337 "startIndex": 1,
3338 "endIndex": 2
3339 },
3340 "defaultTypeTokenRange": {
3341 "startIndex": 0,
3342 "endIndex": 0
3343 }
3344 }
3345 ],
3346 "name": "faastGoogle"
3347 },
3348 {
3349 "kind": "Function",
3350 "canonicalReference": "faastjs!faastLocal:function(1)",
3351 "docComment": "/**\n * The main entry point for faast with Local provider.\n *\n * @param fmodule - A module imported with `import * as X from \"Y\";`. Using `require` also works but loses type information.\n *\n * @param options - Most common options are in {@link CommonOptions}. Additional Local-specific options are in {@link LocalOptions}.\n *\n * @returns a Promise for {@link LocalFaastModule}.\n *\n * @public\n */\n",
3352 "excerptTokens": [
3353 {
3354 "kind": "Content",
3355 "text": "export declare function faastLocal<M extends "
3356 },
3357 {
3358 "kind": "Content",
3359 "text": "object"
3360 },
3361 {
3362 "kind": "Content",
3363 "text": ">(fmodule: "
3364 },
3365 {
3366 "kind": "Content",
3367 "text": "M"
3368 },
3369 {
3370 "kind": "Content",
3371 "text": ", options?: "
3372 },
3373 {
3374 "kind": "Reference",
3375 "text": "LocalOptions",
3376 "canonicalReference": "faastjs!LocalOptions:interface"
3377 },
3378 {
3379 "kind": "Content",
3380 "text": "): "
3381 },
3382 {
3383 "kind": "Reference",
3384 "text": "Promise",
3385 "canonicalReference": "!Promise:interface"
3386 },
3387 {
3388 "kind": "Content",
3389 "text": "<"
3390 },
3391 {
3392 "kind": "Reference",
3393 "text": "LocalFaastModule",
3394 "canonicalReference": "faastjs!LocalFaastModule:type"
3395 },
3396 {
3397 "kind": "Content",
3398 "text": "<M>>"
3399 },
3400 {
3401 "kind": "Content",
3402 "text": ";"
3403 }
3404 ],
3405 "returnTypeTokenRange": {
3406 "startIndex": 7,
3407 "endIndex": 11
3408 },
3409 "releaseTag": "Public",
3410 "overloadIndex": 1,
3411 "parameters": [
3412 {
3413 "parameterName": "fmodule",
3414 "parameterTypeTokenRange": {
3415 "startIndex": 3,
3416 "endIndex": 4
3417 }
3418 },
3419 {
3420 "parameterName": "options",
3421 "parameterTypeTokenRange": {
3422 "startIndex": 5,
3423 "endIndex": 6
3424 }
3425 }
3426 ],
3427 "typeParameters": [
3428 {
3429 "typeParameterName": "M",
3430 "constraintTokenRange": {
3431 "startIndex": 1,
3432 "endIndex": 2
3433 },
3434 "defaultTypeTokenRange": {
3435 "startIndex": 0,
3436 "endIndex": 0
3437 }
3438 }
3439 ],
3440 "name": "faastLocal"
3441 },
3442 {
3443 "kind": "Interface",
3444 "canonicalReference": "faastjs!FaastModule:interface",
3445 "docComment": "/**\n * The main interface for invoking, cleaning up, and managing faast.js cloud functions. Returned by {@link faast}.\n *\n * @public\n */\n",
3446 "excerptTokens": [
3447 {
3448 "kind": "Content",
3449 "text": "export interface FaastModule<M extends "
3450 },
3451 {
3452 "kind": "Content",
3453 "text": "object"
3454 },
3455 {
3456 "kind": "Content",
3457 "text": "> "
3458 }
3459 ],
3460 "releaseTag": "Public",
3461 "typeParameters": [
3462 {
3463 "typeParameterName": "M",
3464 "constraintTokenRange": {
3465 "startIndex": 1,
3466 "endIndex": 2
3467 },
3468 "defaultTypeTokenRange": {
3469 "startIndex": 0,
3470 "endIndex": 0
3471 }
3472 }
3473 ],
3474 "name": "FaastModule",
3475 "members": [
3476 {
3477 "kind": "MethodSignature",
3478 "canonicalReference": "faastjs!FaastModule#cleanup:member(1)",
3479 "docComment": "/**\n * Stop the faast.js runtime for this cloud function and clean up ephemeral cloud resources.\n *\n * @remarks\n *\n * It is best practice to always call `cleanup` when done with a cloud function. A typical way to ensure this in normal execution is to use the `finally` construct:\n * ```typescript\n * const faastModule = await faast(\"aws\", m);\n * try {\n * // Call faastModule.functions.*\n * } finally {\n * // Note the `await`\n * await faastModule.cleanup();\n * }\n * ```\n *\n * After the cleanup promise resolves, the cloud function instance can no longer invoke new calls on {@link FaastModule.functions}. However, other methods on {@link FaastModule} are safe to call, such as {@link FaastModule.costSnapshot}.\n *\n * Cleanup also stops statistics events (See {@link FaastModule.off}).\n *\n * By default, cleanup will delete all ephemeral cloud resources but leave behind cached resources for use by future cloud functions. Deleted resources typically include cloud functions, queues, and queue subscriptions. Logs are not deleted by cleanup.\n *\n * Note that `cleanup` leaves behind some provider-specific resources:\n *\n * - AWS: Cloudwatch logs are preserved until the garbage collector in a future cloud function instance deletes them. The default log expiration time is 24h (or the value of {@link CommonOptions.retentionInDays}). In addition, the AWS Lambda IAM role is not deleted by cleanup. This role is shared across cloud function instances. Lambda layers are also not cleaned up immediately on AWS when {@link CommonOptions.packageJson} is used and {@link CommonOptions.useDependencyCaching} is true. Cached layers are cleaned up by garbage collection. Also see {@link CleanupOptions.deleteCaches}.\n *\n * - Google: Google Stackdriver automatically deletes log entries after 30 days.\n *\n * - Local: Logs are preserved in a temporary directory on local disk. Garbage collection in a future cloud function instance will delete logs older than 24h.\n *\n * @returns a Promise that resolves when the `FaastModule` runtime stops and ephemeral resources have been deleted.\n */\n",
3480 "excerptTokens": [
3481 {
3482 "kind": "Content",
3483 "text": "cleanup(options?: "
3484 },
3485 {
3486 "kind": "Reference",
3487 "text": "CleanupOptions",
3488 "canonicalReference": "faastjs!CleanupOptions:interface"
3489 },
3490 {
3491 "kind": "Content",
3492 "text": "): "
3493 },
3494 {
3495 "kind": "Reference",
3496 "text": "Promise",
3497 "canonicalReference": "!Promise:interface"
3498 },
3499 {
3500 "kind": "Content",
3501 "text": "<void>"
3502 },
3503 {
3504 "kind": "Content",
3505 "text": ";"
3506 }
3507 ],
3508 "isOptional": false,
3509 "returnTypeTokenRange": {
3510 "startIndex": 3,
3511 "endIndex": 5
3512 },
3513 "releaseTag": "Public",
3514 "overloadIndex": 1,
3515 "parameters": [
3516 {
3517 "parameterName": "options",
3518 "parameterTypeTokenRange": {
3519 "startIndex": 1,
3520 "endIndex": 2
3521 }
3522 }
3523 ],
3524 "name": "cleanup"
3525 },
3526 {
3527 "kind": "MethodSignature",
3528 "canonicalReference": "faastjs!FaastModule#costSnapshot:member(1)",
3529 "docComment": "/**\n * Get a near real-time cost estimate of cloud function invocations.\n *\n * @remarks\n *\n * A cost snapshot provides a near real-time estimate of the costs of the cloud functions invoked. The cost estimate only includes the cost of successfully completed calls. Unsuccessful calls may lack the data required to provide cost information. Calls that are still in flight are not included in the cost snapshot. For this reason, it is typically a good idea to get a cost snapshot after awaiting the result of {@link FaastModule.cleanup}.\n *\n * Code example:\n * ```typescript\n * const faastModule = await faast(\"aws\", m);\n * try {\n * // invoke cloud functions on faastModule.functions.*\n * } finally {\n * await faastModule.cleanup();\n * const costSnapshot = await faastModule.costSnapshot();\n * console.log(costSnapshot);\n * }\n * ```\n *\n * @returns a Promise for a {@link CostSnapshot}.\n */\n",
3530 "excerptTokens": [
3531 {
3532 "kind": "Content",
3533 "text": "costSnapshot(): "
3534 },
3535 {
3536 "kind": "Reference",
3537 "text": "Promise",
3538 "canonicalReference": "!Promise:interface"
3539 },
3540 {
3541 "kind": "Content",
3542 "text": "<"
3543 },
3544 {
3545 "kind": "Reference",
3546 "text": "CostSnapshot",
3547 "canonicalReference": "faastjs!CostSnapshot:class"
3548 },
3549 {
3550 "kind": "Content",
3551 "text": ">"
3552 },
3553 {
3554 "kind": "Content",
3555 "text": ";"
3556 }
3557 ],
3558 "isOptional": false,
3559 "returnTypeTokenRange": {
3560 "startIndex": 1,
3561 "endIndex": 5
3562 },
3563 "releaseTag": "Public",
3564 "overloadIndex": 1,
3565 "parameters": [],
3566 "name": "costSnapshot"
3567 },
3568 {
3569 "kind": "PropertySignature",
3570 "canonicalReference": "faastjs!FaastModule#functions:member",
3571 "docComment": "/**\n * Each call of a cloud function creates a separate remote invocation.\n *\n * @remarks\n *\n * The module passed into {@link faast} or its provider-specific variants ({@link faastAws}, {@link faastGoogle}, and {@link faastLocal}) is mapped to a {@link ProxyModule} version of the module, which performs the following mapping:\n *\n * - All function exports that are generators are mapped to async generators.\n *\n * - All function exports that return async generators are preserved as-is.\n *\n * - All function exports that return promises have their type signatures preserved as-is.\n *\n * - All function exports that return type T, where T is not a Promise, Generator, or AsyncGenerator, are mapped to functions that return Promise<T>. Argument types are preserved as-is.\n *\n * - All non-function exports are omitted in the remote module.\n *\n * Arguments and return values are serialized with `JSON.stringify` when cloud functions are called, therefore what is received on the remote side might not match what was sent. Faast.js attempts to detect nonsupported arguments on a best effort basis.\n *\n * If the cloud function throws an exception or rejects its promise with an instance of `Error`, then the function will reject with {@link FaastError} on the local side. If the exception or rejection resolves to any value that is not an instance of `Error`, the remote function proxy will reject with the value of `JSON.parse(JSON.stringify(err))`.\n *\n * Arguments and return values have size limitations that vary by provider and mode:\n *\n * - AWS: 256KB in queue mode, 6MB arguments and 256KB return values in https mode. See {@link https://docs.aws.amazon.com/lambda/latest/dg/limits.html | AWS Lambda Limits}.\n *\n * - Google: 10MB in https and queue modes. See {@link https://cloud.google.com/functions/quotas | Google Cloud Function Quotas}.\n *\n * - Local: limited only by available memory and the limits of {@link https://nodejs.org/api/child_process.html#child_process_subprocess_send_message_sendhandle_options_callback | childprocess.send}.\n *\n * Note that payloads may be base64 encoded for some providers and therefore different in size than the original payload. Also, some bookkeeping data are passed along with arguments and contribute to the size limit.\n */\n",
3572 "excerptTokens": [
3573 {
3574 "kind": "Content",
3575 "text": "functions: "
3576 },
3577 {
3578 "kind": "Reference",
3579 "text": "ProxyModule",
3580 "canonicalReference": "faastjs!ProxyModule:type"
3581 },
3582 {
3583 "kind": "Content",
3584 "text": "<M>"
3585 },
3586 {
3587 "kind": "Content",
3588 "text": ";"
3589 }
3590 ],
3591 "isOptional": false,
3592 "releaseTag": "Public",
3593 "name": "functions",
3594 "propertyTypeTokenRange": {
3595 "startIndex": 1,
3596 "endIndex": 3
3597 }
3598 },
3599 {
3600 "kind": "PropertySignature",
3601 "canonicalReference": "faastjs!FaastModule#functionsDetail:member",
3602 "docComment": "/**\n * Similar to {@link FaastModule.functions} except each function returns a {@link Detail} object\n *\n * @remarks\n *\n * Advanced users of faast.js may want more information about each function invocation than simply the result of the function call. For example, the specific logUrl for each invocation, to help with detailed debugging. This interface provides a way to get this detailed information.\n */\n",
3603 "excerptTokens": [
3604 {
3605 "kind": "Content",
3606 "text": "functionsDetail: "
3607 },
3608 {
3609 "kind": "Reference",
3610 "text": "ProxyModuleDetail",
3611 "canonicalReference": "faastjs!ProxyModuleDetail:type"
3612 },
3613 {
3614 "kind": "Content",
3615 "text": "<M>"
3616 },
3617 {
3618 "kind": "Content",
3619 "text": ";"
3620 }
3621 ],
3622 "isOptional": false,
3623 "releaseTag": "Public",
3624 "name": "functionsDetail",
3625 "propertyTypeTokenRange": {
3626 "startIndex": 1,
3627 "endIndex": 3
3628 }
3629 },
3630 {
3631 "kind": "MethodSignature",
3632 "canonicalReference": "faastjs!FaastModule#logUrl:member(1)",
3633 "docComment": "/**\n * The URL of logs generated by this cloud function.\n *\n * @remarks\n *\n * Logs are not automatically downloaded because they cause outbound data transfer, which can be expensive. Also, logs may arrive at the logging service well after the cloud functions have completed. This log URL specifically filters the logs for this cloud function instance. Authentication is required to view cloud provider logs.\n *\n * The local provider returns a `file://` url pointing to a file for logs.\n */\n",
3634 "excerptTokens": [
3635 {
3636 "kind": "Content",
3637 "text": "logUrl(): "
3638 },
3639 {
3640 "kind": "Content",
3641 "text": "string"
3642 },
3643 {
3644 "kind": "Content",
3645 "text": ";"
3646 }
3647 ],
3648 "isOptional": false,
3649 "returnTypeTokenRange": {
3650 "startIndex": 1,
3651 "endIndex": 2
3652 },
3653 "releaseTag": "Public",
3654 "overloadIndex": 1,
3655 "parameters": [],
3656 "name": "logUrl"
3657 },
3658 {
3659 "kind": "MethodSignature",
3660 "canonicalReference": "faastjs!FaastModule#off:member(1)",
3661 "docComment": "/**\n * Deregister a callback for statistics events.\n *\n * @remarks\n *\n * Stops the callback listener from receiving future function statistics events. Calling {@link FaastModule.cleanup} also turns off statistics events.\n */\n",
3662 "excerptTokens": [
3663 {
3664 "kind": "Content",
3665 "text": "off(name: "
3666 },
3667 {
3668 "kind": "Content",
3669 "text": "\"stats\""
3670 },
3671 {
3672 "kind": "Content",
3673 "text": ", listener: "
3674 },
3675 {
3676 "kind": "Content",
3677 "text": "(statsEvent: "
3678 },
3679 {
3680 "kind": "Reference",
3681 "text": "FunctionStatsEvent",
3682 "canonicalReference": "faastjs!FunctionStatsEvent:class"
3683 },
3684 {
3685 "kind": "Content",
3686 "text": ") => void"
3687 },
3688 {
3689 "kind": "Content",
3690 "text": "): "
3691 },
3692 {
3693 "kind": "Content",
3694 "text": "void"
3695 },
3696 {
3697 "kind": "Content",
3698 "text": ";"
3699 }
3700 ],
3701 "isOptional": false,
3702 "returnTypeTokenRange": {
3703 "startIndex": 7,
3704 "endIndex": 8
3705 },
3706 "releaseTag": "Public",
3707 "overloadIndex": 1,
3708 "parameters": [
3709 {
3710 "parameterName": "name",
3711 "parameterTypeTokenRange": {
3712 "startIndex": 1,
3713 "endIndex": 2
3714 }
3715 },
3716 {
3717 "parameterName": "listener",
3718 "parameterTypeTokenRange": {
3719 "startIndex": 3,
3720 "endIndex": 6
3721 }
3722 }
3723 ],
3724 "name": "off"
3725 },
3726 {
3727 "kind": "MethodSignature",
3728 "canonicalReference": "faastjs!FaastModule#on:member(1)",
3729 "docComment": "/**\n * Register a callback for statistics events.\n *\n * @remarks\n *\n * The callback is invoked once for each cloud function that was invoked within the last 1s interval, with a {@link FunctionStatsEvent} summarizing the statistics for each function. Typical usage:\n * ```typescript\n * faastModule.on(\"stats\", console.log);\n * ```\n *\n */\n",
3730 "excerptTokens": [
3731 {
3732 "kind": "Content",
3733 "text": "on(name: "
3734 },
3735 {
3736 "kind": "Content",
3737 "text": "\"stats\""
3738 },
3739 {
3740 "kind": "Content",
3741 "text": ", listener: "
3742 },
3743 {
3744 "kind": "Content",
3745 "text": "(statsEvent: "
3746 },
3747 {
3748 "kind": "Reference",
3749 "text": "FunctionStatsEvent",
3750 "canonicalReference": "faastjs!FunctionStatsEvent:class"
3751 },
3752 {
3753 "kind": "Content",
3754 "text": ") => void"
3755 },
3756 {
3757 "kind": "Content",
3758 "text": "): "
3759 },
3760 {
3761 "kind": "Content",
3762 "text": "void"
3763 },
3764 {
3765 "kind": "Content",
3766 "text": ";"
3767 }
3768 ],
3769 "isOptional": false,
3770 "returnTypeTokenRange": {
3771 "startIndex": 7,
3772 "endIndex": 8
3773 },
3774 "releaseTag": "Public",
3775 "overloadIndex": 1,
3776 "parameters": [
3777 {
3778 "parameterName": "name",
3779 "parameterTypeTokenRange": {
3780 "startIndex": 1,
3781 "endIndex": 2
3782 }
3783 },
3784 {
3785 "parameterName": "listener",
3786 "parameterTypeTokenRange": {
3787 "startIndex": 3,
3788 "endIndex": 6
3789 }
3790 }
3791 ],
3792 "name": "on"
3793 },
3794 {
3795 "kind": "PropertySignature",
3796 "canonicalReference": "faastjs!FaastModule#provider:member",
3797 "docComment": "/**\n * See {@link Provider}.\n */\n",
3798 "excerptTokens": [
3799 {
3800 "kind": "Content",
3801 "text": "provider: "
3802 },
3803 {
3804 "kind": "Reference",
3805 "text": "Provider",
3806 "canonicalReference": "faastjs!Provider:type"
3807 },
3808 {
3809 "kind": "Content",
3810 "text": ";"
3811 }
3812 ],
3813 "isOptional": false,
3814 "releaseTag": "Public",
3815 "name": "provider",
3816 "propertyTypeTokenRange": {
3817 "startIndex": 1,
3818 "endIndex": 2
3819 }
3820 },
3821 {
3822 "kind": "MethodSignature",
3823 "canonicalReference": "faastjs!FaastModule#stats:member(1)",
3824 "docComment": "/**\n * Statistics for a specific function or the entire faast.js module.\n *\n * @param functionName - The name of the function to retrieve statistics for. If the function does not exist or has not been invoked, a new instance of {@link FunctionStats} is returned with zero values. If `functionName` omitted (undefined), then aggregate statistics are returned that summarize all cloud functions within this faast.js module.\n *\n * @returns an snapshot of {@link FunctionStats} at a point in time.\n */\n",
3825 "excerptTokens": [
3826 {
3827 "kind": "Content",
3828 "text": "stats(functionName?: "
3829 },
3830 {
3831 "kind": "Content",
3832 "text": "string"
3833 },
3834 {
3835 "kind": "Content",
3836 "text": "): "
3837 },
3838 {
3839 "kind": "Reference",
3840 "text": "FunctionStats",
3841 "canonicalReference": "faastjs!FunctionStats:class"
3842 },
3843 {
3844 "kind": "Content",
3845 "text": ";"
3846 }
3847 ],
3848 "isOptional": false,
3849 "returnTypeTokenRange": {
3850 "startIndex": 3,
3851 "endIndex": 4
3852 },
3853 "releaseTag": "Public",
3854 "overloadIndex": 1,
3855 "parameters": [
3856 {
3857 "parameterName": "functionName",
3858 "parameterTypeTokenRange": {
3859 "startIndex": 1,
3860 "endIndex": 2
3861 }
3862 }
3863 ],
3864 "name": "stats"
3865 }
3866 ],
3867 "extendsTokenRanges": []
3868 },
3869 {
3870 "kind": "Class",
3871 "canonicalReference": "faastjs!FaastModuleProxy:class",
3872 "docComment": "/**\n * Implementation of {@link FaastModule}.\n *\n * @remarks\n *\n * `FaastModuleProxy` provides a unified developer experience for faast.js modules on top of provider-specific runtime APIs. Most users will not create `FaastModuleProxy` instances themselves; instead use {@link faast}, or {@link faastAws}, {@link faastGoogle}, or {@link faastLocal}. `FaastModuleProxy` implements the {@link FaastModule} interface, which is the preferred public interface for faast modules. `FaastModuleProxy` can be used to access provider-specific details and state, and is useful for deeper testing.\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FaastModuleProxy` class.\n *\n * @public\n */\n",
3873 "excerptTokens": [
3874 {
3875 "kind": "Content",
3876 "text": "export declare class FaastModuleProxy<M extends "
3877 },
3878 {
3879 "kind": "Content",
3880 "text": "object"
3881 },
3882 {
3883 "kind": "Content",
3884 "text": ", O, S> implements "
3885 },
3886 {
3887 "kind": "Reference",
3888 "text": "FaastModule",
3889 "canonicalReference": "faastjs!FaastModule:interface"
3890 },
3891 {
3892 "kind": "Content",
3893 "text": "<M> "
3894 }
3895 ],
3896 "releaseTag": "Public",
3897 "typeParameters": [
3898 {
3899 "typeParameterName": "M",
3900 "constraintTokenRange": {
3901 "startIndex": 1,
3902 "endIndex": 2
3903 },
3904 "defaultTypeTokenRange": {
3905 "startIndex": 0,
3906 "endIndex": 0
3907 }
3908 },
3909 {
3910 "typeParameterName": "O",
3911 "constraintTokenRange": {
3912 "startIndex": 0,
3913 "endIndex": 0
3914 },
3915 "defaultTypeTokenRange": {
3916 "startIndex": 0,
3917 "endIndex": 0
3918 }
3919 },
3920 {
3921 "typeParameterName": "S",
3922 "constraintTokenRange": {
3923 "startIndex": 0,
3924 "endIndex": 0
3925 },
3926 "defaultTypeTokenRange": {
3927 "startIndex": 0,
3928 "endIndex": 0
3929 }
3930 }
3931 ],
3932 "name": "FaastModuleProxy",
3933 "members": [
3934 {
3935 "kind": "Method",
3936 "canonicalReference": "faastjs!FaastModuleProxy#cleanup:member(1)",
3937 "docComment": "/**\n * Stop the faast.js runtime for this cloud function and clean up ephemeral cloud resources.\n *\n * @remarks\n *\n * It is best practice to always call `cleanup` when done with a cloud function. A typical way to ensure this in normal execution is to use the `finally` construct:\n * ```typescript\n * const faastModule = await faast(\"aws\", m);\n * try {\n * // Call faastModule.functions.*\n * } finally {\n * // Note the `await`\n * await faastModule.cleanup();\n * }\n * ```\n *\n * After the cleanup promise resolves, the cloud function instance can no longer invoke new calls on {@link FaastModule.functions}. However, other methods on {@link FaastModule} are safe to call, such as {@link FaastModule.costSnapshot}.\n *\n * Cleanup also stops statistics events (See {@link FaastModule.off}).\n *\n * By default, cleanup will delete all ephemeral cloud resources but leave behind cached resources for use by future cloud functions. Deleted resources typically include cloud functions, queues, and queue subscriptions. Logs are not deleted by cleanup.\n *\n * Note that `cleanup` leaves behind some provider-specific resources:\n *\n * - AWS: Cloudwatch logs are preserved until the garbage collector in a future cloud function instance deletes them. The default log expiration time is 24h (or the value of {@link CommonOptions.retentionInDays}). In addition, the AWS Lambda IAM role is not deleted by cleanup. This role is shared across cloud function instances. Lambda layers are also not cleaned up immediately on AWS when {@link CommonOptions.packageJson} is used and {@link CommonOptions.useDependencyCaching} is true. Cached layers are cleaned up by garbage collection. Also see {@link CleanupOptions.deleteCaches}.\n *\n * - Google: Google Stackdriver automatically deletes log entries after 30 days.\n *\n * - Local: Logs are preserved in a temporary directory on local disk. Garbage collection in a future cloud function instance will delete logs older than 24h.\n *\n * @returns a Promise that resolves when the `FaastModule` runtime stops and ephemeral resources have been deleted.\n */\n",
3938 "excerptTokens": [
3939 {
3940 "kind": "Content",
3941 "text": "cleanup(userCleanupOptions?: "
3942 },
3943 {
3944 "kind": "Reference",
3945 "text": "CleanupOptions",
3946 "canonicalReference": "faastjs!CleanupOptions:interface"
3947 },
3948 {
3949 "kind": "Content",
3950 "text": "): "
3951 },
3952 {
3953 "kind": "Reference",
3954 "text": "Promise",
3955 "canonicalReference": "!Promise:interface"
3956 },
3957 {
3958 "kind": "Content",
3959 "text": "<void>"
3960 },
3961 {
3962 "kind": "Content",
3963 "text": ";"
3964 }
3965 ],
3966 "isOptional": false,
3967 "isStatic": false,
3968 "returnTypeTokenRange": {
3969 "startIndex": 3,
3970 "endIndex": 5
3971 },
3972 "releaseTag": "Public",
3973 "overloadIndex": 1,
3974 "parameters": [
3975 {
3976 "parameterName": "userCleanupOptions",
3977 "parameterTypeTokenRange": {
3978 "startIndex": 1,
3979 "endIndex": 2
3980 }
3981 }
3982 ],
3983 "name": "cleanup"
3984 },
3985 {
3986 "kind": "Method",
3987 "canonicalReference": "faastjs!FaastModuleProxy#costSnapshot:member(1)",
3988 "docComment": "/**\n * Get a near real-time cost estimate of cloud function invocations.\n *\n * @remarks\n *\n * A cost snapshot provides a near real-time estimate of the costs of the cloud functions invoked. The cost estimate only includes the cost of successfully completed calls. Unsuccessful calls may lack the data required to provide cost information. Calls that are still in flight are not included in the cost snapshot. For this reason, it is typically a good idea to get a cost snapshot after awaiting the result of {@link FaastModule.cleanup}.\n *\n * Code example:\n * ```typescript\n * const faastModule = await faast(\"aws\", m);\n * try {\n * // invoke cloud functions on faastModule.functions.*\n * } finally {\n * await faastModule.cleanup();\n * const costSnapshot = await faastModule.costSnapshot();\n * console.log(costSnapshot);\n * }\n * ```\n *\n * @returns a Promise for a {@link CostSnapshot}.\n */\n",
3989 "excerptTokens": [
3990 {
3991 "kind": "Content",
3992 "text": "costSnapshot(): "
3993 },
3994 {
3995 "kind": "Reference",
3996 "text": "Promise",
3997 "canonicalReference": "!Promise:interface"
3998 },
3999 {
4000 "kind": "Content",
4001 "text": "<"
4002 },
4003 {
4004 "kind": "Reference",
4005 "text": "CostSnapshot",
4006 "canonicalReference": "faastjs!CostSnapshot:class"
4007 },
4008 {
4009 "kind": "Content",
4010 "text": ">"
4011 },
4012 {
4013 "kind": "Content",
4014 "text": ";"
4015 }
4016 ],
4017 "isOptional": false,
4018 "isStatic": false,
4019 "returnTypeTokenRange": {
4020 "startIndex": 1,
4021 "endIndex": 5
4022 },
4023 "releaseTag": "Public",
4024 "overloadIndex": 1,
4025 "parameters": [],
4026 "name": "costSnapshot"
4027 },
4028 {
4029 "kind": "Property",
4030 "canonicalReference": "faastjs!FaastModuleProxy#functions:member",
4031 "docComment": "/**\n * Each call of a cloud function creates a separate remote invocation.\n *\n * @remarks\n *\n * The module passed into {@link faast} or its provider-specific variants ({@link faastAws}, {@link faastGoogle}, and {@link faastLocal}) is mapped to a {@link ProxyModule} version of the module, which performs the following mapping:\n *\n * - All function exports that are generators are mapped to async generators.\n *\n * - All function exports that return async generators are preserved as-is.\n *\n * - All function exports that return promises have their type signatures preserved as-is.\n *\n * - All function exports that return type T, where T is not a Promise, Generator, or AsyncGenerator, are mapped to functions that return Promise<T>. Argument types are preserved as-is.\n *\n * - All non-function exports are omitted in the remote module.\n *\n * Arguments and return values are serialized with `JSON.stringify` when cloud functions are called, therefore what is received on the remote side might not match what was sent. Faast.js attempts to detect nonsupported arguments on a best effort basis.\n *\n * If the cloud function throws an exception or rejects its promise with an instance of `Error`, then the function will reject with {@link FaastError} on the local side. If the exception or rejection resolves to any value that is not an instance of `Error`, the remote function proxy will reject with the value of `JSON.parse(JSON.stringify(err))`.\n *\n * Arguments and return values have size limitations that vary by provider and mode:\n *\n * - AWS: 256KB in queue mode, 6MB arguments and 256KB return values in https mode. See {@link https://docs.aws.amazon.com/lambda/latest/dg/limits.html | AWS Lambda Limits}.\n *\n * - Google: 10MB in https and queue modes. See {@link https://cloud.google.com/functions/quotas | Google Cloud Function Quotas}.\n *\n * - Local: limited only by available memory and the limits of {@link https://nodejs.org/api/child_process.html#child_process_subprocess_send_message_sendhandle_options_callback | childprocess.send}.\n *\n * Note that payloads may be base64 encoded for some providers and therefore different in size than the original payload. Also, some bookkeeping data are passed along with arguments and contribute to the size limit.\n */\n",
4032 "excerptTokens": [
4033 {
4034 "kind": "Content",
4035 "text": "functions: "
4036 },
4037 {
4038 "kind": "Reference",
4039 "text": "ProxyModule",
4040 "canonicalReference": "faastjs!ProxyModule:type"
4041 },
4042 {
4043 "kind": "Content",
4044 "text": "<M>"
4045 },
4046 {
4047 "kind": "Content",
4048 "text": ";"
4049 }
4050 ],
4051 "isOptional": false,
4052 "releaseTag": "Public",
4053 "name": "functions",
4054 "propertyTypeTokenRange": {
4055 "startIndex": 1,
4056 "endIndex": 3
4057 },
4058 "isStatic": false
4059 },
4060 {
4061 "kind": "Property",
4062 "canonicalReference": "faastjs!FaastModuleProxy#functionsDetail:member",
4063 "docComment": "/**\n * Similar to {@link FaastModule.functions} except each function returns a {@link Detail} object\n *\n * @remarks\n *\n * Advanced users of faast.js may want more information about each function invocation than simply the result of the function call. For example, the specific logUrl for each invocation, to help with detailed debugging. This interface provides a way to get this detailed information.\n */\n",
4064 "excerptTokens": [
4065 {
4066 "kind": "Content",
4067 "text": "functionsDetail: "
4068 },
4069 {
4070 "kind": "Reference",
4071 "text": "ProxyModuleDetail",
4072 "canonicalReference": "faastjs!ProxyModuleDetail:type"
4073 },
4074 {
4075 "kind": "Content",
4076 "text": "<M>"
4077 },
4078 {
4079 "kind": "Content",
4080 "text": ";"
4081 }
4082 ],
4083 "isOptional": false,
4084 "releaseTag": "Public",
4085 "name": "functionsDetail",
4086 "propertyTypeTokenRange": {
4087 "startIndex": 1,
4088 "endIndex": 3
4089 },
4090 "isStatic": false
4091 },
4092 {
4093 "kind": "Method",
4094 "canonicalReference": "faastjs!FaastModuleProxy#logUrl:member(1)",
4095 "docComment": "/**\n * The URL of logs generated by this cloud function.\n *\n * @remarks\n *\n * Logs are not automatically downloaded because they cause outbound data transfer, which can be expensive. Also, logs may arrive at the logging service well after the cloud functions have completed. This log URL specifically filters the logs for this cloud function instance. Authentication is required to view cloud provider logs.\n *\n * The local provider returns a `file://` url pointing to a file for logs.\n */\n",
4096 "excerptTokens": [
4097 {
4098 "kind": "Content",
4099 "text": "logUrl(): "
4100 },
4101 {
4102 "kind": "Content",
4103 "text": "string"
4104 },
4105 {
4106 "kind": "Content",
4107 "text": ";"
4108 }
4109 ],
4110 "isOptional": false,
4111 "isStatic": false,
4112 "returnTypeTokenRange": {
4113 "startIndex": 1,
4114 "endIndex": 2
4115 },
4116 "releaseTag": "Public",
4117 "overloadIndex": 1,
4118 "parameters": [],
4119 "name": "logUrl"
4120 },
4121 {
4122 "kind": "Method",
4123 "canonicalReference": "faastjs!FaastModuleProxy#off:member(1)",
4124 "docComment": "/**\n * Deregister a callback for statistics events.\n *\n * @remarks\n *\n * Stops the callback listener from receiving future function statistics events. Calling {@link FaastModule.cleanup} also turns off statistics events.\n */\n",
4125 "excerptTokens": [
4126 {
4127 "kind": "Content",
4128 "text": "off(name: "
4129 },
4130 {
4131 "kind": "Content",
4132 "text": "\"stats\""
4133 },
4134 {
4135 "kind": "Content",
4136 "text": ", listener: "
4137 },
4138 {
4139 "kind": "Content",
4140 "text": "(statsEvent: "
4141 },
4142 {
4143 "kind": "Reference",
4144 "text": "FunctionStatsEvent",
4145 "canonicalReference": "faastjs!FunctionStatsEvent:class"
4146 },
4147 {
4148 "kind": "Content",
4149 "text": ") => void"
4150 },
4151 {
4152 "kind": "Content",
4153 "text": "): "
4154 },
4155 {
4156 "kind": "Content",
4157 "text": "void"
4158 },
4159 {
4160 "kind": "Content",
4161 "text": ";"
4162 }
4163 ],
4164 "isOptional": false,
4165 "isStatic": false,
4166 "returnTypeTokenRange": {
4167 "startIndex": 7,
4168 "endIndex": 8
4169 },
4170 "releaseTag": "Public",
4171 "overloadIndex": 1,
4172 "parameters": [
4173 {
4174 "parameterName": "name",
4175 "parameterTypeTokenRange": {
4176 "startIndex": 1,
4177 "endIndex": 2
4178 }
4179 },
4180 {
4181 "parameterName": "listener",
4182 "parameterTypeTokenRange": {
4183 "startIndex": 3,
4184 "endIndex": 6
4185 }
4186 }
4187 ],
4188 "name": "off"
4189 },
4190 {
4191 "kind": "Method",
4192 "canonicalReference": "faastjs!FaastModuleProxy#on:member(1)",
4193 "docComment": "/**\n * Register a callback for statistics events.\n *\n * @remarks\n *\n * The callback is invoked once for each cloud function that was invoked within the last 1s interval, with a {@link FunctionStatsEvent} summarizing the statistics for each function. Typical usage:\n * ```typescript\n * faastModule.on(\"stats\", console.log);\n * ```\n *\n */\n",
4194 "excerptTokens": [
4195 {
4196 "kind": "Content",
4197 "text": "on(name: "
4198 },
4199 {
4200 "kind": "Content",
4201 "text": "\"stats\""
4202 },
4203 {
4204 "kind": "Content",
4205 "text": ", listener: "
4206 },
4207 {
4208 "kind": "Content",
4209 "text": "(statsEvent: "
4210 },
4211 {
4212 "kind": "Reference",
4213 "text": "FunctionStatsEvent",
4214 "canonicalReference": "faastjs!FunctionStatsEvent:class"
4215 },
4216 {
4217 "kind": "Content",
4218 "text": ") => void"
4219 },
4220 {
4221 "kind": "Content",
4222 "text": "): "
4223 },
4224 {
4225 "kind": "Content",
4226 "text": "void"
4227 },
4228 {
4229 "kind": "Content",
4230 "text": ";"
4231 }
4232 ],
4233 "isOptional": false,
4234 "isStatic": false,
4235 "returnTypeTokenRange": {
4236 "startIndex": 7,
4237 "endIndex": 8
4238 },
4239 "releaseTag": "Public",
4240 "overloadIndex": 1,
4241 "parameters": [
4242 {
4243 "parameterName": "name",
4244 "parameterTypeTokenRange": {
4245 "startIndex": 1,
4246 "endIndex": 2
4247 }
4248 },
4249 {
4250 "parameterName": "listener",
4251 "parameterTypeTokenRange": {
4252 "startIndex": 3,
4253 "endIndex": 6
4254 }
4255 }
4256 ],
4257 "name": "on"
4258 },
4259 {
4260 "kind": "Property",
4261 "canonicalReference": "faastjs!FaastModuleProxy#options:member",
4262 "docComment": "/**\n * The options set for this instance, which includes default values.\n */\n",
4263 "excerptTokens": [
4264 {
4265 "kind": "Content",
4266 "text": "readonly options: "
4267 },
4268 {
4269 "kind": "Reference",
4270 "text": "Required",
4271 "canonicalReference": "!Required:type"
4272 },
4273 {
4274 "kind": "Content",
4275 "text": "<"
4276 },
4277 {
4278 "kind": "Reference",
4279 "text": "CommonOptions",
4280 "canonicalReference": "faastjs!CommonOptions:interface"
4281 },
4282 {
4283 "kind": "Content",
4284 "text": ">"
4285 },
4286 {
4287 "kind": "Content",
4288 "text": ";"
4289 }
4290 ],
4291 "isOptional": false,
4292 "releaseTag": "Public",
4293 "name": "options",
4294 "propertyTypeTokenRange": {
4295 "startIndex": 1,
4296 "endIndex": 5
4297 },
4298 "isStatic": false
4299 },
4300 {
4301 "kind": "Property",
4302 "canonicalReference": "faastjs!FaastModuleProxy#provider:member",
4303 "docComment": "/**\n * The {@link Provider}, e.g. \"aws\" or \"google\".\n */\n",
4304 "excerptTokens": [
4305 {
4306 "kind": "Content",
4307 "text": "provider: "
4308 },
4309 {
4310 "kind": "Reference",
4311 "text": "Provider",
4312 "canonicalReference": "faastjs!Provider:type"
4313 },
4314 {
4315 "kind": "Content",
4316 "text": ";"
4317 }
4318 ],
4319 "isOptional": false,
4320 "releaseTag": "Public",
4321 "name": "provider",
4322 "propertyTypeTokenRange": {
4323 "startIndex": 1,
4324 "endIndex": 2
4325 },
4326 "isStatic": false
4327 },
4328 {
4329 "kind": "Method",
4330 "canonicalReference": "faastjs!FaastModuleProxy#stats:member(1)",
4331 "docComment": "/**\n * Statistics for a specific function or the entire faast.js module.\n *\n * @param functionName - The name of the function to retrieve statistics for. If the function does not exist or has not been invoked, a new instance of {@link FunctionStats} is returned with zero values. If `functionName` omitted (undefined), then aggregate statistics are returned that summarize all cloud functions within this faast.js module.\n *\n * @returns an snapshot of {@link FunctionStats} at a point in time.\n */\n",
4332 "excerptTokens": [
4333 {
4334 "kind": "Content",
4335 "text": "stats(functionName?: "
4336 },
4337 {
4338 "kind": "Content",
4339 "text": "string"
4340 },
4341 {
4342 "kind": "Content",
4343 "text": "): "
4344 },
4345 {
4346 "kind": "Reference",
4347 "text": "FunctionStats",
4348 "canonicalReference": "faastjs!FunctionStats:class"
4349 },
4350 {
4351 "kind": "Content",
4352 "text": ";"
4353 }
4354 ],
4355 "isOptional": false,
4356 "isStatic": false,
4357 "returnTypeTokenRange": {
4358 "startIndex": 3,
4359 "endIndex": 4
4360 },
4361 "releaseTag": "Public",
4362 "overloadIndex": 1,
4363 "parameters": [
4364 {
4365 "parameterName": "functionName",
4366 "parameterTypeTokenRange": {
4367 "startIndex": 1,
4368 "endIndex": 2
4369 }
4370 }
4371 ],
4372 "name": "stats"
4373 }
4374 ],
4375 "implementsTokenRanges": [
4376 {
4377 "startIndex": 3,
4378 "endIndex": 5
4379 }
4380 ]
4381 },
4382 {
4383 "kind": "Class",
4384 "canonicalReference": "faastjs!FunctionStats:class",
4385 "docComment": "/**\n * Summary statistics for function invocations.\n *\n * @remarks\n * ```\n * localStartLatency remoteStartLatency executionTime\n * ◀──────────────────▶◁ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▷◀──────────▶\n *\n * ┌───────────────────────────────────┬──────────────────────────────────────┐\n * │ │ │\n * │ Local │ Cloud Provider │\n * │ │ │\n * │ ┌─────────┐ │ ┌──────────┐ ┌──────────┐ │\n * │ │ │ │ │ │ │ │ │\n * │ │ local │ │ │ request │ │ │ │\n * │ invoke ────────▶│ queue │────┼──▶│ queue ├────────▶│ │ │\n * │ │ │ │ │ │ │ │ │\n * │ └─────────┘ │ └──────────┘ │ cloud │ │\n * │ │ │ function │ │\n * │ ┌─────────┐ │ ┌──────────┐ │ │ │\n * │ │ │ │ │ │ │ │ │\n * │ result ◀────────│ local │◀───┼───│ response │◀────────│ │ │\n * │ │ polling │ │ │ queue │ │ │ │\n * │ │ │ │ │ │ │ │ │\n * │ └─────────┘ │ └──────────┘ └──────────┘ │\n * │ │ │\n * └───────────────────────────────────┴──────────────────────────────────────┘\n *\n * ◁ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▷\n * returnLatency ◀───────▶\n * sendResponseLatency\n * ```\n *\n * `localStartLatency` and `executionTime` are measured on one machine and are free of clock skew. `remoteStartLatency` and `returnLatency` are measured as time differences between machines and are subject to much more uncertainty, and effects like clock skew.\n *\n * All times are in milliseconds.\n *\n * @public\n */\n",
4386 "excerptTokens": [
4387 {
4388 "kind": "Content",
4389 "text": "export declare class FunctionStats "
4390 }
4391 ],
4392 "releaseTag": "Public",
4393 "name": "FunctionStats",
4394 "members": [
4395 {
4396 "kind": "Property",
4397 "canonicalReference": "faastjs!FunctionStats#completed:member",
4398 "docComment": "/**\n * The number of invocations that were successfully completed.\n */\n",
4399 "excerptTokens": [
4400 {
4401 "kind": "Content",
4402 "text": "completed: "
4403 },
4404 {
4405 "kind": "Content",
4406 "text": "number"
4407 },
4408 {
4409 "kind": "Content",
4410 "text": ";"
4411 }
4412 ],
4413 "isOptional": false,
4414 "releaseTag": "Public",
4415 "name": "completed",
4416 "propertyTypeTokenRange": {
4417 "startIndex": 1,
4418 "endIndex": 2
4419 },
4420 "isStatic": false
4421 },
4422 {
4423 "kind": "Property",
4424 "canonicalReference": "faastjs!FunctionStats#errors:member",
4425 "docComment": "/**\n * The number of invocations that resulted in an error. If an invocation is retried, an error is only counted once, no matter how many retries were attempted.\n */\n",
4426 "excerptTokens": [
4427 {
4428 "kind": "Content",
4429 "text": "errors: "
4430 },
4431 {
4432 "kind": "Content",
4433 "text": "number"
4434 },
4435 {
4436 "kind": "Content",
4437 "text": ";"
4438 }
4439 ],
4440 "isOptional": false,
4441 "releaseTag": "Public",
4442 "name": "errors",
4443 "propertyTypeTokenRange": {
4444 "startIndex": 1,
4445 "endIndex": 2
4446 },
4447 "isStatic": false
4448 },
4449 {
4450 "kind": "Property",
4451 "canonicalReference": "faastjs!FunctionStats#estimatedBilledTime:member",
4452 "docComment": "/**\n * Statistics for amount of time billed. This is similar to {@link FunctionStats.executionTime} except each sampled time is rounded up to the next 100ms.\n */\n",
4453 "excerptTokens": [
4454 {
4455 "kind": "Content",
4456 "text": "estimatedBilledTime: "
4457 },
4458 {
4459 "kind": "Reference",
4460 "text": "Statistics",
4461 "canonicalReference": "faastjs!Statistics:class"
4462 },
4463 {
4464 "kind": "Content",
4465 "text": ";"
4466 }
4467 ],
4468 "isOptional": false,
4469 "releaseTag": "Public",
4470 "name": "estimatedBilledTime",
4471 "propertyTypeTokenRange": {
4472 "startIndex": 1,
4473 "endIndex": 2
4474 },
4475 "isStatic": false
4476 },
4477 {
4478 "kind": "Property",
4479 "canonicalReference": "faastjs!FunctionStats#executionTime:member",
4480 "docComment": "/**\n * Statistics for function execution time in milliseconds. This is measured as wall clock time inside the cloud function, and does not include the time taken to send the response to the response queue. Note that most cloud providers round up to the next 100ms for pricing.\n */\n",
4481 "excerptTokens": [
4482 {
4483 "kind": "Content",
4484 "text": "executionTime: "
4485 },
4486 {
4487 "kind": "Reference",
4488 "text": "Statistics",
4489 "canonicalReference": "faastjs!Statistics:class"
4490 },
4491 {
4492 "kind": "Content",
4493 "text": ";"
4494 }
4495 ],
4496 "isOptional": false,
4497 "releaseTag": "Public",
4498 "name": "executionTime",
4499 "propertyTypeTokenRange": {
4500 "startIndex": 1,
4501 "endIndex": 2
4502 },
4503 "isStatic": false
4504 },
4505 {
4506 "kind": "Property",
4507 "canonicalReference": "faastjs!FunctionStats#invocations:member",
4508 "docComment": "/**\n * The number of invocations attempted. If an invocation is retried, this only counts the invocation once.\n */\n",
4509 "excerptTokens": [
4510 {
4511 "kind": "Content",
4512 "text": "invocations: "
4513 },
4514 {
4515 "kind": "Content",
4516 "text": "number"
4517 },
4518 {
4519 "kind": "Content",
4520 "text": ";"
4521 }
4522 ],
4523 "isOptional": false,
4524 "releaseTag": "Public",
4525 "name": "invocations",
4526 "propertyTypeTokenRange": {
4527 "startIndex": 1,
4528 "endIndex": 2
4529 },
4530 "isStatic": false
4531 },
4532 {
4533 "kind": "Property",
4534 "canonicalReference": "faastjs!FunctionStats#localStartLatency:member",
4535 "docComment": "/**\n * Statistics for how long invocations stay in the local queue before being sent to the cloud provider.\n */\n",
4536 "excerptTokens": [
4537 {
4538 "kind": "Content",
4539 "text": "localStartLatency: "
4540 },
4541 {
4542 "kind": "Reference",
4543 "text": "Statistics",
4544 "canonicalReference": "faastjs!Statistics:class"
4545 },
4546 {
4547 "kind": "Content",
4548 "text": ";"
4549 }
4550 ],
4551 "isOptional": false,
4552 "releaseTag": "Public",
4553 "name": "localStartLatency",
4554 "propertyTypeTokenRange": {
4555 "startIndex": 1,
4556 "endIndex": 2
4557 },
4558 "isStatic": false
4559 },
4560 {
4561 "kind": "Property",
4562 "canonicalReference": "faastjs!FunctionStats#remoteStartLatency:member",
4563 "docComment": "/**\n * Statistics for how long requests take to start execution after being sent to the cloud provider. This typically includes remote queueing and cold start times. Because this measurement requires comparing timestamps from different machines, it is subject to clock skew and other effects, and should not be considered highly accurate. It can be useful for detecting excessively high latency problems. Faast.js attempt to correct for clock skew heuristically.\n */\n",
4564 "excerptTokens": [
4565 {
4566 "kind": "Content",
4567 "text": "remoteStartLatency: "
4568 },
4569 {
4570 "kind": "Reference",
4571 "text": "Statistics",
4572 "canonicalReference": "faastjs!Statistics:class"
4573 },
4574 {
4575 "kind": "Content",
4576 "text": ";"
4577 }
4578 ],
4579 "isOptional": false,
4580 "releaseTag": "Public",
4581 "name": "remoteStartLatency",
4582 "propertyTypeTokenRange": {
4583 "startIndex": 1,
4584 "endIndex": 2
4585 },
4586 "isStatic": false
4587 },
4588 {
4589 "kind": "Property",
4590 "canonicalReference": "faastjs!FunctionStats#retries:member",
4591 "docComment": "/**\n * The number of invocation retries attempted. This counts retries attempted by faast.js to recover from transient errors, but does not count retries by the cloud provider.\n */\n",
4592 "excerptTokens": [
4593 {
4594 "kind": "Content",
4595 "text": "retries: "
4596 },
4597 {
4598 "kind": "Content",
4599 "text": "number"
4600 },
4601 {
4602 "kind": "Content",
4603 "text": ";"
4604 }
4605 ],
4606 "isOptional": false,
4607 "releaseTag": "Public",
4608 "name": "retries",
4609 "propertyTypeTokenRange": {
4610 "startIndex": 1,
4611 "endIndex": 2
4612 },
4613 "isStatic": false
4614 },
4615 {
4616 "kind": "Property",
4617 "canonicalReference": "faastjs!FunctionStats#returnLatency:member",
4618 "docComment": "/**\n * Statistics for how long it takes to return a response from the end of execution time to the receipt of the response locally. This measurement requires comparing timestamps from different machines, and is subject to clock skew and other effects. It should not be considered highly accurate. It can be useful for detecting excessively high latency problems. Faast.js attempts to correct for clock skew heuristically.\n */\n",
4619 "excerptTokens": [
4620 {
4621 "kind": "Content",
4622 "text": "returnLatency: "
4623 },
4624 {
4625 "kind": "Reference",
4626 "text": "Statistics",
4627 "canonicalReference": "faastjs!Statistics:class"
4628 },
4629 {
4630 "kind": "Content",
4631 "text": ";"
4632 }
4633 ],
4634 "isOptional": false,
4635 "releaseTag": "Public",
4636 "name": "returnLatency",
4637 "propertyTypeTokenRange": {
4638 "startIndex": 1,
4639 "endIndex": 2
4640 },
4641 "isStatic": false
4642 },
4643 {
4644 "kind": "Property",
4645 "canonicalReference": "faastjs!FunctionStats#sendResponseLatency:member",
4646 "docComment": "/**\n * Statistics for how long it takes to send the response to the response queue.\n */\n",
4647 "excerptTokens": [
4648 {
4649 "kind": "Content",
4650 "text": "sendResponseLatency: "
4651 },
4652 {
4653 "kind": "Reference",
4654 "text": "Statistics",
4655 "canonicalReference": "faastjs!Statistics:class"
4656 },
4657 {
4658 "kind": "Content",
4659 "text": ";"
4660 }
4661 ],
4662 "isOptional": false,
4663 "releaseTag": "Public",
4664 "name": "sendResponseLatency",
4665 "propertyTypeTokenRange": {
4666 "startIndex": 1,
4667 "endIndex": 2
4668 },
4669 "isStatic": false
4670 },
4671 {
4672 "kind": "Method",
4673 "canonicalReference": "faastjs!FunctionStats#toString:member(1)",
4674 "docComment": "/**\n * Summarize the function stats as a string.\n *\n * @returns a string showing the value of completed, retries, errors, and mean execution time. This string excludes invocations by default because it is often fixed.\n */\n",
4675 "excerptTokens": [
4676 {
4677 "kind": "Content",
4678 "text": "toString(): "
4679 },
4680 {
4681 "kind": "Content",
4682 "text": "string"
4683 },
4684 {
4685 "kind": "Content",
4686 "text": ";"
4687 }
4688 ],
4689 "isOptional": false,
4690 "isStatic": false,
4691 "returnTypeTokenRange": {
4692 "startIndex": 1,
4693 "endIndex": 2
4694 },
4695 "releaseTag": "Public",
4696 "overloadIndex": 1,
4697 "parameters": [],
4698 "name": "toString"
4699 }
4700 ],
4701 "implementsTokenRanges": []
4702 },
4703 {
4704 "kind": "Class",
4705 "canonicalReference": "faastjs!FunctionStatsEvent:class",
4706 "docComment": "/**\n * Summarize statistics about cloud function invocations.\n *\n * @remarks\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FunctionStatsEvent` class.\n *\n * @public\n */\n",
4707 "excerptTokens": [
4708 {
4709 "kind": "Content",
4710 "text": "export declare class FunctionStatsEvent "
4711 }
4712 ],
4713 "releaseTag": "Public",
4714 "name": "FunctionStatsEvent",
4715 "members": [
4716 {
4717 "kind": "Property",
4718 "canonicalReference": "faastjs!FunctionStatsEvent#fn:member",
4719 "docComment": "/**\n * The name of the cloud function the statistics are about.\n */\n",
4720 "excerptTokens": [
4721 {
4722 "kind": "Content",
4723 "text": "readonly fn: "
4724 },
4725 {
4726 "kind": "Content",
4727 "text": "string"
4728 },
4729 {
4730 "kind": "Content",
4731 "text": ";"
4732 }
4733 ],
4734 "isOptional": false,
4735 "releaseTag": "Public",
4736 "name": "fn",
4737 "propertyTypeTokenRange": {
4738 "startIndex": 1,
4739 "endIndex": 2
4740 },
4741 "isStatic": false
4742 },
4743 {
4744 "kind": "Property",
4745 "canonicalReference": "faastjs!FunctionStatsEvent#stats:member",
4746 "docComment": "/**\n * See {@link FunctionStats}.\n */\n",
4747 "excerptTokens": [
4748 {
4749 "kind": "Content",
4750 "text": "readonly stats: "
4751 },
4752 {
4753 "kind": "Reference",
4754 "text": "FunctionStats",
4755 "canonicalReference": "faastjs!FunctionStats:class"
4756 },
4757 {
4758 "kind": "Content",
4759 "text": ";"
4760 }
4761 ],
4762 "isOptional": false,
4763 "releaseTag": "Public",
4764 "name": "stats",
4765 "propertyTypeTokenRange": {
4766 "startIndex": 1,
4767 "endIndex": 2
4768 },
4769 "isStatic": false
4770 },
4771 {
4772 "kind": "Method",
4773 "canonicalReference": "faastjs!FunctionStatsEvent#toString:member(1)",
4774 "docComment": "/**\n * Returns a string summarizing the statistics event.\n *\n * @remarks\n *\n * The string includes number of completed calls, errors, and retries, and the mean execution time for the calls that completed within the last time interval (1s).\n */\n",
4775 "excerptTokens": [
4776 {
4777 "kind": "Content",
4778 "text": "toString(): "
4779 },
4780 {
4781 "kind": "Content",
4782 "text": "string"
4783 },
4784 {
4785 "kind": "Content",
4786 "text": ";"
4787 }
4788 ],
4789 "isOptional": false,
4790 "isStatic": false,
4791 "returnTypeTokenRange": {
4792 "startIndex": 1,
4793 "endIndex": 2
4794 },
4795 "releaseTag": "Public",
4796 "overloadIndex": 1,
4797 "parameters": [],
4798 "name": "toString"
4799 }
4800 ],
4801 "implementsTokenRanges": []
4802 },
4803 {
4804 "kind": "TypeAlias",
4805 "canonicalReference": "faastjs!GoogleFaastModule:type",
4806 "docComment": "/**\n * The return type of {@link faastGoogle}. See {@link FaastModuleProxy}.\n *\n * @public\n */\n",
4807 "excerptTokens": [
4808 {
4809 "kind": "Content",
4810 "text": "export declare type GoogleFaastModule<M extends "
4811 },
4812 {
4813 "kind": "Content",
4814 "text": "object "
4815 },
4816 {
4817 "kind": "Content",
4818 "text": "= "
4819 },
4820 {
4821 "kind": "Content",
4822 "text": "object"
4823 },
4824 {
4825 "kind": "Content",
4826 "text": "> = "
4827 },
4828 {
4829 "kind": "Reference",
4830 "text": "FaastModuleProxy",
4831 "canonicalReference": "faastjs!FaastModuleProxy:class"
4832 },
4833 {
4834 "kind": "Content",
4835 "text": "<M, "
4836 },
4837 {
4838 "kind": "Reference",
4839 "text": "GoogleOptions",
4840 "canonicalReference": "faastjs!GoogleOptions:interface"
4841 },
4842 {
4843 "kind": "Content",
4844 "text": ", "
4845 },
4846 {
4847 "kind": "Reference",
4848 "text": "GoogleState",
4849 "canonicalReference": "faastjs!GoogleState:interface"
4850 },
4851 {
4852 "kind": "Content",
4853 "text": ">"
4854 },
4855 {
4856 "kind": "Content",
4857 "text": ";"
4858 }
4859 ],
4860 "releaseTag": "Public",
4861 "name": "GoogleFaastModule",
4862 "typeParameters": [
4863 {
4864 "typeParameterName": "M",
4865 "constraintTokenRange": {
4866 "startIndex": 1,
4867 "endIndex": 2
4868 },
4869 "defaultTypeTokenRange": {
4870 "startIndex": 3,
4871 "endIndex": 4
4872 }
4873 }
4874 ],
4875 "typeTokenRange": {
4876 "startIndex": 5,
4877 "endIndex": 11
4878 }
4879 },
4880 {
4881 "kind": "Interface",
4882 "canonicalReference": "faastjs!GoogleOptions:interface",
4883 "docComment": "/**\n * Google-specific options for {@link faastGoogle}.\n *\n * @public\n */\n",
4884 "excerptTokens": [
4885 {
4886 "kind": "Content",
4887 "text": "export interface GoogleOptions extends "
4888 },
4889 {
4890 "kind": "Reference",
4891 "text": "CommonOptions",
4892 "canonicalReference": "faastjs!CommonOptions:interface"
4893 },
4894 {
4895 "kind": "Content",
4896 "text": " "
4897 }
4898 ],
4899 "releaseTag": "Public",
4900 "name": "GoogleOptions",
4901 "members": [
4902 {
4903 "kind": "PropertySignature",
4904 "canonicalReference": "faastjs!GoogleOptions#googleCloudFunctionOptions:member",
4905 "docComment": "/**\n * Additional options to pass to Google Cloud Function creation. See {@link https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions#CloudFunction | projects.locations.functions}.\n *\n * @remarks\n *\n * If you need specialized options, you can pass them to the Google Cloud Functions API directly. Note that if you override any settings set by faast.js, you may cause faast.js to not work:\n * ```typescript\n * const requestBody: CloudFunctions.Schema$CloudFunction = {\n * name,\n * entryPoint: \"trampoline\",\n * timeout,\n * availableMemoryMb,\n * sourceUploadUrl,\n * runtime: \"nodejs14\",\n * ...googleCloudFunctionOptions\n * };\n * ```\n *\n */\n",
4906 "excerptTokens": [
4907 {
4908 "kind": "Content",
4909 "text": "googleCloudFunctionOptions?: "
4910 },
4911 {
4912 "kind": "Reference",
4913 "text": "CloudFunctions.Schema$CloudFunction",
4914 "canonicalReference": "googleapis!cloudfunctions_v1.Schema$CloudFunction:interface"
4915 },
4916 {
4917 "kind": "Content",
4918 "text": ";"
4919 }
4920 ],
4921 "isOptional": true,
4922 "releaseTag": "Public",
4923 "name": "googleCloudFunctionOptions",
4924 "propertyTypeTokenRange": {
4925 "startIndex": 1,
4926 "endIndex": 2
4927 }
4928 },
4929 {
4930 "kind": "PropertySignature",
4931 "canonicalReference": "faastjs!GoogleOptions#region:member",
4932 "docComment": "/**\n * The region to create resources in. Garbage collection is also limited to this region. Default: `\"us-central1\"`.\n */\n",
4933 "excerptTokens": [
4934 {
4935 "kind": "Content",
4936 "text": "region?: "
4937 },
4938 {
4939 "kind": "Reference",
4940 "text": "GoogleRegion",
4941 "canonicalReference": "faastjs!GoogleRegion:type"
4942 },
4943 {
4944 "kind": "Content",
4945 "text": ";"
4946 }
4947 ],
4948 "isOptional": true,
4949 "releaseTag": "Public",
4950 "name": "region",
4951 "propertyTypeTokenRange": {
4952 "startIndex": 1,
4953 "endIndex": 2
4954 }
4955 }
4956 ],
4957 "extendsTokenRanges": [
4958 {
4959 "startIndex": 1,
4960 "endIndex": 3
4961 }
4962 ]
4963 },
4964 {
4965 "kind": "TypeAlias",
4966 "canonicalReference": "faastjs!GoogleRegion:type",
4967 "docComment": "/**\n * Valid Google Cloud {@link https://cloud.google.com/compute/docs/regions-zones/ | regions}. Only some of these {@link https://cloud.google.com/functions/docs/locations | regions have Cloud Functions}.\n *\n * @public\n */\n",
4968 "excerptTokens": [
4969 {
4970 "kind": "Content",
4971 "text": "export declare type GoogleRegion = "
4972 },
4973 {
4974 "kind": "Content",
4975 "text": "\"asia-east1\" | \"asia-east2\" | \"asia-northeast1\" | \"asia-south1\" | \"asia-southeast1\" | \"australia-southeast1\" | \"europe-north1\" | \"europe-west1\" | \"europe-west2\" | \"europe-west3\" | \"europe-west4\" | \"europe-west6\" | \"northamerica-northeast1\" | \"southamerica-east1\" | \"us-central1\" | \"us-east1\" | \"us-east4\" | \"us-west1\" | \"us-west2\""
4976 },
4977 {
4978 "kind": "Content",
4979 "text": ";"
4980 }
4981 ],
4982 "releaseTag": "Public",
4983 "name": "GoogleRegion",
4984 "typeTokenRange": {
4985 "startIndex": 1,
4986 "endIndex": 2
4987 }
4988 },
4989 {
4990 "kind": "Interface",
4991 "canonicalReference": "faastjs!IncludeOption:interface",
4992 "docComment": "/**\n * Options for the {@link CommonOptions.include} option.\n *\n * @public\n */\n",
4993 "excerptTokens": [
4994 {
4995 "kind": "Content",
4996 "text": "export interface IncludeOption "
4997 }
4998 ],
4999 "releaseTag": "Public",
5000 "name": "IncludeOption",
5001 "members": [
5002 {
5003 "kind": "PropertySignature",
5004 "canonicalReference": "faastjs!IncludeOption#cwd:member",
5005 "docComment": "/**\n * The working directory if `path` is relative. Defaults to `process.cwd()`. For example, if `cwd` is `\"foo\"` and `path` is `\"bar\"`, then the contents of the directory `foo/bar/` will be added to the remote function under the path `bar/`.\n */\n",
5006 "excerptTokens": [
5007 {
5008 "kind": "Content",
5009 "text": "cwd?: "
5010 },
5011 {
5012 "kind": "Content",
5013 "text": "string"
5014 },
5015 {
5016 "kind": "Content",
5017 "text": ";"
5018 }
5019 ],
5020 "isOptional": true,
5021 "releaseTag": "Public",
5022 "name": "cwd",
5023 "propertyTypeTokenRange": {
5024 "startIndex": 1,
5025 "endIndex": 2
5026 }
5027 },
5028 {
5029 "kind": "PropertySignature",
5030 "canonicalReference": "faastjs!IncludeOption#path:member",
5031 "docComment": "/**\n * The path to the directory or glob to add to the cloud function.\n */\n",
5032 "excerptTokens": [
5033 {
5034 "kind": "Content",
5035 "text": "path: "
5036 },
5037 {
5038 "kind": "Content",
5039 "text": "string"
5040 },
5041 {
5042 "kind": "Content",
5043 "text": ";"
5044 }
5045 ],
5046 "isOptional": false,
5047 "releaseTag": "Public",
5048 "name": "path",
5049 "propertyTypeTokenRange": {
5050 "startIndex": 1,
5051 "endIndex": 2
5052 }
5053 }
5054 ],
5055 "extendsTokenRanges": []
5056 },
5057 {
5058 "kind": "Interface",
5059 "canonicalReference": "faastjs!Limits:interface",
5060 "docComment": "/**\n * Specify {@link throttle} limits. These limits shape the way throttle invokes the underlying function.\n *\n * @public\n */\n",
5061 "excerptTokens": [
5062 {
5063 "kind": "Content",
5064 "text": "export interface Limits "
5065 }
5066 ],
5067 "releaseTag": "Public",
5068 "name": "Limits",
5069 "members": [
5070 {
5071 "kind": "PropertySignature",
5072 "canonicalReference": "faastjs!Limits#burst:member",
5073 "docComment": "/**\n * The maximum number of calls to the underlying function to \"burst\" -- e.g. the number that can be issued immediately as long as the rate limit is not exceeded. For example, if rate is 5 and burst is 5, and 10 calls are made to the throttled function, 5 calls are made immediately and then after 1 second, another 5 calls are made immediately. Setting burst to 1 means calls are issued uniformly every `1/rate` seconds. If `rate` is not specified, then `burst` does not apply. Default: 1.\n */\n",
5074 "excerptTokens": [
5075 {
5076 "kind": "Content",
5077 "text": "burst?: "
5078 },
5079 {
5080 "kind": "Content",
5081 "text": "number"
5082 },
5083 {
5084 "kind": "Content",
5085 "text": ";"
5086 }
5087 ],
5088 "isOptional": true,
5089 "releaseTag": "Public",
5090 "name": "burst",
5091 "propertyTypeTokenRange": {
5092 "startIndex": 1,
5093 "endIndex": 2
5094 }
5095 },
5096 {
5097 "kind": "PropertySignature",
5098 "canonicalReference": "faastjs!Limits#cache:member",
5099 "docComment": "/**\n * Similar to `memoize` except the map from function arguments to results is stored in a persistent cache on disk. This is useful to prevent redundant calls to APIs which are expected to return the same results for the same arguments, and which are likely to be called across many faast.js module instantiations. This is used internally by faast.js for caching cloud prices for AWS and Google, and for saving the last garbage collection date for AWS. Persistent cache entries expire after a period of time. See {@link PersistentCache}.\n */\n",
5100 "excerptTokens": [
5101 {
5102 "kind": "Content",
5103 "text": "cache?: "
5104 },
5105 {
5106 "kind": "Reference",
5107 "text": "PersistentCache",
5108 "canonicalReference": "faastjs!PersistentCache:class"
5109 },
5110 {
5111 "kind": "Content",
5112 "text": ";"
5113 }
5114 ],
5115 "isOptional": true,
5116 "releaseTag": "Public",
5117 "name": "cache",
5118 "propertyTypeTokenRange": {
5119 "startIndex": 1,
5120 "endIndex": 2
5121 }
5122 },
5123 {
5124 "kind": "PropertySignature",
5125 "canonicalReference": "faastjs!Limits#concurrency:member",
5126 "docComment": "/**\n * The maximum number of concurrent executions of the underlying function to allow. Must be supplied, there is no default. Specifying `0` or `Infinity` is allowed and means there is no concurrency limit.\n */\n",
5127 "excerptTokens": [
5128 {
5129 "kind": "Content",
5130 "text": "concurrency: "
5131 },
5132 {
5133 "kind": "Content",
5134 "text": "number"
5135 },
5136 {
5137 "kind": "Content",
5138 "text": ";"
5139 }
5140 ],
5141 "isOptional": false,
5142 "releaseTag": "Public",
5143 "name": "concurrency",
5144 "propertyTypeTokenRange": {
5145 "startIndex": 1,
5146 "endIndex": 2
5147 }
5148 },
5149 {
5150 "kind": "PropertySignature",
5151 "canonicalReference": "faastjs!Limits#memoize:member",
5152 "docComment": "/**\n * If `memoize` is `true`, then every call to the throttled function will be saved as an entry in a map from arguments to return value. If same arguments are seen again in a future call, the return value is retrieved from the Map rather than calling the function again. This can be useful for avoiding redundant calls that are expected to return the same results given the same arguments.\n *\n * The arguments will be captured with `JSON.stringify`, therefore types that do not stringify uniquely won't be distinguished from each other. Care must be taken when specifying `memoize` to ensure avoid incorrect results.\n */\n",
5153 "excerptTokens": [
5154 {
5155 "kind": "Content",
5156 "text": "memoize?: "
5157 },
5158 {
5159 "kind": "Content",
5160 "text": "boolean"
5161 },
5162 {
5163 "kind": "Content",
5164 "text": ";"
5165 }
5166 ],
5167 "isOptional": true,
5168 "releaseTag": "Public",
5169 "name": "memoize",
5170 "propertyTypeTokenRange": {
5171 "startIndex": 1,
5172 "endIndex": 2
5173 }
5174 },
5175 {
5176 "kind": "PropertySignature",
5177 "canonicalReference": "faastjs!Limits#rate:member",
5178 "docComment": "/**\n * The maximum number of calls per second to allow to the underlying function. Default: no rate limit.\n */\n",
5179 "excerptTokens": [
5180 {
5181 "kind": "Content",
5182 "text": "rate?: "
5183 },
5184 {
5185 "kind": "Content",
5186 "text": "number"
5187 },
5188 {
5189 "kind": "Content",
5190 "text": ";"
5191 }
5192 ],
5193 "isOptional": true,
5194 "releaseTag": "Public",
5195 "name": "rate",
5196 "propertyTypeTokenRange": {
5197 "startIndex": 1,
5198 "endIndex": 2
5199 }
5200 },
5201 {
5202 "kind": "PropertySignature",
5203 "canonicalReference": "faastjs!Limits#retry:member",
5204 "docComment": "/**\n * Retry if the throttled function returns a rejected promise. `retry` can be a number or a function. If it is a number `N`, then up to `N` additional attempts are made in addition to the initial call. If retry is a function, it should return `true` if another retry attempt should be made, otherwise `false`. The first argument will be the value of the rejected promise from the previous call attempt, and the second argument will be the number of previous retry attempts (e.g. the first call will have value 0). Default: 0 (no retry attempts).\n */\n",
5205 "excerptTokens": [
5206 {
5207 "kind": "Content",
5208 "text": "retry?: "
5209 },
5210 {
5211 "kind": "Content",
5212 "text": "number | ((err: any, retries: number) => boolean)"
5213 },
5214 {
5215 "kind": "Content",
5216 "text": ";"
5217 }
5218 ],
5219 "isOptional": true,
5220 "releaseTag": "Public",
5221 "name": "retry",
5222 "propertyTypeTokenRange": {
5223 "startIndex": 1,
5224 "endIndex": 2
5225 }
5226 }
5227 ],
5228 "extendsTokenRanges": []
5229 },
5230 {
5231 "kind": "TypeAlias",
5232 "canonicalReference": "faastjs!LocalFaastModule:type",
5233 "docComment": "/**\n * The return type of {@link faastLocal}. See {@link FaastModuleProxy}.\n *\n * @public\n */\n",
5234 "excerptTokens": [
5235 {
5236 "kind": "Content",
5237 "text": "export declare type LocalFaastModule<M extends "
5238 },
5239 {
5240 "kind": "Content",
5241 "text": "object "
5242 },
5243 {
5244 "kind": "Content",
5245 "text": "= "
5246 },
5247 {
5248 "kind": "Content",
5249 "text": "object"
5250 },
5251 {
5252 "kind": "Content",
5253 "text": "> = "
5254 },
5255 {
5256 "kind": "Reference",
5257 "text": "FaastModuleProxy",
5258 "canonicalReference": "faastjs!FaastModuleProxy:class"
5259 },
5260 {
5261 "kind": "Content",
5262 "text": "<M, "
5263 },
5264 {
5265 "kind": "Reference",
5266 "text": "LocalOptions",
5267 "canonicalReference": "faastjs!LocalOptions:interface"
5268 },
5269 {
5270 "kind": "Content",
5271 "text": ", "
5272 },
5273 {
5274 "kind": "Reference",
5275 "text": "LocalState",
5276 "canonicalReference": "faastjs!LocalState:interface"
5277 },
5278 {
5279 "kind": "Content",
5280 "text": ">"
5281 },
5282 {
5283 "kind": "Content",
5284 "text": ";"
5285 }
5286 ],
5287 "releaseTag": "Public",
5288 "name": "LocalFaastModule",
5289 "typeParameters": [
5290 {
5291 "typeParameterName": "M",
5292 "constraintTokenRange": {
5293 "startIndex": 1,
5294 "endIndex": 2
5295 },
5296 "defaultTypeTokenRange": {
5297 "startIndex": 3,
5298 "endIndex": 4
5299 }
5300 }
5301 ],
5302 "typeTokenRange": {
5303 "startIndex": 5,
5304 "endIndex": 11
5305 }
5306 },
5307 {
5308 "kind": "Interface",
5309 "canonicalReference": "faastjs!LocalOptions:interface",
5310 "docComment": "/**\n * Local provider options for {@link faastLocal}.\n *\n * @public\n */\n",
5311 "excerptTokens": [
5312 {
5313 "kind": "Content",
5314 "text": "export interface LocalOptions extends "
5315 },
5316 {
5317 "kind": "Reference",
5318 "text": "CommonOptions",
5319 "canonicalReference": "faastjs!CommonOptions:interface"
5320 },
5321 {
5322 "kind": "Content",
5323 "text": " "
5324 }
5325 ],
5326 "releaseTag": "Public",
5327 "name": "LocalOptions",
5328 "members": [],
5329 "extendsTokenRanges": [
5330 {
5331 "startIndex": 1,
5332 "endIndex": 3
5333 }
5334 ]
5335 },
5336 {
5337 "kind": "Variable",
5338 "canonicalReference": "faastjs!log:var",
5339 "docComment": "/**\n * Faast.js loggers.\n *\n * @remarks\n *\n * Unless otherwise specified, each log is disabled by default unless the value of the DEBUG environment variable is set to the corresponding value. For example:\n * ```\n * $ DEBUG=faast:info,faast:provider <cmd>\n * $ DEBUG=faast:* <cmd>\n * ```\n *\n * Logs can also be enabled or disabled programmatically:\n * ```typescript\n * import { log } from \"faastjs\"\n * log.info.enabled = true;\n * log.provider.enabled = true;\n * ```\n *\n * Each log outputs specific information:\n *\n * `info` - General informational logging.\n *\n * `minimal` - Outputs only basic information like the function name created in the cloud.\n *\n * `warn` - Warnings. Enabled by default.\n *\n * `gc` - Garbage collection verbose logging.\n *\n * `leaks` - Memory leak detector warnings for the cloud function. Enabled by default.\n *\n * `calls` - Verbose logging of each faast.js enabled function invocation.\n *\n * `webpack` - Verbose logging from webpack and packaging details.\n *\n * `provider` - Verbose logging of each interaction between faast.js runtime and the provider-specific implementation.\n *\n * `awssdk` - Verbose logging of AWS SDK. This can be useful for identifying which API calls are failing, retrying, or encountering rate limits.\n *\n * @public\n */\n",
5340 "excerptTokens": [
5341 {
5342 "kind": "Content",
5343 "text": "log: "
5344 },
5345 {
5346 "kind": "Content",
5347 "text": "{\n info: "
5348 },
5349 {
5350 "kind": "Reference",
5351 "text": "debug.Debugger",
5352 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5353 },
5354 {
5355 "kind": "Content",
5356 "text": ";\n minimal: "
5357 },
5358 {
5359 "kind": "Reference",
5360 "text": "debug.Debugger",
5361 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5362 },
5363 {
5364 "kind": "Content",
5365 "text": ";\n warn: "
5366 },
5367 {
5368 "kind": "Reference",
5369 "text": "debug.Debugger",
5370 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5371 },
5372 {
5373 "kind": "Content",
5374 "text": ";\n gc: "
5375 },
5376 {
5377 "kind": "Reference",
5378 "text": "debug.Debugger",
5379 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5380 },
5381 {
5382 "kind": "Content",
5383 "text": ";\n leaks: "
5384 },
5385 {
5386 "kind": "Reference",
5387 "text": "debug.Debugger",
5388 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5389 },
5390 {
5391 "kind": "Content",
5392 "text": ";\n calls: "
5393 },
5394 {
5395 "kind": "Reference",
5396 "text": "debug.Debugger",
5397 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5398 },
5399 {
5400 "kind": "Content",
5401 "text": ";\n webpack: "
5402 },
5403 {
5404 "kind": "Reference",
5405 "text": "debug.Debugger",
5406 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5407 },
5408 {
5409 "kind": "Content",
5410 "text": ";\n provider: "
5411 },
5412 {
5413 "kind": "Reference",
5414 "text": "debug.Debugger",
5415 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5416 },
5417 {
5418 "kind": "Content",
5419 "text": ";\n awssdk: "
5420 },
5421 {
5422 "kind": "Reference",
5423 "text": "debug.Debugger",
5424 "canonicalReference": "@types/debug!~debug.Debugger:interface"
5425 },
5426 {
5427 "kind": "Content",
5428 "text": ";\n}"
5429 }
5430 ],
5431 "releaseTag": "Public",
5432 "name": "log",
5433 "variableTypeTokenRange": {
5434 "startIndex": 1,
5435 "endIndex": 20
5436 }
5437 },
5438 {
5439 "kind": "Class",
5440 "canonicalReference": "faastjs!PersistentCache:class",
5441 "docComment": "/**\n * A simple persistent key-value store. Used to implement {@link Limits.cache} for {@link throttle}.\n *\n * @remarks\n *\n * Entries can be expired, but are not actually deleted individually. The entire cache can be deleted at once. Hence this cache is useful for storing results that are expensive to compute but do not change too often (e.g. the node_modules folder from an 'npm install' where 'package.json' is not expected to change too often).\n *\n * By default faast.js will use the directory `~/.faastjs` as a local cache to store data such as pricing retrieved from cloud APIs, and garbage collection information. This directory can be safely deleted if no faast.js instances are running.\n *\n * @public\n */\n",
5442 "excerptTokens": [
5443 {
5444 "kind": "Content",
5445 "text": "export declare class PersistentCache "
5446 }
5447 ],
5448 "releaseTag": "Public",
5449 "name": "PersistentCache",
5450 "members": [
5451 {
5452 "kind": "Constructor",
5453 "canonicalReference": "faastjs!PersistentCache:constructor(1)",
5454 "docComment": "/**\n * Construct a new persistent cache, typically used with {@link Limits} as part of the arguments to {@link throttle}.\n *\n * @param dirRelativeToHomeDir - The directory under the user's home directory that will be used to store cached values. The directory will be created if it doesn't exist.\n *\n * @param expiration - The age (in ms) after which a cached entry is invalid. Default: `24*3600*1000` (1 day).\n */\n",
5455 "excerptTokens": [
5456 {
5457 "kind": "Content",
5458 "text": "constructor(\n dirRelativeToHomeDir: "
5459 },
5460 {
5461 "kind": "Content",
5462 "text": "string"
5463 },
5464 {
5465 "kind": "Content",
5466 "text": ", \n expiration?: "
5467 },
5468 {
5469 "kind": "Content",
5470 "text": "number"
5471 },
5472 {
5473 "kind": "Content",
5474 "text": ");"
5475 }
5476 ],
5477 "releaseTag": "Public",
5478 "overloadIndex": 1,
5479 "parameters": [
5480 {
5481 "parameterName": "dirRelativeToHomeDir",
5482 "parameterTypeTokenRange": {
5483 "startIndex": 1,
5484 "endIndex": 2
5485 }
5486 },
5487 {
5488 "parameterName": "expiration",
5489 "parameterTypeTokenRange": {
5490 "startIndex": 3,
5491 "endIndex": 4
5492 }
5493 }
5494 ]
5495 },
5496 {
5497 "kind": "Method",
5498 "canonicalReference": "faastjs!PersistentCache#clear:member(1)",
5499 "docComment": "/**\n * Deletes all cached entries from disk.\n *\n * @param leaveEmptyDir - If true, leave the cache directory in place after deleting its contents. If false, the cache directory will be removed. Default: `true`.\n */\n",
5500 "excerptTokens": [
5501 {
5502 "kind": "Content",
5503 "text": "clear({ leaveEmptyDir }?: "
5504 },
5505 {
5506 "kind": "Content",
5507 "text": "{\n leaveEmptyDir?: boolean | undefined;\n }"
5508 },
5509 {
5510 "kind": "Content",
5511 "text": "): "
5512 },
5513 {
5514 "kind": "Reference",
5515 "text": "Promise",
5516 "canonicalReference": "!Promise:interface"
5517 },
5518 {
5519 "kind": "Content",
5520 "text": "<void>"
5521 },
5522 {
5523 "kind": "Content",
5524 "text": ";"
5525 }
5526 ],
5527 "isOptional": false,
5528 "isStatic": false,
5529 "returnTypeTokenRange": {
5530 "startIndex": 3,
5531 "endIndex": 5
5532 },
5533 "releaseTag": "Public",
5534 "overloadIndex": 1,
5535 "parameters": [
5536 {
5537 "parameterName": "{ leaveEmptyDir }",
5538 "parameterTypeTokenRange": {
5539 "startIndex": 1,
5540 "endIndex": 2
5541 }
5542 }
5543 ],
5544 "name": "clear"
5545 },
5546 {
5547 "kind": "Property",
5548 "canonicalReference": "faastjs!PersistentCache#dir:member",
5549 "docComment": "/**\n * The directory on disk where cached values are stored.\n */\n",
5550 "excerptTokens": [
5551 {
5552 "kind": "Content",
5553 "text": "readonly dir: "
5554 },
5555 {
5556 "kind": "Content",
5557 "text": "string"
5558 },
5559 {
5560 "kind": "Content",
5561 "text": ";"
5562 }
5563 ],
5564 "isOptional": false,
5565 "releaseTag": "Public",
5566 "name": "dir",
5567 "propertyTypeTokenRange": {
5568 "startIndex": 1,
5569 "endIndex": 2
5570 },
5571 "isStatic": false
5572 },
5573 {
5574 "kind": "Property",
5575 "canonicalReference": "faastjs!PersistentCache#dirRelativeToHomeDir:member",
5576 "docComment": "/**\n * The directory under the user's home directory that will be used to store cached values. The directory will be created if it doesn't exist.\n */\n",
5577 "excerptTokens": [
5578 {
5579 "kind": "Content",
5580 "text": "readonly dirRelativeToHomeDir: "
5581 },
5582 {
5583 "kind": "Content",
5584 "text": "string"
5585 },
5586 {
5587 "kind": "Content",
5588 "text": ";"
5589 }
5590 ],
5591 "isOptional": false,
5592 "releaseTag": "Public",
5593 "name": "dirRelativeToHomeDir",
5594 "propertyTypeTokenRange": {
5595 "startIndex": 1,
5596 "endIndex": 2
5597 },
5598 "isStatic": false
5599 },
5600 {
5601 "kind": "Method",
5602 "canonicalReference": "faastjs!PersistentCache#entries:member(1)",
5603 "docComment": "/**\n * Retrieve all keys stored in the cache, including expired entries.\n */\n",
5604 "excerptTokens": [
5605 {
5606 "kind": "Content",
5607 "text": "entries(): "
5608 },
5609 {
5610 "kind": "Reference",
5611 "text": "Promise",
5612 "canonicalReference": "!Promise:interface"
5613 },
5614 {
5615 "kind": "Content",
5616 "text": "<string[]>"
5617 },
5618 {
5619 "kind": "Content",
5620 "text": ";"
5621 }
5622 ],
5623 "isOptional": false,
5624 "isStatic": false,
5625 "returnTypeTokenRange": {
5626 "startIndex": 1,
5627 "endIndex": 3
5628 },
5629 "releaseTag": "Public",
5630 "overloadIndex": 1,
5631 "parameters": [],
5632 "name": "entries"
5633 },
5634 {
5635 "kind": "Property",
5636 "canonicalReference": "faastjs!PersistentCache#expiration:member",
5637 "docComment": "/**\n * The age (in ms) after which a cached entry is invalid. Default: `24*3600*1000` (1 day).\n */\n",
5638 "excerptTokens": [
5639 {
5640 "kind": "Content",
5641 "text": "readonly expiration: "
5642 },
5643 {
5644 "kind": "Content",
5645 "text": "number"
5646 },
5647 {
5648 "kind": "Content",
5649 "text": ";"
5650 }
5651 ],
5652 "isOptional": false,
5653 "releaseTag": "Public",
5654 "name": "expiration",
5655 "propertyTypeTokenRange": {
5656 "startIndex": 1,
5657 "endIndex": 2
5658 },
5659 "isStatic": false
5660 },
5661 {
5662 "kind": "Method",
5663 "canonicalReference": "faastjs!PersistentCache#get:member(1)",
5664 "docComment": "/**\n * Retrieves the value previously set for the given key, or undefined if the key is not found.\n */\n",
5665 "excerptTokens": [
5666 {
5667 "kind": "Content",
5668 "text": "get(key: "
5669 },
5670 {
5671 "kind": "Content",
5672 "text": "string"
5673 },
5674 {
5675 "kind": "Content",
5676 "text": "): "
5677 },
5678 {
5679 "kind": "Reference",
5680 "text": "Promise",
5681 "canonicalReference": "!Promise:interface"
5682 },
5683 {
5684 "kind": "Content",
5685 "text": "<"
5686 },
5687 {
5688 "kind": "Reference",
5689 "text": "Buffer",
5690 "canonicalReference": "!__global.Buffer:interface"
5691 },
5692 {
5693 "kind": "Content",
5694 "text": " | undefined>"
5695 },
5696 {
5697 "kind": "Content",
5698 "text": ";"
5699 }
5700 ],
5701 "isOptional": false,
5702 "isStatic": false,
5703 "returnTypeTokenRange": {
5704 "startIndex": 3,
5705 "endIndex": 7
5706 },
5707 "releaseTag": "Public",
5708 "overloadIndex": 1,
5709 "parameters": [
5710 {
5711 "parameterName": "key",
5712 "parameterTypeTokenRange": {
5713 "startIndex": 1,
5714 "endIndex": 2
5715 }
5716 }
5717 ],
5718 "name": "get"
5719 },
5720 {
5721 "kind": "Method",
5722 "canonicalReference": "faastjs!PersistentCache#set:member(1)",
5723 "docComment": "/**\n * Set the cache key to the given value.\n *\n * @returns a Promise that resolves when the cache entry has been persisted.\n */\n",
5724 "excerptTokens": [
5725 {
5726 "kind": "Content",
5727 "text": "set(key: "
5728 },
5729 {
5730 "kind": "Content",
5731 "text": "string"
5732 },
5733 {
5734 "kind": "Content",
5735 "text": ", value: "
5736 },
5737 {
5738 "kind": "Reference",
5739 "text": "Buffer",
5740 "canonicalReference": "!__global.Buffer:interface"
5741 },
5742 {
5743 "kind": "Content",
5744 "text": " | string | "
5745 },
5746 {
5747 "kind": "Reference",
5748 "text": "Uint8Array",
5749 "canonicalReference": "!Uint8Array:interface"
5750 },
5751 {
5752 "kind": "Content",
5753 "text": " | "
5754 },
5755 {
5756 "kind": "Reference",
5757 "text": "Readable",
5758 "canonicalReference": "!internal.Readable:class"
5759 },
5760 {
5761 "kind": "Content",
5762 "text": " | "
5763 },
5764 {
5765 "kind": "Reference",
5766 "text": "Blob",
5767 "canonicalReference": "faastjs!~Blob:interface"
5768 },
5769 {
5770 "kind": "Content",
5771 "text": "): "
5772 },
5773 {
5774 "kind": "Reference",
5775 "text": "Promise",
5776 "canonicalReference": "!Promise:interface"
5777 },
5778 {
5779 "kind": "Content",
5780 "text": "<void>"
5781 },
5782 {
5783 "kind": "Content",
5784 "text": ";"
5785 }
5786 ],
5787 "isOptional": false,
5788 "isStatic": false,
5789 "returnTypeTokenRange": {
5790 "startIndex": 11,
5791 "endIndex": 13
5792 },
5793 "releaseTag": "Public",
5794 "overloadIndex": 1,
5795 "parameters": [
5796 {
5797 "parameterName": "key",
5798 "parameterTypeTokenRange": {
5799 "startIndex": 1,
5800 "endIndex": 2
5801 }
5802 },
5803 {
5804 "parameterName": "value",
5805 "parameterTypeTokenRange": {
5806 "startIndex": 3,
5807 "endIndex": 10
5808 }
5809 }
5810 ],
5811 "name": "set"
5812 }
5813 ],
5814 "implementsTokenRanges": []
5815 },
5816 {
5817 "kind": "TypeAlias",
5818 "canonicalReference": "faastjs!Provider:type",
5819 "docComment": "/**\n * The type of all supported cloud providers.\n *\n * @public\n */\n",
5820 "excerptTokens": [
5821 {
5822 "kind": "Content",
5823 "text": "export declare type Provider = "
5824 },
5825 {
5826 "kind": "Content",
5827 "text": "\"aws\" | \"google\" | \"local\""
5828 },
5829 {
5830 "kind": "Content",
5831 "text": ";"
5832 }
5833 ],
5834 "releaseTag": "Public",
5835 "name": "Provider",
5836 "typeTokenRange": {
5837 "startIndex": 1,
5838 "endIndex": 2
5839 }
5840 },
5841 {
5842 "kind": "Variable",
5843 "canonicalReference": "faastjs!providers:var",
5844 "docComment": "/**\n * An array of all available provider.\n *\n * @public\n */\n",
5845 "excerptTokens": [
5846 {
5847 "kind": "Content",
5848 "text": "providers: "
5849 },
5850 {
5851 "kind": "Reference",
5852 "text": "Provider",
5853 "canonicalReference": "faastjs!Provider:type"
5854 },
5855 {
5856 "kind": "Content",
5857 "text": "[]"
5858 }
5859 ],
5860 "releaseTag": "Public",
5861 "name": "providers",
5862 "variableTypeTokenRange": {
5863 "startIndex": 1,
5864 "endIndex": 3
5865 }
5866 },
5867 {
5868 "kind": "TypeAlias",
5869 "canonicalReference": "faastjs!ProxyModule:type",
5870 "docComment": "/**\n * `ProxyModule<M>` is the type of {@link FaastModule.functions}.\n *\n * @remarks\n *\n * `ProxyModule<M>` maps an imported module's functions to promise-returning or async-iteratable versions of those functions. Non-function exports of the module are omitted. When invoked, the functions in a `ProxyModule` invoke a remote cloud function.\n *\n * @public\n */\n",
5871 "excerptTokens": [
5872 {
5873 "kind": "Content",
5874 "text": "export declare type ProxyModule<M> = "
5875 },
5876 {
5877 "kind": "Content",
5878 "text": "{\n [K in keyof M]: M[K] extends (...args: infer A) => infer R ? (...args: A) => "
5879 },
5880 {
5881 "kind": "Reference",
5882 "text": "Async",
5883 "canonicalReference": "faastjs!Async:type"
5884 },
5885 {
5886 "kind": "Content",
5887 "text": "<R> : never;\n}"
5888 },
5889 {
5890 "kind": "Content",
5891 "text": ";"
5892 }
5893 ],
5894 "releaseTag": "Public",
5895 "name": "ProxyModule",
5896 "typeParameters": [
5897 {
5898 "typeParameterName": "M",
5899 "constraintTokenRange": {
5900 "startIndex": 0,
5901 "endIndex": 0
5902 },
5903 "defaultTypeTokenRange": {
5904 "startIndex": 0,
5905 "endIndex": 0
5906 }
5907 }
5908 ],
5909 "typeTokenRange": {
5910 "startIndex": 1,
5911 "endIndex": 4
5912 }
5913 },
5914 {
5915 "kind": "TypeAlias",
5916 "canonicalReference": "faastjs!ProxyModuleDetail:type",
5917 "docComment": "/**\n * Similar to {@link ProxyModule} except each function returns a {@link Detail} object.\n *\n * @remarks\n *\n * See {@link FaastModule.functionsDetail}.\n *\n * @public\n */\n",
5918 "excerptTokens": [
5919 {
5920 "kind": "Content",
5921 "text": "export declare type ProxyModuleDetail<M> = "
5922 },
5923 {
5924 "kind": "Content",
5925 "text": "{\n [K in keyof M]: M[K] extends (...args: infer A) => infer R ? (...args: A) => "
5926 },
5927 {
5928 "kind": "Reference",
5929 "text": "AsyncDetail",
5930 "canonicalReference": "faastjs!AsyncDetail:type"
5931 },
5932 {
5933 "kind": "Content",
5934 "text": "<R> : never;\n}"
5935 },
5936 {
5937 "kind": "Content",
5938 "text": ";"
5939 }
5940 ],
5941 "releaseTag": "Public",
5942 "name": "ProxyModuleDetail",
5943 "typeParameters": [
5944 {
5945 "typeParameterName": "M",
5946 "constraintTokenRange": {
5947 "startIndex": 0,
5948 "endIndex": 0
5949 },
5950 "defaultTypeTokenRange": {
5951 "startIndex": 0,
5952 "endIndex": 0
5953 }
5954 }
5955 ],
5956 "typeTokenRange": {
5957 "startIndex": 1,
5958 "endIndex": 4
5959 }
5960 },
5961 {
5962 "kind": "Class",
5963 "canonicalReference": "faastjs!Statistics:class",
5964 "docComment": "/**\n * Incrementally updated statistics on a set of values.\n *\n * @public\n */\n",
5965 "excerptTokens": [
5966 {
5967 "kind": "Content",
5968 "text": "export declare class Statistics "
5969 }
5970 ],
5971 "releaseTag": "Public",
5972 "name": "Statistics",
5973 "members": [
5974 {
5975 "kind": "Constructor",
5976 "canonicalReference": "faastjs!Statistics:constructor(1)",
5977 "docComment": "/**\n * Incrementally track mean, stdev, min, max, of a sequence of values.\n *\n * @param printFixedPrecision - The number of decimal places to print in {@link Statistics.toString}.\n */\n",
5978 "excerptTokens": [
5979 {
5980 "kind": "Content",
5981 "text": "constructor(\n printFixedPrecision?: "
5982 },
5983 {
5984 "kind": "Content",
5985 "text": "number"
5986 },
5987 {
5988 "kind": "Content",
5989 "text": ");"
5990 }
5991 ],
5992 "releaseTag": "Public",
5993 "overloadIndex": 1,
5994 "parameters": [
5995 {
5996 "parameterName": "printFixedPrecision",
5997 "parameterTypeTokenRange": {
5998 "startIndex": 1,
5999 "endIndex": 2
6000 }
6001 }
6002 ]
6003 },
6004 {
6005 "kind": "Property",
6006 "canonicalReference": "faastjs!Statistics#max:member",
6007 "docComment": "/**\n * The maximum value observed. Initialized to `Number.NEGATIVE_INFINITY`.\n */\n",
6008 "excerptTokens": [
6009 {
6010 "kind": "Content",
6011 "text": "max: "
6012 },
6013 {
6014 "kind": "Content",
6015 "text": "number"
6016 },
6017 {
6018 "kind": "Content",
6019 "text": ";"
6020 }
6021 ],
6022 "isOptional": false,
6023 "releaseTag": "Public",
6024 "name": "max",
6025 "propertyTypeTokenRange": {
6026 "startIndex": 1,
6027 "endIndex": 2
6028 },
6029 "isStatic": false
6030 },
6031 {
6032 "kind": "Property",
6033 "canonicalReference": "faastjs!Statistics#mean:member",
6034 "docComment": "/**\n * The mean (average) of the values observed.\n */\n",
6035 "excerptTokens": [
6036 {
6037 "kind": "Content",
6038 "text": "mean: "
6039 },
6040 {
6041 "kind": "Content",
6042 "text": "number"
6043 },
6044 {
6045 "kind": "Content",
6046 "text": ";"
6047 }
6048 ],
6049 "isOptional": false,
6050 "releaseTag": "Public",
6051 "name": "mean",
6052 "propertyTypeTokenRange": {
6053 "startIndex": 1,
6054 "endIndex": 2
6055 },
6056 "isStatic": false
6057 },
6058 {
6059 "kind": "Property",
6060 "canonicalReference": "faastjs!Statistics#min:member",
6061 "docComment": "/**\n * The minimum value observed. Initialized to `Number.POSITIVE_INFINITY`.\n */\n",
6062 "excerptTokens": [
6063 {
6064 "kind": "Content",
6065 "text": "min: "
6066 },
6067 {
6068 "kind": "Content",
6069 "text": "number"
6070 },
6071 {
6072 "kind": "Content",
6073 "text": ";"
6074 }
6075 ],
6076 "isOptional": false,
6077 "releaseTag": "Public",
6078 "name": "min",
6079 "propertyTypeTokenRange": {
6080 "startIndex": 1,
6081 "endIndex": 2
6082 },
6083 "isStatic": false
6084 },
6085 {
6086 "kind": "Property",
6087 "canonicalReference": "faastjs!Statistics#printFixedPrecision:member",
6088 "docComment": "/**\n * The number of decimal places to print in {@link Statistics.toString}\n */\n",
6089 "excerptTokens": [
6090 {
6091 "kind": "Content",
6092 "text": "protected printFixedPrecision: "
6093 },
6094 {
6095 "kind": "Content",
6096 "text": "number"
6097 },
6098 {
6099 "kind": "Content",
6100 "text": ";"
6101 }
6102 ],
6103 "isOptional": false,
6104 "releaseTag": "Public",
6105 "name": "printFixedPrecision",
6106 "propertyTypeTokenRange": {
6107 "startIndex": 1,
6108 "endIndex": 2
6109 },
6110 "isStatic": false
6111 },
6112 {
6113 "kind": "Property",
6114 "canonicalReference": "faastjs!Statistics#samples:member",
6115 "docComment": "/**\n * Number of values observed.\n */\n",
6116 "excerptTokens": [
6117 {
6118 "kind": "Content",
6119 "text": "samples: "
6120 },
6121 {
6122 "kind": "Content",
6123 "text": "number"
6124 },
6125 {
6126 "kind": "Content",
6127 "text": ";"
6128 }
6129 ],
6130 "isOptional": false,
6131 "releaseTag": "Public",
6132 "name": "samples",
6133 "propertyTypeTokenRange": {
6134 "startIndex": 1,
6135 "endIndex": 2
6136 },
6137 "isStatic": false
6138 },
6139 {
6140 "kind": "Property",
6141 "canonicalReference": "faastjs!Statistics#stdev:member",
6142 "docComment": "/**\n * The standard deviation of the values observed.\n */\n",
6143 "excerptTokens": [
6144 {
6145 "kind": "Content",
6146 "text": "stdev: "
6147 },
6148 {
6149 "kind": "Content",
6150 "text": "number"
6151 },
6152 {
6153 "kind": "Content",
6154 "text": ";"
6155 }
6156 ],
6157 "isOptional": false,
6158 "releaseTag": "Public",
6159 "name": "stdev",
6160 "propertyTypeTokenRange": {
6161 "startIndex": 1,
6162 "endIndex": 2
6163 },
6164 "isStatic": false
6165 },
6166 {
6167 "kind": "Method",
6168 "canonicalReference": "faastjs!Statistics#toString:member(1)",
6169 "docComment": "/**\n * Print the mean of the observations seen, with the precision specified in the constructor.\n */\n",
6170 "excerptTokens": [
6171 {
6172 "kind": "Content",
6173 "text": "toString(): "
6174 },
6175 {
6176 "kind": "Content",
6177 "text": "string"
6178 },
6179 {
6180 "kind": "Content",
6181 "text": ";"
6182 }
6183 ],
6184 "isOptional": false,
6185 "isStatic": false,
6186 "returnTypeTokenRange": {
6187 "startIndex": 1,
6188 "endIndex": 2
6189 },
6190 "releaseTag": "Public",
6191 "overloadIndex": 1,
6192 "parameters": [],
6193 "name": "toString"
6194 },
6195 {
6196 "kind": "Method",
6197 "canonicalReference": "faastjs!Statistics#update:member(1)",
6198 "docComment": "/**\n * Update statistics with a new value in the sequence.\n */\n",
6199 "excerptTokens": [
6200 {
6201 "kind": "Content",
6202 "text": "update(value: "
6203 },
6204 {
6205 "kind": "Content",
6206 "text": "number | undefined"
6207 },
6208 {
6209 "kind": "Content",
6210 "text": "): "
6211 },
6212 {
6213 "kind": "Content",
6214 "text": "void"
6215 },
6216 {
6217 "kind": "Content",
6218 "text": ";"
6219 }
6220 ],
6221 "isOptional": false,
6222 "isStatic": false,
6223 "returnTypeTokenRange": {
6224 "startIndex": 3,
6225 "endIndex": 4
6226 },
6227 "releaseTag": "Public",
6228 "overloadIndex": 1,
6229 "parameters": [
6230 {
6231 "parameterName": "value",
6232 "parameterTypeTokenRange": {
6233 "startIndex": 1,
6234 "endIndex": 2
6235 }
6236 }
6237 ],
6238 "name": "update"
6239 },
6240 {
6241 "kind": "Property",
6242 "canonicalReference": "faastjs!Statistics#variance:member",
6243 "docComment": "/**\n * The variance of the values observed.\n */\n",
6244 "excerptTokens": [
6245 {
6246 "kind": "Content",
6247 "text": "variance: "
6248 },
6249 {
6250 "kind": "Content",
6251 "text": "number"
6252 },
6253 {
6254 "kind": "Content",
6255 "text": ";"
6256 }
6257 ],
6258 "isOptional": false,
6259 "releaseTag": "Public",
6260 "name": "variance",
6261 "propertyTypeTokenRange": {
6262 "startIndex": 1,
6263 "endIndex": 2
6264 },
6265 "isStatic": false
6266 }
6267 ],
6268 "implementsTokenRanges": []
6269 },
6270 {
6271 "kind": "Function",
6272 "canonicalReference": "faastjs!throttle:function(1)",
6273 "docComment": "/**\n * A decorator for rate limiting, concurrency limiting, retry, memoization, and on-disk caching. See {@link Limits}.\n *\n * @remarks\n *\n * When programming against cloud services, databases, and other resources, it is often necessary to control the rate of request issuance to avoid overwhelming the service provider. In many cases the provider has built-in safeguards against abuse, which automatically fail requests if they are coming in too fast. Some systems don't have safeguards and precipitously degrade their service level or fail outright when faced with excessive load.\n *\n * With faast.js it becomes very easy to (accidentally) generate requests from thousands of cloud functions. The `throttle` function can help manage request flow without resorting to setting up a separate service. This is in keeping with faast.js' zero-ops philosophy.\n *\n * Usage is simple:\n * ```typescript\n * async function operation() { ... }\n * const throttledOperation = throttle({ concurrency: 10, rate: 5 }, operation);\n * for(let i = 0; i < 100; i++) {\n * // at most 10 concurrent executions at a rate of 5 invocations per second.\n * throttledOperation();\n * }\n * ```\n *\n * Note that each invocation to `throttle` creates a separate function with a separate limits. Therefore it is likely that you want to use `throttle` in a global context, not within a dynamic context:\n * ```typescript\n * async function operation() { ... }\n * for(let i = 0; i < 100; i++) {\n * // WRONG - each iteration creates a separate throttled function that's only called once.\n * const throttledOperation = throttle({ concurrency: 10, rate: 5 }, operation);\n * throttledOperation();\n * }\n * ```\n *\n * A better way to use throttle avoids creating a named `operation` function altogether, ensuring it cannot be accidentally called without throttling:\n * ```typescript\n * const operation = throttle({ concurrency: 10, rate: 5 }, async () => {\n * ...\n * });\n * ```\n *\n * Throttle supports functions with arguments automatically infers the correct type for the returned function:\n * ```typescript\n * // `operation` inferred to have type (str: string) => Promise<string>\n * const operation = throttle({ concurrency: 10, rate: 5 }, async (str: string) => {\n * return string;\n * });\n * ```\n *\n * In addition to limiting concurrency and invocation rate, `throttle` also supports retrying failed invocations, memoizing calls, and on-disk caching. See {@link Limits} for details.\n *\n * @param limits - see {@link Limits}.\n *\n * @param fn - The function to throttle. It can take any arguments, but must return a Promise (which includes `async` functions).\n *\n * @returns Returns a throttled function with the same signature as the argument `fn`.\n *\n * @public\n */\n",
6274 "excerptTokens": [
6275 {
6276 "kind": "Content",
6277 "text": "export declare function throttle<A extends "
6278 },
6279 {
6280 "kind": "Content",
6281 "text": "any[]"
6282 },
6283 {
6284 "kind": "Content",
6285 "text": ", R>(limits: "
6286 },
6287 {
6288 "kind": "Reference",
6289 "text": "Limits",
6290 "canonicalReference": "faastjs!Limits:interface"
6291 },
6292 {
6293 "kind": "Content",
6294 "text": ", fn: "
6295 },
6296 {
6297 "kind": "Content",
6298 "text": "(...args: A) => "
6299 },
6300 {
6301 "kind": "Reference",
6302 "text": "Promise",
6303 "canonicalReference": "!Promise:interface"
6304 },
6305 {
6306 "kind": "Content",
6307 "text": "<R>"
6308 },
6309 {
6310 "kind": "Content",
6311 "text": "): "
6312 },
6313 {
6314 "kind": "Content",
6315 "text": "(...args: A) => "
6316 },
6317 {
6318 "kind": "Reference",
6319 "text": "Promise",
6320 "canonicalReference": "!Promise:interface"
6321 },
6322 {
6323 "kind": "Content",
6324 "text": "<R>"
6325 },
6326 {
6327 "kind": "Content",
6328 "text": ";"
6329 }
6330 ],
6331 "returnTypeTokenRange": {
6332 "startIndex": 9,
6333 "endIndex": 12
6334 },
6335 "releaseTag": "Public",
6336 "overloadIndex": 1,
6337 "parameters": [
6338 {
6339 "parameterName": "limits",
6340 "parameterTypeTokenRange": {
6341 "startIndex": 3,
6342 "endIndex": 4
6343 }
6344 },
6345 {
6346 "parameterName": "fn",
6347 "parameterTypeTokenRange": {
6348 "startIndex": 5,
6349 "endIndex": 8
6350 }
6351 }
6352 ],
6353 "typeParameters": [
6354 {
6355 "typeParameterName": "A",
6356 "constraintTokenRange": {
6357 "startIndex": 1,
6358 "endIndex": 2
6359 },
6360 "defaultTypeTokenRange": {
6361 "startIndex": 0,
6362 "endIndex": 0
6363 }
6364 },
6365 {
6366 "typeParameterName": "R",
6367 "constraintTokenRange": {
6368 "startIndex": 0,
6369 "endIndex": 0
6370 },
6371 "defaultTypeTokenRange": {
6372 "startIndex": 0,
6373 "endIndex": 0
6374 }
6375 }
6376 ],
6377 "name": "throttle"
6378 }
6379 ]
6380 }
6381 ]
6382}