You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@last-rev/app-config

Package Overview
Dependencies
Maintainers
5
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@last-rev/app-config - npm Package Compare versions

Comparing version

to
0.5.0

6

CHANGELOG.md
# @last-rev/app-config
## 0.5.0
### Minor Changes
- 6d0abb0: 'Updated app config to use feature flag for enablePathsV2'
## 0.4.5

@@ -4,0 +10,0 @@

41

dist/index.d.ts

@@ -52,41 +52,9 @@ /// <reference types="node" />

};
get apolloServerOptions(): Partial<import("@apollo/server").ApolloServerOptions<Context<{
loaders: import("packages/types").ContentfulLoaders;
mappers: import("packages/types").Mappers;
defaultLocale: string;
typeMappings: import("packages/types").TypeMappings;
loadEntriesForPath: import("packages/types").LoadEntriesForPathFunction;
loadPathsForContent: import("packages/types").loadPathsForContentFunction;
locale?: string | undefined;
path?: string | undefined;
locales: string[];
preview?: boolean | undefined;
contentful: import("packages/types").ContentfulClients;
pathReaders?: import("packages/types").PathReaders | undefined;
displayType?: string | undefined;
pathEntries?: import("packages/types").PathEntries | undefined;
}>>> & {
context?: import("@apollo/server").ContextFunction<any, Context<{
loaders: import("packages/types").ContentfulLoaders;
mappers: import("packages/types").Mappers;
defaultLocale: string;
typeMappings: import("packages/types").TypeMappings;
loadEntriesForPath: import("packages/types").LoadEntriesForPathFunction;
loadPathsForContent: import("packages/types").loadPathsForContentFunction;
locale?: string | undefined;
path?: string | undefined;
locales: string[];
preview?: boolean | undefined;
contentful: import("packages/types").ContentfulClients;
pathReaders?: import("packages/types").PathReaders | undefined;
displayType?: string | undefined;
pathEntries?: import("packages/types").PathEntries | undefined;
}>> | undefined;
get apolloServerOptions(): Partial<import("@apollo/server").ApolloServerOptions<import("packages/types").ApolloContext>> & {
context?: import("@apollo/server").ContextFunction<any, import("packages/types").ApolloContext> | undefined;
};
get sites(): string[];
get paths(): {
version: import("./types").PathVersion;
generateFullPathTree: true;
};
get skipReferenceFields(): boolean;
get sitemap(): {

@@ -100,6 +68,7 @@ domain: string;

get features(): {
disableCoreSidekickLookup: boolean | undefined;
disableFederatedSchema: boolean | undefined;
disableCoreSidekickLookup: boolean;
disableFederatedSchema: boolean;
enablePathsV2: boolean;
};
}
//# 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"},apolloServerOptions:{},sites:[],features:{}},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,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")}}},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,"apolloServerOptions",{get:function(){return this.config.apolloServerOptions||{}},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}),Object.defineProperty(n.prototype,"features",{get:function(){var e,t,i;return(null===(e=this.config.features)||void 0===e?void 0:e.disableCoreSidekickLookup)||console.warn("The SidekickLookupResolver in the core is being deprecated. See how to migrate: https://lastrev.atlassian.net/wiki/spaces/KB/pages/108167187/Sidekick+Lookup+Migration"),{disableCoreSidekickLookup:null===(t=this.config.features)||void 0===t?void 0:t.disableCoreSidekickLookup,disableFederatedSchema:null===(i=this.config.features)||void 0===i?void 0:i.disableFederatedSchema}},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"},apolloServerOptions:{},sites:[],features:{}},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,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")}}},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,"apolloServerOptions",{get:function(){return this.config.apolloServerOptions||{}},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;return{generateFullPathTree:(null===(e=this.config.paths)||void 0===e?void 0:e.generateFullPathTree)||!0}},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}),Object.defineProperty(n.prototype,"features",{get:function(){var e,t,o,n,r,s,a;return(null===(e=this.config.features)||void 0===e?void 0:e.disableCoreSidekickLookup)||console.warn("The SidekickLookupResolver in the core is being deprecated. See how to migrate: https://lastrev.atlassian.net/wiki/spaces/KB/pages/108167187/Sidekick+Lookup+Migration"),(null===(t=this.config.paths)||void 0===t?void 0:t.version)&&console.warn("The paths.version config option is deprecated. Use the features.enablePathsV2 option instead"),{disableCoreSidekickLookup:!!(null===(o=this.config.features)||void 0===o?void 0:o.disableCoreSidekickLookup),disableFederatedSchema:!!(null===(n=this.config.features)||void 0===n?void 0:n.disableFederatedSchema),enablePathsV2:i(null===(r=this.config.features)||void 0===r?void 0:r.enablePathsV2)?"v2"===(null===(s=this.config.paths)||void 0===s?void 0:s.version):!!(null===(a=this.config.features)||void 0===a?void 0:a.enablePathsV2)}},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"},apolloServerOptions:{},sites:[],features:{}},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,u,g;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===(u=this.config.dynamodb)||void 0===u?void 0:u.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.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,"apolloServerOptions",{get:function(){return this.config.apolloServerOptions||{}},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}),Object.defineProperty(t.prototype,"features",{get:function(){var e,t,i;return(null===(e=this.config.features)||void 0===e?void 0:e.disableCoreSidekickLookup)||console.warn("The SidekickLookupResolver in the core is being deprecated. See how to migrate: https://lastrev.atlassian.net/wiki/spaces/KB/pages/108167187/Sidekick+Lookup+Migration"),{disableCoreSidekickLookup:null===(t=this.config.features)||void 0===t?void 0:t.disableCoreSidekickLookup,disableFederatedSchema:null===(i=this.config.features)||void 0===i?void 0:i.disableFederatedSchema}},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"},apolloServerOptions:{},sites:[],features:{}},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,u,g;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===(u=this.config.dynamodb)||void 0===u?void 0:u.secretAccessKey))throw new Error("DynamoDB strategy: dynamodb.secretAccessKey is required");if(!(null===(g=this.config.dynamodb)||void 0===g?void 0:g.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,"apolloServerOptions",{get:function(){return this.config.apolloServerOptions||{}},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;return{generateFullPathTree:(null===(e=this.config.paths)||void 0===e?void 0:e.generateFullPathTree)||!0}},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}),Object.defineProperty(t.prototype,"features",{get:function(){var e,t,i,o,n,s,a;return(null===(e=this.config.features)||void 0===e?void 0:e.disableCoreSidekickLookup)||console.warn("The SidekickLookupResolver in the core is being deprecated. See how to migrate: https://lastrev.atlassian.net/wiki/spaces/KB/pages/108167187/Sidekick+Lookup+Migration"),(null===(t=this.config.paths)||void 0===t?void 0:t.version)&&console.warn("The paths.version config option is deprecated. Use the features.enablePathsV2 option instead"),{disableCoreSidekickLookup:!!(null===(i=this.config.features)||void 0===i?void 0:i.disableCoreSidekickLookup),disableFederatedSchema:!!(null===(o=this.config.features)||void 0===o?void 0:o.disableFederatedSchema),enablePathsV2:r.default(null===(n=this.config.features)||void 0===n?void 0:n.enablePathsV2)?"v2"===(null===(s=this.config.paths)||void 0===s?void 0:s.version):!!(null===(a=this.config.features)||void 0===a?void 0:a.enablePathsV2)}},enumerable:!1,configurable:!0}),t}();module.exports=a;

@@ -49,5 +49,3 @@ import { ApolloContext, Extensions } from '@last-rev/types';

sites: string[];
skipReferenceFields: boolean;
paths: {
version: PathVersion;
generateFullPathTree: boolean;

@@ -63,4 +61,5 @@ };

features: {
disableCoreSidekickLookup?: boolean;
disableFederatedSchema?: boolean;
disableCoreSidekickLookup: boolean;
disableFederatedSchema: boolean;
enablePathsV2: boolean;
};

@@ -113,3 +112,2 @@ }

sites?: string[];
skipReferenceFields?: boolean;
paths?: {

@@ -129,2 +127,3 @@ version?: PathVersion;

disableFederatedSchema?: boolean;
enablePathsV2?: boolean;
};

@@ -131,0 +130,0 @@ };

{
"name": "@last-rev/app-config",
"version": "0.4.5",
"version": "0.5.0",
"description": "",

@@ -18,3 +18,3 @@ "main": "dist/index.js",

"@last-rev/testing-library": "^0.1.10",
"@last-rev/types": "^0.3.3",
"@last-rev/types": "^0.3.6",
"ioredis": "^5.0.4",

@@ -21,0 +21,0 @@ "jest": "^26.6.3"

@@ -48,3 +48,4 @@ import { LastRevAppConfigArgs } from './types';

},
skipReferenceFields: false
paths: {},
features: {}
});

@@ -222,3 +222,2 @@ import { LastRevAppConfigArgs, LastRevAppConfiguration } from './types';

return {
version: this.config.paths?.version || 'v1',
generateFullPathTree: this.config.paths?.generateFullPathTree || true

@@ -228,7 +227,2 @@ };

get skipReferenceFields() {
// defaults to true, to allow backwards compatibility
return isNil(this.config.skipReferenceFields) ? true : this.config.skipReferenceFields;
}
get sitemap() {

@@ -250,7 +244,13 @@ return {

}
if (this.config.paths?.version) {
console.warn('The paths.version config option is deprecated. Use the features.enablePathsV2 option instead');
}
return {
disableCoreSidekickLookup: this.config.features?.disableCoreSidekickLookup,
disableFederatedSchema: this.config.features?.disableFederatedSchema
disableCoreSidekickLookup: !!this.config.features?.disableCoreSidekickLookup,
disableFederatedSchema: !!this.config.features?.disableFederatedSchema,
enablePathsV2: isNil(this.config.features?.enablePathsV2)
? this.config.paths?.version === 'v2'
: !!this.config.features?.enablePathsV2
};
}
}

@@ -52,5 +52,3 @@ import { ApolloContext, Extensions } from '@last-rev/types';

sites: string[];
skipReferenceFields: boolean;
paths: {
version: PathVersion;
generateFullPathTree: boolean;

@@ -66,4 +64,5 @@ };

features: {
disableCoreSidekickLookup?: boolean;
disableFederatedSchema?: boolean;
disableCoreSidekickLookup: boolean;
disableFederatedSchema: boolean;
enablePathsV2: boolean;
};

@@ -120,4 +119,6 @@ }

sites?: string[];
skipReferenceFields?: boolean;
paths?: {
/*
@deprecated use features.enablePathsV2 instead
*/
version?: PathVersion;

@@ -136,3 +137,4 @@ generateFullPathTree?: boolean;

disableFederatedSchema?: boolean;
enablePathsV2?: boolean;
};
};

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

Sorry, the diff of this file is not supported yet