message: [build-utils] Add `allowQuery` to Lambda
diff: @@ -19,6 +19,7 @@ interface LambdaOptions {
  memory?: number;
  maxDuration?: number;
  environment: Environment;
  + allowQuery?: string[];
  }
  interface CreateLambdaOptions {
  @@ -28,6 +29,7 @@ interface CreateLambdaOptions {
  memory?: number;
  maxDuration?: number;
  environment?: Environment;
  + allowQuery?: string[];
  }
  interface GetLambdaOptionsFromFunctionOptions {
  @@ -43,6 +45,7 @@ export class Lambda {
  public memory?: number;
  public maxDuration?: number;
  public environment: Environment;
  + public allowQuery?: string[];
  constructor({
  zipBuffer,
  @@ -51,6 +54,7 @@ export class Lambda {
  maxDuration,
  memory,
  environment,
  + allowQuery,
  }: LambdaOptions) {
  this.type = 'Lambda';
  this.zipBuffer = zipBuffer;
  @@ -59,6 +63,7 @@ export class Lambda {
  this.memory = memory;
  this.maxDuration = maxDuration;
  this.environment = environment;
  + this.allowQuery = allowQuery;
  }
  }
  @@ -72,6 +77,7 @@ export async function createLambda({
  memory,
  maxDuration,
  environment = {},
  + allowQuery,
  }: CreateLambdaOptions): Promise<Lambda> {
  assert(typeof files === 'object', '"files" must be an object');
  assert(typeof handler === 'string', '"handler" is not a string');
  @@ -86,6 +92,14 @@ export async function createLambda({
  assert(typeof maxDuration === 'number', '"maxDuration" is not a number');
  }
  + if (allowQuery !== undefined) {
  + assert(Array.isArray(allowQuery), '"allowQuery" is not an Array');
  + assert(
  + allowQuery.every(q => typeof q === 'string'),
  + '"allowQuery" is not a string Array'
  + );
  + }
  +
  await sema.acquire();
  try {
  @@ -131,9 +145,7 @@ export async function createZip(files: Files): Promise<Buffer> {
  }
  zipFile.end();
  - streamToBuffer(zipFile.outputStream)
  - .then(resolve)
  - .catch(reject);
  + streamToBuffer(zipFile.outputStream).then(resolve).catch(reject);
  });
  return zipBuffer;
  