fix(payments-next): add StrapiClientConfig to nestapp config

This commit is contained in:
julianpoyourow 2024-07-17 19:12:33 +00:00
Родитель d86419a683
Коммит 158beb4828
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: EA0570ABC73D47D3
5 изменённых файлов: 17 добавлений и 35 удалений

Просмотреть файл

@ -52,6 +52,13 @@ CONTENTFUL_CLIENT_CONFIG__FIRESTORE_CACHE_COLLECTION_NAME=contentfulQueryCacheCo
CONTENTFUL_CLIENT_CONFIG__MEM_CACHE_T_T_L=
CONTENTFUL_CLIENT_CONFIG__FIRESTORE_CACHE_T_T_L=
# Strapi Config
STRAPI_CLIENT_CONFIG__GRAPHQL_API_URI=https://example.com
STRAPI_CLIENT_CONFIG__GRAPHQL_API_KEY=PLACEHOLDER
STRAPI_CLIENT_CONFIG__MEM_CACHE_T_T_L=
STRAPI_CLIENT_CONFIG__FIRESTORE_CACHE_COLLECTION_NAME=strapiClientQueryCacheCollection
STRAPI_CLIENT_CONFIG__FIRESTORE_CACHE_T_T_L=
# CMS Config
CMS_CONFIG__SUPPORTED_PRICE_IDS=plan_GqM9N6qyhvxaVk,price_1KbomlBVqmGyQTMaa0Tq7UaW,price_1Ivq4gBVqmGyQTMaplHcFEGO

Просмотреть файл

@ -48,6 +48,13 @@ CONTENTFUL_CLIENT_CONFIG__FIRESTORE_CACHE_COLLECTION_NAME=contentfulQueryCacheCo
CONTENTFUL_CLIENT_CONFIG__MEM_CACHE_T_T_L= 300
CONTENTFUL_CLIENT_CONFIG__FIRESTORE_CACHE_T_T_L= 604800
# Strapi Config
STRAPI_CLIENT_CONFIG__GRAPHQL_API_URI=https://example.com
STRAPI_CLIENT_CONFIG__API_KEY=PLACEHOLDER
STRAPI_CLIENT_CONFIG__MEM_CACHE_T_T_L=
STRAPI_CLIENT_CONFIG__FIRESTORE_CACHE_COLLECTION_NAME=strapiClientQueryCacheCollection
STRAPI_CLIENT_CONFIG__FIRESTORE_CACHE_T_T_L=
# CMS Config
CMS_CONFIG__SUPPORTED_PRICE_IDS=

Просмотреть файл

@ -9,7 +9,7 @@ import { MySQLConfig } from '@fxa/shared/db/mysql/core';
import { GeoDBConfig, GeoDBManagerConfig } from '@fxa/shared/geodb';
import { PaypalClientConfig } from 'libs/payments/paypal/src/lib/paypal.client.config';
import { StripeConfig } from '@fxa/payments/stripe';
import { CMSConfig, ContentfulClientConfig } from '@fxa/shared/cms';
import { CMSConfig, StrapiClientConfig } from '@fxa/shared/cms';
import { FirestoreConfig } from 'libs/shared/db/firestore/src/lib/firestore.config';
import { StatsDConfig } from 'libs/shared/metrics/statsd/src/lib/statsd.config';
@ -38,10 +38,10 @@ export class RootConfig {
@IsDefined()
public readonly paypalClientConfig!: Partial<PaypalClientConfig>;
@Type(() => ContentfulClientConfig)
@Type(() => StrapiClientConfig)
@ValidateNested()
@IsDefined()
public readonly contentfulClientConfig!: Partial<ContentfulClientConfig>;
public readonly strapiClientConfig!: Partial<StrapiClientConfig>;
@Type(() => CMSConfig)
@ValidateNested()

Просмотреть файл

@ -5,7 +5,6 @@
export * from './lib/cms.config';
export * from './lib/cms.error';
export * from './lib/constants';
export * from './lib/contentful.client.config';
export * from './lib/factories';
export * from './lib/product-configuration.manager';
export * from './lib/queries/capability-service-by-plan-ids';

Просмотреть файл

@ -1,31 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { IsNumber, IsString, IsUrl } from 'class-validator';
export class ContentfulClientConfig {
@IsUrl()
public readonly cdnApiUri!: string;
@IsUrl()
public readonly graphqlApiUri!: string;
@IsString()
public readonly graphqlApiKey!: string;
@IsString()
public readonly graphqlSpaceId!: string;
@IsString()
public readonly graphqlEnvironment!: string;
@IsString()
public readonly firestoreCacheCollectionName!: string;
@IsNumber()
public readonly memCacheTTL?: number;
@IsNumber()
public readonly firestoreCacheTTL?: number;
}