chore: update frontend dependencies

This commit is contained in:
Steven
2025-08-11 22:53:10 +08:00
parent 115cd1f506
commit dfddf26bda
53 changed files with 18244 additions and 1262 deletions
-2
View File
@@ -36,5 +36,3 @@ keys.json
# typescript # typescript
.tsbuildinfo .tsbuildinfo
src/types/proto
+8 -8
View File
@@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.1",
"@mui/joy": "5.0.0-beta.51", "@mui/joy": "5.0.0-beta.51",
"@plasmohq/storage": "^1.15.0", "@plasmohq/storage": "^1.15.0",
"classnames": "^2.5.1", "classnames": "^2.5.1",
@@ -24,21 +24,21 @@
}, },
"devDependencies": { "devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/chrome": "^0.1.1", "@types/chrome": "^0.1.3",
"@types/node": "^22.15.29", "@types/node": "^22.17.1",
"@types/react": "^18.3.23", "@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7", "@types/react-dom": "^18.3.7",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^7.18.0",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.2",
"eslint-plugin-prettier": "^5.5.3", "eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"postcss": "^8.5.4", "postcss": "^8.5.6",
"prettier": "^3.5.3", "prettier": "^3.6.2",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"typescript": "^5.8.3" "typescript": "^5.9.2"
}, },
"manifest": { "manifest": {
"permissions": [ "permissions": [
+493 -519
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -3,4 +3,3 @@ node_modules
dist dist
dist-ssr dist-ssr
*.local *.local
src/types/proto
+11 -13
View File
@@ -6,8 +6,7 @@
"serve": "vite preview", "serve": "vite preview",
"lint": "eslint --ext .js,.ts,.tsx, src", "lint": "eslint --ext .js,.ts,.tsx, src",
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix", "lint-fix": "eslint --ext .js,.ts,.tsx, src --fix",
"type-check": "tsc --noEmit --skipLibCheck", "type-check": "tsc --noEmit --skipLibCheck"
"postinstall": "cd ../../proto && buf generate"
}, },
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
@@ -25,16 +24,15 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-hot-toast": "^2.5.2", "react-hot-toast": "^2.5.2",
"react-i18next": "^15.5.2", "react-i18next": "^15.6.1",
"react-router-dom": "^7.6.1", "react-router-dom": "^7.8.0",
"react-use": "^17.6.0", "react-use": "^17.6.0",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"uuid": "^11.1.0", "uuid": "^11.1.0",
"zustand": "^5.0.5" "zustand": "^5.0.7"
}, },
"devDependencies": { "devDependencies": {
"@bufbuild/buf": "^1.54.0", "@bufbuild/protobuf": "^2.6.3",
"@bufbuild/protobuf": "^2.6.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/react": "^18.3.23", "@types/react": "^18.3.23",
@@ -42,17 +40,17 @@
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^7.18.0",
"@vitejs/plugin-react-swc": "^3.10.0", "@vitejs/plugin-react-swc": "^3.11.0",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.2",
"eslint-plugin-prettier": "^5.4.1", "eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"long": "^5.3.2", "long": "^5.3.2",
"postcss": "^8.5.4", "postcss": "^8.5.6",
"prettier": "^3.5.3", "prettier": "^3.6.2",
"protobufjs": "^7.5.3", "protobufjs": "^7.5.3",
"typescript": "^5.8.3", "typescript": "^5.9.2",
"vite": "^6.3.5" "vite": "^6.3.5"
}, },
"resolutions": { "resolutions": {
+555 -682
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,522 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/auth_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Empty } from "../../google/protobuf/empty";
import { User } from "./user_service";
export const protobufPackage = "slash.api.v1";
export interface GetAuthStatusRequest {
}
export interface SignInRequest {
email: string;
password: string;
}
export interface SignUpRequest {
email: string;
nickname: string;
password: string;
}
export interface SignInWithSSORequest {
/** The id of the SSO provider. */
idpId: string;
/** The code to sign in with. */
code: string;
/** The redirect URI. */
redirectUri: string;
}
export interface SignOutRequest {
}
function createBaseGetAuthStatusRequest(): GetAuthStatusRequest {
return {};
}
export const GetAuthStatusRequest: MessageFns<GetAuthStatusRequest> = {
encode(_: GetAuthStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetAuthStatusRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetAuthStatusRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetAuthStatusRequest>): GetAuthStatusRequest {
return GetAuthStatusRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<GetAuthStatusRequest>): GetAuthStatusRequest {
const message = createBaseGetAuthStatusRequest();
return message;
},
};
function createBaseSignInRequest(): SignInRequest {
return { email: "", password: "" };
}
export const SignInRequest: MessageFns<SignInRequest> = {
encode(message: SignInRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.email !== "") {
writer.uint32(10).string(message.email);
}
if (message.password !== "") {
writer.uint32(18).string(message.password);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SignInRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSignInRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.email = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.password = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SignInRequest>): SignInRequest {
return SignInRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<SignInRequest>): SignInRequest {
const message = createBaseSignInRequest();
message.email = object.email ?? "";
message.password = object.password ?? "";
return message;
},
};
function createBaseSignUpRequest(): SignUpRequest {
return { email: "", nickname: "", password: "" };
}
export const SignUpRequest: MessageFns<SignUpRequest> = {
encode(message: SignUpRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.email !== "") {
writer.uint32(10).string(message.email);
}
if (message.nickname !== "") {
writer.uint32(18).string(message.nickname);
}
if (message.password !== "") {
writer.uint32(26).string(message.password);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SignUpRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSignUpRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.email = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.nickname = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.password = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SignUpRequest>): SignUpRequest {
return SignUpRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<SignUpRequest>): SignUpRequest {
const message = createBaseSignUpRequest();
message.email = object.email ?? "";
message.nickname = object.nickname ?? "";
message.password = object.password ?? "";
return message;
},
};
function createBaseSignInWithSSORequest(): SignInWithSSORequest {
return { idpId: "", code: "", redirectUri: "" };
}
export const SignInWithSSORequest: MessageFns<SignInWithSSORequest> = {
encode(message: SignInWithSSORequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.idpId !== "") {
writer.uint32(10).string(message.idpId);
}
if (message.code !== "") {
writer.uint32(18).string(message.code);
}
if (message.redirectUri !== "") {
writer.uint32(26).string(message.redirectUri);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SignInWithSSORequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSignInWithSSORequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.idpId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.code = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.redirectUri = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SignInWithSSORequest>): SignInWithSSORequest {
return SignInWithSSORequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<SignInWithSSORequest>): SignInWithSSORequest {
const message = createBaseSignInWithSSORequest();
message.idpId = object.idpId ?? "";
message.code = object.code ?? "";
message.redirectUri = object.redirectUri ?? "";
return message;
},
};
function createBaseSignOutRequest(): SignOutRequest {
return {};
}
export const SignOutRequest: MessageFns<SignOutRequest> = {
encode(_: SignOutRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SignOutRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSignOutRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SignOutRequest>): SignOutRequest {
return SignOutRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<SignOutRequest>): SignOutRequest {
const message = createBaseSignOutRequest();
return message;
},
};
export type AuthServiceDefinition = typeof AuthServiceDefinition;
export const AuthServiceDefinition = {
name: "AuthService",
fullName: "slash.api.v1.AuthService",
methods: {
/** GetAuthStatus returns the current auth status of the user. */
getAuthStatus: {
name: "GetAuthStatus",
requestType: GetAuthStatusRequest,
requestStream: false,
responseType: User,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
21,
34,
19,
47,
97,
112,
105,
47,
118,
49,
47,
97,
117,
116,
104,
47,
115,
116,
97,
116,
117,
115,
]),
],
},
},
},
/** SignIn signs in the user with the given username and password. */
signIn: {
name: "SignIn",
requestType: SignInRequest,
requestStream: false,
responseType: User,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
21,
34,
19,
47,
97,
112,
105,
47,
118,
49,
47,
97,
117,
116,
104,
47,
115,
105,
103,
110,
105,
110,
]),
],
},
},
},
/** SignInWithSSO signs in the user with the given SSO code. */
signInWithSSO: {
name: "SignInWithSSO",
requestType: SignInWithSSORequest,
requestStream: false,
responseType: User,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
25,
34,
23,
47,
97,
112,
105,
47,
118,
49,
47,
97,
117,
116,
104,
47,
115,
105,
103,
110,
105,
110,
47,
115,
115,
111,
]),
],
},
},
},
/** SignUp signs up the user with the given username and password. */
signUp: {
name: "SignUp",
requestType: SignUpRequest,
requestStream: false,
responseType: User,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
21,
34,
19,
47,
97,
112,
105,
47,
118,
49,
47,
97,
117,
116,
104,
47,
115,
105,
103,
110,
117,
112,
]),
],
},
},
},
/** SignOut signs out the user. */
signOut: {
name: "SignOut",
requestType: SignOutRequest,
requestStream: false,
responseType: Empty,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
22,
34,
20,
47,
97,
112,
105,
47,
118,
49,
47,
97,
117,
116,
104,
47,
115,
105,
103,
110,
111,
117,
116,
]),
],
},
},
},
},
} as const;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,857 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/collection_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Empty } from "../../google/protobuf/empty";
import { FieldMask } from "../../google/protobuf/field_mask";
import { Timestamp } from "../../google/protobuf/timestamp";
import { Visibility, visibilityFromJSON, visibilityToNumber } from "./common";
export const protobufPackage = "slash.api.v1";
export interface Collection {
id: number;
creatorId: number;
createdTime?: Date | undefined;
updatedTime?: Date | undefined;
name: string;
title: string;
description: string;
shortcutIds: number[];
visibility: Visibility;
}
export interface ListCollectionsRequest {
}
export interface ListCollectionsResponse {
collections: Collection[];
}
export interface GetCollectionRequest {
id: number;
}
export interface GetCollectionByNameRequest {
name: string;
}
export interface CreateCollectionRequest {
collection?: Collection | undefined;
}
export interface UpdateCollectionRequest {
collection?: Collection | undefined;
updateMask?: string[] | undefined;
}
export interface DeleteCollectionRequest {
id: number;
}
function createBaseCollection(): Collection {
return {
id: 0,
creatorId: 0,
createdTime: undefined,
updatedTime: undefined,
name: "",
title: "",
description: "",
shortcutIds: [],
visibility: Visibility.VISIBILITY_UNSPECIFIED,
};
}
export const Collection: MessageFns<Collection> = {
encode(message: Collection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.creatorId !== 0) {
writer.uint32(16).int32(message.creatorId);
}
if (message.createdTime !== undefined) {
Timestamp.encode(toTimestamp(message.createdTime), writer.uint32(26).fork()).join();
}
if (message.updatedTime !== undefined) {
Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(34).fork()).join();
}
if (message.name !== "") {
writer.uint32(50).string(message.name);
}
if (message.title !== "") {
writer.uint32(58).string(message.title);
}
if (message.description !== "") {
writer.uint32(66).string(message.description);
}
writer.uint32(74).fork();
for (const v of message.shortcutIds) {
writer.int32(v);
}
writer.join();
if (message.visibility !== Visibility.VISIBILITY_UNSPECIFIED) {
writer.uint32(80).int32(visibilityToNumber(message.visibility));
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Collection {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCollection();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.creatorId = reader.int32();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.createdTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.name = reader.string();
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.title = reader.string();
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.description = reader.string();
continue;
}
case 9: {
if (tag === 72) {
message.shortcutIds.push(reader.int32());
continue;
}
if (tag === 74) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.shortcutIds.push(reader.int32());
}
continue;
}
break;
}
case 10: {
if (tag !== 80) {
break;
}
message.visibility = visibilityFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Collection>): Collection {
return Collection.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Collection>): Collection {
const message = createBaseCollection();
message.id = object.id ?? 0;
message.creatorId = object.creatorId ?? 0;
message.createdTime = object.createdTime ?? undefined;
message.updatedTime = object.updatedTime ?? undefined;
message.name = object.name ?? "";
message.title = object.title ?? "";
message.description = object.description ?? "";
message.shortcutIds = object.shortcutIds?.map((e) => e) || [];
message.visibility = object.visibility ?? Visibility.VISIBILITY_UNSPECIFIED;
return message;
},
};
function createBaseListCollectionsRequest(): ListCollectionsRequest {
return {};
}
export const ListCollectionsRequest: MessageFns<ListCollectionsRequest> = {
encode(_: ListCollectionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ListCollectionsRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListCollectionsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ListCollectionsRequest>): ListCollectionsRequest {
return ListCollectionsRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<ListCollectionsRequest>): ListCollectionsRequest {
const message = createBaseListCollectionsRequest();
return message;
},
};
function createBaseListCollectionsResponse(): ListCollectionsResponse {
return { collections: [] };
}
export const ListCollectionsResponse: MessageFns<ListCollectionsResponse> = {
encode(message: ListCollectionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.collections) {
Collection.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ListCollectionsResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListCollectionsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.collections.push(Collection.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ListCollectionsResponse>): ListCollectionsResponse {
return ListCollectionsResponse.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<ListCollectionsResponse>): ListCollectionsResponse {
const message = createBaseListCollectionsResponse();
message.collections = object.collections?.map((e) => Collection.fromPartial(e)) || [];
return message;
},
};
function createBaseGetCollectionRequest(): GetCollectionRequest {
return { id: 0 };
}
export const GetCollectionRequest: MessageFns<GetCollectionRequest> = {
encode(message: GetCollectionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetCollectionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetCollectionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetCollectionRequest>): GetCollectionRequest {
return GetCollectionRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<GetCollectionRequest>): GetCollectionRequest {
const message = createBaseGetCollectionRequest();
message.id = object.id ?? 0;
return message;
},
};
function createBaseGetCollectionByNameRequest(): GetCollectionByNameRequest {
return { name: "" };
}
export const GetCollectionByNameRequest: MessageFns<GetCollectionByNameRequest> = {
encode(message: GetCollectionByNameRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetCollectionByNameRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetCollectionByNameRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetCollectionByNameRequest>): GetCollectionByNameRequest {
return GetCollectionByNameRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<GetCollectionByNameRequest>): GetCollectionByNameRequest {
const message = createBaseGetCollectionByNameRequest();
message.name = object.name ?? "";
return message;
},
};
function createBaseCreateCollectionRequest(): CreateCollectionRequest {
return { collection: undefined };
}
export const CreateCollectionRequest: MessageFns<CreateCollectionRequest> = {
encode(message: CreateCollectionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.collection !== undefined) {
Collection.encode(message.collection, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CreateCollectionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCreateCollectionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.collection = Collection.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<CreateCollectionRequest>): CreateCollectionRequest {
return CreateCollectionRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<CreateCollectionRequest>): CreateCollectionRequest {
const message = createBaseCreateCollectionRequest();
message.collection = (object.collection !== undefined && object.collection !== null)
? Collection.fromPartial(object.collection)
: undefined;
return message;
},
};
function createBaseUpdateCollectionRequest(): UpdateCollectionRequest {
return { collection: undefined, updateMask: undefined };
}
export const UpdateCollectionRequest: MessageFns<UpdateCollectionRequest> = {
encode(message: UpdateCollectionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.collection !== undefined) {
Collection.encode(message.collection, writer.uint32(10).fork()).join();
}
if (message.updateMask !== undefined) {
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UpdateCollectionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateCollectionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.collection = Collection.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UpdateCollectionRequest>): UpdateCollectionRequest {
return UpdateCollectionRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UpdateCollectionRequest>): UpdateCollectionRequest {
const message = createBaseUpdateCollectionRequest();
message.collection = (object.collection !== undefined && object.collection !== null)
? Collection.fromPartial(object.collection)
: undefined;
message.updateMask = object.updateMask ?? undefined;
return message;
},
};
function createBaseDeleteCollectionRequest(): DeleteCollectionRequest {
return { id: 0 };
}
export const DeleteCollectionRequest: MessageFns<DeleteCollectionRequest> = {
encode(message: DeleteCollectionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): DeleteCollectionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDeleteCollectionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<DeleteCollectionRequest>): DeleteCollectionRequest {
return DeleteCollectionRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<DeleteCollectionRequest>): DeleteCollectionRequest {
const message = createBaseDeleteCollectionRequest();
message.id = object.id ?? 0;
return message;
},
};
export type CollectionServiceDefinition = typeof CollectionServiceDefinition;
export const CollectionServiceDefinition = {
name: "CollectionService",
fullName: "slash.api.v1.CollectionService",
methods: {
/** ListCollections returns a list of collections. */
listCollections: {
name: "ListCollections",
requestType: ListCollectionsRequest,
requestStream: false,
responseType: ListCollectionsResponse,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
21,
18,
19,
47,
97,
112,
105,
47,
118,
49,
47,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
115,
]),
],
},
},
},
/** GetCollection returns a collection by id. */
getCollection: {
name: "GetCollection",
requestType: GetCollectionRequest,
requestStream: false,
responseType: Collection,
responseStream: false,
options: {
_unknownFields: {
8410: [new Uint8Array([2, 105, 100])],
578365826: [
new Uint8Array([
26,
18,
24,
47,
97,
112,
105,
47,
118,
49,
47,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
]),
],
},
},
},
/** GetCollectionByName returns a collection by name. */
getCollectionByName: {
name: "GetCollectionByName",
requestType: GetCollectionByNameRequest,
requestStream: false,
responseType: Collection,
responseStream: false,
options: {},
},
/** CreateCollection creates a collection. */
createCollection: {
name: "CreateCollection",
requestType: CreateCollectionRequest,
requestStream: false,
responseType: Collection,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
33,
58,
10,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
34,
19,
47,
97,
112,
105,
47,
118,
49,
47,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
115,
]),
],
},
},
},
/** UpdateCollection updates a collection. */
updateCollection: {
name: "UpdateCollection",
requestType: UpdateCollectionRequest,
requestStream: false,
responseType: Collection,
responseStream: false,
options: {
_unknownFields: {
8410: [
new Uint8Array([
22,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
44,
117,
112,
100,
97,
116,
101,
95,
109,
97,
115,
107,
]),
],
578365826: [
new Uint8Array([
49,
58,
10,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
26,
35,
47,
97,
112,
105,
47,
118,
49,
47,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
115,
47,
123,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
46,
105,
100,
125,
]),
],
},
},
},
/** DeleteCollection deletes a collection by id. */
deleteCollection: {
name: "DeleteCollection",
requestType: DeleteCollectionRequest,
requestStream: false,
responseType: Empty,
responseStream: false,
options: {
_unknownFields: {
8410: [new Uint8Array([2, 105, 100])],
578365826: [
new Uint8Array([
26,
42,
24,
47,
97,
112,
105,
47,
118,
49,
47,
99,
111,
108,
108,
101,
99,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
]),
],
},
},
},
},
} as const;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.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 = Math.trunc(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;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,87 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/common.proto
/* eslint-disable */
export const protobufPackage = "slash.api.v1";
export enum State {
STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
ACTIVE = "ACTIVE",
INACTIVE = "INACTIVE",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function stateFromJSON(object: any): State {
switch (object) {
case 0:
case "STATE_UNSPECIFIED":
return State.STATE_UNSPECIFIED;
case 1:
case "ACTIVE":
return State.ACTIVE;
case 2:
case "INACTIVE":
return State.INACTIVE;
case -1:
case "UNRECOGNIZED":
default:
return State.UNRECOGNIZED;
}
}
export function stateToNumber(object: State): number {
switch (object) {
case State.STATE_UNSPECIFIED:
return 0;
case State.ACTIVE:
return 1;
case State.INACTIVE:
return 2;
case State.UNRECOGNIZED:
default:
return -1;
}
}
export enum Visibility {
VISIBILITY_UNSPECIFIED = "VISIBILITY_UNSPECIFIED",
WORKSPACE = "WORKSPACE",
PUBLIC = "PUBLIC",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function visibilityFromJSON(object: any): Visibility {
switch (object) {
case 0:
case "VISIBILITY_UNSPECIFIED":
return Visibility.VISIBILITY_UNSPECIFIED;
case 1:
case "WORKSPACE":
return Visibility.WORKSPACE;
case 2:
case "PUBLIC":
return Visibility.PUBLIC;
case -1:
case "UNRECOGNIZED":
default:
return Visibility.UNRECOGNIZED;
}
}
export function visibilityToNumber(object: Visibility): number {
switch (object) {
case Visibility.VISIBILITY_UNSPECIFIED:
return 0;
case Visibility.WORKSPACE:
return 1;
case Visibility.PUBLIC:
return 2;
case Visibility.UNRECOGNIZED:
default:
return -1;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,419 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/subscription_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Timestamp } from "../../google/protobuf/timestamp";
export const protobufPackage = "slash.api.v1";
export enum PlanType {
PLAN_TYPE_UNSPECIFIED = "PLAN_TYPE_UNSPECIFIED",
FREE = "FREE",
PRO = "PRO",
ENTERPRISE = "ENTERPRISE",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function planTypeFromJSON(object: any): PlanType {
switch (object) {
case 0:
case "PLAN_TYPE_UNSPECIFIED":
return PlanType.PLAN_TYPE_UNSPECIFIED;
case 1:
case "FREE":
return PlanType.FREE;
case 2:
case "PRO":
return PlanType.PRO;
case 3:
case "ENTERPRISE":
return PlanType.ENTERPRISE;
case -1:
case "UNRECOGNIZED":
default:
return PlanType.UNRECOGNIZED;
}
}
export function planTypeToNumber(object: PlanType): number {
switch (object) {
case PlanType.PLAN_TYPE_UNSPECIFIED:
return 0;
case PlanType.FREE:
return 1;
case PlanType.PRO:
return 2;
case PlanType.ENTERPRISE:
return 3;
case PlanType.UNRECOGNIZED:
default:
return -1;
}
}
export interface Subscription {
plan: PlanType;
startedTime?: Date | undefined;
expiresTime?: Date | undefined;
features: string[];
seats: number;
shortcutsLimit: number;
collectionsLimit: number;
}
export interface GetSubscriptionRequest {
}
export interface UpdateSubscriptionRequest {
licenseKey: string;
}
export interface DeleteSubscriptionRequest {
}
function createBaseSubscription(): Subscription {
return {
plan: PlanType.PLAN_TYPE_UNSPECIFIED,
startedTime: undefined,
expiresTime: undefined,
features: [],
seats: 0,
shortcutsLimit: 0,
collectionsLimit: 0,
};
}
export const Subscription: MessageFns<Subscription> = {
encode(message: Subscription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
writer.uint32(8).int32(planTypeToNumber(message.plan));
}
if (message.startedTime !== undefined) {
Timestamp.encode(toTimestamp(message.startedTime), writer.uint32(18).fork()).join();
}
if (message.expiresTime !== undefined) {
Timestamp.encode(toTimestamp(message.expiresTime), writer.uint32(26).fork()).join();
}
for (const v of message.features) {
writer.uint32(34).string(v!);
}
if (message.seats !== 0) {
writer.uint32(40).int32(message.seats);
}
if (message.shortcutsLimit !== 0) {
writer.uint32(48).int32(message.shortcutsLimit);
}
if (message.collectionsLimit !== 0) {
writer.uint32(56).int32(message.collectionsLimit);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Subscription {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSubscription();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.plan = planTypeFromJSON(reader.int32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.startedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.expiresTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.features.push(reader.string());
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.seats = reader.int32();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.shortcutsLimit = reader.int32();
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.collectionsLimit = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Subscription>): Subscription {
return Subscription.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Subscription>): Subscription {
const message = createBaseSubscription();
message.plan = object.plan ?? PlanType.PLAN_TYPE_UNSPECIFIED;
message.startedTime = object.startedTime ?? undefined;
message.expiresTime = object.expiresTime ?? undefined;
message.features = object.features?.map((e) => e) || [];
message.seats = object.seats ?? 0;
message.shortcutsLimit = object.shortcutsLimit ?? 0;
message.collectionsLimit = object.collectionsLimit ?? 0;
return message;
},
};
function createBaseGetSubscriptionRequest(): GetSubscriptionRequest {
return {};
}
export const GetSubscriptionRequest: MessageFns<GetSubscriptionRequest> = {
encode(_: GetSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetSubscriptionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetSubscriptionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetSubscriptionRequest>): GetSubscriptionRequest {
return GetSubscriptionRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<GetSubscriptionRequest>): GetSubscriptionRequest {
const message = createBaseGetSubscriptionRequest();
return message;
},
};
function createBaseUpdateSubscriptionRequest(): UpdateSubscriptionRequest {
return { licenseKey: "" };
}
export const UpdateSubscriptionRequest: MessageFns<UpdateSubscriptionRequest> = {
encode(message: UpdateSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.licenseKey !== "") {
writer.uint32(10).string(message.licenseKey);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UpdateSubscriptionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateSubscriptionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.licenseKey = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UpdateSubscriptionRequest>): UpdateSubscriptionRequest {
return UpdateSubscriptionRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UpdateSubscriptionRequest>): UpdateSubscriptionRequest {
const message = createBaseUpdateSubscriptionRequest();
message.licenseKey = object.licenseKey ?? "";
return message;
},
};
function createBaseDeleteSubscriptionRequest(): DeleteSubscriptionRequest {
return {};
}
export const DeleteSubscriptionRequest: MessageFns<DeleteSubscriptionRequest> = {
encode(_: DeleteSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): DeleteSubscriptionRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDeleteSubscriptionRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<DeleteSubscriptionRequest>): DeleteSubscriptionRequest {
return DeleteSubscriptionRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<DeleteSubscriptionRequest>): DeleteSubscriptionRequest {
const message = createBaseDeleteSubscriptionRequest();
return message;
},
};
export type SubscriptionServiceDefinition = typeof SubscriptionServiceDefinition;
export const SubscriptionServiceDefinition = {
name: "SubscriptionService",
fullName: "slash.api.v1.SubscriptionService",
methods: {
/** GetSubscription gets the current subscription of Slash instance. */
getSubscription: {
name: "GetSubscription",
requestType: GetSubscriptionRequest,
requestStream: false,
responseType: Subscription,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([18, 18, 16, 47, 118, 49, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110]),
],
},
},
},
/** UpdateSubscription updates the subscription. */
updateSubscription: {
name: "UpdateSubscription",
requestType: UpdateSubscriptionRequest,
requestStream: false,
responseType: Subscription,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
21,
58,
1,
42,
50,
16,
47,
118,
49,
47,
115,
117,
98,
115,
99,
114,
105,
112,
116,
105,
111,
110,
]),
],
},
},
},
/** DeleteSubscription deletes the subscription. */
deleteSubscription: {
name: "DeleteSubscription",
requestType: DeleteSubscriptionRequest,
requestStream: false,
responseType: Subscription,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([18, 42, 16, 47, 118, 49, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110]),
],
},
},
},
},
} as const;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.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 = Math.trunc(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;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,569 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/user_setting_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { FieldMask } from "../../google/protobuf/field_mask";
export const protobufPackage = "slash.api.v1";
export interface UserSetting {
userId: number;
general?: UserSetting_GeneralSetting | undefined;
accessTokens?: UserSetting_AccessTokensSetting | undefined;
}
export interface UserSetting_GeneralSetting {
locale: string;
colorTheme: string;
}
export interface UserSetting_AccessTokensSetting {
/** Nested repeated field */
accessTokens: UserSetting_AccessTokensSetting_AccessToken[];
}
export interface UserSetting_AccessTokensSetting_AccessToken {
/** The access token is a JWT token, including expiration time, issuer, etc. */
accessToken: string;
/** A description for the access token. */
description: string;
}
export interface GetUserSettingRequest {
/** id is the user id. */
id: number;
}
export interface UpdateUserSettingRequest {
/** id is the user id. */
id: number;
/** user_setting is the user setting to update. */
userSetting?:
| UserSetting
| undefined;
/** update_mask is the field mask to update. */
updateMask?: string[] | undefined;
}
function createBaseUserSetting(): UserSetting {
return { userId: 0, general: undefined, accessTokens: undefined };
}
export const UserSetting: MessageFns<UserSetting> = {
encode(message: UserSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.userId !== 0) {
writer.uint32(8).int32(message.userId);
}
if (message.general !== undefined) {
UserSetting_GeneralSetting.encode(message.general, writer.uint32(18).fork()).join();
}
if (message.accessTokens !== undefined) {
UserSetting_AccessTokensSetting.encode(message.accessTokens, writer.uint32(26).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.userId = reader.int32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.general = UserSetting_GeneralSetting.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.accessTokens = UserSetting_AccessTokensSetting.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting>): UserSetting {
return UserSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting>): UserSetting {
const message = createBaseUserSetting();
message.userId = object.userId ?? 0;
message.general = (object.general !== undefined && object.general !== null)
? UserSetting_GeneralSetting.fromPartial(object.general)
: undefined;
message.accessTokens = (object.accessTokens !== undefined && object.accessTokens !== null)
? UserSetting_AccessTokensSetting.fromPartial(object.accessTokens)
: undefined;
return message;
},
};
function createBaseUserSetting_GeneralSetting(): UserSetting_GeneralSetting {
return { locale: "", colorTheme: "" };
}
export const UserSetting_GeneralSetting: MessageFns<UserSetting_GeneralSetting> = {
encode(message: UserSetting_GeneralSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.locale !== "") {
writer.uint32(10).string(message.locale);
}
if (message.colorTheme !== "") {
writer.uint32(18).string(message.colorTheme);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_GeneralSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_GeneralSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.locale = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.colorTheme = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_GeneralSetting>): UserSetting_GeneralSetting {
return UserSetting_GeneralSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_GeneralSetting>): UserSetting_GeneralSetting {
const message = createBaseUserSetting_GeneralSetting();
message.locale = object.locale ?? "";
message.colorTheme = object.colorTheme ?? "";
return message;
},
};
function createBaseUserSetting_AccessTokensSetting(): UserSetting_AccessTokensSetting {
return { accessTokens: [] };
}
export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessTokensSetting> = {
encode(message: UserSetting_AccessTokensSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.accessTokens) {
UserSetting_AccessTokensSetting_AccessToken.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_AccessTokensSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_AccessTokensSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.accessTokens.push(UserSetting_AccessTokensSetting_AccessToken.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting {
return UserSetting_AccessTokensSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting {
const message = createBaseUserSetting_AccessTokensSetting();
message.accessTokens =
object.accessTokens?.map((e) => UserSetting_AccessTokensSetting_AccessToken.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_AccessTokensSetting_AccessToken(): UserSetting_AccessTokensSetting_AccessToken {
return { accessToken: "", description: "" };
}
export const UserSetting_AccessTokensSetting_AccessToken: MessageFns<UserSetting_AccessTokensSetting_AccessToken> = {
encode(
message: UserSetting_AccessTokensSetting_AccessToken,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.accessToken !== "") {
writer.uint32(10).string(message.accessToken);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_AccessTokensSetting_AccessToken {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.accessToken = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>): UserSetting_AccessTokensSetting_AccessToken {
return UserSetting_AccessTokensSetting_AccessToken.fromPartial(base ?? {});
},
fromPartial(
object: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>,
): UserSetting_AccessTokensSetting_AccessToken {
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
message.accessToken = object.accessToken ?? "";
message.description = object.description ?? "";
return message;
},
};
function createBaseGetUserSettingRequest(): GetUserSettingRequest {
return { id: 0 };
}
export const GetUserSettingRequest: MessageFns<GetUserSettingRequest> = {
encode(message: GetUserSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetUserSettingRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetUserSettingRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetUserSettingRequest>): GetUserSettingRequest {
return GetUserSettingRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<GetUserSettingRequest>): GetUserSettingRequest {
const message = createBaseGetUserSettingRequest();
message.id = object.id ?? 0;
return message;
},
};
function createBaseUpdateUserSettingRequest(): UpdateUserSettingRequest {
return { id: 0, userSetting: undefined, updateMask: undefined };
}
export const UpdateUserSettingRequest: MessageFns<UpdateUserSettingRequest> = {
encode(message: UpdateUserSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.userSetting !== undefined) {
UserSetting.encode(message.userSetting, writer.uint32(18).fork()).join();
}
if (message.updateMask !== undefined) {
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(26).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UpdateUserSettingRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateUserSettingRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.userSetting = UserSetting.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UpdateUserSettingRequest>): UpdateUserSettingRequest {
return UpdateUserSettingRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UpdateUserSettingRequest>): UpdateUserSettingRequest {
const message = createBaseUpdateUserSettingRequest();
message.id = object.id ?? 0;
message.userSetting = (object.userSetting !== undefined && object.userSetting !== null)
? UserSetting.fromPartial(object.userSetting)
: undefined;
message.updateMask = object.updateMask ?? undefined;
return message;
},
};
export type UserSettingServiceDefinition = typeof UserSettingServiceDefinition;
export const UserSettingServiceDefinition = {
name: "UserSettingService",
fullName: "slash.api.v1.UserSettingService",
methods: {
/** GetUserSetting returns the user setting. */
getUserSetting: {
name: "GetUserSetting",
requestType: GetUserSettingRequest,
requestStream: false,
responseType: UserSetting,
responseStream: false,
options: {
_unknownFields: {
8410: [new Uint8Array([2, 105, 100])],
578365826: [
new Uint8Array([
29,
18,
27,
47,
97,
112,
105,
47,
118,
49,
47,
117,
115,
101,
114,
115,
47,
123,
105,
100,
125,
47,
115,
101,
116,
116,
105,
110,
103,
115,
]),
],
},
},
},
/** UpdateUserSetting updates the user setting. */
updateUserSetting: {
name: "UpdateUserSetting",
requestType: UpdateUserSettingRequest,
requestStream: false,
responseType: UserSetting,
responseStream: false,
options: {
_unknownFields: {
8410: [
new Uint8Array([
24,
117,
115,
101,
114,
95,
115,
101,
116,
116,
105,
110,
103,
44,
117,
112,
100,
97,
116,
101,
95,
109,
97,
115,
107,
]),
],
578365826: [
new Uint8Array([
43,
58,
12,
117,
115,
101,
114,
95,
115,
101,
116,
116,
105,
110,
103,
50,
27,
47,
97,
112,
105,
47,
118,
49,
47,
117,
115,
101,
114,
115,
47,
123,
105,
100,
125,
47,
115,
101,
116,
116,
105,
110,
103,
115,
]),
],
},
},
},
},
} as const;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,990 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/workspace_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { FieldMask } from "../../google/protobuf/field_mask";
import { Visibility, visibilityFromJSON, visibilityToNumber } from "./common";
import { Subscription } from "./subscription_service";
export const protobufPackage = "slash.api.v1";
export interface WorkspaceProfile {
/** Current workspace mode: dev, prod. */
mode: string;
/** Current workspace version. */
version: string;
/**
* The owner name.
* Format: "users/{id}"
*/
owner: string;
/** The workspace subscription. */
subscription?:
| Subscription
| undefined;
/** The custom style. */
customStyle: string;
/** The workspace branding. */
branding: Uint8Array;
}
export interface WorkspaceSetting {
/** The url of instance. */
instanceUrl: string;
/** The workspace custome branding. */
branding: Uint8Array;
/** The custom style. */
customStyle: string;
/** The default visibility of shortcuts and collections. */
defaultVisibility: Visibility;
/** The identity providers. */
identityProviders: IdentityProvider[];
/** Whether to disallow user registration by email&password. */
disallowUserRegistration: boolean;
/** Whether to disallow password authentication. */
disallowPasswordAuth: boolean;
}
export interface IdentityProvider {
/** The unique identifier of the identity provider. */
id: string;
title: string;
type: IdentityProvider_Type;
config?: IdentityProviderConfig | undefined;
}
export enum IdentityProvider_Type {
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
OAUTH2 = "OAUTH2",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function identityProvider_TypeFromJSON(object: any): IdentityProvider_Type {
switch (object) {
case 0:
case "TYPE_UNSPECIFIED":
return IdentityProvider_Type.TYPE_UNSPECIFIED;
case 1:
case "OAUTH2":
return IdentityProvider_Type.OAUTH2;
case -1:
case "UNRECOGNIZED":
default:
return IdentityProvider_Type.UNRECOGNIZED;
}
}
export function identityProvider_TypeToNumber(object: IdentityProvider_Type): number {
switch (object) {
case IdentityProvider_Type.TYPE_UNSPECIFIED:
return 0;
case IdentityProvider_Type.OAUTH2:
return 1;
case IdentityProvider_Type.UNRECOGNIZED:
default:
return -1;
}
}
export interface IdentityProviderConfig {
oauth2?: IdentityProviderConfig_OAuth2Config | undefined;
}
export interface IdentityProviderConfig_FieldMapping {
identifier: string;
displayName: string;
}
export interface IdentityProviderConfig_OAuth2Config {
clientId: string;
clientSecret: string;
authUrl: string;
tokenUrl: string;
userInfoUrl: string;
scopes: string[];
fieldMapping?: IdentityProviderConfig_FieldMapping | undefined;
}
export interface GetWorkspaceProfileRequest {
}
export interface GetWorkspaceSettingRequest {
}
export interface UpdateWorkspaceSettingRequest {
/** The user setting. */
setting?:
| WorkspaceSetting
| undefined;
/** The update mask. */
updateMask?: string[] | undefined;
}
function createBaseWorkspaceProfile(): WorkspaceProfile {
return { mode: "", version: "", owner: "", subscription: undefined, customStyle: "", branding: new Uint8Array(0) };
}
export const WorkspaceProfile: MessageFns<WorkspaceProfile> = {
encode(message: WorkspaceProfile, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.mode !== "") {
writer.uint32(10).string(message.mode);
}
if (message.version !== "") {
writer.uint32(18).string(message.version);
}
if (message.owner !== "") {
writer.uint32(26).string(message.owner);
}
if (message.subscription !== undefined) {
Subscription.encode(message.subscription, writer.uint32(34).fork()).join();
}
if (message.customStyle !== "") {
writer.uint32(42).string(message.customStyle);
}
if (message.branding.length !== 0) {
writer.uint32(50).bytes(message.branding);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceProfile {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceProfile();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.mode = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.version = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.owner = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.subscription = Subscription.decode(reader, reader.uint32());
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.customStyle = reader.string();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.branding = reader.bytes();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceProfile>): WorkspaceProfile {
return WorkspaceProfile.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceProfile>): WorkspaceProfile {
const message = createBaseWorkspaceProfile();
message.mode = object.mode ?? "";
message.version = object.version ?? "";
message.owner = object.owner ?? "";
message.subscription = (object.subscription !== undefined && object.subscription !== null)
? Subscription.fromPartial(object.subscription)
: undefined;
message.customStyle = object.customStyle ?? "";
message.branding = object.branding ?? new Uint8Array(0);
return message;
},
};
function createBaseWorkspaceSetting(): WorkspaceSetting {
return {
instanceUrl: "",
branding: new Uint8Array(0),
customStyle: "",
defaultVisibility: Visibility.VISIBILITY_UNSPECIFIED,
identityProviders: [],
disallowUserRegistration: false,
disallowPasswordAuth: false,
};
}
export const WorkspaceSetting: MessageFns<WorkspaceSetting> = {
encode(message: WorkspaceSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.instanceUrl !== "") {
writer.uint32(10).string(message.instanceUrl);
}
if (message.branding.length !== 0) {
writer.uint32(18).bytes(message.branding);
}
if (message.customStyle !== "") {
writer.uint32(26).string(message.customStyle);
}
if (message.defaultVisibility !== Visibility.VISIBILITY_UNSPECIFIED) {
writer.uint32(32).int32(visibilityToNumber(message.defaultVisibility));
}
for (const v of message.identityProviders) {
IdentityProvider.encode(v!, writer.uint32(42).fork()).join();
}
if (message.disallowUserRegistration !== false) {
writer.uint32(48).bool(message.disallowUserRegistration);
}
if (message.disallowPasswordAuth !== false) {
writer.uint32(56).bool(message.disallowPasswordAuth);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceUrl = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.branding = reader.bytes();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.customStyle = reader.string();
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.defaultVisibility = visibilityFromJSON(reader.int32());
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.identityProviders.push(IdentityProvider.decode(reader, reader.uint32()));
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.disallowUserRegistration = reader.bool();
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.disallowPasswordAuth = reader.bool();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
return WorkspaceSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
const message = createBaseWorkspaceSetting();
message.instanceUrl = object.instanceUrl ?? "";
message.branding = object.branding ?? new Uint8Array(0);
message.customStyle = object.customStyle ?? "";
message.defaultVisibility = object.defaultVisibility ?? Visibility.VISIBILITY_UNSPECIFIED;
message.identityProviders = object.identityProviders?.map((e) => IdentityProvider.fromPartial(e)) || [];
message.disallowUserRegistration = object.disallowUserRegistration ?? false;
message.disallowPasswordAuth = object.disallowPasswordAuth ?? false;
return message;
},
};
function createBaseIdentityProvider(): IdentityProvider {
return { id: "", title: "", type: IdentityProvider_Type.TYPE_UNSPECIFIED, config: undefined };
}
export const IdentityProvider: MessageFns<IdentityProvider> = {
encode(message: IdentityProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
}
if (message.type !== IdentityProvider_Type.TYPE_UNSPECIFIED) {
writer.uint32(24).int32(identityProvider_TypeToNumber(message.type));
}
if (message.config !== undefined) {
IdentityProviderConfig.encode(message.config, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProvider {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProvider();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.title = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.type = identityProvider_TypeFromJSON(reader.int32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.config = IdentityProviderConfig.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProvider>): IdentityProvider {
return IdentityProvider.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProvider>): IdentityProvider {
const message = createBaseIdentityProvider();
message.id = object.id ?? "";
message.title = object.title ?? "";
message.type = object.type ?? IdentityProvider_Type.TYPE_UNSPECIFIED;
message.config = (object.config !== undefined && object.config !== null)
? IdentityProviderConfig.fromPartial(object.config)
: undefined;
return message;
},
};
function createBaseIdentityProviderConfig(): IdentityProviderConfig {
return { oauth2: undefined };
}
export const IdentityProviderConfig: MessageFns<IdentityProviderConfig> = {
encode(message: IdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.oauth2 !== undefined) {
IdentityProviderConfig_OAuth2Config.encode(message.oauth2, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.oauth2 = IdentityProviderConfig_OAuth2Config.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
return IdentityProviderConfig.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
const message = createBaseIdentityProviderConfig();
message.oauth2 = (object.oauth2 !== undefined && object.oauth2 !== null)
? IdentityProviderConfig_OAuth2Config.fromPartial(object.oauth2)
: undefined;
return message;
},
};
function createBaseIdentityProviderConfig_FieldMapping(): IdentityProviderConfig_FieldMapping {
return { identifier: "", displayName: "" };
}
export const IdentityProviderConfig_FieldMapping: MessageFns<IdentityProviderConfig_FieldMapping> = {
encode(message: IdentityProviderConfig_FieldMapping, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.identifier !== "") {
writer.uint32(10).string(message.identifier);
}
if (message.displayName !== "") {
writer.uint32(18).string(message.displayName);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig_FieldMapping {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig_FieldMapping();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.identifier = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.displayName = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig_FieldMapping>): IdentityProviderConfig_FieldMapping {
return IdentityProviderConfig_FieldMapping.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig_FieldMapping>): IdentityProviderConfig_FieldMapping {
const message = createBaseIdentityProviderConfig_FieldMapping();
message.identifier = object.identifier ?? "";
message.displayName = object.displayName ?? "";
return message;
},
};
function createBaseIdentityProviderConfig_OAuth2Config(): IdentityProviderConfig_OAuth2Config {
return {
clientId: "",
clientSecret: "",
authUrl: "",
tokenUrl: "",
userInfoUrl: "",
scopes: [],
fieldMapping: undefined,
};
}
export const IdentityProviderConfig_OAuth2Config: MessageFns<IdentityProviderConfig_OAuth2Config> = {
encode(message: IdentityProviderConfig_OAuth2Config, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
if (message.clientSecret !== "") {
writer.uint32(18).string(message.clientSecret);
}
if (message.authUrl !== "") {
writer.uint32(26).string(message.authUrl);
}
if (message.tokenUrl !== "") {
writer.uint32(34).string(message.tokenUrl);
}
if (message.userInfoUrl !== "") {
writer.uint32(42).string(message.userInfoUrl);
}
for (const v of message.scopes) {
writer.uint32(50).string(v!);
}
if (message.fieldMapping !== undefined) {
IdentityProviderConfig_FieldMapping.encode(message.fieldMapping, writer.uint32(58).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig_OAuth2Config {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig_OAuth2Config();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.clientId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.clientSecret = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.authUrl = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tokenUrl = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.userInfoUrl = reader.string();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.scopes.push(reader.string());
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.fieldMapping = IdentityProviderConfig_FieldMapping.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig_OAuth2Config>): IdentityProviderConfig_OAuth2Config {
return IdentityProviderConfig_OAuth2Config.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig_OAuth2Config>): IdentityProviderConfig_OAuth2Config {
const message = createBaseIdentityProviderConfig_OAuth2Config();
message.clientId = object.clientId ?? "";
message.clientSecret = object.clientSecret ?? "";
message.authUrl = object.authUrl ?? "";
message.tokenUrl = object.tokenUrl ?? "";
message.userInfoUrl = object.userInfoUrl ?? "";
message.scopes = object.scopes?.map((e) => e) || [];
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? IdentityProviderConfig_FieldMapping.fromPartial(object.fieldMapping)
: undefined;
return message;
},
};
function createBaseGetWorkspaceProfileRequest(): GetWorkspaceProfileRequest {
return {};
}
export const GetWorkspaceProfileRequest: MessageFns<GetWorkspaceProfileRequest> = {
encode(_: GetWorkspaceProfileRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetWorkspaceProfileRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetWorkspaceProfileRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetWorkspaceProfileRequest>): GetWorkspaceProfileRequest {
return GetWorkspaceProfileRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<GetWorkspaceProfileRequest>): GetWorkspaceProfileRequest {
const message = createBaseGetWorkspaceProfileRequest();
return message;
},
};
function createBaseGetWorkspaceSettingRequest(): GetWorkspaceSettingRequest {
return {};
}
export const GetWorkspaceSettingRequest: MessageFns<GetWorkspaceSettingRequest> = {
encode(_: GetWorkspaceSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GetWorkspaceSettingRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetWorkspaceSettingRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<GetWorkspaceSettingRequest>): GetWorkspaceSettingRequest {
return GetWorkspaceSettingRequest.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<GetWorkspaceSettingRequest>): GetWorkspaceSettingRequest {
const message = createBaseGetWorkspaceSettingRequest();
return message;
},
};
function createBaseUpdateWorkspaceSettingRequest(): UpdateWorkspaceSettingRequest {
return { setting: undefined, updateMask: undefined };
}
export const UpdateWorkspaceSettingRequest: MessageFns<UpdateWorkspaceSettingRequest> = {
encode(message: UpdateWorkspaceSettingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.setting !== undefined) {
WorkspaceSetting.encode(message.setting, writer.uint32(10).fork()).join();
}
if (message.updateMask !== undefined) {
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UpdateWorkspaceSettingRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateWorkspaceSettingRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.setting = WorkspaceSetting.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UpdateWorkspaceSettingRequest>): UpdateWorkspaceSettingRequest {
return UpdateWorkspaceSettingRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UpdateWorkspaceSettingRequest>): UpdateWorkspaceSettingRequest {
const message = createBaseUpdateWorkspaceSettingRequest();
message.setting = (object.setting !== undefined && object.setting !== null)
? WorkspaceSetting.fromPartial(object.setting)
: undefined;
message.updateMask = object.updateMask ?? undefined;
return message;
},
};
export type WorkspaceServiceDefinition = typeof WorkspaceServiceDefinition;
export const WorkspaceServiceDefinition = {
name: "WorkspaceService",
fullName: "slash.api.v1.WorkspaceService",
methods: {
getWorkspaceProfile: {
name: "GetWorkspaceProfile",
requestType: GetWorkspaceProfileRequest,
requestStream: false,
responseType: WorkspaceProfile,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
27,
18,
25,
47,
97,
112,
105,
47,
118,
49,
47,
119,
111,
114,
107,
115,
112,
97,
99,
101,
47,
112,
114,
111,
102,
105,
108,
101,
]),
],
},
},
},
getWorkspaceSetting: {
name: "GetWorkspaceSetting",
requestType: GetWorkspaceSettingRequest,
requestStream: false,
responseType: WorkspaceSetting,
responseStream: false,
options: {
_unknownFields: {
578365826: [
new Uint8Array([
27,
18,
25,
47,
97,
112,
105,
47,
118,
49,
47,
119,
111,
114,
107,
115,
112,
97,
99,
101,
47,
115,
101,
116,
116,
105,
110,
103,
]),
],
},
},
},
updateWorkspaceSetting: {
name: "UpdateWorkspaceSetting",
requestType: UpdateWorkspaceSettingRequest,
requestStream: false,
responseType: WorkspaceSetting,
responseStream: false,
options: {
_unknownFields: {
8410: [
new Uint8Array([
19,
115,
101,
116,
116,
105,
110,
103,
44,
117,
112,
100,
97,
116,
101,
95,
109,
97,
115,
107,
]),
],
578365826: [
new Uint8Array([
36,
58,
7,
115,
101,
116,
116,
105,
110,
103,
50,
25,
47,
97,
112,
105,
47,
118,
49,
47,
119,
111,
114,
107,
115,
112,
97,
99,
101,
47,
115,
101,
116,
116,
105,
110,
103,
]),
],
},
},
},
},
} as const;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,9 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/api/annotations.proto
/* eslint-disable */
export const protobufPackage = "google.api";
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,145 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/api/field_behavior.proto
/* eslint-disable */
export const protobufPackage = "google.api";
/**
* An indicator of the behavior of a given field (for example, that a field
* is required in requests, or given as output but ignored as input).
* This **does not** change the behavior in protocol buffers itself; it only
* denotes the behavior and may affect how API tooling handles the field.
*
* Note: This enum **may** receive new values in the future.
*/
export enum FieldBehavior {
/** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */
FIELD_BEHAVIOR_UNSPECIFIED = "FIELD_BEHAVIOR_UNSPECIFIED",
/**
* OPTIONAL - Specifically denotes a field as optional.
* While all fields in protocol buffers are optional, this may be specified
* for emphasis if appropriate.
*/
OPTIONAL = "OPTIONAL",
/**
* REQUIRED - Denotes a field as required.
* This indicates that the field **must** be provided as part of the request,
* and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
*/
REQUIRED = "REQUIRED",
/**
* OUTPUT_ONLY - Denotes a field as output only.
* This indicates that the field is provided in responses, but including the
* field in a request does nothing (the server *must* ignore it and
* *must not* throw an error as a result of the field's presence).
*/
OUTPUT_ONLY = "OUTPUT_ONLY",
/**
* INPUT_ONLY - Denotes a field as input only.
* This indicates that the field is provided in requests, and the
* corresponding field is not included in output.
*/
INPUT_ONLY = "INPUT_ONLY",
/**
* IMMUTABLE - Denotes a field as immutable.
* This indicates that the field may be set once in a request to create a
* resource, but may not be changed thereafter.
*/
IMMUTABLE = "IMMUTABLE",
/**
* UNORDERED_LIST - Denotes that a (repeated) field is an unordered list.
* This indicates that the service may provide the elements of the list
* in any arbitrary order, rather than the order the user originally
* provided. Additionally, the list's order may or may not be stable.
*/
UNORDERED_LIST = "UNORDERED_LIST",
/**
* NON_EMPTY_DEFAULT - Denotes that this field returns a non-empty default value if not set.
* This indicates that if the user provides the empty value in a request,
* a non-empty value will be returned. The user will not be aware of what
* non-empty value to expect.
*/
NON_EMPTY_DEFAULT = "NON_EMPTY_DEFAULT",
/**
* IDENTIFIER - Denotes that the field in a resource (a message annotated with
* google.api.resource) is used in the resource name to uniquely identify the
* resource. For AIP-compliant APIs, this should only be applied to the
* `name` field on the resource.
*
* This behavior should not be applied to references to other resources within
* the message.
*
* The identifier field of resources often have different field behavior
* depending on the request it is embedded in (e.g. for Create methods name
* is optional and unused, while for Update methods it is required). Instead
* of method-specific annotations, only `IDENTIFIER` is required.
*/
IDENTIFIER = "IDENTIFIER",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldBehaviorFromJSON(object: any): FieldBehavior {
switch (object) {
case 0:
case "FIELD_BEHAVIOR_UNSPECIFIED":
return FieldBehavior.FIELD_BEHAVIOR_UNSPECIFIED;
case 1:
case "OPTIONAL":
return FieldBehavior.OPTIONAL;
case 2:
case "REQUIRED":
return FieldBehavior.REQUIRED;
case 3:
case "OUTPUT_ONLY":
return FieldBehavior.OUTPUT_ONLY;
case 4:
case "INPUT_ONLY":
return FieldBehavior.INPUT_ONLY;
case 5:
case "IMMUTABLE":
return FieldBehavior.IMMUTABLE;
case 6:
case "UNORDERED_LIST":
return FieldBehavior.UNORDERED_LIST;
case 7:
case "NON_EMPTY_DEFAULT":
return FieldBehavior.NON_EMPTY_DEFAULT;
case 8:
case "IDENTIFIER":
return FieldBehavior.IDENTIFIER;
case -1:
case "UNRECOGNIZED":
default:
return FieldBehavior.UNRECOGNIZED;
}
}
export function fieldBehaviorToNumber(object: FieldBehavior): number {
switch (object) {
case FieldBehavior.FIELD_BEHAVIOR_UNSPECIFIED:
return 0;
case FieldBehavior.OPTIONAL:
return 1;
case FieldBehavior.REQUIRED:
return 2;
case FieldBehavior.OUTPUT_ONLY:
return 3;
case FieldBehavior.INPUT_ONLY:
return 4;
case FieldBehavior.IMMUTABLE:
return 5;
case FieldBehavior.UNORDERED_LIST:
return 6;
case FieldBehavior.NON_EMPTY_DEFAULT:
return 7;
case FieldBehavior.IDENTIFIER:
return 8;
case FieldBehavior.UNRECOGNIZED:
default:
return -1;
}
}
@@ -0,0 +1,678 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/api/http.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "google.api";
/**
* Defines the HTTP configuration for an API service. It contains a list of
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
* to one or more HTTP REST API methods.
*/
export interface Http {
/**
* A list of HTTP configuration rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
*/
rules: HttpRule[];
/**
* When set to true, URL path parameters will be fully URI-decoded except in
* cases of single segment matches in reserved expansion, where "%2F" will be
* left encoded.
*
* The default behavior is to not decode RFC 6570 reserved characters in multi
* segment matches.
*/
fullyDecodeReservedExpansion: boolean;
}
/**
* # gRPC Transcoding
*
* gRPC Transcoding is a feature for mapping between a gRPC method and one or
* more HTTP REST endpoints. It allows developers to build a single API service
* that supports both gRPC APIs and REST APIs. Many systems, including [Google
* APIs](https://github.com/googleapis/googleapis),
* [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
* Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
* and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
* and use it for large scale production services.
*
* `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
* how different portions of the gRPC request message are mapped to the URL
* path, URL query parameters, and HTTP request body. It also controls how the
* gRPC response message is mapped to the HTTP response body. `HttpRule` is
* typically specified as an `google.api.http` annotation on the gRPC method.
*
* Each mapping specifies a URL path template and an HTTP method. The path
* template may refer to one or more fields in the gRPC request message, as long
* as each field is a non-repeated field with a primitive (non-message) type.
* The path template controls how fields of the request message are mapped to
* the URL path.
*
* Example:
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http) = {
* get: "/v1/{name=messages/*}"
* };
* }
* }
* message GetMessageRequest {
* string name = 1; // Mapped to URL path.
* }
* message Message {
* string text = 1; // The resource content.
* }
*
* This enables an HTTP REST to gRPC mapping as below:
*
* HTTP | gRPC
* -----|-----
* `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
*
* Any fields in the request message which are not bound by the path template
* automatically become HTTP query parameters if there is no HTTP request body.
* For example:
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http) = {
* get:"/v1/messages/{message_id}"
* };
* }
* }
* message GetMessageRequest {
* message SubMessage {
* string subfield = 1;
* }
* string message_id = 1; // Mapped to URL path.
* int64 revision = 2; // Mapped to URL query parameter `revision`.
* SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
* }
*
* This enables a HTTP JSON to RPC mapping as below:
*
* HTTP | gRPC
* -----|-----
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
* `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
* "foo"))`
*
* Note that fields which are mapped to URL query parameters must have a
* primitive type or a repeated primitive type or a non-repeated message type.
* In the case of a repeated type, the parameter can be repeated in the URL
* as `...?param=A&param=B`. In the case of a message type, each field of the
* message is mapped to a separate parameter, such as
* `...?foo.a=A&foo.b=B&foo.c=C`.
*
* For HTTP methods that allow a request body, the `body` field
* specifies the mapping. Consider a REST update method on the
* message resource collection:
*
* service Messaging {
* rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
* option (google.api.http) = {
* patch: "/v1/messages/{message_id}"
* body: "message"
* };
* }
* }
* message UpdateMessageRequest {
* string message_id = 1; // mapped to the URL
* Message message = 2; // mapped to the body
* }
*
* The following HTTP JSON to RPC mapping is enabled, where the
* representation of the JSON in the request body is determined by
* protos JSON encoding:
*
* HTTP | gRPC
* -----|-----
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
* "123456" message { text: "Hi!" })`
*
* The special name `*` can be used in the body mapping to define that
* every field not bound by the path template should be mapped to the
* request body. This enables the following alternative definition of
* the update method:
*
* service Messaging {
* rpc UpdateMessage(Message) returns (Message) {
* option (google.api.http) = {
* patch: "/v1/messages/{message_id}"
* body: "*"
* };
* }
* }
* message Message {
* string message_id = 1;
* string text = 2;
* }
*
* The following HTTP JSON to RPC mapping is enabled:
*
* HTTP | gRPC
* -----|-----
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
* "123456" text: "Hi!")`
*
* Note that when using `*` in the body mapping, it is not possible to
* have HTTP parameters, as all fields not bound by the path end in
* the body. This makes this option more rarely used in practice when
* defining REST APIs. The common usage of `*` is in custom methods
* which don't use the URL at all for transferring data.
*
* It is possible to define multiple HTTP methods for one RPC by using
* the `additional_bindings` option. Example:
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http) = {
* get: "/v1/messages/{message_id}"
* additional_bindings {
* get: "/v1/users/{user_id}/messages/{message_id}"
* }
* };
* }
* }
* message GetMessageRequest {
* string message_id = 1;
* string user_id = 2;
* }
*
* This enables the following two alternative HTTP JSON to RPC mappings:
*
* HTTP | gRPC
* -----|-----
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
* "123456")`
*
* ## Rules for HTTP mapping
*
* 1. Leaf request fields (recursive expansion nested messages in the request
* message) are classified into three categories:
* - Fields referred by the path template. They are passed via the URL path.
* - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
* are passed via the HTTP
* request body.
* - All other fields are passed via the URL query parameters, and the
* parameter name is the field path in the request message. A repeated
* field can be represented as multiple query parameters under the same
* name.
* 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
* query parameter, all fields
* are passed via URL path and HTTP request body.
* 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
* request body, all
* fields are passed via URL path and URL query parameters.
*
* ### Path template syntax
*
* Template = "/" Segments [ Verb ] ;
* Segments = Segment { "/" Segment } ;
* Segment = "*" | "**" | LITERAL | Variable ;
* Variable = "{" FieldPath [ "=" Segments ] "}" ;
* FieldPath = IDENT { "." IDENT } ;
* Verb = ":" LITERAL ;
*
* The syntax `*` matches a single URL path segment. The syntax `**` matches
* zero or more URL path segments, which must be the last part of the URL path
* except the `Verb`.
*
* The syntax `Variable` matches part of the URL path as specified by its
* template. A variable template must not contain other variables. If a variable
* matches a single path segment, its template may be omitted, e.g. `{var}`
* is equivalent to `{var=*}`.
*
* The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
* contains any reserved character, such characters should be percent-encoded
* before the matching.
*
* If a variable contains exactly one path segment, such as `"{var}"` or
* `"{var=*}"`, when such a variable is expanded into a URL path on the client
* side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
* server side does the reverse decoding. Such variables show up in the
* [Discovery
* Document](https://developers.google.com/discovery/v1/reference/apis) as
* `{var}`.
*
* If a variable contains multiple path segments, such as `"{var=foo/*}"`
* or `"{var=**}"`, when such a variable is expanded into a URL path on the
* client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
* The server side does the reverse decoding, except "%2F" and "%2f" are left
* unchanged. Such variables show up in the
* [Discovery
* Document](https://developers.google.com/discovery/v1/reference/apis) as
* `{+var}`.
*
* ## Using gRPC API Service Configuration
*
* gRPC API Service Configuration (service config) is a configuration language
* for configuring a gRPC service to become a user-facing product. The
* service config is simply the YAML representation of the `google.api.Service`
* proto message.
*
* As an alternative to annotating your proto file, you can configure gRPC
* transcoding in your service config YAML files. You do this by specifying a
* `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
* effect as the proto annotation. This can be particularly useful if you
* have a proto that is reused in multiple services. Note that any transcoding
* specified in the service config will override any matching transcoding
* configuration in the proto.
*
* Example:
*
* http:
* rules:
* # Selects a gRPC method and applies HttpRule to it.
* - selector: example.v1.Messaging.GetMessage
* get: /v1/messages/{message_id}/{sub.subfield}
*
* ## Special notes
*
* When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
* proto to JSON conversion must follow the [proto3
* specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
*
* While the single segment variable follows the semantics of
* [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
* Expansion, the multi segment variable **does not** follow RFC 6570 Section
* 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
* does not expand special characters like `?` and `#`, which would lead
* to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
* for multi segment variables.
*
* The path variables **must not** refer to any repeated or mapped field,
* because client libraries are not capable of handling such variable expansion.
*
* The path variables **must not** capture the leading "/" character. The reason
* is that the most common use case "{var}" does not capture the leading "/"
* character. For consistency, all path variables must share the same behavior.
*
* Repeated message fields must not be mapped to URL query parameters, because
* no client library can support such complicated mapping.
*
* If an API needs to use a JSON array for request or response body, it can map
* the request or response body to a repeated field. However, some gRPC
* Transcoding implementations may not support this feature.
*/
export interface HttpRule {
/**
* Selects a method to which this rule applies.
*
* Refer to [selector][google.api.DocumentationRule.selector] for syntax
* details.
*/
selector: string;
/**
* Maps to HTTP GET. Used for listing and getting information about
* resources.
*/
get?:
| string
| undefined;
/** Maps to HTTP PUT. Used for replacing a resource. */
put?:
| string
| undefined;
/** Maps to HTTP POST. Used for creating a resource or performing an action. */
post?:
| string
| undefined;
/** Maps to HTTP DELETE. Used for deleting a resource. */
delete?:
| string
| undefined;
/** Maps to HTTP PATCH. Used for updating a resource. */
patch?:
| string
| undefined;
/**
* The custom pattern is used for specifying an HTTP method that is not
* included in the `pattern` field, such as HEAD, or "*" to leave the
* HTTP method unspecified for this rule. The wild-card rule is useful
* for services that provide content to Web (HTML) clients.
*/
custom?:
| CustomHttpPattern
| undefined;
/**
* The name of the request field whose value is mapped to the HTTP request
* body, or `*` for mapping all request fields not captured by the path
* pattern to the HTTP body, or omitted for not having any HTTP request body.
*
* NOTE: the referred field must be present at the top-level of the request
* message type.
*/
body: string;
/**
* Optional. The name of the response field whose value is mapped to the HTTP
* response body. When omitted, the entire response message will be used
* as the HTTP response body.
*
* NOTE: The referred field must be present at the top-level of the response
* message type.
*/
responseBody: string;
/**
* Additional HTTP bindings for the selector. Nested bindings must
* not contain an `additional_bindings` field themselves (that is,
* the nesting may only be one level deep).
*/
additionalBindings: HttpRule[];
}
/** A custom pattern is used for defining custom HTTP verb. */
export interface CustomHttpPattern {
/** The name of this custom HTTP verb. */
kind: string;
/** The path matched by this custom verb. */
path: string;
}
function createBaseHttp(): Http {
return { rules: [], fullyDecodeReservedExpansion: false };
}
export const Http: MessageFns<Http> = {
encode(message: Http, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.rules) {
HttpRule.encode(v!, writer.uint32(10).fork()).join();
}
if (message.fullyDecodeReservedExpansion !== false) {
writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Http {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseHttp();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.rules.push(HttpRule.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.fullyDecodeReservedExpansion = reader.bool();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Http>): Http {
return Http.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Http>): Http {
const message = createBaseHttp();
message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || [];
message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false;
return message;
},
};
function createBaseHttpRule(): HttpRule {
return {
selector: "",
get: undefined,
put: undefined,
post: undefined,
delete: undefined,
patch: undefined,
custom: undefined,
body: "",
responseBody: "",
additionalBindings: [],
};
}
export const HttpRule: MessageFns<HttpRule> = {
encode(message: HttpRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.selector !== "") {
writer.uint32(10).string(message.selector);
}
if (message.get !== undefined) {
writer.uint32(18).string(message.get);
}
if (message.put !== undefined) {
writer.uint32(26).string(message.put);
}
if (message.post !== undefined) {
writer.uint32(34).string(message.post);
}
if (message.delete !== undefined) {
writer.uint32(42).string(message.delete);
}
if (message.patch !== undefined) {
writer.uint32(50).string(message.patch);
}
if (message.custom !== undefined) {
CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).join();
}
if (message.body !== "") {
writer.uint32(58).string(message.body);
}
if (message.responseBody !== "") {
writer.uint32(98).string(message.responseBody);
}
for (const v of message.additionalBindings) {
HttpRule.encode(v!, writer.uint32(90).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): HttpRule {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseHttpRule();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.selector = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.get = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.put = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.post = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.delete = reader.string();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.patch = reader.string();
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.custom = CustomHttpPattern.decode(reader, reader.uint32());
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.body = reader.string();
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.responseBody = reader.string();
continue;
}
case 11: {
if (tag !== 90) {
break;
}
message.additionalBindings.push(HttpRule.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<HttpRule>): HttpRule {
return HttpRule.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<HttpRule>): HttpRule {
const message = createBaseHttpRule();
message.selector = object.selector ?? "";
message.get = object.get ?? undefined;
message.put = object.put ?? undefined;
message.post = object.post ?? undefined;
message.delete = object.delete ?? undefined;
message.patch = object.patch ?? undefined;
message.custom = (object.custom !== undefined && object.custom !== null)
? CustomHttpPattern.fromPartial(object.custom)
: undefined;
message.body = object.body ?? "";
message.responseBody = object.responseBody ?? "";
message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [];
return message;
},
};
function createBaseCustomHttpPattern(): CustomHttpPattern {
return { kind: "", path: "" };
}
export const CustomHttpPattern: MessageFns<CustomHttpPattern> = {
encode(message: CustomHttpPattern, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.kind !== "") {
writer.uint32(10).string(message.kind);
}
if (message.path !== "") {
writer.uint32(18).string(message.path);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCustomHttpPattern();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.kind = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.path = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
return CustomHttpPattern.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
const message = createBaseCustomHttpPattern();
message.kind = object.kind ?? "";
message.path = object.path ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,121 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/api/launch_stage.proto
/* eslint-disable */
export const protobufPackage = "google.api";
/**
* The launch stage as defined by [Google Cloud Platform
* Launch Stages](https://cloud.google.com/terms/launch-stages).
*/
export enum LaunchStage {
/** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */
LAUNCH_STAGE_UNSPECIFIED = "LAUNCH_STAGE_UNSPECIFIED",
/** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */
UNIMPLEMENTED = "UNIMPLEMENTED",
/** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */
PRELAUNCH = "PRELAUNCH",
/**
* EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use
* these features, you must sign up in advance and sign a Trusted Tester
* agreement (which includes confidentiality provisions). These features may
* be unstable, changed in backward-incompatible ways, and are not
* guaranteed to be released.
*/
EARLY_ACCESS = "EARLY_ACCESS",
/**
* ALPHA - Alpha is a limited availability test for releases before they are cleared
* for widespread use. By Alpha, all significant design issues are resolved
* and we are in the process of verifying functionality. Alpha customers
* need to apply for access, agree to applicable terms, and have their
* projects allowlisted. Alpha releases don't have to be feature complete,
* no SLAs are provided, and there are no technical support obligations, but
* they will be far enough along that customers can actually use them in
* test environments or for limited-use tests -- just like they would in
* normal production cases.
*/
ALPHA = "ALPHA",
/**
* BETA - Beta is the point at which we are ready to open a release for any
* customer to use. There are no SLA or technical support obligations in a
* Beta release. Products will be complete from a feature perspective, but
* may have some open outstanding issues. Beta releases are suitable for
* limited production use cases.
*/
BETA = "BETA",
/**
* GA - GA features are open to all developers and are considered stable and
* fully qualified for production use.
*/
GA = "GA",
/**
* DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more
* information, see the "Deprecation Policy" section of our [Terms of
* Service](https://cloud.google.com/terms/)
* and the [Google Cloud Platform Subject to the Deprecation
* Policy](https://cloud.google.com/terms/deprecation) documentation.
*/
DEPRECATED = "DEPRECATED",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function launchStageFromJSON(object: any): LaunchStage {
switch (object) {
case 0:
case "LAUNCH_STAGE_UNSPECIFIED":
return LaunchStage.LAUNCH_STAGE_UNSPECIFIED;
case 6:
case "UNIMPLEMENTED":
return LaunchStage.UNIMPLEMENTED;
case 7:
case "PRELAUNCH":
return LaunchStage.PRELAUNCH;
case 1:
case "EARLY_ACCESS":
return LaunchStage.EARLY_ACCESS;
case 2:
case "ALPHA":
return LaunchStage.ALPHA;
case 3:
case "BETA":
return LaunchStage.BETA;
case 4:
case "GA":
return LaunchStage.GA;
case 5:
case "DEPRECATED":
return LaunchStage.DEPRECATED;
case -1:
case "UNRECOGNIZED":
default:
return LaunchStage.UNRECOGNIZED;
}
}
export function launchStageToNumber(object: LaunchStage): number {
switch (object) {
case LaunchStage.LAUNCH_STAGE_UNSPECIFIED:
return 0;
case LaunchStage.UNIMPLEMENTED:
return 6;
case LaunchStage.PRELAUNCH:
return 7;
case LaunchStage.EARLY_ACCESS:
return 1;
case LaunchStage.ALPHA:
return 2;
case LaunchStage.BETA:
return 3;
case LaunchStage.GA:
return 4;
case LaunchStage.DEPRECATED:
return 5;
case LaunchStage.UNRECOGNIZED:
default:
return -1;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,172 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/protobuf/duration.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "google.protobuf";
/**
* A Duration represents a signed, fixed-length span of time represented
* as a count of seconds and fractions of seconds at nanosecond
* resolution. It is independent of any calendar and concepts like "day"
* or "month". It is related to Timestamp in that the difference between
* two Timestamp values is a Duration and it can be added or subtracted
* from a Timestamp. Range is approximately +-10,000 years.
*
* # Examples
*
* Example 1: Compute Duration from two Timestamps in pseudo code.
*
* Timestamp start = ...;
* Timestamp end = ...;
* Duration duration = ...;
*
* duration.seconds = end.seconds - start.seconds;
* duration.nanos = end.nanos - start.nanos;
*
* if (duration.seconds < 0 && duration.nanos > 0) {
* duration.seconds += 1;
* duration.nanos -= 1000000000;
* } else if (duration.seconds > 0 && duration.nanos < 0) {
* duration.seconds -= 1;
* duration.nanos += 1000000000;
* }
*
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
*
* Timestamp start = ...;
* Duration duration = ...;
* Timestamp end = ...;
*
* end.seconds = start.seconds + duration.seconds;
* end.nanos = start.nanos + duration.nanos;
*
* if (end.nanos < 0) {
* end.seconds -= 1;
* end.nanos += 1000000000;
* } else if (end.nanos >= 1000000000) {
* end.seconds += 1;
* end.nanos -= 1000000000;
* }
*
* Example 3: Compute Duration from datetime.timedelta in Python.
*
* td = datetime.timedelta(days=3, minutes=10)
* duration = Duration()
* duration.FromTimedelta(td)
*
* # JSON Mapping
*
* In JSON format, the Duration type is encoded as a string rather than an
* object, where the string ends in the suffix "s" (indicating seconds) and
* is preceded by the number of seconds, with nanoseconds expressed as
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
* microsecond should be expressed in JSON format as "3.000001s".
*/
export interface Duration {
/**
* Signed seconds of the span of time. Must be from -315,576,000,000
* 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;
/**
* Signed fractions of a second at nanosecond resolution of the span
* of time. Durations less than one second are represented with a 0
* `seconds` field and a positive or negative `nanos` field. For durations
* of one second or more, a non-zero value for the `nanos` field must be
* of the same sign as the `seconds` field. Must be from -999,999,999
* to +999,999,999 inclusive.
*/
nanos: number;
}
function createBaseDuration(): Duration {
return { seconds: 0, nanos: 0 };
}
export const Duration: MessageFns<Duration> = {
encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.seconds !== 0) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
writer.uint32(16).int32(message.nanos);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Duration {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDuration();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.seconds = longToNumber(reader.int64());
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.nanos = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Duration>): Duration {
return Duration.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Duration>): Duration {
const message = createBaseDuration();
message.seconds = object.seconds ?? 0;
message.nanos = object.nanos ?? 0;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function longToNumber(int64: { toString(): string }): number {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
}
return num;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,71 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/protobuf/empty.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "google.protobuf";
/**
* A generic empty message that you can re-use to avoid defining duplicated
* empty messages in your APIs. A typical example is to use it as the request
* or the response type of an API method. For instance:
*
* service Foo {
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
* }
*/
export interface Empty {
}
function createBaseEmpty(): Empty {
return {};
}
export const Empty: MessageFns<Empty> = {
encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Empty {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEmpty();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Empty>): Empty {
return Empty.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<Empty>): Empty {
const message = createBaseEmpty();
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,291 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/protobuf/field_mask.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "google.protobuf";
/**
* `FieldMask` represents a set of symbolic field paths, for example:
*
* paths: "f.a"
* paths: "f.b.d"
*
* Here `f` represents a field in some root message, `a` and `b`
* fields in the message found in `f`, and `d` a field found in the
* message in `f.b`.
*
* Field masks are used to specify a subset of fields that should be
* returned by a get operation or modified by an update operation.
* Field masks also have a custom JSON encoding (see below).
*
* # Field Masks in Projections
*
* When used in the context of a projection, a response message or
* sub-message is filtered by the API to only contain those fields as
* specified in the mask. For example, if the mask in the previous
* example is applied to a response message as follows:
*
* f {
* a : 22
* b {
* d : 1
* x : 2
* }
* y : 13
* }
* z: 8
*
* The result will not contain specific values for fields x,y and z
* (their value will be set to the default, and omitted in proto text
* output):
*
* f {
* a : 22
* b {
* d : 1
* }
* }
*
* A repeated field is not allowed except at the last position of a
* paths string.
*
* If a FieldMask object is not present in a get operation, the
* operation applies to all fields (as if a FieldMask of all fields
* had been specified).
*
* Note that a field mask does not necessarily apply to the
* top-level response message. In case of a REST get operation, the
* field mask applies directly to the response, but in case of a REST
* list operation, the mask instead applies to each individual message
* in the returned resource list. In case of a REST custom method,
* other definitions may be used. Where the mask applies will be
* clearly documented together with its declaration in the API. In
* any case, the effect on the returned resource/resources is required
* behavior for APIs.
*
* # Field Masks in Update Operations
*
* A field mask in update operations specifies which fields of the
* targeted resource are going to be updated. The API is required
* to only change the values of the fields as specified in the mask
* and leave the others untouched. If a resource is passed in to
* describe the updated values, the API ignores the values of all
* fields not covered by the mask.
*
* If a repeated field is specified for an update operation, new values will
* be appended to the existing repeated field in the target resource. Note that
* a repeated field is only allowed in the last position of a `paths` string.
*
* If a sub-message is specified in the last position of the field mask for an
* update operation, then new value will be merged into the existing sub-message
* in the target resource.
*
* For example, given the target message:
*
* f {
* b {
* d: 1
* x: 2
* }
* c: [1]
* }
*
* And an update message:
*
* f {
* b {
* d: 10
* }
* c: [2]
* }
*
* then if the field mask is:
*
* paths: ["f.b", "f.c"]
*
* then the result will be:
*
* f {
* b {
* d: 10
* x: 2
* }
* c: [1, 2]
* }
*
* An implementation may provide options to override this default behavior for
* repeated and message fields.
*
* In order to reset a field's value to the default, the field must
* be in the mask and set to the default value in the provided resource.
* Hence, in order to reset all fields of a resource, provide a default
* instance of the resource and set all fields in the mask, or do
* not provide a mask as described below.
*
* If a field mask is not present on update, the operation applies to
* all fields (as if a field mask of all fields has been specified).
* Note that in the presence of schema evolution, this may mean that
* fields the client does not know and has therefore not filled into
* the request will be reset to their default. If this is unwanted
* behavior, a specific service may require a client to always specify
* a field mask, producing an error if not.
*
* As with get operations, the location of the resource which
* describes the updated values in the request message depends on the
* operation kind. In any case, the effect of the field mask is
* required to be honored by the API.
*
* ## Considerations for HTTP REST
*
* The HTTP kind of an update operation which uses a field mask must
* be set to PATCH instead of PUT in order to satisfy HTTP semantics
* (PUT must only be used for full updates).
*
* # JSON Encoding of Field Masks
*
* In JSON, a field mask is encoded as a single string where paths are
* separated by a comma. Fields name in each path are converted
* to/from lower-camel naming conventions.
*
* As an example, consider the following message declarations:
*
* message Profile {
* User user = 1;
* Photo photo = 2;
* }
* message User {
* string display_name = 1;
* string address = 2;
* }
*
* In proto a field mask for `Profile` may look as such:
*
* mask {
* paths: "user.display_name"
* paths: "photo"
* }
*
* In JSON, the same mask is represented as below:
*
* {
* mask: "user.displayName,photo"
* }
*
* # Field Masks and Oneof Fields
*
* Field masks treat fields in oneofs just as regular fields. Consider the
* following message:
*
* message SampleMessage {
* oneof test_oneof {
* string name = 4;
* SubMessage sub_message = 9;
* }
* }
*
* The field mask can be:
*
* mask {
* paths: "name"
* }
*
* Or:
*
* mask {
* paths: "sub_message"
* }
*
* Note that oneof type names ("test_oneof" in this case) cannot be used in
* paths.
*
* ## Field Mask Verification
*
* The implementation of any API method which has a FieldMask type field in the
* request should verify the included field paths, and return an
* `INVALID_ARGUMENT` error if any path is unmappable.
*/
export interface FieldMask {
/** The set of field mask paths. */
paths: string[];
}
function createBaseFieldMask(): FieldMask {
return { paths: [] };
}
export const FieldMask: MessageFns<FieldMask> & FieldMaskWrapperFns = {
encode(message: FieldMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.paths) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): FieldMask {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseFieldMask();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.paths.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<FieldMask>): FieldMask {
return FieldMask.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<FieldMask>): FieldMask {
const message = createBaseFieldMask();
message.paths = object.paths?.map((e) => e) || [];
return message;
},
wrap(paths: string[]): FieldMask {
const result = createBaseFieldMask();
result.paths = paths;
return result;
},
unwrap(message: FieldMask): string[] {
return message.paths;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
export interface FieldMaskWrapperFns {
wrap(paths: string[]): FieldMask;
unwrap(message: FieldMask): string[];
}
@@ -0,0 +1,201 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: google/protobuf/timestamp.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "google.protobuf";
/**
* A Timestamp represents a point in time independent of any time zone or local
* calendar, encoded as a count of seconds and fractions of seconds at
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
* January 1, 1970, in the proleptic Gregorian calendar which extends the
* Gregorian calendar backwards to year one.
*
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
* second table is needed for interpretation, using a [24-hour linear
* smear](https://developers.google.com/time/smear).
*
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
* restricting to that range, we ensure that we can convert to and from [RFC
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
*
* # Examples
*
* Example 1: Compute Timestamp from POSIX `time()`.
*
* Timestamp timestamp;
* timestamp.set_seconds(time(NULL));
* timestamp.set_nanos(0);
*
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
*
* struct timeval tv;
* gettimeofday(&tv, NULL);
*
* Timestamp timestamp;
* timestamp.set_seconds(tv.tv_sec);
* timestamp.set_nanos(tv.tv_usec * 1000);
*
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
*
* FILETIME ft;
* GetSystemTimeAsFileTime(&ft);
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
*
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
* Timestamp timestamp;
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
*
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
*
* long millis = System.currentTimeMillis();
*
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
* .setNanos((int) ((millis % 1000) * 1000000)).build();
*
* Example 5: Compute Timestamp from Java `Instant.now()`.
*
* Instant now = Instant.now();
*
* Timestamp timestamp =
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
* .setNanos(now.getNano()).build();
*
* Example 6: Compute Timestamp from current time in Python.
*
* timestamp = Timestamp()
* timestamp.GetCurrentTime()
*
* # JSON Mapping
*
* In JSON format, the Timestamp type is encoded as a string in the
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
* where {year} is always expressed using four digits while {month}, {day},
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
* is required. A proto3 JSON serializer should always use UTC (as indicated by
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
* able to accept both UTC and other timezones (as indicated by an offset).
*
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
* 01:30 UTC on January 15, 2017.
*
* In JavaScript, one can convert a Date object to this format using the
* standard
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.
*/
export interface Timestamp {
/**
* Represents seconds of UTC time since Unix epoch
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
* 9999-12-31T23:59:59Z inclusive.
*/
seconds: number;
/**
* Non-negative fractions of a second at nanosecond resolution. Negative
* second values with fractions must still have non-negative nanos values
* that count forward in time. Must be from 0 to 999,999,999
* inclusive.
*/
nanos: number;
}
function createBaseTimestamp(): Timestamp {
return { seconds: 0, nanos: 0 };
}
export const Timestamp: MessageFns<Timestamp> = {
encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.seconds !== 0) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
writer.uint32(16).int32(message.nanos);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTimestamp();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.seconds = longToNumber(reader.int64());
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.nanos = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Timestamp>): Timestamp {
return Timestamp.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
const message = createBaseTimestamp();
message.seconds = object.seconds ?? 0;
message.nanos = object.nanos ?? 0;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function longToNumber(int64: { toString(): string }): number {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
}
return num;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,302 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/activity.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "slash.store";
export interface ActivityShorcutCreatePayload {
shortcutId: number;
}
export interface ActivityShorcutViewPayload {
shortcutId: number;
ip: string;
referer: string;
userAgent: string;
params: { [key: string]: ActivityShorcutViewPayload_ValueList };
}
export interface ActivityShorcutViewPayload_ParamsEntry {
key: string;
value?: ActivityShorcutViewPayload_ValueList | undefined;
}
export interface ActivityShorcutViewPayload_ValueList {
values: string[];
}
function createBaseActivityShorcutCreatePayload(): ActivityShorcutCreatePayload {
return { shortcutId: 0 };
}
export const ActivityShorcutCreatePayload: MessageFns<ActivityShorcutCreatePayload> = {
encode(message: ActivityShorcutCreatePayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.shortcutId !== 0) {
writer.uint32(8).int32(message.shortcutId);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ActivityShorcutCreatePayload {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseActivityShorcutCreatePayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.shortcutId = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ActivityShorcutCreatePayload>): ActivityShorcutCreatePayload {
return ActivityShorcutCreatePayload.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<ActivityShorcutCreatePayload>): ActivityShorcutCreatePayload {
const message = createBaseActivityShorcutCreatePayload();
message.shortcutId = object.shortcutId ?? 0;
return message;
},
};
function createBaseActivityShorcutViewPayload(): ActivityShorcutViewPayload {
return { shortcutId: 0, ip: "", referer: "", userAgent: "", params: {} };
}
export const ActivityShorcutViewPayload: MessageFns<ActivityShorcutViewPayload> = {
encode(message: ActivityShorcutViewPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.shortcutId !== 0) {
writer.uint32(8).int32(message.shortcutId);
}
if (message.ip !== "") {
writer.uint32(18).string(message.ip);
}
if (message.referer !== "") {
writer.uint32(26).string(message.referer);
}
if (message.userAgent !== "") {
writer.uint32(34).string(message.userAgent);
}
Object.entries(message.params).forEach(([key, value]) => {
ActivityShorcutViewPayload_ParamsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ActivityShorcutViewPayload {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseActivityShorcutViewPayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.shortcutId = reader.int32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.ip = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.referer = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.userAgent = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
const entry5 = ActivityShorcutViewPayload_ParamsEntry.decode(reader, reader.uint32());
if (entry5.value !== undefined) {
message.params[entry5.key] = entry5.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ActivityShorcutViewPayload>): ActivityShorcutViewPayload {
return ActivityShorcutViewPayload.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<ActivityShorcutViewPayload>): ActivityShorcutViewPayload {
const message = createBaseActivityShorcutViewPayload();
message.shortcutId = object.shortcutId ?? 0;
message.ip = object.ip ?? "";
message.referer = object.referer ?? "";
message.userAgent = object.userAgent ?? "";
message.params = Object.entries(object.params ?? {}).reduce<
{ [key: string]: ActivityShorcutViewPayload_ValueList }
>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = ActivityShorcutViewPayload_ValueList.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseActivityShorcutViewPayload_ParamsEntry(): ActivityShorcutViewPayload_ParamsEntry {
return { key: "", value: undefined };
}
export const ActivityShorcutViewPayload_ParamsEntry: MessageFns<ActivityShorcutViewPayload_ParamsEntry> = {
encode(message: ActivityShorcutViewPayload_ParamsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
ActivityShorcutViewPayload_ValueList.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ActivityShorcutViewPayload_ParamsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseActivityShorcutViewPayload_ParamsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = ActivityShorcutViewPayload_ValueList.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ActivityShorcutViewPayload_ParamsEntry>): ActivityShorcutViewPayload_ParamsEntry {
return ActivityShorcutViewPayload_ParamsEntry.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<ActivityShorcutViewPayload_ParamsEntry>): ActivityShorcutViewPayload_ParamsEntry {
const message = createBaseActivityShorcutViewPayload_ParamsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? ActivityShorcutViewPayload_ValueList.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseActivityShorcutViewPayload_ValueList(): ActivityShorcutViewPayload_ValueList {
return { values: [] };
}
export const ActivityShorcutViewPayload_ValueList: MessageFns<ActivityShorcutViewPayload_ValueList> = {
encode(message: ActivityShorcutViewPayload_ValueList, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.values) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ActivityShorcutViewPayload_ValueList {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseActivityShorcutViewPayload_ValueList();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.values.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<ActivityShorcutViewPayload_ValueList>): ActivityShorcutViewPayload_ValueList {
return ActivityShorcutViewPayload_ValueList.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<ActivityShorcutViewPayload_ValueList>): ActivityShorcutViewPayload_ValueList {
const message = createBaseActivityShorcutViewPayload_ValueList();
message.values = object.values?.map((e) => e) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,213 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/collection.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Visibility, visibilityFromJSON, visibilityToNumber } from "./common";
export const protobufPackage = "slash.store";
export interface Collection {
id: number;
creatorId: number;
createdTs: number;
updatedTs: number;
name: string;
title: string;
description: string;
shortcutIds: number[];
visibility: Visibility;
}
function createBaseCollection(): Collection {
return {
id: 0,
creatorId: 0,
createdTs: 0,
updatedTs: 0,
name: "",
title: "",
description: "",
shortcutIds: [],
visibility: Visibility.VISIBILITY_UNSPECIFIED,
};
}
export const Collection: MessageFns<Collection> = {
encode(message: Collection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.creatorId !== 0) {
writer.uint32(16).int32(message.creatorId);
}
if (message.createdTs !== 0) {
writer.uint32(24).int64(message.createdTs);
}
if (message.updatedTs !== 0) {
writer.uint32(32).int64(message.updatedTs);
}
if (message.name !== "") {
writer.uint32(50).string(message.name);
}
if (message.title !== "") {
writer.uint32(58).string(message.title);
}
if (message.description !== "") {
writer.uint32(66).string(message.description);
}
writer.uint32(74).fork();
for (const v of message.shortcutIds) {
writer.int32(v);
}
writer.join();
if (message.visibility !== Visibility.VISIBILITY_UNSPECIFIED) {
writer.uint32(80).int32(visibilityToNumber(message.visibility));
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Collection {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCollection();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.creatorId = reader.int32();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.createdTs = longToNumber(reader.int64());
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.updatedTs = longToNumber(reader.int64());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.name = reader.string();
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.title = reader.string();
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.description = reader.string();
continue;
}
case 9: {
if (tag === 72) {
message.shortcutIds.push(reader.int32());
continue;
}
if (tag === 74) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.shortcutIds.push(reader.int32());
}
continue;
}
break;
}
case 10: {
if (tag !== 80) {
break;
}
message.visibility = visibilityFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Collection>): Collection {
return Collection.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Collection>): Collection {
const message = createBaseCollection();
message.id = object.id ?? 0;
message.creatorId = object.creatorId ?? 0;
message.createdTs = object.createdTs ?? 0;
message.updatedTs = object.updatedTs ?? 0;
message.name = object.name ?? "";
message.title = object.title ?? "";
message.description = object.description ?? "";
message.shortcutIds = object.shortcutIds?.map((e) => e) || [];
message.visibility = object.visibility ?? Visibility.VISIBILITY_UNSPECIFIED;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function longToNumber(int64: { toString(): string }): number {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
}
return num;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,87 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/common.proto
/* eslint-disable */
export const protobufPackage = "slash.store";
export enum RowStatus {
ROW_STATUS_UNSPECIFIED = "ROW_STATUS_UNSPECIFIED",
NORMAL = "NORMAL",
ARCHIVED = "ARCHIVED",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function rowStatusFromJSON(object: any): RowStatus {
switch (object) {
case 0:
case "ROW_STATUS_UNSPECIFIED":
return RowStatus.ROW_STATUS_UNSPECIFIED;
case 1:
case "NORMAL":
return RowStatus.NORMAL;
case 2:
case "ARCHIVED":
return RowStatus.ARCHIVED;
case -1:
case "UNRECOGNIZED":
default:
return RowStatus.UNRECOGNIZED;
}
}
export function rowStatusToNumber(object: RowStatus): number {
switch (object) {
case RowStatus.ROW_STATUS_UNSPECIFIED:
return 0;
case RowStatus.NORMAL:
return 1;
case RowStatus.ARCHIVED:
return 2;
case RowStatus.UNRECOGNIZED:
default:
return -1;
}
}
export enum Visibility {
VISIBILITY_UNSPECIFIED = "VISIBILITY_UNSPECIFIED",
WORKSPACE = "WORKSPACE",
PUBLIC = "PUBLIC",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function visibilityFromJSON(object: any): Visibility {
switch (object) {
case 0:
case "VISIBILITY_UNSPECIFIED":
return Visibility.VISIBILITY_UNSPECIFIED;
case 1:
case "WORKSPACE":
return Visibility.WORKSPACE;
case 2:
case "PUBLIC":
return Visibility.PUBLIC;
case -1:
case "UNRECOGNIZED":
default:
return Visibility.UNRECOGNIZED;
}
}
export function visibilityToNumber(object: Visibility): number {
switch (object) {
case Visibility.VISIBILITY_UNSPECIFIED:
return 0;
case Visibility.WORKSPACE:
return 1;
case Visibility.PUBLIC:
return 2;
case Visibility.UNRECOGNIZED:
default:
return -1;
}
}
+403
View File
@@ -0,0 +1,403 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/idp.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "slash.store";
export interface IdentityProvider {
/** The unique identifier of the identity provider. */
id: string;
title: string;
type: IdentityProvider_Type;
config?: IdentityProviderConfig | undefined;
}
export enum IdentityProvider_Type {
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
OAUTH2 = "OAUTH2",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function identityProvider_TypeFromJSON(object: any): IdentityProvider_Type {
switch (object) {
case 0:
case "TYPE_UNSPECIFIED":
return IdentityProvider_Type.TYPE_UNSPECIFIED;
case 1:
case "OAUTH2":
return IdentityProvider_Type.OAUTH2;
case -1:
case "UNRECOGNIZED":
default:
return IdentityProvider_Type.UNRECOGNIZED;
}
}
export function identityProvider_TypeToNumber(object: IdentityProvider_Type): number {
switch (object) {
case IdentityProvider_Type.TYPE_UNSPECIFIED:
return 0;
case IdentityProvider_Type.OAUTH2:
return 1;
case IdentityProvider_Type.UNRECOGNIZED:
default:
return -1;
}
}
export interface IdentityProviderConfig {
oauth2?: IdentityProviderConfig_OAuth2Config | undefined;
}
export interface IdentityProviderConfig_FieldMapping {
identifier: string;
displayName: string;
}
export interface IdentityProviderConfig_OAuth2Config {
clientId: string;
clientSecret: string;
authUrl: string;
tokenUrl: string;
userInfoUrl: string;
scopes: string[];
fieldMapping?: IdentityProviderConfig_FieldMapping | undefined;
}
function createBaseIdentityProvider(): IdentityProvider {
return { id: "", title: "", type: IdentityProvider_Type.TYPE_UNSPECIFIED, config: undefined };
}
export const IdentityProvider: MessageFns<IdentityProvider> = {
encode(message: IdentityProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
}
if (message.type !== IdentityProvider_Type.TYPE_UNSPECIFIED) {
writer.uint32(24).int32(identityProvider_TypeToNumber(message.type));
}
if (message.config !== undefined) {
IdentityProviderConfig.encode(message.config, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProvider {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProvider();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.title = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.type = identityProvider_TypeFromJSON(reader.int32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.config = IdentityProviderConfig.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProvider>): IdentityProvider {
return IdentityProvider.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProvider>): IdentityProvider {
const message = createBaseIdentityProvider();
message.id = object.id ?? "";
message.title = object.title ?? "";
message.type = object.type ?? IdentityProvider_Type.TYPE_UNSPECIFIED;
message.config = (object.config !== undefined && object.config !== null)
? IdentityProviderConfig.fromPartial(object.config)
: undefined;
return message;
},
};
function createBaseIdentityProviderConfig(): IdentityProviderConfig {
return { oauth2: undefined };
}
export const IdentityProviderConfig: MessageFns<IdentityProviderConfig> = {
encode(message: IdentityProviderConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.oauth2 !== undefined) {
IdentityProviderConfig_OAuth2Config.encode(message.oauth2, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.oauth2 = IdentityProviderConfig_OAuth2Config.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
return IdentityProviderConfig.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig>): IdentityProviderConfig {
const message = createBaseIdentityProviderConfig();
message.oauth2 = (object.oauth2 !== undefined && object.oauth2 !== null)
? IdentityProviderConfig_OAuth2Config.fromPartial(object.oauth2)
: undefined;
return message;
},
};
function createBaseIdentityProviderConfig_FieldMapping(): IdentityProviderConfig_FieldMapping {
return { identifier: "", displayName: "" };
}
export const IdentityProviderConfig_FieldMapping: MessageFns<IdentityProviderConfig_FieldMapping> = {
encode(message: IdentityProviderConfig_FieldMapping, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.identifier !== "") {
writer.uint32(10).string(message.identifier);
}
if (message.displayName !== "") {
writer.uint32(18).string(message.displayName);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig_FieldMapping {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig_FieldMapping();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.identifier = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.displayName = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig_FieldMapping>): IdentityProviderConfig_FieldMapping {
return IdentityProviderConfig_FieldMapping.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig_FieldMapping>): IdentityProviderConfig_FieldMapping {
const message = createBaseIdentityProviderConfig_FieldMapping();
message.identifier = object.identifier ?? "";
message.displayName = object.displayName ?? "";
return message;
},
};
function createBaseIdentityProviderConfig_OAuth2Config(): IdentityProviderConfig_OAuth2Config {
return {
clientId: "",
clientSecret: "",
authUrl: "",
tokenUrl: "",
userInfoUrl: "",
scopes: [],
fieldMapping: undefined,
};
}
export const IdentityProviderConfig_OAuth2Config: MessageFns<IdentityProviderConfig_OAuth2Config> = {
encode(message: IdentityProviderConfig_OAuth2Config, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
if (message.clientSecret !== "") {
writer.uint32(18).string(message.clientSecret);
}
if (message.authUrl !== "") {
writer.uint32(26).string(message.authUrl);
}
if (message.tokenUrl !== "") {
writer.uint32(34).string(message.tokenUrl);
}
if (message.userInfoUrl !== "") {
writer.uint32(42).string(message.userInfoUrl);
}
for (const v of message.scopes) {
writer.uint32(50).string(v!);
}
if (message.fieldMapping !== undefined) {
IdentityProviderConfig_FieldMapping.encode(message.fieldMapping, writer.uint32(58).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): IdentityProviderConfig_OAuth2Config {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseIdentityProviderConfig_OAuth2Config();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.clientId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.clientSecret = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.authUrl = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tokenUrl = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.userInfoUrl = reader.string();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.scopes.push(reader.string());
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.fieldMapping = IdentityProviderConfig_FieldMapping.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<IdentityProviderConfig_OAuth2Config>): IdentityProviderConfig_OAuth2Config {
return IdentityProviderConfig_OAuth2Config.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<IdentityProviderConfig_OAuth2Config>): IdentityProviderConfig_OAuth2Config {
const message = createBaseIdentityProviderConfig_OAuth2Config();
message.clientId = object.clientId ?? "";
message.clientSecret = object.clientSecret ?? "";
message.authUrl = object.authUrl ?? "";
message.tokenUrl = object.tokenUrl ?? "";
message.userInfoUrl = object.userInfoUrl ?? "";
message.scopes = object.scopes?.map((e) => e) || [];
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? IdentityProviderConfig_FieldMapping.fromPartial(object.fieldMapping)
: undefined;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,307 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/shortcut.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Visibility, visibilityFromJSON, visibilityToNumber } from "./common";
export const protobufPackage = "slash.store";
export interface Shortcut {
id: number;
creatorId: number;
createdTs: number;
updatedTs: number;
name: string;
link: string;
title: string;
tags: string[];
description: string;
visibility: Visibility;
ogMetadata?: OpenGraphMetadata | undefined;
}
export interface OpenGraphMetadata {
title: string;
description: string;
image: string;
}
function createBaseShortcut(): Shortcut {
return {
id: 0,
creatorId: 0,
createdTs: 0,
updatedTs: 0,
name: "",
link: "",
title: "",
tags: [],
description: "",
visibility: Visibility.VISIBILITY_UNSPECIFIED,
ogMetadata: undefined,
};
}
export const Shortcut: MessageFns<Shortcut> = {
encode(message: Shortcut, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.creatorId !== 0) {
writer.uint32(16).int32(message.creatorId);
}
if (message.createdTs !== 0) {
writer.uint32(24).int64(message.createdTs);
}
if (message.updatedTs !== 0) {
writer.uint32(32).int64(message.updatedTs);
}
if (message.name !== "") {
writer.uint32(50).string(message.name);
}
if (message.link !== "") {
writer.uint32(58).string(message.link);
}
if (message.title !== "") {
writer.uint32(66).string(message.title);
}
for (const v of message.tags) {
writer.uint32(74).string(v!);
}
if (message.description !== "") {
writer.uint32(82).string(message.description);
}
if (message.visibility !== Visibility.VISIBILITY_UNSPECIFIED) {
writer.uint32(88).int32(visibilityToNumber(message.visibility));
}
if (message.ogMetadata !== undefined) {
OpenGraphMetadata.encode(message.ogMetadata, writer.uint32(98).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Shortcut {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseShortcut();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.creatorId = reader.int32();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.createdTs = longToNumber(reader.int64());
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.updatedTs = longToNumber(reader.int64());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.name = reader.string();
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.link = reader.string();
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.title = reader.string();
continue;
}
case 9: {
if (tag !== 74) {
break;
}
message.tags.push(reader.string());
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.description = reader.string();
continue;
}
case 11: {
if (tag !== 88) {
break;
}
message.visibility = visibilityFromJSON(reader.int32());
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.ogMetadata = OpenGraphMetadata.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<Shortcut>): Shortcut {
return Shortcut.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<Shortcut>): Shortcut {
const message = createBaseShortcut();
message.id = object.id ?? 0;
message.creatorId = object.creatorId ?? 0;
message.createdTs = object.createdTs ?? 0;
message.updatedTs = object.updatedTs ?? 0;
message.name = object.name ?? "";
message.link = object.link ?? "";
message.title = object.title ?? "";
message.tags = object.tags?.map((e) => e) || [];
message.description = object.description ?? "";
message.visibility = object.visibility ?? Visibility.VISIBILITY_UNSPECIFIED;
message.ogMetadata = (object.ogMetadata !== undefined && object.ogMetadata !== null)
? OpenGraphMetadata.fromPartial(object.ogMetadata)
: undefined;
return message;
},
};
function createBaseOpenGraphMetadata(): OpenGraphMetadata {
return { title: "", description: "", image: "" };
}
export const OpenGraphMetadata: MessageFns<OpenGraphMetadata> = {
encode(message: OpenGraphMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.image !== "") {
writer.uint32(26).string(message.image);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): OpenGraphMetadata {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOpenGraphMetadata();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.title = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.image = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
return OpenGraphMetadata.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
const message = createBaseOpenGraphMetadata();
message.title = object.title ?? "";
message.description = object.description ?? "";
message.image = object.image ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function longToNumber(int64: { toString(): string }): number {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
}
return num;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,344 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/user_setting.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "slash.store";
export enum UserSettingKey {
USER_SETTING_KEY_UNSPECIFIED = "USER_SETTING_KEY_UNSPECIFIED",
/** USER_SETTING_GENERAL - User general settings. */
USER_SETTING_GENERAL = "USER_SETTING_GENERAL",
/** USER_SETTING_ACCESS_TOKENS - User access tokens. */
USER_SETTING_ACCESS_TOKENS = "USER_SETTING_ACCESS_TOKENS",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function userSettingKeyFromJSON(object: any): UserSettingKey {
switch (object) {
case 0:
case "USER_SETTING_KEY_UNSPECIFIED":
return UserSettingKey.USER_SETTING_KEY_UNSPECIFIED;
case 1:
case "USER_SETTING_GENERAL":
return UserSettingKey.USER_SETTING_GENERAL;
case 2:
case "USER_SETTING_ACCESS_TOKENS":
return UserSettingKey.USER_SETTING_ACCESS_TOKENS;
case -1:
case "UNRECOGNIZED":
default:
return UserSettingKey.UNRECOGNIZED;
}
}
export function userSettingKeyToNumber(object: UserSettingKey): number {
switch (object) {
case UserSettingKey.USER_SETTING_KEY_UNSPECIFIED:
return 0;
case UserSettingKey.USER_SETTING_GENERAL:
return 1;
case UserSettingKey.USER_SETTING_ACCESS_TOKENS:
return 2;
case UserSettingKey.UNRECOGNIZED:
default:
return -1;
}
}
export interface UserSetting {
userId: number;
key: UserSettingKey;
general?: UserSetting_GeneralSetting | undefined;
accessTokens?: UserSetting_AccessTokensSetting | undefined;
}
export interface UserSetting_GeneralSetting {
locale: string;
colorTheme: string;
}
export interface UserSetting_AccessTokensSetting {
/** Nested repeated field */
accessTokens: UserSetting_AccessTokensSetting_AccessToken[];
}
export interface UserSetting_AccessTokensSetting_AccessToken {
/** The access token is a JWT token, including expiration time, issuer, etc. */
accessToken: string;
/** A description for the access token. */
description: string;
}
function createBaseUserSetting(): UserSetting {
return { userId: 0, key: UserSettingKey.USER_SETTING_KEY_UNSPECIFIED, general: undefined, accessTokens: undefined };
}
export const UserSetting: MessageFns<UserSetting> = {
encode(message: UserSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.userId !== 0) {
writer.uint32(8).int32(message.userId);
}
if (message.key !== UserSettingKey.USER_SETTING_KEY_UNSPECIFIED) {
writer.uint32(16).int32(userSettingKeyToNumber(message.key));
}
if (message.general !== undefined) {
UserSetting_GeneralSetting.encode(message.general, writer.uint32(26).fork()).join();
}
if (message.accessTokens !== undefined) {
UserSetting_AccessTokensSetting.encode(message.accessTokens, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.userId = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.key = userSettingKeyFromJSON(reader.int32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.general = UserSetting_GeneralSetting.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.accessTokens = UserSetting_AccessTokensSetting.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting>): UserSetting {
return UserSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting>): UserSetting {
const message = createBaseUserSetting();
message.userId = object.userId ?? 0;
message.key = object.key ?? UserSettingKey.USER_SETTING_KEY_UNSPECIFIED;
message.general = (object.general !== undefined && object.general !== null)
? UserSetting_GeneralSetting.fromPartial(object.general)
: undefined;
message.accessTokens = (object.accessTokens !== undefined && object.accessTokens !== null)
? UserSetting_AccessTokensSetting.fromPartial(object.accessTokens)
: undefined;
return message;
},
};
function createBaseUserSetting_GeneralSetting(): UserSetting_GeneralSetting {
return { locale: "", colorTheme: "" };
}
export const UserSetting_GeneralSetting: MessageFns<UserSetting_GeneralSetting> = {
encode(message: UserSetting_GeneralSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.locale !== "") {
writer.uint32(10).string(message.locale);
}
if (message.colorTheme !== "") {
writer.uint32(18).string(message.colorTheme);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_GeneralSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_GeneralSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.locale = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.colorTheme = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_GeneralSetting>): UserSetting_GeneralSetting {
return UserSetting_GeneralSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_GeneralSetting>): UserSetting_GeneralSetting {
const message = createBaseUserSetting_GeneralSetting();
message.locale = object.locale ?? "";
message.colorTheme = object.colorTheme ?? "";
return message;
},
};
function createBaseUserSetting_AccessTokensSetting(): UserSetting_AccessTokensSetting {
return { accessTokens: [] };
}
export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessTokensSetting> = {
encode(message: UserSetting_AccessTokensSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.accessTokens) {
UserSetting_AccessTokensSetting_AccessToken.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_AccessTokensSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_AccessTokensSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.accessTokens.push(UserSetting_AccessTokensSetting_AccessToken.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting {
return UserSetting_AccessTokensSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting {
const message = createBaseUserSetting_AccessTokensSetting();
message.accessTokens =
object.accessTokens?.map((e) => UserSetting_AccessTokensSetting_AccessToken.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_AccessTokensSetting_AccessToken(): UserSetting_AccessTokensSetting_AccessToken {
return { accessToken: "", description: "" };
}
export const UserSetting_AccessTokensSetting_AccessToken: MessageFns<UserSetting_AccessTokensSetting_AccessToken> = {
encode(
message: UserSetting_AccessTokensSetting_AccessToken,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.accessToken !== "") {
writer.uint32(10).string(message.accessToken);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_AccessTokensSetting_AccessToken {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.accessToken = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>): UserSetting_AccessTokensSetting_AccessToken {
return UserSetting_AccessTokensSetting_AccessToken.fromPartial(base ?? {});
},
fromPartial(
object: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>,
): UserSetting_AccessTokensSetting_AccessToken {
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
message.accessToken = object.accessToken ?? "";
message.description = object.description ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
@@ -0,0 +1,508 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: store/workspace_setting.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Visibility, visibilityFromJSON, visibilityToNumber } from "./common";
import { IdentityProvider } from "./idp";
export const protobufPackage = "slash.store";
export enum WorkspaceSettingKey {
WORKSPACE_SETTING_KEY_UNSPECIFIED = "WORKSPACE_SETTING_KEY_UNSPECIFIED",
/** WORKSPACE_SETTING_GENERAL - Workspace general settings. */
WORKSPACE_SETTING_GENERAL = "WORKSPACE_SETTING_GENERAL",
/** WORKSPACE_SETTING_SECURITY - Workspace security settings. */
WORKSPACE_SETTING_SECURITY = "WORKSPACE_SETTING_SECURITY",
/** WORKSPACE_SETTING_SHORTCUT_RELATED - Workspace shortcut-related settings. */
WORKSPACE_SETTING_SHORTCUT_RELATED = "WORKSPACE_SETTING_SHORTCUT_RELATED",
/** WORKSPACE_SETTING_IDENTITY_PROVIDER - Workspace identity provider settings. */
WORKSPACE_SETTING_IDENTITY_PROVIDER = "WORKSPACE_SETTING_IDENTITY_PROVIDER",
/**
* WORKSPACE_SETTING_LICENSE_KEY - TODO: remove the following keys.
* The license key.
*/
WORKSPACE_SETTING_LICENSE_KEY = "WORKSPACE_SETTING_LICENSE_KEY",
/** WORKSPACE_SETTING_SECRET_SESSION - The secret session key used to encrypt session data. */
WORKSPACE_SETTING_SECRET_SESSION = "WORKSPACE_SETTING_SECRET_SESSION",
/** WORKSPACE_SETTING_CUSTOM_STYLE - The custom style. */
WORKSPACE_SETTING_CUSTOM_STYLE = "WORKSPACE_SETTING_CUSTOM_STYLE",
/** WORKSPACE_SETTING_DEFAULT_VISIBILITY - The default visibility of shortcuts and collections. */
WORKSPACE_SETTING_DEFAULT_VISIBILITY = "WORKSPACE_SETTING_DEFAULT_VISIBILITY",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function workspaceSettingKeyFromJSON(object: any): WorkspaceSettingKey {
switch (object) {
case 0:
case "WORKSPACE_SETTING_KEY_UNSPECIFIED":
return WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED;
case 1:
case "WORKSPACE_SETTING_GENERAL":
return WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL;
case 2:
case "WORKSPACE_SETTING_SECURITY":
return WorkspaceSettingKey.WORKSPACE_SETTING_SECURITY;
case 3:
case "WORKSPACE_SETTING_SHORTCUT_RELATED":
return WorkspaceSettingKey.WORKSPACE_SETTING_SHORTCUT_RELATED;
case 4:
case "WORKSPACE_SETTING_IDENTITY_PROVIDER":
return WorkspaceSettingKey.WORKSPACE_SETTING_IDENTITY_PROVIDER;
case 10:
case "WORKSPACE_SETTING_LICENSE_KEY":
return WorkspaceSettingKey.WORKSPACE_SETTING_LICENSE_KEY;
case 11:
case "WORKSPACE_SETTING_SECRET_SESSION":
return WorkspaceSettingKey.WORKSPACE_SETTING_SECRET_SESSION;
case 12:
case "WORKSPACE_SETTING_CUSTOM_STYLE":
return WorkspaceSettingKey.WORKSPACE_SETTING_CUSTOM_STYLE;
case 13:
case "WORKSPACE_SETTING_DEFAULT_VISIBILITY":
return WorkspaceSettingKey.WORKSPACE_SETTING_DEFAULT_VISIBILITY;
case -1:
case "UNRECOGNIZED":
default:
return WorkspaceSettingKey.UNRECOGNIZED;
}
}
export function workspaceSettingKeyToNumber(object: WorkspaceSettingKey): number {
switch (object) {
case WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED:
return 0;
case WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL:
return 1;
case WorkspaceSettingKey.WORKSPACE_SETTING_SECURITY:
return 2;
case WorkspaceSettingKey.WORKSPACE_SETTING_SHORTCUT_RELATED:
return 3;
case WorkspaceSettingKey.WORKSPACE_SETTING_IDENTITY_PROVIDER:
return 4;
case WorkspaceSettingKey.WORKSPACE_SETTING_LICENSE_KEY:
return 10;
case WorkspaceSettingKey.WORKSPACE_SETTING_SECRET_SESSION:
return 11;
case WorkspaceSettingKey.WORKSPACE_SETTING_CUSTOM_STYLE:
return 12;
case WorkspaceSettingKey.WORKSPACE_SETTING_DEFAULT_VISIBILITY:
return 13;
case WorkspaceSettingKey.UNRECOGNIZED:
default:
return -1;
}
}
export interface WorkspaceSetting {
key: WorkspaceSettingKey;
raw: string;
general?: WorkspaceSetting_GeneralSetting | undefined;
security?: WorkspaceSetting_SecuritySetting | undefined;
shortcutRelated?: WorkspaceSetting_ShortcutRelatedSetting | undefined;
identityProvider?: WorkspaceSetting_IdentityProviderSetting | undefined;
}
export interface WorkspaceSetting_GeneralSetting {
secretSession: string;
licenseKey: string;
instanceUrl: string;
branding: Uint8Array;
customStyle: string;
}
export interface WorkspaceSetting_SecuritySetting {
disallowUserRegistration: boolean;
disallowPasswordAuth: boolean;
}
export interface WorkspaceSetting_ShortcutRelatedSetting {
defaultVisibility: Visibility;
}
export interface WorkspaceSetting_IdentityProviderSetting {
identityProviders: IdentityProvider[];
}
function createBaseWorkspaceSetting(): WorkspaceSetting {
return {
key: WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED,
raw: "",
general: undefined,
security: undefined,
shortcutRelated: undefined,
identityProvider: undefined,
};
}
export const WorkspaceSetting: MessageFns<WorkspaceSetting> = {
encode(message: WorkspaceSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED) {
writer.uint32(8).int32(workspaceSettingKeyToNumber(message.key));
}
if (message.raw !== "") {
writer.uint32(18).string(message.raw);
}
if (message.general !== undefined) {
WorkspaceSetting_GeneralSetting.encode(message.general, writer.uint32(26).fork()).join();
}
if (message.security !== undefined) {
WorkspaceSetting_SecuritySetting.encode(message.security, writer.uint32(34).fork()).join();
}
if (message.shortcutRelated !== undefined) {
WorkspaceSetting_ShortcutRelatedSetting.encode(message.shortcutRelated, writer.uint32(42).fork()).join();
}
if (message.identityProvider !== undefined) {
WorkspaceSetting_IdentityProviderSetting.encode(message.identityProvider, writer.uint32(50).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = workspaceSettingKeyFromJSON(reader.int32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.raw = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.general = WorkspaceSetting_GeneralSetting.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.security = WorkspaceSetting_SecuritySetting.decode(reader, reader.uint32());
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.shortcutRelated = WorkspaceSetting_ShortcutRelatedSetting.decode(reader, reader.uint32());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.identityProvider = WorkspaceSetting_IdentityProviderSetting.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
return WorkspaceSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
const message = createBaseWorkspaceSetting();
message.key = object.key ?? WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED;
message.raw = object.raw ?? "";
message.general = (object.general !== undefined && object.general !== null)
? WorkspaceSetting_GeneralSetting.fromPartial(object.general)
: undefined;
message.security = (object.security !== undefined && object.security !== null)
? WorkspaceSetting_SecuritySetting.fromPartial(object.security)
: undefined;
message.shortcutRelated = (object.shortcutRelated !== undefined && object.shortcutRelated !== null)
? WorkspaceSetting_ShortcutRelatedSetting.fromPartial(object.shortcutRelated)
: undefined;
message.identityProvider = (object.identityProvider !== undefined && object.identityProvider !== null)
? WorkspaceSetting_IdentityProviderSetting.fromPartial(object.identityProvider)
: undefined;
return message;
},
};
function createBaseWorkspaceSetting_GeneralSetting(): WorkspaceSetting_GeneralSetting {
return { secretSession: "", licenseKey: "", instanceUrl: "", branding: new Uint8Array(0), customStyle: "" };
}
export const WorkspaceSetting_GeneralSetting: MessageFns<WorkspaceSetting_GeneralSetting> = {
encode(message: WorkspaceSetting_GeneralSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.secretSession !== "") {
writer.uint32(10).string(message.secretSession);
}
if (message.licenseKey !== "") {
writer.uint32(18).string(message.licenseKey);
}
if (message.instanceUrl !== "") {
writer.uint32(26).string(message.instanceUrl);
}
if (message.branding.length !== 0) {
writer.uint32(34).bytes(message.branding);
}
if (message.customStyle !== "") {
writer.uint32(42).string(message.customStyle);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting_GeneralSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting_GeneralSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.secretSession = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.licenseKey = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.instanceUrl = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.branding = reader.bytes();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.customStyle = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting_GeneralSetting>): WorkspaceSetting_GeneralSetting {
return WorkspaceSetting_GeneralSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting_GeneralSetting>): WorkspaceSetting_GeneralSetting {
const message = createBaseWorkspaceSetting_GeneralSetting();
message.secretSession = object.secretSession ?? "";
message.licenseKey = object.licenseKey ?? "";
message.instanceUrl = object.instanceUrl ?? "";
message.branding = object.branding ?? new Uint8Array(0);
message.customStyle = object.customStyle ?? "";
return message;
},
};
function createBaseWorkspaceSetting_SecuritySetting(): WorkspaceSetting_SecuritySetting {
return { disallowUserRegistration: false, disallowPasswordAuth: false };
}
export const WorkspaceSetting_SecuritySetting: MessageFns<WorkspaceSetting_SecuritySetting> = {
encode(message: WorkspaceSetting_SecuritySetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.disallowUserRegistration !== false) {
writer.uint32(8).bool(message.disallowUserRegistration);
}
if (message.disallowPasswordAuth !== false) {
writer.uint32(16).bool(message.disallowPasswordAuth);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting_SecuritySetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting_SecuritySetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.disallowUserRegistration = reader.bool();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.disallowPasswordAuth = reader.bool();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting_SecuritySetting>): WorkspaceSetting_SecuritySetting {
return WorkspaceSetting_SecuritySetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting_SecuritySetting>): WorkspaceSetting_SecuritySetting {
const message = createBaseWorkspaceSetting_SecuritySetting();
message.disallowUserRegistration = object.disallowUserRegistration ?? false;
message.disallowPasswordAuth = object.disallowPasswordAuth ?? false;
return message;
},
};
function createBaseWorkspaceSetting_ShortcutRelatedSetting(): WorkspaceSetting_ShortcutRelatedSetting {
return { defaultVisibility: Visibility.VISIBILITY_UNSPECIFIED };
}
export const WorkspaceSetting_ShortcutRelatedSetting: MessageFns<WorkspaceSetting_ShortcutRelatedSetting> = {
encode(message: WorkspaceSetting_ShortcutRelatedSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.defaultVisibility !== Visibility.VISIBILITY_UNSPECIFIED) {
writer.uint32(8).int32(visibilityToNumber(message.defaultVisibility));
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting_ShortcutRelatedSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting_ShortcutRelatedSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.defaultVisibility = visibilityFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting_ShortcutRelatedSetting>): WorkspaceSetting_ShortcutRelatedSetting {
return WorkspaceSetting_ShortcutRelatedSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting_ShortcutRelatedSetting>): WorkspaceSetting_ShortcutRelatedSetting {
const message = createBaseWorkspaceSetting_ShortcutRelatedSetting();
message.defaultVisibility = object.defaultVisibility ?? Visibility.VISIBILITY_UNSPECIFIED;
return message;
},
};
function createBaseWorkspaceSetting_IdentityProviderSetting(): WorkspaceSetting_IdentityProviderSetting {
return { identityProviders: [] };
}
export const WorkspaceSetting_IdentityProviderSetting: MessageFns<WorkspaceSetting_IdentityProviderSetting> = {
encode(message: WorkspaceSetting_IdentityProviderSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.identityProviders) {
IdentityProvider.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): WorkspaceSetting_IdentityProviderSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseWorkspaceSetting_IdentityProviderSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.identityProviders.push(IdentityProvider.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<WorkspaceSetting_IdentityProviderSetting>): WorkspaceSetting_IdentityProviderSetting {
return WorkspaceSetting_IdentityProviderSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<WorkspaceSetting_IdentityProviderSetting>): WorkspaceSetting_IdentityProviderSetting {
const message = createBaseWorkspaceSetting_IdentityProviderSetting();
message.identityProviders = object.identityProviders?.map((e) => IdentityProvider.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/auth_service.proto // source: api/v1/auth_service.proto
+15 -5
View File
@@ -40,7 +40,9 @@ func request_AuthService_GetAuthStatus_0(ctx context.Context, marshaler runtime.
protoReq GetAuthStatusRequest protoReq GetAuthStatusRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.GetAuthStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetAuthStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -61,7 +63,9 @@ func request_AuthService_SignIn_0(ctx context.Context, marshaler runtime.Marshal
protoReq SignInRequest protoReq SignInRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
@@ -94,7 +98,9 @@ func request_AuthService_SignInWithSSO_0(ctx context.Context, marshaler runtime.
protoReq SignInWithSSORequest protoReq SignInWithSSORequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
@@ -127,7 +133,9 @@ func request_AuthService_SignUp_0(ctx context.Context, marshaler runtime.Marshal
protoReq SignUpRequest protoReq SignUpRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
@@ -158,7 +166,9 @@ func request_AuthService_SignOut_0(ctx context.Context, marshaler runtime.Marsha
protoReq SignOutRequest protoReq SignOutRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.SignOut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.SignOut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/collection_service.proto // source: api/v1/collection_service.proto
+15 -3
View File
@@ -40,7 +40,9 @@ func request_CollectionService_ListCollections_0(ctx context.Context, marshaler
protoReq ListCollectionsRequest protoReq ListCollectionsRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.ListCollections(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListCollections(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -60,7 +62,9 @@ func request_CollectionService_GetCollection_0(ctx context.Context, marshaler ru
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -99,6 +103,9 @@ func request_CollectionService_CreateCollection_0(ctx context.Context, marshaler
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Collection); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Collection); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.CreateCollection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.CreateCollection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -126,6 +133,9 @@ func request_CollectionService_UpdateCollection_0(ctx context.Context, marshaler
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Collection); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Collection); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["collection.id"] val, ok := pathParams["collection.id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collection.id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collection.id")
@@ -177,7 +187,9 @@ func request_CollectionService_DeleteCollection_0(ctx context.Context, marshaler
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/common.proto // source: api/v1/common.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/shortcut_service.proto // source: api/v1/shortcut_service.proto
+18 -4
View File
@@ -40,7 +40,9 @@ func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runt
protoReq ListShortcutsRequest protoReq ListShortcutsRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -60,7 +62,9 @@ func request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler runtim
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -99,6 +103,9 @@ func request_ShortcutService_CreateShortcut_0(ctx context.Context, marshaler run
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.CreateShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.CreateShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -126,6 +133,9 @@ func request_ShortcutService_UpdateShortcut_0(ctx context.Context, marshaler run
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["shortcut.id"] val, ok := pathParams["shortcut.id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shortcut.id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shortcut.id")
@@ -177,7 +187,9 @@ func request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshaler run
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -214,7 +226,9 @@ func request_ShortcutService_GetShortcutAnalytics_0(ctx context.Context, marshal
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/subscription_service.proto // source: api/v1/subscription_service.proto
@@ -40,7 +40,9 @@ func request_SubscriptionService_GetSubscription_0(ctx context.Context, marshale
protoReq GetSubscriptionRequest protoReq GetSubscriptionRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.GetSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -62,6 +64,9 @@ func request_SubscriptionService_UpdateSubscription_0(ctx context.Context, marsh
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.UpdateSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.UpdateSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -83,7 +88,9 @@ func request_SubscriptionService_DeleteSubscription_0(ctx context.Context, marsh
protoReq DeleteSubscriptionRequest protoReq DeleteSubscriptionRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.DeleteSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.DeleteSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/user_service.proto // source: api/v1/user_service.proto
+24 -5
View File
@@ -40,7 +40,9 @@ func request_UserService_ListUsers_0(ctx context.Context, marshaler runtime.Mars
protoReq ListUsersRequest protoReq ListUsersRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -60,7 +62,9 @@ func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marsha
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -99,6 +103,9 @@ func request_UserService_CreateUser_0(ctx context.Context, marshaler runtime.Mar
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -130,6 +137,9 @@ func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Mar
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.User); err != nil { if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.User); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
@@ -199,7 +209,9 @@ func request_UserService_DeleteUser_0(ctx context.Context, marshaler runtime.Mar
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -236,7 +248,9 @@ func request_UserService_ListUserAccessTokens_0(ctx context.Context, marshaler r
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -276,6 +290,9 @@ func request_UserService_CreateUserAccessToken_0(ctx context.Context, marshaler
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -315,7 +332,9 @@ func request_UserService_DeleteUserAccessToken_0(ctx context.Context, marshaler
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/user_setting_service.proto // source: api/v1/user_setting_service.proto
@@ -41,7 +41,9 @@ func request_UserSettingService_GetUserSetting_0(ctx context.Context, marshaler
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
val, ok := pathParams["id"] val, ok := pathParams["id"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
@@ -87,6 +89,9 @@ func request_UserSettingService_UpdateUserSetting_0(ctx context.Context, marshal
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.UserSetting); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.UserSetting); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.UserSetting); err != nil { if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.UserSetting); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: api/v1/workspace_service.proto // source: api/v1/workspace_service.proto
+9 -2
View File
@@ -40,7 +40,9 @@ func request_WorkspaceService_GetWorkspaceProfile_0(ctx context.Context, marshal
protoReq GetWorkspaceProfileRequest protoReq GetWorkspaceProfileRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.GetWorkspaceProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetWorkspaceProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -59,7 +61,9 @@ func request_WorkspaceService_GetWorkspaceSetting_0(ctx context.Context, marshal
protoReq GetWorkspaceSettingRequest protoReq GetWorkspaceSettingRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
io.Copy(io.Discard, req.Body) if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.GetWorkspaceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetWorkspaceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
@@ -87,6 +91,9 @@ func request_WorkspaceService_UpdateWorkspaceSetting_0(ctx context.Context, mars
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Setting); err != nil && !errors.Is(err, io.EOF) { if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Setting); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Setting); err != nil { if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Setting); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/activity.proto // source: store/activity.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/collection.proto // source: store/collection.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/common.proto // source: store/common.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/idp.proto // source: store/idp.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/shortcut.proto // source: store/shortcut.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/user_setting.proto // source: store/user_setting.proto
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.7
// protoc (unknown) // protoc (unknown)
// source: store/workspace_setting.proto // source: store/workspace_setting.proto