@driveflux/cms 1.4.9 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -1,30 +1,24 @@
1
1
  import { initSingleton } from '@driveflux/singleton';
2
2
  import { z } from 'zod';
3
- export var ConfigValidation = z.object({
3
+ export const ConfigValidation = z.object({
4
4
  graphCms: z.object({
5
5
  devAuthToken: z.string(),
6
6
  prodAuthToken: z.string(),
7
7
  projectApi: z.string()
8
8
  })
9
9
  });
10
- export var getConfig = function() {
11
- return ConfigValidation.parse({
10
+ export const getConfig = ()=>ConfigValidation.parse({
12
11
  graphCms: {
13
12
  devAuthToken: process.env.GRAPHCMS_AUTH_TOKEN,
14
13
  prodAuthToken: process.env.GRAPHCMS_AUTH_TOKEN,
15
14
  projectApi: process.env.GRAPHCMS_PROJECT_API
16
15
  }
17
16
  });
18
- };
19
- export var config = initSingleton('backendConfig', function() {
20
- return getConfig();
21
- });
22
- export var setConfig = function(key, value) {
17
+ export let config = initSingleton('backendConfig', ()=>getConfig());
18
+ export const setConfig = (key, value)=>{
23
19
  config[key] = value;
24
20
  };
25
- export var resetConfig = function() {
26
- config = initSingleton('backendConfig', function() {
27
- return getConfig();
28
- }, true);
21
+ export const resetConfig = ()=>{
22
+ config = initSingleton('backendConfig', ()=>getConfig(), true);
29
23
  return config;
30
24
  };