@driveflux/cms 1.4.9 → 1.4.11
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 +6 -12
- package/dist/hygraph/drivers/graphcms.js +611 -842
- package/dist/hygraph/index.d.ts.map +1 -1
- package/dist/hygraph/index.js +1 -2
- package/package.json +1 -5
- package/dist/hygraph/hygraph.js +0 -6
package/dist/config.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { initSingleton } from '@driveflux/singleton';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export
|
|
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
|
|
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
|
|
20
|
-
return getConfig();
|
|
21
|
-
});
|
|
22
|
-
export var setConfig = function(key, value) {
|
|
17
|
+
export let config = initSingleton('fluxCmsConfug', ()=>getConfig());
|
|
18
|
+
export const setConfig = (key, value)=>{
|
|
23
19
|
config[key] = value;
|
|
24
20
|
};
|
|
25
|
-
export
|
|
26
|
-
config = initSingleton('
|
|
27
|
-
return getConfig();
|
|
28
|
-
}, true);
|
|
21
|
+
export const resetConfig = ()=>{
|
|
22
|
+
config = initSingleton('fluxCmsConfug', ()=>getConfig(), true);
|
|
29
23
|
return config;
|
|
30
24
|
};
|