@last-rev/app-config
Advanced tools
Comparing version 0.4.0 to 0.4.1
# @last-rev/app-config | ||
## 0.4.1 | ||
### Patch Changes | ||
- 3371479: Bring fetching logic into sitemap generator | ||
## 0.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -57,4 +57,10 @@ /// <reference types="node" /> | ||
get skipReferenceFields(): boolean; | ||
get sitemapMaxPageSize(): number; | ||
get sitemap(): { | ||
domain: string; | ||
maxPageSize: number; | ||
indexRootPath: string; | ||
pagesRootPath: string; | ||
excludePages: string[]; | ||
}; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
@@ -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,"sitemapMaxPageSize",{get:function(){return this.config.sitemapMaxPageSize||1e3},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,"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 n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),r=n(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=o.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,n,o,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===(n=this.config.dynamodb)||void 0===n?void 0:n.region))throw new Error("DynamoDB strategy: dynamodb.region is required");if(!(null===(o=this.config.dynamodb)||void 0===o?void 0:o.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(o.default({},this.config,e))},Object.defineProperty(t.prototype,"contentful",{get:function(){var e,t,i,n,o,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===(n=this.config.contentful)||void 0===n?void 0:n.env,usePreview:!!(null===(o=this.config.contentful)||void 0===o?void 0:o.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,n;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===(n=this.config.algolia)||void 0===n?void 0:n.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,n;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===(n=this.config.dynamodb)||void 0===n?void 0:n.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,"sitemapMaxPageSize",{get:function(){return this.config.sitemapMaxPageSize||1e3},enumerable:!1,configurable:!0}),t}();module.exports=c; | ||
"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; |
@@ -52,3 +52,9 @@ import { Extensions } from '@last-rev/types'; | ||
}; | ||
sitemapMaxPageSize: number; | ||
sitemap: { | ||
domain: string; | ||
maxPageSize: number; | ||
indexRootPath: string; | ||
pagesRootPath: string; | ||
excludePages: string[]; | ||
}; | ||
} | ||
@@ -100,4 +106,10 @@ export declare type LastRevAppConfigArgs = { | ||
}; | ||
sitemapMaxPageSize?: number; | ||
sitemap?: { | ||
domain?: string; | ||
maxPageSize?: number; | ||
indexRootPath?: string; | ||
pagesRootPath?: string; | ||
excludePages?: string[]; | ||
}; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@last-rev/app-config", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -223,5 +223,11 @@ import { LastRevAppConfigArgs, LastRevAppConfiguration } from './types'; | ||
get sitemapMaxPageSize() { | ||
return this.config.sitemapMaxPageSize || 1000; | ||
get sitemap() { | ||
return { | ||
domain: this.config.sitemap?.domain || '', | ||
maxPageSize: this.config.sitemap?.maxPageSize || 1000, | ||
indexRootPath: this.config.sitemap?.indexRootPath || '/', | ||
pagesRootPath: this.config.sitemap?.pagesRootPath || '/sitemap', | ||
excludePages: this.config.sitemap?.excludePages || [] | ||
}; | ||
} | ||
} |
@@ -55,3 +55,9 @@ import { Extensions } from '@last-rev/types'; | ||
}; | ||
sitemapMaxPageSize: number; | ||
sitemap: { | ||
domain: string; | ||
maxPageSize: number; | ||
indexRootPath: string; | ||
pagesRootPath: string; | ||
excludePages: string[]; | ||
}; | ||
} | ||
@@ -107,3 +113,9 @@ | ||
}; | ||
sitemapMaxPageSize?: number; | ||
sitemap?: { | ||
domain?: string; | ||
maxPageSize?: number; | ||
indexRootPath?: string; | ||
pagesRootPath?: string; | ||
excludePages?: string[]; | ||
}; | ||
}; |
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
53864
958