UNPKG

281 kBJSONView Raw
1{
2 "metadata": {
3 "toolPackage": "@microsoft/api-extractor",
4 "toolVersion": "7.19.2",
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#childProcessMemoryMb:member",
798 "docComment": "/**\n * When childProcess is true, the child process will be spawned with the value of this property as the setting for --max-old-space-size.\n *\n * @remarks\n *\n * This is useful if a function requires the node process to limit its memory so that another spawned process (e.g. a browser instance) can use the rest.\n *\n * @public\n */\n",
799 "excerptTokens": [
800 {
801 "kind": "Content",
802 "text": "childProcessMemoryMb?: "
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": "childProcessMemoryMb",
816 "propertyTypeTokenRange": {
817 "startIndex": 1,
818 "endIndex": 2
819 }
820 },
821 {
822 "kind": "PropertySignature",
823 "canonicalReference": "faastjs!CommonOptions#concurrency:member",
824 "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",
825 "excerptTokens": [
826 {
827 "kind": "Content",
828 "text": "concurrency?: "
829 },
830 {
831 "kind": "Content",
832 "text": "number"
833 },
834 {
835 "kind": "Content",
836 "text": ";"
837 }
838 ],
839 "isOptional": true,
840 "releaseTag": "Public",
841 "name": "concurrency",
842 "propertyTypeTokenRange": {
843 "startIndex": 1,
844 "endIndex": 2
845 }
846 },
847 {
848 "kind": "PropertySignature",
849 "canonicalReference": "faastjs!CommonOptions#description:member",
850 "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",
851 "excerptTokens": [
852 {
853 "kind": "Content",
854 "text": "description?: "
855 },
856 {
857 "kind": "Content",
858 "text": "string"
859 },
860 {
861 "kind": "Content",
862 "text": ";"
863 }
864 ],
865 "isOptional": true,
866 "releaseTag": "Public",
867 "name": "description",
868 "propertyTypeTokenRange": {
869 "startIndex": 1,
870 "endIndex": 2
871 }
872 },
873 {
874 "kind": "PropertySignature",
875 "canonicalReference": "faastjs!CommonOptions#env:member",
876 "docComment": "/**\n * Environment variables available during serverless function execution. Default: \\{\\}.\n */\n",
877 "excerptTokens": [
878 {
879 "kind": "Content",
880 "text": "env?: "
881 },
882 {
883 "kind": "Content",
884 "text": "{\n [key: string]: string;\n }"
885 },
886 {
887 "kind": "Content",
888 "text": ";"
889 }
890 ],
891 "isOptional": true,
892 "releaseTag": "Public",
893 "name": "env",
894 "propertyTypeTokenRange": {
895 "startIndex": 1,
896 "endIndex": 2
897 }
898 },
899 {
900 "kind": "PropertySignature",
901 "canonicalReference": "faastjs!CommonOptions#exclude:member",
902 "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",
903 "excerptTokens": [
904 {
905 "kind": "Content",
906 "text": "exclude?: "
907 },
908 {
909 "kind": "Content",
910 "text": "string[]"
911 },
912 {
913 "kind": "Content",
914 "text": ";"
915 }
916 ],
917 "isOptional": true,
918 "releaseTag": "Public",
919 "name": "exclude",
920 "propertyTypeTokenRange": {
921 "startIndex": 1,
922 "endIndex": 2
923 }
924 },
925 {
926 "kind": "PropertySignature",
927 "canonicalReference": "faastjs!CommonOptions#gc:member",
928 "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",
929 "excerptTokens": [
930 {
931 "kind": "Content",
932 "text": "gc?: "
933 },
934 {
935 "kind": "Content",
936 "text": "\"auto\" | \"force\" | \"off\""
937 },
938 {
939 "kind": "Content",
940 "text": ";"
941 }
942 ],
943 "isOptional": true,
944 "releaseTag": "Public",
945 "name": "gc",
946 "propertyTypeTokenRange": {
947 "startIndex": 1,
948 "endIndex": 2
949 }
950 },
951 {
952 "kind": "PropertySignature",
953 "canonicalReference": "faastjs!CommonOptions#include:member",
954 "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",
955 "excerptTokens": [
956 {
957 "kind": "Content",
958 "text": "include?: "
959 },
960 {
961 "kind": "Content",
962 "text": "(string | "
963 },
964 {
965 "kind": "Reference",
966 "text": "IncludeOption",
967 "canonicalReference": "faastjs!IncludeOption:interface"
968 },
969 {
970 "kind": "Content",
971 "text": ")[]"
972 },
973 {
974 "kind": "Content",
975 "text": ";"
976 }
977 ],
978 "isOptional": true,
979 "releaseTag": "Public",
980 "name": "include",
981 "propertyTypeTokenRange": {
982 "startIndex": 1,
983 "endIndex": 4
984 }
985 },
986 {
987 "kind": "PropertySignature",
988 "canonicalReference": "faastjs!CommonOptions#maxRetries:member",
989 "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",
990 "excerptTokens": [
991 {
992 "kind": "Content",
993 "text": "maxRetries?: "
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": "maxRetries",
1007 "propertyTypeTokenRange": {
1008 "startIndex": 1,
1009 "endIndex": 2
1010 }
1011 },
1012 {
1013 "kind": "PropertySignature",
1014 "canonicalReference": "faastjs!CommonOptions#memorySize:member",
1015 "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",
1016 "excerptTokens": [
1017 {
1018 "kind": "Content",
1019 "text": "memorySize?: "
1020 },
1021 {
1022 "kind": "Content",
1023 "text": "number"
1024 },
1025 {
1026 "kind": "Content",
1027 "text": ";"
1028 }
1029 ],
1030 "isOptional": true,
1031 "releaseTag": "Public",
1032 "name": "memorySize",
1033 "propertyTypeTokenRange": {
1034 "startIndex": 1,
1035 "endIndex": 2
1036 }
1037 },
1038 {
1039 "kind": "PropertySignature",
1040 "canonicalReference": "faastjs!CommonOptions#mode:member",
1041 "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",
1042 "excerptTokens": [
1043 {
1044 "kind": "Content",
1045 "text": "mode?: "
1046 },
1047 {
1048 "kind": "Content",
1049 "text": "\"https\" | \"queue\" | \"auto\""
1050 },
1051 {
1052 "kind": "Content",
1053 "text": ";"
1054 }
1055 ],
1056 "isOptional": true,
1057 "releaseTag": "Public",
1058 "name": "mode",
1059 "propertyTypeTokenRange": {
1060 "startIndex": 1,
1061 "endIndex": 2
1062 }
1063 },
1064 {
1065 "kind": "PropertySignature",
1066 "canonicalReference": "faastjs!CommonOptions#packageJson:member",
1067 "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",
1068 "excerptTokens": [
1069 {
1070 "kind": "Content",
1071 "text": "packageJson?: "
1072 },
1073 {
1074 "kind": "Content",
1075 "text": "string | object"
1076 },
1077 {
1078 "kind": "Content",
1079 "text": ";"
1080 }
1081 ],
1082 "isOptional": true,
1083 "releaseTag": "Public",
1084 "name": "packageJson",
1085 "propertyTypeTokenRange": {
1086 "startIndex": 1,
1087 "endIndex": 2
1088 }
1089 },
1090 {
1091 "kind": "PropertySignature",
1092 "canonicalReference": "faastjs!CommonOptions#rate:member",
1093 "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",
1094 "excerptTokens": [
1095 {
1096 "kind": "Content",
1097 "text": "rate?: "
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": "rate",
1111 "propertyTypeTokenRange": {
1112 "startIndex": 1,
1113 "endIndex": 2
1114 }
1115 },
1116 {
1117 "kind": "PropertySignature",
1118 "canonicalReference": "faastjs!CommonOptions#retentionInDays:member",
1119 "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",
1120 "excerptTokens": [
1121 {
1122 "kind": "Content",
1123 "text": "retentionInDays?: "
1124 },
1125 {
1126 "kind": "Content",
1127 "text": "number"
1128 },
1129 {
1130 "kind": "Content",
1131 "text": ";"
1132 }
1133 ],
1134 "isOptional": true,
1135 "releaseTag": "Public",
1136 "name": "retentionInDays",
1137 "propertyTypeTokenRange": {
1138 "startIndex": 1,
1139 "endIndex": 2
1140 }
1141 },
1142 {
1143 "kind": "PropertySignature",
1144 "canonicalReference": "faastjs!CommonOptions#speculativeRetryThreshold:member",
1145 "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",
1146 "excerptTokens": [
1147 {
1148 "kind": "Content",
1149 "text": "speculativeRetryThreshold?: "
1150 },
1151 {
1152 "kind": "Content",
1153 "text": "number"
1154 },
1155 {
1156 "kind": "Content",
1157 "text": ";"
1158 }
1159 ],
1160 "isOptional": true,
1161 "releaseTag": "Beta",
1162 "name": "speculativeRetryThreshold",
1163 "propertyTypeTokenRange": {
1164 "startIndex": 1,
1165 "endIndex": 2
1166 }
1167 },
1168 {
1169 "kind": "PropertySignature",
1170 "canonicalReference": "faastjs!CommonOptions#timeout:member",
1171 "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",
1172 "excerptTokens": [
1173 {
1174 "kind": "Content",
1175 "text": "timeout?: "
1176 },
1177 {
1178 "kind": "Content",
1179 "text": "number"
1180 },
1181 {
1182 "kind": "Content",
1183 "text": ";"
1184 }
1185 ],
1186 "isOptional": true,
1187 "releaseTag": "Public",
1188 "name": "timeout",
1189 "propertyTypeTokenRange": {
1190 "startIndex": 1,
1191 "endIndex": 2
1192 }
1193 },
1194 {
1195 "kind": "PropertySignature",
1196 "canonicalReference": "faastjs!CommonOptions#useDependencyCaching:member",
1197 "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",
1198 "excerptTokens": [
1199 {
1200 "kind": "Content",
1201 "text": "useDependencyCaching?: "
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": "useDependencyCaching",
1215 "propertyTypeTokenRange": {
1216 "startIndex": 1,
1217 "endIndex": 2
1218 }
1219 },
1220 {
1221 "kind": "PropertySignature",
1222 "canonicalReference": "faastjs!CommonOptions#validateSerialization:member",
1223 "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",
1224 "excerptTokens": [
1225 {
1226 "kind": "Content",
1227 "text": "validateSerialization?: "
1228 },
1229 {
1230 "kind": "Content",
1231 "text": "boolean"
1232 },
1233 {
1234 "kind": "Content",
1235 "text": ";"
1236 }
1237 ],
1238 "isOptional": true,
1239 "releaseTag": "Public",
1240 "name": "validateSerialization",
1241 "propertyTypeTokenRange": {
1242 "startIndex": 1,
1243 "endIndex": 2
1244 }
1245 },
1246 {
1247 "kind": "PropertySignature",
1248 "canonicalReference": "faastjs!CommonOptions#webpackOptions:member",
1249 "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",
1250 "excerptTokens": [
1251 {
1252 "kind": "Content",
1253 "text": "webpackOptions?: "
1254 },
1255 {
1256 "kind": "Reference",
1257 "text": "webpack.Configuration",
1258 "canonicalReference": "webpack!~Configuration:interface"
1259 },
1260 {
1261 "kind": "Content",
1262 "text": ";"
1263 }
1264 ],
1265 "isOptional": true,
1266 "releaseTag": "Public",
1267 "name": "webpackOptions",
1268 "propertyTypeTokenRange": {
1269 "startIndex": 1,
1270 "endIndex": 2
1271 }
1272 }
1273 ],
1274 "extendsTokenRanges": []
1275 },
1276 {
1277 "kind": "Namespace",
1278 "canonicalReference": "faastjs!CostAnalyzer:namespace",
1279 "docComment": "/**\n * Analyze the cost of a workload across many provider configurations.\n *\n * @public\n */\n",
1280 "excerptTokens": [
1281 {
1282 "kind": "Content",
1283 "text": "export declare namespace CostAnalyzer "
1284 }
1285 ],
1286 "releaseTag": "Public",
1287 "name": "CostAnalyzer",
1288 "members": [
1289 {
1290 "kind": "Function",
1291 "canonicalReference": "faastjs!CostAnalyzer.analyze:function(1)",
1292 "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",
1293 "excerptTokens": [
1294 {
1295 "kind": "Content",
1296 "text": "function analyze<T extends "
1297 },
1298 {
1299 "kind": "Content",
1300 "text": "object"
1301 },
1302 {
1303 "kind": "Content",
1304 "text": ", A extends "
1305 },
1306 {
1307 "kind": "Content",
1308 "text": "string"
1309 },
1310 {
1311 "kind": "Content",
1312 "text": ">(userWorkload: "
1313 },
1314 {
1315 "kind": "Reference",
1316 "text": "Workload",
1317 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface"
1318 },
1319 {
1320 "kind": "Content",
1321 "text": "<T, A>"
1322 },
1323 {
1324 "kind": "Content",
1325 "text": "): "
1326 },
1327 {
1328 "kind": "Reference",
1329 "text": "Promise",
1330 "canonicalReference": "!Promise:interface"
1331 },
1332 {
1333 "kind": "Content",
1334 "text": "<"
1335 },
1336 {
1337 "kind": "Reference",
1338 "text": "Result",
1339 "canonicalReference": "faastjs!CostAnalyzer.Result:class"
1340 },
1341 {
1342 "kind": "Content",
1343 "text": "<T, A>>"
1344 },
1345 {
1346 "kind": "Content",
1347 "text": ";"
1348 }
1349 ],
1350 "returnTypeTokenRange": {
1351 "startIndex": 8,
1352 "endIndex": 12
1353 },
1354 "releaseTag": "Public",
1355 "overloadIndex": 1,
1356 "parameters": [
1357 {
1358 "parameterName": "userWorkload",
1359 "parameterTypeTokenRange": {
1360 "startIndex": 5,
1361 "endIndex": 7
1362 }
1363 }
1364 ],
1365 "typeParameters": [
1366 {
1367 "typeParameterName": "T",
1368 "constraintTokenRange": {
1369 "startIndex": 1,
1370 "endIndex": 2
1371 },
1372 "defaultTypeTokenRange": {
1373 "startIndex": 0,
1374 "endIndex": 0
1375 }
1376 },
1377 {
1378 "typeParameterName": "A",
1379 "constraintTokenRange": {
1380 "startIndex": 3,
1381 "endIndex": 4
1382 },
1383 "defaultTypeTokenRange": {
1384 "startIndex": 0,
1385 "endIndex": 0
1386 }
1387 }
1388 ],
1389 "name": "analyze"
1390 },
1391 {
1392 "kind": "Variable",
1393 "canonicalReference": "faastjs!CostAnalyzer.awsConfigurations:var",
1394 "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",
1395 "excerptTokens": [
1396 {
1397 "kind": "Content",
1398 "text": "awsConfigurations: "
1399 },
1400 {
1401 "kind": "Reference",
1402 "text": "Configuration",
1403 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1404 },
1405 {
1406 "kind": "Content",
1407 "text": "[]"
1408 }
1409 ],
1410 "releaseTag": "Public",
1411 "name": "awsConfigurations",
1412 "variableTypeTokenRange": {
1413 "startIndex": 1,
1414 "endIndex": 3
1415 }
1416 },
1417 {
1418 "kind": "TypeAlias",
1419 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type",
1420 "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",
1421 "excerptTokens": [
1422 {
1423 "kind": "Content",
1424 "text": "type Configuration = "
1425 },
1426 {
1427 "kind": "Content",
1428 "text": "{\n provider: \"aws\";\n options: "
1429 },
1430 {
1431 "kind": "Reference",
1432 "text": "AwsOptions",
1433 "canonicalReference": "faastjs!AwsOptions:interface"
1434 },
1435 {
1436 "kind": "Content",
1437 "text": ";\n } | {\n provider: \"google\";\n options: "
1438 },
1439 {
1440 "kind": "Reference",
1441 "text": "GoogleOptions",
1442 "canonicalReference": "faastjs!GoogleOptions:interface"
1443 },
1444 {
1445 "kind": "Content",
1446 "text": ";\n }"
1447 },
1448 {
1449 "kind": "Content",
1450 "text": ";"
1451 }
1452 ],
1453 "releaseTag": "Public",
1454 "name": "Configuration",
1455 "typeTokenRange": {
1456 "startIndex": 1,
1457 "endIndex": 6
1458 }
1459 },
1460 {
1461 "kind": "Interface",
1462 "canonicalReference": "faastjs!CostAnalyzer.Estimate:interface",
1463 "docComment": "/**\n * A cost estimate result for a specific cost analyzer configuration.\n *\n * @public\n */\n",
1464 "excerptTokens": [
1465 {
1466 "kind": "Content",
1467 "text": "interface Estimate<A extends "
1468 },
1469 {
1470 "kind": "Content",
1471 "text": "string"
1472 },
1473 {
1474 "kind": "Content",
1475 "text": "> "
1476 }
1477 ],
1478 "releaseTag": "Public",
1479 "typeParameters": [
1480 {
1481 "typeParameterName": "A",
1482 "constraintTokenRange": {
1483 "startIndex": 1,
1484 "endIndex": 2
1485 },
1486 "defaultTypeTokenRange": {
1487 "startIndex": 0,
1488 "endIndex": 0
1489 }
1490 }
1491 ],
1492 "name": "Estimate",
1493 "members": [
1494 {
1495 "kind": "PropertySignature",
1496 "canonicalReference": "faastjs!CostAnalyzer.Estimate#config:member",
1497 "docComment": "/**\n * The worload configuration that was analyzed. See {@link CostAnalyzer.Configuration}.\n */\n",
1498 "excerptTokens": [
1499 {
1500 "kind": "Content",
1501 "text": "config: "
1502 },
1503 {
1504 "kind": "Reference",
1505 "text": "Configuration",
1506 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1507 },
1508 {
1509 "kind": "Content",
1510 "text": ";"
1511 }
1512 ],
1513 "isOptional": false,
1514 "releaseTag": "Public",
1515 "name": "config",
1516 "propertyTypeTokenRange": {
1517 "startIndex": 1,
1518 "endIndex": 2
1519 }
1520 },
1521 {
1522 "kind": "PropertySignature",
1523 "canonicalReference": "faastjs!CostAnalyzer.Estimate#costSnapshot:member",
1524 "docComment": "/**\n * The cost snapshot for the cost analysis of the specific (workload, configuration) combination. See {@link CostSnapshot}.\n */\n",
1525 "excerptTokens": [
1526 {
1527 "kind": "Content",
1528 "text": "costSnapshot: "
1529 },
1530 {
1531 "kind": "Reference",
1532 "text": "CostSnapshot",
1533 "canonicalReference": "faastjs!CostSnapshot:class"
1534 },
1535 {
1536 "kind": "Content",
1537 "text": ";"
1538 }
1539 ],
1540 "isOptional": false,
1541 "releaseTag": "Public",
1542 "name": "costSnapshot",
1543 "propertyTypeTokenRange": {
1544 "startIndex": 1,
1545 "endIndex": 2
1546 }
1547 },
1548 {
1549 "kind": "PropertySignature",
1550 "canonicalReference": "faastjs!CostAnalyzer.Estimate#extraMetrics:member",
1551 "docComment": "/**\n * Additional workload metrics returned from the work function. See {@link CostAnalyzer.WorkloadAttribute}.\n */\n",
1552 "excerptTokens": [
1553 {
1554 "kind": "Content",
1555 "text": "extraMetrics: "
1556 },
1557 {
1558 "kind": "Reference",
1559 "text": "WorkloadAttribute",
1560 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
1561 },
1562 {
1563 "kind": "Content",
1564 "text": "<A>"
1565 },
1566 {
1567 "kind": "Content",
1568 "text": ";"
1569 }
1570 ],
1571 "isOptional": false,
1572 "releaseTag": "Public",
1573 "name": "extraMetrics",
1574 "propertyTypeTokenRange": {
1575 "startIndex": 1,
1576 "endIndex": 3
1577 }
1578 }
1579 ],
1580 "extendsTokenRanges": []
1581 },
1582 {
1583 "kind": "Variable",
1584 "canonicalReference": "faastjs!CostAnalyzer.googleConfigurations:var",
1585 "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",
1586 "excerptTokens": [
1587 {
1588 "kind": "Content",
1589 "text": "googleConfigurations: "
1590 },
1591 {
1592 "kind": "Reference",
1593 "text": "Configuration",
1594 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1595 },
1596 {
1597 "kind": "Content",
1598 "text": "[]"
1599 }
1600 ],
1601 "releaseTag": "Public",
1602 "name": "googleConfigurations",
1603 "variableTypeTokenRange": {
1604 "startIndex": 1,
1605 "endIndex": 3
1606 }
1607 },
1608 {
1609 "kind": "Class",
1610 "canonicalReference": "faastjs!CostAnalyzer.Result:class",
1611 "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",
1612 "excerptTokens": [
1613 {
1614 "kind": "Content",
1615 "text": "class Result<T extends "
1616 },
1617 {
1618 "kind": "Content",
1619 "text": "object"
1620 },
1621 {
1622 "kind": "Content",
1623 "text": ", A extends "
1624 },
1625 {
1626 "kind": "Content",
1627 "text": "string"
1628 },
1629 {
1630 "kind": "Content",
1631 "text": "> "
1632 }
1633 ],
1634 "releaseTag": "Public",
1635 "typeParameters": [
1636 {
1637 "typeParameterName": "T",
1638 "constraintTokenRange": {
1639 "startIndex": 1,
1640 "endIndex": 2
1641 },
1642 "defaultTypeTokenRange": {
1643 "startIndex": 0,
1644 "endIndex": 0
1645 }
1646 },
1647 {
1648 "typeParameterName": "A",
1649 "constraintTokenRange": {
1650 "startIndex": 3,
1651 "endIndex": 4
1652 },
1653 "defaultTypeTokenRange": {
1654 "startIndex": 0,
1655 "endIndex": 0
1656 }
1657 }
1658 ],
1659 "name": "Result",
1660 "members": [
1661 {
1662 "kind": "Method",
1663 "canonicalReference": "faastjs!CostAnalyzer.Result#csv:member(1)",
1664 "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",
1665 "excerptTokens": [
1666 {
1667 "kind": "Content",
1668 "text": "csv(): "
1669 },
1670 {
1671 "kind": "Content",
1672 "text": "string"
1673 },
1674 {
1675 "kind": "Content",
1676 "text": ";"
1677 }
1678 ],
1679 "isOptional": false,
1680 "isStatic": false,
1681 "returnTypeTokenRange": {
1682 "startIndex": 1,
1683 "endIndex": 2
1684 },
1685 "releaseTag": "Public",
1686 "overloadIndex": 1,
1687 "parameters": [],
1688 "name": "csv"
1689 },
1690 {
1691 "kind": "Property",
1692 "canonicalReference": "faastjs!CostAnalyzer.Result#estimates:member",
1693 "docComment": "/**\n * Cost estimates for each configuration of the workload. See {@link CostAnalyzer.Estimate}.\n */\n",
1694 "excerptTokens": [
1695 {
1696 "kind": "Content",
1697 "text": "readonly estimates: "
1698 },
1699 {
1700 "kind": "Reference",
1701 "text": "Estimate",
1702 "canonicalReference": "faastjs!CostAnalyzer.Estimate:interface"
1703 },
1704 {
1705 "kind": "Content",
1706 "text": "<A>[]"
1707 },
1708 {
1709 "kind": "Content",
1710 "text": ";"
1711 }
1712 ],
1713 "isOptional": false,
1714 "releaseTag": "Public",
1715 "name": "estimates",
1716 "propertyTypeTokenRange": {
1717 "startIndex": 1,
1718 "endIndex": 3
1719 },
1720 "isStatic": false
1721 },
1722 {
1723 "kind": "Property",
1724 "canonicalReference": "faastjs!CostAnalyzer.Result#workload:member",
1725 "docComment": "/**\n * The workload analyzed.\n */\n",
1726 "excerptTokens": [
1727 {
1728 "kind": "Content",
1729 "text": "readonly workload: "
1730 },
1731 {
1732 "kind": "Reference",
1733 "text": "Required",
1734 "canonicalReference": "!Required:type"
1735 },
1736 {
1737 "kind": "Content",
1738 "text": "<"
1739 },
1740 {
1741 "kind": "Reference",
1742 "text": "Workload",
1743 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface"
1744 },
1745 {
1746 "kind": "Content",
1747 "text": "<T, A>>"
1748 },
1749 {
1750 "kind": "Content",
1751 "text": ";"
1752 }
1753 ],
1754 "isOptional": false,
1755 "releaseTag": "Public",
1756 "name": "workload",
1757 "propertyTypeTokenRange": {
1758 "startIndex": 1,
1759 "endIndex": 5
1760 },
1761 "isStatic": false
1762 }
1763 ],
1764 "implementsTokenRanges": []
1765 },
1766 {
1767 "kind": "Interface",
1768 "canonicalReference": "faastjs!CostAnalyzer.Workload:interface",
1769 "docComment": "/**\n * A user-defined cost analyzer workload for {@link CostAnalyzer.analyze}.\n *\n * Example:\n *\n * @public\n */\n",
1770 "excerptTokens": [
1771 {
1772 "kind": "Content",
1773 "text": "interface Workload<T extends "
1774 },
1775 {
1776 "kind": "Content",
1777 "text": "object"
1778 },
1779 {
1780 "kind": "Content",
1781 "text": ", A extends "
1782 },
1783 {
1784 "kind": "Content",
1785 "text": "string"
1786 },
1787 {
1788 "kind": "Content",
1789 "text": "> "
1790 }
1791 ],
1792 "releaseTag": "Public",
1793 "typeParameters": [
1794 {
1795 "typeParameterName": "T",
1796 "constraintTokenRange": {
1797 "startIndex": 1,
1798 "endIndex": 2
1799 },
1800 "defaultTypeTokenRange": {
1801 "startIndex": 0,
1802 "endIndex": 0
1803 }
1804 },
1805 {
1806 "typeParameterName": "A",
1807 "constraintTokenRange": {
1808 "startIndex": 3,
1809 "endIndex": 4
1810 },
1811 "defaultTypeTokenRange": {
1812 "startIndex": 0,
1813 "endIndex": 0
1814 }
1815 }
1816 ],
1817 "name": "Workload",
1818 "members": [
1819 {
1820 "kind": "PropertySignature",
1821 "canonicalReference": "faastjs!CostAnalyzer.Workload#concurrency:member",
1822 "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",
1823 "excerptTokens": [
1824 {
1825 "kind": "Content",
1826 "text": "concurrency?: "
1827 },
1828 {
1829 "kind": "Content",
1830 "text": "number"
1831 },
1832 {
1833 "kind": "Content",
1834 "text": ";"
1835 }
1836 ],
1837 "isOptional": true,
1838 "releaseTag": "Public",
1839 "name": "concurrency",
1840 "propertyTypeTokenRange": {
1841 "startIndex": 1,
1842 "endIndex": 2
1843 }
1844 },
1845 {
1846 "kind": "PropertySignature",
1847 "canonicalReference": "faastjs!CostAnalyzer.Workload#configurations:member",
1848 "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",
1849 "excerptTokens": [
1850 {
1851 "kind": "Content",
1852 "text": "configurations?: "
1853 },
1854 {
1855 "kind": "Reference",
1856 "text": "Configuration",
1857 "canonicalReference": "faastjs!CostAnalyzer.Configuration:type"
1858 },
1859 {
1860 "kind": "Content",
1861 "text": "[]"
1862 },
1863 {
1864 "kind": "Content",
1865 "text": ";"
1866 }
1867 ],
1868 "isOptional": true,
1869 "releaseTag": "Public",
1870 "name": "configurations",
1871 "propertyTypeTokenRange": {
1872 "startIndex": 1,
1873 "endIndex": 3
1874 }
1875 },
1876 {
1877 "kind": "PropertySignature",
1878 "canonicalReference": "faastjs!CostAnalyzer.Workload#format:member",
1879 "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",
1880 "excerptTokens": [
1881 {
1882 "kind": "Content",
1883 "text": "format?: "
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": "format",
1897 "propertyTypeTokenRange": {
1898 "startIndex": 1,
1899 "endIndex": 2
1900 }
1901 },
1902 {
1903 "kind": "PropertySignature",
1904 "canonicalReference": "faastjs!CostAnalyzer.Workload#formatCSV:member",
1905 "docComment": "/**\n * Format an attribute value for CSV. The default returns `value.toFixed(1)`.\n */\n",
1906 "excerptTokens": [
1907 {
1908 "kind": "Content",
1909 "text": "formatCSV?: "
1910 },
1911 {
1912 "kind": "Content",
1913 "text": "(attr: A, value: number) => string"
1914 },
1915 {
1916 "kind": "Content",
1917 "text": ";"
1918 }
1919 ],
1920 "isOptional": true,
1921 "releaseTag": "Public",
1922 "name": "formatCSV",
1923 "propertyTypeTokenRange": {
1924 "startIndex": 1,
1925 "endIndex": 2
1926 }
1927 },
1928 {
1929 "kind": "PropertySignature",
1930 "canonicalReference": "faastjs!CostAnalyzer.Workload#funcs:member",
1931 "docComment": "/**\n * The imported module that contains the cloud functions to test.\n */\n",
1932 "excerptTokens": [
1933 {
1934 "kind": "Content",
1935 "text": "funcs: "
1936 },
1937 {
1938 "kind": "Content",
1939 "text": "T"
1940 },
1941 {
1942 "kind": "Content",
1943 "text": ";"
1944 }
1945 ],
1946 "isOptional": false,
1947 "releaseTag": "Public",
1948 "name": "funcs",
1949 "propertyTypeTokenRange": {
1950 "startIndex": 1,
1951 "endIndex": 2
1952 }
1953 },
1954 {
1955 "kind": "PropertySignature",
1956 "canonicalReference": "faastjs!CostAnalyzer.Workload#repetitions:member",
1957 "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",
1958 "excerptTokens": [
1959 {
1960 "kind": "Content",
1961 "text": "repetitions?: "
1962 },
1963 {
1964 "kind": "Content",
1965 "text": "number"
1966 },
1967 {
1968 "kind": "Content",
1969 "text": ";"
1970 }
1971 ],
1972 "isOptional": true,
1973 "releaseTag": "Public",
1974 "name": "repetitions",
1975 "propertyTypeTokenRange": {
1976 "startIndex": 1,
1977 "endIndex": 2
1978 }
1979 },
1980 {
1981 "kind": "PropertySignature",
1982 "canonicalReference": "faastjs!CostAnalyzer.Workload#silent:member",
1983 "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",
1984 "excerptTokens": [
1985 {
1986 "kind": "Content",
1987 "text": "silent?: "
1988 },
1989 {
1990 "kind": "Content",
1991 "text": "boolean"
1992 },
1993 {
1994 "kind": "Content",
1995 "text": ";"
1996 }
1997 ],
1998 "isOptional": true,
1999 "releaseTag": "Public",
2000 "name": "silent",
2001 "propertyTypeTokenRange": {
2002 "startIndex": 1,
2003 "endIndex": 2
2004 }
2005 },
2006 {
2007 "kind": "PropertySignature",
2008 "canonicalReference": "faastjs!CostAnalyzer.Workload#summarize:member",
2009 "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",
2010 "excerptTokens": [
2011 {
2012 "kind": "Content",
2013 "text": "summarize?: "
2014 },
2015 {
2016 "kind": "Content",
2017 "text": "(summaries: "
2018 },
2019 {
2020 "kind": "Reference",
2021 "text": "WorkloadAttribute",
2022 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
2023 },
2024 {
2025 "kind": "Content",
2026 "text": "<A>[]) => "
2027 },
2028 {
2029 "kind": "Reference",
2030 "text": "WorkloadAttribute",
2031 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
2032 },
2033 {
2034 "kind": "Content",
2035 "text": "<A>"
2036 },
2037 {
2038 "kind": "Content",
2039 "text": ";"
2040 }
2041 ],
2042 "isOptional": true,
2043 "releaseTag": "Public",
2044 "name": "summarize",
2045 "propertyTypeTokenRange": {
2046 "startIndex": 1,
2047 "endIndex": 6
2048 }
2049 },
2050 {
2051 "kind": "PropertySignature",
2052 "canonicalReference": "faastjs!CostAnalyzer.Workload#work:member",
2053 "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",
2054 "excerptTokens": [
2055 {
2056 "kind": "Content",
2057 "text": "work: "
2058 },
2059 {
2060 "kind": "Content",
2061 "text": "(faastModule: "
2062 },
2063 {
2064 "kind": "Reference",
2065 "text": "FaastModule",
2066 "canonicalReference": "faastjs!FaastModule:interface"
2067 },
2068 {
2069 "kind": "Content",
2070 "text": "<T>) => "
2071 },
2072 {
2073 "kind": "Reference",
2074 "text": "Promise",
2075 "canonicalReference": "!Promise:interface"
2076 },
2077 {
2078 "kind": "Content",
2079 "text": "<"
2080 },
2081 {
2082 "kind": "Reference",
2083 "text": "WorkloadAttribute",
2084 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type"
2085 },
2086 {
2087 "kind": "Content",
2088 "text": "<A> | void>"
2089 },
2090 {
2091 "kind": "Content",
2092 "text": ";"
2093 }
2094 ],
2095 "isOptional": false,
2096 "releaseTag": "Public",
2097 "name": "work",
2098 "propertyTypeTokenRange": {
2099 "startIndex": 1,
2100 "endIndex": 8
2101 }
2102 }
2103 ],
2104 "extendsTokenRanges": []
2105 },
2106 {
2107 "kind": "TypeAlias",
2108 "canonicalReference": "faastjs!CostAnalyzer.WorkloadAttribute:type",
2109 "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",
2110 "excerptTokens": [
2111 {
2112 "kind": "Content",
2113 "text": "type WorkloadAttribute<A extends "
2114 },
2115 {
2116 "kind": "Content",
2117 "text": "string"
2118 },
2119 {
2120 "kind": "Content",
2121 "text": "> = "
2122 },
2123 {
2124 "kind": "Content",
2125 "text": "{\n [attr in A]: number;\n }"
2126 },
2127 {
2128 "kind": "Content",
2129 "text": ";"
2130 }
2131 ],
2132 "releaseTag": "Public",
2133 "name": "WorkloadAttribute",
2134 "typeParameters": [
2135 {
2136 "typeParameterName": "A",
2137 "constraintTokenRange": {
2138 "startIndex": 1,
2139 "endIndex": 2
2140 },
2141 "defaultTypeTokenRange": {
2142 "startIndex": 0,
2143 "endIndex": 0
2144 }
2145 }
2146 ],
2147 "typeTokenRange": {
2148 "startIndex": 3,
2149 "endIndex": 4
2150 }
2151 }
2152 ]
2153 },
2154 {
2155 "kind": "Class",
2156 "canonicalReference": "faastjs!CostMetric:class",
2157 "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",
2158 "excerptTokens": [
2159 {
2160 "kind": "Content",
2161 "text": "export declare class CostMetric "
2162 }
2163 ],
2164 "releaseTag": "Public",
2165 "name": "CostMetric",
2166 "members": [
2167 {
2168 "kind": "Property",
2169 "canonicalReference": "faastjs!CostMetric#comment:member",
2170 "docComment": "/**\n * An optional comment, usually providing a link to the provider's pricing page and other data.\n */\n",
2171 "excerptTokens": [
2172 {
2173 "kind": "Content",
2174 "text": "readonly comment?: "
2175 },
2176 {
2177 "kind": "Content",
2178 "text": "string"
2179 },
2180 {
2181 "kind": "Content",
2182 "text": ";"
2183 }
2184 ],
2185 "isOptional": true,
2186 "releaseTag": "Public",
2187 "name": "comment",
2188 "propertyTypeTokenRange": {
2189 "startIndex": 1,
2190 "endIndex": 2
2191 },
2192 "isStatic": false
2193 },
2194 {
2195 "kind": "Method",
2196 "canonicalReference": "faastjs!CostMetric#cost:member(1)",
2197 "docComment": "/**\n * The cost contribution of this cost metric. Equal to {@link CostMetric.pricing} * {@link CostMetric.measured}.\n */\n",
2198 "excerptTokens": [
2199 {
2200 "kind": "Content",
2201 "text": "cost(): "
2202 },
2203 {
2204 "kind": "Content",
2205 "text": "number"
2206 },
2207 {
2208 "kind": "Content",
2209 "text": ";"
2210 }
2211 ],
2212 "isOptional": false,
2213 "isStatic": false,
2214 "returnTypeTokenRange": {
2215 "startIndex": 1,
2216 "endIndex": 2
2217 },
2218 "releaseTag": "Public",
2219 "overloadIndex": 1,
2220 "parameters": [],
2221 "name": "cost"
2222 },
2223 {
2224 "kind": "Method",
2225 "canonicalReference": "faastjs!CostMetric#describeCostOnly:member(1)",
2226 "docComment": "/**\n * Return a string with the cost estimate for this metric, omitting comments.\n */\n",
2227 "excerptTokens": [
2228 {
2229 "kind": "Content",
2230 "text": "describeCostOnly(): "
2231 },
2232 {
2233 "kind": "Content",
2234 "text": "string"
2235 },
2236 {
2237 "kind": "Content",
2238 "text": ";"
2239 }
2240 ],
2241 "isOptional": false,
2242 "isStatic": false,
2243 "returnTypeTokenRange": {
2244 "startIndex": 1,
2245 "endIndex": 2
2246 },
2247 "releaseTag": "Public",
2248 "overloadIndex": 1,
2249 "parameters": [],
2250 "name": "describeCostOnly"
2251 },
2252 {
2253 "kind": "Property",
2254 "canonicalReference": "faastjs!CostMetric#informationalOnly:member",
2255 "docComment": "/**\n * True if this cost metric is only for informational purposes (e.g. AWS's `logIngestion`) and does not contribute cost.\n */\n",
2256 "excerptTokens": [
2257 {
2258 "kind": "Content",
2259 "text": "readonly informationalOnly?: "
2260 },
2261 {
2262