fix: OpenAPI Parameter Conflict in DeleteMemoTag Endpoint (#4985)

Signed-off-by: ChaoLiu <chaoliu719@gmail.com>
This commit is contained in:
Liu Chao 2025-08-13 07:14:18 +08:00 committed by GitHub
parent 5ba81d629c
commit ba7dfb7d98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 695 additions and 188 deletions

View File

@ -57,7 +57,10 @@ service MemoService {
}
// DeleteMemoTag deletes a tag for a memo.
rpc DeleteMemoTag(DeleteMemoTagRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{parent=memos/*}/tags/{tag}"};
option (google.api.http) = {
post: "/api/v1/{parent=memos/*}/tags:delete"
body: "*"
};
option (google.api.method_signature) = "parent,tag";
}
// SetMemoAttachments sets attachments for a memo.

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/activity_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/attachment_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/auth_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/common.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/idp_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/inbox_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/markdown_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/memo_service.proto
@ -2174,7 +2174,7 @@ const file_api_v1_memo_service_proto_rawDesc = "" +
"\aPRIVATE\x10\x01\x12\r\n" +
"\tPROTECTED\x10\x02\x12\n" +
"\n" +
"\x06PUBLIC\x10\x032\xeb\x10\n" +
"\x06PUBLIC\x10\x032\xef\x10\n" +
"\vMemoService\x12e\n" +
"\n" +
"CreateMemo\x12\x1f.memos.api.v1.CreateMemoRequest\x1a\x12.memos.api.v1.Memo\"\"\xdaA\x04memo\x82\xd3\xe4\x93\x02\x15:\x04memo\"\r/api/v1/memos\x12f\n" +
@ -2184,9 +2184,9 @@ const file_api_v1_memo_service_proto_rawDesc = "" +
"UpdateMemo\x12\x1f.memos.api.v1.UpdateMemoRequest\x1a\x12.memos.api.v1.Memo\"<\xdaA\x10memo,update_mask\x82\xd3\xe4\x93\x02#:\x04memo2\x1b/api/v1/{memo.name=memos/*}\x12l\n" +
"\n" +
"DeleteMemo\x12\x1f.memos.api.v1.DeleteMemoRequest\x1a\x16.google.protobuf.Empty\"%\xdaA\x04name\x82\xd3\xe4\x93\x02\x18*\x16/api/v1/{name=memos/*}\x12\x95\x01\n" +
"\rRenameMemoTag\x12\".memos.api.v1.RenameMemoTagRequest\x1a\x16.google.protobuf.Empty\"H\xdaA\x16parent,old_tag,new_tag\x82\xd3\xe4\x93\x02):\x01*2$/api/v1/{parent=memos/*}/tags:rename\x12\x85\x01\n" +
"\rDeleteMemoTag\x12\".memos.api.v1.DeleteMemoTagRequest\x1a\x16.google.protobuf.Empty\"8\xdaA\n" +
"parent,tag\x82\xd3\xe4\x93\x02%*#/api/v1/{parent=memos/*}/tags/{tag}\x12\x8b\x01\n" +
"\rRenameMemoTag\x12\".memos.api.v1.RenameMemoTagRequest\x1a\x16.google.protobuf.Empty\"H\xdaA\x16parent,old_tag,new_tag\x82\xd3\xe4\x93\x02):\x01*2$/api/v1/{parent=memos/*}/tags:rename\x12\x89\x01\n" +
"\rDeleteMemoTag\x12\".memos.api.v1.DeleteMemoTagRequest\x1a\x16.google.protobuf.Empty\"<\xdaA\n" +
"parent,tag\x82\xd3\xe4\x93\x02):\x01*\"$/api/v1/{parent=memos/*}/tags:delete\x12\x8b\x01\n" +
"\x12SetMemoAttachments\x12'.memos.api.v1.SetMemoAttachmentsRequest\x1a\x16.google.protobuf.Empty\"4\xdaA\x04name\x82\xd3\xe4\x93\x02':\x01*2\"/api/v1/{name=memos/*}/attachments\x12\x9d\x01\n" +
"\x13ListMemoAttachments\x12(.memos.api.v1.ListMemoAttachmentsRequest\x1a).memos.api.v1.ListMemoAttachmentsResponse\"1\xdaA\x04name\x82\xd3\xe4\x93\x02$\x12\"/api/v1/{name=memos/*}/attachments\x12\x85\x01\n" +
"\x10SetMemoRelations\x12%.memos.api.v1.SetMemoRelationsRequest\x1a\x16.google.protobuf.Empty\"2\xdaA\x04name\x82\xd3\xe4\x93\x02%:\x01*2 /api/v1/{name=memos/*}/relations\x12\x95\x01\n" +

View File

@ -343,14 +343,15 @@ func local_request_MemoService_RenameMemoTag_0(ctx context.Context, marshaler ru
return msg, metadata, err
}
var filter_MemoService_DeleteMemoTag_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0, "tag": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
func request_MemoService_DeleteMemoTag_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq DeleteMemoTagRequest
metadata runtime.ServerMetadata
err error
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
@ -362,20 +363,6 @@ func request_MemoService_DeleteMemoTag_0(ctx context.Context, marshaler runtime.
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
}
val, ok = pathParams["tag"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag")
}
protoReq.Tag, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_DeleteMemoTag_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DeleteMemoTag(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
@ -386,6 +373,9 @@ func local_request_MemoService_DeleteMemoTag_0(ctx context.Context, marshaler ru
metadata runtime.ServerMetadata
err error
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
val, ok := pathParams["parent"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
@ -394,20 +384,6 @@ func local_request_MemoService_DeleteMemoTag_0(ctx context.Context, marshaler ru
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
}
val, ok = pathParams["tag"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag")
}
protoReq.Tag, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_DeleteMemoTag_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DeleteMemoTag(ctx, &protoReq)
return msg, metadata, err
}
@ -983,13 +959,13 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
}
forward_MemoService_RenameMemoTag_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodDelete, pattern_MemoService_DeleteMemoTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle(http.MethodPost, pattern_MemoService_DeleteMemoTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoService/DeleteMemoTag", runtime.WithHTTPPathPattern("/api/v1/{parent=memos/*}/tags/{tag}"))
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoService/DeleteMemoTag", runtime.WithHTTPPathPattern("/api/v1/{parent=memos/*}/tags:delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -1325,11 +1301,11 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
forward_MemoService_RenameMemoTag_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodDelete, pattern_MemoService_DeleteMemoTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle(http.MethodPost, pattern_MemoService_DeleteMemoTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoService/DeleteMemoTag", runtime.WithHTTPPathPattern("/api/v1/{parent=memos/*}/tags/{tag}"))
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoService/DeleteMemoTag", runtime.WithHTTPPathPattern("/api/v1/{parent=memos/*}/tags:delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -1505,7 +1481,7 @@ var (
pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "memos", "memo.name"}, ""))
pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "memos", "name"}, ""))
pattern_MemoService_RenameMemoTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "parent", "tags"}, "rename"))
pattern_MemoService_DeleteMemoTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "memos", "parent", "tags", "tag"}, ""))
pattern_MemoService_DeleteMemoTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "parent", "tags"}, "delete"))
pattern_MemoService_SetMemoAttachments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "name", "attachments"}, ""))
pattern_MemoService_ListMemoAttachments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "name", "attachments"}, ""))
pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "memos", "name", "relations"}, ""))

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/shortcut_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/user_service.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: api/v1/workspace_service.proto

View File

@ -15,13 +15,19 @@ paths:
parameters:
- name: pageSize
in: query
description: "The maximum number of activities to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 100 activities will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
The maximum number of activities to return.
The service may return fewer than this value.
If unspecified, at most 100 activities will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "A page token, received from a previous `ListActivities` call.\r\n Provide this to retrieve the subsequent page."
description: |-
A page token, received from a previous `ListActivities` call.
Provide this to retrieve the subsequent page.
schema:
type: string
responses:
@ -72,23 +78,35 @@ paths:
parameters:
- name: pageSize
in: query
description: "Optional. The maximum number of attachments to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 attachments will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
Optional. The maximum number of attachments to return.
The service may return fewer than this value.
If unspecified, at most 50 attachments will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "Optional. A page token, received from a previous `ListAttachments` call.\r\n Provide this to retrieve the subsequent page."
description: |-
Optional. A page token, received from a previous `ListAttachments` call.
Provide this to retrieve the subsequent page.
schema:
type: string
- name: filter
in: query
description: "Optional. Filter to apply to the list results.\r\n Example: \"type=image/png\" or \"filename:*.jpg\"\r\n Supported operators: =, !=, <, <=, >, >=, :\r\n Supported fields: filename, type, size, create_time, memo"
description: |-
Optional. Filter to apply to the list results.
Example: "type=image/png" or "filename:*.jpg"
Supported operators: =, !=, <, <=, >, >=, :
Supported fields: filename, type, size, create_time, memo
schema:
type: string
- name: orderBy
in: query
description: "Optional. The order to sort results by.\r\n Example: \"create_time desc\" or \"filename asc\""
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "filename asc"
schema:
type: string
responses:
@ -112,7 +130,9 @@ paths:
parameters:
- name: attachmentId
in: query
description: "Optional. The attachment ID to use for this attachment.\r\n If empty, a unique ID will be generated."
description: |-
Optional. The attachment ID to use for this attachment.
If empty, a unique ID will be generated.
schema:
type: string
requestBody:
@ -223,7 +243,9 @@ paths:
post:
tags:
- AuthService
description: "CreateSession authenticates a user and creates a new session.\r\n Returns the authenticated user information upon successful authentication."
description: |-
CreateSession authenticates a user and creates a new session.
Returns the authenticated user information upon successful authentication.
operationId: AuthService_CreateSession
requestBody:
content:
@ -248,7 +270,9 @@ paths:
get:
tags:
- AuthService
description: "GetCurrentSession returns the current active session information.\r\n This method is idempotent and safe, suitable for checking current session state."
description: |-
GetCurrentSession returns the current active session information.
This method is idempotent and safe, suitable for checking current session state.
operationId: AuthService_GetCurrentSession
responses:
"200":
@ -266,7 +290,9 @@ paths:
delete:
tags:
- AuthService
description: "DeleteSession terminates the current user session.\r\n This is an idempotent operation that invalidates the user's authentication."
description: |-
DeleteSession terminates the current user session.
This is an idempotent operation that invalidates the user's authentication.
operationId: AuthService_DeleteSession
responses:
"200":
@ -305,7 +331,9 @@ paths:
parameters:
- name: identityProviderId
in: query
description: "Optional. The ID to use for the identity provider, which will become the final component of the resource name.\r\n If not provided, the system will generate one."
description: |-
Optional. The ID to use for the identity provider, which will become the final component of the resource name.
If not provided, the system will generate one.
schema:
type: string
requestBody:
@ -389,7 +417,9 @@ paths:
type: string
- name: updateMask
in: query
description: "Required. The update mask applies to the resource. Only the top level fields of\r\n IdentityProvider are supported."
description: |-
Required. The update mask applies to the resource. Only the top level fields of
IdentityProvider are supported.
schema:
type: string
format: field-mask
@ -481,7 +511,9 @@ paths:
get:
tags:
- MarkdownService
description: "GetLinkMetadata returns metadata for a given link.\r\n This is useful for generating link previews."
description: |-
GetLinkMetadata returns metadata for a given link.
This is useful for generating link previews.
operationId: MarkdownService_GetLinkMetadata
parameters:
- name: link
@ -506,7 +538,9 @@ paths:
post:
tags:
- MarkdownService
description: "ParseMarkdown parses the given markdown content and returns a list of nodes.\r\n This is a utility method that transforms markdown text into structured nodes."
description: |-
ParseMarkdown parses the given markdown content and returns a list of nodes.
This is a utility method that transforms markdown text into structured nodes.
operationId: MarkdownService_ParseMarkdown
requestBody:
content:
@ -531,7 +565,9 @@ paths:
post:
tags:
- MarkdownService
description: "RestoreMarkdownNodes restores the given nodes to markdown content.\r\n This is the inverse operation of ParseMarkdown."
description: |-
RestoreMarkdownNodes restores the given nodes to markdown content.
This is the inverse operation of ParseMarkdown.
operationId: MarkdownService_RestoreMarkdownNodes
requestBody:
content:
@ -556,7 +592,9 @@ paths:
post:
tags:
- MarkdownService
description: "StringifyMarkdownNodes stringify the given nodes to plain text content.\r\n This removes all markdown formatting and returns plain text."
description: |-
StringifyMarkdownNodes stringify the given nodes to plain text content.
This removes all markdown formatting and returns plain text.
operationId: MarkdownService_StringifyMarkdownNodes
requestBody:
content:
@ -586,18 +624,26 @@ paths:
parameters:
- name: pageSize
in: query
description: "Optional. The maximum number of memos to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 memos will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
Optional. The maximum number of memos to return.
The service may return fewer than this value.
If unspecified, at most 50 memos will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "Optional. A page token, received from a previous `ListMemos` call.\r\n Provide this to retrieve the subsequent page."
description: |-
Optional. A page token, received from a previous `ListMemos` call.
Provide this to retrieve the subsequent page.
schema:
type: string
- name: state
in: query
description: "Optional. The state of the memos to list.\r\n Default to `NORMAL`. Set to `ARCHIVED` to list archived memos."
description: |-
Optional. The state of the memos to list.
Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
schema:
enum:
- STATE_UNSPECIFIED
@ -607,12 +653,18 @@ paths:
format: enum
- name: orderBy
in: query
description: "Optional. The order to sort results by.\r\n Default to \"display_time desc\".\r\n Example: \"display_time desc\" or \"create_time asc\""
description: |-
Optional. The order to sort results by.
Default to "display_time desc".
Example: "display_time desc" or "create_time asc"
schema:
type: string
- name: filter
in: query
description: "Optional. Filter to apply to the list results.\r\n Filter is a CEL expression to filter memos.\r\n Refer to `Shortcut.filter`."
description: |-
Optional. Filter to apply to the list results.
Filter is a CEL expression to filter memos.
Refer to `Shortcut.filter`.
schema:
type: string
- name: showDeleted
@ -641,7 +693,9 @@ paths:
parameters:
- name: memoId
in: query
description: "Optional. The memo ID to use for this memo.\r\n If empty, a unique ID will be generated."
description: |-
Optional. The memo ID to use for this memo.
If empty, a unique ID will be generated.
schema:
type: string
- name: validateOnly
@ -688,7 +742,9 @@ paths:
type: string
- name: readMask
in: query
description: "Optional. The fields to return in the response.\r\n If not specified, all fields are returned."
description: |-
Optional. The fields to return in the response.
If not specified, all fields are returned.
schema:
type: string
format: field-mask
@ -1050,36 +1106,25 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/memos/{memo}/tags/{tag}:
delete:
/api/v1/memos/{memo}/tags:delete:
post:
tags:
- MemoService
description: DeleteMemoTag deletes a tag for a memo.
operationId: MemoService_DeleteMemoTag
parameters:
- name: tag
in: path
description: Required. The tag name to delete.
required: true
schema:
type: string
- name: memo
in: path
description: The memo id.
required: true
schema:
type: string
- name: tag
in: path
description: The tag id.
required: true
schema:
type: string
- name: deleteRelatedMemos
in: query
description: Optional. Whether to delete related memos.
schema:
type: boolean
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMemoTagRequest'
required: true
responses:
"200":
description: OK
@ -1151,18 +1196,28 @@ paths:
parameters:
- name: pageSize
in: query
description: "Optional. The maximum number of users to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 users will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
Optional. The maximum number of users to return.
The service may return fewer than this value.
If unspecified, at most 50 users will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "Optional. A page token, received from a previous `ListUsers` call.\r\n Provide this to retrieve the subsequent page."
description: |-
Optional. A page token, received from a previous `ListUsers` call.
Provide this to retrieve the subsequent page.
schema:
type: string
- name: filter
in: query
description: "Optional. Filter to apply to the list results.\r\n Example: \"state=ACTIVE\" or \"role=USER\" or \"email:@example.com\"\r\n Supported operators: =, !=, <, <=, >, >=, :\r\n Supported fields: username, email, role, state, create_time, update_time"
description: |-
Optional. Filter to apply to the list results.
Example: "state=ACTIVE" or "role=USER" or "email:@example.com"
Supported operators: =, !=, <, <=, >, >=, :
Supported fields: username, email, role, state, create_time, update_time
schema:
type: string
- name: showDeleted
@ -1191,7 +1246,10 @@ paths:
parameters:
- name: userId
in: query
description: "Optional. The user ID to use for this user.\r\n If empty, a unique ID will be generated.\r\n Must match the pattern [a-z0-9-]+"
description: |-
Optional. The user ID to use for this user.
If empty, a unique ID will be generated.
Must match the pattern [a-z0-9-]+
schema:
type: string
- name: validateOnly
@ -1201,7 +1259,9 @@ paths:
type: boolean
- name: requestId
in: query
description: "Optional. An idempotency token that can be used to ensure that multiple\r\n requests to create a user have the same result."
description: |-
Optional. An idempotency token that can be used to ensure that multiple
requests to create a user have the same result.
schema:
type: string
requestBody:
@ -1238,7 +1298,9 @@ paths:
type: string
- name: readMask
in: query
description: "Optional. The fields to return in the response.\r\n If not specified, all fields are returned."
description: |-
Optional. The fields to return in the response.
If not specified, all fields are returned.
schema:
type: string
format: field-mask
@ -1465,23 +1527,35 @@ paths:
type: string
- name: pageSize
in: query
description: "Optional. The maximum number of inboxes to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 inboxes will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
Optional. The maximum number of inboxes to return.
The service may return fewer than this value.
If unspecified, at most 50 inboxes will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "Optional. A page token, received from a previous `ListInboxes` call.\r\n Provide this to retrieve the subsequent page."
description: |-
Optional. A page token, received from a previous `ListInboxes` call.
Provide this to retrieve the subsequent page.
schema:
type: string
- name: filter
in: query
description: "Optional. Filter to apply to the list results.\r\n Example: \"status=UNREAD\" or \"type=MEMO_COMMENT\"\r\n Supported operators: =, !=\r\n Supported fields: status, type, sender, create_time"
description: |-
Optional. Filter to apply to the list results.
Example: "status=UNREAD" or "type=MEMO_COMMENT"
Supported operators: =, !=
Supported fields: status, type, sender, create_time
schema:
type: string
- name: orderBy
in: query
description: "Optional. The order to sort results by.\r\n Example: \"create_time desc\" or \"status asc\""
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "status asc"
schema:
type: string
responses:
@ -1567,13 +1641,19 @@ paths:
type: string
- name: pageSize
in: query
description: "Optional. The maximum number of settings to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 settings will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
description: |-
Optional. The maximum number of settings to return.
The service may return fewer than this value.
If unspecified, at most 50 settings will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: "Optional. A page token, received from a previous `ListUserSettings` call.\r\n Provide this to retrieve the subsequent page."
description: |-
Optional. A page token, received from a previous `ListUserSettings` call.
Provide this to retrieve the subsequent page.
schema:
type: string
responses:
@ -2128,11 +2208,15 @@ components:
name:
readOnly: true
type: string
description: "The name of the activity.\r\n Format: activities/{id}"
description: |-
The name of the activity.
Format: activities/{id}
creator:
readOnly: true
type: string
description: "The name of the creator.\r\n Format: users/{user}"
description: |-
The name of the creator.
Format: users/{user}
type:
readOnly: true
enum:
@ -2167,10 +2251,14 @@ components:
properties:
memo:
type: string
description: "The memo name of comment.\r\n Format: memos/{memo}"
description: |-
The memo name of comment.
Format: memos/{memo}
relatedMemo:
type: string
description: "The name of related memo.\r\n Format: memos/{memo}"
description: |-
The name of related memo.
Format: memos/{memo}
description: ActivityMemoCommentPayload represents the payload of a memo comment activity.
ActivityPayload:
type: object
@ -2187,7 +2275,9 @@ components:
properties:
name:
type: string
description: "The name of the attachment.\r\n Format: attachments/{attachment}"
description: |-
The name of the attachment.
Format: attachments/{attachment}
createTime:
readOnly: true
type: string
@ -2213,7 +2303,9 @@ components:
description: Output only. The size of the attachment in bytes.
memo:
type: string
description: "Optional. The related memo. Refer to `Memo.name`.\r\n Format: memos/{memo}"
description: |-
Optional. The related memo. Refer to `Memo.name`.
Format: memos/{memo}
AutoLinkNode:
type: object
properties:
@ -2275,10 +2367,14 @@ components:
properties:
username:
type: string
description: "The username to sign in with.\r\n Required field for password-based authentication."
description: |-
The username to sign in with.
Required field for password-based authentication.
password:
type: string
description: "The password to sign in with.\r\n Required field for password-based authentication."
description: |-
The password to sign in with.
Required field for password-based authentication.
description: Nested message for password-based authentication credentials.
CreateSessionRequest_SSOCredentials:
required:
@ -2289,14 +2385,20 @@ components:
properties:
idpId:
type: integer
description: "The ID of the SSO provider.\r\n Required field to identify the SSO provider."
description: |-
The ID of the SSO provider.
Required field to identify the SSO provider.
format: int32
code:
type: string
description: "The authorization code from the SSO provider.\r\n Required field for completing the SSO flow."
description: |-
The authorization code from the SSO provider.
Required field for completing the SSO flow.
redirectUri:
type: string
description: "The redirect URI used in the SSO flow.\r\n Required field for security validation."
description: |-
The redirect URI used in the SSO flow.
Required field for security validation.
description: Nested message for SSO authentication credentials.
CreateSessionResponse:
type: object
@ -2307,8 +2409,27 @@ components:
description: The authenticated user information.
lastAccessedAt:
type: string
description: "Last time the session was accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
description: |-
Last time the session was accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
format: date-time
DeleteMemoTagRequest:
required:
- parent
- tag
type: object
properties:
parent:
type: string
description: |-
Required. The parent, who owns the tags.
Format: memos/{memo}. Use "memos/-" to delete all tags.
tag:
type: string
description: Required. The tag name to delete.
deleteRelatedMemos:
type: boolean
description: Optional. Whether to delete related memos.
EmbeddedContentNode:
type: object
properties:
@ -2355,7 +2476,9 @@ components:
$ref: '#/components/schemas/User'
lastAccessedAt:
type: string
description: "Last time the session was accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
description: |-
Last time the session was accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
format: date-time
GoogleProtobufAny:
type: object
@ -2403,7 +2526,9 @@ components:
properties:
name:
type: string
description: "The resource name of the identity provider.\r\n Format: identityProviders/{idp}"
description: |-
The resource name of the identity provider.
Format: identityProviders/{idp}
type:
enum:
- TYPE_UNSPECIFIED
@ -2438,15 +2563,21 @@ components:
properties:
name:
type: string
description: "The resource name of the inbox.\r\n Format: inboxes/{inbox}"
description: |-
The resource name of the inbox.
Format: inboxes/{inbox}
sender:
readOnly: true
type: string
description: "The sender of the inbox notification.\r\n Format: users/{user}"
description: |-
The sender of the inbox notification.
Format: users/{user}
receiver:
readOnly: true
type: string
description: "The receiver of the inbox notification.\r\n Format: users/{user}"
description: |-
The receiver of the inbox notification.
Format: users/{user}
status:
enum:
- STATUS_UNSPECIFIED
@ -2516,7 +2647,10 @@ components:
description: The activities.
nextPageToken:
type: string
description: "A token to retrieve the next page of results.\r\n Pass this value in the page_token field in the subsequent call to `ListActivities`\r\n method to retrieve the next page of results."
description: |-
A token to retrieve the next page of results.
Pass this value in the page_token field in the subsequent call to `ListActivities`
method to retrieve the next page of results.
ListAllUserStatsResponse:
type: object
properties:
@ -2535,7 +2669,9 @@ components:
description: The list of attachments.
nextPageToken:
type: string
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
description: The total count of attachments (may be approximate).
@ -2558,7 +2694,9 @@ components:
description: The list of inboxes.
nextPageToken:
type: string
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
description: The total count of inboxes (may be approximate).
@ -2633,7 +2771,9 @@ components:
description: The list of memos.
nextPageToken:
type: string
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
description: The total count of memos (may be approximate).
@ -2697,7 +2837,9 @@ components:
description: The list of user settings.
nextPageToken:
type: string
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
description: The total count of settings (may be approximate).
@ -2721,7 +2863,9 @@ components:
description: The list of users.
nextPageToken:
type: string
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
description: The total count of users (may be approximate).
@ -2759,7 +2903,9 @@ components:
properties:
name:
type: string
description: "The resource name of the memo.\r\n Format: memos/{memo}, memo is the user defined id or uuid."
description: |-
The resource name of the memo.
Format: memos/{memo}, memo is the user defined id or uuid.
state:
enum:
- STATE_UNSPECIFIED
@ -2771,7 +2917,9 @@ components:
creator:
readOnly: true
type: string
description: "The name of the creator.\r\n Format: users/{user}"
description: |-
The name of the creator.
Format: users/{user}
createTime:
readOnly: true
type: string
@ -2837,7 +2985,9 @@ components:
parent:
readOnly: true
type: string
description: "Output only. The name of the parent memo.\r\n Format: memos/{memo}"
description: |-
Output only. The name of the parent memo.
Format: memos/{memo}
snippet:
readOnly: true
type: string
@ -2875,7 +3025,9 @@ components:
properties:
name:
type: string
description: "The resource name of the memo.\r\n Format: memos/{memo}"
description: |-
The resource name of the memo.
Format: memos/{memo}
snippet:
readOnly: true
type: string
@ -3061,14 +3213,21 @@ components:
name:
readOnly: true
type: string
description: "The resource name of the reaction.\r\n Format: reactions/{reaction}"
description: |-
The resource name of the reaction.
Format: reactions/{reaction}
creator:
readOnly: true
type: string
description: "The resource name of the creator.\r\n Format: users/{user}"
description: |-
The resource name of the creator.
Format: users/{user}
contentId:
type: string
description: "The resource name of the content.\r\n For memo reactions, this should be the memo's resource name.\r\n Format: memos/{memo}"
description: |-
The resource name of the content.
For memo reactions, this should be the memo's resource name.
Format: memos/{memo}
reactionType:
type: string
description: "Required. The type of reaction (e.g., \"\U0001F44D\", \"❤️\", \"\U0001F604\")."
@ -3095,7 +3254,9 @@ components:
properties:
parent:
type: string
description: "Required. The parent, who owns the tags.\r\n Format: memos/{memo}. Use \"memos/-\" to rename all tags."
description: |-
Required. The parent, who owns the tags.
Format: memos/{memo}. Use "memos/-" to rename all tags.
oldTag:
type: string
description: Required. The old tag name to rename.
@ -3126,7 +3287,9 @@ components:
properties:
name:
type: string
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
attachments:
type: array
items:
@ -3140,7 +3303,9 @@ components:
properties:
name:
type: string
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
relations:
type: array
items:
@ -3153,7 +3318,9 @@ components:
properties:
name:
type: string
description: "The resource name of the shortcut.\r\n Format: users/{user}/shortcuts/{shortcut}"
description: |-
The resource name of the shortcut.
Format: users/{user}/shortcuts/{shortcut}
title:
type: string
description: The title of the shortcut.
@ -3196,7 +3363,9 @@ components:
type: string
usePathStyle:
type: boolean
description: "S3 configuration for cloud storage backend.\r\n Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/"
description: |-
S3 configuration for cloud storage backend.
Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
StrikethroughNode:
type: object
properties:
@ -3294,7 +3463,9 @@ components:
properties:
name:
type: string
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
reaction:
allOf:
- $ref: '#/components/schemas/Reaction'
@ -3308,7 +3479,9 @@ components:
properties:
name:
type: string
description: "The resource name of the user.\r\n Format: users/{user}"
description: |-
The resource name of the user.
Format: users/{user}
role:
enum:
- ROLE_UNSPECIFIED
@ -3360,7 +3533,9 @@ components:
properties:
name:
type: string
description: "The resource name of the access token.\r\n Format: users/{user}/accessTokens/{access_token}"
description: |-
The resource name of the access token.
Format: users/{user}/accessTokens/{access_token}
accessToken:
readOnly: true
type: string
@ -3383,7 +3558,9 @@ components:
properties:
name:
type: string
description: "The resource name of the session.\r\n Format: users/{user}/sessions/{session}"
description: |-
The resource name of the session.
Format: users/{user}/sessions/{session}
sessionId:
readOnly: true
type: string
@ -3396,7 +3573,9 @@ components:
lastAccessedTime:
readOnly: true
type: string
description: "The timestamp when the session was last accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
description: |-
The timestamp when the session was last accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
format: date-time
clientInfo:
readOnly: true
@ -3426,7 +3605,10 @@ components:
properties:
name:
type: string
description: "The name of the user setting.\r\n Format: users/{user}/settings/{setting}, {setting} is the key for the setting.\r\n For example, \"users/123/settings/GENERAL\" for general settings."
description: |-
The name of the user setting.
Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
For example, "users/123/settings/GENERAL" for general settings.
generalSetting:
$ref: '#/components/schemas/UserSetting_GeneralSetting'
sessionsSetting:
@ -3459,7 +3641,10 @@ components:
description: The default visibility of the memo.
theme:
type: string
description: "The preferred theme of the user.\r\n This references a CSS file in the web/public/themes/ directory.\r\n If not set, the default theme will be used."
description: |-
The preferred theme of the user.
This references a CSS file in the web/public/themes/ directory.
If not set, the default theme will be used.
description: General user settings configuration.
UserSetting_SessionsSetting:
type: object
@ -3484,7 +3669,9 @@ components:
properties:
name:
type: string
description: "The resource name of the user whose stats these are.\r\n Format: users/{user}"
description: |-
The resource name of the user whose stats these are.
Format: users/{user}
memoDisplayTimestamps:
type: array
items:
@ -3532,7 +3719,9 @@ components:
properties:
name:
type: string
description: "The name of the webhook.\r\n Format: users/{user}/webhooks/{webhook}"
description: |-
The name of the webhook.
Format: users/{user}/webhooks/{webhook}
url:
type: string
description: The URL to send the webhook to.
@ -3555,7 +3744,9 @@ components:
properties:
owner:
type: string
description: "The name of instance owner.\r\n Format: users/{user}"
description: |-
The name of instance owner.
Format: users/{user}
version:
type: string
description: Version is the current version of instance.
@ -3571,7 +3762,9 @@ components:
properties:
name:
type: string
description: "The name of the workspace setting.\r\n Format: workspace/settings/{setting}"
description: |-
The name of the workspace setting.
Format: workspace/settings/{setting}
generalSetting:
$ref: '#/components/schemas/WorkspaceSetting_GeneralSetting'
storageSetting:
@ -3584,7 +3777,9 @@ components:
properties:
theme:
type: string
description: "theme is the name of the selected theme.\r\n This references a CSS file in the web/public/themes/ directory."
description: |-
theme is the name of the selected theme.
This references a CSS file in the web/public/themes/ directory.
disallowUserRegistration:
type: boolean
description: disallow_user_registration disallows user registration.
@ -3603,7 +3798,10 @@ components:
description: custom_profile is the custom profile.
weekStartDayOffset:
type: integer
description: "week_start_day_offset is the week start day offset from Sunday.\r\n 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday\r\n Default is Sunday."
description: |-
week_start_day_offset is the week start day offset from Sunday.
0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
Default is Sunday.
format: int32
disallowChangeUsername:
type: boolean
@ -3662,7 +3860,9 @@ components:
format: enum
filepathTemplate:
type: string
description: "The template of file path.\r\n e.g. assets/{timestamp}_{filename}"
description: |-
The template of file path.
e.g. assets/{timestamp}_{filename}
uploadSizeLimitMb:
type: string
description: The max upload size in megabytes.

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/activity.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/attachment.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/idp.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/inbox.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/memo.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/user_setting.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc-gen-go v1.36.7
// protoc (unknown)
// source: store/workspace_setting.proto

View File

@ -2875,9 +2875,12 @@ export const MemoServiceDefinition = {
8410: [new Uint8Array([10, 112, 97, 114, 101, 110, 116, 44, 116, 97, 103])],
578365826: [
new Uint8Array([
37,
41,
58,
1,
42,
35,
34,
36,
47,
97,
112,
@ -2907,12 +2910,13 @@ export const MemoServiceDefinition = {
97,
103,
115,
47,
123,
58,
100,
101,
108,
101,
116,
97,
103,
125,
101,
]),
],
},

View File

@ -35,7 +35,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024",
/**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
* used or relyed on outside of tests.
* used or relied on outside of tests.
*/
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
@ -128,6 +128,52 @@ export function editionToNumber(object: Edition): number {
}
}
/**
* Describes the 'visibility' of a symbol with respect to the proto import
* system. Symbols can only be imported when the visibility rules do not prevent
* it (ex: local symbols cannot be imported). Visibility modifiers can only set
* on `message` and `enum` as they are the only types available to be referenced
* from other files.
*/
export enum SymbolVisibility {
VISIBILITY_UNSET = "VISIBILITY_UNSET",
VISIBILITY_LOCAL = "VISIBILITY_LOCAL",
VISIBILITY_EXPORT = "VISIBILITY_EXPORT",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function symbolVisibilityFromJSON(object: any): SymbolVisibility {
switch (object) {
case 0:
case "VISIBILITY_UNSET":
return SymbolVisibility.VISIBILITY_UNSET;
case 1:
case "VISIBILITY_LOCAL":
return SymbolVisibility.VISIBILITY_LOCAL;
case 2:
case "VISIBILITY_EXPORT":
return SymbolVisibility.VISIBILITY_EXPORT;
case -1:
case "UNRECOGNIZED":
default:
return SymbolVisibility.UNRECOGNIZED;
}
}
export function symbolVisibilityToNumber(object: SymbolVisibility): number {
switch (object) {
case SymbolVisibility.VISIBILITY_UNSET:
return 0;
case SymbolVisibility.VISIBILITY_LOCAL:
return 1;
case SymbolVisibility.VISIBILITY_EXPORT:
return 2;
case SymbolVisibility.UNRECOGNIZED:
default:
return -1;
}
}
/**
* The protocol compiler can output a FileDescriptorSet containing the .proto
* files it parses.
@ -155,6 +201,11 @@ export interface FileDescriptorProto {
* For Google-internal migration only. Do not use.
*/
weakDependency: number[];
/**
* Names of files imported by this file purely for the purpose of providing
* option extensions. These are excluded from the dependency list above.
*/
optionDependency: string[];
/** All top-level definitions in this file. */
messageType: DescriptorProto[];
enumType: EnumDescriptorProto[];
@ -177,11 +228,19 @@ export interface FileDescriptorProto {
* The supported values are "proto2", "proto3", and "editions".
*
* If `edition` is present, this value must be "editions".
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
syntax?:
| string
| undefined;
/** The edition of the proto file. */
/**
* The edition of the proto file.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
edition?: Edition | undefined;
}
@ -201,6 +260,8 @@ export interface DescriptorProto {
* A given name may only be reserved once.
*/
reservedName: string[];
/** Support for `export` and `local` keywords on enums. */
visibility?: SymbolVisibility | undefined;
}
export interface DescriptorProto_ExtensionRange {
@ -624,6 +685,8 @@ export interface EnumDescriptorProto {
* be reserved once.
*/
reservedName: string[];
/** Support for `export` and `local` keywords on enums. */
visibility?: SymbolVisibility | undefined;
}
/**
@ -828,7 +891,12 @@ export interface FileOptions {
rubyPackage?:
| string
| undefined;
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -966,7 +1034,12 @@ export interface MessageOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -976,12 +1049,13 @@ export interface MessageOptions {
export interface FieldOptions {
/**
* NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
* type "bytes" in the open source release -- sorry, we'll try to include
* other types in a future version!
* type "bytes" in the open source release.
* TODO: make ctype actually deprecated.
*/
ctype?:
| FieldOptions_CType
@ -1070,7 +1144,12 @@ export interface FieldOptions {
retention?: FieldOptions_OptionRetention | undefined;
targets: FieldOptions_OptionTargetType[];
editionDefaults: FieldOptions_EditionDefault[];
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: FeatureSet | undefined;
featureSupport?:
| FieldOptions_FeatureSupport
@ -1169,11 +1248,7 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
}
}
/**
* If set to RETENTION_SOURCE, the option will be omitted from the binary.
* Note: as of January 2023, support for this is in progress and does not yet
* have an effect (b/264593489).
*/
/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME",
@ -1216,8 +1291,7 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
* option on any kind of entity. Note: as of January 2023, support for this is
* in progress and does not yet have an effect (b/264593489).
* option on any kind of entity.
*/
export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
@ -1341,7 +1415,12 @@ export interface FieldOptions_FeatureSupport {
}
export interface OneofOptions {
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -1379,7 +1458,12 @@ export interface EnumOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -1397,7 +1481,12 @@ export interface EnumValueOptions {
deprecated?:
| boolean
| undefined;
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -1418,7 +1507,12 @@ export interface EnumValueOptions {
}
export interface ServiceOptions {
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -1446,7 +1540,12 @@ export interface MethodOptions {
idempotencyLevel?:
| MethodOptions_IdempotencyLevel
| undefined;
/** Any features defined in the specific edition. */
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?:
| FeatureSet
| undefined;
@ -1549,6 +1648,8 @@ export interface FeatureSet {
utf8Validation?: FeatureSet_Utf8Validation | undefined;
messageEncoding?: FeatureSet_MessageEncoding | undefined;
jsonFormat?: FeatureSet_JsonFormat | undefined;
enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility | undefined;
}
export enum FeatureSet_FieldPresence {
@ -1791,6 +1892,111 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu
}
}
export enum FeatureSet_EnforceNamingStyle {
ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
STYLE2024 = "STYLE2024",
STYLE_LEGACY = "STYLE_LEGACY",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
switch (object) {
case 0:
case "ENFORCE_NAMING_STYLE_UNKNOWN":
return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
case 1:
case "STYLE2024":
return FeatureSet_EnforceNamingStyle.STYLE2024;
case 2:
case "STYLE_LEGACY":
return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
case -1:
case "UNRECOGNIZED":
default:
return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
}
}
export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
switch (object) {
case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
return 0;
case FeatureSet_EnforceNamingStyle.STYLE2024:
return 1;
case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
return 2;
case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
default:
return -1;
}
}
export interface FeatureSet_VisibilityFeature {
}
export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility {
DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",
/** EXPORT_ALL - Default pre-EDITION_2024, all UNSET visibility are export. */
EXPORT_ALL = "EXPORT_ALL",
/** EXPORT_TOP_LEVEL - All top-level symbols default to export, nested default to local. */
EXPORT_TOP_LEVEL = "EXPORT_TOP_LEVEL",
/** LOCAL_ALL - All symbols default to local. */
LOCAL_ALL = "LOCAL_ALL",
/**
* STRICT - All symbols local by default. Nested types cannot be exported.
* With special case caveat for message { enum {} reserved 1 to max; }
* This is the recommended setting for new protos.
*/
STRICT = "STRICT",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(
object: any,
): FeatureSet_VisibilityFeature_DefaultSymbolVisibility {
switch (object) {
case 0:
case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN":
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
case 1:
case "EXPORT_ALL":
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL;
case 2:
case "EXPORT_TOP_LEVEL":
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL;
case 3:
case "LOCAL_ALL":
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL;
case 4:
case "STRICT":
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT;
case -1:
case "UNRECOGNIZED":
default:
return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED;
}
}
export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToNumber(
object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility,
): number {
switch (object) {
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:
return 0;
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL:
return 1;
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL:
return 2;
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL:
return 3;
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT:
return 4;
case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED:
default:
return -1;
}
}
/**
* A compiled specification for the defaults of a set of features. These
* messages are generated from FeatureSet extensions and can be used to seed
@ -2111,6 +2317,7 @@ function createBaseFileDescriptorProto(): FileDescriptorProto {
dependency: [],
publicDependency: [],
weakDependency: [],
optionDependency: [],
messageType: [],
enumType: [],
service: [],
@ -2143,6 +2350,9 @@ export const FileDescriptorProto: MessageFns<FileDescriptorProto> = {
writer.int32(v);
}
writer.join();
for (const v of message.optionDependency) {
writer.uint32(122).string(v!);
}
for (const v of message.messageType) {
DescriptorProto.encode(v!, writer.uint32(34).fork()).join();
}
@ -2237,6 +2447,14 @@ export const FileDescriptorProto: MessageFns<FileDescriptorProto> = {
break;
}
case 15: {
if (tag !== 122) {
break;
}
message.optionDependency.push(reader.string());
continue;
}
case 4: {
if (tag !== 34) {
break;
@ -2320,6 +2538,7 @@ export const FileDescriptorProto: MessageFns<FileDescriptorProto> = {
message.dependency = object.dependency?.map((e) => e) || [];
message.publicDependency = object.publicDependency?.map((e) => e) || [];
message.weakDependency = object.weakDependency?.map((e) => e) || [];
message.optionDependency = object.optionDependency?.map((e) => e) || [];
message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || [];
message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || [];
message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || [];
@ -2348,6 +2567,7 @@ function createBaseDescriptorProto(): DescriptorProto {
options: undefined,
reservedRange: [],
reservedName: [],
visibility: SymbolVisibility.VISIBILITY_UNSET,
};
}
@ -2383,6 +2603,9 @@ export const DescriptorProto: MessageFns<DescriptorProto> = {
for (const v of message.reservedName) {
writer.uint32(82).string(v!);
}
if (message.visibility !== undefined && message.visibility !== SymbolVisibility.VISIBILITY_UNSET) {
writer.uint32(88).int32(symbolVisibilityToNumber(message.visibility));
}
return writer;
},
@ -2473,6 +2696,14 @@ export const DescriptorProto: MessageFns<DescriptorProto> = {
message.reservedName.push(reader.string());
continue;
}
case 11: {
if (tag !== 88) {
break;
}
message.visibility = symbolVisibilityFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
@ -2499,6 +2730,7 @@ export const DescriptorProto: MessageFns<DescriptorProto> = {
: undefined;
message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || [];
message.reservedName = object.reservedName?.map((e) => e) || [];
message.visibility = object.visibility ?? SymbolVisibility.VISIBILITY_UNSET;
return message;
},
};
@ -3059,7 +3291,14 @@ export const OneofDescriptorProto: MessageFns<OneofDescriptorProto> = {
};
function createBaseEnumDescriptorProto(): EnumDescriptorProto {
return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] };
return {
name: "",
value: [],
options: undefined,
reservedRange: [],
reservedName: [],
visibility: SymbolVisibility.VISIBILITY_UNSET,
};
}
export const EnumDescriptorProto: MessageFns<EnumDescriptorProto> = {
@ -3079,6 +3318,9 @@ export const EnumDescriptorProto: MessageFns<EnumDescriptorProto> = {
for (const v of message.reservedName) {
writer.uint32(42).string(v!);
}
if (message.visibility !== undefined && message.visibility !== SymbolVisibility.VISIBILITY_UNSET) {
writer.uint32(48).int32(symbolVisibilityToNumber(message.visibility));
}
return writer;
},
@ -3129,6 +3371,14 @@ export const EnumDescriptorProto: MessageFns<EnumDescriptorProto> = {
message.reservedName.push(reader.string());
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.visibility = symbolVisibilityFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
@ -3151,6 +3401,7 @@ export const EnumDescriptorProto: MessageFns<EnumDescriptorProto> = {
message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) ||
[];
message.reservedName = object.reservedName?.map((e) => e) || [];
message.visibility = object.visibility ?? SymbolVisibility.VISIBILITY_UNSET;
return message;
},
};
@ -4914,6 +5165,8 @@ function createBaseFeatureSet(): FeatureSet {
utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
};
}
@ -4948,6 +5201,21 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
}
if (
message.enforceNamingStyle !== undefined &&
message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
) {
writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
}
if (
message.defaultSymbolVisibility !== undefined &&
message.defaultSymbolVisibility !==
FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
) {
writer.uint32(64).int32(
featureSet_VisibilityFeature_DefaultSymbolVisibilityToNumber(message.defaultSymbolVisibility),
);
}
return writer;
},
@ -5006,6 +5274,24 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
continue;
}
case 8: {
if (tag !== 64) {
break;
}
message.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(
reader.int32(),
);
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
@ -5027,6 +5313,44 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
message.enforceNamingStyle = object.enforceNamingStyle ??
FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
message.defaultSymbolVisibility = object.defaultSymbolVisibility ??
FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
return message;
},
};
function createBaseFeatureSet_VisibilityFeature(): FeatureSet_VisibilityFeature {
return {};
}
export const FeatureSet_VisibilityFeature: MessageFns<FeatureSet_VisibilityFeature> = {
encode(_: FeatureSet_VisibilityFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet_VisibilityFeature {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseFeatureSet_VisibilityFeature();
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<FeatureSet_VisibilityFeature>): FeatureSet_VisibilityFeature {
return FeatureSet_VisibilityFeature.fromPartial(base ?? {});
},
fromPartial(_: DeepPartial<FeatureSet_VisibilityFeature>): FeatureSet_VisibilityFeature {
const message = createBaseFeatureSet_VisibilityFeature();
return message;
},
};