@lark-project/cli
Version:
飞书项目插件开发工具
39 lines (38 loc) • 2.86 kB
TypeScript
import { AppType, ECommandName } from "../types";
export type OnlineWriteOperation = ECommandName.create | ECommandName.update | ECommandName.publish | ECommandName.updateDescription | 'perm.apply';
export type AppTypeRestrictedOperation = OnlineWriteOperation | ECommandName.schema | 'local-config.set' | 'local-config.diff' | 'check.diff';
/**
* Commands whose implementation is app-type-specific must opt in each
* supported app type here. This includes online writes plus schema/config
* workflows that are unavailable until their point type is supported.
* Keep the arrays explicit so a newly added AppType is denied until every
* guarded path has been reviewed deliberately.
*
* start / init / release are intentionally outside this gate.
*/
export declare const APP_TYPE_OPERATION_ALLOWLIST: {
readonly create: readonly ["normal", "ai_node", "ai_field"];
readonly update: readonly ["normal", "ai_node", "ai_field"];
readonly publish: readonly ["normal", "ai_node", "ai_field"];
readonly "update-description": readonly ["normal", "ai_node", "ai_field"];
readonly 'perm.apply': readonly ["normal"];
readonly schema: readonly ["normal", "ai_node", "ai_field"];
readonly 'local-config.set': readonly ["normal", "ai_node", "ai_field"];
readonly 'local-config.diff': readonly ["normal", "ai_node", "ai_field"];
readonly 'check.diff': readonly ["normal", "ai_node", "ai_field"];
};
export declare const ONLINE_WRITE_APP_TYPE_ALLOWLIST: {
readonly create: readonly ["normal", "ai_node", "ai_field"];
readonly update: readonly ["normal", "ai_node", "ai_field"];
readonly publish: readonly ["normal", "ai_node", "ai_field"];
readonly "update-description": readonly ["normal", "ai_node", "ai_field"];
readonly 'perm.apply': readonly ["normal"];
};
export declare function getAllowedAppTypesForOperation(operation: AppTypeRestrictedOperation): readonly AppType[];
export declare function isAppTypeAllowedForOperation(operation: AppTypeRestrictedOperation, appType: AppType | undefined): boolean;
export declare function formatAppTypeOperationError(operation: AppTypeRestrictedOperation, appType: AppType | undefined): string;
export declare function assertAppTypeAllowedForOperation(operation: AppTypeRestrictedOperation, appType: AppType | undefined): asserts appType is AppType;
export declare function getAllowedAppTypesForOnlineWrite(operation: OnlineWriteOperation): readonly AppType[];
export declare function isAppTypeAllowedForOnlineWrite(operation: OnlineWriteOperation, appType: AppType | undefined): boolean;
export declare function formatOnlineWriteAppTypeError(operation: OnlineWriteOperation, appType: AppType | undefined): string;
export declare function assertAppTypeAllowedForOnlineWrite(operation: OnlineWriteOperation, appType: AppType | undefined): asserts appType is AppType;