chore: add auto backup workspace setting

This commit is contained in:
steven
2023-09-02 14:17:23 +08:00
parent b8f31cfd25
commit 7c4ccbef3f
5 changed files with 575 additions and 0 deletions

View File

@ -0,0 +1,100 @@
// @generated by protoc-gen-es v1.3.0
// @generated from file store/workspace_setting.proto (package slash.store, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
/**
* @generated from enum slash.store.WorkspaceSettingKey
*/
export declare enum WorkspaceSettingKey {
/**
* @generated from enum value: WORKSPACE_SETTING_KEY_UNSPECIFIED = 0;
*/
WORKSPACE_SETTING_KEY_UNSPECIFIED = 0,
/**
* @generated from enum value: WORKSPACE_SETTING_AUTO_BACKUP = 1;
*/
WORKSPACE_SETTING_AUTO_BACKUP = 1,
}
/**
* @generated from message slash.store.WorkspaceSetting
*/
export declare class WorkspaceSetting extends Message<WorkspaceSetting> {
/**
* @generated from field: slash.store.WorkspaceSettingKey key = 1;
*/
key: WorkspaceSettingKey;
/**
* @generated from oneof slash.store.WorkspaceSetting.value
*/
value: {
/**
* @generated from field: slash.store.AutoBackupWorkspaceSetting auto_backup = 2;
*/
value: AutoBackupWorkspaceSetting;
case: "autoBackup";
} | { case: undefined; value?: undefined };
constructor(data?: PartialMessage<WorkspaceSetting>);
static readonly runtime: typeof proto3;
static readonly typeName = "slash.store.WorkspaceSetting";
static readonly fields: FieldList;
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): WorkspaceSetting;
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): WorkspaceSetting;
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): WorkspaceSetting;
static equals(a: WorkspaceSetting | PlainMessage<WorkspaceSetting> | undefined, b: WorkspaceSetting | PlainMessage<WorkspaceSetting> | undefined): boolean;
}
/**
* @generated from message slash.store.AutoBackupWorkspaceSetting
*/
export declare class AutoBackupWorkspaceSetting extends Message<AutoBackupWorkspaceSetting> {
/**
* Whether auto backup is enabled.
*
* @generated from field: bool enabled = 1;
*/
enabled: boolean;
/**
* The cron expression for auto backup.
* For example, "0 0 0 * * *" means backup at 00:00:00 every day.
* See https://en.wikipedia.org/wiki/Cron for more details.
*
* @generated from field: string cron_expression = 2;
*/
cronExpression: string;
/**
* The maximum number of backups to keep.
*
* @generated from field: int32 max_keep = 3;
*/
maxKeep: number;
constructor(data?: PartialMessage<AutoBackupWorkspaceSetting>);
static readonly runtime: typeof proto3;
static readonly typeName = "slash.store.AutoBackupWorkspaceSetting";
static readonly fields: FieldList;
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AutoBackupWorkspaceSetting;
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AutoBackupWorkspaceSetting;
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AutoBackupWorkspaceSetting;
static equals(a: AutoBackupWorkspaceSetting | PlainMessage<AutoBackupWorkspaceSetting> | undefined, b: AutoBackupWorkspaceSetting | PlainMessage<AutoBackupWorkspaceSetting> | undefined): boolean;
}

View File

@ -0,0 +1,41 @@
// @generated by protoc-gen-es v1.3.0
// @generated from file store/workspace_setting.proto (package slash.store, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import { proto3 } from "@bufbuild/protobuf";
/**
* @generated from enum slash.store.WorkspaceSettingKey
*/
export const WorkspaceSettingKey = proto3.makeEnum(
"slash.store.WorkspaceSettingKey",
[
{no: 0, name: "WORKSPACE_SETTING_KEY_UNSPECIFIED"},
{no: 1, name: "WORKSPACE_SETTING_AUTO_BACKUP"},
],
);
/**
* @generated from message slash.store.WorkspaceSetting
*/
export const WorkspaceSetting = proto3.makeMessageType(
"slash.store.WorkspaceSetting",
() => [
{ no: 1, name: "key", kind: "enum", T: proto3.getEnumType(WorkspaceSettingKey) },
{ no: 2, name: "auto_backup", kind: "message", T: AutoBackupWorkspaceSetting, oneof: "value" },
],
);
/**
* @generated from message slash.store.AutoBackupWorkspaceSetting
*/
export const AutoBackupWorkspaceSetting = proto3.makeMessageType(
"slash.store.AutoBackupWorkspaceSetting",
() => [
{ no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 2, name: "cron_expression", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "max_keep", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
],
);