mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-27 11:15:02 +00:00
Revert "+debug build method (revert this)"
This reverts commit a80af1e729
.
This commit is contained in:
parent
a80af1e729
commit
139a4ab4a8
12 changed files with 23 additions and 40 deletions
|
@ -93,11 +93,6 @@ export function strictValidationErrorToConfigValidationError(err: StrictValidati
|
|||
|
||||
export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?: ZeppelinPlugin["configParser"]) {
|
||||
return async (options: PluginOptions<any>, strict?: boolean) => {
|
||||
const ident = `[getPluginConfigParser.${blueprint.name}] | `;
|
||||
if (blueprint.name === "mutes") {
|
||||
console.log(ident, "options => ", JSON.stringify(options));
|
||||
}
|
||||
|
||||
// 1. Validate the basic structure of plugin config
|
||||
const basicOptionsValidation = validate(BasicPluginStructureType, options);
|
||||
if (basicOptionsValidation instanceof StrictValidationError) {
|
||||
|
@ -147,7 +142,7 @@ export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?:
|
|||
}
|
||||
}
|
||||
|
||||
// 3. Run custom parser, if any
|
||||
// 3. Run custom preprocessor, if any
|
||||
if (customParser) {
|
||||
options = await customParser(options);
|
||||
}
|
||||
|
@ -161,7 +156,6 @@ export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?:
|
|||
? decodeAndValidateStrict(blueprint.configSchema, options.config)
|
||||
: options.config;
|
||||
if (decodedConfig instanceof StrictValidationError) {
|
||||
console.error("4.strict:", blueprint.name);
|
||||
throw strictValidationErrorToConfigValidationError(decodedConfig);
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +167,6 @@ export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?:
|
|||
? decodeAndValidateStrict(blueprint.configSchema, overrideConfigMergedWithBaseConfig)
|
||||
: overrideConfigMergedWithBaseConfig;
|
||||
if (decodedOverrideConfig instanceof StrictValidationError) {
|
||||
console.error("4.overrides.strict:", blueprint.name, options, decodedOverrideConfig);
|
||||
throw strictValidationErrorToConfigValidationError(decodedOverrideConfig);
|
||||
}
|
||||
decodedOverrides.push({
|
||||
|
@ -234,13 +227,11 @@ export async function sendErrorMessage(
|
|||
|
||||
export function getBaseUrl(pluginData: AnyPluginData<any>) {
|
||||
const knub = pluginData.getKnubInstance() as TZeppelinKnub;
|
||||
// @ts-expect-error
|
||||
return knub.getGlobalConfig().url;
|
||||
}
|
||||
|
||||
export function isOwner(pluginData: AnyPluginData<any>, userId: string) {
|
||||
const knub = pluginData.getKnubInstance() as TZeppelinKnub;
|
||||
// @ts-expect-error
|
||||
const owners = knub.getGlobalConfig()?.owners;
|
||||
if (!owners) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue