feat: add automate module with feature flag
This commit is contained in:
Родитель
1d135c101b
Коммит
3c3dd0f919
|
@ -0,0 +1,3 @@
|
||||||
|
import { Resolvers } from '@/modules/core/graph/generated/graphql'
|
||||||
|
|
||||||
|
export = {} as Resolvers
|
|
@ -1,8 +1,10 @@
|
||||||
import { moduleLogger } from '@/logging/logging'
|
import { moduleLogger } from '@/logging/logging'
|
||||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||||
|
import { ENABLE_AUTOMATE_MODULE } from '../shared/helpers/envHelper'
|
||||||
|
|
||||||
const automateModule: SpeckleModule = {
|
const automateModule: SpeckleModule = {
|
||||||
async init() {
|
async init() {
|
||||||
|
if (!ENABLE_AUTOMATE_MODULE) return
|
||||||
moduleLogger.info('⚙️ Init automate module')
|
moduleLogger.info('⚙️ Init automate module')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import { MisconfiguredEnvironmentError } from '@/modules/shared/errors'
|
import { MisconfiguredEnvironmentError } from '@/modules/shared/errors'
|
||||||
import { trimEnd } from 'lodash'
|
import { trimEnd } from 'lodash'
|
||||||
|
import { parseEnv } from 'znv'
|
||||||
|
import { z } from 'zod'
|
||||||
|
|
||||||
export function isTestEnv() {
|
export function isTestEnv() {
|
||||||
return process.env.NODE_ENV === 'test'
|
return process.env.NODE_ENV === 'test'
|
||||||
|
@ -263,3 +265,7 @@ export function getEmailFromAddress() {
|
||||||
export function getMaximumProjectModelsPerPage() {
|
export function getMaximumProjectModelsPerPage() {
|
||||||
return getIntFromEnv('MAX_PROJECT_MODELS_PER_PAGE', '500')
|
return getIntFromEnv('MAX_PROJECT_MODELS_PER_PAGE', '500')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const { ENABLE_AUTOMATE_MODULE } = parseEnv(process.env, {
|
||||||
|
ENABLE_AUTOMATE_MODULE: z.boolean().default(false)
|
||||||
|
})
|
||||||
|
|
|
@ -102,7 +102,8 @@
|
||||||
"undici": "^5.28.3",
|
"undici": "^5.28.3",
|
||||||
"verror": "^1.10.1",
|
"verror": "^1.10.1",
|
||||||
"xml-escape": "^1.1.0",
|
"xml-escape": "^1.1.0",
|
||||||
"zod": "^3.22.3",
|
"znv": "^0.4.0",
|
||||||
|
"zod": "^3.22.4",
|
||||||
"zod-validation-error": "^1.5.0",
|
"zod-validation-error": "^1.5.0",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -14198,7 +14198,8 @@ __metadata:
|
||||||
ws: ^7.5.7
|
ws: ^7.5.7
|
||||||
xml-escape: ^1.1.0
|
xml-escape: ^1.1.0
|
||||||
yargs: ^17.3.1
|
yargs: ^17.3.1
|
||||||
zod: ^3.22.3
|
znv: ^0.4.0
|
||||||
|
zod: ^3.22.4
|
||||||
zod-validation-error: ^1.5.0
|
zod-validation-error: ^1.5.0
|
||||||
zxcvbn: ^4.4.2
|
zxcvbn: ^4.4.2
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
|
@ -48054,6 +48055,17 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"znv@npm:^0.4.0":
|
||||||
|
version: 0.4.0
|
||||||
|
resolution: "znv@npm:0.4.0"
|
||||||
|
dependencies:
|
||||||
|
colorette: ^2.0.19
|
||||||
|
peerDependencies:
|
||||||
|
zod: ^3.13.2
|
||||||
|
checksum: 7dac62d9b83de85f46ebdcc3a8563a198129a34f60948e99ba339a824594ace4ca37d328ad358646f321ee42b9506ef71d9e9901d41a668cca843ac272194d71
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"zod-validation-error@npm:^1.5.0":
|
"zod-validation-error@npm:^1.5.0":
|
||||||
version: 1.5.0
|
version: 1.5.0
|
||||||
resolution: "zod-validation-error@npm:1.5.0"
|
resolution: "zod-validation-error@npm:1.5.0"
|
||||||
|
@ -48063,7 +48075,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"zod@npm:^3.22.3":
|
"zod@npm:^3.22.4":
|
||||||
version: 3.22.4
|
version: 3.22.4
|
||||||
resolution: "zod@npm:3.22.4"
|
resolution: "zod@npm:3.22.4"
|
||||||
checksum: 80bfd7f8039b24fddeb0718a2ec7c02aa9856e4838d6aa4864335a047b6b37a3273b191ef335bf0b2002e5c514ef261ffcda5a589fb084a48c336ffc4cdbab7f
|
checksum: 80bfd7f8039b24fddeb0718a2ec7c02aa9856e4838d6aa4864335a047b6b37a3273b191ef335bf0b2002e5c514ef261ffcda5a589fb084a48c336ffc4cdbab7f
|
||||||
|
|
Загрузка…
Ссылка в новой задаче