construct-hub 0.2.55 → 0.2.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/.gitattributes +0 -1
  2. package/.jsii +78 -11
  3. package/API.md +44 -0
  4. package/README.md +7 -0
  5. package/lib/backend/catalog-builder/catalog-builder.bundle/index.js +1 -1
  6. package/lib/backend/catalog-builder/catalog-builder.bundle/index.js.map +1 -1
  7. package/lib/backend/catalog-builder/catalog-builder.lambda.js +2 -2
  8. package/lib/backend/ingestion/ingestion.bundle/index.js +3 -3
  9. package/lib/backend/ingestion/ingestion.bundle/index.js.map +1 -1
  10. package/lib/backend/ingestion/ingestion.lambda.js +4 -4
  11. package/lib/backend/orchestration/index.js +3 -2
  12. package/lib/backend/package-stats/package-stats.bundle/index.js +1 -1
  13. package/lib/backend/package-stats/package-stats.bundle/index.js.map +1 -1
  14. package/lib/backend/package-stats/package-stats.lambda.js +2 -2
  15. package/lib/backend/transliterator/transliterator.bundle/index.js +6 -6
  16. package/lib/backend/transliterator/transliterator.bundle/index.js.map +1 -1
  17. package/lib/backend/transliterator/transliterator.ecstask.js +2 -2
  18. package/lib/construct-hub.d.ts +7 -1
  19. package/lib/construct-hub.js +3 -2
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.js +1 -1
  22. package/lib/package-sources/code-artifact.js +1 -1
  23. package/lib/package-sources/npmjs.js +1 -1
  24. package/lib/package-tag/index.js +2 -2
  25. package/lib/spdx-license.js +1 -1
  26. package/lib/webapp/config.d.ts +5 -1
  27. package/lib/webapp/config.js +2 -1
  28. package/lib/webapp/index.d.ts +16 -0
  29. package/lib/webapp/index.js +11 -4
  30. package/package.json +3 -4
  31. package/lib/webapp/cache-invalidator/constants.d.ts +0 -4
  32. package/lib/webapp/cache-invalidator/constants.js +0 -5
  33. package/lib/webapp/cache-invalidator/handler.bundle/index.js +0 -1404
  34. package/lib/webapp/cache-invalidator/handler.bundle/index.js.map +0 -7
  35. package/lib/webapp/cache-invalidator/handler.d.ts +0 -7
  36. package/lib/webapp/cache-invalidator/handler.js +0 -19
  37. package/lib/webapp/cache-invalidator/handler.lambda.d.ts +0 -3
  38. package/lib/webapp/cache-invalidator/handler.lambda.js +0 -42
  39. package/lib/webapp/cache-invalidator/index.d.ts +0 -34
  40. package/lib/webapp/cache-invalidator/index.js +0 -57
package/.gitattributes CHANGED
@@ -39,6 +39,5 @@
39
39
  /src/package-sources/npmjs/npm-js-follower.ts linguist-generated
40
40
  /src/package-sources/npmjs/stage-and-notify.ts linguist-generated
41
41
  /src/spdx-license.ts linguist-generated
42
- /src/webapp/cache-invalidator/handler.ts linguist-generated
43
42
  /tsconfig.dev.json linguist-generated
44
43
  /yarn.lock linguist-generated
package/.jsii CHANGED
@@ -1868,7 +1868,7 @@
1868
1868
  },
1869
1869
  "name": "construct-hub",
1870
1870
  "readme": {
1871
- "markdown": "# Construct Hub\n\nThis project maintains a [AWS Cloud Development Kit][aws-cdk] construct library\nthat can be used to deploy instances of the Construct Hub in any AWS Account.\n\nThis software backs the public instance of the\n[ConstructHub](https://constructs.dev), and can be used to deploy a self-hosted\ninstance with personalized configuration.\n\n[aws-cdk]: https://github.com/aws/aws-cdk\n\n\n## :question: Getting Started\n\n> :warning: Disclaimer\n>\n> The [public instance of ConstructHub](https://constructs.dev) is currently in\n> *Developer Preview*.\n>\n> Self-hosted ConstructHub instances are however in active development and\n> should be considered *experimental*. Breaking changes to the public API of\n> this package are expected to be released without prior notice, and the\n> infrastructure and operational posture of ConstructHub instances may also\n> significantly change.\n>\n> You are welcome to deploy self-hosted instances of ConstructHub for evaluation\n> purposes, and we welcome any feedback (good or bad) from your experience in\n> doing so.\n\n### Quick Start\n\nOnce you have installed the `construct-hub` library in your project, the\nsimplest way to get started is to create an instance of the `ConstructHub`\nconstruct:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub');\n```\n\n### Personalization\n\n#### Using a custom domain name\n\nIn order to use a custom domain for your ConstructHub instance instead of the\ndefault CloudFront domain name, specify the `domain` property with the following\nelements:\n\nAttribute | Description\n------------------------------|---------------------------------------------------------------------\n`zone` | A Route53 Hosted Zone, where DNS records will be added.\n`cert` | An Amazon Certificate Manager certificate, which must be in the `us-east-1` region.\n`monitorCertificateExpiration`| Set to `false` if you do not want an alarm to be created when the certificate is close to expiry.\n\nYour self-hosted ConstructHub instance will be served from the root of the\nprovided `zone`, so the certificate must match this name.\n\n#### Alternate package sources\n\nBy default, ConstructHub has a single package source configured: the public\n`npmjs.com` registry. Self-hosted instances typically should list packages from\nalternate sources, either in addition to packages from `npmjs.com`, or instead\nof those.\n\nThe `packageSources` property can be used to replace the default set of package\nsources configured on the instance. ConstructHub provides `IPackageSource`\nimplementations for the public `npmjs.com` registry as well as for private\nCodeArtifact repositories:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nconst registry = new codeartifact.CfnRegistry(stack, 'Registry', {\n // ....\n});\nnew ConstructHub(stack, 'ConstructHub', {\n packageSources: [\n new sources.NpmJs(), // Remove if you do NOT want npmjs.com packages\n new sources.CodeArtifact({ registry }),\n ],\n});\n```\n\nYou may also implement a custom `IPackageSource` if you want to index packages\nfrom alternate locations. In this case, the component you provide will be\nresponsible for sending notifications to an SQS Queue about newly discovered\npackages. You may refer to the [sources.NpmJs] and [sources.CodeArtifact]\nimplementations as a reference for hos this can be done.\n\nBy default, download counts of NPM packages will be fetched periodically from\nNPM's public API by a Lambda. Since this is not desirable if you are using a\nprivate package registry, this is automatically disabled if you specify your own\nvalue for `packageSources`. (But this can be re-enabled through the\n`fetchPackageStats` property if needed).\n\n[sources.NpmJs]: src/package-sources/npmjs.ts\n[sources.CodeArtifact]: src/package-sources/code-artifact.ts\n\n#### Package deny list\n\nCertain packages may be undesirable to show in your self-hosted ConstructHub\ninstance. In order to prevent a package from ever being listed in construct hub,\nthe `denyList` property can be configured with a set of `DenyListRule` objects\nthat specify which package or package versions should never be lested:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub', {\n denyList: [\n // Denying _all_ versions of the \"sneaky-hackery\" package\n { packageName: 'sneaky-hackery', reason: 'Mines bitcoins wherever it gets installed' },\n // Denying _a specific_ version of the \"bad-release\" package\n { packageName: 'bad-release', version: '1.2.3', reason: 'CVE-####-#####' },\n ],\n});\n```\n\n#### Decrease deployment footprint\n\nBy default, ConstructHub executes the documentation rendering process in the\ncontext of isolated subnets. This is a defense-in-depth mechanism to mitigate\nthe risks associated with downloading aribtrary (un-trusted) *npm packages* and\ntheir dependency closures.\n\nThis layer of security implies the creation of a number of resources that can\nincrease the operating cost of your self-hosted instance: several VPC endpoints\nare created, an internal CodeArtifact repository needs to be provisioned, etc...\n\nWhile we generally recommend leaving these features enabled, if your self-hosted\nConstructHub instance only indexes *trusted* packages (as could be the case for\nan instance that does not list packages from the public `npmjs.com` registry),\nyou may set the `isolateLambdas` setting to `false`.\n\n\n## :gear: Operating a self-hosted instance\n\n1. [Application Overview](./docs/application-overview.md) provides a high-level\n description of the components that make a ConstructHub instance. This is a\n great starting point for people who consider operating a self-hosted instance\n of ConstructHub; and for new operators on-boarding the platform.\n\n1. [Operator Runbook](./docs/operator-runbook.md) is a series of diagnostics and\n troubleshooting guides indended for operators to have a quick and easy way to\n navigate a ConstructHub instance when they are reacting to an alarm or bug\n report.\n\n### :nail_care: Customizing the frontend\n\nThere are a number of customizations available in order to make your private\nconstruct hub better tailored to your organization.\n\n#### Package Tags\n\nConfiguring package tags allows you to compute additional labels to be applied\nto packages. These can be used to indicate to users which packages are owned by\ntrusted organizations, or any other arbitrary conditions, and can be referenced\nwhile searching.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.field('name').eq('construct-hub'),\n }]\n});\n```\n\nThe above example will result in packages with the `name` of `construct-hub` to\nreceive the `Official` tag, which is colored green.\n\nCombinations of conditions are also supported:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.or(\n TagCondition.field('name').eq('construct-hub'),\n TagCondition.field('name').eq('construct-hub-webapp'),\n ),\n }]\n});\n\n// or more succintly if you have a long list\ncondition: TagCondition.or(\n ...['construct-hub', 'construct-hub-webapp', '...',]\n .map(name => TagCondition.field('name').eq(name))\n),\n```\n\nYou can assert against any value within package json including nested ones.\n```ts\nTagCondition.field('constructHub', 'nested', 'key').eq('value');\n\n// checks\npackageJson?.constructHub?.nested?.key === value;\n```\n\n#### Package Links\n\nConfiguring package links allows you to replace the `Repository`, `License`,\nand `Registry` links on the package details page with whatever you choose.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageLinks: [{\n linkLabel: 'Service Level Agreement',\n configKey: 'SLA',\n }, {\n linkLabel: 'Contact',\n configKey: 'Contact',\n linkText: 'Email Me!',\n allowedDomains: ['me.com'],\n }]\n});\n```\n\nThis would allow publishers to add the following to their package.json:\n\n```json\n\"constructHub\": {\n \"packageLinks\": {\n \"SLA\": \"https://support.mypackage.com\",\n \"Contact\": \"me.com/contact\"\n }\n}\n```\n\nThen the links on the corresponding package page would show these items as\nconfigured.\n\n#### Home Page\n\nThe home page is divided into sections, each with a header and list of packages.\nCurrently, for a given section you can display either the most recently updated\npackages, or a curated list of packages.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n featuredPackages: {\n sections: [\n {\n name: \"Recently updated\",\n showLastUpdated: 4\n },\n {\n name: \"From the AWS CDK\",\n showPackages: [\n {\n name: \"@aws-cdk/core\"\n },\n {\n name: \"@aws-cdk/aws-s3\",\n comment: \"One of the most popular AWS CDK libraries!\"\n },\n {\n name: \"@aws-cdk/aws-lambda\"\n },\n {\n name: \"@aws-cdk/pipelines\"\n comment: \"The pipelines L3 construct library abstracts away many of the details of managing software deployment within AWS.\"\n }\n ]\n }\n ]\n }\n});\n```\n\n## :raised_hand: Contributing\n\nIf you are looking to contribute to this project, but don't know where to start,\nhave a look at our [contributing guide](CONTRIBUTING.md)!\n\n\n## :cop: Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n\n## :balance_scale: License\n\nThis project is licensed under the Apache-2.0 License.\n"
1871
+ "markdown": "# Construct Hub\n\nThis project maintains a [AWS Cloud Development Kit][aws-cdk] construct library\nthat can be used to deploy instances of the Construct Hub in any AWS Account.\n\nThis software backs the public instance of the\n[ConstructHub](https://constructs.dev), and can be used to deploy a self-hosted\ninstance with personalized configuration.\n\n[aws-cdk]: https://github.com/aws/aws-cdk\n\n\n## :question: Getting Started\n\n> :warning: Disclaimer\n>\n> The [public instance of ConstructHub](https://constructs.dev) is currently in\n> *Developer Preview*.\n>\n> Self-hosted ConstructHub instances are however in active development and\n> should be considered *experimental*. Breaking changes to the public API of\n> this package are expected to be released without prior notice, and the\n> infrastructure and operational posture of ConstructHub instances may also\n> significantly change.\n>\n> You are welcome to deploy self-hosted instances of ConstructHub for evaluation\n> purposes, and we welcome any feedback (good or bad) from your experience in\n> doing so.\n\n### Quick Start\n\nOnce you have installed the `construct-hub` library in your project, the\nsimplest way to get started is to create an instance of the `ConstructHub`\nconstruct:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub');\n```\n\n### Personalization\n\n#### Using a custom domain name\n\nIn order to use a custom domain for your ConstructHub instance instead of the\ndefault CloudFront domain name, specify the `domain` property with the following\nelements:\n\nAttribute | Description\n------------------------------|---------------------------------------------------------------------\n`zone` | A Route53 Hosted Zone, where DNS records will be added.\n`cert` | An Amazon Certificate Manager certificate, which must be in the `us-east-1` region.\n`monitorCertificateExpiration`| Set to `false` if you do not want an alarm to be created when the certificate is close to expiry.\n\nYour self-hosted ConstructHub instance will be served from the root of the\nprovided `zone`, so the certificate must match this name.\n\n#### Alternate package sources\n\nBy default, ConstructHub has a single package source configured: the public\n`npmjs.com` registry. Self-hosted instances typically should list packages from\nalternate sources, either in addition to packages from `npmjs.com`, or instead\nof those.\n\nThe `packageSources` property can be used to replace the default set of package\nsources configured on the instance. ConstructHub provides `IPackageSource`\nimplementations for the public `npmjs.com` registry as well as for private\nCodeArtifact repositories:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nconst registry = new codeartifact.CfnRegistry(stack, 'Registry', {\n // ....\n});\nnew ConstructHub(stack, 'ConstructHub', {\n packageSources: [\n new sources.NpmJs(), // Remove if you do NOT want npmjs.com packages\n new sources.CodeArtifact({ registry }),\n ],\n});\n```\n\nYou may also implement a custom `IPackageSource` if you want to index packages\nfrom alternate locations. In this case, the component you provide will be\nresponsible for sending notifications to an SQS Queue about newly discovered\npackages. You may refer to the [sources.NpmJs] and [sources.CodeArtifact]\nimplementations as a reference for hos this can be done.\n\nBy default, download counts of NPM packages will be fetched periodically from\nNPM's public API by a Lambda. Since this is not desirable if you are using a\nprivate package registry, this is automatically disabled if you specify your own\nvalue for `packageSources`. (But this can be re-enabled through the\n`fetchPackageStats` property if needed).\n\n[sources.NpmJs]: src/package-sources/npmjs.ts\n[sources.CodeArtifact]: src/package-sources/code-artifact.ts\n\n#### Package deny list\n\nCertain packages may be undesirable to show in your self-hosted ConstructHub\ninstance. In order to prevent a package from ever being listed in construct hub,\nthe `denyList` property can be configured with a set of `DenyListRule` objects\nthat specify which package or package versions should never be lested:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub', {\n denyList: [\n // Denying _all_ versions of the \"sneaky-hackery\" package\n { packageName: 'sneaky-hackery', reason: 'Mines bitcoins wherever it gets installed' },\n // Denying _a specific_ version of the \"bad-release\" package\n { packageName: 'bad-release', version: '1.2.3', reason: 'CVE-####-#####' },\n ],\n});\n```\n\n#### Decrease deployment footprint\n\nBy default, ConstructHub executes the documentation rendering process in the\ncontext of isolated subnets. This is a defense-in-depth mechanism to mitigate\nthe risks associated with downloading aribtrary (un-trusted) *npm packages* and\ntheir dependency closures.\n\nThis layer of security implies the creation of a number of resources that can\nincrease the operating cost of your self-hosted instance: several VPC endpoints\nare created, an internal CodeArtifact repository needs to be provisioned, etc...\n\nWhile we generally recommend leaving these features enabled, if your self-hosted\nConstructHub instance only indexes *trusted* packages (as could be the case for\nan instance that does not list packages from the public `npmjs.com` registry),\nyou may set the `isolateLambdas` setting to `false`.\n\n\n## :gear: Operating a self-hosted instance\n\n1. [Application Overview](./docs/application-overview.md) provides a high-level\n description of the components that make a ConstructHub instance. This is a\n great starting point for people who consider operating a self-hosted instance\n of ConstructHub; and for new operators on-boarding the platform.\n\n1. [Operator Runbook](./docs/operator-runbook.md) is a series of diagnostics and\n troubleshooting guides indended for operators to have a quick and easy way to\n navigate a ConstructHub instance when they are reacting to an alarm or bug\n report.\n\n### :nail_care: Customizing the frontend\n\nThere are a number of customizations available in order to make your private\nconstruct hub better tailored to your organization.\n\n#### Package Tags\n\nConfiguring package tags allows you to compute additional labels to be applied\nto packages. These can be used to indicate to users which packages are owned by\ntrusted organizations, or any other arbitrary conditions, and can be referenced\nwhile searching.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.field('name').eq('construct-hub'),\n }]\n});\n```\n\nThe above example will result in packages with the `name` of `construct-hub` to\nreceive the `Official` tag, which is colored green.\n\nCombinations of conditions are also supported:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.or(\n TagCondition.field('name').eq('construct-hub'),\n TagCondition.field('name').eq('construct-hub-webapp'),\n ),\n }]\n});\n\n// or more succintly if you have a long list\ncondition: TagCondition.or(\n ...['construct-hub', 'construct-hub-webapp', '...',]\n .map(name => TagCondition.field('name').eq(name))\n),\n```\n\nYou can assert against any value within package json including nested ones.\n```ts\nTagCondition.field('constructHub', 'nested', 'key').eq('value');\n\n// checks\npackageJson?.constructHub?.nested?.key === value;\n```\n\n#### Package Links\n\nConfiguring package links allows you to replace the `Repository`, `License`,\nand `Registry` links on the package details page with whatever you choose.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageLinks: [{\n linkLabel: 'Service Level Agreement',\n configKey: 'SLA',\n }, {\n linkLabel: 'Contact',\n configKey: 'Contact',\n linkText: 'Email Me!',\n allowedDomains: ['me.com'],\n }]\n});\n```\n\nThis would allow publishers to add the following to their package.json:\n\n```json\n\"constructHub\": {\n \"packageLinks\": {\n \"SLA\": \"https://support.mypackage.com\",\n \"Contact\": \"me.com/contact\"\n }\n}\n```\n\nThen the links on the corresponding package page would show these items as\nconfigured.\n\n#### Home Page\n\nThe home page is divided into sections, each with a header and list of packages.\nCurrently, for a given section you can display either the most recently updated\npackages, or a curated list of packages.\n\nFor example:\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n featuredPackages: {\n sections: [\n {\n name: \"Recently updated\",\n showLastUpdated: 4\n },\n {\n name: \"From the AWS CDK\",\n showPackages: [\n {\n name: \"@aws-cdk/core\"\n },\n {\n name: \"@aws-cdk/aws-s3\",\n comment: \"One of the most popular AWS CDK libraries!\"\n },\n {\n name: \"@aws-cdk/aws-lambda\"\n },\n {\n name: \"@aws-cdk/pipelines\"\n comment: \"The pipelines L3 construct library abstracts away many of the details of managing software deployment within AWS.\"\n }\n ]\n }\n ]\n }\n});\n```\n\n#### Feature Flags\n\nFeature flags for the web app can be used to enable or disable experimental\nfeatures. These can be customized through the `featureFlags` property - for\nmore information about the available flags, check the documentation for\nhttps://github.com/cdklabs/construct-hub-webapp/.\n\n## :raised_hand: Contributing\n\nIf you are looking to contribute to this project, but don't know where to start,\nhave a look at our [contributing guide](CONTRIBUTING.md)!\n\n\n## :cop: Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n\n## :balance_scale: License\n\nThis project is licensed under the Apache-2.0 License.\n"
1872
1872
  },
1873
1873
  "repository": {
1874
1874
  "type": "git",
@@ -2000,7 +2000,7 @@
2000
2000
  "kind": "interface",
2001
2001
  "locationInModule": {
2002
2002
  "filename": "src/construct-hub.ts",
2003
- "line": 130
2003
+ "line": 135
2004
2004
  },
2005
2005
  "name": "CodeArtifactDomainProps",
2006
2006
  "properties": [
@@ -2013,7 +2013,7 @@
2013
2013
  "immutable": true,
2014
2014
  "locationInModule": {
2015
2015
  "filename": "src/construct-hub.ts",
2016
- "line": 134
2016
+ "line": 139
2017
2017
  },
2018
2018
  "name": "name",
2019
2019
  "type": {
@@ -2029,7 +2029,7 @@
2029
2029
  "immutable": true,
2030
2030
  "locationInModule": {
2031
2031
  "filename": "src/construct-hub.ts",
2032
- "line": 140
2032
+ "line": 145
2033
2033
  },
2034
2034
  "name": "upstreams",
2035
2035
  "optional": true,
@@ -2059,7 +2059,7 @@
2059
2059
  },
2060
2060
  "locationInModule": {
2061
2061
  "filename": "src/construct-hub.ts",
2062
- "line": 149
2062
+ "line": 154
2063
2063
  },
2064
2064
  "parameters": [
2065
2065
  {
@@ -2089,7 +2089,7 @@
2089
2089
  "kind": "class",
2090
2090
  "locationInModule": {
2091
2091
  "filename": "src/construct-hub.ts",
2092
- "line": 146
2092
+ "line": 151
2093
2093
  },
2094
2094
  "name": "ConstructHub",
2095
2095
  "properties": [
@@ -2101,7 +2101,7 @@
2101
2101
  "immutable": true,
2102
2102
  "locationInModule": {
2103
2103
  "filename": "src/construct-hub.ts",
2104
- "line": 295
2104
+ "line": 301
2105
2105
  },
2106
2106
  "name": "grantPrincipal",
2107
2107
  "overrides": "@aws-cdk/aws-iam.IGrantable",
@@ -2116,7 +2116,7 @@
2116
2116
  "immutable": true,
2117
2117
  "locationInModule": {
2118
2118
  "filename": "src/construct-hub.ts",
2119
- "line": 299
2119
+ "line": 305
2120
2120
  },
2121
2121
  "name": "ingestionQueue",
2122
2122
  "type": {
@@ -2275,6 +2275,23 @@
2275
2275
  "fqn": "construct-hub.FeaturedPackages"
2276
2276
  }
2277
2277
  },
2278
+ {
2279
+ "abstract": true,
2280
+ "docs": {
2281
+ "stability": "experimental",
2282
+ "summary": "Configure feature flags for the web app."
2283
+ },
2284
+ "immutable": true,
2285
+ "locationInModule": {
2286
+ "filename": "src/construct-hub.ts",
2287
+ "line": 119
2288
+ },
2289
+ "name": "featureFlags",
2290
+ "optional": true,
2291
+ "type": {
2292
+ "fqn": "construct-hub.FeatureFlags"
2293
+ }
2294
+ },
2278
2295
  {
2279
2296
  "abstract": true,
2280
2297
  "docs": {
@@ -2285,7 +2302,7 @@
2285
2302
  "immutable": true,
2286
2303
  "locationInModule": {
2287
2304
  "filename": "src/construct-hub.ts",
2288
- "line": 124
2305
+ "line": 129
2289
2306
  },
2290
2307
  "name": "fetchPackageStats",
2291
2308
  "optional": true,
@@ -2556,6 +2573,56 @@
2556
2573
  ],
2557
2574
  "symbolId": "src/api:Domain"
2558
2575
  },
2576
+ "construct-hub.FeatureFlags": {
2577
+ "assembly": "construct-hub",
2578
+ "datatype": true,
2579
+ "docs": {
2580
+ "stability": "experimental",
2581
+ "summary": "Enable/disable features for the web app."
2582
+ },
2583
+ "fqn": "construct-hub.FeatureFlags",
2584
+ "kind": "interface",
2585
+ "locationInModule": {
2586
+ "filename": "src/webapp/index.ts",
2587
+ "line": 95
2588
+ },
2589
+ "name": "FeatureFlags",
2590
+ "properties": [
2591
+ {
2592
+ "abstract": true,
2593
+ "docs": {
2594
+ "stability": "experimental"
2595
+ },
2596
+ "immutable": true,
2597
+ "locationInModule": {
2598
+ "filename": "src/webapp/index.ts",
2599
+ "line": 96
2600
+ },
2601
+ "name": "homeRedesign",
2602
+ "optional": true,
2603
+ "type": {
2604
+ "primitive": "boolean"
2605
+ }
2606
+ },
2607
+ {
2608
+ "abstract": true,
2609
+ "docs": {
2610
+ "stability": "experimental"
2611
+ },
2612
+ "immutable": true,
2613
+ "locationInModule": {
2614
+ "filename": "src/webapp/index.ts",
2615
+ "line": 97
2616
+ },
2617
+ "name": "searchRedesign",
2618
+ "optional": true,
2619
+ "type": {
2620
+ "primitive": "boolean"
2621
+ }
2622
+ }
2623
+ ],
2624
+ "symbolId": "src/webapp/index:FeatureFlags"
2625
+ },
2559
2626
  "construct-hub.FeaturedPackages": {
2560
2627
  "assembly": "construct-hub",
2561
2628
  "datatype": true,
@@ -12987,6 +13054,6 @@
12987
13054
  "symbolId": "src/package-sources/npmjs:NpmJsProps"
12988
13055
  }
12989
13056
  },
12990
- "version": "0.2.55",
12991
- "fingerprint": "tffW72JDAUJ5F14veAdq0U1tRamGZDsGq4cqCq/QthI="
13057
+ "version": "0.2.59",
13058
+ "fingerprint": "p8RYUN1/06VIcZpClrgsg4QRf5snMSQ9L1pvpGZ5Oi8="
12992
13059
  }
package/API.md CHANGED
@@ -280,6 +280,18 @@ Configuration for packages to feature on the home page.
280
280
 
281
281
  ---
282
282
 
283
+ ##### `featureFlags`<sup>Optional</sup> <a name="construct-hub.ConstructHubProps.property.featureFlags"></a>
284
+
285
+ ```typescript
286
+ public readonly featureFlags: FeatureFlags;
287
+ ```
288
+
289
+ - *Type:* [`construct-hub.FeatureFlags`](#construct-hub.FeatureFlags)
290
+
291
+ Configure feature flags for the web app.
292
+
293
+ ---
294
+
283
295
  ##### `fetchPackageStats`<sup>Optional</sup> <a name="construct-hub.ConstructHubProps.property.fetchPackageStats"></a>
284
296
 
285
297
  ```typescript
@@ -589,6 +601,38 @@ Cannot be used with `showLastUpdated`.
589
601
 
590
602
  ---
591
603
 
604
+ ### FeatureFlags <a name="construct-hub.FeatureFlags"></a>
605
+
606
+ Enable/disable features for the web app.
607
+
608
+ #### Initializer <a name="[object Object].Initializer"></a>
609
+
610
+ ```typescript
611
+ import { FeatureFlags } from 'construct-hub'
612
+
613
+ const featureFlags: FeatureFlags = { ... }
614
+ ```
615
+
616
+ ##### `homeRedesign`<sup>Optional</sup> <a name="construct-hub.FeatureFlags.property.homeRedesign"></a>
617
+
618
+ ```typescript
619
+ public readonly homeRedesign: boolean;
620
+ ```
621
+
622
+ - *Type:* `boolean`
623
+
624
+ ---
625
+
626
+ ##### `searchRedesign`<sup>Optional</sup> <a name="construct-hub.FeatureFlags.property.searchRedesign"></a>
627
+
628
+ ```typescript
629
+ public readonly searchRedesign: boolean;
630
+ ```
631
+
632
+ - *Type:* `boolean`
633
+
634
+ ---
635
+
592
636
  ### LinkedResource <a name="construct-hub.LinkedResource"></a>
593
637
 
594
638
  #### Initializer <a name="[object Object].Initializer"></a>
package/README.md CHANGED
@@ -296,6 +296,13 @@ new ConstructHub(this, "ConstructHub", {
296
296
  });
297
297
  ```
298
298
 
299
+ #### Feature Flags
300
+
301
+ Feature flags for the web app can be used to enable or disable experimental
302
+ features. These can be customized through the `featureFlags` property - for
303
+ more information about the available flags, check the documentation for
304
+ https://github.com/cdklabs/construct-hub-webapp/.
305
+
299
306
  ## :raised_hand: Contributing
300
307
 
301
308
  If you are looking to contribute to this project, but don't know where to start,
@@ -16277,7 +16277,7 @@ async function handler(event, context) {
16277
16277
  Key: CATALOG_KEY,
16278
16278
  Body: JSON.stringify(catalog, null, 2),
16279
16279
  ContentType: "application/json",
16280
- CacheControl: "public, max-age=300",
16280
+ CacheControl: "public, max-age=300, must-revalidate, proxy-revalidate",
16281
16281
  Metadata: {
16282
16282
  "Lambda-Log-Group": context.logGroupName,
16283
16283
  "Lambda-Log-Stream": context.logStreamName,