Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor(frontend): use real Long type for int64 values (#9111)

Liu Ji9a243513ec62
diff --git a/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue b/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
index 0b1e14e5b3..586e65ff48 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
@@ -61,6 +61,7 @@
</template>
<script setup lang="ts">
+import Long from "long";
import { zindexable as vZindexable } from "vdirs";
import { computed, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
@@ -100,7 +101,9 @@ const show = computed(() => {
const isSheetOversize = computed(() => {
if (!sheet.value) return false;
- return getSheetStatement(sheet.value).length < sheet.value.contentSize;
+ return Long.fromNumber(getSheetStatement(sheet.value).length).lt(
+ sheet.value.contentSize
+ );
});
const dirty = computed(() => {
diff --git a/frontend/src/components/DatabaseBackup/DatabaseBackupSettingForm.vue b/frontend/src/components/DatabaseBackup/DatabaseBackupSettingForm.vue
index fc11a6a381..4b323dbb41 100644
--- a/frontend/src/components/DatabaseBackup/DatabaseBackupSettingForm.vue
+++ b/frontend/src/components/DatabaseBackup/DatabaseBackupSettingForm.vue
@@ -166,6 +166,7 @@ import { useI18n } from "vue-i18n";
import { DrawerContent } from "@/components/v2";
import { pushNotification, useBackupV1Store } from "@/store";
import { ComposedDatabase, unknown } from "@/types";
+import { Duration } from "@/types/proto/google/protobuf/duration";
import { BackupSetting } from "@/types/proto/v1/database_service";
import {
BackupPlanSchedule,
@@ -304,10 +305,10 @@ const handleSave = async () => {
dayOfWeek: setting.dayOfWeek,
}),
hookUrl: props.backupSetting.hookUrl,
- backupRetainDuration: {
+ backupRetainDuration: Duration.fromPartial({
seconds: setting.retentionPeriodTs,
nanos: 0,
- },
+ }),
});
const action = setting.enabled
@@ -412,7 +413,8 @@ function extractEditValue(backupSetting: BackupSetting): BackupSettingEdit {
enabled: backupSetting.cronSchedule !== "",
dayOfWeek: schedule.dayOfWeek,
hour: schedule.hourOfDay,
- retentionPeriodTs: backupSetting.backupRetainDuration?.seconds ?? 0,
+ retentionPeriodTs:
+ backupSetting.backupRetainDuration?.seconds?.toNumber() ?? 0,
};
}
diff --git a/frontend/src/components/DatabaseBackupPanel.vue b/frontend/src/components/DatabaseBackupPanel.vue
index 746ad60fae..560507bcd6 100644
--- a/frontend/src/components/DatabaseBackupPanel.vue
+++ b/frontend/src/components/DatabaseBackupPanel.vue
@@ -198,6 +198,7 @@ import {
POLL_JITTER,
MINIMUM_POLL_INTERVAL,
} from "@/types";
+import { Duration } from "@/types/proto/google/protobuf/duration";
import {
Backup,
BackupSetting,
@@ -283,7 +284,7 @@ const assignBackupSetting = (backupSetting: BackupSetting) => {
state.autoBackupHour = schedule.hourOfDay;
state.autoBackupDayOfWeek = schedule.dayOfWeek;
state.autoBackupRetentionPeriodTs =
- backupSetting.backupRetainDuration?.seconds ?? 0;
+ backupSetting.backupRetainDuration?.seconds?.toNumber() ?? 0;
state.autoBackupHookUrl = backupSetting.hookUrl;
state.autoBackupUpdatedHookUrl = backupSetting.hookUrl;
@@ -448,10 +449,10 @@ const updateBackupHookUrl = () => {
dayOfWeek: state.autoBackupDayOfWeek,
}),
hookUrl: state.autoBackupUpdatedHookUrl,
- backupRetainDuration: {
+ backupRetainDuration: Duration.fromPartial({
seconds: state.autoBackupRetentionPeriodTs,
nanos: 0,
- },
+ }),
})
.then((backupSetting: BackupSetting) => {
assignBackupSetting(backupSetting);
diff --git a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
index b6211e4fc7..5b6c734c19 100644
--- a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
+++ b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
@@ -32,7 +32,7 @@
</div>
<FeatureModal
- :open="state.featureNameForModal"
+ :open="!!state.featureNameForModal"
:feature="state.featureNameForModal"
@cancel="state.featureNameForModal = undefined"
/>
@@ -46,6 +46,7 @@ import { useI18n } from "vue-i18n";
import { featureToRef, pushNotification, useCurrentUserV1 } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { FeatureType, defaultTokenDurationInHours } from "@/types";
+import { Duration } from "@/types/proto/google/protobuf/duration";
import { hasWorkspacePermissionV1 } from "@/utils";
const getInitialState = (): LocalState => {
@@ -54,7 +55,7 @@ const getInitialState = (): LocalState => {
timeFormat: "DAYS",
};
const seconds =
- settingV1Store.workspaceProfileSetting?.tokenDuration?.seconds;
+ settingV1Store.workspaceProfileSetting?.tokenDuration?.seconds?.toNumber();
if (seconds && seconds > 0) {
if (seconds < 60 * 60 * 24) {
defaultState.inputValue = Math.floor(seconds / (60 * 60)) || 1;
@@ -103,7 +104,7 @@ const handleFrequencySettingChange = useDebounceFn(async () => {
? state.inputValue * 60 * 60
: state.inputValue * 24 * 60 * 60;
await settingV1Store.updateWorkspaceProfile({
- tokenDuration: { seconds: seconds, nanos: 0 },
+ tokenDuration: Duration.fromPartial({ seconds, nanos: 0 }),
});
pushNotification({
module: "bytebase",
diff --git a/frontend/src/components/InstanceForm/InstanceForm.vue b/frontend/src/components/InstanceForm/InstanceForm.vue
index d81591c624..fcdef3a82b 100644
--- a/frontend/src/components/InstanceForm/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm/InstanceForm.vue
@@ -819,8 +819,8 @@ const doUpdate = async () => {
updateMask.push("options.schema_tenant_mode");
}
if (
- instancePatch.options?.syncInterval?.seconds !==
- instance.options?.syncInterval?.seconds
+ instancePatch.options?.syncInterval?.seconds?.toNumber() !==
+ instance.options?.syncInterval?.seconds?.toNumber()
) {
updateMask.push("options.sync_interval");
}
diff --git a/frontend/src/components/InstanceForm/ScanIntervalInput.vue b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
index f8dc958e7d..99d1bf08cf 100644
--- a/frontend/src/components/InstanceForm/ScanIntervalInput.vue
+++ b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
@@ -79,7 +79,7 @@ const hasSecretFeature = computed(() => {
const mode = computed(() => {
const duration = props.scanInterval;
if (!duration) return "DEFAULT";
- if (duration.seconds === 0) return "DEFAULT";
+ if (duration.seconds.toNumber() === 0) return "DEFAULT";
return "CUSTOM";
});
@@ -91,8 +91,8 @@ const minutes = computed({
get() {
const duration = props.scanInterval;
if (!duration) return undefined;
- if (duration.seconds === 0) return undefined;
- return Math.floor(duration.seconds / 60);
+ if (duration.seconds.toNumber() === 0) return undefined;
+ return Math.floor(duration.seconds.toNumber() / 60);
},
set(value) {
if (!value) {
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
index 63369bd619..e793565ab3 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
@@ -158,6 +158,7 @@
<script setup lang="ts">
import { cloneDeep } from "lodash-es";
+import Long from "long";
import { NButton, NTooltip, useDialog } from "naive-ui";
import { computed, h, reactive, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
@@ -303,7 +304,9 @@ const isTaskSheetOversize = computed(() => {
if (state.isEditing) return false;
if (!sheetReady.value) return false;
if (!sheet.value) return false;
- return getSheetStatement(sheet.value).length < sheet.value.contentSize;
+ return Long.fromNumber(getSheetStatement(sheet.value).length).lt(
+ sheet.value.contentSize
+ );
});
const denyEditTaskReasons = computed(() => {
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunTable.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunTable.vue
index 10b053a9b8..8122ad128d 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunTable.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunTable.vue
@@ -90,17 +90,17 @@ const executionDurationOfTaskRun = (taskRun: TaskRun): Duration | undefined => {
taskRun.executionStatusUpdateTime
) {
const elapsedMS = Date.now() - taskRun.executionStatusUpdateTime.getTime();
- return {
+ return Duration.fromPartial({
seconds: Math.floor(elapsedMS / 1000),
nanos: (elapsedMS % 1000) * 1e6,
- };
+ });
}
const startMS = startTime.getTime();
const updateMS = updateTime.getTime();
const elapsedMS = updateMS - startMS;
- return {
+ return Duration.fromPartial({
seconds: Math.floor(elapsedMS / 1000),
nanos: (elapsedMS % 1000) * 1e6,
- };
+ });
};
</script>
diff --git a/frontend/src/components/SchemaEditorV1/Panels/TableList.vue b/frontend/src/components/SchemaEditorV1/Panels/TableList.vue
index d7a7120806..446aa0118e 100644
--- a/frontend/src/components/SchemaEditorV1/Panels/TableList.vue
+++ b/frontend/src/components/SchemaEditorV1/Panels/TableList.vue
@@ -58,7 +58,7 @@
{{ table.rowCount }}
</div>
<div class="bb-grid-cell" :class="getTableClassList(table, row)">
- {{ bytesToString(table.dataSize) }}
+ {{ bytesToString(table.dataSize.toNumber()) }}
</div>
<div class="bb-grid-cell" :class="getTableClassList(table, row)">
{{ table.engine }}
diff --git a/frontend/src/components/SlowQuery/Panel/DetailPanel.vue b/frontend/src/components/SlowQuery/Panel/DetailPanel.vue
index 51f09fca8f..364a53957a 100644
--- a/frontend/src/components/SlowQuery/Panel/DetailPanel.vue
+++ b/frontend/src/components/SlowQuery/Panel/DetailPanel.vue
@@ -95,10 +95,10 @@
</div>
</div>
<div class="bb-grid-cell">
- {{ detail.queryTime?.seconds.toFixed(2) }}s
+ {{ detail.queryTime?.seconds?.toNumber()?.toFixed(2) }}s
</div>
<div class="bb-grid-cell">
- {{ detail.lockTime?.seconds.toFixed(2) }}s
+ {{ detail.lockTime?.seconds?.toNumber()?.toFixed(2) }}s
</div>
<div class="bb-grid-cell">
{{ detail.rowsExamined }}
diff --git a/frontend/src/components/SlowQuery/Panel/LogTable.vue b/frontend/src/components/SlowQuery/Panel/LogTable.vue
index bacb8d2146..b1fbde64b9 100644
--- a/frontend/src/components/SlowQuery/Panel/LogTable.vue
+++ b/frontend/src/components/SlowQuery/Panel/LogTable.vue
@@ -239,7 +239,7 @@ const toggleExpandRow = (item: ComposedSlowQueryLog) => {
const durationText = (duration: Duration | undefined) => {
if (!duration) return "-";
const { seconds, nanos } = duration;
- const total = seconds + nanos / 1e9;
+ const total = seconds.toNumber() + nanos / 1e9;
return total.toFixed(2) + "s";
};
diff --git a/frontend/src/components/SyncDatabaseSchema/RawSQLEditor.vue b/frontend/src/components/SyncDatabaseSchema/RawSQLEditor.vue
index 9f8cdca3bd..adc0d6b90b 100644
--- a/frontend/src/components/SyncDatabaseSchema/RawSQLEditor.vue
+++ b/frontend/src/components/SyncDatabaseSchema/RawSQLEditor.vue
@@ -76,6 +76,7 @@
<script lang="ts" setup>
import { useDebounceFn } from "@vueuse/core";
+import Long from "long";
import { NSelect } from "naive-ui";
import { computed, onMounted, nextTick, reactive } from "vue";
import { useI18n } from "vue-i18n";
@@ -148,10 +149,9 @@ const isSheetOversized = computed(() => {
if (!sheet.value) {
return false;
}
- return (
- new TextDecoder().decode(sheet.value.content).length <
- sheet.value.contentSize
- );
+ return Long.fromNumber(
+ new TextDecoder().decode(sheet.value.content).length
+ ).lt(sheet.value.contentSize);
});
onMounted(async () => {
diff --git a/frontend/src/components/TableDetailDrawer.vue b/frontend/src/components/TableDetailDrawer.vue
index 774ca2569a..0dde8d4b78 100644
--- a/frontend/src/components/TableDetailDrawer.vue
+++ b/frontend/src/components/TableDetailDrawer.vue
@@ -122,7 +122,7 @@
{{ $t("database.data-size") }}
</dt>
<dd class="mt-1 text-lg sm:text-xl font-semibold">
- {{ bytesToString(table.dataSize) }}
+ {{ bytesToString(table.dataSize.toNumber()) }}
</dd>
</div>
@@ -135,7 +135,7 @@
instanceEngine === Engine.CLICKHOUSE ||
instanceEngine === Engine.SNOWFLAKE
? "n/a"
- : bytesToString(table.indexSize)
+ : bytesToString(table.indexSize.toNumber())
}}
</dd>
</div>
diff --git a/frontend/src/components/TableTable.vue b/frontend/src/components/TableTable.vue
index 58bc15cc3a..de47972155 100644
--- a/frontend/src/components/TableTable.vue
+++ b/frontend/src/components/TableTable.vue
@@ -37,10 +37,10 @@
{{ table.rowCount }}
</BBTableCell>
<BBTableCell class="w-8">
- {{ bytesToString(table.dataSize) }}
+ {{ bytesToString(table.dataSize.toNumber()) }}
</BBTableCell>
<BBTableCell class="w-8">
- {{ bytesToString(table.indexSize) }}
+ {{ bytesToString(table.indexSize.toNumber()) }}
</BBTableCell>
<BBTableCell class="w-16 break-all">
{{ table.userComment }}
diff --git a/frontend/src/plugins/cel/logic/resolve.ts b/frontend/src/plugins/cel/logic/resolve.ts
index 83346c7676..f85fb11d9a 100644
--- a/frontend/src/plugins/cel/logic/resolve.ts
+++ b/frontend/src/plugins/cel/logic/resolve.ts
@@ -92,7 +92,7 @@ const resolveEqualityExpr = (expr: CELExpr): EqualityExpr => {
if (isNumberFactor(factor)) {
return {
operator,
- args: [factor, valueExpr.constExpr!.int64Value! ?? 0],
+ args: [factor, valueExpr.constExpr!.int64Value!.toNumber() ?? 0],
};
}
if (isStringFactor(factor)) {
@@ -111,7 +111,7 @@ const resolveCompareExpr = (expr: CELExpr): CompareExpr => {
if (isNumberFactor(factor)) {
return {
operator,
- args: [factor, valueExpr.constExpr!.int64Value!],
+ args: [factor, valueExpr.constExpr!.int64Value!.toNumber()],
};
}
if (isTimestampFactor(factor)) {
@@ -146,7 +146,7 @@ const resolveCollectionExpr = (expr: CELExpr): CollectionExpr => {
args: [
factor,
valuesExpr.listExpr?.elements?.map(
- (constant) => constant.constExpr?.int64Value ?? 0
+ (constant) => constant.constExpr?.int64Value?.toNumber() ?? 0
) ?? [],
],
};
diff --git a/frontend/src/store/modules/v1/sheet.ts b/frontend/src/store/modules/v1/sheet.ts
index 3a3fd50c84..d8ec94cb8c 100644
--- a/frontend/src/store/modules/v1/sheet.ts
+++ b/frontend/src/store/modules/v1/sheet.ts
@@ -1,4 +1,5 @@
import { isEqual, isUndefined } from "lodash-es";
+import Long from "long";
import { defineStore } from "pinia";
import { computed, ref, unref, watch, watchEffect } from "vue";
import { sheetServiceClient } from "@/grpcweb";
@@ -290,7 +291,7 @@ export const useSheetAndTabStore = defineStore("sheet_and_tab", () => {
// Incomplete sheets should be read-only. e.g. 100MB sheet from issue task.、
const statement = getSheetStatement(sheet);
- if (statement.length !== sheet.contentSize) {
+ if (Long.fromNumber(statement.length).ne(sheet.contentSize)) {
return true;
}
diff --git a/frontend/src/store/modules/v1/webTerminal.ts b/frontend/src/store/modules/v1/webTerminal.ts
index 609bb98c1b..1e48904ca5 100644
--- a/frontend/src/store/modules/v1/webTerminal.ts
+++ b/frontend/src/store/modules/v1/webTerminal.ts
@@ -116,11 +116,11 @@ const createStreamingQueryController = (tab: TabInfo) => {
const payload: any = {
...request,
};
- const timeout: Duration = {
+ const timeout = Duration.fromPartial({
seconds: 60,
nanos: 0,
- };
- const seconds = timeout.seconds + timeout.nanos / 1e9;
+ });
+ const seconds = timeout.seconds.toNumber() + timeout.nanos / 1e9;
payload.timeout = `${seconds}s`;
console.debug("will send", JSON.stringify(payload));
ws.send(JSON.stringify(payload));
@@ -321,8 +321,8 @@ export const parseDuration = (str: string): Duration | undefined => {
if (Number.isNaN(totalSeconds) || totalSeconds < 0) return undefined;
const seconds = Math.floor(totalSeconds);
const nanos = (totalSeconds - seconds) * 1e9;
- return {
+ return Duration.fromPartial({
seconds,
nanos,
- };
+ });
};
diff --git a/frontend/src/types/proto/google/api/client.ts b/frontend/src/types/proto/google/api/client.ts
index ab0204283e..0ff1bec657 100644
--- a/frontend/src/types/proto/google/api/client.ts
+++ b/frontend/src/types/proto/google/api/client.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../protobuf/duration";
import { LaunchStage, launchStageFromJSON, launchStageToJSON } from "./launch_stage";
@@ -2006,10 +2007,16 @@ export const MethodSettings_LongRunning = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
index 278b3163c0..f5de03844f 100644
--- a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
+++ b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
@@ -40,7 +40,7 @@ export interface Expr {
* given expression tree. This is used to associate type information and other
* attributes to a node in the parse tree.
*/
- id: number;
+ id: Long;
/** A literal expression. */
constExpr?:
| Constant
@@ -169,7 +169,7 @@ export interface Expr_CreateStruct_Entry {
* in a given expression tree. This is used to associate type
* information and other attributes to the node.
*/
- id: number;
+ id: Long;
/** The field key for a message creator statement. */
fieldKey?:
| string
@@ -284,11 +284,11 @@ export interface Constant {
| undefined;
/** int64 value. */
int64Value?:
- | number
+ | Long
| undefined;
/** uint64 value. */
uint64Value?:
- | number
+ | Long
| undefined;
/** double value. */
doubleValue?:
@@ -347,7 +347,7 @@ export interface SourceInfo {
* A map from the parse node id (e.g. `Expr.id`) to the code point offset
* within the source.
*/
- positions: { [key: number]: number };
+ positions: { [key: Long]: number };
/**
* A map from the parse node id where a macro replacement was made to the
* call `Expr` that resulted in a macro expansion.
@@ -358,16 +358,16 @@ export interface SourceInfo {
* in the map corresponds to the expression id of the expanded macro, and the
* value is the call `Expr` that was replaced.
*/
- macroCalls: { [key: number]: Expr };
+ macroCalls: { [key: Long]: Expr };
}
export interface SourceInfo_PositionsEntry {
- key: number;
+ key: Long;
value: number;
}
export interface SourceInfo_MacroCallsEntry {
- key: number;
+ key: Long;
value: Expr | undefined;
}
@@ -465,7 +465,7 @@ export const ParsedExpr = {
function createBaseExpr(): Expr {
return {
- id: 0,
+ id: Long.ZERO,
constExpr: undefined,
identExpr: undefined,
selectExpr: undefined,
@@ -478,7 +478,7 @@ function createBaseExpr(): Expr {
export const Expr = {
encode(message: Expr, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.id !== 0) {
+ if (!message.id.isZero()) {
writer.uint32(16).int64(message.id);
}
if (message.constExpr !== undefined) {
@@ -517,7 +517,7 @@ export const Expr = {
break;
}
- message.id = longToNumber(reader.int64() as Long);
+ message.id = reader.int64() as Long;
continue;
case 3:
if (tag !== 26) {
@@ -579,7 +579,7 @@ export const Expr = {
fromJSON(object: any): Expr {
return {
- id: isSet(object.id) ? Number(object.id) : 0,
+ id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
constExpr: isSet(object.constExpr) ? Constant.fromJSON(object.constExpr) : undefined,
identExpr: isSet(object.identExpr) ? Expr_Ident.fromJSON(object.identExpr) : undefined,
selectExpr: isSet(object.selectExpr) ? Expr_Select.fromJSON(object.selectExpr) : undefined,
@@ -594,7 +594,7 @@ export const Expr = {
toJSON(message: Expr): unknown {
const obj: any = {};
- message.id !== undefined && (obj.id = Math.round(message.id));
+ message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString());
message.constExpr !== undefined &&
(obj.constExpr = message.constExpr ? Constant.toJSON(message.constExpr) : undefined);
message.identExpr !== undefined &&
@@ -619,7 +619,7 @@ export const Expr = {
fromPartial(object: DeepPartial<Expr>): Expr {
const message = createBaseExpr();
- message.id = object.id ?? 0;
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO;
message.constExpr = (object.constExpr !== undefined && object.constExpr !== null)
? Constant.fromPartial(object.constExpr)
: undefined;
@@ -1046,12 +1046,12 @@ export const Expr_CreateStruct = {
};
function createBaseExpr_CreateStruct_Entry(): Expr_CreateStruct_Entry {
- return { id: 0, fieldKey: undefined, mapKey: undefined, value: undefined, optionalEntry: false };
+ return { id: Long.ZERO, fieldKey: undefined, mapKey: undefined, value: undefined, optionalEntry: false };
}
export const Expr_CreateStruct_Entry = {
encode(message: Expr_CreateStruct_Entry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.id !== 0) {
+ if (!message.id.isZero()) {
writer.uint32(8).int64(message.id);
}
if (message.fieldKey !== undefined) {
@@ -1081,7 +1081,7 @@ export const Expr_CreateStruct_Entry = {
break;
}
- message.id = longToNumber(reader.int64() as Long);
+ message.id = reader.int64() as Long;
continue;
case 2:
if (tag !== 18) {
@@ -1122,7 +1122,7 @@ export const Expr_CreateStruct_Entry = {
fromJSON(object: any): Expr_CreateStruct_Entry {
return {
- id: isSet(object.id) ? Number(object.id) : 0,
+ id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
fieldKey: isSet(object.fieldKey) ? String(object.fieldKey) : undefined,
mapKey: isSet(object.mapKey) ? Expr.fromJSON(object.mapKey) : undefined,
value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined,
@@ -1132,7 +1132,7 @@ export const Expr_CreateStruct_Entry = {
toJSON(message: Expr_CreateStruct_Entry): unknown {
const obj: any = {};
- message.id !== undefined && (obj.id = Math.round(message.id));
+ message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString());
message.fieldKey !== undefined && (obj.fieldKey = message.fieldKey);
message.mapKey !== undefined && (obj.mapKey = message.mapKey ? Expr.toJSON(message.mapKey) : undefined);
message.value !== undefined && (obj.value = message.value ? Expr.toJSON(message.value) : undefined);
@@ -1146,7 +1146,7 @@ export const Expr_CreateStruct_Entry = {
fromPartial(object: DeepPartial<Expr_CreateStruct_Entry>): Expr_CreateStruct_Entry {
const message = createBaseExpr_CreateStruct_Entry();
- message.id = object.id ?? 0;
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO;
message.fieldKey = object.fieldKey ?? undefined;
message.mapKey = (object.mapKey !== undefined && object.mapKey !== null)
? Expr.fromPartial(object.mapKey)
@@ -1384,14 +1384,14 @@ export const Constant = {
break;
}
- message.int64Value = longToNumber(reader.int64() as Long);
+ message.int64Value = reader.int64() as Long;
continue;
case 4:
if (tag !== 32) {
break;
}
- message.uint64Value = longToNumber(reader.uint64() as Long);
+ message.uint64Value = reader.uint64() as Long;
continue;
case 5:
if (tag !== 41) {
@@ -1441,8 +1441,8 @@ export const Constant = {
return {
nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined,
- int64Value: isSet(object.int64Value) ? Number(object.int64Value) : undefined,
- uint64Value: isSet(object.uint64Value) ? Number(object.uint64Value) : undefined,
+ int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
+ uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : undefined,
stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined,
bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,
@@ -1456,8 +1456,8 @@ export const Constant = {
message.nullValue !== undefined &&
(obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined);
message.boolValue !== undefined && (obj.boolValue = message.boolValue);
- message.int64Value !== undefined && (obj.int64Value = Math.round(message.int64Value));
- message.uint64Value !== undefined && (obj.uint64Value = Math.round(message.uint64Value));
+ message.int64Value !== undefined && (obj.int64Value = (message.int64Value || undefined).toString());
+ message.uint64Value !== undefined && (obj.uint64Value = (message.uint64Value || undefined).toString());
message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue);
message.stringValue !== undefined && (obj.stringValue = message.stringValue);
message.bytesValue !== undefined &&
@@ -1476,8 +1476,12 @@ export const Constant = {
const message = createBaseConstant();
message.nullValue = object.nullValue ?? undefined;
message.boolValue = object.boolValue ?? undefined;
- message.int64Value = object.int64Value ?? undefined;
- message.uint64Value = object.uint64Value ?? undefined;
+ message.int64Value = (object.int64Value !== undefined && object.int64Value !== null)
+ ? Long.fromValue(object.int64Value)
+ : undefined;
+ message.uint64Value = (object.uint64Value !== undefined && object.uint64Value !== null)
+ ? Long.fromValue(object.uint64Value)
+ : undefined;
message.doubleValue = object.doubleValue ?? undefined;
message.stringValue = object.stringValue ?? undefined;
message.bytesValue = object.bytesValue ?? undefined;
@@ -1588,13 +1592,13 @@ export const SourceInfo = {
location: isSet(object.location) ? String(object.location) : "",
lineOffsets: Array.isArray(object?.lineOffsets) ? object.lineOffsets.map((e: any) => Number(e)) : [],
positions: isObject(object.positions)
- ? Object.entries(object.positions).reduce<{ [key: number]: number }>((acc, [key, value]) => {
+ ? Object.entries(object.positions).reduce<{ [key: Long]: number }>((acc, [key, value]) => {
acc[Number(key)] = Number(value);
return acc;
}, {})
: {},
macroCalls: isObject(object.macroCalls)
- ? Object.entries(object.macroCalls).reduce<{ [key: number]: Expr }>((acc, [key, value]) => {
+ ? Object.entries(object.macroCalls).reduce<{ [key: Long]: Expr }>((acc, [key, value]) => {
acc[Number(key)] = Expr.fromJSON(value);
return acc;
}, {})
@@ -1635,35 +1639,29 @@ export const SourceInfo = {
message.syntaxVersion = object.syntaxVersion ?? "";
message.location = object.location ?? "";
message.lineOffsets = object.lineOffsets?.map((e) => e) || [];
- message.positions = Object.entries(object.positions ?? {}).reduce<{ [key: number]: number }>(
- (acc, [key, value]) => {
- if (value !== undefined) {
- acc[Number(key)] = Number(value);
- }
- return acc;
- },
- {},
- );
- message.macroCalls = Object.entries(object.macroCalls ?? {}).reduce<{ [key: number]: Expr }>(
- (acc, [key, value]) => {
- if (value !== undefined) {
- acc[Number(key)] = Expr.fromPartial(value);
- }
- return acc;
- },
- {},
- );
+ message.positions = Object.entries(object.positions ?? {}).reduce<{ [key: Long]: number }>((acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[Number(key)] = Number(value);
+ }
+ return acc;
+ }, {});
+ message.macroCalls = Object.entries(object.macroCalls ?? {}).reduce<{ [key: Long]: Expr }>((acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[Number(key)] = Expr.fromPartial(value);
+ }
+ return acc;
+ }, {});
return message;
},
};
function createBaseSourceInfo_PositionsEntry(): SourceInfo_PositionsEntry {
- return { key: 0, value: 0 };
+ return { key: Long.ZERO, value: 0 };
}
export const SourceInfo_PositionsEntry = {
encode(message: SourceInfo_PositionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.key !== 0) {
+ if (!message.key.isZero()) {
writer.uint32(8).int64(message.key);
}
if (message.value !== 0) {
@@ -1684,7 +1682,7 @@ export const SourceInfo_PositionsEntry = {
break;
}
- message.key = longToNumber(reader.int64() as Long);
+ message.key = reader.int64() as Long;
continue;
case 2:
if (tag !== 16) {
@@ -1703,12 +1701,15 @@ export const SourceInfo_PositionsEntry = {
},
fromJSON(object: any): SourceInfo_PositionsEntry {
- return { key: isSet(object.key) ? Number(object.key) : 0, value: isSet(object.value) ? Number(object.value) : 0 };
+ return {
+ key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO,
+ value: isSet(object.value) ? Number(object.value) : 0,
+ };
},
toJSON(message: SourceInfo_PositionsEntry): unknown {
const obj: any = {};
- message.key !== undefined && (obj.key = Math.round(message.key));
+ message.key !== undefined && (obj.key = (message.key || Long.ZERO).toString());
message.value !== undefined && (obj.value = Math.round(message.value));
return obj;
},
@@ -1719,19 +1720,19 @@ export const SourceInfo_PositionsEntry = {
fromPartial(object: DeepPartial<SourceInfo_PositionsEntry>): SourceInfo_PositionsEntry {
const message = createBaseSourceInfo_PositionsEntry();
- message.key = object.key ?? 0;
+ message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO;
message.value = object.value ?? 0;
return message;
},
};
function createBaseSourceInfo_MacroCallsEntry(): SourceInfo_MacroCallsEntry {
- return { key: 0, value: undefined };
+ return { key: Long.ZERO, value: undefined };
}
export const SourceInfo_MacroCallsEntry = {
encode(message: SourceInfo_MacroCallsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.key !== 0) {
+ if (!message.key.isZero()) {
writer.uint32(8).int64(message.key);
}
if (message.value !== undefined) {
@@ -1752,7 +1753,7 @@ export const SourceInfo_MacroCallsEntry = {
break;
}
- message.key = longToNumber(reader.int64() as Long);
+ message.key = reader.int64() as Long;
continue;
case 2:
if (tag !== 18) {
@@ -1772,14 +1773,14 @@ export const SourceInfo_MacroCallsEntry = {
fromJSON(object: any): SourceInfo_MacroCallsEntry {
return {
- key: isSet(object.key) ? Number(object.key) : 0,
+ key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO,
value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined,
};
},
toJSON(message: SourceInfo_MacroCallsEntry): unknown {
const obj: any = {};
- message.key !== undefined && (obj.key = Math.round(message.key));
+ message.key !== undefined && (obj.key = (message.key || Long.ZERO).toString());
message.value !== undefined && (obj.value = message.value ? Expr.toJSON(message.value) : undefined);
return obj;
},
@@ -1790,7 +1791,7 @@ export const SourceInfo_MacroCallsEntry = {
fromPartial(object: DeepPartial<SourceInfo_MacroCallsEntry>): SourceInfo_MacroCallsEntry {
const message = createBaseSourceInfo_MacroCallsEntry();
- message.key = object.key ?? 0;
+ message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO;
message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined;
return message;
},
@@ -1940,18 +1941,19 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1966,11 +1968,8 @@ function fromJsonTimestamp(o: any): Date {
}
}
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
}
if (_m0.util.Long !== Long) {
diff --git a/frontend/src/types/proto/google/api/http.ts b/frontend/src/types/proto/google/api/http.ts
index 259368a644..1224357b4d 100644
--- a/frontend/src/types/proto/google/api/http.ts
+++ b/frontend/src/types/proto/google/api/http.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.api";
@@ -717,10 +718,16 @@ export const CustomHttpPattern = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index d3ce935221..adf5ff4af4 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -1108,8 +1108,8 @@ export interface UninterpretedOption {
* identified it as during parsing. Exactly one of these should be set.
*/
identifierValue: string;
- positiveIntValue: number;
- negativeIntValue: number;
+ positiveIntValue: Long;
+ negativeIntValue: Long;
doubleValue: number;
stringValue: Uint8Array;
aggregateValue: string;
@@ -4052,8 +4052,8 @@ function createBaseUninterpretedOption(): UninterpretedOption {
return {
name: [],
identifierValue: "",
- positiveIntValue: 0,
- negativeIntValue: 0,
+ positiveIntValue: Long.UZERO,
+ negativeIntValue: Long.ZERO,
doubleValue: 0,
stringValue: new Uint8Array(0),
aggregateValue: "",
@@ -4068,10 +4068,10 @@ export const UninterpretedOption = {
if (message.identifierValue !== "") {
writer.uint32(26).string(message.identifierValue);
}
- if (message.positiveIntValue !== 0) {
+ if (!message.positiveIntValue.isZero()) {
writer.uint32(32).uint64(message.positiveIntValue);
}
- if (message.negativeIntValue !== 0) {
+ if (!message.negativeIntValue.isZero()) {
writer.uint32(40).int64(message.negativeIntValue);
}
if (message.doubleValue !== 0) {
@@ -4112,14 +4112,14 @@ export const UninterpretedOption = {
break;
}
- message.positiveIntValue = longToNumber(reader.uint64() as Long);
+ message.positiveIntValue = reader.uint64() as Long;
continue;
case 5:
if (tag !== 40) {
break;
}
- message.negativeIntValue = longToNumber(reader.int64() as Long);
+ message.negativeIntValue = reader.int64() as Long;
continue;
case 6:
if (tag !== 49) {
@@ -4155,8 +4155,8 @@ export const UninterpretedOption = {
return {
name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) : [],
identifierValue: isSet(object.identifierValue) ? String(object.identifierValue) : "",
- positiveIntValue: isSet(object.positiveIntValue) ? Number(object.positiveIntValue) : 0,
- negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0,
+ positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO,
+ negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO,
doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0,
stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0),
aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "",
@@ -4171,8 +4171,10 @@ export const UninterpretedOption = {
obj.name = [];
}
message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue);
- message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue));
- message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue));
+ message.positiveIntValue !== undefined &&
+ (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString());
+ message.negativeIntValue !== undefined &&
+ (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString());
message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue);
message.stringValue !== undefined &&
(obj.stringValue = base64FromBytes(message.stringValue !== undefined ? message.stringValue : new Uint8Array(0)));
@@ -4188,8 +4190,12 @@ export const UninterpretedOption = {
const message = createBaseUninterpretedOption();
message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || [];
message.identifierValue = object.identifierValue ?? "";
- message.positiveIntValue = object.positiveIntValue ?? 0;
- message.negativeIntValue = object.negativeIntValue ?? 0;
+ message.positiveIntValue = (object.positiveIntValue !== undefined && object.positiveIntValue !== null)
+ ? Long.fromValue(object.positiveIntValue)
+ : Long.UZERO;
+ message.negativeIntValue = (object.negativeIntValue !== undefined && object.negativeIntValue !== null)
+ ? Long.fromValue(object.negativeIntValue)
+ : Long.ZERO;
message.doubleValue = object.doubleValue ?? 0;
message.stringValue = object.stringValue ?? new Uint8Array(0);
message.aggregateValue = object.aggregateValue ?? "";
@@ -4717,17 +4723,11 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/google/protobuf/duration.ts b/frontend/src/types/proto/google/protobuf/duration.ts
index 77dbf42e92..81da59e2cb 100644
--- a/frontend/src/types/proto/google/protobuf/duration.ts
+++ b/frontend/src/types/proto/google/protobuf/duration.ts
@@ -70,7 +70,7 @@ export interface Duration {
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
*/
- seconds: number;
+ seconds: Long;
/**
* Signed fractions of a second at nanosecond resolution of the span
* of time. Durations less than one second are represented with a 0
@@ -83,12 +83,12 @@ export interface Duration {
}
function createBaseDuration(): Duration {
- return { seconds: 0, nanos: 0 };
+ return { seconds: Long.ZERO, nanos: 0 };
}
export const Duration = {
encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.seconds !== 0) {
+ if (!message.seconds.isZero()) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
@@ -109,7 +109,7 @@ export const Duration = {
break;
}
- message.seconds = longToNumber(reader.int64() as Long);
+ message.seconds = reader.int64() as Long;
continue;
case 2:
if (tag !== 16) {
@@ -129,14 +129,14 @@ export const Duration = {
fromJSON(object: any): Duration {
return {
- seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
+ seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
};
},
toJSON(message: Duration): unknown {
const obj: any = {};
- message.seconds !== undefined && (obj.seconds = Math.round(message.seconds));
+ message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
return obj;
},
@@ -147,45 +147,22 @@ export const Duration = {
fromPartial(object: DeepPartial<Duration>): Duration {
const message = createBaseDuration();
- message.seconds = object.seconds ?? 0;
+ message.seconds = (object.seconds !== undefined && object.seconds !== null)
+ ? Long.fromValue(object.seconds)
+ : Long.ZERO;
message.nanos = object.nanos ?? 0;
return message;
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/google/protobuf/empty.ts b/frontend/src/types/proto/google/protobuf/empty.ts
index 553acad987..8c48851cd5 100644
--- a/frontend/src/types/proto/google/protobuf/empty.ts
+++ b/frontend/src/types/proto/google/protobuf/empty.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
@@ -62,6 +63,12 @@ export const Empty = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
diff --git a/frontend/src/types/proto/google/protobuf/field_mask.ts b/frontend/src/types/proto/google/protobuf/field_mask.ts
index 95026d0f0b..e513b89bfc 100644
--- a/frontend/src/types/proto/google/protobuf/field_mask.ts
+++ b/frontend/src/types/proto/google/protobuf/field_mask.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
@@ -281,6 +282,12 @@ export const FieldMask = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index 6ffbf5bb98..97cae05154 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
@@ -514,10 +515,16 @@ export const ListValue = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/google/protobuf/timestamp.ts b/frontend/src/types/proto/google/protobuf/timestamp.ts
index d37cc92c1d..a2faf65199 100644
--- a/frontend/src/types/proto/google/protobuf/timestamp.ts
+++ b/frontend/src/types/proto/google/protobuf/timestamp.ts
@@ -101,7 +101,7 @@ export interface Timestamp {
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
* 9999-12-31T23:59:59Z inclusive.
*/
- seconds: number;
+ seconds: Long;
/**
* Non-negative fractions of a second at nanosecond resolution. Negative
* second values with fractions must still have non-negative nanos values
@@ -112,12 +112,12 @@ export interface Timestamp {
}
function createBaseTimestamp(): Timestamp {
- return { seconds: 0, nanos: 0 };
+ return { seconds: Long.ZERO, nanos: 0 };
}
export const Timestamp = {
encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.seconds !== 0) {
+ if (!message.seconds.isZero()) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
@@ -138,7 +138,7 @@ export const Timestamp = {
break;
}
- message.seconds = longToNumber(reader.int64() as Long);
+ message.seconds = reader.int64() as Long;
continue;
case 2:
if (tag !== 16) {
@@ -158,14 +158,14 @@ export const Timestamp = {
fromJSON(object: any): Timestamp {
return {
- seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
+ seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
};
},
toJSON(message: Timestamp): unknown {
const obj: any = {};
- message.seconds !== undefined && (obj.seconds = Math.round(message.seconds));
+ message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
return obj;
},
@@ -176,45 +176,22 @@ export const Timestamp = {
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
const message = createBaseTimestamp();
- message.seconds = object.seconds ?? 0;
+ message.seconds = (object.seconds !== undefined && object.seconds !== null)
+ ? Long.fromValue(object.seconds)
+ : Long.ZERO;
message.nanos = object.nanos ?? 0;
return message;
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/google/protobuf/wrappers.ts b/frontend/src/types/proto/google/protobuf/wrappers.ts
index 45f6e35be7..f1aa1b49f8 100644
--- a/frontend/src/types/proto/google/protobuf/wrappers.ts
+++ b/frontend/src/types/proto/google/protobuf/wrappers.ts
@@ -31,7 +31,7 @@ export interface FloatValue {
*/
export interface Int64Value {
/** The int64 value. */
- value: number;
+ value: Long;
}
/**
@@ -41,7 +41,7 @@ export interface Int64Value {
*/
export interface UInt64Value {
/** The uint64 value. */
- value: number;
+ value: Long;
}
/**
@@ -207,12 +207,12 @@ export const FloatValue = {
};
function createBaseInt64Value(): Int64Value {
- return { value: 0 };
+ return { value: Long.ZERO };
}
export const Int64Value = {
encode(message: Int64Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.value !== 0) {
+ if (!message.value.isZero()) {
writer.uint32(8).int64(message.value);
}
return writer;
@@ -230,7 +230,7 @@ export const Int64Value = {
break;
}
- message.value = longToNumber(reader.int64() as Long);
+ message.value = reader.int64() as Long;
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -242,12 +242,12 @@ export const Int64Value = {
},
fromJSON(object: any): Int64Value {
- return { value: isSet(object.value) ? Number(object.value) : 0 };
+ return { value: isSet(object.value) ? Long.fromValue(object.value) : Long.ZERO };
},
toJSON(message: Int64Value): unknown {
const obj: any = {};
- message.value !== undefined && (obj.value = Math.round(message.value));
+ message.value !== undefined && (obj.value = (message.value || Long.ZERO).toString());
return obj;
},
@@ -257,18 +257,18 @@ export const Int64Value = {
fromPartial(object: DeepPartial<Int64Value>): Int64Value {
const message = createBaseInt64Value();
- message.value = object.value ?? 0;
+ message.value = (object.value !== undefined && object.value !== null) ? Long.fromValue(object.value) : Long.ZERO;
return message;
},
};
function createBaseUInt64Value(): UInt64Value {
- return { value: 0 };
+ return { value: Long.UZERO };
}
export const UInt64Value = {
encode(message: UInt64Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.value !== 0) {
+ if (!message.value.isZero()) {
writer.uint32(8).uint64(message.value);
}
return writer;
@@ -286,7 +286,7 @@ export const UInt64Value = {
break;
}
- message.value = longToNumber(reader.uint64() as Long);
+ message.value = reader.uint64() as Long;
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -298,12 +298,12 @@ export const UInt64Value = {
},
fromJSON(object: any): UInt64Value {
- return { value: isSet(object.value) ? Number(object.value) : 0 };
+ return { value: isSet(object.value) ? Long.fromValue(object.value) : Long.UZERO };
},
toJSON(message: UInt64Value): unknown {
const obj: any = {};
- message.value !== undefined && (obj.value = Math.round(message.value));
+ message.value !== undefined && (obj.value = (message.value || Long.UZERO).toString());
return obj;
},
@@ -313,7 +313,7 @@ export const UInt64Value = {
fromPartial(object: DeepPartial<UInt64Value>): UInt64Value {
const message = createBaseUInt64Value();
- message.value = object.value ?? 0;
+ message.value = (object.value !== undefined && object.value !== null) ? Long.fromValue(object.value) : Long.UZERO;
return message;
},
};
@@ -646,17 +646,11 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/google/type/expr.ts b/frontend/src/types/proto/google/type/expr.ts
index 51e324bc25..e41861829b 100644
--- a/frontend/src/types/proto/google/type/expr.ts
+++ b/frontend/src/types/proto/google/type/expr.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.type";
@@ -160,10 +161,16 @@ export const Expr = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/activity.ts b/frontend/src/types/proto/store/activity.ts
index 26f82a08cb..af8c9dff1b 100644
--- a/frontend/src/types/proto/store/activity.ts
+++ b/frontend/src/types/proto/store/activity.ts
@@ -33,10 +33,10 @@ export interface ActivityIssueCommentCreatePayload {
* The task with taskID in IssueID is rollbacked by the task with RollbackByTaskID in RollbackByIssueID.
*/
export interface ActivityIssueCommentCreatePayload_TaskRollbackBy {
- issueId: number;
- taskId: number;
- rollbackByIssueId: number;
- rollbackByTaskId: number;
+ issueId: Long;
+ taskId: Long;
+ rollbackByIssueId: Long;
+ rollbackByTaskId: Long;
}
export interface ActivityIssueCommentCreatePayload_ExternalApprovalEvent {
@@ -363,7 +363,7 @@ export const ActivityIssueCommentCreatePayload = {
};
function createBaseActivityIssueCommentCreatePayload_TaskRollbackBy(): ActivityIssueCommentCreatePayload_TaskRollbackBy {
- return { issueId: 0, taskId: 0, rollbackByIssueId: 0, rollbackByTaskId: 0 };
+ return { issueId: Long.ZERO, taskId: Long.ZERO, rollbackByIssueId: Long.ZERO, rollbackByTaskId: Long.ZERO };
}
export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
@@ -371,16 +371,16 @@ export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
message: ActivityIssueCommentCreatePayload_TaskRollbackBy,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
- if (message.issueId !== 0) {
+ if (!message.issueId.isZero()) {
writer.uint32(8).int64(message.issueId);
}
- if (message.taskId !== 0) {
+ if (!message.taskId.isZero()) {
writer.uint32(16).int64(message.taskId);
}
- if (message.rollbackByIssueId !== 0) {
+ if (!message.rollbackByIssueId.isZero()) {
writer.uint32(24).int64(message.rollbackByIssueId);
}
- if (message.rollbackByTaskId !== 0) {
+ if (!message.rollbackByTaskId.isZero()) {
writer.uint32(32).int64(message.rollbackByTaskId);
}
return writer;
@@ -398,28 +398,28 @@ export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
break;
}
- message.issueId = longToNumber(reader.int64() as Long);
+ message.issueId = reader.int64() as Long;
continue;
case 2:
if (tag !== 16) {
break;
}
- message.taskId = longToNumber(reader.int64() as Long);
+ message.taskId = reader.int64() as Long;
continue;
case 3:
if (tag !== 24) {
break;
}
- message.rollbackByIssueId = longToNumber(reader.int64() as Long);
+ message.rollbackByIssueId = reader.int64() as Long;
continue;
case 4:
if (tag !== 32) {
break;
}
- message.rollbackByTaskId = longToNumber(reader.int64() as Long);
+ message.rollbackByTaskId = reader.int64() as Long;
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -432,19 +432,21 @@ export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
fromJSON(object: any): ActivityIssueCommentCreatePayload_TaskRollbackBy {
return {
- issueId: isSet(object.issueId) ? Number(object.issueId) : 0,
- taskId: isSet(object.taskId) ? Number(object.taskId) : 0,
- rollbackByIssueId: isSet(object.rollbackByIssueId) ? Number(object.rollbackByIssueId) : 0,
- rollbackByTaskId: isSet(object.rollbackByTaskId) ? Number(object.rollbackByTaskId) : 0,
+ issueId: isSet(object.issueId) ? Long.fromValue(object.issueId) : Long.ZERO,
+ taskId: isSet(object.taskId) ? Long.fromValue(object.taskId) : Long.ZERO,
+ rollbackByIssueId: isSet(object.rollbackByIssueId) ? Long.fromValue(object.rollbackByIssueId) : Long.ZERO,
+ rollbackByTaskId: isSet(object.rollbackByTaskId) ? Long.fromValue(object.rollbackByTaskId) : Long.ZERO,
};
},
toJSON(message: ActivityIssueCommentCreatePayload_TaskRollbackBy): unknown {
const obj: any = {};
- message.issueId !== undefined && (obj.issueId = Math.round(message.issueId));
- message.taskId !== undefined && (obj.taskId = Math.round(message.taskId));
- message.rollbackByIssueId !== undefined && (obj.rollbackByIssueId = Math.round(message.rollbackByIssueId));
- message.rollbackByTaskId !== undefined && (obj.rollbackByTaskId = Math.round(message.rollbackByTaskId));
+ message.issueId !== undefined && (obj.issueId = (message.issueId || Long.ZERO).toString());
+ message.taskId !== undefined && (obj.taskId = (message.taskId || Long.ZERO).toString());
+ message.rollbackByIssueId !== undefined &&
+ (obj.rollbackByIssueId = (message.rollbackByIssueId || Long.ZERO).toString());
+ message.rollbackByTaskId !== undefined &&
+ (obj.rollbackByTaskId = (message.rollbackByTaskId || Long.ZERO).toString());
return obj;
},
@@ -458,10 +460,18 @@ export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
object: DeepPartial<ActivityIssueCommentCreatePayload_TaskRollbackBy>,
): ActivityIssueCommentCreatePayload_TaskRollbackBy {
const message = createBaseActivityIssueCommentCreatePayload_TaskRollbackBy();
- message.issueId = object.issueId ?? 0;
- message.taskId = object.taskId ?? 0;
- message.rollbackByIssueId = object.rollbackByIssueId ?? 0;
- message.rollbackByTaskId = object.rollbackByTaskId ?? 0;
+ message.issueId = (object.issueId !== undefined && object.issueId !== null)
+ ? Long.fromValue(object.issueId)
+ : Long.ZERO;
+ message.taskId = (object.taskId !== undefined && object.taskId !== null)
+ ? Long.fromValue(object.taskId)
+ : Long.ZERO;
+ message.rollbackByIssueId = (object.rollbackByIssueId !== undefined && object.rollbackByIssueId !== null)
+ ? Long.fromValue(object.rollbackByIssueId)
+ : Long.ZERO;
+ message.rollbackByTaskId = (object.rollbackByTaskId !== undefined && object.rollbackByTaskId !== null)
+ ? Long.fromValue(object.rollbackByTaskId)
+ : Long.ZERO;
return message;
},
};
@@ -686,39 +696,14 @@ export const ActivityIssueApprovalNotifyPayload = {
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/store/approval.ts b/frontend/src/types/proto/store/approval.ts
index ddeec313ee..d6cec8f598 100644
--- a/frontend/src/types/proto/store/approval.ts
+++ b/frontend/src/types/proto/store/approval.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -754,10 +755,16 @@ export const ApprovalNode = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/changelist.ts b/frontend/src/types/proto/store/changelist.ts
index 0de5b80c27..69503ef7e7 100644
--- a/frontend/src/types/proto/store/changelist.ts
+++ b/frontend/src/types/proto/store/changelist.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -169,10 +170,16 @@ export const Changelist_Change = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/common.ts b/frontend/src/types/proto/store/common.ts
index d3fa33b4b7..f7d0ece56b 100644
--- a/frontend/src/types/proto/store/common.ts
+++ b/frontend/src/types/proto/store/common.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -302,10 +303,16 @@ export const PageToken = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/data_source.ts b/frontend/src/types/proto/store/data_source.ts
index 54fca1398b..9c73329e0c 100644
--- a/frontend/src/types/proto/store/data_source.ts
+++ b/frontend/src/types/proto/store/data_source.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -201,10 +202,16 @@ export const DataSourceOptions = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/database.ts b/frontend/src/types/proto/store/database.ts
index 93543be10a..ec071d2462 100644
--- a/frontend/src/types/proto/store/database.ts
+++ b/frontend/src/types/proto/store/database.ts
@@ -231,13 +231,13 @@ export interface TableMetadata {
/** The collation is the collation of a table. */
collation: string;
/** The row_count is the estimated number of rows of a table. */
- rowCount: number;
+ rowCount: Long;
/** The data_size is the estimated data size of a table. */
- dataSize: number;
+ dataSize: Long;
/** The index_size is the estimated index size of a table. */
- indexSize: number;
+ indexSize: Long;
/** The data_free is the estimated free data size of a table. */
- dataFree: number;
+ dataFree: Long;
/** The create_options is the create option of a table. */
createOptions: string;
/**
@@ -1224,10 +1224,10 @@ function createBaseTableMetadata(): TableMetadata {
indexes: [],
engine: "",
collation: "",
- rowCount: 0,
- dataSize: 0,
- indexSize: 0,
- dataFree: 0,
+ rowCount: Long.ZERO,
+ dataSize: Long.ZERO,
+ indexSize: Long.ZERO,
+ dataFree: Long.ZERO,
createOptions: "",
comment: "",
classification: "",
@@ -1253,16 +1253,16 @@ export const TableMetadata = {
if (message.collation !== "") {
writer.uint32(42).string(message.collation);
}
- if (message.rowCount !== 0) {
+ if (!message.rowCount.isZero()) {
writer.uint32(48).int64(message.rowCount);
}
- if (message.dataSize !== 0) {
+ if (!message.dataSize.isZero()) {
writer.uint32(56).int64(message.dataSize);
}
- if (message.indexSize !== 0) {
+ if (!message.indexSize.isZero()) {
writer.uint32(64).int64(message.indexSize);
}
- if (message.dataFree !== 0) {
+ if (!message.dataFree.isZero()) {
writer.uint32(72).int64(message.dataFree);
}
if (message.createOptions !== "") {
@@ -1330,28 +1330,28 @@ export const TableMetadata = {
break;
}
- message.rowCount = longToNumber(reader.int64() as Long);
+ message.rowCount = reader.int64() as Long;
continue;
case 7:
if (tag !== 56) {
break;
}
- message.dataSize = longToNumber(reader.int64() as Long);
+ message.dataSize = reader.int64() as Long;
continue;
case 8:
if (tag !== 64) {
break;
}
- message.indexSize = longToNumber(reader.int64() as Long);
+ message.indexSize = reader.int64() as Long;
continue;
case 9:
if (tag !== 72) {
break;
}
- message.dataFree = longToNumber(reader.int64() as Long);
+ message.dataFree = reader.int64() as Long;
continue;
case 10:
if (tag !== 82) {
@@ -1404,10 +1404,10 @@ export const TableMetadata = {
indexes: Array.isArray(object?.indexes) ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e)) : [],
engine: isSet(object.engine) ? String(object.engine) : "",
collation: isSet(object.collation) ? String(object.collation) : "",
- rowCount: isSet(object.rowCount) ? Number(object.rowCount) : 0,
- dataSize: isSet(object.dataSize) ? Number(object.dataSize) : 0,
- indexSize: isSet(object.indexSize) ? Number(object.indexSize) : 0,
- dataFree: isSet(object.dataFree) ? Number(object.dataFree) : 0,
+ rowCount: isSet(object.rowCount) ? Long.fromValue(object.rowCount) : Long.ZERO,
+ dataSize: isSet(object.dataSize) ? Long.fromValue(object.dataSize) : Long.ZERO,
+ indexSize: isSet(object.indexSize) ? Long.fromValue(object.indexSize) : Long.ZERO,
+ dataFree: isSet(object.dataFree) ? Long.fromValue(object.dataFree) : Long.ZERO,
createOptions: isSet(object.createOptions) ? String(object.createOptions) : "",
comment: isSet(object.comment) ? String(object.comment) : "",
classification: isSet(object.classification) ? String(object.classification) : "",
@@ -1433,10 +1433,10 @@ export const TableMetadata = {
}
message.engine !== undefined && (obj.engine = message.engine);
message.collation !== undefined && (obj.collation = message.collation);
- message.rowCount !== undefined && (obj.rowCount = Math.round(message.rowCount));
- message.dataSize !== undefined && (obj.dataSize = Math.round(message.dataSize));
- message.indexSize !== undefined && (obj.indexSize = Math.round(message.indexSize));
- message.dataFree !== undefined && (obj.dataFree = Math.round(message.dataFree));
+ message.rowCount !== undefined && (obj.rowCount = (message.rowCount || Long.ZERO).toString());
+ message.dataSize !== undefined && (obj.dataSize = (message.dataSize || Long.ZERO).toString());
+ message.indexSize !== undefined && (obj.indexSize = (message.indexSize || Long.ZERO).toString());
+ message.dataFree !== undefined && (obj.dataFree = (message.dataFree || Long.ZERO).toString());
message.createOptions !== undefined && (obj.createOptions = message.createOptions);
message.comment !== undefined && (obj.comment = message.comment);
message.classification !== undefined && (obj.classification = message.classification);
@@ -1460,10 +1460,18 @@ export const TableMetadata = {
message.indexes = object.indexes?.map((e) => IndexMetadata.fromPartial(e)) || [];
message.engine = object.engine ?? "";
message.collation = object.collation ?? "";
- message.rowCount = object.rowCount ?? 0;
- message.dataSize = object.dataSize ?? 0;
- message.indexSize = object.indexSize ?? 0;
- message.dataFree = object.dataFree ?? 0;
+ message.rowCount = (object.rowCount !== undefined && object.rowCount !== null)
+ ? Long.fromValue(object.rowCount)
+ : Long.ZERO;
+ message.dataSize = (object.dataSize !== undefined && object.dataSize !== null)
+ ? Long.fromValue(object.dataSize)
+ : Long.ZERO;
+ message.indexSize = (object.indexSize !== undefined && object.indexSize !== null)
+ ? Long.fromValue(object.indexSize)
+ : Long.ZERO;
+ message.dataFree = (object.dataFree !== undefined && object.dataFree !== null)
+ ? Long.fromValue(object.dataFree)
+ : Long.ZERO;
message.createOptions = object.createOptions ?? "";
message.comment = object.comment ?? "";
message.classification = object.classification ?? "";
@@ -2966,40 +2974,22 @@ export const ColumnConfig_LabelsEntry = {
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -3014,11 +3004,8 @@ function fromJsonTimestamp(o: any): Date {
}
}
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
}
if (_m0.util.Long !== Long) {
diff --git a/frontend/src/types/proto/store/idp.ts b/frontend/src/types/proto/store/idp.ts
index da617075d9..d93507855d 100644
--- a/frontend/src/types/proto/store/idp.ts
+++ b/frontend/src/types/proto/store/idp.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -965,10 +966,16 @@ export const IdentityProviderUserInfo = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/instance.ts b/frontend/src/types/proto/store/instance.ts
index 636794dd7a..fc93f1cc01 100644
--- a/frontend/src/types/proto/store/instance.ts
+++ b/frontend/src/types/proto/store/instance.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -175,18 +176,19 @@ export const InstanceMetadata = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -201,6 +203,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/instance_change_history.ts b/frontend/src/types/proto/store/instance_change_history.ts
index 900ec542b7..a5cc840925 100644
--- a/frontend/src/types/proto/store/instance_change_history.ts
+++ b/frontend/src/types/proto/store/instance_change_history.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { PushEvent } from "./vcs";
@@ -377,10 +378,16 @@ export const ChangedResourceTable = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/issue.ts b/frontend/src/types/proto/store/issue.ts
index 4999aa9ac9..963e7c70b1 100644
--- a/frontend/src/types/proto/store/issue.ts
+++ b/frontend/src/types/proto/store/issue.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Expr } from "../google/type/expr";
@@ -208,10 +209,16 @@ export const GrantRequest = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/plan.ts b/frontend/src/types/proto/store/plan.ts
index 9e68e40acc..638a640f0f 100644
--- a/frontend/src/types/proto/store/plan.ts
+++ b/frontend/src/types/proto/store/plan.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -1165,18 +1166,19 @@ export const PlanConfig_RestoreDatabaseConfig = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1191,6 +1193,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.ts
index 3c38010ee7..31f0e92cb0 100644
--- a/frontend/src/types/proto/store/plan_check_run.ts
+++ b/frontend/src/types/proto/store/plan_check_run.ts
@@ -11,7 +11,7 @@ export interface PlanCheckRunConfig {
instanceUid: number;
databaseName: string;
/** database_group_uid is optional. If it's set, it means the database is part of a database group. */
- databaseGroupUid?: number | undefined;
+ databaseGroupUid?: Long | undefined;
ghostFlags: { [key: string]: string };
}
@@ -214,7 +214,7 @@ export const PlanCheckRunConfig = {
break;
}
- message.databaseGroupUid = longToNumber(reader.int64() as Long);
+ message.databaseGroupUid = reader.int64() as Long;
continue;
case 6:
if (tag !== 50) {
@@ -243,7 +243,7 @@ export const PlanCheckRunConfig = {
: 0,
instanceUid: isSet(object.instanceUid) ? Number(object.instanceUid) : 0,
databaseName: isSet(object.databaseName) ? String(object.databaseName) : "",
- databaseGroupUid: isSet(object.databaseGroupUid) ? Number(object.databaseGroupUid) : undefined,
+ databaseGroupUid: isSet(object.databaseGroupUid) ? Long.fromValue(object.databaseGroupUid) : undefined,
ghostFlags: isObject(object.ghostFlags)
? Object.entries(object.ghostFlags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
acc[key] = String(value);
@@ -260,7 +260,8 @@ export const PlanCheckRunConfig = {
(obj.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeToJSON(message.changeDatabaseType));
message.instanceUid !== undefined && (obj.instanceUid = Math.round(message.instanceUid));
message.databaseName !== undefined && (obj.databaseName = message.databaseName);
- message.databaseGroupUid !== undefined && (obj.databaseGroupUid = Math.round(message.databaseGroupUid));
+ message.databaseGroupUid !== undefined &&
+ (obj.databaseGroupUid = (message.databaseGroupUid || undefined).toString());
obj.ghostFlags = {};
if (message.ghostFlags) {
Object.entries(message.ghostFlags).forEach(([k, v]) => {
@@ -280,7 +281,9 @@ export const PlanCheckRunConfig = {
message.changeDatabaseType = object.changeDatabaseType ?? 0;
message.instanceUid = object.instanceUid ?? 0;
message.databaseName = object.databaseName ?? "";
- message.databaseGroupUid = object.databaseGroupUid ?? undefined;
+ message.databaseGroupUid = (object.databaseGroupUid !== undefined && object.databaseGroupUid !== null)
+ ? Long.fromValue(object.databaseGroupUid)
+ : undefined;
message.ghostFlags = Object.entries(object.ghostFlags ?? {}).reduce<{ [key: string]: string }>(
(acc, [key, value]) => {
if (value !== undefined) {
@@ -779,39 +782,14 @@ export const PlanCheckRunResult_Result_SqlReviewReport = {
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/store/policy.ts b/frontend/src/types/proto/store/policy.ts
index 57eb37a536..9a73497cdc 100644
--- a/frontend/src/types/proto/store/policy.ts
+++ b/frontend/src/types/proto/store/policy.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Expr } from "../google/type/expr";
import { Engine, engineFromJSON, engineToJSON, MaskingLevel, maskingLevelFromJSON, maskingLevelToJSON } from "./common";
@@ -1145,10 +1146,16 @@ export const SQLReviewRule = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/project.ts b/frontend/src/types/proto/store/project.ts
index d31549e01a..6306a90700 100644
--- a/frontend/src/types/proto/store/project.ts
+++ b/frontend/src/types/proto/store/project.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -230,10 +231,16 @@ export const ProtectionRule = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/setting.ts b/frontend/src/types/proto/store/setting.ts
index 1eaa722e6c..c441c4986d 100644
--- a/frontend/src/types/proto/store/setting.ts
+++ b/frontend/src/types/proto/store/setting.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";
import { Duration } from "../google/protobuf/duration";
@@ -2787,10 +2788,16 @@ export const MaskingAlgorithmSetting_Algorithm_MD5Mask = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/store/sheet.ts b/frontend/src/types/proto/store/sheet.ts
index d771b211a7..eac5be8e44 100644
--- a/frontend/src/types/proto/store/sheet.ts
+++ b/frontend/src/types/proto/store/sheet.ts
@@ -58,10 +58,10 @@ export function sheetPayload_TypeToJSON(object: SheetPayload_Type): string {
export interface SheetPayload_VCSPayload {
fileName: string;
filePath: string;
- size: number;
+ size: Long;
author: string;
lastCommitId: string;
- lastSyncTs: number;
+ lastSyncTs: Long;
pushEvent: PushEvent | undefined;
}
@@ -259,7 +259,15 @@ export const SheetPayload = {
};
function createBaseSheetPayload_VCSPayload(): SheetPayload_VCSPayload {
- return { fileName: "", filePath: "", size: 0, author: "", lastCommitId: "", lastSyncTs: 0, pushEvent: undefined };
+ return {
+ fileName: "",
+ filePath: "",
+ size: Long.ZERO,
+ author: "",
+ lastCommitId: "",
+ lastSyncTs: Long.ZERO,
+ pushEvent: undefined,
+ };
}
export const SheetPayload_VCSPayload = {
@@ -270,7 +278,7 @@ export const SheetPayload_VCSPayload = {
if (message.filePath !== "") {
writer.uint32(18).string(message.filePath);
}
- if (message.size !== 0) {
+ if (!message.size.isZero()) {
writer.uint32(24).int64(message.size);
}
if (message.author !== "") {
@@ -279,7 +287,7 @@ export const SheetPayload_VCSPayload = {
if (message.lastCommitId !== "") {
writer.uint32(42).string(message.lastCommitId);
}
- if (message.lastSyncTs !== 0) {
+ if (!message.lastSyncTs.isZero()) {
writer.uint32(48).int64(message.lastSyncTs);
}
if (message.pushEvent !== undefined) {
@@ -314,7 +322,7 @@ export const SheetPayload_VCSPayload = {
break;
}
- message.size = longToNumber(reader.int64() as Long);
+ message.size = reader.int64() as Long;
continue;
case 4:
if (tag !== 34) {
@@ -335,7 +343,7 @@ export const SheetPayload_VCSPayload = {
break;
}
- message.lastSyncTs = longToNumber(reader.int64() as Long);
+ message.lastSyncTs = reader.int64() as Long;
continue;
case 7:
if (tag !== 58) {
@@ -357,10 +365,10 @@ export const SheetPayload_VCSPayload = {
return {
fileName: isSet(object.fileName) ? String(object.fileName) : "",
filePath: isSet(object.filePath) ? String(object.filePath) : "",
- size: isSet(object.size) ? Number(object.size) : 0,
+ size: isSet(object.size) ? Long.fromValue(object.size) : Long.ZERO,
author: isSet(object.author) ? String(object.author) : "",
lastCommitId: isSet(object.lastCommitId) ? String(object.lastCommitId) : "",
- lastSyncTs: isSet(object.lastSyncTs) ? Number(object.lastSyncTs) : 0,
+ lastSyncTs: isSet(object.lastSyncTs) ? Long.fromValue(object.lastSyncTs) : Long.ZERO,
pushEvent: isSet(object.pushEvent) ? PushEvent.fromJSON(object.pushEvent) : undefined,
};
},
@@ -369,10 +377,10 @@ export const SheetPayload_VCSPayload = {
const obj: any = {};
message.fileName !== undefined && (obj.fileName = message.fileName);
message.filePath !== undefined && (obj.filePath = message.filePath);
- message.size !== undefined && (obj.size = Math.round(message.size));
+ message.size !== undefined && (obj.size = (message.size || Long.ZERO).toString());
message.author !== undefined && (obj.author = message.author);
message.lastCommitId !== undefined && (obj.lastCommitId = message.lastCommitId);
- message.lastSyncTs !== undefined && (obj.lastSyncTs = Math.round(message.lastSyncTs));
+ message.lastSyncTs !== undefined && (obj.lastSyncTs = (message.lastSyncTs || Long.ZERO).toString());
message.pushEvent !== undefined &&
(obj.pushEvent = message.pushEvent ? PushEvent.toJSON(message.pushEvent) : undefined);
return obj;
@@ -386,10 +394,12 @@ export const SheetPayload_VCSPayload = {
const message = createBaseSheetPayload_VCSPayload();
message.fileName = object.fileName ?? "";
message.filePath = object.filePath ?? "";
- message.size = object.size ?? 0;
+ message.size = (object.size !== undefined && object.size !== null) ? Long.fromValue(object.size) : Long.ZERO;
message.author = object.author ?? "";
message.lastCommitId = object.lastCommitId ?? "";
- message.lastSyncTs = object.lastSyncTs ?? 0;
+ message.lastSyncTs = (object.lastSyncTs !== undefined && object.lastSyncTs !== null)
+ ? Long.fromValue(object.lastSyncTs)
+ : Long.ZERO;
message.pushEvent = (object.pushEvent !== undefined && object.pushEvent !== null)
? PushEvent.fromPartial(object.pushEvent)
: undefined;
@@ -590,39 +600,14 @@ export const SheetPayload_SchemaDesign_Protection = {
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/store/slow_query.ts b/frontend/src/types/proto/store/slow_query.ts
index cd2f1c73d8..d9cb957d2e 100644
--- a/frontend/src/types/proto/store/slow_query.ts
+++ b/frontend/src/types/proto/store/slow_query.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -452,18 +453,19 @@ export const SlowQueryDetails = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -478,6 +480,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/task_run.ts b/frontend/src/types/proto/store/task_run.ts
index c0d8a309a5..cd2a61c6d4 100644
--- a/frontend/src/types/proto/store/task_run.ts
+++ b/frontend/src/types/proto/store/task_run.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -97,10 +98,16 @@ export const TaskRunResult = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/user.ts b/frontend/src/types/proto/store/user.ts
index e41dc1d8e0..cd71a14e54 100644
--- a/frontend/src/types/proto/store/user.ts
+++ b/frontend/src/types/proto/store/user.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
@@ -125,10 +126,16 @@ export const MFAConfig = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/store/vcs.ts b/frontend/src/types/proto/store/vcs.ts
index f598c2b562..3a16a1a58f 100644
--- a/frontend/src/types/proto/store/vcs.ts
+++ b/frontend/src/types/proto/store/vcs.ts
@@ -23,7 +23,7 @@ export interface Commit {
id: string;
title: string;
message: string;
- createdTs: number;
+ createdTs: Long;
url: string;
authorName: string;
authorEmail: string;
@@ -35,7 +35,7 @@ export interface FileCommit {
id: string;
title: string;
message: string;
- createdTs: number;
+ createdTs: Long;
url: string;
authorName: string;
authorEmail: string;
@@ -254,7 +254,7 @@ function createBaseCommit(): Commit {
id: "",
title: "",
message: "",
- createdTs: 0,
+ createdTs: Long.ZERO,
url: "",
authorName: "",
authorEmail: "",
@@ -274,7 +274,7 @@ export const Commit = {
if (message.message !== "") {
writer.uint32(26).string(message.message);
}
- if (message.createdTs !== 0) {
+ if (!message.createdTs.isZero()) {
writer.uint32(32).int64(message.createdTs);
}
if (message.url !== "") {
@@ -328,7 +328,7 @@ export const Commit = {
break;
}
- message.createdTs = longToNumber(reader.int64() as Long);
+ message.createdTs = reader.int64() as Long;
continue;
case 5:
if (tag !== 42) {
@@ -379,7 +379,7 @@ export const Commit = {
id: isSet(object.id) ? String(object.id) : "",
title: isSet(object.title) ? String(object.title) : "",
message: isSet(object.message) ? String(object.message) : "",
- createdTs: isSet(object.createdTs) ? Number(object.createdTs) : 0,
+ createdTs: isSet(object.createdTs) ? Long.fromValue(object.createdTs) : Long.ZERO,
url: isSet(object.url) ? String(object.url) : "",
authorName: isSet(object.authorName) ? String(object.authorName) : "",
authorEmail: isSet(object.authorEmail) ? String(object.authorEmail) : "",
@@ -393,7 +393,7 @@ export const Commit = {
message.id !== undefined && (obj.id = message.id);
message.title !== undefined && (obj.title = message.title);
message.message !== undefined && (obj.message = message.message);
- message.createdTs !== undefined && (obj.createdTs = Math.round(message.createdTs));
+ message.createdTs !== undefined && (obj.createdTs = (message.createdTs || Long.ZERO).toString());
message.url !== undefined && (obj.url = message.url);
message.authorName !== undefined && (obj.authorName = message.authorName);
message.authorEmail !== undefined && (obj.authorEmail = message.authorEmail);
@@ -419,7 +419,9 @@ export const Commit = {
message.id = object.id ?? "";
message.title = object.title ?? "";
message.message = object.message ?? "";
- message.createdTs = object.createdTs ?? 0;
+ message.createdTs = (object.createdTs !== undefined && object.createdTs !== null)
+ ? Long.fromValue(object.createdTs)
+ : Long.ZERO;
message.url = object.url ?? "";
message.authorName = object.authorName ?? "";
message.authorEmail = object.authorEmail ?? "";
@@ -430,7 +432,7 @@ export const Commit = {
};
function createBaseFileCommit(): FileCommit {
- return { id: "", title: "", message: "", createdTs: 0, url: "", authorName: "", authorEmail: "", added: "" };
+ return { id: "", title: "", message: "", createdTs: Long.ZERO, url: "", authorName: "", authorEmail: "", added: "" };
}
export const FileCommit = {
@@ -444,7 +446,7 @@ export const FileCommit = {
if (message.message !== "") {
writer.uint32(26).string(message.message);
}
- if (message.createdTs !== 0) {
+ if (!message.createdTs.isZero()) {
writer.uint32(32).int64(message.createdTs);
}
if (message.url !== "") {
@@ -495,7 +497,7 @@ export const FileCommit = {
break;
}
- message.createdTs = longToNumber(reader.int64() as Long);
+ message.createdTs = reader.int64() as Long;
continue;
case 5:
if (tag !== 42) {
@@ -539,7 +541,7 @@ export const FileCommit = {
id: isSet(object.id) ? String(object.id) : "",
title: isSet(object.title) ? String(object.title) : "",
message: isSet(object.message) ? String(object.message) : "",
- createdTs: isSet(object.createdTs) ? Number(object.createdTs) : 0,
+ createdTs: isSet(object.createdTs) ? Long.fromValue(object.createdTs) : Long.ZERO,
url: isSet(object.url) ? String(object.url) : "",
authorName: isSet(object.authorName) ? String(object.authorName) : "",
authorEmail: isSet(object.authorEmail) ? String(object.authorEmail) : "",
@@ -552,7 +554,7 @@ export const FileCommit = {
message.id !== undefined && (obj.id = message.id);
message.title !== undefined && (obj.title = message.title);
message.message !== undefined && (obj.message = message.message);
- message.createdTs !== undefined && (obj.createdTs = Math.round(message.createdTs));
+ message.createdTs !== undefined && (obj.createdTs = (message.createdTs || Long.ZERO).toString());
message.url !== undefined && (obj.url = message.url);
message.authorName !== undefined && (obj.authorName = message.authorName);
message.authorEmail !== undefined && (obj.authorEmail = message.authorEmail);
@@ -569,7 +571,9 @@ export const FileCommit = {
message.id = object.id ?? "";
message.title = object.title ?? "";
message.message = object.message ?? "";
- message.createdTs = object.createdTs ?? 0;
+ message.createdTs = (object.createdTs !== undefined && object.createdTs !== null)
+ ? Long.fromValue(object.createdTs)
+ : Long.ZERO;
message.url = object.url ?? "";
message.authorName = object.authorName ?? "";
message.authorEmail = object.authorEmail ?? "";
@@ -578,39 +582,14 @@ export const FileCommit = {
},
};
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
index 34d64ab9cb..b52bedf6ef 100644
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ b/frontend/src/types/proto/v1/actuator_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -939,18 +940,19 @@ export const ActuatorServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -965,6 +967,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/anomaly_service.ts b/frontend/src/types/proto/v1/anomaly_service.ts
index c0a8376f1b..14ad9b67e3 100644
--- a/frontend/src/types/proto/v1/anomaly_service.ts
+++ b/frontend/src/types/proto/v1/anomaly_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
import { BackupPlanSchedule, backupPlanScheduleFromJSON, backupPlanScheduleToJSON } from "./org_policy_service";
@@ -1041,18 +1042,19 @@ export const AnomalyServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1067,6 +1069,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 3a720230f3..90c3a87325 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -1685,10 +1686,16 @@ export const AuthServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/bookmark_service.ts b/frontend/src/types/proto/v1/bookmark_service.ts
index 4aafbefccf..bd6e90ad81 100644
--- a/frontend/src/types/proto/v1/bookmark_service.ts
+++ b/frontend/src/types/proto/v1/bookmark_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
@@ -516,10 +517,16 @@ export const BookmarkServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/cel_service.ts b/frontend/src/types/proto/v1/cel_service.ts
index e120914403..47740b01b3 100644
--- a/frontend/src/types/proto/v1/cel_service.ts
+++ b/frontend/src/types/proto/v1/cel_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";
@@ -355,6 +356,12 @@ export const CelServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
diff --git a/frontend/src/types/proto/v1/changelist_service.ts b/frontend/src/types/proto/v1/changelist_service.ts
index b8ab2a1e2e..086ba7568b 100644
--- a/frontend/src/types/proto/v1/changelist_service.ts
+++ b/frontend/src/types/proto/v1/changelist_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -1122,18 +1123,19 @@ export const ChangelistServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1148,6 +1150,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index 1cd8de126b..fa917f3676 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -449,13 +449,13 @@ export interface TableMetadata {
/** The collation is the collation of a table. */
collation: string;
/** The row_count is the estimated number of rows of a table. */
- rowCount: number;
+ rowCount: Long;
/** The data_size is the estimated data size of a table. */
- dataSize: number;
+ dataSize: Long;
/** The index_size is the estimated index size of a table. */
- indexSize: number;
+ indexSize: Long;
/** The data_free is the estimated free data size of a table. */
- dataFree: number;
+ dataFree: Long;
/** The create_options is the create option of a table. */
createOptions: string;
/**
@@ -3417,10 +3417,10 @@ function createBaseTableMetadata(): TableMetadata {
indexes: [],
engine: "",
collation: "",
- rowCount: 0,
- dataSize: 0,
- indexSize: 0,
- dataFree: 0,
+ rowCount: Long.ZERO,
+ dataSize: Long.ZERO,
+ indexSize: Long.ZERO,
+ dataFree: Long.ZERO,
createOptions: "",
comment: "",
classification: "",
@@ -3446,16 +3446,16 @@ export const TableMetadata = {
if (message.collation !== "") {
writer.uint32(42).string(message.collation);
}
- if (message.rowCount !== 0) {
+ if (!message.rowCount.isZero()) {
writer.uint32(48).int64(message.rowCount);
}
- if (message.dataSize !== 0) {
+ if (!message.dataSize.isZero()) {
writer.uint32(56).int64(message.dataSize);
}
- if (message.indexSize !== 0) {
+ if (!message.indexSize.isZero()) {
writer.uint32(64).int64(message.indexSize);
}
- if (message.dataFree !== 0) {
+ if (!message.dataFree.isZero()) {
writer.uint32(72).int64(message.dataFree);
}
if (message.createOptions !== "") {
@@ -3523,28 +3523,28 @@ export const TableMetadata = {
break;
}
- message.rowCount = longToNumber(reader.int64() as Long);
+ message.rowCount = reader.int64() as Long;
continue;
case 7:
if (tag !== 56) {
break;
}
- message.dataSize = longToNumber(reader.int64() as Long);
+ message.dataSize = reader.int64() as Long;
continue;
case 8:
if (tag !== 64) {
break;
}
- message.indexSize = longToNumber(reader.int64() as Long);
+ message.indexSize = reader.int64() as Long;
continue;
case 9:
if (tag !== 72) {
break;
}
- message.dataFree = longToNumber(reader.int64() as Long);
+ message.dataFree = reader.int64() as Long;
continue;
case 10:
if (tag !== 82) {
@@ -3597,10 +3597,10 @@ export const TableMetadata = {
indexes: Array.isArray(object?.indexes) ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e)) : [],
engine: isSet(object.engine) ? String(object.engine) : "",
collation: isSet(object.collation) ? String(object.collation) : "",
- rowCount: isSet(object.rowCount) ? Number(object.rowCount) : 0,
- dataSize: isSet(object.dataSize) ? Number(object.dataSize) : 0,
- indexSize: isSet(object.indexSize) ? Number(object.indexSize) : 0,
- dataFree: isSet(object.dataFree) ? Number(object.dataFree) : 0,
+ rowCount: isSet(object.rowCount) ? Long.fromValue(object.rowCount) : Long.ZERO,
+ dataSize: isSet(object.dataSize) ? Long.fromValue(object.dataSize) : Long.ZERO,
+ indexSize: isSet(object.indexSize) ? Long.fromValue(object.indexSize) : Long.ZERO,
+ dataFree: isSet(object.dataFree) ? Long.fromValue(object.dataFree) : Long.ZERO,
createOptions: isSet(object.createOptions) ? String(object.createOptions) : "",
comment: isSet(object.comment) ? String(object.comment) : "",
classification: isSet(object.classification) ? String(object.classification) : "",
@@ -3626,10 +3626,10 @@ export const TableMetadata = {
}
message.engine !== undefined && (obj.engine = message.engine);
message.collation !== undefined && (obj.collation = message.collation);
- message.rowCount !== undefined && (obj.rowCount = Math.round(message.rowCount));
- message.dataSize !== undefined && (obj.dataSize = Math.round(message.dataSize));
- message.indexSize !== undefined && (obj.indexSize = Math.round(message.indexSize));
- message.dataFree !== undefined && (obj.dataFree = Math.round(message.dataFree));
+ message.rowCount !== undefined && (obj.rowCount = (message.rowCount || Long.ZERO).toString());
+ message.dataSize !== undefined && (obj.dataSize = (message.dataSize || Long.ZERO).toString());
+ message.indexSize !== undefined && (obj.indexSize = (message.indexSize || Long.ZERO).toString());
+ message.dataFree !== undefined && (obj.dataFree = (message.dataFree || Long.ZERO).toString());
message.createOptions !== undefined && (obj.createOptions = message.createOptions);
message.comment !== undefined && (obj.comment = message.comment);
message.classification !== undefined && (obj.classification = message.classification);
@@ -3653,10 +3653,18 @@ export const TableMetadata = {
message.indexes = object.indexes?.map((e) => IndexMetadata.fromPartial(e)) || [];
message.engine = object.engine ?? "";
message.collation = object.collation ?? "";
- message.rowCount = object.rowCount ?? 0;
- message.dataSize = object.dataSize ?? 0;
- message.indexSize = object.indexSize ?? 0;
- message.dataFree = object.dataFree ?? 0;
+ message.rowCount = (object.rowCount !== undefined && object.rowCount !== null)
+ ? Long.fromValue(object.rowCount)
+ : Long.ZERO;
+ message.dataSize = (object.dataSize !== undefined && object.dataSize !== null)
+ ? Long.fromValue(object.dataSize)
+ : Long.ZERO;
+ message.indexSize = (object.indexSize !== undefined && object.indexSize !== null)
+ ? Long.fromValue(object.indexSize)
+ : Long.ZERO;
+ message.dataFree = (object.dataFree !== undefined && object.dataFree !== null)
+ ? Long.fromValue(object.dataFree)
+ : Long.ZERO;
message.createOptions = object.createOptions ?? "";
message.comment = object.comment ?? "";
message.classification = object.classification ?? "";
@@ -9147,40 +9155,22 @@ export const DatabaseServiceDefinition = {
},
} as const;
-declare const self: any | undefined;
-declare const window: any | undefined;
-declare const global: any | undefined;
-const tsProtoGlobalThis: any = (() => {
- if (typeof globalThis !== "undefined") {
- return globalThis;
- }
- if (typeof self !== "undefined") {
- return self;
- }
- if (typeof window !== "undefined") {
- return window;
- }
- if (typeof global !== "undefined") {
- return global;
- }
- throw "Unable to locate global object";
-})();
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -9195,11 +9185,8 @@ function fromJsonTimestamp(o: any): Date {
}
}
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
}
if (_m0.util.Long !== Long) {
diff --git a/frontend/src/types/proto/v1/environment_service.ts b/frontend/src/types/proto/v1/environment_service.ts
index a12ad8d8ae..cf06000118 100644
--- a/frontend/src/types/proto/v1/environment_service.ts
+++ b/frontend/src/types/proto/v1/environment_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -1273,10 +1274,16 @@ export const EnvironmentServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/externalvs_service.ts b/frontend/src/types/proto/v1/externalvs_service.ts
index 43d9851e7e..d2a4ba8c62 100644
--- a/frontend/src/types/proto/v1/externalvs_service.ts
+++ b/frontend/src/types/proto/v1/externalvs_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -2322,18 +2323,19 @@ export const ExternalVersionControlServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -2348,6 +2350,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/iam_policy.ts b/frontend/src/types/proto/v1/iam_policy.ts
index 200a768aad..37b97cf5dc 100644
--- a/frontend/src/types/proto/v1/iam_policy.ts
+++ b/frontend/src/types/proto/v1/iam_policy.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";
import { Expr } from "../google/type/expr";
@@ -202,10 +203,16 @@ export const Binding = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
index cec298061a..5fea977e88 100644
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ b/frontend/src/types/proto/v1/idp_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -2076,10 +2077,16 @@ export const IdentityProviderServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/inbox_service.ts b/frontend/src/types/proto/v1/inbox_service.ts
index 11e94cd262..03192dd55f 100644
--- a/frontend/src/types/proto/v1/inbox_service.ts
+++ b/frontend/src/types/proto/v1/inbox_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { FieldMask } from "../google/protobuf/field_mask";
import { LogEntity } from "./logging_service";
@@ -683,10 +684,16 @@ export const InboxServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/instance_role_service.ts b/frontend/src/types/proto/v1/instance_role_service.ts
index 13417a308f..e48c6279b0 100644
--- a/frontend/src/types/proto/v1/instance_role_service.ts
+++ b/frontend/src/types/proto/v1/instance_role_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -1068,10 +1069,16 @@ export const InstanceRoleServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
index 7564480760..9587912c10 100644
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ b/frontend/src/types/proto/v1/instance_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Empty } from "../google/protobuf/empty";
@@ -2571,10 +2572,16 @@ export const InstanceServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.ts
index 2ac58023c6..607e83197b 100644
--- a/frontend/src/types/proto/v1/issue_service.ts
+++ b/frontend/src/types/proto/v1/issue_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -3360,18 +3361,19 @@ export const IssueServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -3386,6 +3388,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/logging_service.ts b/frontend/src/types/proto/v1/logging_service.ts
index e2ab09b4b0..722c51bbe1 100644
--- a/frontend/src/types/proto/v1/logging_service.ts
+++ b/frontend/src/types/proto/v1/logging_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
import { ExportFormat, exportFormatFromJSON, exportFormatToJSON } from "./common";
@@ -1049,18 +1050,19 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1075,6 +1077,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/org_policy_service.ts b/frontend/src/types/proto/v1/org_policy_service.ts
index d6bd0cf77d..12807aa35d 100644
--- a/frontend/src/types/proto/v1/org_policy_service.ts
+++ b/frontend/src/types/proto/v1/org_policy_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Empty } from "../google/protobuf/empty";
@@ -3662,10 +3663,16 @@ export const OrgPolicyServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index 0c5ebfaac6..fe55e6a2f8 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -7542,10 +7543,16 @@ export const ProjectServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/risk_service.ts b/frontend/src/types/proto/v1/risk_service.ts
index ce9c060cd6..ea1b25442c 100644
--- a/frontend/src/types/proto/v1/risk_service.ts
+++ b/frontend/src/types/proto/v1/risk_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -717,10 +718,16 @@ export const RiskServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/role_service.ts b/frontend/src/types/proto/v1/role_service.ts
index fd4d9ca499..0fe81aaca3 100644
--- a/frontend/src/types/proto/v1/role_service.ts
+++ b/frontend/src/types/proto/v1/role_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -609,10 +610,16 @@ export const RoleServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.ts
index 589631f3a1..b8f8ca3b9a 100644
--- a/frontend/src/types/proto/v1/rollout_service.ts
+++ b/frontend/src/types/proto/v1/rollout_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -6334,18 +6335,19 @@ export const RolloutServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -6360,6 +6362,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/v1/schema_design_service.ts b/frontend/src/types/proto/v1/schema_design_service.ts
index 65378ce99a..2fd679e2ae 100644
--- a/frontend/src/types/proto/v1/schema_design_service.ts
+++ b/frontend/src/types/proto/v1/schema_design_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
@@ -1986,18 +1987,19 @@ export const SchemaDesignServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -2012,6 +2014,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
index dcd9814bc8..873081278f 100644
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ b/frontend/src/types/proto/v1/setting_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -4032,18 +4033,19 @@ export const SettingServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -4058,6 +4060,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
index ceb33efd14..f22947e257 100644
--- a/frontend/src/types/proto/v1/sheet_service.ts
+++ b/frontend/src/types/proto/v1/sheet_service.ts
@@ -168,7 +168,7 @@ export interface Sheet {
*/
content: Uint8Array;
/** content_size is the full size of the content, may not match the size of the `content` field. */
- contentSize: number;
+ contentSize: Long;
visibility: Sheet_Visibility;
/** The source of the sheet. */
source: Sheet_Source;
@@ -954,7 +954,7 @@ function createBaseSheet(): Sheet {
createTime: undefined,
updateTime: undefined,
content: new Uint8Array(0),
- contentSize: 0,
+ contentSize: Long.ZERO,
visibility: 0,
source: 0,
type: 0,
@@ -987,7 +987,7 @@ export const Sheet = {
if (message.content.length !== 0) {
writer.uint32(58).bytes(message.content);
}
- if (message.contentSize !== 0) {
+ if (!message.contentSize.isZero()) {
writer.uint32(64).int64(message.contentSize);
}
if (message.visibility !== 0) {
@@ -1072,7 +1072,7 @@ export const Sheet = {
break;
}
- message.contentSize = longToNumber(reader.int64() as Long);
+ message.contentSize = reader.int64() as Long;
continue;
case 9:
if (tag !== 72) {
@@ -1134,7 +1134,7 @@ export const Sheet = {
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
- contentSize: isSet(object.contentSize) ? Number(object.contentSize) : 0,
+ contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
visibility: isSet(object.visibility) ? sheet_VisibilityFromJSON(object.visibility) : 0,
source: isSet(object.source) ? sheet_SourceFromJSON(object.source) : 0,
type: isSet(object.type) ? sheet_TypeFromJSON(object.type) : 0,
@@ -1154,7 +1154,7 @@ export const Sheet = {
message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString());
message.content !== undefined &&
(obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array(0)));
- message.contentSize !== undefined && (obj.contentSize = Math.round(message.contentSize));
+ message.contentSize !== undefined && (obj.contentSize = (message.contentSize || Long.ZERO).toString());
message.visibility !== undefined && (obj.visibility = sheet_VisibilityToJSON(message.visibility));
message.source !== undefined && (obj.source = sheet_SourceToJSON(message.source));
message.type !== undefined && (obj.type = sheet_TypeToJSON(message.type));
@@ -1178,7 +1178,9 @@ export const Sheet = {
message.createTime = object.createTime ?? undefined;
message.updateTime = object.updateTime ?? undefined;
message.content = object.content ?? new Uint8Array(0);
- message.contentSize = object.contentSize ?? 0;
+ message.contentSize = (object.contentSize !== undefined && object.contentSize !== null)
+ ? Long.fromValue(object.contentSize)
+ : Long.ZERO;
message.visibility = object.visibility ?? 0;
message.source = object.source ?? 0;
message.type = object.type ?? 0;
@@ -1719,18 +1721,19 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -1745,11 +1748,8 @@ function fromJsonTimestamp(o: any): Date {
}
}
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
}
if (_m0.util.Long !== Long) {
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index bd08201bdb..6d89520c8b 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -138,11 +138,11 @@ export interface RowValue {
doubleValue?: number | undefined;
floatValue?: number | undefined;
int32Value?: number | undefined;
- int64Value?: number | undefined;
+ int64Value?: Long | undefined;
stringValue?: string | undefined;
uint32Value?: number | undefined;
uint64Value?:
- | number
+ | Long
| undefined;
/** value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only. */
valueValue?: any | undefined;
@@ -1310,7 +1310,7 @@ export const RowValue = {
break;
}
- message.int64Value = longToNumber(reader.int64() as Long);
+ message.int64Value = reader.int64() as Long;
continue;
case 8:
if (tag !== 66) {
@@ -1331,7 +1331,7 @@ export const RowValue = {
break;
}
- message.uint64Value = longToNumber(reader.uint64() as Long);
+ message.uint64Value = reader.uint64() as Long;
continue;
case 11:
if (tag !== 90) {
@@ -1357,10 +1357,10 @@ export const RowValue = {
doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : undefined,
floatValue: isSet(object.floatValue) ? Number(object.floatValue) : undefined,
int32Value: isSet(object.int32Value) ? Number(object.int32Value) : undefined,
- int64Value: isSet(object.int64Value) ? Number(object.int64Value) : undefined,
+ int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined,
uint32Value: isSet(object.uint32Value) ? Number(object.uint32Value) : undefined,
- uint64Value: isSet(object.uint64Value) ? Number(object.uint64Value) : undefined,
+ uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
valueValue: isSet(object?.valueValue) ? object.valueValue : undefined,
};
},
@@ -1375,10 +1375,10 @@ export const RowValue = {
message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue);
message.floatValue !== undefined && (obj.floatValue = message.floatValue);
message.int32Value !== undefined && (obj.int32Value = Math.round(message.int32Value));
- message.int64Value !== undefined && (obj.int64Value = Math.round(message.int64Value));
+ message.int64Value !== undefined && (obj.int64Value = (message.int64Value || undefined).toString());
message.stringValue !== undefined && (obj.stringValue = message.stringValue);
message.uint32Value !== undefined && (obj.uint32Value = Math.round(message.uint32Value));
- message.uint64Value !== undefined && (obj.uint64Value = Math.round(message.uint64Value));
+ message.uint64Value !== undefined && (obj.uint64Value = (message.uint64Value || undefined).toString());
message.valueValue !== undefined && (obj.valueValue = message.valueValue);
return obj;
},
@@ -1395,10 +1395,14 @@ export const RowValue = {
message.doubleValue = object.doubleValue ?? undefined;
message.floatValue = object.floatValue ?? undefined;
message.int32Value = object.int32Value ?? undefined;
- message.int64Value = object.int64Value ?? undefined;
+ message.int64Value = (object.int64Value !== undefined && object.int64Value !== null)
+ ? Long.fromValue(object.int64Value)
+ : undefined;
message.stringValue = object.stringValue ?? undefined;
message.uint32Value = object.uint32Value ?? undefined;
- message.uint64Value = object.uint64Value ?? undefined;
+ message.uint64Value = (object.uint64Value !== undefined && object.uint64Value !== null)
+ ? Long.fromValue(object.uint64Value)
+ : undefined;
message.valueValue = object.valueValue ?? undefined;
return message;
},
@@ -2064,17 +2068,11 @@ function base64FromBytes(arr: Uint8Array): string {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
-function longToNumber(long: Long): number {
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
- }
- return long.toNumber();
-}
-
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 6bb061657f..a859d745d1 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -936,18 +937,19 @@ export const SubscriptionServiceDefinition = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -962,6 +964,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
diff --git a/frontend/src/types/proto/v1/vcs.ts b/frontend/src/types/proto/v1/vcs.ts
index 67ef58b55e..e75d3c9a6c 100644
--- a/frontend/src/types/proto/v1/vcs.ts
+++ b/frontend/src/types/proto/v1/vcs.ts
@@ -1,4 +1,5 @@
/* eslint-disable */
+import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
@@ -634,18 +635,19 @@ export const FileCommit = {
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
- const seconds = date.getTime() / 1_000;
+ const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
- let millis = (t.seconds || 0) * 1_000;
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new Date(millis);
}
@@ -660,6 +662,15 @@ function fromJsonTimestamp(o: any): Date {
}
}
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/frontend/src/types/v1/schemaEditor/atomType.ts b/frontend/src/types/v1/schemaEditor/atomType.ts
index 24bddb4b09..e903a2d295 100644
--- a/frontend/src/types/v1/schemaEditor/atomType.ts
+++ b/frontend/src/types/v1/schemaEditor/atomType.ts
@@ -1,3 +1,4 @@
+import Long from "long";
import { v1 as uuidv1 } from "uuid";
import {
SchemaMetadata,
@@ -49,8 +50,8 @@ export interface Table {
name: string;
engine: string;
collation: string;
- rowCount: number;
- dataSize: number;
+ rowCount: Long;
+ dataSize: Long;
comment: string;
userComment: string;
columnList: Column[];
diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts
index c90a899228..57e46efba0 100644
--- a/frontend/src/utils/util.ts
+++ b/frontend/src/utils/util.ts
@@ -45,7 +45,7 @@ export const humanizeDurationV1 = (
) => {
if (!duration) return "-";
const { seconds, nanos } = duration;
- const total = seconds + nanos / 1e9;
+ const total = seconds.toNumber() + nanos / 1e9;
if (brief && total <= 1) {
return "Less than 1s";
}
diff --git a/frontend/src/utils/v1/sheet.ts b/frontend/src/utils/v1/sheet.ts
index 2c9a2b17da..a2fc70289e 100644
--- a/frontend/src/utils/v1/sheet.ts
+++ b/frontend/src/utils/v1/sheet.ts
@@ -1,3 +1,4 @@
+import Long from "long";
import { useCurrentUserV1, useProjectV1Store } from "@/store";
import {
getUserEmailFromIdentifier,
@@ -102,7 +103,7 @@ export const isSheetWritableV1 = (sheet: Sheet) => {
export const setSheetStatement = (sheet: Sheet, statement: string) => {
sheet.content = new TextEncoder().encode(statement);
- sheet.contentSize = statement.length;
+ sheet.contentSize = Long.fromNumber(statement.length);
};
export const getSheetStatement = (sheet: Sheet) => {
diff --git a/frontend/src/views/BannerUpgradeSubscription.vue b/frontend/src/views/BannerUpgradeSubscription.vue
index bb5e892c57..7dcb06676c 100644
--- a/frontend/src/views/BannerUpgradeSubscription.vue
+++ b/frontend/src/views/BannerUpgradeSubscription.vue
@@ -158,7 +158,7 @@ watch(
}
if (
!!settingV1Store.workspaceProfileSetting?.tokenDuration?.seconds &&
- settingV1Store.workspaceProfileSetting?.tokenDuration?.seconds !=
+ settingV1Store.workspaceProfileSetting?.tokenDuration?.seconds.toNumber() !=
defaultTokenDurationInHours * 60 * 60
) {
set.add("bb.feature.secure-token");
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index 5b67e2039d..875993f02d 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -390,7 +390,7 @@ const queryTime = computed(() => {
if (!latency) return "-";
const { seconds, nanos } = latency;
- const totalSeconds = seconds + nanos / 1e9;
+ const totalSeconds = seconds.toNumber() + nanos / 1e9;
if (totalSeconds < 1) {
const totalMS = Math.round(totalSeconds * 1000);
return `${totalMS} ms`;
diff --git a/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue b/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
index 6cf506f16a..178b7882a5 100644
--- a/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
@@ -18,6 +18,7 @@
</template>
<script lang="ts" setup>
+import Long from "long";
import { computed } from "vue";
import DownloadSheetButton from "@/components/Sheet/DownloadSheetButton.vue";
import { useSheetV1Store, useTabStore } from "@/store";
@@ -37,9 +38,8 @@ const isSheetOversize = computed(() => {
return false;
}
- return (
- new TextDecoder().decode(sheet.value.content).length <
- sheet.value.contentSize
- );
+ return Long.fromNumber(
+ new TextDecoder().decode(sheet.value.content).length
+ ).lt(sheet.value.contentSize);
});
</script>
diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml
index 11b726bedb..7b5e0fe267 100644
--- a/proto/buf.gen.yaml
+++ b/proto/buf.gen.yaml
@@ -19,6 +19,7 @@ plugins:
- outputServices=generic-definitions
- useExactTypes=false
- esModuleInterop=true
+ - forceLong=long
- plugin: buf.build/community/pseudomuto-doc:v1.5.1
out: gen/grpc-doc
opt: