From fe75f86542bc9bb053c3a8e747ed12b99c658622 Mon Sep 17 00:00:00 2001 From: Justin Glommen Date: Tue, 13 Feb 2024 14:04:29 -0600 Subject: [PATCH 1/5] feat(infra)!: BREAKING CHANGE: Allow multiple sources to be specified for a single BucketDeployment [CLK-469869] --- src/generator.ts | 92 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 12 deletions(-) diff --git a/src/generator.ts b/src/generator.ts index 925c731..8861af5 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -1,7 +1,7 @@ import Ajv, { SchemaObject } from 'ajv'; import { IRole } from 'aws-cdk-lib/aws-iam'; import { IBucket } from 'aws-cdk-lib/aws-s3'; -import { BucketDeployment, BucketDeploymentProps, Source } from 'aws-cdk-lib/aws-s3-deployment'; +import { BucketDeployment, BucketDeploymentProps, ISource, Source } from 'aws-cdk-lib/aws-s3-deployment'; import { Construct } from 'constructs'; // $data fields in schemas allow us to set conditional permitted values. @@ -71,25 +71,38 @@ export interface SerializerProps { //readonly validator?: (contents: any) => boolean; } -export interface GeneratorProps extends Omit { +export interface FileProps { /** * The data to be marshalled. */ readonly contents: any; - readonly fileType: GeneratorFileType; /** * Name of the file, to be created in the path. */ readonly fileName: string; + readonly fileType?: GeneratorFileType; /** * Optionally define how to serialize the final output. */ readonly serializer?: SerializerProps; } +export interface GeneratorProps extends Omit { + files: FileProps[]; +} + export class Generator extends BucketDeployment { + // NOTE: The constructor has a lot of helper functions defined in-line + // since the super call must occur prior to private methods being accessed. constructor(scope: Construct, id: string, props: GeneratorProps) { - const generateFileContents = (contents: any, fileType: GeneratorFileType) => { + /** + * Helper to process and format the contents of the file based on the fileType. + * + * @param contents File contents + * @param fileType? File format type for output. Defaults to JSON. + * @returns The contents structured in the correct file format type + */ + const generateFileContents = (contents: any, fileType?: GeneratorFileType) => { // TODO: Only supports JSON right now switch (fileType) { case GeneratorFileType.JSON: @@ -101,9 +114,30 @@ export class Generator extends BucketDeployment { }; /** - * Ensures the contents adhere to the schema, and the values adhere to - * validator specifications. + * Helper to ensure we utilize the proper Source. based on + * the fileType. + * + * @param fileType? File format type for output. Defaults to JSON. + * @returns Source. + */ + const getSourceDataFunction = (fileType?: GeneratorFileType): ((objectKey: string, obj: any) => ISource) => { + let sourceDataFunc: (objectKey: string, obj: any) => ISource; + // TODO: Support other source types + switch (fileType) { + case GeneratorFileType.JSON: + default: + sourceDataFunc = Source.jsonData; + break; + } + return sourceDataFunc; + }; + + /** + * Helper to ensure the contents adhere to the schema, and the values + * adhere to validator specifications. * + * @param contents File contents + * @param schema? The schema to validate against * @throws if the contents do not match the provided schema */ const validateFileContents = (contents: any, schema?: SchemaObject) => { @@ -116,15 +150,49 @@ export class Generator extends BucketDeployment { } }; - try { - validateFileContents(props.contents, props.serializer?.schema); - } catch (e) { - throw new Error(`Failed validation of contents against schema: ${JSON.stringify(e, null, 2)}`); - } + /** + * Helper to validate the contents of all passed in files. + * + * @param files The properties of each file to validate + * @throws if any file contents do not match the provided schema + */ + const validateFilesContents = (files: FileProps[]) => { + const errMsgs: string[] = []; + for (const fileProps of files) { + try { + validateFileContents(fileProps.contents, fileProps.serializer?.schema); + } catch (e) { + errMsgs.push( + `Failed validation of ${fileProps.fileName} contents against schema: ${JSON.stringify(e, null, 2)}`, + ); + } + } + + // If there are any errors, throw them all at once + if (errMsgs.length > 0) { + throw new Error(errMsgs.join('\n')); + } + }; + + /** + * Helper to retrieve the ISource for each file. + * + * @param files The properties of each file to validate + * @returns Array of ISources to pass to the BucketDeployment + */ + const getSources = (files: FileProps[]): ISource[] => { + return files.map((fileProps) => { + const sourceDataFunc = getSourceDataFunction(fileProps.fileType); + return sourceDataFunc(fileProps.fileName, generateFileContents(fileProps.contents, fileProps.fileType)); + }); + }; + + validateFilesContents(props.files); + const sources = getSources(props.files); super(scope, id, { ...props, - sources: [Source.jsonData(props.fileName, generateFileContents(props.contents, props.fileType))], + sources, prune: props.prune ?? false, }); } From c5059660de4a83b1018c908c385544c210506166 Mon Sep 17 00:00:00 2001 From: Justin Glommen Date: Tue, 13 Feb 2024 14:08:20 -0600 Subject: [PATCH 2/5] chore(infra): Update UTs to validate number of expected assets is accurate [CLK-469869] --- test/generator.test.ts | 68 +++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/test/generator.test.ts b/test/generator.test.ts index ea2f47f..6f447e2 100644 --- a/test/generator.test.ts +++ b/test/generator.test.ts @@ -3,27 +3,37 @@ import { Match, Template } from 'aws-cdk-lib/assertions'; import { Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { schema } from './resources/test.schema'; -import { Generator, GeneratorFileType, GeneratorProps } from '../src'; +import { FileProps, Generator, GeneratorProps } from '../src'; describe('Generator', () => { let app: App; let stack: Stack; - let props: Omit; + // Helper interface for testing + interface GeneratorPropsNoFiles extends Omit {} + // Helper interface to remove contents from FileProps to inject later in the testing below + interface FilePropsNoContents extends Omit {} + + let props: GeneratorPropsNoFiles; + const defaultFilesProps: FilePropsNoContents = { + fileName: 'test.json', + serializer: { + schema, + }, + }; const setupStack = () => { app = new App(); stack = new Stack(app, 'TestStack'); const bucket = Bucket.fromBucketArn(stack, 'TestBucket', 'arn:aws:s3:1232387877:testArn:test-clickup-bucket'); props = { - fileType: GeneratorFileType.JSON, destinationBucket: bucket, destinationKeyPrefix: 'topLevelFolder', - fileName: 'test.json', - serializer: { - schema, - }, }; }; + + const getGeneratorProps = (noFileProps: GeneratorPropsNoFiles, contents: any): GeneratorProps => { + return { ...noFileProps, files: [{ ...defaultFilesProps, contents }] }; + }; // test('generateFileContents', () => { // expect(new Generator(app, 'test', props)['generateFileContents']()).toEqual(props.contents); // }); @@ -50,25 +60,26 @@ describe('Generator', () => { test.each(testCasesShouldSucceed)('validateFileContents succeeds properly', (testContents) => { setupStack(); - const actualProps: GeneratorProps = { ...props, contents: testContents }; + const actualProps: GeneratorProps = getGeneratorProps(props, testContents); expect(() => new Generator(stack, 'test', actualProps)).not.toThrow(); }); test.each(testCasesShouldFail)('validateFileContents fails properly', (testContents) => { setupStack(); - const actualProps: GeneratorProps = { ...props, contents: testContents }; + const actualProps: GeneratorProps = getGeneratorProps(props, testContents); expect(() => new Generator(stack, 'test', actualProps)).toThrow( - new RegExp('Failed validation of contents against schema.*'), + new RegExp(`Failed validation of ${defaultFilesProps.fileName} contents against schema.*`), ); }); }); describe('uploadToS3', () => { beforeEach(setupStack); - const actualProps: GeneratorProps = { - ...props, - contents: { test: true, test1: false, testComplex: { foo: 'bar', arr: [1, 2] } }, - }; + const actualProps: GeneratorProps = getGeneratorProps(props, { + test: true, + test1: false, + testComplex: { foo: 'bar', arr: [1, 2] }, + }); it('creates resources', () => { new Generator(stack, 'Generator', actualProps); @@ -77,6 +88,8 @@ describe('Generator', () => { DestinationBucketKeyPrefix: actualProps.destinationKeyPrefix, DestinationBucketName: actualProps.destinationBucket.bucketName, Prune: false, + // Validates a single asset is included in the Deployment + SourceObjectKeys: Match.arrayEquals([Match.stringLikeRegexp('.*.zip')]), }); }); @@ -135,5 +148,32 @@ describe('Generator', () => { Role: { 'Fn::GetAtt': [roleId, 'Arn'] }, }); }); + + it('supports upload of multiple sources', () => { + const generatorProps: GeneratorProps = { + ...actualProps, + files: [ + ...actualProps.files, + { + ...defaultFilesProps, + fileName: 'test2.json', + contents: { + test: true, + test1: false, + testComplex: { foo: 'testingthisstringer', arr: [2] }, + }, + }, + ], + }; + new Generator(stack, 'Generator', generatorProps); + const template = Template.fromStack(stack); + + const expectedZipFiles = generatorProps.files.map((_file) => '.*.zip'); + template.hasResourceProperties('Custom::CDKBucketDeployment', { + // Validates there are a number of assets equal to the number of passed in files included in the Deployment. + // At the time of writing, that's two according to generatorProps.files. + SourceObjectKeys: Match.arrayWith(expectedZipFiles.map((expectedFile) => Match.stringLikeRegexp(expectedFile))), + }); + }); }); }); From 156fad4f1273901bd6b4b685661202d2377e93f5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Feb 2024 20:16:37 +0000 Subject: [PATCH 3/5] chore: self mutation Signed-off-by: github-actions --- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/Generator.html | 1 + docs/enums/GeneratorFileType.html | 1 + docs/index.html | 4 +- docs/interfaces/FileProps.html | 91 ++++++++++++++++++++++++++++ docs/interfaces/GeneratorProps.html | 35 ++--------- docs/interfaces/SerializerProps.html | 1 + docs/interfaces/UploadProps.html | 1 + 9 files changed, 106 insertions(+), 32 deletions(-) create mode 100644 docs/interfaces/FileProps.html diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index efb4f26..eca0dfa 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA33MywrCMBCF4XeZdVFaUKQPoFtBuxIXQzvS4DQJkxG84Ltb3DQ1tevzn+/0AqW7Qgk7siSoTraG6fjwBBl41LafyN66sEyCRasd99XV2AbKzTtLrcGoGUOgSBm/82Lyvxfnw4AYqyQXrGPnm4yxYrWOsAOJQTZPmtF+mjmu8uyw+U9Fe8qcP5Wwh1VwAQAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA33OTQrCMBAF4LvMuigWFOkB6lbQrsTF0E5pME1CMoI/eHfjxibGZv3e+2ZOT2C6MVSwI0UWWdtaSDreDUEBBnnwEanr6JZJYTHwKH3rIlQH1fZVpNZktBKdo0CJ16sy3H8u7K02btoLxWR7bD3xTWOiXG/+vTDvxJUcdiArUIoHZbSfTo5rjNTYzVNBnjLnN4mAmUqzAQAA" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index ca65dd6..e34280e 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6VWTY/aMBD9L+YaAeMQCJyrVu1ht9K2vSBUpeAt6YYkckK/EP+94yTE48XeeOkF4eS9eZ43HmdOTBa/KrZan9hTmu/YKg5YnhwEW7F3IhcyqQv5Ns3Epz+lYAE7ygzfiPx4qCZX78f7+pAhaJslVSUwKGPn4BIX5n3gDw/3d16xRh2SBAxYmUiR19b9aTUeabnPZVYku4+yKKteNc1rIR+Tragm5PXLCUz5rI/57bh9ErVPuFEPtWdBd+cQK5N67yXVAW8WekQj79RfHzECvj0zecz91C7Im6WkqJM0v8/fiEzUfppXlNvFi8xTsgW+Roge9Qch0yRL/wrpPO7PIP5HvtruxSHxDTnq4fZcnu/Unk/f4s50TIR/NtsCY+S1b8wRwQ/cRoMdZlylA7IE/7+yrsZ2yb7Y236yVV9kX2GD8Vppbvl29cJdMK364lmJgNOjUtXyuB2ONjKhA/tn502AfuzEb7Y6sZ9CVmmRI4CPw/ESGY+pyHbq09xuBOMVh4OKsenefRFKSCFayGTKgvU04NE4XG42wfpCaJ43DxoU4AosKDBQHFfcguIGKsRVaEGFBmqGq5kFNTNQEa6igE/HPAYDFhmwOa7mlmBzA7XA1cKCWhioGFexBRUbKCzGemlBLU1blctgsx+e+d8UwFoBswSgvAZbEcCsAii7wVYHMAsBM5fHYNYClOdgqxmY1QBlO0Q2oFkQUM6DrXDQ1qRpBuyCWuzet02Bx/oyPJ3Y165TwktfnliIP+ez7gu1agOTLtRMPYGeGGo6ud09T4icELmDqK7Mtk81MdK8SAEDhja76XVz0RNdkiu4kv2ubzrCJMpYhwGmTXuqA0yH+GX7cSbyQOTBQf9R4W1HSYTjoLTzrabMNMXlazc3ag45BC5j2rmvQHw792nyQpNdB6id4DQl1pTYQbmMSsQLYj+4/KffSkIlpkA0SL2q3VLTlw72sZlDr5ikS6xNgg1epqXIUizIar05n/8Brc4hHnwOAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA51XTY/aMBT8L+YaAc8hEDhXrdrDbqVte0GoSsGUdEMSJaFfiP/e53z5GWziclmt1zNv7Bk/x3tmRfarZKv1mb3G6Y6tQo+l0VGwFXsnUlFEVVa8jRPx6U8umMdORYIzIj0dy8nN/PhQHRMEbZOoLAUWZezidXVh3hf+8PL85FRr1CJJQY/lUSHSyrg+pcYDJfc5T7Jo97HI8rJXjdNKFPtoK8oJmb6/gSmf9TW/nbavonIpN+qh5l3Q1VnE8qg6OEm1wIeF9mjkk/zVRYyAH99ZcUrd1Drkw1KFqKI4fU7fiERUbpo3lMfFs8RRsgH+jxA96i+iiKMk/isK63G/grgf+XJ7EMfIteSoh5v3cr1S835kZ1t30k+672GbIT2tHMqNCNS8A7W2B7rpSmywl5zEtDv6vlgLfVCs7MNzkNPA7oL0GPQ3vfUs6Aj3AyG9cC046sADn6Mb67jhm9prtsWU4N3FB8DpYS6r4rQdrjbSoQPrZ5eNh1bsxG+2OrOfoijjLEUAH/vjJTL2sUh28snQLATrZcejrLFp574IKSQRDWQyZd566vH52F/CZuOtO0Y9Uf+hhgGOwAQDDcZxxE0wrsF8HPkmmK/BZjiamWAzDRbgKPA4jHnINVigweY4mpuqzTXYAkcLE2yhwUIchSZYqMEwlPXSBFvq9kq3wZgDXAVRJ2GOQs8CpOdgTAP0OMC3OQh6ICCNB2NyoGcC0nswhgd6LCDth8CI1JMBmQAYIwQ9HJAhgDFF0PMBmQMYg4QmorrhsNMqsXvfNB62TvdwPLOvbTf6Xe+fmY8/LhfVe3LUFCadrpgQKipqWrntJ48QOSFyC1FejM1doIiB4gUS6DGwrVnS8+ZmJ8JAhOEOU2fNCWtxh1XVH0BCJN7iMTMTv6vbmzAXhBkOMU3aU1VgOsS/9YkYjWfZTP9R4g1OSYRjoTT/SyjKTFFs9rRvdMUhYdhW1ryxM8Q3b2xFJrbagmxey4pCDrktiO5ZSrwg9oPNf/qIIVRiCgSD1Jvslopu68lT/ea/YZKuNDYlXih5nIskxkBW683l8g8jc3LK6A8AAA=="; \ No newline at end of file diff --git a/docs/classes/Generator.html b/docs/classes/Generator.html index d4bb11b..acc78c6 100644 --- a/docs/classes/Generator.html +++ b/docs/classes/Generator.html @@ -198,6 +198,7 @@

  • GeneratorFileType
  • Generator
  • +
  • FileProps
  • GeneratorProps
  • SerializerProps
  • UploadProps
  • diff --git a/docs/enums/GeneratorFileType.html b/docs/enums/GeneratorFileType.html index 8656004..eadfaa3 100644 --- a/docs/enums/GeneratorFileType.html +++ b/docs/enums/GeneratorFileType.html @@ -54,6 +54,7 @@

  • GeneratorFileType
  • Generator
  • +
  • FileProps
  • GeneratorProps
  • SerializerProps
  • UploadProps
  • diff --git a/docs/index.html b/docs/index.html index 88bcd4c..6b42f87 100644 --- a/docs/index.html +++ b/docs/index.html @@ -25,7 +25,8 @@

    Classes

    Interfaces

    -
    @@ -49,6 +50,7 @@

    Theme

    +
    +
    +
      +
    • Preparing search index...
    • +
    • The search index is not available
    @time-loop/cdk-s3-file-generator +
    +
    +
    + +
    +

    Hierarchy

    +
      +
    • FileProps
    +
    +
    +
    + +
    +
    +

    Properties

    +
    +
    +

    Properties

    +
    + +
    contents: any
    +

    The data to be marshalled.

    +
    +
    +
    + +
    fileName: string
    +

    Name of the file, to be created in the path.

    +
    +
    +
    + +
    fileType?: JSON
    +
    + +
    serializer?: SerializerProps
    +

    Optionally define how to serialize the final output.

    +
    +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file diff --git a/docs/interfaces/GeneratorProps.html b/docs/interfaces/GeneratorProps.html index 3c9aa07..01e57fd 100644 --- a/docs/interfaces/GeneratorProps.html +++ b/docs/interfaces/GeneratorProps.html @@ -34,7 +34,6 @@

    Properties

    contentEncoding? contentLanguage? contentType? -contents destinationBucket destinationKeyPrefix? distribution? @@ -43,8 +42,7 @@

    Properties

    exclude? expires? extract? -fileName -fileType +files include? logRetention? memoryLimit? @@ -52,7 +50,6 @@

    Properties

    prune? retainOnDelete? role? -serializer? serverSideEncryption? serverSideEncryptionAwsKmsKeyId? serverSideEncryptionCustomerAlgorithm? @@ -137,12 +134,6 @@

    Default

    - See

    https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata

    -
    - -
    contents: any
    -

    The data to be marshalled.

    -
    -
    destinationBucket: IBucket
    @@ -232,15 +223,9 @@

    Default

    true
     
    -
    - -
    fileName: string
    -

    Name of the file, to be created in the path.

    -
    -
    -
    - -
    fileType: JSON
    +
    + +
    files: FileProps[]
    include?: string[]
    @@ -333,12 +318,6 @@

    Default

    - 
    -
    - -
    serializer?: SerializerProps
    -

    Optionally define how to serialize the final output.

    -
    -
    serverSideEncryption?: ServerSideEncryption
    @@ -470,7 +449,6 @@

    contentEncoding
  • contentLanguage
  • contentType
  • -
  • contents
  • destinationBucket
  • destinationKeyPrefix
  • distribution
  • @@ -479,8 +457,7 @@

    exclude
  • expires
  • extract
  • -
  • fileName
  • -
  • fileType
  • +
  • files
  • include
  • logRetention
  • memoryLimit
  • @@ -488,7 +465,6 @@

    prune
  • retainOnDelete
  • role
  • -
  • serializer
  • serverSideEncryption
  • serverSideEncryptionAwsKmsKeyId
  • serverSideEncryptionCustomerAlgorithm
  • @@ -503,6 +479,7 @@

  • GeneratorFileType
  • Generator
  • +
  • FileProps
  • GeneratorProps
  • SerializerProps
  • UploadProps
  • diff --git a/docs/interfaces/SerializerProps.html b/docs/interfaces/SerializerProps.html index dc4cab3..370c255 100644 --- a/docs/interfaces/SerializerProps.html +++ b/docs/interfaces/SerializerProps.html @@ -64,6 +64,7 @@

  • GeneratorFileType
  • Generator
  • +
  • FileProps
  • GeneratorProps
  • SerializerProps
  • UploadProps
  • diff --git a/docs/interfaces/UploadProps.html b/docs/interfaces/UploadProps.html index fa29838..add37ec 100644 --- a/docs/interfaces/UploadProps.html +++ b/docs/interfaces/UploadProps.html @@ -119,6 +119,7 @@

  • GeneratorFileType
  • Generator
  • +
  • FileProps
  • GeneratorProps
  • SerializerProps
  • UploadProps
  • From f8b409654e16069dd9bde2e3bbe6a52905f2bce7 Mon Sep 17 00:00:00 2001 From: Justin Glommen Date: Tue, 13 Feb 2024 14:40:33 -0600 Subject: [PATCH 4/5] feat(infra)!: BREAKING CHANGE: Remove exposed, superfluous interface [CLK-469869] --- src/generator.ts | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/src/generator.ts b/src/generator.ts index 8861af5..84564f4 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -1,6 +1,4 @@ import Ajv, { SchemaObject } from 'ajv'; -import { IRole } from 'aws-cdk-lib/aws-iam'; -import { IBucket } from 'aws-cdk-lib/aws-s3'; import { BucketDeployment, BucketDeploymentProps, ISource, Source } from 'aws-cdk-lib/aws-s3-deployment'; import { Construct } from 'constructs'; @@ -15,46 +13,6 @@ export enum GeneratorFileType { // TODO: YAML = 'generator_yaml', } -export interface UploadProps { - /** - * Bucket where the file will be uploaded. - */ - readonly bucket: IBucket; - /** - * The path in the bucket to which the file will be uploaded. - * @default - root of the bucket - */ - readonly path?: string; - /** - * Name of the file, to be created in the path. - */ - readonly fileName: string; - /** - * Whether or not to clear out the destination directory before uploading. - * - * @default false - */ - readonly prune?: boolean; - /** - * Whether or not to delete the objects from the bucket when this resource - * is deleted/updated from the stack. - * - * NOTE: Changing the logical ID of the `BucketDeployment` construct, without changing the destination - * (for example due to refactoring, or intentional ID change) **will result in the deletion of the objects**. - * This is because CloudFormation will first create the new resource, which will have no affect, - * followed by a deletion of the old resource, which will cause a deletion of the objects, - * since the destination hasn't changed, and `retainOnDelete` is `false`. - * - * @default true - */ - readonly retainOnDelete?: boolean; - /** - * Used as the Lambda Execution Role for the BucketDeployment. - * @default - role is created automatically by the Construct - */ - readonly role?: IRole; -} - export interface SerializerProps { /** * Skeleton of final structure, i.e., definition of the output's structure. From 86110245bce807182e548ddc740c0f83dbaf3089 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Feb 2024 20:42:26 +0000 Subject: [PATCH 5/5] chore: self mutation Signed-off-by: github-actions --- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/Generator.html | 3 +- docs/enums/GeneratorFileType.html | 3 +- docs/index.html | 4 +- docs/interfaces/FileProps.html | 3 +- docs/interfaces/GeneratorProps.html | 3 +- docs/interfaces/SerializerProps.html | 3 +- docs/interfaces/UploadProps.html | 128 --------------------------- 9 files changed, 8 insertions(+), 143 deletions(-) delete mode 100644 docs/interfaces/UploadProps.html diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index eca0dfa..d78fbc7 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA33OTQrCMBAF4LvMuigWFOkB6lbQrsTF0E5pME1CMoI/eHfjxibGZv3e+2ZOT2C6MVSwI0UWWdtaSDreDUEBBnnwEanr6JZJYTHwKH3rIlQH1fZVpNZktBKdo0CJ16sy3H8u7K02btoLxWR7bD3xTWOiXG/+vTDvxJUcdiArUIoHZbSfTo5rjNTYzVNBnjLnN4mAmUqzAQAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA4uuVipJrShRslJyT81LLUosyS9yy8xJDaksSFXSUSpILMkASqXmleYW62Mo0Msoyc0BqsrOzEtRsrKo1cE0C2FGck5icXEqkimoug2NkPWDbAgoyi8oRujPzCtJLUpLTAYaAZdFNcLI1AybE3Cbg6oEn2HBqUWZiTmZVal4TENTg2lcLABbmhuxbAEAAA==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index e34280e..31b0b02 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA51XTY/aMBT8L+YaAc8hEDhXrdrDbqVte0GoSsGUdEMSJaFfiP/e53z5GWziclmt1zNv7Bk/x3tmRfarZKv1mb3G6Y6tQo+l0VGwFXsnUlFEVVa8jRPx6U8umMdORYIzIj0dy8nN/PhQHRMEbZOoLAUWZezidXVh3hf+8PL85FRr1CJJQY/lUSHSyrg+pcYDJfc5T7Jo97HI8rJXjdNKFPtoK8oJmb6/gSmf9TW/nbavonIpN+qh5l3Q1VnE8qg6OEm1wIeF9mjkk/zVRYyAH99ZcUrd1Drkw1KFqKI4fU7fiERUbpo3lMfFs8RRsgH+jxA96i+iiKMk/isK63G/grgf+XJ7EMfIteSoh5v3cr1S835kZ1t30k+672GbIT2tHMqNCNS8A7W2B7rpSmywl5zEtDv6vlgLfVCs7MNzkNPA7oL0GPQ3vfUs6Aj3AyG9cC046sADn6Mb67jhm9prtsWU4N3FB8DpYS6r4rQdrjbSoQPrZ5eNh1bsxG+2OrOfoijjLEUAH/vjJTL2sUh28snQLATrZcejrLFp574IKSQRDWQyZd566vH52F/CZuOtO0Y9Uf+hhgGOwAQDDcZxxE0wrsF8HPkmmK/BZjiamWAzDRbgKPA4jHnINVigweY4mpuqzTXYAkcLE2yhwUIchSZYqMEwlPXSBFvq9kq3wZgDXAVRJ2GOQs8CpOdgTAP0OMC3OQh6ICCNB2NyoGcC0nswhgd6LCDth8CI1JMBmQAYIwQ9HJAhgDFF0PMBmQMYg4QmorrhsNMqsXvfNB62TvdwPLOvbTf6Xe+fmY8/LhfVe3LUFCadrpgQKipqWrntJ48QOSFyC1FejM1doIiB4gUS6DGwrVnS8+ZmJ8JAhOEOU2fNCWtxh1XVH0BCJN7iMTMTv6vbmzAXhBkOMU3aU1VgOsS/9YkYjWfZTP9R4g1OSYRjoTT/SyjKTFFs9rRvdMUhYdhW1ryxM8Q3b2xFJrbagmxey4pCDrktiO5ZSrwg9oPNf/qIIVRiCgSD1Jvslopu68lT/ea/YZKuNDYlXih5nIskxkBW683l8g8jc3LK6A8AAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WWyW7bMBCG34W6Crap3XqAFu0hLZCiF8EoBJtulGgDKXcT9O4dSraGtKkF7c1jfv8snN9MWsKrn4LESUvesvJE4sgmZVowEpP3rGQ8bSr+LsvZl981Iza58BxOWHkpxPbhfPPSFDlAxzwVgkFSQjr7lpcGY+KPz5+eVuWyrqSS0CZ1ylnZGPvDao6P5Z4Zz9I8+8P4Z17VYqyclQ3j5/TIxPYOmR9k53hjbnF8YUW6NqU14uaJ7js1zyPHnZxkPFw/w7ECedmsSGcpqHkC7G2i2BmAJ/lxuZiC/kcxzbjzxa7oPxYT4/JWlNPg9QVVG4z2n/SCTqw3hLyLtQmtG7zwG324Osfw0Iw1r8mw4GzzPnVUM4uGX47L2SwdXeifdAcbruLEfpG4JT8YF1lVAuBs3M0eFOeM5Sf5jg6NQL6qKGSOw/XsK5OFJDEg2x2xk53tQAI3OBzs5KboD/oveoxCRE0Y1TAHIseEORrmQuSaMFfDPIg8E+ZpmA+Rb8J8DQsgCkxYoGEhRKEJCzUsgigyYZGGwVKSvQnb69crb5sa90DvFtFvwrwKfRdU3jk1boMO6+i9BCZq2OnD4Kkk0a3bkm9Xt6G5WwLyuO06dJeMhvy3hxmFPur8CZn88Q5+RVmAsmBGVg+vDuo81HkzOk0DF4+z7WZUTf80ozBEXTgh+46vilKQKgXpktJUWel4quFR/3BHexTvJ8SvAt4VtWOl4QnJ7b8KFLkocqdEyl8gFEYojBaFD+MpTjUaFWxfZzXLsxKY5NB1fwHxGRJbfgoAAA=="; \ No newline at end of file diff --git a/docs/classes/Generator.html b/docs/classes/Generator.html index acc78c6..29c423f 100644 --- a/docs/classes/Generator.html +++ b/docs/classes/Generator.html @@ -200,8 +200,7 @@

    Generator
  • FileProps
  • GeneratorProps
  • -
  • SerializerProps
  • -
  • UploadProps
  • +
  • SerializerProps
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/GeneratorFileType.html b/docs/enums/GeneratorFileType.html index eadfaa3..a1d3d16 100644 --- a/docs/enums/GeneratorFileType.html +++ b/docs/enums/GeneratorFileType.html @@ -56,8 +56,7 @@

    Generator
  • FileProps
  • GeneratorProps
  • -
  • SerializerProps
  • -
  • UploadProps
  • +
  • SerializerProps
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6b42f87..f4be21d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -28,7 +28,6 @@

    Interfaces

    -
    -
    -
      -
    • Preparing search index...
    • -
    • The search index is not available
    @time-loop/cdk-s3-file-generator
    -
    -
    -
    -
    - -

    Interface UploadProps

    -
    -

    Hierarchy

    -
      -
    • UploadProps
    -
    -
    -
    - -
    -
    -

    Properties

    -
    - -
    bucket: IBucket
    -

    Bucket where the file will be uploaded.

    -
    -
    -
    - -
    fileName: string
    -

    Name of the file, to be created in the path.

    -
    -
    -
    - -
    path?: string
    -

    The path in the bucket to which the file will be uploaded.

    -
    -
    -

    Default

    - root of the bucket
    -
    -
    -
    - -
    prune?: boolean
    -

    Whether or not to clear out the destination directory before uploading.

    -
    -
    -

    Default

    false
    -
    -
    -
    - -
    retainOnDelete?: boolean
    -

    Whether or not to delete the objects from the bucket when this resource -is deleted/updated from the stack.

    -

    NOTE: Changing the logical ID of the BucketDeployment construct, without changing the destination -(for example due to refactoring, or intentional ID change) will result in the deletion of the objects. -This is because CloudFormation will first create the new resource, which will have no affect, -followed by a deletion of the old resource, which will cause a deletion of the objects, -since the destination hasn't changed, and retainOnDelete is false.

    -
    -
    -

    Default

    true
    -
    -
    -
    - -
    role?: IRole
    -

    Used as the Lambda Execution Role for the BucketDeployment.

    -
    -
    -

    Default

    - role is created automatically by the Construct
    -
    -
    -
    - -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file