@last-rev/app-config
Advanced tools
Comparing version
# @last-rev/app-config | ||
## 0.4.2 | ||
### Patch Changes | ||
- 4fc37b3: Added ability to add jwt signing for webhook verification | ||
## 0.4.1 | ||
@@ -4,0 +10,0 @@ |
@@ -11,2 +11,3 @@ /// <reference types="node" /> | ||
clone(newConfig: LastRevAppConfigArgs): LastRevAppConfig; | ||
get jwtSigningSecret(): string | undefined; | ||
get contentful(): { | ||
@@ -13,0 +14,0 @@ spaceId: string; |
@@ -1,1 +0,1 @@ | ||
import{__assign as e}from"tslib";import t from"lodash/merge";import i from"lodash/isNil";var o={cms:"Contentful",strategy:"fs",contentful:{env:"master",usePreview:!1},logLevel:"warn",graphql:{port:5e3,host:"localhost"},sites:[]},n=function(){function n(e){this.config=t({},o,e),this.validateCmsVars(),this.validateStrategy(),this.validatePaths()}return n.prototype.validateCmsVars=function(){var e,t,i;if("Contentful"!==this.config.cms)throw new Error("Invalid CMS: ".concat(this.config.cms));if(!(null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId))throw new Error("Contentful CMS: contentful.spaceId is required.");if(!(null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken))throw new Error("Contentful CMS: contentful.contentDeliveryToken is required.");if(!(null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken))throw new Error("Contentful CMS: contentful.contentPreviewToken is required.")},n.prototype.validateStrategy=function(){var e,t,i,o,n,r,s,c,a,d,l,f,g,u;if(this.config.contentStrategy)if("fs"===this.config.contentStrategy){if(!(null===(e=this.config.fs)||void 0===e?void 0:e.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else{if("cms"!==this.config.contentStrategy)throw new Error("Invalid contentStrategy: ".concat(this.config.contentStrategy));if("redis"===this.config.cmsCacheStrategy){if(!(null===(t=this.config.redis)||void 0===t?void 0:t.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(i=this.config.redis)||void 0===i?void 0:i.port))throw new Error("Redis strategy: redis.port is required")}else if("dynamodb"===this.config.cmsCacheStrategy){if(!(null===(o=this.config.dynamodb)||void 0===o?void 0:o.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(n=this.config.dynamodb)||void 0===n?void 0:n.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(r=this.config.dynamodb)||void 0===r?void 0:r.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(s=this.config.dynamodb)||void 0===s?void 0:s.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}else{if(!this.config.strategy)throw new Error("Must specify a content stratgy");if("fs"===this.config.strategy){if(!(null===(c=this.config.fs)||void 0===c?void 0:c.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else if("redis"===this.config.strategy){if(!(null===(a=this.config.redis)||void 0===a?void 0:a.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(d=this.config.redis)||void 0===d?void 0:d.port))throw new Error("Redis strategy: redis.port is required")}else{if("dynamodb"!==this.config.strategy)throw new Error("Invalid strategy: ".concat(this.config.strategy));if(!(null===(l=this.config.dynamodb)||void 0===l?void 0:l.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(f=this.config.dynamodb)||void 0===f?void 0:f.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(u=this.config.dynamodb)||void 0===u?void 0:u.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}},n.prototype.validatePaths=function(){var e,t;if("v2"!==(null===(e=this.config.paths)||void 0===e?void 0:e.version)&&!1===(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree))throw new Error("Invalid paths configuration: generateFullPathTree must be true when using paths v1")},n.prototype.clone=function(e){return new n(t({},this.config,e))},Object.defineProperty(n.prototype,"contentful",{get:function(){var e,t,i,o,n,r,s;return{spaceId:null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId,contentDeliveryToken:null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken,contentPreviewToken:null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken,env:null===(o=this.config.contentful)||void 0===o?void 0:o.env,usePreview:!!(null===(n=this.config.contentful)||void 0===n?void 0:n.usePreview),maxBatchSize:(null===(r=this.config.contentful)||void 0===r?void 0:r.maxBatchSize)||1e3,syncLimit:null===(s=this.config.contentful)||void 0===s?void 0:s.syncLimit}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"algolia",{get:function(){var e,t,i,o;return{applicationId:null===(e=this.config.algolia)||void 0===e?void 0:e.applicationId,adminApiKey:null===(t=this.config.algolia)||void 0===t?void 0:t.adminApiKey,contentTypeIds:null===(i=this.config.algolia)||void 0===i?void 0:i.contentTypeIds,indexDraftContent:!!(null===(o=this.config.algolia)||void 0===o?void 0:o.indexDraftContent)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"logLevel",{get:function(){return this.config.logLevel||"warn"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cms",{get:function(){return this.config.cms},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentStrategy",{get:function(){return this.config.contentStrategy?this.config.contentStrategy:"fs"!==this.config.strategy?"cms":"fs"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cmsCacheStrategy",{get:function(){return this.config.cmsCacheStrategy?this.config.cmsCacheStrategy:"cms"===this.config.contentStrategy?"none":(this.config.strategy,this.config.strategy)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fs",{get:function(){var e;return{contentDir:null===(e=this.config.fs)||void 0===e?void 0:e.contentDir}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"redis",{get:function(){var t,i;return e(e({},this.config.redis),{maxBatchSize:(null===(t=this.config.redis)||void 0===t?void 0:t.maxBatchSize)||1e3,ttlSeconds:(null===(i=this.config.redis)||void 0===i?void 0:i.ttlSeconds)||2592e3})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dynamodb",{get:function(){var e,t,i,o;return{region:null===(e=this.config.dynamodb)||void 0===e?void 0:e.region,accessKeyId:null===(t=this.config.dynamodb)||void 0===t?void 0:t.accessKeyId,secretAccessKey:null===(i=this.config.dynamodb)||void 0===i?void 0:i.secretAccessKey,tableName:null===(o=this.config.dynamodb)||void 0===o?void 0:o.tableName}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"extensions",{get:function(){return this.config.extensions||{typeDefs:"",resolvers:{},mappers:{},typeMappings:{},pathsConfigs:{}}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"graphql",{get:function(){var e,t;return{port:null===(e=this.config.graphql)||void 0===e?void 0:e.port,host:null===(t=this.config.graphql)||void 0===t?void 0:t.host}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sites",{get:function(){return this.config.sites},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paths",{get:function(){var e,t;return{version:(null===(e=this.config.paths)||void 0===e?void 0:e.version)||"v1",generateFullPathTree:(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree)||!0}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"skipReferenceFields",{get:function(){return!!i(this.config.skipReferenceFields)||this.config.skipReferenceFields},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sitemap",{get:function(){var e,t,i,o,n;return{domain:(null===(e=this.config.sitemap)||void 0===e?void 0:e.domain)||"",maxPageSize:(null===(t=this.config.sitemap)||void 0===t?void 0:t.maxPageSize)||1e3,indexRootPath:(null===(i=this.config.sitemap)||void 0===i?void 0:i.indexRootPath)||"/",pagesRootPath:(null===(o=this.config.sitemap)||void 0===o?void 0:o.pagesRootPath)||"/sitemap",excludePages:(null===(n=this.config.sitemap)||void 0===n?void 0:n.excludePages)||[]}},enumerable:!1,configurable:!0}),n}();export{n as default}; | ||
import{__assign as e}from"tslib";import t from"lodash/merge";import i from"lodash/isNil";var o={cms:"Contentful",strategy:"fs",contentful:{env:"master",usePreview:!1},logLevel:"warn",graphql:{port:5e3,host:"localhost"},sites:[]},n=function(){function n(e){this.config=t({},o,e),this.validateCmsVars(),this.validateStrategy(),this.validatePaths()}return n.prototype.validateCmsVars=function(){var e,t,i;if("Contentful"!==this.config.cms)throw new Error("Invalid CMS: ".concat(this.config.cms));if(!(null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId))throw new Error("Contentful CMS: contentful.spaceId is required.");if(!(null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken))throw new Error("Contentful CMS: contentful.contentDeliveryToken is required.");if(!(null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken))throw new Error("Contentful CMS: contentful.contentPreviewToken is required.")},n.prototype.validateStrategy=function(){var e,t,i,o,n,r,s,c,a,d,l,f,g,u;if(this.config.contentStrategy)if("fs"===this.config.contentStrategy){if(!(null===(e=this.config.fs)||void 0===e?void 0:e.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else{if("cms"!==this.config.contentStrategy)throw new Error("Invalid contentStrategy: ".concat(this.config.contentStrategy));if("redis"===this.config.cmsCacheStrategy){if(!(null===(t=this.config.redis)||void 0===t?void 0:t.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(i=this.config.redis)||void 0===i?void 0:i.port))throw new Error("Redis strategy: redis.port is required")}else if("dynamodb"===this.config.cmsCacheStrategy){if(!(null===(o=this.config.dynamodb)||void 0===o?void 0:o.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(n=this.config.dynamodb)||void 0===n?void 0:n.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(r=this.config.dynamodb)||void 0===r?void 0:r.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(s=this.config.dynamodb)||void 0===s?void 0:s.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}else{if(!this.config.strategy)throw new Error("Must specify a content stratgy");if("fs"===this.config.strategy){if(!(null===(c=this.config.fs)||void 0===c?void 0:c.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else if("redis"===this.config.strategy){if(!(null===(a=this.config.redis)||void 0===a?void 0:a.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(d=this.config.redis)||void 0===d?void 0:d.port))throw new Error("Redis strategy: redis.port is required")}else{if("dynamodb"!==this.config.strategy)throw new Error("Invalid strategy: ".concat(this.config.strategy));if(!(null===(l=this.config.dynamodb)||void 0===l?void 0:l.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(f=this.config.dynamodb)||void 0===f?void 0:f.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(u=this.config.dynamodb)||void 0===u?void 0:u.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}},n.prototype.validatePaths=function(){var e,t;if("v2"!==(null===(e=this.config.paths)||void 0===e?void 0:e.version)&&!1===(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree))throw new Error("Invalid paths configuration: generateFullPathTree must be true when using paths v1")},n.prototype.clone=function(e){return new n(t({},this.config,e))},Object.defineProperty(n.prototype,"jwtSigningSecret",{get:function(){return this.config.jwtSigningSecret},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentful",{get:function(){var e,t,i,o,n,r,s;return{spaceId:null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId,contentDeliveryToken:null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken,contentPreviewToken:null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken,env:null===(o=this.config.contentful)||void 0===o?void 0:o.env,usePreview:!!(null===(n=this.config.contentful)||void 0===n?void 0:n.usePreview),maxBatchSize:(null===(r=this.config.contentful)||void 0===r?void 0:r.maxBatchSize)||1e3,syncLimit:null===(s=this.config.contentful)||void 0===s?void 0:s.syncLimit}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"algolia",{get:function(){var e,t,i,o;return{applicationId:null===(e=this.config.algolia)||void 0===e?void 0:e.applicationId,adminApiKey:null===(t=this.config.algolia)||void 0===t?void 0:t.adminApiKey,contentTypeIds:null===(i=this.config.algolia)||void 0===i?void 0:i.contentTypeIds,indexDraftContent:!!(null===(o=this.config.algolia)||void 0===o?void 0:o.indexDraftContent)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"logLevel",{get:function(){return this.config.logLevel||"warn"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cms",{get:function(){return this.config.cms},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentStrategy",{get:function(){return this.config.contentStrategy?this.config.contentStrategy:"fs"!==this.config.strategy?"cms":"fs"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cmsCacheStrategy",{get:function(){return this.config.cmsCacheStrategy?this.config.cmsCacheStrategy:"cms"===this.config.contentStrategy?"none":(this.config.strategy,this.config.strategy)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fs",{get:function(){var e;return{contentDir:null===(e=this.config.fs)||void 0===e?void 0:e.contentDir}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"redis",{get:function(){var t,i;return e(e({},this.config.redis),{maxBatchSize:(null===(t=this.config.redis)||void 0===t?void 0:t.maxBatchSize)||1e3,ttlSeconds:(null===(i=this.config.redis)||void 0===i?void 0:i.ttlSeconds)||2592e3})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dynamodb",{get:function(){var e,t,i,o;return{region:null===(e=this.config.dynamodb)||void 0===e?void 0:e.region,accessKeyId:null===(t=this.config.dynamodb)||void 0===t?void 0:t.accessKeyId,secretAccessKey:null===(i=this.config.dynamodb)||void 0===i?void 0:i.secretAccessKey,tableName:null===(o=this.config.dynamodb)||void 0===o?void 0:o.tableName}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"extensions",{get:function(){return this.config.extensions||{typeDefs:"",resolvers:{},mappers:{},typeMappings:{},pathsConfigs:{}}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"graphql",{get:function(){var e,t;return{port:null===(e=this.config.graphql)||void 0===e?void 0:e.port,host:null===(t=this.config.graphql)||void 0===t?void 0:t.host}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sites",{get:function(){return this.config.sites},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paths",{get:function(){var e,t;return{version:(null===(e=this.config.paths)||void 0===e?void 0:e.version)||"v1",generateFullPathTree:(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree)||!0}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"skipReferenceFields",{get:function(){return!!i(this.config.skipReferenceFields)||this.config.skipReferenceFields},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sitemap",{get:function(){var e,t,i,o,n;return{domain:(null===(e=this.config.sitemap)||void 0===e?void 0:e.domain)||"",maxPageSize:(null===(t=this.config.sitemap)||void 0===t?void 0:t.maxPageSize)||1e3,indexRootPath:(null===(i=this.config.sitemap)||void 0===i?void 0:i.indexRootPath)||"/",pagesRootPath:(null===(o=this.config.sitemap)||void 0===o?void 0:o.pagesRootPath)||"/sitemap",excludePages:(null===(n=this.config.sitemap)||void 0===n?void 0:n.excludePages)||[]}},enumerable:!1,configurable:!0}),n}();export{n as default}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("tslib"),t=require("lodash/merge"),i=require("lodash/isNil");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(t),r=o(i),s={cms:"Contentful",strategy:"fs",contentful:{env:"master",usePreview:!1},logLevel:"warn",graphql:{port:5e3,host:"localhost"},sites:[]},a=function(){function t(e){this.config=n.default({},s,e),this.validateCmsVars(),this.validateStrategy(),this.validatePaths()}return t.prototype.validateCmsVars=function(){var e,t,i;if("Contentful"!==this.config.cms)throw new Error("Invalid CMS: ".concat(this.config.cms));if(!(null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId))throw new Error("Contentful CMS: contentful.spaceId is required.");if(!(null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken))throw new Error("Contentful CMS: contentful.contentDeliveryToken is required.");if(!(null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken))throw new Error("Contentful CMS: contentful.contentPreviewToken is required.")},t.prototype.validateStrategy=function(){var e,t,i,o,n,r,s,a,c,d,l,f,g,u;if(this.config.contentStrategy)if("fs"===this.config.contentStrategy){if(!(null===(e=this.config.fs)||void 0===e?void 0:e.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else{if("cms"!==this.config.contentStrategy)throw new Error("Invalid contentStrategy: ".concat(this.config.contentStrategy));if("redis"===this.config.cmsCacheStrategy){if(!(null===(t=this.config.redis)||void 0===t?void 0:t.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(i=this.config.redis)||void 0===i?void 0:i.port))throw new Error("Redis strategy: redis.port is required")}else if("dynamodb"===this.config.cmsCacheStrategy){if(!(null===(o=this.config.dynamodb)||void 0===o?void 0:o.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(n=this.config.dynamodb)||void 0===n?void 0:n.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(r=this.config.dynamodb)||void 0===r?void 0:r.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(s=this.config.dynamodb)||void 0===s?void 0:s.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}else{if(!this.config.strategy)throw new Error("Must specify a content stratgy");if("fs"===this.config.strategy){if(!(null===(a=this.config.fs)||void 0===a?void 0:a.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else if("redis"===this.config.strategy){if(!(null===(c=this.config.redis)||void 0===c?void 0:c.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(d=this.config.redis)||void 0===d?void 0:d.port))throw new Error("Redis strategy: redis.port is required")}else{if("dynamodb"!==this.config.strategy)throw new Error("Invalid strategy: ".concat(this.config.strategy));if(!(null===(l=this.config.dynamodb)||void 0===l?void 0:l.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(f=this.config.dynamodb)||void 0===f?void 0:f.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(u=this.config.dynamodb)||void 0===u?void 0:u.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}},t.prototype.validatePaths=function(){var e,t;if("v2"!==(null===(e=this.config.paths)||void 0===e?void 0:e.version)&&!1===(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree))throw new Error("Invalid paths configuration: generateFullPathTree must be true when using paths v1")},t.prototype.clone=function(e){return new t(n.default({},this.config,e))},Object.defineProperty(t.prototype,"contentful",{get:function(){var e,t,i,o,n,r,s;return{spaceId:null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId,contentDeliveryToken:null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken,contentPreviewToken:null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken,env:null===(o=this.config.contentful)||void 0===o?void 0:o.env,usePreview:!!(null===(n=this.config.contentful)||void 0===n?void 0:n.usePreview),maxBatchSize:(null===(r=this.config.contentful)||void 0===r?void 0:r.maxBatchSize)||1e3,syncLimit:null===(s=this.config.contentful)||void 0===s?void 0:s.syncLimit}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"algolia",{get:function(){var e,t,i,o;return{applicationId:null===(e=this.config.algolia)||void 0===e?void 0:e.applicationId,adminApiKey:null===(t=this.config.algolia)||void 0===t?void 0:t.adminApiKey,contentTypeIds:null===(i=this.config.algolia)||void 0===i?void 0:i.contentTypeIds,indexDraftContent:!!(null===(o=this.config.algolia)||void 0===o?void 0:o.indexDraftContent)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logLevel",{get:function(){return this.config.logLevel||"warn"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cms",{get:function(){return this.config.cms},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentStrategy",{get:function(){return this.config.contentStrategy?this.config.contentStrategy:"fs"!==this.config.strategy?"cms":"fs"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cmsCacheStrategy",{get:function(){return this.config.cmsCacheStrategy?this.config.cmsCacheStrategy:"cms"===this.config.contentStrategy?"none":(this.config.strategy,this.config.strategy)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fs",{get:function(){var e;return{contentDir:null===(e=this.config.fs)||void 0===e?void 0:e.contentDir}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redis",{get:function(){var t,i;return e.__assign(e.__assign({},this.config.redis),{maxBatchSize:(null===(t=this.config.redis)||void 0===t?void 0:t.maxBatchSize)||1e3,ttlSeconds:(null===(i=this.config.redis)||void 0===i?void 0:i.ttlSeconds)||2592e3})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dynamodb",{get:function(){var e,t,i,o;return{region:null===(e=this.config.dynamodb)||void 0===e?void 0:e.region,accessKeyId:null===(t=this.config.dynamodb)||void 0===t?void 0:t.accessKeyId,secretAccessKey:null===(i=this.config.dynamodb)||void 0===i?void 0:i.secretAccessKey,tableName:null===(o=this.config.dynamodb)||void 0===o?void 0:o.tableName}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensions",{get:function(){return this.config.extensions||{typeDefs:"",resolvers:{},mappers:{},typeMappings:{},pathsConfigs:{}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"graphql",{get:function(){var e,t;return{port:null===(e=this.config.graphql)||void 0===e?void 0:e.port,host:null===(t=this.config.graphql)||void 0===t?void 0:t.host}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sites",{get:function(){return this.config.sites},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paths",{get:function(){var e,t;return{version:(null===(e=this.config.paths)||void 0===e?void 0:e.version)||"v1",generateFullPathTree:(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree)||!0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipReferenceFields",{get:function(){return!!r.default(this.config.skipReferenceFields)||this.config.skipReferenceFields},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sitemap",{get:function(){var e,t,i,o,n;return{domain:(null===(e=this.config.sitemap)||void 0===e?void 0:e.domain)||"",maxPageSize:(null===(t=this.config.sitemap)||void 0===t?void 0:t.maxPageSize)||1e3,indexRootPath:(null===(i=this.config.sitemap)||void 0===i?void 0:i.indexRootPath)||"/",pagesRootPath:(null===(o=this.config.sitemap)||void 0===o?void 0:o.pagesRootPath)||"/sitemap",excludePages:(null===(n=this.config.sitemap)||void 0===n?void 0:n.excludePages)||[]}},enumerable:!1,configurable:!0}),t}();module.exports=a; | ||
"use strict";var e=require("tslib"),t=require("lodash/merge"),i=require("lodash/isNil");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(t),r=o(i),s={cms:"Contentful",strategy:"fs",contentful:{env:"master",usePreview:!1},logLevel:"warn",graphql:{port:5e3,host:"localhost"},sites:[]},c=function(){function t(e){this.config=n.default({},s,e),this.validateCmsVars(),this.validateStrategy(),this.validatePaths()}return t.prototype.validateCmsVars=function(){var e,t,i;if("Contentful"!==this.config.cms)throw new Error("Invalid CMS: ".concat(this.config.cms));if(!(null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId))throw new Error("Contentful CMS: contentful.spaceId is required.");if(!(null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken))throw new Error("Contentful CMS: contentful.contentDeliveryToken is required.");if(!(null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken))throw new Error("Contentful CMS: contentful.contentPreviewToken is required.")},t.prototype.validateStrategy=function(){var e,t,i,o,n,r,s,c,a,d,l,f,g,u;if(this.config.contentStrategy)if("fs"===this.config.contentStrategy){if(!(null===(e=this.config.fs)||void 0===e?void 0:e.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else{if("cms"!==this.config.contentStrategy)throw new Error("Invalid contentStrategy: ".concat(this.config.contentStrategy));if("redis"===this.config.cmsCacheStrategy){if(!(null===(t=this.config.redis)||void 0===t?void 0:t.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(i=this.config.redis)||void 0===i?void 0:i.port))throw new Error("Redis strategy: redis.port is required")}else if("dynamodb"===this.config.cmsCacheStrategy){if(!(null===(o=this.config.dynamodb)||void 0===o?void 0:o.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(n=this.config.dynamodb)||void 0===n?void 0:n.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(r=this.config.dynamodb)||void 0===r?void 0:r.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(s=this.config.dynamodb)||void 0===s?void 0:s.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}else{if(!this.config.strategy)throw new Error("Must specify a content stratgy");if("fs"===this.config.strategy){if(!(null===(c=this.config.fs)||void 0===c?void 0:c.contentDir))throw new Error("FS strategy: fs.contentDir is required")}else if("redis"===this.config.strategy){if(!(null===(a=this.config.redis)||void 0===a?void 0:a.host))throw new Error("Redis strategy: redis.host is required");if(!(null===(d=this.config.redis)||void 0===d?void 0:d.port))throw new Error("Redis strategy: redis.port is required")}else{if("dynamodb"!==this.config.strategy)throw new Error("Invalid strategy: ".concat(this.config.strategy));if(!(null===(l=this.config.dynamodb)||void 0===l?void 0:l.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(f=this.config.dynamodb)||void 0===f?void 0:f.accessKeyId))throw new Error("DynamoDB strategy: dynamodb.accessKeyId is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(u=this.config.dynamodb)||void 0===u?void 0:u.tableName))throw new Error("DynamoDB strategy: dynamodb.tableName is required")}}},t.prototype.validatePaths=function(){var e,t;if("v2"!==(null===(e=this.config.paths)||void 0===e?void 0:e.version)&&!1===(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree))throw new Error("Invalid paths configuration: generateFullPathTree must be true when using paths v1")},t.prototype.clone=function(e){return new t(n.default({},this.config,e))},Object.defineProperty(t.prototype,"jwtSigningSecret",{get:function(){return this.config.jwtSigningSecret},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentful",{get:function(){var e,t,i,o,n,r,s;return{spaceId:null===(e=this.config.contentful)||void 0===e?void 0:e.spaceId,contentDeliveryToken:null===(t=this.config.contentful)||void 0===t?void 0:t.contentDeliveryToken,contentPreviewToken:null===(i=this.config.contentful)||void 0===i?void 0:i.contentPreviewToken,env:null===(o=this.config.contentful)||void 0===o?void 0:o.env,usePreview:!!(null===(n=this.config.contentful)||void 0===n?void 0:n.usePreview),maxBatchSize:(null===(r=this.config.contentful)||void 0===r?void 0:r.maxBatchSize)||1e3,syncLimit:null===(s=this.config.contentful)||void 0===s?void 0:s.syncLimit}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"algolia",{get:function(){var e,t,i,o;return{applicationId:null===(e=this.config.algolia)||void 0===e?void 0:e.applicationId,adminApiKey:null===(t=this.config.algolia)||void 0===t?void 0:t.adminApiKey,contentTypeIds:null===(i=this.config.algolia)||void 0===i?void 0:i.contentTypeIds,indexDraftContent:!!(null===(o=this.config.algolia)||void 0===o?void 0:o.indexDraftContent)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logLevel",{get:function(){return this.config.logLevel||"warn"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cms",{get:function(){return this.config.cms},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentStrategy",{get:function(){return this.config.contentStrategy?this.config.contentStrategy:"fs"!==this.config.strategy?"cms":"fs"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cmsCacheStrategy",{get:function(){return this.config.cmsCacheStrategy?this.config.cmsCacheStrategy:"cms"===this.config.contentStrategy?"none":(this.config.strategy,this.config.strategy)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fs",{get:function(){var e;return{contentDir:null===(e=this.config.fs)||void 0===e?void 0:e.contentDir}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redis",{get:function(){var t,i;return e.__assign(e.__assign({},this.config.redis),{maxBatchSize:(null===(t=this.config.redis)||void 0===t?void 0:t.maxBatchSize)||1e3,ttlSeconds:(null===(i=this.config.redis)||void 0===i?void 0:i.ttlSeconds)||2592e3})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dynamodb",{get:function(){var e,t,i,o;return{region:null===(e=this.config.dynamodb)||void 0===e?void 0:e.region,accessKeyId:null===(t=this.config.dynamodb)||void 0===t?void 0:t.accessKeyId,secretAccessKey:null===(i=this.config.dynamodb)||void 0===i?void 0:i.secretAccessKey,tableName:null===(o=this.config.dynamodb)||void 0===o?void 0:o.tableName}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensions",{get:function(){return this.config.extensions||{typeDefs:"",resolvers:{},mappers:{},typeMappings:{},pathsConfigs:{}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"graphql",{get:function(){var e,t;return{port:null===(e=this.config.graphql)||void 0===e?void 0:e.port,host:null===(t=this.config.graphql)||void 0===t?void 0:t.host}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sites",{get:function(){return this.config.sites},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paths",{get:function(){var e,t;return{version:(null===(e=this.config.paths)||void 0===e?void 0:e.version)||"v1",generateFullPathTree:(null===(t=this.config.paths)||void 0===t?void 0:t.generateFullPathTree)||!0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipReferenceFields",{get:function(){return!!r.default(this.config.skipReferenceFields)||this.config.skipReferenceFields},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sitemap",{get:function(){var e,t,i,o,n;return{domain:(null===(e=this.config.sitemap)||void 0===e?void 0:e.domain)||"",maxPageSize:(null===(t=this.config.sitemap)||void 0===t?void 0:t.maxPageSize)||1e3,indexRootPath:(null===(i=this.config.sitemap)||void 0===i?void 0:i.indexRootPath)||"/",pagesRootPath:(null===(o=this.config.sitemap)||void 0===o?void 0:o.pagesRootPath)||"/sitemap",excludePages:(null===(n=this.config.sitemap)||void 0===n?void 0:n.excludePages)||[]}},enumerable:!1,configurable:!0}),t}();module.exports=c; |
@@ -12,2 +12,3 @@ import { Extensions } from '@last-rev/types'; | ||
cmsCacheStrategy: CmsCacheStrategy; | ||
jwtSigningSecret?: string; | ||
redis: RedisOptions & { | ||
@@ -66,2 +67,3 @@ maxBatchSize: number; | ||
cmsCacheStrategy?: CmsCacheStrategy; | ||
jwtSigningSecret?: string; | ||
redis?: RedisOptions & { | ||
@@ -68,0 +70,0 @@ maxBatchSize?: number; |
{ | ||
"name": "@last-rev/app-config", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -120,2 +120,6 @@ import { LastRevAppConfigArgs, LastRevAppConfiguration } from './types'; | ||
get jwtSigningSecret() { | ||
return this.config.jwtSigningSecret; | ||
} | ||
get contentful() { | ||
@@ -122,0 +126,0 @@ return { |
@@ -15,2 +15,3 @@ import { Extensions } from '@last-rev/types'; | ||
cmsCacheStrategy: CmsCacheStrategy; | ||
jwtSigningSecret?: string; | ||
redis: RedisOptions & { | ||
@@ -73,2 +74,3 @@ maxBatchSize: number; | ||
cmsCacheStrategy?: CmsCacheStrategy; | ||
jwtSigningSecret?: string; | ||
redis?: RedisOptions & { | ||
@@ -75,0 +77,0 @@ maxBatchSize?: number; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
55026
2.16%976
1.88%