@@ -28,7 +28,7 @@ import * as logger from "../logger";
28
28
* an Expression<number> as the value of an option that normally accepts numbers.
29
29
*/
30
30
export abstract class Expression < T extends string | number | boolean | string [ ] > {
31
- /** Returns the Expression 's runtime value, based on the CLI's resolution of params . */
31
+ /** Returns the expression 's runtime value, based on the CLI's resolution of parameters . */
32
32
value ( ) : T {
33
33
if ( process . env . FUNCTIONS_CONTROL_API === "true" ) {
34
34
logger . warn (
@@ -47,11 +47,12 @@ export abstract class Expression<T extends string | number | boolean | string[]>
47
47
throw new Error ( "Not implemented" ) ;
48
48
}
49
49
50
- /** Returns the Expression 's representation as a braced CEL expression. */
50
+ /** Returns the expression 's representation as a braced CEL expression. */
51
51
toCEL ( ) : string {
52
52
return `{{ ${ this . toString ( ) } }}` ;
53
53
}
54
54
55
+ /** Returns the expression's representation as JSON. */
55
56
toJSON ( ) : string {
56
57
return this . toString ( ) ;
57
58
}
@@ -61,8 +62,8 @@ function valueOf<T extends string | number | boolean | string[]>(arg: T | Expres
61
62
return arg instanceof Expression ? arg . runtimeValue ( ) : arg ;
62
63
}
63
64
/**
64
- * Returns how an entity (either an Expression or a literal value) should be represented in CEL.
65
- * - Expressions delegate to the .toString() method, which is used by the WireManifest
65
+ * Returns how an entity (either an ` Expression` or a literal value) should be represented in CEL.
66
+ * - Expressions delegate to the ` .toString()` method, which is used by the WireManifest
66
67
* - Strings have to be quoted explicitly
67
68
* - Arrays are represented as []-delimited, parsable JSON
68
69
* - Numbers and booleans are not quoted explicitly
@@ -159,7 +160,7 @@ export class CompareExpression<
159
160
return `${ this . lhs } ${ this . cmp } ${ rhsStr } ` ;
160
161
}
161
162
162
- /** Returns a TernaryExpression which can resolve to one of two values, based on the resolution of this comparison. */
163
+ /** Returns a ` TernaryExpression` which can resolve to one of two values, based on the resolution of this comparison. */
163
164
thenElse < retT extends string | number | boolean | string [ ] > (
164
165
ifTrue : retT | Expression < retT > ,
165
166
ifFalse : retT | Expression < retT >
@@ -220,8 +221,8 @@ type ParamInput<T> =
220
221
| ( T extends string ? ResourceInput : never ) ;
221
222
222
223
/**
223
- * Specifies that a Param 's value should be determined by prompting the user
224
- * to type it in interactively at deploy- time. Input that does not match the
224
+ * Specifies that a parameter 's value should be determined by prompting the user
225
+ * to type it in interactively at deploy time. Input that does not match the
225
226
* provided validationRegex, if present, will be retried.
226
227
*/
227
228
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -243,7 +244,7 @@ export interface TextInput<T = unknown> {
243
244
}
244
245
245
246
/**
246
- * Specifies that a Param 's value should be determined by having the user
247
+ * Specifies that a parameter 's value should be determined by having the user
247
248
* select from a list containing all the project's resources of a certain
248
249
* type. Currently, only type:"storage.googleapis.com/Bucket" is supported.
249
250
*/
@@ -253,15 +254,18 @@ export interface ResourceInput {
253
254
} ;
254
255
}
255
256
257
+ /**
258
+ * Autogenerate a list of buckets in a project that a user can select from.
259
+ */
256
260
export const BUCKET_PICKER : ResourceInput = {
257
261
resource : {
258
262
type : "storage.googleapis.com/Bucket" ,
259
263
} ,
260
264
} ;
261
265
262
266
/**
263
- * Specifies that a Param 's value should be determined by having the user select
264
- * from a list of pre-canned options interactively at deploy- time.
267
+ * Specifies that a parameter 's value should be determined by having the user select
268
+ * from a list of pre-canned options interactively at deploy time.
265
269
*/
266
270
export interface SelectInput < T = unknown > {
267
271
select : {
@@ -270,9 +274,9 @@ export interface SelectInput<T = unknown> {
270
274
}
271
275
272
276
/**
273
- * Specifies that a Param 's value should be determined by having the user select
274
- * a subset from a list of pre-canned options interactively at deploy- time.
275
- * Will result in errors if used on Params of type other than string[].
277
+ * Specifies that a parameter 's value should be determined by having the user select
278
+ * a subset from a list of pre-canned options interactively at deploy time.
279
+ * Will result in errors if used on parameters of type other than ` string[]` .
276
280
*/
277
281
export interface MultiSelectInput {
278
282
multiSelect : {
@@ -281,27 +285,27 @@ export interface MultiSelectInput {
281
285
}
282
286
283
287
/**
284
- * One of the options provided to a SelectInput, containing a value and
288
+ * One of the options provided to a ` SelectInput` , containing a value and
285
289
* optionally a human-readable label to display in the selection interface.
286
290
*/
287
291
export interface SelectOptions < T = unknown > {
288
292
label ?: string ;
289
293
value : T ;
290
294
}
291
295
292
- /** The wire representation of a Param when it's sent to the CLI. A superset of ParamOptions. */
296
+ /** The wire representation of a parameter when it's sent to the CLI. A superset of ` ParamOptions` . */
293
297
export type ParamSpec < T extends string | number | boolean | string [ ] > = {
294
298
/** The name of the parameter which will be stored in .env files. Use UPPERCASE. */
295
299
name : string ;
296
300
/** An optional default value to be used while prompting for input. Can be a literal or another parametrized expression. */
297
301
default ?: T | Expression < T > ;
298
- /** An optional human-readable string to be used as a replacement for the Param 's name when prompting. */
302
+ /** An optional human-readable string to be used as a replacement for the parameter 's name when prompting. */
299
303
label ?: string ;
300
- /** An optional long-form description of the Param to be displayed while prompting. */
304
+ /** An optional long-form description of the parameter to be displayed while prompting. */
301
305
description ?: string ;
302
306
/** @internal */
303
307
type : ParamValueType ;
304
- /** The way in which the Firebase CLI will prompt for the value of this Param . Defaults to a TextInput. */
308
+ /** The way in which the Firebase CLI will prompt for the value of this parameter . Defaults to a TextInput. */
305
309
input ?: ParamInput < T > ;
306
310
} ;
307
311
@@ -322,7 +326,7 @@ export type WireParamSpec<T extends string | number | boolean | string[]> = {
322
326
input ?: ParamInput < T > ;
323
327
} ;
324
328
325
- /** Configuration options which can be used to customize the prompting behavior of a Param . */
329
+ /** Configuration options which can be used to customize the prompting behavior of a parameter . */
326
330
export type ParamOptions < T extends string | number | boolean | string [ ] > = Omit <
327
331
ParamSpec < T > ,
328
332
"name" | "type"
@@ -345,43 +349,43 @@ export abstract class Param<T extends string | number | boolean | string[]> exte
345
349
throw new Error ( "Not implemented" ) ;
346
350
}
347
351
348
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
352
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
349
353
cmp ( cmp : "==" | "!=" | ">" | ">=" | "<" | "<=" , rhs : T | Expression < T > ) {
350
354
return new CompareExpression < T > ( cmp , this , rhs ) ;
351
355
}
352
356
353
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
357
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
354
358
equals ( rhs : T | Expression < T > ) {
355
359
return this . cmp ( "==" , rhs ) ;
356
360
}
357
361
358
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
362
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
359
363
notEquals ( rhs : T | Expression < T > ) {
360
364
return this . cmp ( "!=" , rhs ) ;
361
365
}
362
366
363
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
367
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
364
368
greaterThan ( rhs : T | Expression < T > ) {
365
369
return this . cmp ( ">" , rhs ) ;
366
370
}
367
371
368
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
372
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
369
373
greaterThanOrEqualTo ( rhs : T | Expression < T > ) {
370
374
return this . cmp ( ">=" , rhs ) ;
371
375
}
372
376
373
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
377
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
374
378
lessThan ( rhs : T | Expression < T > ) {
375
379
return this . cmp ( "<" , rhs ) ;
376
380
}
377
381
378
- /** Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression. */
382
+ /** Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression. */
379
383
lessThanOrEqualTo ( rhs : T | Expression < T > ) {
380
384
return this . cmp ( "<=" , rhs ) ;
381
385
}
382
386
383
387
/**
384
- * Returns a parametrized expression of Boolean type, based on comparing the value of this param to a literal or a different expression.
388
+ * Returns a parametrized expression of Boolean type, based on comparing the value of this parameter to a literal or a different expression.
385
389
* @deprecated A typo. Use lessThanOrEqualTo instead.
386
390
*/
387
391
lessThanorEqualTo ( rhs : T | Expression < T > ) {
@@ -474,7 +478,7 @@ export class StringParam extends Param<string> {
474
478
/**
475
479
* A CEL expression which represents an internal Firebase variable. This class
476
480
* cannot be instantiated by developers, but we provide several canned instances
477
- * of it to make available params that will never have to be defined at
481
+ * of it to make available parameters that will never have to be defined at
478
482
* deployment time, and can always be read from process.env.
479
483
* @internal
480
484
*/
0 commit comments