refactor(memo-views): replace shortcuts with saved views (#6167)
This commit is contained in:
parent
6c22f9562b
commit
4e8b262d6d
131 changed files with 3954 additions and 3241 deletions
|
|
@ -188,13 +188,17 @@ func TestRenderTagStringPredicatesAreExactPerDialect(t *testing.T) {
|
||||||
{name: "contains", expression: `t.contains("Work_%!")`, sqliteSQL: "instr(tag_item.value, ?) > 0", sqliteArgs: []any{"Work_%!"}, likePattern: "%Work!_!%!!%", usesLike: true},
|
{name: "contains", expression: `t.contains("Work_%!")`, sqliteSQL: "instr(tag_item.value, ?) > 0", sqliteArgs: []any{"Work_%!"}, likePattern: "%Work!_!%!!%", usesLike: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MySQL cannot use EXISTS here: its semi-join rewrite drops JSON_TABLE's lateral
|
||||||
|
// dependency on the outer row, so it counts rows instead. See
|
||||||
|
// TestTagComprehensionAvoidsMySQLExistsSemiJoin.
|
||||||
for _, comprehension := range []struct {
|
for _, comprehension := range []struct {
|
||||||
kind string
|
kind string
|
||||||
sqlFragment string
|
sqlFragment string
|
||||||
|
mysqlSQL string
|
||||||
}{
|
}{
|
||||||
{kind: "exists", sqlFragment: "EXISTS (SELECT 1"},
|
{kind: "exists", sqlFragment: "EXISTS (SELECT 1", mysqlSQL: "SELECT COUNT(*)"},
|
||||||
{kind: "all", sqlFragment: "NOT EXISTS (SELECT 1"},
|
{kind: "all", sqlFragment: "NOT EXISTS (SELECT 1", mysqlSQL: "SELECT COUNT(*)"},
|
||||||
{kind: "exists_one", sqlFragment: "SELECT COUNT(*)"},
|
{kind: "exists_one", sqlFragment: "SELECT COUNT(*)", mysqlSQL: "SELECT COUNT(*)"},
|
||||||
} {
|
} {
|
||||||
for _, predicate := range predicates {
|
for _, predicate := range predicates {
|
||||||
expression := fmt.Sprintf("tags.%s(t, %s)", comprehension.kind, predicate.expression)
|
expression := fmt.Sprintf("tags.%s(t, %s)", comprehension.kind, predicate.expression)
|
||||||
|
|
@ -212,7 +216,8 @@ func TestRenderTagStringPredicatesAreExactPerDialect(t *testing.T) {
|
||||||
mysqlStmt, err := engine.CompileToStatement(context.Background(), expression, RenderOptions{Dialect: DialectMySQL})
|
mysqlStmt, err := engine.CompileToStatement(context.Background(), expression, RenderOptions{Dialect: DialectMySQL})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Contains(t, mysqlStmt.SQL, "JSON_TABLE(")
|
require.Contains(t, mysqlStmt.SQL, "JSON_TABLE(")
|
||||||
require.Contains(t, mysqlStmt.SQL, comprehension.sqlFragment)
|
require.Contains(t, mysqlStmt.SQL, comprehension.mysqlSQL)
|
||||||
|
require.NotContains(t, mysqlStmt.SQL, "EXISTS (SELECT 1")
|
||||||
require.Contains(t, mysqlStmt.SQL, "CAST(tag_item.value AS BINARY)")
|
require.Contains(t, mysqlStmt.SQL, "CAST(tag_item.value AS BINARY)")
|
||||||
|
|
||||||
postgresStmt, err := engine.CompileToStatement(context.Background(), expression, RenderOptions{Dialect: DialectPostgres})
|
postgresStmt, err := engine.CompileToStatement(context.Background(), expression, RenderOptions{Dialect: DialectPostgres})
|
||||||
|
|
@ -434,7 +439,9 @@ func TestRenderTagsAllPerDialect(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{DialectSQLite, []string{"NOT EXISTS", "json_each(", "json_array_length(", "instr(tag_item.value, ?) = 1"}, []any{"work/"}},
|
{DialectSQLite, []string{"NOT EXISTS", "json_each(", "json_array_length(", "instr(tag_item.value, ?) = 1"}, []any{"work/"}},
|
||||||
{DialectPostgres, []string{"NOT EXISTS", "jsonb_array_elements_text(", "jsonb_array_length(", `(tag_item.value COLLATE "C") LIKE`}, []any{"work/%"}},
|
{DialectPostgres, []string{"NOT EXISTS", "jsonb_array_elements_text(", "jsonb_array_length(", `(tag_item.value COLLATE "C") LIKE`}, []any{"work/%"}},
|
||||||
{DialectMySQL, []string{"NOT EXISTS", "JSON_TABLE(", "JSON_LENGTH(", "CAST(tag_item.value AS BINARY) LIKE"}, []any{"work/%"}},
|
// MySQL counts non-matching rows instead of using NOT EXISTS; see
|
||||||
|
// TestTagComprehensionAvoidsMySQLExistsSemiJoin.
|
||||||
|
{DialectMySQL, []string{") = 0", "JSON_TABLE(", "JSON_LENGTH(", "CAST(tag_item.value AS BINARY) LIKE"}, []any{"work/%"}},
|
||||||
}
|
}
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
stmt, err := engine.CompileToStatement(context.Background(), `tags.all(t, t.startsWith("work/"))`, RenderOptions{Dialect: tc.dialect})
|
stmt, err := engine.CompileToStatement(context.Background(), `tags.all(t, t.startsWith("work/"))`, RenderOptions{Dialect: tc.dialect})
|
||||||
|
|
@ -468,3 +475,41 @@ func TestRenderAllRejectsUnsupportedPredicate(t *testing.T) {
|
||||||
_, err = engine.CompileToStatement(context.Background(), `tags.all(t, size(t) > 2)`, RenderOptions{Dialect: DialectSQLite})
|
_, err = engine.CompileToStatement(context.Background(), `tags.all(t, size(t) > 2)`, RenderOptions{Dialect: DialectSQLite})
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestTagComprehensionAvoidsMySQLExistsSemiJoin pins the reason MySQL renders tag
|
||||||
|
// comprehensions as row counts rather than EXISTS.
|
||||||
|
//
|
||||||
|
// MySQL rewrites `EXISTS (SELECT ... FROM JSON_TABLE(<outer column>, ...))` into a
|
||||||
|
// semi-join, and that rewrite drops JSON_TABLE's lateral dependency on the outer row:
|
||||||
|
// the subquery evaluates as empty for every row, so the predicate is silently always
|
||||||
|
// false and every tag filter returns nothing. It fails with no SQL error, which is why
|
||||||
|
// this is guarded here rather than left to the container suite. `NOT EXISTS` happens to
|
||||||
|
// take the anti-join path and works, but relying on that asymmetry is not worth it, so
|
||||||
|
// both directions use counts.
|
||||||
|
func TestTagComprehensionAvoidsMySQLExistsSemiJoin(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
engine, err := NewEngine(NewSchema())
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
for _, expression := range []string{
|
||||||
|
`tags.exists(t, t == "work")`,
|
||||||
|
`tags.exists(t, t.startsWith("work/"))`,
|
||||||
|
`tags.all(t, t == "work")`,
|
||||||
|
`tags.all(t, t.contains("work"))`,
|
||||||
|
`tags.exists_one(t, t == "work")`,
|
||||||
|
} {
|
||||||
|
stmt, err := engine.CompileToStatement(context.Background(), expression, RenderOptions{Dialect: DialectMySQL})
|
||||||
|
require.NoError(t, err, expression)
|
||||||
|
require.NotContains(t, stmt.SQL, "EXISTS", "%s must not use EXISTS on MySQL", expression)
|
||||||
|
require.Contains(t, stmt.SQL, "SELECT COUNT(*)", "%s should count JSON_TABLE rows on MySQL", expression)
|
||||||
|
require.Contains(t, stmt.SQL, "JSON_TABLE(", expression)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The other dialects correlate EXISTS correctly and keep using it.
|
||||||
|
for _, dialect := range []DialectName{DialectSQLite, DialectPostgres} {
|
||||||
|
stmt, err := engine.CompileToStatement(context.Background(), `tags.exists(t, t == "work")`, RenderOptions{Dialect: dialect})
|
||||||
|
require.NoError(t, err, dialect)
|
||||||
|
require.Contains(t, stmt.SQL, "EXISTS (SELECT 1", "dialect %s", dialect)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -627,11 +627,28 @@ func (r *renderer) renderTagComprehension(field Field, pred PredicateExpr, kind
|
||||||
return renderResult{}, errors.Errorf("unsupported dialect %s", r.dialect)
|
return renderResult{}, errors.Errorf("unsupported dialect %s", r.dialect)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MySQL rewrites `EXISTS (SELECT ... FROM JSON_TABLE(<outer column>))` into a semi-join
|
||||||
|
// that drops the lateral dependency on the outer row, so the subquery silently evaluates
|
||||||
|
// as empty and the predicate is always false. Counting rows keeps the correlation intact.
|
||||||
|
// See TestTagComprehensionAvoidsMySQLExistsSemiJoin.
|
||||||
|
anyMatch := func(cond string) string {
|
||||||
|
if r.dialect == DialectMySQL {
|
||||||
|
return fmt.Sprintf("(SELECT COUNT(*) FROM %s WHERE %s) > 0", elements, cond)
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("EXISTS (SELECT 1 FROM %s WHERE %s)", elements, cond)
|
||||||
|
}
|
||||||
|
noMatch := func(cond string) string {
|
||||||
|
if r.dialect == DialectMySQL {
|
||||||
|
return fmt.Sprintf("(SELECT COUNT(*) FROM %s WHERE %s) = 0", elements, cond)
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("NOT EXISTS (SELECT 1 FROM %s WHERE %s)", elements, cond)
|
||||||
|
}
|
||||||
|
|
||||||
switch kind {
|
switch kind {
|
||||||
case ComprehensionExists:
|
case ComprehensionExists:
|
||||||
return renderResult{sql: fmt.Sprintf("EXISTS (SELECT 1 FROM %s WHERE %s)", elements, elemCond)}, nil
|
return renderResult{sql: anyMatch(elemCond)}, nil
|
||||||
case ComprehensionAll:
|
case ComprehensionAll:
|
||||||
return renderResult{sql: fmt.Sprintf("(%s > 0 AND NOT EXISTS (SELECT 1 FROM %s WHERE NOT (%s)))", length, elements, elemCond)}, nil
|
return renderResult{sql: fmt.Sprintf("(%s > 0 AND %s)", length, noMatch(fmt.Sprintf("NOT (%s)", elemCond)))}, nil
|
||||||
case ComprehensionExistsOne:
|
case ComprehensionExistsOne:
|
||||||
return renderResult{sql: fmt.Sprintf("(SELECT COUNT(*) FROM %s WHERE %s) = 1", elements, elemCond)}, nil
|
return renderResult{sql: fmt.Sprintf("(SELECT COUNT(*) FROM %s WHERE %s) = 1", elements, elemCond)}, nil
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
127
proto/api/v1/memo_view_service.proto
Normal file
127
proto/api/v1/memo_view_service.proto
Normal file
|
|
@ -0,0 +1,127 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package memos.api.v1;
|
||||||
|
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
import "google/api/client.proto";
|
||||||
|
import "google/api/field_behavior.proto";
|
||||||
|
import "google/api/resource.proto";
|
||||||
|
import "google/protobuf/empty.proto";
|
||||||
|
import "google/protobuf/field_mask.proto";
|
||||||
|
|
||||||
|
option go_package = "gen/api/v1";
|
||||||
|
|
||||||
|
service MemoViewService {
|
||||||
|
// ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
|
// CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
|
// ListMemos `filter` argument.
|
||||||
|
rpc ListMemoViews(ListMemoViewsRequest) returns (ListMemoViewsResponse) {
|
||||||
|
option (google.api.http) = {get: "/api/v1/{parent=users/*}/views"};
|
||||||
|
option (google.api.method_signature) = "parent";
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMemoView gets a memo view by name.
|
||||||
|
rpc GetMemoView(GetMemoViewRequest) returns (MemoView) {
|
||||||
|
option (google.api.http) = {get: "/api/v1/{name=users/*/views/*}"};
|
||||||
|
option (google.api.method_signature) = "name";
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateMemoView creates a new memo view for a user.
|
||||||
|
rpc CreateMemoView(CreateMemoViewRequest) returns (MemoView) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
post: "/api/v1/{parent=users/*}/views"
|
||||||
|
body: "memo_view"
|
||||||
|
};
|
||||||
|
option (google.api.method_signature) = "parent,memo_view";
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateMemoView updates a memo view for a user.
|
||||||
|
rpc UpdateMemoView(UpdateMemoViewRequest) returns (MemoView) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
patch: "/api/v1/{memo_view.name=users/*/views/*}"
|
||||||
|
body: "memo_view"
|
||||||
|
};
|
||||||
|
option (google.api.method_signature) = "memo_view,update_mask";
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteMemoView deletes a memo view for a user.
|
||||||
|
rpc DeleteMemoView(DeleteMemoViewRequest) returns (google.protobuf.Empty) {
|
||||||
|
option (google.api.http) = {delete: "/api/v1/{name=users/*/views/*}"};
|
||||||
|
option (google.api.method_signature) = "name";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message MemoView {
|
||||||
|
option (google.api.resource) = {
|
||||||
|
type: "memos.api.v1/MemoView"
|
||||||
|
pattern: "users/{user}/views/{view}"
|
||||||
|
singular: "view"
|
||||||
|
plural: "views"
|
||||||
|
};
|
||||||
|
|
||||||
|
// The resource name of the memo view.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
||||||
|
|
||||||
|
// The title of the memo view.
|
||||||
|
string title = 2 [(google.api.field_behavior) = REQUIRED];
|
||||||
|
|
||||||
|
// The CEL filter expression for the memo view, using the same grammar as the
|
||||||
|
// ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
||||||
|
string filter = 3 [(google.api.field_behavior) = REQUIRED];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListMemoViewsRequest {
|
||||||
|
// Required. The parent resource where memo views are listed.
|
||||||
|
// Format: users/{user}
|
||||||
|
string parent = 1 [
|
||||||
|
(google.api.field_behavior) = REQUIRED,
|
||||||
|
(google.api.resource_reference) = {child_type: "memos.api.v1/MemoView"}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListMemoViewsResponse {
|
||||||
|
// The list of memo views.
|
||||||
|
repeated MemoView memo_views = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetMemoViewRequest {
|
||||||
|
// Required. The resource name of the memo view to retrieve.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
string name = 1 [
|
||||||
|
(google.api.field_behavior) = REQUIRED,
|
||||||
|
(google.api.resource_reference) = {type: "memos.api.v1/MemoView"}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CreateMemoViewRequest {
|
||||||
|
// Required. The parent resource where this memo view will be created.
|
||||||
|
// Format: users/{user}
|
||||||
|
string parent = 1 [
|
||||||
|
(google.api.field_behavior) = REQUIRED,
|
||||||
|
(google.api.resource_reference) = {child_type: "memos.api.v1/MemoView"}
|
||||||
|
];
|
||||||
|
|
||||||
|
// Required. The memo view to create.
|
||||||
|
MemoView memo_view = 2 [(google.api.field_behavior) = REQUIRED];
|
||||||
|
|
||||||
|
// Optional. If set, validate the request, but do not actually create the memo view.
|
||||||
|
bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
|
||||||
|
}
|
||||||
|
|
||||||
|
message UpdateMemoViewRequest {
|
||||||
|
// Required. The memo view resource which replaces the resource on the server.
|
||||||
|
MemoView memo_view = 1 [(google.api.field_behavior) = REQUIRED];
|
||||||
|
|
||||||
|
// Optional. The list of fields to update.
|
||||||
|
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeleteMemoViewRequest {
|
||||||
|
// Required. The resource name of the memo view to delete.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
string name = 1 [
|
||||||
|
(google.api.field_behavior) = REQUIRED,
|
||||||
|
(google.api.resource_reference) = {type: "memos.api.v1/MemoView"}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package memos.api.v1;
|
|
||||||
|
|
||||||
import "google/api/annotations.proto";
|
|
||||||
import "google/api/client.proto";
|
|
||||||
import "google/api/field_behavior.proto";
|
|
||||||
import "google/api/resource.proto";
|
|
||||||
import "google/protobuf/empty.proto";
|
|
||||||
import "google/protobuf/field_mask.proto";
|
|
||||||
|
|
||||||
option go_package = "gen/api/v1";
|
|
||||||
|
|
||||||
service ShortcutService {
|
|
||||||
// ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
|
||||||
// reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
|
||||||
// to the ListMemos `filter` argument to reuse a saved view.
|
|
||||||
rpc ListShortcuts(ListShortcutsRequest) returns (ListShortcutsResponse) {
|
|
||||||
option (google.api.http) = {get: "/api/v1/{parent=users/*}/shortcuts"};
|
|
||||||
option (google.api.method_signature) = "parent";
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetShortcut gets a shortcut by name.
|
|
||||||
rpc GetShortcut(GetShortcutRequest) returns (Shortcut) {
|
|
||||||
option (google.api.http) = {get: "/api/v1/{name=users/*/shortcuts/*}"};
|
|
||||||
option (google.api.method_signature) = "name";
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateShortcut creates a new shortcut for a user.
|
|
||||||
rpc CreateShortcut(CreateShortcutRequest) returns (Shortcut) {
|
|
||||||
option (google.api.http) = {
|
|
||||||
post: "/api/v1/{parent=users/*}/shortcuts"
|
|
||||||
body: "shortcut"
|
|
||||||
};
|
|
||||||
option (google.api.method_signature) = "parent,shortcut";
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateShortcut updates a shortcut for a user.
|
|
||||||
rpc UpdateShortcut(UpdateShortcutRequest) returns (Shortcut) {
|
|
||||||
option (google.api.http) = {
|
|
||||||
patch: "/api/v1/{shortcut.name=users/*/shortcuts/*}"
|
|
||||||
body: "shortcut"
|
|
||||||
};
|
|
||||||
option (google.api.method_signature) = "shortcut,update_mask";
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeleteShortcut deletes a shortcut for a user.
|
|
||||||
rpc DeleteShortcut(DeleteShortcutRequest) returns (google.protobuf.Empty) {
|
|
||||||
option (google.api.http) = {delete: "/api/v1/{name=users/*/shortcuts/*}"};
|
|
||||||
option (google.api.method_signature) = "name";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message Shortcut {
|
|
||||||
option (google.api.resource) = {
|
|
||||||
type: "memos.api.v1/Shortcut"
|
|
||||||
pattern: "users/{user}/shortcuts/{shortcut}"
|
|
||||||
singular: "shortcut"
|
|
||||||
plural: "shortcuts"
|
|
||||||
};
|
|
||||||
|
|
||||||
// The resource name of the shortcut.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
|
||||||
|
|
||||||
// The title of the shortcut.
|
|
||||||
string title = 2 [(google.api.field_behavior) = REQUIRED];
|
|
||||||
|
|
||||||
// The CEL filter expression for the shortcut, using the same grammar as the
|
|
||||||
// ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
|
||||||
string filter = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
||||||
}
|
|
||||||
|
|
||||||
message ListShortcutsRequest {
|
|
||||||
// Required. The parent resource where shortcuts are listed.
|
|
||||||
// Format: users/{user}
|
|
||||||
string parent = 1 [
|
|
||||||
(google.api.field_behavior) = REQUIRED,
|
|
||||||
(google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
message ListShortcutsResponse {
|
|
||||||
// The list of shortcuts.
|
|
||||||
repeated Shortcut shortcuts = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetShortcutRequest {
|
|
||||||
// Required. The resource name of the shortcut to retrieve.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
string name = 1 [
|
|
||||||
(google.api.field_behavior) = REQUIRED,
|
|
||||||
(google.api.resource_reference) = {type: "memos.api.v1/Shortcut"}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
message CreateShortcutRequest {
|
|
||||||
// Required. The parent resource where this shortcut will be created.
|
|
||||||
// Format: users/{user}
|
|
||||||
string parent = 1 [
|
|
||||||
(google.api.field_behavior) = REQUIRED,
|
|
||||||
(google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"}
|
|
||||||
];
|
|
||||||
|
|
||||||
// Required. The shortcut to create.
|
|
||||||
Shortcut shortcut = 2 [(google.api.field_behavior) = REQUIRED];
|
|
||||||
|
|
||||||
// Optional. If set, validate the request, but do not actually create the shortcut.
|
|
||||||
bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
||||||
}
|
|
||||||
|
|
||||||
message UpdateShortcutRequest {
|
|
||||||
// Required. The shortcut resource which replaces the resource on the server.
|
|
||||||
Shortcut shortcut = 1 [(google.api.field_behavior) = REQUIRED];
|
|
||||||
|
|
||||||
// Optional. The list of fields to update.
|
|
||||||
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
||||||
}
|
|
||||||
|
|
||||||
message DeleteShortcutRequest {
|
|
||||||
// Required. The resource name of the shortcut to delete.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
string name = 1 [
|
|
||||||
(google.api.field_behavior) = REQUIRED,
|
|
||||||
(google.api.resource_reference) = {type: "memos.api.v1/Shortcut"}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
240
proto/gen/api/v1/apiv1connect/memo_view_service.connect.go
Normal file
240
proto/gen/api/v1/apiv1connect/memo_view_service.connect.go
Normal file
|
|
@ -0,0 +1,240 @@
|
||||||
|
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Source: api/v1/memo_view_service.proto
|
||||||
|
|
||||||
|
package apiv1connect
|
||||||
|
|
||||||
|
import (
|
||||||
|
connect "connectrpc.com/connect"
|
||||||
|
context "context"
|
||||||
|
errors "errors"
|
||||||
|
v1 "github.com/usememos/memos/proto/gen/api/v1"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
http "net/http"
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
||||||
|
// compatible. If you get a compiler error that this constant is not defined, this code was
|
||||||
|
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
||||||
|
// problem by either regenerating this code with an older version of connect or updating the connect
|
||||||
|
// version compiled into your binary.
|
||||||
|
const _ = connect.IsAtLeastVersion1_13_0
|
||||||
|
|
||||||
|
const (
|
||||||
|
// MemoViewServiceName is the fully-qualified name of the MemoViewService service.
|
||||||
|
MemoViewServiceName = "memos.api.v1.MemoViewService"
|
||||||
|
)
|
||||||
|
|
||||||
|
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
||||||
|
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
||||||
|
//
|
||||||
|
// Note that these are different from the fully-qualified method names used by
|
||||||
|
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
||||||
|
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||||
|
// period.
|
||||||
|
const (
|
||||||
|
// MemoViewServiceListMemoViewsProcedure is the fully-qualified name of the MemoViewService's
|
||||||
|
// ListMemoViews RPC.
|
||||||
|
MemoViewServiceListMemoViewsProcedure = "/memos.api.v1.MemoViewService/ListMemoViews"
|
||||||
|
// MemoViewServiceGetMemoViewProcedure is the fully-qualified name of the MemoViewService's
|
||||||
|
// GetMemoView RPC.
|
||||||
|
MemoViewServiceGetMemoViewProcedure = "/memos.api.v1.MemoViewService/GetMemoView"
|
||||||
|
// MemoViewServiceCreateMemoViewProcedure is the fully-qualified name of the MemoViewService's
|
||||||
|
// CreateMemoView RPC.
|
||||||
|
MemoViewServiceCreateMemoViewProcedure = "/memos.api.v1.MemoViewService/CreateMemoView"
|
||||||
|
// MemoViewServiceUpdateMemoViewProcedure is the fully-qualified name of the MemoViewService's
|
||||||
|
// UpdateMemoView RPC.
|
||||||
|
MemoViewServiceUpdateMemoViewProcedure = "/memos.api.v1.MemoViewService/UpdateMemoView"
|
||||||
|
// MemoViewServiceDeleteMemoViewProcedure is the fully-qualified name of the MemoViewService's
|
||||||
|
// DeleteMemoView RPC.
|
||||||
|
MemoViewServiceDeleteMemoViewProcedure = "/memos.api.v1.MemoViewService/DeleteMemoView"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MemoViewServiceClient is a client for the memos.api.v1.MemoViewService service.
|
||||||
|
type MemoViewServiceClient interface {
|
||||||
|
// ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
|
// CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
|
// ListMemos `filter` argument.
|
||||||
|
ListMemoViews(context.Context, *connect.Request[v1.ListMemoViewsRequest]) (*connect.Response[v1.ListMemoViewsResponse], error)
|
||||||
|
// GetMemoView gets a memo view by name.
|
||||||
|
GetMemoView(context.Context, *connect.Request[v1.GetMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// CreateMemoView creates a new memo view for a user.
|
||||||
|
CreateMemoView(context.Context, *connect.Request[v1.CreateMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// UpdateMemoView updates a memo view for a user.
|
||||||
|
UpdateMemoView(context.Context, *connect.Request[v1.UpdateMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// DeleteMemoView deletes a memo view for a user.
|
||||||
|
DeleteMemoView(context.Context, *connect.Request[v1.DeleteMemoViewRequest]) (*connect.Response[emptypb.Empty], error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMemoViewServiceClient constructs a client for the memos.api.v1.MemoViewService service. By
|
||||||
|
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
|
||||||
|
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
|
||||||
|
// connect.WithGRPC() or connect.WithGRPCWeb() options.
|
||||||
|
//
|
||||||
|
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
||||||
|
// http://api.acme.com or https://acme.com/grpc).
|
||||||
|
func NewMemoViewServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MemoViewServiceClient {
|
||||||
|
baseURL = strings.TrimRight(baseURL, "/")
|
||||||
|
memoViewServiceMethods := v1.File_api_v1_memo_view_service_proto.Services().ByName("MemoViewService").Methods()
|
||||||
|
return &memoViewServiceClient{
|
||||||
|
listMemoViews: connect.NewClient[v1.ListMemoViewsRequest, v1.ListMemoViewsResponse](
|
||||||
|
httpClient,
|
||||||
|
baseURL+MemoViewServiceListMemoViewsProcedure,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("ListMemoViews")),
|
||||||
|
connect.WithClientOptions(opts...),
|
||||||
|
),
|
||||||
|
getMemoView: connect.NewClient[v1.GetMemoViewRequest, v1.MemoView](
|
||||||
|
httpClient,
|
||||||
|
baseURL+MemoViewServiceGetMemoViewProcedure,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("GetMemoView")),
|
||||||
|
connect.WithClientOptions(opts...),
|
||||||
|
),
|
||||||
|
createMemoView: connect.NewClient[v1.CreateMemoViewRequest, v1.MemoView](
|
||||||
|
httpClient,
|
||||||
|
baseURL+MemoViewServiceCreateMemoViewProcedure,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("CreateMemoView")),
|
||||||
|
connect.WithClientOptions(opts...),
|
||||||
|
),
|
||||||
|
updateMemoView: connect.NewClient[v1.UpdateMemoViewRequest, v1.MemoView](
|
||||||
|
httpClient,
|
||||||
|
baseURL+MemoViewServiceUpdateMemoViewProcedure,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("UpdateMemoView")),
|
||||||
|
connect.WithClientOptions(opts...),
|
||||||
|
),
|
||||||
|
deleteMemoView: connect.NewClient[v1.DeleteMemoViewRequest, emptypb.Empty](
|
||||||
|
httpClient,
|
||||||
|
baseURL+MemoViewServiceDeleteMemoViewProcedure,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("DeleteMemoView")),
|
||||||
|
connect.WithClientOptions(opts...),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// memoViewServiceClient implements MemoViewServiceClient.
|
||||||
|
type memoViewServiceClient struct {
|
||||||
|
listMemoViews *connect.Client[v1.ListMemoViewsRequest, v1.ListMemoViewsResponse]
|
||||||
|
getMemoView *connect.Client[v1.GetMemoViewRequest, v1.MemoView]
|
||||||
|
createMemoView *connect.Client[v1.CreateMemoViewRequest, v1.MemoView]
|
||||||
|
updateMemoView *connect.Client[v1.UpdateMemoViewRequest, v1.MemoView]
|
||||||
|
deleteMemoView *connect.Client[v1.DeleteMemoViewRequest, emptypb.Empty]
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListMemoViews calls memos.api.v1.MemoViewService.ListMemoViews.
|
||||||
|
func (c *memoViewServiceClient) ListMemoViews(ctx context.Context, req *connect.Request[v1.ListMemoViewsRequest]) (*connect.Response[v1.ListMemoViewsResponse], error) {
|
||||||
|
return c.listMemoViews.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMemoView calls memos.api.v1.MemoViewService.GetMemoView.
|
||||||
|
func (c *memoViewServiceClient) GetMemoView(ctx context.Context, req *connect.Request[v1.GetMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return c.getMemoView.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateMemoView calls memos.api.v1.MemoViewService.CreateMemoView.
|
||||||
|
func (c *memoViewServiceClient) CreateMemoView(ctx context.Context, req *connect.Request[v1.CreateMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return c.createMemoView.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateMemoView calls memos.api.v1.MemoViewService.UpdateMemoView.
|
||||||
|
func (c *memoViewServiceClient) UpdateMemoView(ctx context.Context, req *connect.Request[v1.UpdateMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return c.updateMemoView.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteMemoView calls memos.api.v1.MemoViewService.DeleteMemoView.
|
||||||
|
func (c *memoViewServiceClient) DeleteMemoView(ctx context.Context, req *connect.Request[v1.DeleteMemoViewRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||||
|
return c.deleteMemoView.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MemoViewServiceHandler is an implementation of the memos.api.v1.MemoViewService service.
|
||||||
|
type MemoViewServiceHandler interface {
|
||||||
|
// ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
|
// CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
|
// ListMemos `filter` argument.
|
||||||
|
ListMemoViews(context.Context, *connect.Request[v1.ListMemoViewsRequest]) (*connect.Response[v1.ListMemoViewsResponse], error)
|
||||||
|
// GetMemoView gets a memo view by name.
|
||||||
|
GetMemoView(context.Context, *connect.Request[v1.GetMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// CreateMemoView creates a new memo view for a user.
|
||||||
|
CreateMemoView(context.Context, *connect.Request[v1.CreateMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// UpdateMemoView updates a memo view for a user.
|
||||||
|
UpdateMemoView(context.Context, *connect.Request[v1.UpdateMemoViewRequest]) (*connect.Response[v1.MemoView], error)
|
||||||
|
// DeleteMemoView deletes a memo view for a user.
|
||||||
|
DeleteMemoView(context.Context, *connect.Request[v1.DeleteMemoViewRequest]) (*connect.Response[emptypb.Empty], error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMemoViewServiceHandler builds an HTTP handler from the service implementation. It returns the
|
||||||
|
// path on which to mount the handler and the handler itself.
|
||||||
|
//
|
||||||
|
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
||||||
|
// and JSON codecs. They also support gzip compression.
|
||||||
|
func NewMemoViewServiceHandler(svc MemoViewServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||||
|
memoViewServiceMethods := v1.File_api_v1_memo_view_service_proto.Services().ByName("MemoViewService").Methods()
|
||||||
|
memoViewServiceListMemoViewsHandler := connect.NewUnaryHandler(
|
||||||
|
MemoViewServiceListMemoViewsProcedure,
|
||||||
|
svc.ListMemoViews,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("ListMemoViews")),
|
||||||
|
connect.WithHandlerOptions(opts...),
|
||||||
|
)
|
||||||
|
memoViewServiceGetMemoViewHandler := connect.NewUnaryHandler(
|
||||||
|
MemoViewServiceGetMemoViewProcedure,
|
||||||
|
svc.GetMemoView,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("GetMemoView")),
|
||||||
|
connect.WithHandlerOptions(opts...),
|
||||||
|
)
|
||||||
|
memoViewServiceCreateMemoViewHandler := connect.NewUnaryHandler(
|
||||||
|
MemoViewServiceCreateMemoViewProcedure,
|
||||||
|
svc.CreateMemoView,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("CreateMemoView")),
|
||||||
|
connect.WithHandlerOptions(opts...),
|
||||||
|
)
|
||||||
|
memoViewServiceUpdateMemoViewHandler := connect.NewUnaryHandler(
|
||||||
|
MemoViewServiceUpdateMemoViewProcedure,
|
||||||
|
svc.UpdateMemoView,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("UpdateMemoView")),
|
||||||
|
connect.WithHandlerOptions(opts...),
|
||||||
|
)
|
||||||
|
memoViewServiceDeleteMemoViewHandler := connect.NewUnaryHandler(
|
||||||
|
MemoViewServiceDeleteMemoViewProcedure,
|
||||||
|
svc.DeleteMemoView,
|
||||||
|
connect.WithSchema(memoViewServiceMethods.ByName("DeleteMemoView")),
|
||||||
|
connect.WithHandlerOptions(opts...),
|
||||||
|
)
|
||||||
|
return "/memos.api.v1.MemoViewService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
switch r.URL.Path {
|
||||||
|
case MemoViewServiceListMemoViewsProcedure:
|
||||||
|
memoViewServiceListMemoViewsHandler.ServeHTTP(w, r)
|
||||||
|
case MemoViewServiceGetMemoViewProcedure:
|
||||||
|
memoViewServiceGetMemoViewHandler.ServeHTTP(w, r)
|
||||||
|
case MemoViewServiceCreateMemoViewProcedure:
|
||||||
|
memoViewServiceCreateMemoViewHandler.ServeHTTP(w, r)
|
||||||
|
case MemoViewServiceUpdateMemoViewProcedure:
|
||||||
|
memoViewServiceUpdateMemoViewHandler.ServeHTTP(w, r)
|
||||||
|
case MemoViewServiceDeleteMemoViewProcedure:
|
||||||
|
memoViewServiceDeleteMemoViewHandler.ServeHTTP(w, r)
|
||||||
|
default:
|
||||||
|
http.NotFound(w, r)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMemoViewServiceHandler returns CodeUnimplemented from all methods.
|
||||||
|
type UnimplementedMemoViewServiceHandler struct{}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceHandler) ListMemoViews(context.Context, *connect.Request[v1.ListMemoViewsRequest]) (*connect.Response[v1.ListMemoViewsResponse], error) {
|
||||||
|
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoViewService.ListMemoViews is not implemented"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceHandler) GetMemoView(context.Context, *connect.Request[v1.GetMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoViewService.GetMemoView is not implemented"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceHandler) CreateMemoView(context.Context, *connect.Request[v1.CreateMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoViewService.CreateMemoView is not implemented"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceHandler) UpdateMemoView(context.Context, *connect.Request[v1.UpdateMemoViewRequest]) (*connect.Response[v1.MemoView], error) {
|
||||||
|
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoViewService.UpdateMemoView is not implemented"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceHandler) DeleteMemoView(context.Context, *connect.Request[v1.DeleteMemoViewRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||||
|
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoViewService.DeleteMemoView is not implemented"))
|
||||||
|
}
|
||||||
|
|
@ -1,240 +0,0 @@
|
||||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
|
||||||
//
|
|
||||||
// Source: api/v1/shortcut_service.proto
|
|
||||||
|
|
||||||
package apiv1connect
|
|
||||||
|
|
||||||
import (
|
|
||||||
connect "connectrpc.com/connect"
|
|
||||||
context "context"
|
|
||||||
errors "errors"
|
|
||||||
v1 "github.com/usememos/memos/proto/gen/api/v1"
|
|
||||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
http "net/http"
|
|
||||||
strings "strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
|
||||||
// compatible. If you get a compiler error that this constant is not defined, this code was
|
|
||||||
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
|
||||||
// problem by either regenerating this code with an older version of connect or updating the connect
|
|
||||||
// version compiled into your binary.
|
|
||||||
const _ = connect.IsAtLeastVersion1_13_0
|
|
||||||
|
|
||||||
const (
|
|
||||||
// ShortcutServiceName is the fully-qualified name of the ShortcutService service.
|
|
||||||
ShortcutServiceName = "memos.api.v1.ShortcutService"
|
|
||||||
)
|
|
||||||
|
|
||||||
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
|
||||||
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
|
||||||
//
|
|
||||||
// Note that these are different from the fully-qualified method names used by
|
|
||||||
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
|
||||||
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
|
||||||
// period.
|
|
||||||
const (
|
|
||||||
// ShortcutServiceListShortcutsProcedure is the fully-qualified name of the ShortcutService's
|
|
||||||
// ListShortcuts RPC.
|
|
||||||
ShortcutServiceListShortcutsProcedure = "/memos.api.v1.ShortcutService/ListShortcuts"
|
|
||||||
// ShortcutServiceGetShortcutProcedure is the fully-qualified name of the ShortcutService's
|
|
||||||
// GetShortcut RPC.
|
|
||||||
ShortcutServiceGetShortcutProcedure = "/memos.api.v1.ShortcutService/GetShortcut"
|
|
||||||
// ShortcutServiceCreateShortcutProcedure is the fully-qualified name of the ShortcutService's
|
|
||||||
// CreateShortcut RPC.
|
|
||||||
ShortcutServiceCreateShortcutProcedure = "/memos.api.v1.ShortcutService/CreateShortcut"
|
|
||||||
// ShortcutServiceUpdateShortcutProcedure is the fully-qualified name of the ShortcutService's
|
|
||||||
// UpdateShortcut RPC.
|
|
||||||
ShortcutServiceUpdateShortcutProcedure = "/memos.api.v1.ShortcutService/UpdateShortcut"
|
|
||||||
// ShortcutServiceDeleteShortcutProcedure is the fully-qualified name of the ShortcutService's
|
|
||||||
// DeleteShortcut RPC.
|
|
||||||
ShortcutServiceDeleteShortcutProcedure = "/memos.api.v1.ShortcutService/DeleteShortcut"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ShortcutServiceClient is a client for the memos.api.v1.ShortcutService service.
|
|
||||||
type ShortcutServiceClient interface {
|
|
||||||
// ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
|
||||||
// reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
|
||||||
// to the ListMemos `filter` argument to reuse a saved view.
|
|
||||||
ListShortcuts(context.Context, *connect.Request[v1.ListShortcutsRequest]) (*connect.Response[v1.ListShortcutsResponse], error)
|
|
||||||
// GetShortcut gets a shortcut by name.
|
|
||||||
GetShortcut(context.Context, *connect.Request[v1.GetShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// CreateShortcut creates a new shortcut for a user.
|
|
||||||
CreateShortcut(context.Context, *connect.Request[v1.CreateShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// UpdateShortcut updates a shortcut for a user.
|
|
||||||
UpdateShortcut(context.Context, *connect.Request[v1.UpdateShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// DeleteShortcut deletes a shortcut for a user.
|
|
||||||
DeleteShortcut(context.Context, *connect.Request[v1.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewShortcutServiceClient constructs a client for the memos.api.v1.ShortcutService service. By
|
|
||||||
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
|
|
||||||
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
|
|
||||||
// connect.WithGRPC() or connect.WithGRPCWeb() options.
|
|
||||||
//
|
|
||||||
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
|
||||||
// http://api.acme.com or https://acme.com/grpc).
|
|
||||||
func NewShortcutServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ShortcutServiceClient {
|
|
||||||
baseURL = strings.TrimRight(baseURL, "/")
|
|
||||||
shortcutServiceMethods := v1.File_api_v1_shortcut_service_proto.Services().ByName("ShortcutService").Methods()
|
|
||||||
return &shortcutServiceClient{
|
|
||||||
listShortcuts: connect.NewClient[v1.ListShortcutsRequest, v1.ListShortcutsResponse](
|
|
||||||
httpClient,
|
|
||||||
baseURL+ShortcutServiceListShortcutsProcedure,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("ListShortcuts")),
|
|
||||||
connect.WithClientOptions(opts...),
|
|
||||||
),
|
|
||||||
getShortcut: connect.NewClient[v1.GetShortcutRequest, v1.Shortcut](
|
|
||||||
httpClient,
|
|
||||||
baseURL+ShortcutServiceGetShortcutProcedure,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("GetShortcut")),
|
|
||||||
connect.WithClientOptions(opts...),
|
|
||||||
),
|
|
||||||
createShortcut: connect.NewClient[v1.CreateShortcutRequest, v1.Shortcut](
|
|
||||||
httpClient,
|
|
||||||
baseURL+ShortcutServiceCreateShortcutProcedure,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("CreateShortcut")),
|
|
||||||
connect.WithClientOptions(opts...),
|
|
||||||
),
|
|
||||||
updateShortcut: connect.NewClient[v1.UpdateShortcutRequest, v1.Shortcut](
|
|
||||||
httpClient,
|
|
||||||
baseURL+ShortcutServiceUpdateShortcutProcedure,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("UpdateShortcut")),
|
|
||||||
connect.WithClientOptions(opts...),
|
|
||||||
),
|
|
||||||
deleteShortcut: connect.NewClient[v1.DeleteShortcutRequest, emptypb.Empty](
|
|
||||||
httpClient,
|
|
||||||
baseURL+ShortcutServiceDeleteShortcutProcedure,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("DeleteShortcut")),
|
|
||||||
connect.WithClientOptions(opts...),
|
|
||||||
),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// shortcutServiceClient implements ShortcutServiceClient.
|
|
||||||
type shortcutServiceClient struct {
|
|
||||||
listShortcuts *connect.Client[v1.ListShortcutsRequest, v1.ListShortcutsResponse]
|
|
||||||
getShortcut *connect.Client[v1.GetShortcutRequest, v1.Shortcut]
|
|
||||||
createShortcut *connect.Client[v1.CreateShortcutRequest, v1.Shortcut]
|
|
||||||
updateShortcut *connect.Client[v1.UpdateShortcutRequest, v1.Shortcut]
|
|
||||||
deleteShortcut *connect.Client[v1.DeleteShortcutRequest, emptypb.Empty]
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListShortcuts calls memos.api.v1.ShortcutService.ListShortcuts.
|
|
||||||
func (c *shortcutServiceClient) ListShortcuts(ctx context.Context, req *connect.Request[v1.ListShortcutsRequest]) (*connect.Response[v1.ListShortcutsResponse], error) {
|
|
||||||
return c.listShortcuts.CallUnary(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetShortcut calls memos.api.v1.ShortcutService.GetShortcut.
|
|
||||||
func (c *shortcutServiceClient) GetShortcut(ctx context.Context, req *connect.Request[v1.GetShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return c.getShortcut.CallUnary(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateShortcut calls memos.api.v1.ShortcutService.CreateShortcut.
|
|
||||||
func (c *shortcutServiceClient) CreateShortcut(ctx context.Context, req *connect.Request[v1.CreateShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return c.createShortcut.CallUnary(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateShortcut calls memos.api.v1.ShortcutService.UpdateShortcut.
|
|
||||||
func (c *shortcutServiceClient) UpdateShortcut(ctx context.Context, req *connect.Request[v1.UpdateShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return c.updateShortcut.CallUnary(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeleteShortcut calls memos.api.v1.ShortcutService.DeleteShortcut.
|
|
||||||
func (c *shortcutServiceClient) DeleteShortcut(ctx context.Context, req *connect.Request[v1.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error) {
|
|
||||||
return c.deleteShortcut.CallUnary(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ShortcutServiceHandler is an implementation of the memos.api.v1.ShortcutService service.
|
|
||||||
type ShortcutServiceHandler interface {
|
|
||||||
// ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
|
||||||
// reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
|
||||||
// to the ListMemos `filter` argument to reuse a saved view.
|
|
||||||
ListShortcuts(context.Context, *connect.Request[v1.ListShortcutsRequest]) (*connect.Response[v1.ListShortcutsResponse], error)
|
|
||||||
// GetShortcut gets a shortcut by name.
|
|
||||||
GetShortcut(context.Context, *connect.Request[v1.GetShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// CreateShortcut creates a new shortcut for a user.
|
|
||||||
CreateShortcut(context.Context, *connect.Request[v1.CreateShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// UpdateShortcut updates a shortcut for a user.
|
|
||||||
UpdateShortcut(context.Context, *connect.Request[v1.UpdateShortcutRequest]) (*connect.Response[v1.Shortcut], error)
|
|
||||||
// DeleteShortcut deletes a shortcut for a user.
|
|
||||||
DeleteShortcut(context.Context, *connect.Request[v1.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewShortcutServiceHandler builds an HTTP handler from the service implementation. It returns the
|
|
||||||
// path on which to mount the handler and the handler itself.
|
|
||||||
//
|
|
||||||
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
|
||||||
// and JSON codecs. They also support gzip compression.
|
|
||||||
func NewShortcutServiceHandler(svc ShortcutServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
|
||||||
shortcutServiceMethods := v1.File_api_v1_shortcut_service_proto.Services().ByName("ShortcutService").Methods()
|
|
||||||
shortcutServiceListShortcutsHandler := connect.NewUnaryHandler(
|
|
||||||
ShortcutServiceListShortcutsProcedure,
|
|
||||||
svc.ListShortcuts,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("ListShortcuts")),
|
|
||||||
connect.WithHandlerOptions(opts...),
|
|
||||||
)
|
|
||||||
shortcutServiceGetShortcutHandler := connect.NewUnaryHandler(
|
|
||||||
ShortcutServiceGetShortcutProcedure,
|
|
||||||
svc.GetShortcut,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("GetShortcut")),
|
|
||||||
connect.WithHandlerOptions(opts...),
|
|
||||||
)
|
|
||||||
shortcutServiceCreateShortcutHandler := connect.NewUnaryHandler(
|
|
||||||
ShortcutServiceCreateShortcutProcedure,
|
|
||||||
svc.CreateShortcut,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("CreateShortcut")),
|
|
||||||
connect.WithHandlerOptions(opts...),
|
|
||||||
)
|
|
||||||
shortcutServiceUpdateShortcutHandler := connect.NewUnaryHandler(
|
|
||||||
ShortcutServiceUpdateShortcutProcedure,
|
|
||||||
svc.UpdateShortcut,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("UpdateShortcut")),
|
|
||||||
connect.WithHandlerOptions(opts...),
|
|
||||||
)
|
|
||||||
shortcutServiceDeleteShortcutHandler := connect.NewUnaryHandler(
|
|
||||||
ShortcutServiceDeleteShortcutProcedure,
|
|
||||||
svc.DeleteShortcut,
|
|
||||||
connect.WithSchema(shortcutServiceMethods.ByName("DeleteShortcut")),
|
|
||||||
connect.WithHandlerOptions(opts...),
|
|
||||||
)
|
|
||||||
return "/memos.api.v1.ShortcutService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
switch r.URL.Path {
|
|
||||||
case ShortcutServiceListShortcutsProcedure:
|
|
||||||
shortcutServiceListShortcutsHandler.ServeHTTP(w, r)
|
|
||||||
case ShortcutServiceGetShortcutProcedure:
|
|
||||||
shortcutServiceGetShortcutHandler.ServeHTTP(w, r)
|
|
||||||
case ShortcutServiceCreateShortcutProcedure:
|
|
||||||
shortcutServiceCreateShortcutHandler.ServeHTTP(w, r)
|
|
||||||
case ShortcutServiceUpdateShortcutProcedure:
|
|
||||||
shortcutServiceUpdateShortcutHandler.ServeHTTP(w, r)
|
|
||||||
case ShortcutServiceDeleteShortcutProcedure:
|
|
||||||
shortcutServiceDeleteShortcutHandler.ServeHTTP(w, r)
|
|
||||||
default:
|
|
||||||
http.NotFound(w, r)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedShortcutServiceHandler returns CodeUnimplemented from all methods.
|
|
||||||
type UnimplementedShortcutServiceHandler struct{}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceHandler) ListShortcuts(context.Context, *connect.Request[v1.ListShortcutsRequest]) (*connect.Response[v1.ListShortcutsResponse], error) {
|
|
||||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.ShortcutService.ListShortcuts is not implemented"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceHandler) GetShortcut(context.Context, *connect.Request[v1.GetShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.ShortcutService.GetShortcut is not implemented"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceHandler) CreateShortcut(context.Context, *connect.Request[v1.CreateShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.ShortcutService.CreateShortcut is not implemented"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceHandler) UpdateShortcut(context.Context, *connect.Request[v1.UpdateShortcutRequest]) (*connect.Response[v1.Shortcut], error) {
|
|
||||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.ShortcutService.UpdateShortcut is not implemented"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceHandler) DeleteShortcut(context.Context, *connect.Request[v1.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error) {
|
|
||||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.ShortcutService.DeleteShortcut is not implemented"))
|
|
||||||
}
|
|
||||||
|
|
@ -45,15 +45,15 @@ func request_AttachmentService_CreateAttachment_0(ctx context.Context, marshaler
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Attachment); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Attachment); 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 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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_CreateAttachment_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_CreateAttachment_0); err != nil {
|
||||||
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.CreateAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -83,15 +83,15 @@ func request_AttachmentService_ListAttachments_0(ctx context.Context, marshaler
|
||||||
protoReq ListAttachmentsRequest
|
protoReq ListAttachmentsRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_ListAttachments_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_ListAttachments_0); err != nil {
|
||||||
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.ListAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -117,9 +117,6 @@ func request_AttachmentService_GetAttachment_0(ctx context.Context, marshaler ru
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -128,6 +125,9 @@ func request_AttachmentService_GetAttachment_0(ctx context.Context, marshaler ru
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -165,9 +165,6 @@ func request_AttachmentService_UpdateAttachment_0(ctx context.Context, marshaler
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Attachment); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Attachment); 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.Attachment); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Attachment); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
|
@ -189,6 +186,9 @@ func request_AttachmentService_UpdateAttachment_0(ctx context.Context, marshaler
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_UpdateAttachment_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_UpdateAttachment_0); err != nil {
|
||||||
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.UpdateAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -237,9 +237,6 @@ func request_AttachmentService_DeleteAttachment_0(ctx context.Context, marshaler
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -248,6 +245,9 @@ func request_AttachmentService_DeleteAttachment_0(ctx context.Context, marshaler
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,6 @@ func request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context,
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -73,6 +70,9 @@ func request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -105,15 +105,15 @@ func request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Contex
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.IdentityProvider); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.IdentityProvider); 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 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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_CreateIdentityProvider_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_CreateIdentityProvider_0); err != nil {
|
||||||
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.CreateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -151,9 +151,6 @@ func request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Contex
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); 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.IdentityProvider); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
|
@ -175,6 +172,9 @@ func request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Contex
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil {
|
||||||
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.UpdateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -223,9 +223,6 @@ func request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Contex
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -234,6 +231,9 @@ func request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Contex
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,6 @@ func request_InstanceService_GetInstanceSetting_0(ctx context.Context, marshaler
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -73,6 +70,9 @@ func request_InstanceService_GetInstanceSetting_0(ctx context.Context, marshaler
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetInstanceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetInstanceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -137,9 +137,6 @@ func request_InstanceService_UpdateInstanceSetting_0(ctx context.Context, marsha
|
||||||
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)
|
||||||
|
|
@ -161,6 +158,9 @@ func request_InstanceService_UpdateInstanceSetting_0(ctx context.Context, marsha
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InstanceService_UpdateInstanceSetting_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InstanceService_UpdateInstanceSetting_0); err != nil {
|
||||||
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.UpdateInstanceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateInstanceSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,15 +45,15 @@ func request_MemoService_CreateMemo_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Memo); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Memo); 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 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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_CreateMemo_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_CreateMemo_0); err != nil {
|
||||||
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.CreateMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -83,15 +83,15 @@ func request_MemoService_ListMemos_0(ctx context.Context, marshaler runtime.Mars
|
||||||
protoReq ListMemosRequest
|
protoReq ListMemosRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemos_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemos_0); err != nil {
|
||||||
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.ListMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -117,9 +117,6 @@ func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marsha
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -128,6 +125,9 @@ func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marsha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -165,9 +165,6 @@ func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Memo); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Memo); 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.Memo); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Memo); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
|
@ -189,6 +186,9 @@ func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_UpdateMemo_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_UpdateMemo_0); err != nil {
|
||||||
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.UpdateMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -239,9 +239,6 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -256,6 +253,9 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_DeleteMemo_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_DeleteMemo_0); err != nil {
|
||||||
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.DeleteMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -293,9 +293,6 @@ func request_MemoService_SetMemoAttachments_0(ctx context.Context, marshaler run
|
||||||
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["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -304,6 +301,9 @@ func request_MemoService_SetMemoAttachments_0(ctx context.Context, marshaler run
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.SetMemoAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.SetMemoAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -337,9 +337,6 @@ func request_MemoService_ListMemoAttachments_0(ctx context.Context, marshaler ru
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -354,6 +351,9 @@ func request_MemoService_ListMemoAttachments_0(ctx context.Context, marshaler ru
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoAttachments_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoAttachments_0); err != nil {
|
||||||
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.ListMemoAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemoAttachments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -391,9 +391,6 @@ func request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler runti
|
||||||
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["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -402,6 +399,9 @@ func request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler runti
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.SetMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.SetMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -435,9 +435,6 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -452,6 +449,9 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoRelations_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoRelations_0); err != nil {
|
||||||
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.ListMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -491,9 +491,6 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Comment); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Comment); 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["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -508,6 +505,9 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_CreateMemoComment_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_CreateMemoComment_0); err != nil {
|
||||||
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.CreateMemoComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateMemoComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -547,9 +547,6 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -564,6 +561,9 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoComments_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoComments_0); err != nil {
|
||||||
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.ListMemoComments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemoComments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -600,9 +600,6 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -617,6 +614,9 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoReactions_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_ListMemoReactions_0); err != nil {
|
||||||
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.ListMemoReactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemoReactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -654,9 +654,6 @@ func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler run
|
||||||
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["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -665,6 +662,9 @@ func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler run
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.UpsertMemoReaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpsertMemoReaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -696,9 +696,6 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -707,6 +704,9 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteMemoReaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteMemoReaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -738,9 +738,6 @@ func request_MemoService_CreateMemoShare_0(ctx context.Context, marshaler runtim
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.MemoShare); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.MemoShare); 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["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -749,6 +746,9 @@ func request_MemoService_CreateMemoShare_0(ctx context.Context, marshaler runtim
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.CreateMemoShare(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateMemoShare(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -780,9 +780,6 @@ func request_MemoService_ListMemoShares_0(ctx context.Context, marshaler runtime
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -791,6 +788,9 @@ func request_MemoService_ListMemoShares_0(ctx context.Context, marshaler runtime
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.ListMemoShares(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListMemoShares(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -819,9 +819,6 @@ func request_MemoService_DeleteMemoShare_0(ctx context.Context, marshaler runtim
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -830,6 +827,9 @@ func request_MemoService_DeleteMemoShare_0(ctx context.Context, marshaler runtim
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteMemoShare(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteMemoShare(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -858,9 +858,6 @@ func request_MemoService_GetSharedMemo_0(ctx context.Context, marshaler runtime.
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["share_token"]
|
val, ok := pathParams["share_token"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "share_token")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "share_token")
|
||||||
|
|
@ -869,6 +866,9 @@ func request_MemoService_GetSharedMemo_0(ctx context.Context, marshaler runtime.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "share_token", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "share_token", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetSharedMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetSharedMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -898,15 +898,15 @@ func request_MemoService_GetLinkMetadata_0(ctx context.Context, marshaler runtim
|
||||||
protoReq GetLinkMetadataRequest
|
protoReq GetLinkMetadataRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_GetLinkMetadata_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_GetLinkMetadata_0); err != nil {
|
||||||
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.GetLinkMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetLinkMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
498
proto/gen/api/v1/memo_view_service.pb.go
Normal file
498
proto/gen/api/v1/memo_view_service.pb.go
Normal file
|
|
@ -0,0 +1,498 @@
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.11
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: api/v1/memo_view_service.proto
|
||||||
|
|
||||||
|
package apiv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
unsafe "unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
type MemoView struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// The resource name of the memo view.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
// The title of the memo view.
|
||||||
|
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||||
|
// The CEL filter expression for the memo view, using the same grammar as the
|
||||||
|
// ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
||||||
|
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoView) Reset() {
|
||||||
|
*x = MemoView{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoView) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MemoView) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MemoView) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[0]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use MemoView.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MemoView) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoView) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoView) GetTitle() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Title
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoView) GetFilter() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Filter
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListMemoViewsRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// Required. The parent resource where memo views are listed.
|
||||||
|
// Format: users/{user}
|
||||||
|
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsRequest) Reset() {
|
||||||
|
*x = ListMemoViewsRequest{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListMemoViewsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[1]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListMemoViewsRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListMemoViewsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsRequest) GetParent() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Parent
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListMemoViewsResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// The list of memo views.
|
||||||
|
MemoViews []*MemoView `protobuf:"bytes,1,rep,name=memo_views,json=memoViews,proto3" json:"memo_views,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsResponse) Reset() {
|
||||||
|
*x = ListMemoViewsResponse{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListMemoViewsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[2]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListMemoViewsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListMemoViewsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListMemoViewsResponse) GetMemoViews() []*MemoView {
|
||||||
|
if x != nil {
|
||||||
|
return x.MemoViews
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMemoViewRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// Required. The resource name of the memo view to retrieve.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetMemoViewRequest) Reset() {
|
||||||
|
*x = GetMemoViewRequest{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetMemoViewRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetMemoViewRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetMemoViewRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[3]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetMemoViewRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetMemoViewRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetMemoViewRequest) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateMemoViewRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// Required. The parent resource where this memo view will be created.
|
||||||
|
// Format: users/{user}
|
||||||
|
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
|
||||||
|
// Required. The memo view to create.
|
||||||
|
MemoView *MemoView `protobuf:"bytes,2,opt,name=memo_view,json=memoView,proto3" json:"memo_view,omitempty"`
|
||||||
|
// Optional. If set, validate the request, but do not actually create the memo view.
|
||||||
|
ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) Reset() {
|
||||||
|
*x = CreateMemoViewRequest{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CreateMemoViewRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[4]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use CreateMemoViewRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CreateMemoViewRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) GetParent() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Parent
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) GetMemoView() *MemoView {
|
||||||
|
if x != nil {
|
||||||
|
return x.MemoView
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateMemoViewRequest) GetValidateOnly() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.ValidateOnly
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateMemoViewRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// Required. The memo view resource which replaces the resource on the server.
|
||||||
|
MemoView *MemoView `protobuf:"bytes,1,opt,name=memo_view,json=memoView,proto3" json:"memo_view,omitempty"`
|
||||||
|
// Optional. The list of fields to update.
|
||||||
|
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateMemoViewRequest) Reset() {
|
||||||
|
*x = UpdateMemoViewRequest{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateMemoViewRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateMemoViewRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateMemoViewRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[5]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateMemoViewRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateMemoViewRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateMemoViewRequest) GetMemoView() *MemoView {
|
||||||
|
if x != nil {
|
||||||
|
return x.MemoView
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateMemoViewRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
|
||||||
|
if x != nil {
|
||||||
|
return x.UpdateMask
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteMemoViewRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
// Required. The resource name of the memo view to delete.
|
||||||
|
// Format: users/{user}/views/{view}
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteMemoViewRequest) Reset() {
|
||||||
|
*x = DeleteMemoViewRequest{}
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[6]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteMemoViewRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeleteMemoViewRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeleteMemoViewRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_memo_view_service_proto_msgTypes[6]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DeleteMemoViewRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeleteMemoViewRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescGZIP(), []int{6}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteMemoViewRequest) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_api_v1_memo_view_service_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_api_v1_memo_view_service_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x1eapi/v1/memo_view_service.proto\x12\fmemos.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9f\x01\n" +
|
||||||
|
"\bMemoView\x12\x17\n" +
|
||||||
|
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x19\n" +
|
||||||
|
"\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" +
|
||||||
|
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x02R\x06filter:B\xeaA?\n" +
|
||||||
|
"\x15memos.api.v1/MemoView\x12\x19users/{user}/views/{view}*\x05views2\x04view\"M\n" +
|
||||||
|
"\x14ListMemoViewsRequest\x125\n" +
|
||||||
|
"\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/MemoViewR\x06parent\"N\n" +
|
||||||
|
"\x15ListMemoViewsResponse\x125\n" +
|
||||||
|
"\n" +
|
||||||
|
"memo_views\x18\x01 \x03(\v2\x16.memos.api.v1.MemoViewR\tmemoViews\"G\n" +
|
||||||
|
"\x12GetMemoViewRequest\x121\n" +
|
||||||
|
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
|
||||||
|
"\x15memos.api.v1/MemoViewR\x04name\"\xb2\x01\n" +
|
||||||
|
"\x15CreateMemoViewRequest\x125\n" +
|
||||||
|
"\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/MemoViewR\x06parent\x128\n" +
|
||||||
|
"\tmemo_view\x18\x02 \x01(\v2\x16.memos.api.v1.MemoViewB\x03\xe0A\x02R\bmemoView\x12(\n" +
|
||||||
|
"\rvalidate_only\x18\x03 \x01(\bB\x03\xe0A\x01R\fvalidateOnly\"\x93\x01\n" +
|
||||||
|
"\x15UpdateMemoViewRequest\x128\n" +
|
||||||
|
"\tmemo_view\x18\x01 \x01(\v2\x16.memos.api.v1.MemoViewB\x03\xe0A\x02R\bmemoView\x12@\n" +
|
||||||
|
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x01R\n" +
|
||||||
|
"updateMask\"J\n" +
|
||||||
|
"\x15DeleteMemoViewRequest\x121\n" +
|
||||||
|
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
|
||||||
|
"\x15memos.api.v1/MemoViewR\x04name2\xce\x05\n" +
|
||||||
|
"\x0fMemoViewService\x12\x89\x01\n" +
|
||||||
|
"\rListMemoViews\x12\".memos.api.v1.ListMemoViewsRequest\x1a#.memos.api.v1.ListMemoViewsResponse\"/\xdaA\x06parent\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/{parent=users/*}/views\x12v\n" +
|
||||||
|
"\vGetMemoView\x12 .memos.api.v1.GetMemoViewRequest\x1a\x16.memos.api.v1.MemoView\"-\xdaA\x04name\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/{name=users/*/views/*}\x12\x93\x01\n" +
|
||||||
|
"\x0eCreateMemoView\x12#.memos.api.v1.CreateMemoViewRequest\x1a\x16.memos.api.v1.MemoView\"D\xdaA\x10parent,memo_view\x82\xd3\xe4\x93\x02+:\tmemo_view\"\x1e/api/v1/{parent=users/*}/views\x12\xa2\x01\n" +
|
||||||
|
"\x0eUpdateMemoView\x12#.memos.api.v1.UpdateMemoViewRequest\x1a\x16.memos.api.v1.MemoView\"S\xdaA\x15memo_view,update_mask\x82\xd3\xe4\x93\x025:\tmemo_view2(/api/v1/{memo_view.name=users/*/views/*}\x12|\n" +
|
||||||
|
"\x0eDeleteMemoView\x12#.memos.api.v1.DeleteMemoViewRequest\x1a\x16.google.protobuf.Empty\"-\xdaA\x04name\x82\xd3\xe4\x93\x02 *\x1e/api/v1/{name=users/*/views/*}B\xac\x01\n" +
|
||||||
|
"\x10com.memos.api.v1B\x14MemoViewServiceProtoP\x01Z0github.com/usememos/memos/proto/gen/api/v1;apiv1\xa2\x02\x03MAX\xaa\x02\fMemos.Api.V1\xca\x02\fMemos\\Api\\V1\xe2\x02\x18Memos\\Api\\V1\\GPBMetadata\xea\x02\x0eMemos::Api::V1b\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_api_v1_memo_view_service_proto_rawDescOnce sync.Once
|
||||||
|
file_api_v1_memo_view_service_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_api_v1_memo_view_service_proto_rawDescGZIP() []byte {
|
||||||
|
file_api_v1_memo_view_service_proto_rawDescOnce.Do(func() {
|
||||||
|
file_api_v1_memo_view_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_memo_view_service_proto_rawDesc), len(file_api_v1_memo_view_service_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_api_v1_memo_view_service_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_api_v1_memo_view_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||||
|
var file_api_v1_memo_view_service_proto_goTypes = []any{
|
||||||
|
(*MemoView)(nil), // 0: memos.api.v1.MemoView
|
||||||
|
(*ListMemoViewsRequest)(nil), // 1: memos.api.v1.ListMemoViewsRequest
|
||||||
|
(*ListMemoViewsResponse)(nil), // 2: memos.api.v1.ListMemoViewsResponse
|
||||||
|
(*GetMemoViewRequest)(nil), // 3: memos.api.v1.GetMemoViewRequest
|
||||||
|
(*CreateMemoViewRequest)(nil), // 4: memos.api.v1.CreateMemoViewRequest
|
||||||
|
(*UpdateMemoViewRequest)(nil), // 5: memos.api.v1.UpdateMemoViewRequest
|
||||||
|
(*DeleteMemoViewRequest)(nil), // 6: memos.api.v1.DeleteMemoViewRequest
|
||||||
|
(*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
|
||||||
|
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
|
||||||
|
}
|
||||||
|
var file_api_v1_memo_view_service_proto_depIdxs = []int32{
|
||||||
|
0, // 0: memos.api.v1.ListMemoViewsResponse.memo_views:type_name -> memos.api.v1.MemoView
|
||||||
|
0, // 1: memos.api.v1.CreateMemoViewRequest.memo_view:type_name -> memos.api.v1.MemoView
|
||||||
|
0, // 2: memos.api.v1.UpdateMemoViewRequest.memo_view:type_name -> memos.api.v1.MemoView
|
||||||
|
7, // 3: memos.api.v1.UpdateMemoViewRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||||
|
1, // 4: memos.api.v1.MemoViewService.ListMemoViews:input_type -> memos.api.v1.ListMemoViewsRequest
|
||||||
|
3, // 5: memos.api.v1.MemoViewService.GetMemoView:input_type -> memos.api.v1.GetMemoViewRequest
|
||||||
|
4, // 6: memos.api.v1.MemoViewService.CreateMemoView:input_type -> memos.api.v1.CreateMemoViewRequest
|
||||||
|
5, // 7: memos.api.v1.MemoViewService.UpdateMemoView:input_type -> memos.api.v1.UpdateMemoViewRequest
|
||||||
|
6, // 8: memos.api.v1.MemoViewService.DeleteMemoView:input_type -> memos.api.v1.DeleteMemoViewRequest
|
||||||
|
2, // 9: memos.api.v1.MemoViewService.ListMemoViews:output_type -> memos.api.v1.ListMemoViewsResponse
|
||||||
|
0, // 10: memos.api.v1.MemoViewService.GetMemoView:output_type -> memos.api.v1.MemoView
|
||||||
|
0, // 11: memos.api.v1.MemoViewService.CreateMemoView:output_type -> memos.api.v1.MemoView
|
||||||
|
0, // 12: memos.api.v1.MemoViewService.UpdateMemoView:output_type -> memos.api.v1.MemoView
|
||||||
|
8, // 13: memos.api.v1.MemoViewService.DeleteMemoView:output_type -> google.protobuf.Empty
|
||||||
|
9, // [9:14] is the sub-list for method output_type
|
||||||
|
4, // [4:9] is the sub-list for method input_type
|
||||||
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
|
0, // [0:4] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_api_v1_memo_view_service_proto_init() }
|
||||||
|
func file_api_v1_memo_view_service_proto_init() {
|
||||||
|
if File_api_v1_memo_view_service_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_memo_view_service_proto_rawDesc), len(file_api_v1_memo_view_service_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 7,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_api_v1_memo_view_service_proto_goTypes,
|
||||||
|
DependencyIndexes: file_api_v1_memo_view_service_proto_depIdxs,
|
||||||
|
MessageInfos: file_api_v1_memo_view_service_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_api_v1_memo_view_service_proto = out.File
|
||||||
|
file_api_v1_memo_view_service_proto_goTypes = nil
|
||||||
|
file_api_v1_memo_view_service_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
// source: api/v1/shortcut_service.proto
|
// source: api/v1/memo_view_service.proto
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package apiv1 is a reverse proxy.
|
Package apiv1 is a reverse proxy.
|
||||||
|
|
@ -35,30 +35,9 @@ var (
|
||||||
_ = metadata.Join
|
_ = metadata.Join
|
||||||
)
|
)
|
||||||
|
|
||||||
func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_MemoViewService_ListMemoViews_0(ctx context.Context, marshaler runtime.Marshaler, client MemoViewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq ListShortcutsRequest
|
protoReq ListMemoViewsRequest
|
||||||
metadata runtime.ServerMetadata
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
|
||||||
if !ok {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
|
||||||
}
|
|
||||||
protoReq.Parent, err = runtime.String(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
|
||||||
}
|
|
||||||
msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func local_request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var (
|
|
||||||
protoReq ListShortcutsRequest
|
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
@ -70,34 +49,34 @@ func local_request_ShortcutService_ListShortcuts_0(ctx context.Context, marshale
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
msg, err := server.ListShortcuts(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var (
|
|
||||||
protoReq GetShortcutRequest
|
|
||||||
metadata runtime.ServerMetadata
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
if req.Body != nil {
|
if req.Body != nil {
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
}
|
}
|
||||||
val, ok := pathParams["name"]
|
msg, err := client.ListMemoViews(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
if !ok {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
|
||||||
}
|
|
||||||
protoReq.Name, err = runtime.String(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
|
||||||
}
|
|
||||||
msg, err := client.GetShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_MemoViewService_ListMemoViews_0(ctx context.Context, marshaler runtime.Marshaler, server MemoViewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq GetShortcutRequest
|
protoReq ListMemoViewsRequest
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
val, ok := pathParams["parent"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
}
|
||||||
|
protoReq.Parent, err = runtime.String(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
|
}
|
||||||
|
msg, err := server.ListMemoViews(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func request_MemoViewService_GetMemoView_0(ctx context.Context, marshaler runtime.Marshaler, client MemoViewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq GetMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
@ -109,49 +88,40 @@ func local_request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
msg, err := server.GetShortcut(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var filter_ShortcutService_CreateShortcut_0 = &utilities.DoubleArray{Encoding: map[string]int{"shortcut": 0, "parent": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
|
||||||
|
|
||||||
func request_ShortcutService_CreateShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var (
|
|
||||||
protoReq CreateShortcutRequest
|
|
||||||
metadata runtime.ServerMetadata
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
if req.Body != nil {
|
if req.Body != nil {
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
}
|
}
|
||||||
val, ok := pathParams["parent"]
|
msg, err := client.GetMemoView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
if !ok {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
|
||||||
}
|
|
||||||
protoReq.Parent, err = runtime.String(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
|
||||||
}
|
|
||||||
if err := req.ParseForm(); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_CreateShortcut_0); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
msg, err := client.CreateShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_ShortcutService_CreateShortcut_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_MemoViewService_GetMemoView_0(ctx context.Context, marshaler runtime.Marshaler, server MemoViewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq CreateShortcutRequest
|
protoReq GetMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) {
|
val, ok := pathParams["name"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
}
|
||||||
|
protoReq.Name, err = runtime.String(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
|
}
|
||||||
|
msg, err := server.GetMemoView(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var filter_MemoViewService_CreateMemoView_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo_view": 0, "parent": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
||||||
|
|
||||||
|
func request_MemoViewService_CreateMemoView_0(ctx context.Context, marshaler runtime.Marshaler, client MemoViewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq CreateMemoViewRequest
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.MemoView); 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)
|
||||||
}
|
}
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
|
|
@ -165,18 +135,48 @@ func local_request_ShortcutService_CreateShortcut_0(ctx context.Context, marshal
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_CreateShortcut_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoViewService_CreateMemoView_0); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
msg, err := server.CreateShortcut(ctx, &protoReq)
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
|
msg, err := client.CreateMemoView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var filter_ShortcutService_UpdateShortcut_0 = &utilities.DoubleArray{Encoding: map[string]int{"shortcut": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
|
func local_request_MemoViewService_CreateMemoView_0(ctx context.Context, marshaler runtime.Marshaler, server MemoViewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
|
||||||
func request_ShortcutService_UpdateShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var (
|
var (
|
||||||
protoReq UpdateShortcutRequest
|
protoReq CreateMemoViewRequest
|
||||||
|
metadata runtime.ServerMetadata
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.MemoView); 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")
|
||||||
|
}
|
||||||
|
protoReq.Parent, err = runtime.String(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
|
}
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoViewService_CreateMemoView_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
msg, err := server.CreateMemoView(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var filter_MemoViewService_UpdateMemoView_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo_view": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
|
||||||
|
|
||||||
|
func request_MemoViewService_UpdateMemoView_0(ctx context.Context, marshaler runtime.Marshaler, client MemoViewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var (
|
||||||
|
protoReq UpdateMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
@ -184,40 +184,40 @@ func request_ShortcutService_UpdateShortcut_0(ctx context.Context, marshaler run
|
||||||
if berr != nil {
|
if berr != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||||
}
|
}
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.MemoView); 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.Shortcut); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.MemoView); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
} else {
|
} else {
|
||||||
protoReq.UpdateMask = fieldMask
|
protoReq.UpdateMask = fieldMask
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val, ok := pathParams["shortcut.name"]
|
val, ok := pathParams["memo_view.name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shortcut.name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo_view.name")
|
||||||
}
|
}
|
||||||
err = runtime.PopulateFieldFromPath(&protoReq, "shortcut.name", val)
|
err = runtime.PopulateFieldFromPath(&protoReq, "memo_view.name", val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shortcut.name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo_view.name", err)
|
||||||
}
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_UpdateShortcut_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoViewService_UpdateMemoView_0); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
msg, err := client.UpdateShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
|
msg, err := client.UpdateMemoView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_ShortcutService_UpdateShortcut_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_MemoViewService_UpdateMemoView_0(ctx context.Context, marshaler runtime.Marshaler, server MemoViewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq UpdateShortcutRequest
|
protoReq UpdateMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
@ -225,58 +225,58 @@ func local_request_ShortcutService_UpdateShortcut_0(ctx context.Context, marshal
|
||||||
if berr != nil {
|
if berr != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||||
}
|
}
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Shortcut); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.MemoView); 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 protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Shortcut); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.MemoView); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
} else {
|
} else {
|
||||||
protoReq.UpdateMask = fieldMask
|
protoReq.UpdateMask = fieldMask
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val, ok := pathParams["shortcut.name"]
|
val, ok := pathParams["memo_view.name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shortcut.name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo_view.name")
|
||||||
}
|
}
|
||||||
err = runtime.PopulateFieldFromPath(&protoReq, "shortcut.name", val)
|
err = runtime.PopulateFieldFromPath(&protoReq, "memo_view.name", val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shortcut.name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo_view.name", err)
|
||||||
}
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_UpdateShortcut_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoViewService_UpdateMemoView_0); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
msg, err := server.UpdateShortcut(ctx, &protoReq)
|
msg, err := server.UpdateMemoView(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_MemoViewService_DeleteMemoView_0(ctx context.Context, marshaler runtime.Marshaler, client MemoViewServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq DeleteShortcutRequest
|
protoReq DeleteMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
val, ok := pathParams["name"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
}
|
||||||
|
protoReq.Name, err = runtime.String(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
|
}
|
||||||
if req.Body != nil {
|
if req.Body != nil {
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
}
|
}
|
||||||
val, ok := pathParams["name"]
|
msg, err := client.DeleteMemoView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
if !ok {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
|
||||||
}
|
|
||||||
protoReq.Name, err = runtime.String(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
|
||||||
}
|
|
||||||
msg, err := client.DeleteShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_MemoViewService_DeleteMemoView_0(ctx context.Context, marshaler runtime.Marshaler, server MemoViewServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq DeleteShortcutRequest
|
protoReq DeleteMemoViewRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
@ -288,123 +288,123 @@ func local_request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshal
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
msg, err := server.DeleteShortcut(ctx, &protoReq)
|
msg, err := server.DeleteMemoView(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterShortcutServiceHandlerServer registers the http handlers for service ShortcutService to "mux".
|
// RegisterMemoViewServiceHandlerServer registers the http handlers for service MemoViewService to "mux".
|
||||||
// UnaryRPC :call ShortcutServiceServer directly.
|
// UnaryRPC :call MemoViewServiceServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterShortcutServiceHandlerFromEndpoint instead.
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMemoViewServiceHandlerFromEndpoint instead.
|
||||||
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
|
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
|
||||||
func RegisterShortcutServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShortcutServiceServer) error {
|
func RegisterMemoViewServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MemoViewServiceServer) error {
|
||||||
mux.Handle(http.MethodGet, pattern_ShortcutService_ListShortcuts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_MemoViewService_ListMemoViews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/shortcuts"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoViewService/ListMemoViews", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/views"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_ShortcutService_ListShortcuts_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_MemoViewService_ListMemoViews_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_ListShortcuts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_ListMemoViews_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_ShortcutService_GetShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_MemoViewService_GetMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoViewService/GetMemoView", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_ShortcutService_GetShortcut_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_MemoViewService_GetMemoView_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_GetShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_GetMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodPost, pattern_ShortcutService_CreateShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodPost, pattern_MemoViewService_CreateMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/shortcuts"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoViewService/CreateMemoView", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/views"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_ShortcutService_CreateShortcut_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_MemoViewService_CreateMemoView_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_CreateShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_CreateMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodPatch, pattern_ShortcutService_UpdateShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodPatch, pattern_MemoViewService_UpdateMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v1/{shortcut.name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoViewService/UpdateMemoView", runtime.WithHTTPPathPattern("/api/v1/{memo_view.name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_ShortcutService_UpdateShortcut_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_MemoViewService_UpdateMemoView_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_UpdateShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_UpdateMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodDelete, pattern_ShortcutService_DeleteShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodDelete, pattern_MemoViewService_DeleteMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MemoViewService/DeleteMemoView", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_ShortcutService_DeleteShortcut_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_MemoViewService_DeleteMemoView_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_DeleteShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_DeleteMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterShortcutServiceHandlerFromEndpoint is same as RegisterShortcutServiceHandler but
|
// RegisterMemoViewServiceHandlerFromEndpoint is same as RegisterMemoViewServiceHandler but
|
||||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
func RegisterShortcutServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
func RegisterMemoViewServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||||
conn, err := grpc.NewClient(endpoint, opts...)
|
conn, err := grpc.NewClient(endpoint, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -423,121 +423,121 @@ func RegisterShortcutServiceHandlerFromEndpoint(ctx context.Context, mux *runtim
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}()
|
}()
|
||||||
return RegisterShortcutServiceHandler(ctx, mux, conn)
|
return RegisterMemoViewServiceHandler(ctx, mux, conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterShortcutServiceHandler registers the http handlers for service ShortcutService to "mux".
|
// RegisterMemoViewServiceHandler registers the http handlers for service MemoViewService to "mux".
|
||||||
// The handlers forward requests to the grpc endpoint over "conn".
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
func RegisterShortcutServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
func RegisterMemoViewServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
return RegisterShortcutServiceHandlerClient(ctx, mux, NewShortcutServiceClient(conn))
|
return RegisterMemoViewServiceHandlerClient(ctx, mux, NewMemoViewServiceClient(conn))
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterShortcutServiceHandlerClient registers the http handlers for service ShortcutService
|
// RegisterMemoViewServiceHandlerClient registers the http handlers for service MemoViewService
|
||||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ShortcutServiceClient".
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MemoViewServiceClient".
|
||||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ShortcutServiceClient"
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MemoViewServiceClient"
|
||||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
// "ShortcutServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
// "MemoViewServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
||||||
func RegisterShortcutServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShortcutServiceClient) error {
|
func RegisterMemoViewServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MemoViewServiceClient) error {
|
||||||
mux.Handle(http.MethodGet, pattern_ShortcutService_ListShortcuts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_MemoViewService_ListMemoViews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/shortcuts"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoViewService/ListMemoViews", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/views"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_ShortcutService_ListShortcuts_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_MemoViewService_ListMemoViews_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_ListShortcuts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_ListMemoViews_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_ShortcutService_GetShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_MemoViewService_GetMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoViewService/GetMemoView", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_ShortcutService_GetShortcut_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_MemoViewService_GetMemoView_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_GetShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_GetMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodPost, pattern_ShortcutService_CreateShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodPost, pattern_MemoViewService_CreateMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/shortcuts"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoViewService/CreateMemoView", runtime.WithHTTPPathPattern("/api/v1/{parent=users/*}/views"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_ShortcutService_CreateShortcut_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_MemoViewService_CreateMemoView_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_CreateShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_CreateMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodPatch, pattern_ShortcutService_UpdateShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodPatch, pattern_MemoViewService_UpdateMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v1/{shortcut.name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoViewService/UpdateMemoView", runtime.WithHTTPPathPattern("/api/v1/{memo_view.name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_ShortcutService_UpdateShortcut_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_MemoViewService_UpdateMemoView_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_UpdateShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_UpdateMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodDelete, pattern_ShortcutService_DeleteShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodDelete, pattern_MemoViewService_DeleteMemoView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/shortcuts/*}"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MemoViewService/DeleteMemoView", runtime.WithHTTPPathPattern("/api/v1/{name=users/*/views/*}"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_ShortcutService_DeleteShortcut_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_MemoViewService_DeleteMemoView_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_ShortcutService_DeleteShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_MemoViewService_DeleteMemoView_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
pattern_ShortcutService_ListShortcuts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "users", "parent", "shortcuts"}, ""))
|
pattern_MemoViewService_ListMemoViews_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "users", "parent", "views"}, ""))
|
||||||
pattern_ShortcutService_GetShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "shortcuts", "name"}, ""))
|
pattern_MemoViewService_GetMemoView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "views", "name"}, ""))
|
||||||
pattern_ShortcutService_CreateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "users", "parent", "shortcuts"}, ""))
|
pattern_MemoViewService_CreateMemoView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "users", "parent", "views"}, ""))
|
||||||
pattern_ShortcutService_UpdateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "shortcuts", "shortcut.name"}, ""))
|
pattern_MemoViewService_UpdateMemoView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "views", "memo_view.name"}, ""))
|
||||||
pattern_ShortcutService_DeleteShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "shortcuts", "name"}, ""))
|
pattern_MemoViewService_DeleteMemoView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 2, 3, 1, 0, 4, 4, 5, 4}, []string{"api", "v1", "users", "views", "name"}, ""))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
forward_ShortcutService_ListShortcuts_0 = runtime.ForwardResponseMessage
|
forward_MemoViewService_ListMemoViews_0 = runtime.ForwardResponseMessage
|
||||||
forward_ShortcutService_GetShortcut_0 = runtime.ForwardResponseMessage
|
forward_MemoViewService_GetMemoView_0 = runtime.ForwardResponseMessage
|
||||||
forward_ShortcutService_CreateShortcut_0 = runtime.ForwardResponseMessage
|
forward_MemoViewService_CreateMemoView_0 = runtime.ForwardResponseMessage
|
||||||
forward_ShortcutService_UpdateShortcut_0 = runtime.ForwardResponseMessage
|
forward_MemoViewService_UpdateMemoView_0 = runtime.ForwardResponseMessage
|
||||||
forward_ShortcutService_DeleteShortcut_0 = runtime.ForwardResponseMessage
|
forward_MemoViewService_DeleteMemoView_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
288
proto/gen/api/v1/memo_view_service_grpc.pb.go
Normal file
288
proto/gen/api/v1/memo_view_service_grpc.pb.go
Normal file
|
|
@ -0,0 +1,288 @@
|
||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.6.2
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: api/v1/memo_view_service.proto
|
||||||
|
|
||||||
|
package apiv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
|
const (
|
||||||
|
MemoViewService_ListMemoViews_FullMethodName = "/memos.api.v1.MemoViewService/ListMemoViews"
|
||||||
|
MemoViewService_GetMemoView_FullMethodName = "/memos.api.v1.MemoViewService/GetMemoView"
|
||||||
|
MemoViewService_CreateMemoView_FullMethodName = "/memos.api.v1.MemoViewService/CreateMemoView"
|
||||||
|
MemoViewService_UpdateMemoView_FullMethodName = "/memos.api.v1.MemoViewService/UpdateMemoView"
|
||||||
|
MemoViewService_DeleteMemoView_FullMethodName = "/memos.api.v1.MemoViewService/DeleteMemoView"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MemoViewServiceClient is the client API for MemoViewService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type MemoViewServiceClient interface {
|
||||||
|
// ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
|
// CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
|
// ListMemos `filter` argument.
|
||||||
|
ListMemoViews(ctx context.Context, in *ListMemoViewsRequest, opts ...grpc.CallOption) (*ListMemoViewsResponse, error)
|
||||||
|
// GetMemoView gets a memo view by name.
|
||||||
|
GetMemoView(ctx context.Context, in *GetMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error)
|
||||||
|
// CreateMemoView creates a new memo view for a user.
|
||||||
|
CreateMemoView(ctx context.Context, in *CreateMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error)
|
||||||
|
// UpdateMemoView updates a memo view for a user.
|
||||||
|
UpdateMemoView(ctx context.Context, in *UpdateMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error)
|
||||||
|
// DeleteMemoView deletes a memo view for a user.
|
||||||
|
DeleteMemoView(ctx context.Context, in *DeleteMemoViewRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type memoViewServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemoViewServiceClient(cc grpc.ClientConnInterface) MemoViewServiceClient {
|
||||||
|
return &memoViewServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *memoViewServiceClient) ListMemoViews(ctx context.Context, in *ListMemoViewsRequest, opts ...grpc.CallOption) (*ListMemoViewsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(ListMemoViewsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, MemoViewService_ListMemoViews_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *memoViewServiceClient) GetMemoView(ctx context.Context, in *GetMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(MemoView)
|
||||||
|
err := c.cc.Invoke(ctx, MemoViewService_GetMemoView_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *memoViewServiceClient) CreateMemoView(ctx context.Context, in *CreateMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(MemoView)
|
||||||
|
err := c.cc.Invoke(ctx, MemoViewService_CreateMemoView_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *memoViewServiceClient) UpdateMemoView(ctx context.Context, in *UpdateMemoViewRequest, opts ...grpc.CallOption) (*MemoView, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(MemoView)
|
||||||
|
err := c.cc.Invoke(ctx, MemoViewService_UpdateMemoView_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *memoViewServiceClient) DeleteMemoView(ctx context.Context, in *DeleteMemoViewRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(emptypb.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, MemoViewService_DeleteMemoView_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MemoViewServiceServer is the server API for MemoViewService service.
|
||||||
|
// All implementations must embed UnimplementedMemoViewServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
|
type MemoViewServiceServer interface {
|
||||||
|
// ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
|
// CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
|
// ListMemos `filter` argument.
|
||||||
|
ListMemoViews(context.Context, *ListMemoViewsRequest) (*ListMemoViewsResponse, error)
|
||||||
|
// GetMemoView gets a memo view by name.
|
||||||
|
GetMemoView(context.Context, *GetMemoViewRequest) (*MemoView, error)
|
||||||
|
// CreateMemoView creates a new memo view for a user.
|
||||||
|
CreateMemoView(context.Context, *CreateMemoViewRequest) (*MemoView, error)
|
||||||
|
// UpdateMemoView updates a memo view for a user.
|
||||||
|
UpdateMemoView(context.Context, *UpdateMemoViewRequest) (*MemoView, error)
|
||||||
|
// DeleteMemoView deletes a memo view for a user.
|
||||||
|
DeleteMemoView(context.Context, *DeleteMemoViewRequest) (*emptypb.Empty, error)
|
||||||
|
mustEmbedUnimplementedMemoViewServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMemoViewServiceServer must be embedded to have
|
||||||
|
// forward compatible implementations.
|
||||||
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedMemoViewServiceServer struct{}
|
||||||
|
|
||||||
|
func (UnimplementedMemoViewServiceServer) ListMemoViews(context.Context, *ListMemoViewsRequest) (*ListMemoViewsResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method ListMemoViews not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMemoViewServiceServer) GetMemoView(context.Context, *GetMemoViewRequest) (*MemoView, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetMemoView not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMemoViewServiceServer) CreateMemoView(context.Context, *CreateMemoViewRequest) (*MemoView, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method CreateMemoView not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMemoViewServiceServer) UpdateMemoView(context.Context, *UpdateMemoViewRequest) (*MemoView, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method UpdateMemoView not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMemoViewServiceServer) DeleteMemoView(context.Context, *DeleteMemoViewRequest) (*emptypb.Empty, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method DeleteMemoView not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMemoViewServiceServer) mustEmbedUnimplementedMemoViewServiceServer() {}
|
||||||
|
func (UnimplementedMemoViewServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafeMemoViewServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to MemoViewServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeMemoViewServiceServer interface {
|
||||||
|
mustEmbedUnimplementedMemoViewServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMemoViewServiceServer(s grpc.ServiceRegistrar, srv MemoViewServiceServer) {
|
||||||
|
// If the following call panics, it indicates UnimplementedMemoViewServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
|
s.RegisterService(&MemoViewService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _MemoViewService_ListMemoViews_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListMemoViewsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MemoViewServiceServer).ListMemoViews(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: MemoViewService_ListMemoViews_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MemoViewServiceServer).ListMemoViews(ctx, req.(*ListMemoViewsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _MemoViewService_GetMemoView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetMemoViewRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MemoViewServiceServer).GetMemoView(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: MemoViewService_GetMemoView_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MemoViewServiceServer).GetMemoView(ctx, req.(*GetMemoViewRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _MemoViewService_CreateMemoView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateMemoViewRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MemoViewServiceServer).CreateMemoView(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: MemoViewService_CreateMemoView_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MemoViewServiceServer).CreateMemoView(ctx, req.(*CreateMemoViewRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _MemoViewService_UpdateMemoView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateMemoViewRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MemoViewServiceServer).UpdateMemoView(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: MemoViewService_UpdateMemoView_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MemoViewServiceServer).UpdateMemoView(ctx, req.(*UpdateMemoViewRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _MemoViewService_DeleteMemoView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteMemoViewRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MemoViewServiceServer).DeleteMemoView(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: MemoViewService_DeleteMemoView_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MemoViewServiceServer).DeleteMemoView(ctx, req.(*DeleteMemoViewRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MemoViewService_ServiceDesc is the grpc.ServiceDesc for MemoViewService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var MemoViewService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "memos.api.v1.MemoViewService",
|
||||||
|
HandlerType: (*MemoViewServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "ListMemoViews",
|
||||||
|
Handler: _MemoViewService_ListMemoViews_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetMemoView",
|
||||||
|
Handler: _MemoViewService_GetMemoView_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreateMemoView",
|
||||||
|
Handler: _MemoViewService_CreateMemoView_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateMemoView",
|
||||||
|
Handler: _MemoViewService_UpdateMemoView_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteMemoView",
|
||||||
|
Handler: _MemoViewService_DeleteMemoView_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "api/v1/memo_view_service.proto",
|
||||||
|
}
|
||||||
|
|
@ -1,497 +0,0 @@
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.36.11
|
|
||||||
// protoc (unknown)
|
|
||||||
// source: api/v1/shortcut_service.proto
|
|
||||||
|
|
||||||
package apiv1
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
unsafe "unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
type Shortcut struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// The resource name of the shortcut.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
||||||
// The title of the shortcut.
|
|
||||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
|
||||||
// The CEL filter expression for the shortcut, using the same grammar as the
|
|
||||||
// ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
|
||||||
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Shortcut) Reset() {
|
|
||||||
*x = Shortcut{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Shortcut) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*Shortcut) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *Shortcut) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use Shortcut.ProtoReflect.Descriptor instead.
|
|
||||||
func (*Shortcut) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Shortcut) GetName() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Name
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Shortcut) GetTitle() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Title
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Shortcut) GetFilter() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Filter
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type ListShortcutsRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// Required. The parent resource where shortcuts are listed.
|
|
||||||
// Format: users/{user}
|
|
||||||
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsRequest) Reset() {
|
|
||||||
*x = ListShortcutsRequest{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ListShortcutsRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ListShortcutsRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ListShortcutsRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ListShortcutsRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsRequest) GetParent() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Parent
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type ListShortcutsResponse struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// The list of shortcuts.
|
|
||||||
Shortcuts []*Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsResponse) Reset() {
|
|
||||||
*x = ListShortcutsResponse{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsResponse) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ListShortcutsResponse) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ListShortcutsResponse) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ListShortcutsResponse.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ListShortcutsResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{2}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut {
|
|
||||||
if x != nil {
|
|
||||||
return x.Shortcuts
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetShortcutRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// Required. The resource name of the shortcut to retrieve.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetShortcutRequest) Reset() {
|
|
||||||
*x = GetShortcutRequest{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetShortcutRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*GetShortcutRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use GetShortcutRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*GetShortcutRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{3}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetShortcutRequest) GetName() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Name
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type CreateShortcutRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// Required. The parent resource where this shortcut will be created.
|
|
||||||
// Format: users/{user}
|
|
||||||
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
|
|
||||||
// Required. The shortcut to create.
|
|
||||||
Shortcut *Shortcut `protobuf:"bytes,2,opt,name=shortcut,proto3" json:"shortcut,omitempty"`
|
|
||||||
// Optional. If set, validate the request, but do not actually create the shortcut.
|
|
||||||
ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) Reset() {
|
|
||||||
*x = CreateShortcutRequest{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*CreateShortcutRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use CreateShortcutRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*CreateShortcutRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{4}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) GetParent() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Parent
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) GetShortcut() *Shortcut {
|
|
||||||
if x != nil {
|
|
||||||
return x.Shortcut
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *CreateShortcutRequest) GetValidateOnly() bool {
|
|
||||||
if x != nil {
|
|
||||||
return x.ValidateOnly
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
type UpdateShortcutRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// Required. The shortcut resource which replaces the resource on the server.
|
|
||||||
Shortcut *Shortcut `protobuf:"bytes,1,opt,name=shortcut,proto3" json:"shortcut,omitempty"`
|
|
||||||
// Optional. The list of fields to update.
|
|
||||||
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *UpdateShortcutRequest) Reset() {
|
|
||||||
*x = UpdateShortcutRequest{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *UpdateShortcutRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*UpdateShortcutRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *UpdateShortcutRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use UpdateShortcutRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*UpdateShortcutRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{5}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *UpdateShortcutRequest) GetShortcut() *Shortcut {
|
|
||||||
if x != nil {
|
|
||||||
return x.Shortcut
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *UpdateShortcutRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
|
|
||||||
if x != nil {
|
|
||||||
return x.UpdateMask
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type DeleteShortcutRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
// Required. The resource name of the shortcut to delete.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DeleteShortcutRequest) Reset() {
|
|
||||||
*x = DeleteShortcutRequest{}
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DeleteShortcutRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*DeleteShortcutRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *DeleteShortcutRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use DeleteShortcutRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*DeleteShortcutRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{6}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DeleteShortcutRequest) GetName() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Name
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_api_v1_shortcut_service_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
const file_api_v1_shortcut_service_proto_rawDesc = "" +
|
|
||||||
"\n" +
|
|
||||||
"\x1dapi/v1/shortcut_service.proto\x12\fmemos.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xaf\x01\n" +
|
|
||||||
"\bShortcut\x12\x17\n" +
|
|
||||||
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x19\n" +
|
|
||||||
"\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" +
|
|
||||||
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter:R\xeaAO\n" +
|
|
||||||
"\x15memos.api.v1/Shortcut\x12!users/{user}/shortcuts/{shortcut}*\tshortcuts2\bshortcut\"M\n" +
|
|
||||||
"\x14ListShortcutsRequest\x125\n" +
|
|
||||||
"\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\"M\n" +
|
|
||||||
"\x15ListShortcutsResponse\x124\n" +
|
|
||||||
"\tshortcuts\x18\x01 \x03(\v2\x16.memos.api.v1.ShortcutR\tshortcuts\"G\n" +
|
|
||||||
"\x12GetShortcutRequest\x121\n" +
|
|
||||||
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
|
|
||||||
"\x15memos.api.v1/ShortcutR\x04name\"\xb1\x01\n" +
|
|
||||||
"\x15CreateShortcutRequest\x125\n" +
|
|
||||||
"\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\x127\n" +
|
|
||||||
"\bshortcut\x18\x02 \x01(\v2\x16.memos.api.v1.ShortcutB\x03\xe0A\x02R\bshortcut\x12(\n" +
|
|
||||||
"\rvalidate_only\x18\x03 \x01(\bB\x03\xe0A\x01R\fvalidateOnly\"\x92\x01\n" +
|
|
||||||
"\x15UpdateShortcutRequest\x127\n" +
|
|
||||||
"\bshortcut\x18\x01 \x01(\v2\x16.memos.api.v1.ShortcutB\x03\xe0A\x02R\bshortcut\x12@\n" +
|
|
||||||
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x01R\n" +
|
|
||||||
"updateMask\"J\n" +
|
|
||||||
"\x15DeleteShortcutRequest\x121\n" +
|
|
||||||
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
|
|
||||||
"\x15memos.api.v1/ShortcutR\x04name2\xde\x05\n" +
|
|
||||||
"\x0fShortcutService\x12\x8d\x01\n" +
|
|
||||||
"\rListShortcuts\x12\".memos.api.v1.ListShortcutsRequest\x1a#.memos.api.v1.ListShortcutsResponse\"3\xdaA\x06parent\x82\xd3\xe4\x93\x02$\x12\"/api/v1/{parent=users/*}/shortcuts\x12z\n" +
|
|
||||||
"\vGetShortcut\x12 .memos.api.v1.GetShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"1\xdaA\x04name\x82\xd3\xe4\x93\x02$\x12\"/api/v1/{name=users/*/shortcuts/*}\x12\x95\x01\n" +
|
|
||||||
"\x0eCreateShortcut\x12#.memos.api.v1.CreateShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"F\xdaA\x0fparent,shortcut\x82\xd3\xe4\x93\x02.:\bshortcut\"\"/api/v1/{parent=users/*}/shortcuts\x12\xa3\x01\n" +
|
|
||||||
"\x0eUpdateShortcut\x12#.memos.api.v1.UpdateShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"T\xdaA\x14shortcut,update_mask\x82\xd3\xe4\x93\x027:\bshortcut2+/api/v1/{shortcut.name=users/*/shortcuts/*}\x12\x80\x01\n" +
|
|
||||||
"\x0eDeleteShortcut\x12#.memos.api.v1.DeleteShortcutRequest\x1a\x16.google.protobuf.Empty\"1\xdaA\x04name\x82\xd3\xe4\x93\x02$*\"/api/v1/{name=users/*/shortcuts/*}B\xac\x01\n" +
|
|
||||||
"\x10com.memos.api.v1B\x14ShortcutServiceProtoP\x01Z0github.com/usememos/memos/proto/gen/api/v1;apiv1\xa2\x02\x03MAX\xaa\x02\fMemos.Api.V1\xca\x02\fMemos\\Api\\V1\xe2\x02\x18Memos\\Api\\V1\\GPBMetadata\xea\x02\x0eMemos::Api::V1b\x06proto3"
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_api_v1_shortcut_service_proto_rawDescOnce sync.Once
|
|
||||||
file_api_v1_shortcut_service_proto_rawDescData []byte
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_api_v1_shortcut_service_proto_rawDescGZIP() []byte {
|
|
||||||
file_api_v1_shortcut_service_proto_rawDescOnce.Do(func() {
|
|
||||||
file_api_v1_shortcut_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_shortcut_service_proto_rawDesc), len(file_api_v1_shortcut_service_proto_rawDesc)))
|
|
||||||
})
|
|
||||||
return file_api_v1_shortcut_service_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_api_v1_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
|
||||||
var file_api_v1_shortcut_service_proto_goTypes = []any{
|
|
||||||
(*Shortcut)(nil), // 0: memos.api.v1.Shortcut
|
|
||||||
(*ListShortcutsRequest)(nil), // 1: memos.api.v1.ListShortcutsRequest
|
|
||||||
(*ListShortcutsResponse)(nil), // 2: memos.api.v1.ListShortcutsResponse
|
|
||||||
(*GetShortcutRequest)(nil), // 3: memos.api.v1.GetShortcutRequest
|
|
||||||
(*CreateShortcutRequest)(nil), // 4: memos.api.v1.CreateShortcutRequest
|
|
||||||
(*UpdateShortcutRequest)(nil), // 5: memos.api.v1.UpdateShortcutRequest
|
|
||||||
(*DeleteShortcutRequest)(nil), // 6: memos.api.v1.DeleteShortcutRequest
|
|
||||||
(*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
|
|
||||||
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
|
|
||||||
}
|
|
||||||
var file_api_v1_shortcut_service_proto_depIdxs = []int32{
|
|
||||||
0, // 0: memos.api.v1.ListShortcutsResponse.shortcuts:type_name -> memos.api.v1.Shortcut
|
|
||||||
0, // 1: memos.api.v1.CreateShortcutRequest.shortcut:type_name -> memos.api.v1.Shortcut
|
|
||||||
0, // 2: memos.api.v1.UpdateShortcutRequest.shortcut:type_name -> memos.api.v1.Shortcut
|
|
||||||
7, // 3: memos.api.v1.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask
|
|
||||||
1, // 4: memos.api.v1.ShortcutService.ListShortcuts:input_type -> memos.api.v1.ListShortcutsRequest
|
|
||||||
3, // 5: memos.api.v1.ShortcutService.GetShortcut:input_type -> memos.api.v1.GetShortcutRequest
|
|
||||||
4, // 6: memos.api.v1.ShortcutService.CreateShortcut:input_type -> memos.api.v1.CreateShortcutRequest
|
|
||||||
5, // 7: memos.api.v1.ShortcutService.UpdateShortcut:input_type -> memos.api.v1.UpdateShortcutRequest
|
|
||||||
6, // 8: memos.api.v1.ShortcutService.DeleteShortcut:input_type -> memos.api.v1.DeleteShortcutRequest
|
|
||||||
2, // 9: memos.api.v1.ShortcutService.ListShortcuts:output_type -> memos.api.v1.ListShortcutsResponse
|
|
||||||
0, // 10: memos.api.v1.ShortcutService.GetShortcut:output_type -> memos.api.v1.Shortcut
|
|
||||||
0, // 11: memos.api.v1.ShortcutService.CreateShortcut:output_type -> memos.api.v1.Shortcut
|
|
||||||
0, // 12: memos.api.v1.ShortcutService.UpdateShortcut:output_type -> memos.api.v1.Shortcut
|
|
||||||
8, // 13: memos.api.v1.ShortcutService.DeleteShortcut:output_type -> google.protobuf.Empty
|
|
||||||
9, // [9:14] is the sub-list for method output_type
|
|
||||||
4, // [4:9] is the sub-list for method input_type
|
|
||||||
4, // [4:4] is the sub-list for extension type_name
|
|
||||||
4, // [4:4] is the sub-list for extension extendee
|
|
||||||
0, // [0:4] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_api_v1_shortcut_service_proto_init() }
|
|
||||||
func file_api_v1_shortcut_service_proto_init() {
|
|
||||||
if File_api_v1_shortcut_service_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_shortcut_service_proto_rawDesc), len(file_api_v1_shortcut_service_proto_rawDesc)),
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 7,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 1,
|
|
||||||
},
|
|
||||||
GoTypes: file_api_v1_shortcut_service_proto_goTypes,
|
|
||||||
DependencyIndexes: file_api_v1_shortcut_service_proto_depIdxs,
|
|
||||||
MessageInfos: file_api_v1_shortcut_service_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_api_v1_shortcut_service_proto = out.File
|
|
||||||
file_api_v1_shortcut_service_proto_goTypes = nil
|
|
||||||
file_api_v1_shortcut_service_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,288 +0,0 @@
|
||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.6.2
|
|
||||||
// - protoc (unknown)
|
|
||||||
// source: api/v1/shortcut_service.proto
|
|
||||||
|
|
||||||
package apiv1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
|
||||||
|
|
||||||
const (
|
|
||||||
ShortcutService_ListShortcuts_FullMethodName = "/memos.api.v1.ShortcutService/ListShortcuts"
|
|
||||||
ShortcutService_GetShortcut_FullMethodName = "/memos.api.v1.ShortcutService/GetShortcut"
|
|
||||||
ShortcutService_CreateShortcut_FullMethodName = "/memos.api.v1.ShortcutService/CreateShortcut"
|
|
||||||
ShortcutService_UpdateShortcut_FullMethodName = "/memos.api.v1.ShortcutService/UpdateShortcut"
|
|
||||||
ShortcutService_DeleteShortcut_FullMethodName = "/memos.api.v1.ShortcutService/DeleteShortcut"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ShortcutServiceClient is the client API for ShortcutService service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type ShortcutServiceClient interface {
|
|
||||||
// ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
|
||||||
// reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
|
||||||
// to the ListMemos `filter` argument to reuse a saved view.
|
|
||||||
ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error)
|
|
||||||
// GetShortcut gets a shortcut by name.
|
|
||||||
GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
|
|
||||||
// CreateShortcut creates a new shortcut for a user.
|
|
||||||
CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
|
|
||||||
// UpdateShortcut updates a shortcut for a user.
|
|
||||||
UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
|
|
||||||
// DeleteShortcut deletes a shortcut for a user.
|
|
||||||
DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type shortcutServiceClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewShortcutServiceClient(cc grpc.ClientConnInterface) ShortcutServiceClient {
|
|
||||||
return &shortcutServiceClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *shortcutServiceClient) ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(ListShortcutsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, ShortcutService_ListShortcuts_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *shortcutServiceClient) GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(Shortcut)
|
|
||||||
err := c.cc.Invoke(ctx, ShortcutService_GetShortcut_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *shortcutServiceClient) CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(Shortcut)
|
|
||||||
err := c.cc.Invoke(ctx, ShortcutService_CreateShortcut_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *shortcutServiceClient) UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(Shortcut)
|
|
||||||
err := c.cc.Invoke(ctx, ShortcutService_UpdateShortcut_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *shortcutServiceClient) DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(emptypb.Empty)
|
|
||||||
err := c.cc.Invoke(ctx, ShortcutService_DeleteShortcut_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ShortcutServiceServer is the server API for ShortcutService service.
|
|
||||||
// All implementations must embed UnimplementedShortcutServiceServer
|
|
||||||
// for forward compatibility.
|
|
||||||
type ShortcutServiceServer interface {
|
|
||||||
// ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
|
||||||
// reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
|
||||||
// to the ListMemos `filter` argument to reuse a saved view.
|
|
||||||
ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error)
|
|
||||||
// GetShortcut gets a shortcut by name.
|
|
||||||
GetShortcut(context.Context, *GetShortcutRequest) (*Shortcut, error)
|
|
||||||
// CreateShortcut creates a new shortcut for a user.
|
|
||||||
CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error)
|
|
||||||
// UpdateShortcut updates a shortcut for a user.
|
|
||||||
UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error)
|
|
||||||
// DeleteShortcut deletes a shortcut for a user.
|
|
||||||
DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error)
|
|
||||||
mustEmbedUnimplementedShortcutServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedShortcutServiceServer must be embedded to have
|
|
||||||
// forward compatible implementations.
|
|
||||||
//
|
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedShortcutServiceServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedShortcutServiceServer) ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method ListShortcuts not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedShortcutServiceServer) GetShortcut(context.Context, *GetShortcutRequest) (*Shortcut, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method GetShortcut not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedShortcutServiceServer) CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method CreateShortcut not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedShortcutServiceServer) UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method UpdateShortcut not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedShortcutServiceServer) DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method DeleteShortcut not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedShortcutServiceServer) mustEmbedUnimplementedShortcutServiceServer() {}
|
|
||||||
func (UnimplementedShortcutServiceServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeShortcutServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to ShortcutServiceServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeShortcutServiceServer interface {
|
|
||||||
mustEmbedUnimplementedShortcutServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterShortcutServiceServer(s grpc.ServiceRegistrar, srv ShortcutServiceServer) {
|
|
||||||
// If the following call panics, it indicates UnimplementedShortcutServiceServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&ShortcutService_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ShortcutService_ListShortcuts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(ListShortcutsRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(ShortcutServiceServer).ListShortcuts(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ShortcutService_ListShortcuts_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(ShortcutServiceServer).ListShortcuts(ctx, req.(*ListShortcutsRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ShortcutService_GetShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(GetShortcutRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(ShortcutServiceServer).GetShortcut(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ShortcutService_GetShortcut_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(ShortcutServiceServer).GetShortcut(ctx, req.(*GetShortcutRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ShortcutService_CreateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(CreateShortcutRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(ShortcutServiceServer).CreateShortcut(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ShortcutService_CreateShortcut_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(ShortcutServiceServer).CreateShortcut(ctx, req.(*CreateShortcutRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ShortcutService_UpdateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateShortcutRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(ShortcutServiceServer).UpdateShortcut(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ShortcutService_UpdateShortcut_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(ShortcutServiceServer).UpdateShortcut(ctx, req.(*UpdateShortcutRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ShortcutService_DeleteShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DeleteShortcutRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(ShortcutServiceServer).DeleteShortcut(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ShortcutService_DeleteShortcut_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(ShortcutServiceServer).DeleteShortcut(ctx, req.(*DeleteShortcutRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ShortcutService_ServiceDesc is the grpc.ServiceDesc for ShortcutService service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var ShortcutService_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "memos.api.v1.ShortcutService",
|
|
||||||
HandlerType: (*ShortcutServiceServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "ListShortcuts",
|
|
||||||
Handler: _ShortcutService_ListShortcuts_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "GetShortcut",
|
|
||||||
Handler: _ShortcutService_GetShortcut_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "CreateShortcut",
|
|
||||||
Handler: _ShortcutService_CreateShortcut_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdateShortcut",
|
|
||||||
Handler: _ShortcutService_UpdateShortcut_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "DeleteShortcut",
|
|
||||||
Handler: _ShortcutService_DeleteShortcut_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "api/v1/shortcut_service.proto",
|
|
||||||
}
|
|
||||||
|
|
@ -42,15 +42,15 @@ func request_UserService_ListUsers_0(ctx context.Context, marshaler runtime.Mars
|
||||||
protoReq ListUsersRequest
|
protoReq ListUsersRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUsers_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUsers_0); err != nil {
|
||||||
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.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
|
||||||
}
|
}
|
||||||
|
|
@ -105,9 +105,6 @@ func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marsha
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -122,6 +119,9 @@ func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marsha
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUser_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUser_0); err != nil {
|
||||||
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.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -160,15 +160,15 @@ 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)
|
|
||||||
}
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_CreateUser_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_CreateUser_0); err != nil {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
@ -206,9 +206,6 @@ 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)
|
||||||
|
|
@ -230,6 +227,9 @@ func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUser_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUser_0); err != nil {
|
||||||
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.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -280,9 +280,6 @@ func request_UserService_DeleteUser_0(ctx context.Context, marshaler runtime.Mar
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -297,6 +294,9 @@ func request_UserService_DeleteUser_0(ctx context.Context, marshaler runtime.Mar
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_DeleteUser_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_DeleteUser_0); err != nil {
|
||||||
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.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -332,15 +332,15 @@ func request_UserService_ListAllUserStats_0(ctx context.Context, marshaler runti
|
||||||
protoReq ListAllUserStatsRequest
|
protoReq ListAllUserStatsRequest
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
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)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListAllUserStats_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListAllUserStats_0); err != nil {
|
||||||
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.ListAllUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListAllUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -366,9 +366,6 @@ func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.M
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -377,6 +374,9 @@ func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.M
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -405,9 +405,6 @@ func request_UserService_GetUserSetting_0(ctx context.Context, marshaler runtime
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -416,6 +413,9 @@ func request_UserService_GetUserSetting_0(ctx context.Context, marshaler runtime
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetUserSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetUserSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -453,9 +453,6 @@ func request_UserService_UpdateUserSetting_0(ctx context.Context, marshaler runt
|
||||||
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)
|
||||||
|
|
@ -477,6 +474,9 @@ func request_UserService_UpdateUserSetting_0(ctx context.Context, marshaler runt
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserSetting_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserSetting_0); err != nil {
|
||||||
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.UpdateUserSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateUserSetting(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -527,9 +527,6 @@ func request_UserService_ListUserSettings_0(ctx context.Context, marshaler runti
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -544,6 +541,9 @@ func request_UserService_ListUserSettings_0(ctx context.Context, marshaler runti
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUserSettings_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUserSettings_0); err != nil {
|
||||||
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.ListUserSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListUserSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -578,9 +578,6 @@ func request_UserService_ListLinkedIdentities_0(ctx context.Context, marshaler r
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -589,6 +586,9 @@ func request_UserService_ListLinkedIdentities_0(ctx context.Context, marshaler r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.ListLinkedIdentities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListLinkedIdentities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -620,9 +620,6 @@ func request_UserService_CreateLinkedIdentity_0(ctx context.Context, marshaler r
|
||||||
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["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -631,6 +628,9 @@ func request_UserService_CreateLinkedIdentity_0(ctx context.Context, marshaler r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.CreateLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -662,9 +662,6 @@ func request_UserService_GetLinkedIdentity_0(ctx context.Context, marshaler runt
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -673,6 +670,9 @@ func request_UserService_GetLinkedIdentity_0(ctx context.Context, marshaler runt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -701,9 +701,6 @@ func request_UserService_DeleteLinkedIdentity_0(ctx context.Context, marshaler r
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -712,6 +709,9 @@ func request_UserService_DeleteLinkedIdentity_0(ctx context.Context, marshaler r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteLinkedIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -742,9 +742,6 @@ func request_UserService_ListPersonalAccessTokens_0(ctx context.Context, marshal
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -759,6 +756,9 @@ func request_UserService_ListPersonalAccessTokens_0(ctx context.Context, marshal
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListPersonalAccessTokens_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListPersonalAccessTokens_0); err != nil {
|
||||||
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.ListPersonalAccessTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListPersonalAccessTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -796,9 +796,6 @@ func request_UserService_CreatePersonalAccessToken_0(ctx context.Context, marsha
|
||||||
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["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -807,6 +804,9 @@ func request_UserService_CreatePersonalAccessToken_0(ctx context.Context, marsha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.CreatePersonalAccessToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreatePersonalAccessToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -838,9 +838,6 @@ func request_UserService_DeletePersonalAccessToken_0(ctx context.Context, marsha
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -849,6 +846,9 @@ func request_UserService_DeletePersonalAccessToken_0(ctx context.Context, marsha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeletePersonalAccessToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeletePersonalAccessToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -877,9 +877,6 @@ func request_UserService_ListUserWebhooks_0(ctx context.Context, marshaler runti
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -888,6 +885,9 @@ func request_UserService_ListUserWebhooks_0(ctx context.Context, marshaler runti
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.ListUserWebhooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListUserWebhooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -919,9 +919,6 @@ func request_UserService_CreateUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Webhook); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Webhook); 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["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -930,6 +927,9 @@ func request_UserService_CreateUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.CreateUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.CreateUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -970,9 +970,6 @@ func request_UserService_UpdateUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Webhook); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Webhook); 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.Webhook); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Webhook); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
|
@ -994,6 +991,9 @@ func request_UserService_UpdateUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserWebhook_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserWebhook_0); err != nil {
|
||||||
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.UpdateUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -1042,9 +1042,6 @@ func request_UserService_DeleteUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -1053,6 +1050,9 @@ func request_UserService_DeleteUserWebhook_0(ctx context.Context, marshaler runt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteUserWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -1081,9 +1081,6 @@ func request_UserService_GetUserWebhookSigningSecret_0(ctx context.Context, mars
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -1092,6 +1089,9 @@ func request_UserService_GetUserWebhookSigningSecret_0(ctx context.Context, mars
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.GetUserWebhookSigningSecret(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetUserWebhookSigningSecret(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -1122,9 +1122,6 @@ func request_UserService_ListUserNotifications_0(ctx context.Context, marshaler
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["parent"]
|
val, ok := pathParams["parent"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
|
||||||
|
|
@ -1139,6 +1136,9 @@ func request_UserService_ListUserNotifications_0(ctx context.Context, marshaler
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUserNotifications_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListUserNotifications_0); err != nil {
|
||||||
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.ListUserNotifications(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.ListUserNotifications(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -1182,9 +1182,6 @@ func request_UserService_UpdateUserNotification_0(ctx context.Context, marshaler
|
||||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Notification); err != nil && !errors.Is(err, io.EOF) {
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Notification); 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.Notification); err != nil {
|
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Notification); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
|
@ -1206,6 +1203,9 @@ func request_UserService_UpdateUserNotification_0(ctx context.Context, marshaler
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserNotification_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUserNotification_0); err != nil {
|
||||||
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.UpdateUserNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.UpdateUserNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -1254,9 +1254,6 @@ func request_UserService_DeleteUserNotification_0(ctx context.Context, marshaler
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
|
||||||
}
|
|
||||||
val, ok := pathParams["name"]
|
val, ok := pathParams["name"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||||
|
|
@ -1265,6 +1262,9 @@ func request_UserService_DeleteUserNotification_0(ctx context.Context, marshaler
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||||
}
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
|
}
|
||||||
msg, err := client.DeleteUserNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteUserNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1941,15 +1941,15 @@ paths:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Status'
|
$ref: '#/components/schemas/Status'
|
||||||
/api/v1/users/{user}/shortcuts:
|
/api/v1/users/{user}/views:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- ShortcutService
|
- MemoViewService
|
||||||
description: |-
|
description: |-
|
||||||
ListShortcuts returns a user's saved shortcuts. Each shortcut is a named,
|
ListMemoViews returns a user's memo views. Each view is a named, reusable
|
||||||
reusable CEL filter (see Shortcut.filter); pass its filter string directly
|
CEL filter (see MemoView.filter); pass its filter string directly to the
|
||||||
to the ListMemos `filter` argument to reuse a saved view.
|
ListMemos `filter` argument.
|
||||||
operationId: ShortcutService_ListShortcuts
|
operationId: MemoViewService_ListMemoViews
|
||||||
parameters:
|
parameters:
|
||||||
- name: user
|
- name: user
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -1963,7 +1963,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ListShortcutsResponse'
|
$ref: '#/components/schemas/ListMemoViewsResponse'
|
||||||
default:
|
default:
|
||||||
description: Default error response
|
description: Default error response
|
||||||
content:
|
content:
|
||||||
|
|
@ -1972,9 +1972,9 @@ paths:
|
||||||
$ref: '#/components/schemas/Status'
|
$ref: '#/components/schemas/Status'
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- ShortcutService
|
- MemoViewService
|
||||||
description: CreateShortcut creates a new shortcut for a user.
|
description: CreateMemoView creates a new memo view for a user.
|
||||||
operationId: ShortcutService_CreateShortcut
|
operationId: MemoViewService_CreateMemoView
|
||||||
parameters:
|
parameters:
|
||||||
- name: user
|
- name: user
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -1984,14 +1984,14 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
- name: validateOnly
|
- name: validateOnly
|
||||||
in: query
|
in: query
|
||||||
description: Optional. If set, validate the request, but do not actually create the shortcut.
|
description: Optional. If set, validate the request, but do not actually create the memo view.
|
||||||
schema:
|
schema:
|
||||||
type: boolean
|
type: boolean
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Shortcut'
|
$ref: '#/components/schemas/MemoView'
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
|
|
@ -1999,19 +1999,19 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Shortcut'
|
$ref: '#/components/schemas/MemoView'
|
||||||
default:
|
default:
|
||||||
description: Default error response
|
description: Default error response
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Status'
|
$ref: '#/components/schemas/Status'
|
||||||
/api/v1/users/{user}/shortcuts/{shortcut}:
|
/api/v1/users/{user}/views/{view}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- ShortcutService
|
- MemoViewService
|
||||||
description: GetShortcut gets a shortcut by name.
|
description: GetMemoView gets a memo view by name.
|
||||||
operationId: ShortcutService_GetShortcut
|
operationId: MemoViewService_GetMemoView
|
||||||
parameters:
|
parameters:
|
||||||
- name: user
|
- name: user
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -2019,9 +2019,9 @@ paths:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: shortcut
|
- name: view
|
||||||
in: path
|
in: path
|
||||||
description: The shortcut id.
|
description: The view id.
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -2031,7 +2031,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Shortcut'
|
$ref: '#/components/schemas/MemoView'
|
||||||
default:
|
default:
|
||||||
description: Default error response
|
description: Default error response
|
||||||
content:
|
content:
|
||||||
|
|
@ -2040,9 +2040,9 @@ paths:
|
||||||
$ref: '#/components/schemas/Status'
|
$ref: '#/components/schemas/Status'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- ShortcutService
|
- MemoViewService
|
||||||
description: DeleteShortcut deletes a shortcut for a user.
|
description: DeleteMemoView deletes a memo view for a user.
|
||||||
operationId: ShortcutService_DeleteShortcut
|
operationId: MemoViewService_DeleteMemoView
|
||||||
parameters:
|
parameters:
|
||||||
- name: user
|
- name: user
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -2050,9 +2050,9 @@ paths:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: shortcut
|
- name: view
|
||||||
in: path
|
in: path
|
||||||
description: The shortcut id.
|
description: The view id.
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -2068,9 +2068,9 @@ paths:
|
||||||
$ref: '#/components/schemas/Status'
|
$ref: '#/components/schemas/Status'
|
||||||
patch:
|
patch:
|
||||||
tags:
|
tags:
|
||||||
- ShortcutService
|
- MemoViewService
|
||||||
description: UpdateShortcut updates a shortcut for a user.
|
description: UpdateMemoView updates a memo view for a user.
|
||||||
operationId: ShortcutService_UpdateShortcut
|
operationId: MemoViewService_UpdateMemoView
|
||||||
parameters:
|
parameters:
|
||||||
- name: user
|
- name: user
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -2078,9 +2078,9 @@ paths:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: shortcut
|
- name: view
|
||||||
in: path
|
in: path
|
||||||
description: The shortcut id.
|
description: The view id.
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -2094,7 +2094,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Shortcut'
|
$ref: '#/components/schemas/MemoView'
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
|
|
@ -2102,7 +2102,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Shortcut'
|
$ref: '#/components/schemas/MemoView'
|
||||||
default:
|
default:
|
||||||
description: Default error response
|
description: Default error response
|
||||||
content:
|
content:
|
||||||
|
|
@ -3129,6 +3129,14 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/MemoShare'
|
$ref: '#/components/schemas/MemoShare'
|
||||||
description: The list of share links.
|
description: The list of share links.
|
||||||
|
ListMemoViewsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
memoViews:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MemoView'
|
||||||
|
description: The list of memo views.
|
||||||
ListMemosResponse:
|
ListMemosResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -3153,14 +3161,6 @@ components:
|
||||||
nextPageToken:
|
nextPageToken:
|
||||||
type: string
|
type: string
|
||||||
description: A token for the next page of results.
|
description: A token for the next page of results.
|
||||||
ListShortcutsResponse:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
shortcuts:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Shortcut'
|
|
||||||
description: The list of shortcuts.
|
|
||||||
ListUserNotificationsResponse:
|
ListUserNotificationsResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -3373,6 +3373,25 @@ components:
|
||||||
If unset, the link never expires.
|
If unset, the link never expires.
|
||||||
format: date-time
|
format: date-time
|
||||||
description: MemoShare is an access grant that permits read-only access to a memo via an opaque bearer token.
|
description: MemoShare is an access grant that permits read-only access to a memo via an opaque bearer token.
|
||||||
|
MemoView:
|
||||||
|
required:
|
||||||
|
- title
|
||||||
|
- filter
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
The resource name of the memo view.
|
||||||
|
Format: users/{user}/views/{view}
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
description: The title of the memo view.
|
||||||
|
filter:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
The CEL filter expression for the memo view, using the same grammar as the
|
||||||
|
ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
||||||
Memo_Property:
|
Memo_Property:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -3562,24 +3581,6 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/MemoRelation'
|
$ref: '#/components/schemas/MemoRelation'
|
||||||
description: Required. The relations to set for the memo.
|
description: Required. The relations to set for the memo.
|
||||||
Shortcut:
|
|
||||||
required:
|
|
||||||
- title
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
description: |-
|
|
||||||
The resource name of the shortcut.
|
|
||||||
Format: users/{user}/shortcuts/{shortcut}
|
|
||||||
title:
|
|
||||||
type: string
|
|
||||||
description: The title of the shortcut.
|
|
||||||
filter:
|
|
||||||
type: string
|
|
||||||
description: |-
|
|
||||||
The CEL filter expression for the shortcut, using the same grammar as the
|
|
||||||
ListMemos `filter` argument. Reuse it by passing this value to ListMemos.
|
|
||||||
SignInRequest:
|
SignInRequest:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -4056,5 +4057,5 @@ tags:
|
||||||
- name: IdentityProviderService
|
- name: IdentityProviderService
|
||||||
- name: InstanceService
|
- name: InstanceService
|
||||||
- name: MemoService
|
- name: MemoService
|
||||||
- name: ShortcutService
|
- name: MemoViewService
|
||||||
- name: UserService
|
- name: UserService
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ const (
|
||||||
UserSetting_KEY_UNSPECIFIED UserSetting_Key = 0
|
UserSetting_KEY_UNSPECIFIED UserSetting_Key = 0
|
||||||
// General user settings.
|
// General user settings.
|
||||||
UserSetting_GENERAL UserSetting_Key = 1
|
UserSetting_GENERAL UserSetting_Key = 1
|
||||||
// The shortcuts of the user.
|
// The memo views of the user.
|
||||||
UserSetting_SHORTCUTS UserSetting_Key = 4
|
UserSetting_MEMO_VIEWS UserSetting_Key = 4
|
||||||
// The webhooks of the user.
|
// The webhooks of the user.
|
||||||
UserSetting_WEBHOOKS UserSetting_Key = 5
|
UserSetting_WEBHOOKS UserSetting_Key = 5
|
||||||
// Refresh tokens for the user.
|
// Refresh tokens for the user.
|
||||||
|
|
@ -46,7 +46,7 @@ var (
|
||||||
UserSetting_Key_name = map[int32]string{
|
UserSetting_Key_name = map[int32]string{
|
||||||
0: "KEY_UNSPECIFIED",
|
0: "KEY_UNSPECIFIED",
|
||||||
1: "GENERAL",
|
1: "GENERAL",
|
||||||
4: "SHORTCUTS",
|
4: "MEMO_VIEWS",
|
||||||
5: "WEBHOOKS",
|
5: "WEBHOOKS",
|
||||||
6: "REFRESH_TOKENS",
|
6: "REFRESH_TOKENS",
|
||||||
7: "PERSONAL_ACCESS_TOKENS",
|
7: "PERSONAL_ACCESS_TOKENS",
|
||||||
|
|
@ -55,7 +55,7 @@ var (
|
||||||
UserSetting_Key_value = map[string]int32{
|
UserSetting_Key_value = map[string]int32{
|
||||||
"KEY_UNSPECIFIED": 0,
|
"KEY_UNSPECIFIED": 0,
|
||||||
"GENERAL": 1,
|
"GENERAL": 1,
|
||||||
"SHORTCUTS": 4,
|
"MEMO_VIEWS": 4,
|
||||||
"WEBHOOKS": 5,
|
"WEBHOOKS": 5,
|
||||||
"REFRESH_TOKENS": 6,
|
"REFRESH_TOKENS": 6,
|
||||||
"PERSONAL_ACCESS_TOKENS": 7,
|
"PERSONAL_ACCESS_TOKENS": 7,
|
||||||
|
|
@ -97,7 +97,7 @@ type UserSetting struct {
|
||||||
// Types that are valid to be assigned to Value:
|
// Types that are valid to be assigned to Value:
|
||||||
//
|
//
|
||||||
// *UserSetting_General
|
// *UserSetting_General
|
||||||
// *UserSetting_Shortcuts
|
// *UserSetting_MemoViews
|
||||||
// *UserSetting_Webhooks
|
// *UserSetting_Webhooks
|
||||||
// *UserSetting_RefreshTokens
|
// *UserSetting_RefreshTokens
|
||||||
// *UserSetting_PersonalAccessTokens
|
// *UserSetting_PersonalAccessTokens
|
||||||
|
|
@ -167,10 +167,10 @@ func (x *UserSetting) GetGeneral() *GeneralUserSetting {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UserSetting) GetShortcuts() *ShortcutsUserSetting {
|
func (x *UserSetting) GetMemoViews() *MemoViewsUserSetting {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
if x, ok := x.Value.(*UserSetting_Shortcuts); ok {
|
if x, ok := x.Value.(*UserSetting_MemoViews); ok {
|
||||||
return x.Shortcuts
|
return x.MemoViews
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -220,8 +220,8 @@ type UserSetting_General struct {
|
||||||
General *GeneralUserSetting `protobuf:"bytes,3,opt,name=general,proto3,oneof"`
|
General *GeneralUserSetting `protobuf:"bytes,3,opt,name=general,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserSetting_Shortcuts struct {
|
type UserSetting_MemoViews struct {
|
||||||
Shortcuts *ShortcutsUserSetting `protobuf:"bytes,6,opt,name=shortcuts,proto3,oneof"`
|
MemoViews *MemoViewsUserSetting `protobuf:"bytes,6,opt,name=memo_views,json=memoViews,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserSetting_Webhooks struct {
|
type UserSetting_Webhooks struct {
|
||||||
|
|
@ -242,7 +242,7 @@ type UserSetting_Tags struct {
|
||||||
|
|
||||||
func (*UserSetting_General) isUserSetting_Value() {}
|
func (*UserSetting_General) isUserSetting_Value() {}
|
||||||
|
|
||||||
func (*UserSetting_Shortcuts) isUserSetting_Value() {}
|
func (*UserSetting_MemoViews) isUserSetting_Value() {}
|
||||||
|
|
||||||
func (*UserSetting_Webhooks) isUserSetting_Value() {}
|
func (*UserSetting_Webhooks) isUserSetting_Value() {}
|
||||||
|
|
||||||
|
|
@ -507,27 +507,27 @@ func (x *PersonalAccessTokensUserSetting) GetTokens() []*PersonalAccessTokensUse
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ShortcutsUserSetting struct {
|
type MemoViewsUserSetting struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Shortcuts []*ShortcutsUserSetting_Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"`
|
MemoViews []*MemoViewsUserSetting_MemoView `protobuf:"bytes,1,rep,name=memo_views,json=memoViews,proto3" json:"memo_views,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting) Reset() {
|
func (x *MemoViewsUserSetting) Reset() {
|
||||||
*x = ShortcutsUserSetting{}
|
*x = MemoViewsUserSetting{}
|
||||||
mi := &file_store_user_setting_proto_msgTypes[6]
|
mi := &file_store_user_setting_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting) String() string {
|
func (x *MemoViewsUserSetting) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ShortcutsUserSetting) ProtoMessage() {}
|
func (*MemoViewsUserSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting) ProtoReflect() protoreflect.Message {
|
func (x *MemoViewsUserSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_store_user_setting_proto_msgTypes[6]
|
mi := &file_store_user_setting_proto_msgTypes[6]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
|
@ -539,14 +539,14 @@ func (x *ShortcutsUserSetting) ProtoReflect() protoreflect.Message {
|
||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use ShortcutsUserSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use MemoViewsUserSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*ShortcutsUserSetting) Descriptor() ([]byte, []int) {
|
func (*MemoViewsUserSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_store_user_setting_proto_rawDescGZIP(), []int{6}
|
return file_store_user_setting_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting) GetShortcuts() []*ShortcutsUserSetting_Shortcut {
|
func (x *MemoViewsUserSetting) GetMemoViews() []*MemoViewsUserSetting_MemoView {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Shortcuts
|
return x.MemoViews
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -847,7 +847,7 @@ func (x *PersonalAccessTokensUserSetting_PersonalAccessToken) GetLastUsedAt() *t
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ShortcutsUserSetting_Shortcut struct {
|
type MemoViewsUserSetting_MemoView struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||||
|
|
@ -856,20 +856,20 @@ type ShortcutsUserSetting_Shortcut struct {
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) Reset() {
|
func (x *MemoViewsUserSetting_MemoView) Reset() {
|
||||||
*x = ShortcutsUserSetting_Shortcut{}
|
*x = MemoViewsUserSetting_MemoView{}
|
||||||
mi := &file_store_user_setting_proto_msgTypes[12]
|
mi := &file_store_user_setting_proto_msgTypes[12]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) String() string {
|
func (x *MemoViewsUserSetting_MemoView) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ShortcutsUserSetting_Shortcut) ProtoMessage() {}
|
func (*MemoViewsUserSetting_MemoView) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) ProtoReflect() protoreflect.Message {
|
func (x *MemoViewsUserSetting_MemoView) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_store_user_setting_proto_msgTypes[12]
|
mi := &file_store_user_setting_proto_msgTypes[12]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
|
@ -881,26 +881,26 @@ func (x *ShortcutsUserSetting_Shortcut) ProtoReflect() protoreflect.Message {
|
||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use ShortcutsUserSetting_Shortcut.ProtoReflect.Descriptor instead.
|
// Deprecated: Use MemoViewsUserSetting_MemoView.ProtoReflect.Descriptor instead.
|
||||||
func (*ShortcutsUserSetting_Shortcut) Descriptor() ([]byte, []int) {
|
func (*MemoViewsUserSetting_MemoView) Descriptor() ([]byte, []int) {
|
||||||
return file_store_user_setting_proto_rawDescGZIP(), []int{6, 0}
|
return file_store_user_setting_proto_rawDescGZIP(), []int{6, 0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) GetId() string {
|
func (x *MemoViewsUserSetting_MemoView) GetId() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Id
|
return x.Id
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) GetTitle() string {
|
func (x *MemoViewsUserSetting_MemoView) GetTitle() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Title
|
return x.Title
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShortcutsUserSetting_Shortcut) GetFilter() string {
|
func (x *MemoViewsUserSetting_MemoView) GetFilter() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Filter
|
return x.Filter
|
||||||
}
|
}
|
||||||
|
|
@ -983,21 +983,23 @@ var File_store_user_setting_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
const file_store_user_setting_proto_rawDesc = "" +
|
const file_store_user_setting_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\x18store/user_setting.proto\x12\vmemos.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/color.proto\"\x89\x05\n" +
|
"\x18store/user_setting.proto\x12\vmemos.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/color.proto\"\x8b\x05\n" +
|
||||||
"\vUserSetting\x12\x17\n" +
|
"\vUserSetting\x12\x17\n" +
|
||||||
"\auser_id\x18\x01 \x01(\x05R\x06userId\x12.\n" +
|
"\auser_id\x18\x01 \x01(\x05R\x06userId\x12.\n" +
|
||||||
"\x03key\x18\x02 \x01(\x0e2\x1c.memos.store.UserSetting.KeyR\x03key\x12;\n" +
|
"\x03key\x18\x02 \x01(\x0e2\x1c.memos.store.UserSetting.KeyR\x03key\x12;\n" +
|
||||||
"\ageneral\x18\x03 \x01(\v2\x1f.memos.store.GeneralUserSettingH\x00R\ageneral\x12A\n" +
|
"\ageneral\x18\x03 \x01(\v2\x1f.memos.store.GeneralUserSettingH\x00R\ageneral\x12B\n" +
|
||||||
"\tshortcuts\x18\x06 \x01(\v2!.memos.store.ShortcutsUserSettingH\x00R\tshortcuts\x12>\n" +
|
"\n" +
|
||||||
|
"memo_views\x18\x06 \x01(\v2!.memos.store.MemoViewsUserSettingH\x00R\tmemoViews\x12>\n" +
|
||||||
"\bwebhooks\x18\a \x01(\v2 .memos.store.WebhooksUserSettingH\x00R\bwebhooks\x12N\n" +
|
"\bwebhooks\x18\a \x01(\v2 .memos.store.WebhooksUserSettingH\x00R\bwebhooks\x12N\n" +
|
||||||
"\x0erefresh_tokens\x18\b \x01(\v2%.memos.store.RefreshTokensUserSettingH\x00R\rrefreshTokens\x12d\n" +
|
"\x0erefresh_tokens\x18\b \x01(\v2%.memos.store.RefreshTokensUserSettingH\x00R\rrefreshTokens\x12d\n" +
|
||||||
"\x16personal_access_tokens\x18\t \x01(\v2,.memos.store.PersonalAccessTokensUserSettingH\x00R\x14personalAccessTokens\x122\n" +
|
"\x16personal_access_tokens\x18\t \x01(\v2,.memos.store.PersonalAccessTokensUserSettingH\x00R\x14personalAccessTokens\x122\n" +
|
||||||
"\x04tags\x18\n" +
|
"\x04tags\x18\n" +
|
||||||
" \x01(\v2\x1c.memos.store.TagsUserSettingH\x00R\x04tags\"~\n" +
|
" \x01(\v2\x1c.memos.store.TagsUserSettingH\x00R\x04tags\"\x7f\n" +
|
||||||
"\x03Key\x12\x13\n" +
|
"\x03Key\x12\x13\n" +
|
||||||
"\x0fKEY_UNSPECIFIED\x10\x00\x12\v\n" +
|
"\x0fKEY_UNSPECIFIED\x10\x00\x12\v\n" +
|
||||||
"\aGENERAL\x10\x01\x12\r\n" +
|
"\aGENERAL\x10\x01\x12\x0e\n" +
|
||||||
"\tSHORTCUTS\x10\x04\x12\f\n" +
|
"\n" +
|
||||||
|
"MEMO_VIEWS\x10\x04\x12\f\n" +
|
||||||
"\bWEBHOOKS\x10\x05\x12\x12\n" +
|
"\bWEBHOOKS\x10\x05\x12\x12\n" +
|
||||||
"\x0eREFRESH_TOKENS\x10\x06\x12\x1a\n" +
|
"\x0eREFRESH_TOKENS\x10\x06\x12\x1a\n" +
|
||||||
"\x16PERSONAL_ACCESS_TOKENS\x10\a\x12\b\n" +
|
"\x16PERSONAL_ACCESS_TOKENS\x10\a\x12\b\n" +
|
||||||
|
|
@ -1048,10 +1050,11 @@ const file_store_user_setting_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12<\n" +
|
"created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12<\n" +
|
||||||
"\flast_used_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
"\flast_used_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
||||||
"lastUsedAt\"\xaa\x01\n" +
|
"lastUsedAt\"\xab\x01\n" +
|
||||||
"\x14ShortcutsUserSetting\x12H\n" +
|
"\x14MemoViewsUserSetting\x12I\n" +
|
||||||
"\tshortcuts\x18\x01 \x03(\v2*.memos.store.ShortcutsUserSetting.ShortcutR\tshortcuts\x1aH\n" +
|
"\n" +
|
||||||
"\bShortcut\x12\x0e\n" +
|
"memo_views\x18\x01 \x03(\v2*.memos.store.MemoViewsUserSetting.MemoViewR\tmemoViews\x1aH\n" +
|
||||||
|
"\bMemoView\x12\x0e\n" +
|
||||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" +
|
"\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" +
|
||||||
"\x05title\x18\x02 \x01(\tR\x05title\x12\x16\n" +
|
"\x05title\x18\x02 \x01(\tR\x05title\x12\x16\n" +
|
||||||
"\x06filter\x18\x03 \x01(\tR\x06filter\"\xc5\x01\n" +
|
"\x06filter\x18\x03 \x01(\tR\x06filter\"\xc5\x01\n" +
|
||||||
|
|
@ -1086,13 +1089,13 @@ var file_store_user_setting_proto_goTypes = []any{
|
||||||
(*TagsUserSetting)(nil), // 4: memos.store.TagsUserSetting
|
(*TagsUserSetting)(nil), // 4: memos.store.TagsUserSetting
|
||||||
(*RefreshTokensUserSetting)(nil), // 5: memos.store.RefreshTokensUserSetting
|
(*RefreshTokensUserSetting)(nil), // 5: memos.store.RefreshTokensUserSetting
|
||||||
(*PersonalAccessTokensUserSetting)(nil), // 6: memos.store.PersonalAccessTokensUserSetting
|
(*PersonalAccessTokensUserSetting)(nil), // 6: memos.store.PersonalAccessTokensUserSetting
|
||||||
(*ShortcutsUserSetting)(nil), // 7: memos.store.ShortcutsUserSetting
|
(*MemoViewsUserSetting)(nil), // 7: memos.store.MemoViewsUserSetting
|
||||||
(*WebhooksUserSetting)(nil), // 8: memos.store.WebhooksUserSetting
|
(*WebhooksUserSetting)(nil), // 8: memos.store.WebhooksUserSetting
|
||||||
nil, // 9: memos.store.TagsUserSetting.TagsEntry
|
nil, // 9: memos.store.TagsUserSetting.TagsEntry
|
||||||
(*RefreshTokensUserSetting_RefreshToken)(nil), // 10: memos.store.RefreshTokensUserSetting.RefreshToken
|
(*RefreshTokensUserSetting_RefreshToken)(nil), // 10: memos.store.RefreshTokensUserSetting.RefreshToken
|
||||||
(*RefreshTokensUserSetting_ClientInfo)(nil), // 11: memos.store.RefreshTokensUserSetting.ClientInfo
|
(*RefreshTokensUserSetting_ClientInfo)(nil), // 11: memos.store.RefreshTokensUserSetting.ClientInfo
|
||||||
(*PersonalAccessTokensUserSetting_PersonalAccessToken)(nil), // 12: memos.store.PersonalAccessTokensUserSetting.PersonalAccessToken
|
(*PersonalAccessTokensUserSetting_PersonalAccessToken)(nil), // 12: memos.store.PersonalAccessTokensUserSetting.PersonalAccessToken
|
||||||
(*ShortcutsUserSetting_Shortcut)(nil), // 13: memos.store.ShortcutsUserSetting.Shortcut
|
(*MemoViewsUserSetting_MemoView)(nil), // 13: memos.store.MemoViewsUserSetting.MemoView
|
||||||
(*WebhooksUserSetting_Webhook)(nil), // 14: memos.store.WebhooksUserSetting.Webhook
|
(*WebhooksUserSetting_Webhook)(nil), // 14: memos.store.WebhooksUserSetting.Webhook
|
||||||
(*color.Color)(nil), // 15: google.type.Color
|
(*color.Color)(nil), // 15: google.type.Color
|
||||||
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
|
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
|
||||||
|
|
@ -1100,7 +1103,7 @@ var file_store_user_setting_proto_goTypes = []any{
|
||||||
var file_store_user_setting_proto_depIdxs = []int32{
|
var file_store_user_setting_proto_depIdxs = []int32{
|
||||||
0, // 0: memos.store.UserSetting.key:type_name -> memos.store.UserSetting.Key
|
0, // 0: memos.store.UserSetting.key:type_name -> memos.store.UserSetting.Key
|
||||||
2, // 1: memos.store.UserSetting.general:type_name -> memos.store.GeneralUserSetting
|
2, // 1: memos.store.UserSetting.general:type_name -> memos.store.GeneralUserSetting
|
||||||
7, // 2: memos.store.UserSetting.shortcuts:type_name -> memos.store.ShortcutsUserSetting
|
7, // 2: memos.store.UserSetting.memo_views:type_name -> memos.store.MemoViewsUserSetting
|
||||||
8, // 3: memos.store.UserSetting.webhooks:type_name -> memos.store.WebhooksUserSetting
|
8, // 3: memos.store.UserSetting.webhooks:type_name -> memos.store.WebhooksUserSetting
|
||||||
5, // 4: memos.store.UserSetting.refresh_tokens:type_name -> memos.store.RefreshTokensUserSetting
|
5, // 4: memos.store.UserSetting.refresh_tokens:type_name -> memos.store.RefreshTokensUserSetting
|
||||||
6, // 5: memos.store.UserSetting.personal_access_tokens:type_name -> memos.store.PersonalAccessTokensUserSetting
|
6, // 5: memos.store.UserSetting.personal_access_tokens:type_name -> memos.store.PersonalAccessTokensUserSetting
|
||||||
|
|
@ -1109,7 +1112,7 @@ var file_store_user_setting_proto_depIdxs = []int32{
|
||||||
9, // 8: memos.store.TagsUserSetting.tags:type_name -> memos.store.TagsUserSetting.TagsEntry
|
9, // 8: memos.store.TagsUserSetting.tags:type_name -> memos.store.TagsUserSetting.TagsEntry
|
||||||
10, // 9: memos.store.RefreshTokensUserSetting.refresh_tokens:type_name -> memos.store.RefreshTokensUserSetting.RefreshToken
|
10, // 9: memos.store.RefreshTokensUserSetting.refresh_tokens:type_name -> memos.store.RefreshTokensUserSetting.RefreshToken
|
||||||
12, // 10: memos.store.PersonalAccessTokensUserSetting.tokens:type_name -> memos.store.PersonalAccessTokensUserSetting.PersonalAccessToken
|
12, // 10: memos.store.PersonalAccessTokensUserSetting.tokens:type_name -> memos.store.PersonalAccessTokensUserSetting.PersonalAccessToken
|
||||||
13, // 11: memos.store.ShortcutsUserSetting.shortcuts:type_name -> memos.store.ShortcutsUserSetting.Shortcut
|
13, // 11: memos.store.MemoViewsUserSetting.memo_views:type_name -> memos.store.MemoViewsUserSetting.MemoView
|
||||||
14, // 12: memos.store.WebhooksUserSetting.webhooks:type_name -> memos.store.WebhooksUserSetting.Webhook
|
14, // 12: memos.store.WebhooksUserSetting.webhooks:type_name -> memos.store.WebhooksUserSetting.Webhook
|
||||||
3, // 13: memos.store.TagsUserSetting.TagsEntry.value:type_name -> memos.store.UserTagMetadata
|
3, // 13: memos.store.TagsUserSetting.TagsEntry.value:type_name -> memos.store.UserTagMetadata
|
||||||
16, // 14: memos.store.RefreshTokensUserSetting.RefreshToken.expires_at:type_name -> google.protobuf.Timestamp
|
16, // 14: memos.store.RefreshTokensUserSetting.RefreshToken.expires_at:type_name -> google.protobuf.Timestamp
|
||||||
|
|
@ -1132,7 +1135,7 @@ func file_store_user_setting_proto_init() {
|
||||||
}
|
}
|
||||||
file_store_user_setting_proto_msgTypes[0].OneofWrappers = []any{
|
file_store_user_setting_proto_msgTypes[0].OneofWrappers = []any{
|
||||||
(*UserSetting_General)(nil),
|
(*UserSetting_General)(nil),
|
||||||
(*UserSetting_Shortcuts)(nil),
|
(*UserSetting_MemoViews)(nil),
|
||||||
(*UserSetting_Webhooks)(nil),
|
(*UserSetting_Webhooks)(nil),
|
||||||
(*UserSetting_RefreshTokens)(nil),
|
(*UserSetting_RefreshTokens)(nil),
|
||||||
(*UserSetting_PersonalAccessTokens)(nil),
|
(*UserSetting_PersonalAccessTokens)(nil),
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ message UserSetting {
|
||||||
KEY_UNSPECIFIED = 0;
|
KEY_UNSPECIFIED = 0;
|
||||||
// General user settings.
|
// General user settings.
|
||||||
GENERAL = 1;
|
GENERAL = 1;
|
||||||
// The shortcuts of the user.
|
// The memo views of the user.
|
||||||
SHORTCUTS = 4;
|
MEMO_VIEWS = 4;
|
||||||
// The webhooks of the user.
|
// The webhooks of the user.
|
||||||
WEBHOOKS = 5;
|
WEBHOOKS = 5;
|
||||||
// Refresh tokens for the user.
|
// Refresh tokens for the user.
|
||||||
|
|
@ -29,7 +29,7 @@ message UserSetting {
|
||||||
Key key = 2;
|
Key key = 2;
|
||||||
oneof value {
|
oneof value {
|
||||||
GeneralUserSetting general = 3;
|
GeneralUserSetting general = 3;
|
||||||
ShortcutsUserSetting shortcuts = 6;
|
MemoViewsUserSetting memo_views = 6;
|
||||||
WebhooksUserSetting webhooks = 7;
|
WebhooksUserSetting webhooks = 7;
|
||||||
RefreshTokensUserSetting refresh_tokens = 8;
|
RefreshTokensUserSetting refresh_tokens = 8;
|
||||||
PersonalAccessTokensUserSetting personal_access_tokens = 9;
|
PersonalAccessTokensUserSetting personal_access_tokens = 9;
|
||||||
|
|
@ -111,13 +111,13 @@ message PersonalAccessTokensUserSetting {
|
||||||
repeated PersonalAccessToken tokens = 1;
|
repeated PersonalAccessToken tokens = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShortcutsUserSetting {
|
message MemoViewsUserSetting {
|
||||||
message Shortcut {
|
message MemoView {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string title = 2;
|
string title = 2;
|
||||||
string filter = 3;
|
string filter = 3;
|
||||||
}
|
}
|
||||||
repeated Shortcut shortcuts = 1;
|
repeated MemoView memo_views = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WebhooksUserSetting {
|
message WebhooksUserSetting {
|
||||||
|
|
|
||||||
|
|
@ -59,11 +59,12 @@ func TestProtectedMethodsRequireAuth(t *testing.T) {
|
||||||
// Attachment Service - write operations
|
// Attachment Service - write operations
|
||||||
"/memos.api.v1.AttachmentService/CreateAttachment",
|
"/memos.api.v1.AttachmentService/CreateAttachment",
|
||||||
"/memos.api.v1.AttachmentService/DeleteAttachment",
|
"/memos.api.v1.AttachmentService/DeleteAttachment",
|
||||||
// Shortcut Service
|
// Memo View Service
|
||||||
"/memos.api.v1.ShortcutService/CreateShortcut",
|
"/memos.api.v1.MemoViewService/CreateMemoView",
|
||||||
"/memos.api.v1.ShortcutService/ListShortcuts",
|
"/memos.api.v1.MemoViewService/GetMemoView",
|
||||||
"/memos.api.v1.ShortcutService/UpdateShortcut",
|
"/memos.api.v1.MemoViewService/ListMemoViews",
|
||||||
"/memos.api.v1.ShortcutService/DeleteShortcut",
|
"/memos.api.v1.MemoViewService/UpdateMemoView",
|
||||||
|
"/memos.api.v1.MemoViewService/DeleteMemoView",
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, method := range protectedMethods {
|
for _, method := range protectedMethods {
|
||||||
|
|
|
||||||
|
|
@ -400,17 +400,7 @@ func (s *APIV1Service) validateAttachmentFilter(ctx context.Context, filterStr s
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var dialect filter.DialectName
|
if _, err := engine.CompileToStatement(ctx, filterStr, filter.RenderOptions{Dialect: s.filterDialect()}); err != nil {
|
||||||
switch s.Profile.Driver {
|
|
||||||
case "mysql":
|
|
||||||
dialect = filter.DialectMySQL
|
|
||||||
case "postgres":
|
|
||||||
dialect = filter.DialectPostgres
|
|
||||||
default:
|
|
||||||
dialect = filter.DialectSQLite
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := engine.CompileToStatement(ctx, filterStr, filter.RenderOptions{Dialect: dialect}); err != nil {
|
|
||||||
return errors.Wrap(err, "failed to compile filter")
|
return errors.Wrap(err, "failed to compile filter")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ func (s *ConnectServiceHandler) RegisterConnectHandlers(mux *http.ServeMux, opts
|
||||||
wrap(apiv1connect.NewMemoServiceHandler(s, opts...)),
|
wrap(apiv1connect.NewMemoServiceHandler(s, opts...)),
|
||||||
wrap(apiv1connect.NewAttachmentServiceHandler(s, opts...)),
|
wrap(apiv1connect.NewAttachmentServiceHandler(s, opts...)),
|
||||||
wrap(apiv1connect.NewAIServiceHandler(s, opts...)),
|
wrap(apiv1connect.NewAIServiceHandler(s, opts...)),
|
||||||
wrap(apiv1connect.NewShortcutServiceHandler(s, opts...)),
|
wrap(apiv1connect.NewMemoViewServiceHandler(s, opts...)),
|
||||||
wrap(apiv1connect.NewIdentityProviderServiceHandler(s, opts...)),
|
wrap(apiv1connect.NewIdentityProviderServiceHandler(s, opts...)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -523,42 +523,47 @@ func (s *ConnectServiceHandler) Transcribe(ctx context.Context, req *connect.Req
|
||||||
return connect.NewResponse(resp), nil
|
return connect.NewResponse(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortcutService
|
// MemoViewService
|
||||||
|
|
||||||
func (s *ConnectServiceHandler) ListShortcuts(ctx context.Context, req *connect.Request[v1pb.ListShortcutsRequest]) (*connect.Response[v1pb.ListShortcutsResponse], error) {
|
// ListMemoViews lists the saved memo views owned by a user.
|
||||||
resp, err := s.APIV1Service.ListShortcuts(ctx, req.Msg)
|
func (s *ConnectServiceHandler) ListMemoViews(ctx context.Context, req *connect.Request[v1pb.ListMemoViewsRequest]) (*connect.Response[v1pb.ListMemoViewsResponse], error) {
|
||||||
|
resp, err := s.APIV1Service.ListMemoViews(ctx, req.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, convertGRPCError(err)
|
return nil, convertGRPCError(err)
|
||||||
}
|
}
|
||||||
return connect.NewResponse(resp), nil
|
return connect.NewResponse(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ConnectServiceHandler) GetShortcut(ctx context.Context, req *connect.Request[v1pb.GetShortcutRequest]) (*connect.Response[v1pb.Shortcut], error) {
|
// GetMemoView returns a saved memo view by resource name.
|
||||||
resp, err := s.APIV1Service.GetShortcut(ctx, req.Msg)
|
func (s *ConnectServiceHandler) GetMemoView(ctx context.Context, req *connect.Request[v1pb.GetMemoViewRequest]) (*connect.Response[v1pb.MemoView], error) {
|
||||||
|
resp, err := s.APIV1Service.GetMemoView(ctx, req.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, convertGRPCError(err)
|
return nil, convertGRPCError(err)
|
||||||
}
|
}
|
||||||
return connect.NewResponse(resp), nil
|
return connect.NewResponse(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ConnectServiceHandler) CreateShortcut(ctx context.Context, req *connect.Request[v1pb.CreateShortcutRequest]) (*connect.Response[v1pb.Shortcut], error) {
|
// CreateMemoView creates a saved memo view for a user.
|
||||||
resp, err := s.APIV1Service.CreateShortcut(ctx, req.Msg)
|
func (s *ConnectServiceHandler) CreateMemoView(ctx context.Context, req *connect.Request[v1pb.CreateMemoViewRequest]) (*connect.Response[v1pb.MemoView], error) {
|
||||||
|
resp, err := s.APIV1Service.CreateMemoView(ctx, req.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, convertGRPCError(err)
|
return nil, convertGRPCError(err)
|
||||||
}
|
}
|
||||||
return connect.NewResponse(resp), nil
|
return connect.NewResponse(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ConnectServiceHandler) UpdateShortcut(ctx context.Context, req *connect.Request[v1pb.UpdateShortcutRequest]) (*connect.Response[v1pb.Shortcut], error) {
|
// UpdateMemoView updates the selected fields of a saved memo view.
|
||||||
resp, err := s.APIV1Service.UpdateShortcut(ctx, req.Msg)
|
func (s *ConnectServiceHandler) UpdateMemoView(ctx context.Context, req *connect.Request[v1pb.UpdateMemoViewRequest]) (*connect.Response[v1pb.MemoView], error) {
|
||||||
|
resp, err := s.APIV1Service.UpdateMemoView(ctx, req.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, convertGRPCError(err)
|
return nil, convertGRPCError(err)
|
||||||
}
|
}
|
||||||
return connect.NewResponse(resp), nil
|
return connect.NewResponse(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ConnectServiceHandler) DeleteShortcut(ctx context.Context, req *connect.Request[v1pb.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error) {
|
// DeleteMemoView deletes a saved memo view by resource name.
|
||||||
resp, err := s.APIV1Service.DeleteShortcut(ctx, req.Msg)
|
func (s *ConnectServiceHandler) DeleteMemoView(ctx context.Context, req *connect.Request[v1pb.DeleteMemoViewRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||||
|
resp, err := s.APIV1Service.DeleteMemoView(ctx, req.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, convertGRPCError(err)
|
return nil, convertGRPCError(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
250
server/router/api/v1/memo_view_service.go
Normal file
250
server/router/api/v1/memo_view_service.go
Normal file
|
|
@ -0,0 +1,250 @@
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
|
||||||
|
"github.com/usememos/memos/internal/filter"
|
||||||
|
"github.com/usememos/memos/internal/util"
|
||||||
|
v1pb "github.com/usememos/memos/proto/gen/api/v1"
|
||||||
|
storepb "github.com/usememos/memos/proto/gen/store"
|
||||||
|
"github.com/usememos/memos/store"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Helper function to extract user and memo view ID from a memo view resource name.
|
||||||
|
// Format: users/{user}/views/{view}.
|
||||||
|
func (s *APIV1Service) extractUserAndMemoViewIDFromName(ctx context.Context, name string) (*store.User, string, error) {
|
||||||
|
parts := strings.Split(name, "/")
|
||||||
|
if len(parts) != 4 || parts[0] != "users" || parts[2] != "views" {
|
||||||
|
return nil, "", errors.Errorf("invalid memo view name format: %s", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
user, err := ResolveUserByName(ctx, s.Store, BuildUserName(parts[1]))
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
if user == nil {
|
||||||
|
return nil, "", errors.Errorf("user not found: %s", parts[1])
|
||||||
|
}
|
||||||
|
|
||||||
|
memoViewID := parts[3]
|
||||||
|
if memoViewID == "" {
|
||||||
|
return nil, "", errors.Errorf("empty memo view ID in name: %s", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
return user, memoViewID, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to construct a memo view resource name.
|
||||||
|
func constructMemoViewName(username string, memoViewID string) string {
|
||||||
|
return fmt.Sprintf("%s/views/%s", BuildUserName(username), memoViewID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func convertMemoViewFromStore(username string, memoView *storepb.MemoViewsUserSetting_MemoView) *v1pb.MemoView {
|
||||||
|
return &v1pb.MemoView{
|
||||||
|
Name: constructMemoViewName(username, memoView.GetId()),
|
||||||
|
Title: memoView.GetTitle(),
|
||||||
|
Filter: memoView.GetFilter(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// authorizeMemoViewAccess resolves the owner of a memo view collection and asserts that
|
||||||
|
// the caller is that owner.
|
||||||
|
func (s *APIV1Service) authorizeMemoViewAccess(ctx context.Context, user *store.User) error {
|
||||||
|
currentUser, err := s.fetchCurrentUser(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
||||||
|
}
|
||||||
|
if currentUser == nil {
|
||||||
|
return status.Errorf(codes.Unauthenticated, "user not authenticated")
|
||||||
|
}
|
||||||
|
if currentUser.ID != user.ID {
|
||||||
|
return status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListMemoViews lists the saved memo views owned by a user.
|
||||||
|
func (s *APIV1Service) ListMemoViews(ctx context.Context, request *v1pb.ListMemoViewsRequest) (*v1pb.ListMemoViewsResponse, error) {
|
||||||
|
user, err := ResolveUserByName(ctx, s.Store, request.Parent)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
||||||
|
}
|
||||||
|
if user == nil {
|
||||||
|
return nil, status.Errorf(codes.NotFound, "user not found")
|
||||||
|
}
|
||||||
|
if err := s.authorizeMemoViewAccess(ctx, user); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
storeMemoViews, err := s.Store.GetUserMemoViews(ctx, user.ID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to get memo views: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
memoViews := []*v1pb.MemoView{}
|
||||||
|
for _, memoView := range storeMemoViews {
|
||||||
|
memoViews = append(memoViews, convertMemoViewFromStore(user.Username, memoView))
|
||||||
|
}
|
||||||
|
|
||||||
|
return &v1pb.ListMemoViewsResponse{
|
||||||
|
MemoViews: memoViews,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMemoView returns a saved memo view by resource name.
|
||||||
|
func (s *APIV1Service) GetMemoView(ctx context.Context, request *v1pb.GetMemoViewRequest) (*v1pb.MemoView, error) {
|
||||||
|
user, memoViewID, err := s.extractUserAndMemoViewIDFromName(ctx, request.Name)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid memo view name: %v", err)
|
||||||
|
}
|
||||||
|
if err := s.authorizeMemoViewAccess(ctx, user); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
memoViews, err := s.Store.GetUserMemoViews(ctx, user.ID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to get memo views: %v", err)
|
||||||
|
}
|
||||||
|
for _, memoView := range memoViews {
|
||||||
|
if memoView.GetId() == memoViewID {
|
||||||
|
return convertMemoViewFromStore(user.Username, memoView), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, status.Errorf(codes.NotFound, "memo view not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateMemoView creates a saved memo view for a user.
|
||||||
|
func (s *APIV1Service) CreateMemoView(ctx context.Context, request *v1pb.CreateMemoViewRequest) (*v1pb.MemoView, error) {
|
||||||
|
user, err := ResolveUserByName(ctx, s.Store, request.Parent)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
||||||
|
}
|
||||||
|
if user == nil {
|
||||||
|
return nil, status.Errorf(codes.NotFound, "user not found")
|
||||||
|
}
|
||||||
|
if err := s.authorizeMemoViewAccess(ctx, user); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
newMemoView := &storepb.MemoViewsUserSetting_MemoView{
|
||||||
|
Id: util.GenUUID(),
|
||||||
|
Title: request.GetMemoView().GetTitle(),
|
||||||
|
Filter: request.GetMemoView().GetFilter(),
|
||||||
|
}
|
||||||
|
if newMemoView.Title == "" {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "title is required")
|
||||||
|
}
|
||||||
|
if err := s.validateFilter(ctx, newMemoView.Filter); err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid filter: %v", err)
|
||||||
|
}
|
||||||
|
if request.ValidateOnly {
|
||||||
|
return convertMemoViewFromStore(user.Username, newMemoView), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.Store.AddUserMemoView(ctx, user.ID, newMemoView); err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to create memo view: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertMemoViewFromStore(user.Username, newMemoView), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateMemoView updates the selected fields of a saved memo view.
|
||||||
|
func (s *APIV1Service) UpdateMemoView(ctx context.Context, request *v1pb.UpdateMemoViewRequest) (*v1pb.MemoView, error) {
|
||||||
|
user, memoViewID, err := s.extractUserAndMemoViewIDFromName(ctx, request.GetMemoView().GetName())
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid memo view name: %v", err)
|
||||||
|
}
|
||||||
|
if err := s.authorizeMemoViewAccess(ctx, user); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "update mask is required")
|
||||||
|
}
|
||||||
|
|
||||||
|
var title, filterValue *string
|
||||||
|
for _, field := range request.UpdateMask.Paths {
|
||||||
|
switch field {
|
||||||
|
case "title":
|
||||||
|
if request.GetMemoView().GetTitle() == "" {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "title is required")
|
||||||
|
}
|
||||||
|
value := request.GetMemoView().GetTitle()
|
||||||
|
title = &value
|
||||||
|
case "filter":
|
||||||
|
if err := s.validateFilter(ctx, request.GetMemoView().GetFilter()); err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid filter: %v", err)
|
||||||
|
}
|
||||||
|
value := request.GetMemoView().GetFilter()
|
||||||
|
filterValue = &value
|
||||||
|
default:
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "unsupported update mask path: %s", field)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updatedMemoView, err := s.Store.UpdateUserMemoView(ctx, user.ID, memoViewID, title, filterValue)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to update memo view: %v", err)
|
||||||
|
}
|
||||||
|
if updatedMemoView == nil {
|
||||||
|
return nil, status.Errorf(codes.NotFound, "memo view not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertMemoViewFromStore(user.Username, updatedMemoView), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteMemoView deletes a saved memo view by resource name.
|
||||||
|
func (s *APIV1Service) DeleteMemoView(ctx context.Context, request *v1pb.DeleteMemoViewRequest) (*emptypb.Empty, error) {
|
||||||
|
user, memoViewID, err := s.extractUserAndMemoViewIDFromName(ctx, request.Name)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "invalid memo view name: %v", err)
|
||||||
|
}
|
||||||
|
if err := s.authorizeMemoViewAccess(ctx, user); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
found, err := s.Store.RemoveUserMemoView(ctx, user.ID, memoViewID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to delete memo view: %v", err)
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, status.Errorf(codes.NotFound, "memo view not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
return &emptypb.Empty{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *APIV1Service) validateFilter(ctx context.Context, filterStr string) error {
|
||||||
|
if filterStr == "" {
|
||||||
|
return errors.New("filter cannot be empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
engine, err := filter.DefaultEngine()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := engine.CompileToStatement(ctx, filterStr, filter.RenderOptions{Dialect: s.filterDialect()}); err != nil {
|
||||||
|
return errors.Wrap(err, "failed to compile filter")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// filterDialect maps the configured database driver onto the filter engine dialect.
|
||||||
|
func (s *APIV1Service) filterDialect() filter.DialectName {
|
||||||
|
switch s.Profile.Driver {
|
||||||
|
case "mysql":
|
||||||
|
return filter.DialectMySQL
|
||||||
|
case "postgres":
|
||||||
|
return filter.DialectPostgres
|
||||||
|
default:
|
||||||
|
return filter.DialectSQLite
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,360 +0,0 @@
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"google.golang.org/grpc/codes"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
|
|
||||||
"github.com/usememos/memos/internal/filter"
|
|
||||||
"github.com/usememos/memos/internal/util"
|
|
||||||
v1pb "github.com/usememos/memos/proto/gen/api/v1"
|
|
||||||
storepb "github.com/usememos/memos/proto/gen/store"
|
|
||||||
"github.com/usememos/memos/store"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Helper function to extract user and shortcut ID from shortcut resource name.
|
|
||||||
// Format: users/{user}/shortcuts/{shortcut}.
|
|
||||||
func (s *APIV1Service) extractUserAndShortcutIDFromName(ctx context.Context, name string) (*store.User, string, error) {
|
|
||||||
parts := strings.Split(name, "/")
|
|
||||||
if len(parts) != 4 || parts[0] != "users" || parts[2] != "shortcuts" {
|
|
||||||
return nil, "", errors.Errorf("invalid shortcut name format: %s", name)
|
|
||||||
}
|
|
||||||
|
|
||||||
user, err := ResolveUserByName(ctx, s.Store, BuildUserName(parts[1]))
|
|
||||||
if err != nil {
|
|
||||||
return nil, "", err
|
|
||||||
}
|
|
||||||
if user == nil {
|
|
||||||
return nil, "", errors.Errorf("user not found: %s", parts[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutID := parts[3]
|
|
||||||
if shortcutID == "" {
|
|
||||||
return nil, "", errors.Errorf("empty shortcut ID in name: %s", name)
|
|
||||||
}
|
|
||||||
|
|
||||||
return user, shortcutID, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper function to construct shortcut resource name.
|
|
||||||
func constructShortcutName(username string, shortcutID string) string {
|
|
||||||
return fmt.Sprintf("%s/shortcuts/%s", BuildUserName(username), shortcutID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) ListShortcuts(ctx context.Context, request *v1pb.ListShortcutsRequest) (*v1pb.ListShortcutsResponse, error) {
|
|
||||||
user, err := ResolveUserByName(ctx, s.Store, request.Parent)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
||||||
}
|
|
||||||
if user == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "user not found")
|
|
||||||
}
|
|
||||||
userID := user.ID
|
|
||||||
|
|
||||||
currentUser, err := s.fetchCurrentUser(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
||||||
}
|
|
||||||
if currentUser == nil || currentUser.ID != userID {
|
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
|
||||||
}
|
|
||||||
|
|
||||||
userSetting, err := s.Store.GetUserSetting(ctx, &store.FindUserSetting{
|
|
||||||
UserID: &userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get user setting: %v", err)
|
|
||||||
}
|
|
||||||
if userSetting == nil {
|
|
||||||
return &v1pb.ListShortcutsResponse{
|
|
||||||
Shortcuts: []*v1pb.Shortcut{},
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
|
||||||
shortcuts := []*v1pb.Shortcut{}
|
|
||||||
for _, shortcut := range shortcutsUserSetting.GetShortcuts() {
|
|
||||||
shortcuts = append(shortcuts, &v1pb.Shortcut{
|
|
||||||
Name: constructShortcutName(user.Username, shortcut.GetId()),
|
|
||||||
Title: shortcut.GetTitle(),
|
|
||||||
Filter: shortcut.GetFilter(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1pb.ListShortcutsResponse{
|
|
||||||
Shortcuts: shortcuts,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) GetShortcut(ctx context.Context, request *v1pb.GetShortcutRequest) (*v1pb.Shortcut, error) {
|
|
||||||
user, shortcutID, err := s.extractUserAndShortcutIDFromName(ctx, request.Name)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid shortcut name: %v", err)
|
|
||||||
}
|
|
||||||
userID := user.ID
|
|
||||||
|
|
||||||
currentUser, err := s.fetchCurrentUser(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
||||||
}
|
|
||||||
if currentUser == nil || currentUser.ID != userID {
|
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
|
||||||
}
|
|
||||||
|
|
||||||
userSetting, err := s.Store.GetUserSetting(ctx, &store.FindUserSetting{
|
|
||||||
UserID: &userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if userSetting == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
|
||||||
for _, shortcut := range shortcutsUserSetting.GetShortcuts() {
|
|
||||||
if shortcut.GetId() == shortcutID {
|
|
||||||
return &v1pb.Shortcut{
|
|
||||||
Name: constructShortcutName(user.Username, shortcut.GetId()),
|
|
||||||
Title: shortcut.GetTitle(),
|
|
||||||
Filter: shortcut.GetFilter(),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateShortcutRequest) (*v1pb.Shortcut, error) {
|
|
||||||
user, err := ResolveUserByName(ctx, s.Store, request.Parent)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
||||||
}
|
|
||||||
if user == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "user not found")
|
|
||||||
}
|
|
||||||
userID := user.ID
|
|
||||||
|
|
||||||
currentUser, err := s.fetchCurrentUser(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
||||||
}
|
|
||||||
if currentUser == nil || currentUser.ID != userID {
|
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
|
||||||
}
|
|
||||||
|
|
||||||
newShortcut := &storepb.ShortcutsUserSetting_Shortcut{
|
|
||||||
Id: util.GenUUID(),
|
|
||||||
Title: request.Shortcut.GetTitle(),
|
|
||||||
Filter: request.Shortcut.GetFilter(),
|
|
||||||
}
|
|
||||||
if newShortcut.Title == "" {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "title is required")
|
|
||||||
}
|
|
||||||
if err := s.validateFilter(ctx, newShortcut.Filter); err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid filter: %v", err)
|
|
||||||
}
|
|
||||||
if request.ValidateOnly {
|
|
||||||
return &v1pb.Shortcut{
|
|
||||||
Name: constructShortcutName(user.Username, newShortcut.GetId()),
|
|
||||||
Title: newShortcut.GetTitle(),
|
|
||||||
Filter: newShortcut.GetFilter(),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
userSetting, err := s.Store.GetUserSetting(ctx, &store.FindUserSetting{
|
|
||||||
UserID: &userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if userSetting == nil {
|
|
||||||
userSetting = &storepb.UserSetting{
|
|
||||||
UserId: userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
Value: &storepb.UserSetting_Shortcuts{
|
|
||||||
Shortcuts: &storepb.ShortcutsUserSetting{
|
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
|
||||||
shortcuts := shortcutsUserSetting.GetShortcuts()
|
|
||||||
shortcuts = append(shortcuts, newShortcut)
|
|
||||||
shortcutsUserSetting.Shortcuts = shortcuts
|
|
||||||
|
|
||||||
userSetting.Value = &storepb.UserSetting_Shortcuts{
|
|
||||||
Shortcuts: shortcutsUserSetting,
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = s.Store.UpsertUserSetting(ctx, userSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to upsert user setting: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1pb.Shortcut{
|
|
||||||
Name: constructShortcutName(user.Username, newShortcut.GetId()),
|
|
||||||
Title: newShortcut.GetTitle(),
|
|
||||||
Filter: newShortcut.GetFilter(),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateShortcutRequest) (*v1pb.Shortcut, error) {
|
|
||||||
user, shortcutID, err := s.extractUserAndShortcutIDFromName(ctx, request.Shortcut.Name)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid shortcut name: %v", err)
|
|
||||||
}
|
|
||||||
userID := user.ID
|
|
||||||
|
|
||||||
currentUser, err := s.fetchCurrentUser(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
||||||
}
|
|
||||||
if currentUser == nil || currentUser.ID != userID {
|
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
|
||||||
}
|
|
||||||
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "update mask is required")
|
|
||||||
}
|
|
||||||
|
|
||||||
userSetting, err := s.Store.GetUserSetting(ctx, &store.FindUserSetting{
|
|
||||||
UserID: &userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if userSetting == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
|
||||||
shortcuts := shortcutsUserSetting.GetShortcuts()
|
|
||||||
var foundShortcut *storepb.ShortcutsUserSetting_Shortcut
|
|
||||||
newShortcuts := make([]*storepb.ShortcutsUserSetting_Shortcut, 0, len(shortcuts))
|
|
||||||
for _, shortcut := range shortcuts {
|
|
||||||
if shortcut.GetId() == shortcutID {
|
|
||||||
foundShortcut = shortcut
|
|
||||||
for _, field := range request.UpdateMask.Paths {
|
|
||||||
if field == "title" {
|
|
||||||
if request.Shortcut.GetTitle() == "" {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "title is required")
|
|
||||||
}
|
|
||||||
shortcut.Title = request.Shortcut.GetTitle()
|
|
||||||
} else if field == "filter" {
|
|
||||||
if err := s.validateFilter(ctx, request.Shortcut.GetFilter()); err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid filter: %v", err)
|
|
||||||
}
|
|
||||||
shortcut.Filter = request.Shortcut.GetFilter()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newShortcuts = append(newShortcuts, shortcut)
|
|
||||||
}
|
|
||||||
|
|
||||||
if foundShortcut == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutsUserSetting.Shortcuts = newShortcuts
|
|
||||||
userSetting.Value = &storepb.UserSetting_Shortcuts{
|
|
||||||
Shortcuts: shortcutsUserSetting,
|
|
||||||
}
|
|
||||||
_, err = s.Store.UpsertUserSetting(ctx, userSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1pb.Shortcut{
|
|
||||||
Name: constructShortcutName(user.Username, foundShortcut.GetId()),
|
|
||||||
Title: foundShortcut.GetTitle(),
|
|
||||||
Filter: foundShortcut.GetFilter(),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) DeleteShortcut(ctx context.Context, request *v1pb.DeleteShortcutRequest) (*emptypb.Empty, error) {
|
|
||||||
user, shortcutID, err := s.extractUserAndShortcutIDFromName(ctx, request.Name)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "invalid shortcut name: %v", err)
|
|
||||||
}
|
|
||||||
userID := user.ID
|
|
||||||
|
|
||||||
currentUser, err := s.fetchCurrentUser(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
||||||
}
|
|
||||||
if currentUser == nil || currentUser.ID != userID {
|
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
|
||||||
}
|
|
||||||
|
|
||||||
userSetting, err := s.Store.GetUserSetting(ctx, &store.FindUserSetting{
|
|
||||||
UserID: &userID,
|
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if userSetting == nil {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
|
||||||
shortcuts := shortcutsUserSetting.GetShortcuts()
|
|
||||||
newShortcuts := make([]*storepb.ShortcutsUserSetting_Shortcut, 0, len(shortcuts))
|
|
||||||
found := false
|
|
||||||
for _, shortcut := range shortcuts {
|
|
||||||
if shortcut.GetId() != shortcutID {
|
|
||||||
newShortcuts = append(newShortcuts, shortcut)
|
|
||||||
} else {
|
|
||||||
found = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, status.Errorf(codes.NotFound, "shortcut not found")
|
|
||||||
}
|
|
||||||
shortcutsUserSetting.Shortcuts = newShortcuts
|
|
||||||
userSetting.Value = &storepb.UserSetting_Shortcuts{
|
|
||||||
Shortcuts: shortcutsUserSetting,
|
|
||||||
}
|
|
||||||
_, err = s.Store.UpsertUserSetting(ctx, userSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to upsert user setting: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &emptypb.Empty{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *APIV1Service) validateFilter(ctx context.Context, filterStr string) error {
|
|
||||||
if filterStr == "" {
|
|
||||||
return errors.New("filter cannot be empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
engine, err := filter.DefaultEngine()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
var dialect filter.DialectName
|
|
||||||
switch s.Profile.Driver {
|
|
||||||
case "mysql":
|
|
||||||
dialect = filter.DialectMySQL
|
|
||||||
case "postgres":
|
|
||||||
dialect = filter.DialectPostgres
|
|
||||||
default:
|
|
||||||
dialect = filter.DialectSQLite
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := engine.CompileToStatement(ctx, filterStr, filter.RenderOptions{Dialect: dialect}); err != nil {
|
|
||||||
return errors.Wrap(err, "failed to compile filter")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -66,11 +66,11 @@ func TestUserResourceName(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, settings)
|
require.NotNil(t, settings)
|
||||||
|
|
||||||
shortcuts, err := ts.Service.ListShortcuts(userCtx, &apiv1.ListShortcutsRequest{
|
memoViews, err := ts.Service.ListMemoViews(userCtx, &apiv1.ListMemoViewsRequest{
|
||||||
Parent: currentUser.GetUser().Name,
|
Parent: currentUser.GetUser().Name,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, shortcuts)
|
require.NotNil(t, memoViews)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("BatchGetUsers preserves mixed-case usernames", func(t *testing.T) {
|
t.Run("BatchGetUsers preserves mixed-case usernames", func(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ func TestListUserSettingsOmitsInternalStoreSettings(t *testing.T) {
|
||||||
|
|
||||||
_, err = ts.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{
|
Value: &storepb.UserSetting_MemoViews{
|
||||||
Shortcuts: &storepb.ShortcutsUserSetting{},
|
MemoViews: &storepb.MemoViewsUserSetting{},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,8 @@ func convertSettingKeyFromStore(key storepb.UserSetting_Key) string {
|
||||||
switch key {
|
switch key {
|
||||||
case storepb.UserSetting_GENERAL:
|
case storepb.UserSetting_GENERAL:
|
||||||
return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_GENERAL)]
|
return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_GENERAL)]
|
||||||
case storepb.UserSetting_SHORTCUTS:
|
case storepb.UserSetting_MEMO_VIEWS:
|
||||||
return "SHORTCUTS" // Not defined in API proto
|
return "MEMO_VIEWS" // Not defined in API proto
|
||||||
case storepb.UserSetting_WEBHOOKS:
|
case storepb.UserSetting_WEBHOOKS:
|
||||||
return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_WEBHOOKS)]
|
return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_WEBHOOKS)]
|
||||||
case storepb.UserSetting_TAGS:
|
case storepb.UserSetting_TAGS:
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ type APIV1Service struct {
|
||||||
v1pb.UnimplementedMemoServiceServer
|
v1pb.UnimplementedMemoServiceServer
|
||||||
v1pb.UnimplementedAttachmentServiceServer
|
v1pb.UnimplementedAttachmentServiceServer
|
||||||
v1pb.UnimplementedAIServiceServer
|
v1pb.UnimplementedAIServiceServer
|
||||||
v1pb.UnimplementedShortcutServiceServer
|
v1pb.UnimplementedMemoViewServiceServer
|
||||||
v1pb.UnimplementedIdentityProviderServiceServer
|
v1pb.UnimplementedIdentityProviderServiceServer
|
||||||
|
|
||||||
Secret string
|
Secret string
|
||||||
|
|
@ -153,7 +153,7 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech
|
||||||
if err := v1pb.RegisterAIServiceHandlerServer(ctx, gwMux, s); err != nil {
|
if err := v1pb.RegisterAIServiceHandlerServer(ctx, gwMux, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := v1pb.RegisterShortcutServiceHandlerServer(ctx, gwMux, s); err != nil {
|
if err := v1pb.RegisterMemoViewServiceHandlerServer(ctx, gwMux, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := v1pb.RegisterIdentityProviderServiceHandlerServer(ctx, gwMux, s); err != nil {
|
if err := v1pb.RegisterIdentityProviderServiceHandlerServer(ctx, gwMux, s); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ a personal access token as a bearer credential. Example client config:
|
||||||
|
|
||||||
The server exposes a curated allowlist (`curatedOperationIDs` in `catalog.go`),
|
The server exposes a curated allowlist (`curatedOperationIDs` in `catalog.go`),
|
||||||
centered on memos and attachments, plus two read-only orientation tools:
|
centered on memos and attachments, plus two read-only orientation tools:
|
||||||
`shortcut_list_shortcuts` (surfaces a user's saved CEL filters for reuse with
|
`memo_view_list_memo_views` (surfaces a user's named CEL filters for reuse with
|
||||||
`memo_list_memos`) and `auth_get_current_user` (a "whoami" so an agent can
|
`memo_list_memos`) and `auth_get_current_user` (a "whoami" so an agent can
|
||||||
resolve its own user — the single allowed auth/identity operation):
|
resolve its own user — the single allowed auth/identity operation):
|
||||||
|
|
||||||
|
|
@ -163,7 +163,7 @@ resolve its own user — the single allowed auth/identity operation):
|
||||||
| `AttachmentService_CreateAttachment` | `attachment_create_attachment` |
|
| `AttachmentService_CreateAttachment` | `attachment_create_attachment` |
|
||||||
| `AttachmentService_GetAttachment` | `attachment_get_attachment` |
|
| `AttachmentService_GetAttachment` | `attachment_get_attachment` |
|
||||||
| `AttachmentService_DeleteAttachment` | `attachment_delete_attachment` |
|
| `AttachmentService_DeleteAttachment` | `attachment_delete_attachment` |
|
||||||
| `ShortcutService_ListShortcuts` | `shortcut_list_shortcuts` |
|
| `MemoViewService_ListMemoViews` | `memo_view_list_memo_views` |
|
||||||
| `AuthService_GetCurrentUser` | `auth_get_current_user` |
|
| `AuthService_GetCurrentUser` | `auth_get_current_user` |
|
||||||
|
|
||||||
**Naming rule** (`toolNameFromOperationID`): drop the `Service` suffix from the
|
**Naming rule** (`toolNameFromOperationID`): drop the `Service` suffix from the
|
||||||
|
|
|
||||||
|
|
@ -177,13 +177,13 @@ func TestBuildAPIRequestAcceptsHierarchicalResourceNamesForPathParameters(t *tes
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "parameter declaration order does not matter",
|
name: "parameter declaration order does not matter",
|
||||||
path: "/api/v1/users/{user}/shortcuts/{shortcut}",
|
path: "/api/v1/users/{user}/views/{view}",
|
||||||
parameters: []string{"shortcut", "user"},
|
parameters: []string{"view", "user"},
|
||||||
arguments: map[string]any{
|
arguments: map[string]any{
|
||||||
"user": "users/user123",
|
"user": "users/user123",
|
||||||
"shortcut": "users/user123/shortcuts/shortcut456",
|
"view": "users/user123/views/view456",
|
||||||
},
|
},
|
||||||
wantPath: "/api/v1/users/user123/shortcuts/shortcut456",
|
wantPath: "/api/v1/users/user123/views/view456",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "canonical nested name on action route",
|
name: "canonical nested name on action route",
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ var curatedOperationIDs = []string{
|
||||||
"AttachmentService_CreateAttachment",
|
"AttachmentService_CreateAttachment",
|
||||||
"AttachmentService_GetAttachment",
|
"AttachmentService_GetAttachment",
|
||||||
"AttachmentService_DeleteAttachment",
|
"AttachmentService_DeleteAttachment",
|
||||||
"ShortcutService_ListShortcuts",
|
"MemoViewService_ListMemoViews",
|
||||||
// The only allowed auth/identity operation: a read-only "whoami" so agents
|
// The only allowed auth/identity operation: a read-only "whoami" so agents
|
||||||
// can resolve the current user (e.g. for ShortcutService_ListShortcuts).
|
// can resolve the current user (e.g. for MemoViewService_ListMemoViews).
|
||||||
"AuthService_GetCurrentUser",
|
"AuthService_GetCurrentUser",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,14 +277,14 @@ func TestBuildToolFromOperationExposesCurrentUser(t *testing.T) {
|
||||||
require.True(t, tool.Annotations.ReadOnlyHint)
|
require.True(t, tool.Annotations.ReadOnlyHint)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildToolFromOperationExposesListShortcuts(t *testing.T) {
|
func TestBuildToolFromOperationExposesListMemoViews(t *testing.T) {
|
||||||
spec, err := loadOpenAPISpec("../../../proto/gen/openapi.yaml")
|
spec, err := loadOpenAPISpec("../../../proto/gen/openapi.yaml")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
registry, err := buildOperationRegistry(spec)
|
registry, err := buildOperationRegistry(spec)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
tool, operation := buildToolFromOperation(registry["ShortcutService_ListShortcuts"])
|
tool, operation := buildToolFromOperation(registry["MemoViewService_ListMemoViews"])
|
||||||
require.Equal(t, "shortcut_list_shortcuts", tool.Name)
|
require.Equal(t, "memo_view_list_memo_views", tool.Name)
|
||||||
require.Equal(t, "GET", operation.Method)
|
require.Equal(t, "GET", operation.Method)
|
||||||
require.True(t, tool.Annotations.ReadOnlyHint)
|
require.True(t, tool.Annotations.ReadOnlyHint)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ tool calls, and has a single string-comparable answer.
|
||||||
Answers are pinned to the deterministic seed in
|
Answers are pinned to the deterministic seed in
|
||||||
[`store/seed/sqlite/01__dump.sql`](../../../../store/seed/sqlite/01__dump.sql)
|
[`store/seed/sqlite/01__dump.sql`](../../../../store/seed/sqlite/01__dump.sql)
|
||||||
(10 memos — 7 top-level + 3 comments — 2 users, 12 reactions, no attachments,
|
(10 memos — 7 top-level + 3 comments — 2 users, 12 reactions, no attachments,
|
||||||
no shortcuts).
|
no memo views).
|
||||||
|
|
||||||
The public demo (`demo.usememos.com`) signs everyone into the **same shared
|
The public demo (`demo.usememos.com`) signs everyone into the **same shared
|
||||||
`demo` account**, so visitors continually add/edit/delete memos and reactions.
|
`demo` account**, so visitors continually add/edit/delete memos and reactions.
|
||||||
|
|
@ -62,6 +62,6 @@ content, all of which are stable across re-seeds.
|
||||||
`"work" in tags` (or `tags.exists(t, t == "work")`), not `tag == "work"`.
|
`"work" in tags` (or `tags.exists(t, t == "work")`), not `tag == "work"`.
|
||||||
- `memo_list_memos` returns only top-level memos; comments are reached via
|
- `memo_list_memos` returns only top-level memos; comments are reached via
|
||||||
`memo_list_memo_comments`.
|
`memo_list_memo_comments`.
|
||||||
- The seed defines no shortcuts and no attachments, so `shortcut_list_shortcuts`
|
- The seed defines no memo views and no attachments, so `memo_view_list_memo_views`
|
||||||
and the attachment tools return empty sets against a fresh seed. Add seed rows
|
and the attachment tools return empty sets against a fresh seed. Add seed rows
|
||||||
before writing questions that depend on them.
|
before writing questions that depend on them.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
These questions test whether an LLM can accomplish realistic tasks by
|
These questions test whether an LLM can accomplish realistic tasks by
|
||||||
composing the curated MCP tools (memo_list_memos with CEL filters,
|
composing the curated MCP tools (memo_list_memos with CEL filters,
|
||||||
memo_list_memo_comments, memo_list_memo_reactions, shortcut_list_shortcuts,
|
memo_list_memo_comments, memo_list_memo_reactions, memo_view_list_memo_views,
|
||||||
auth_get_current_user, ...). They are NOT unit tests of the server plumbing —
|
auth_get_current_user, ...). They are NOT unit tests of the server plumbing —
|
||||||
see *_test.go for that.
|
see *_test.go for that.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
-- Renames the SHORTCUTS user setting to MEMO_VIEWS, rewriting the stored JSON
|
||||||
|
-- object key from `shortcuts` to `memoViews` to match the renamed proto field.
|
||||||
|
--
|
||||||
|
-- Rows are skipped rather than failing the migration when either
|
||||||
|
-- * `value` is not valid JSON, which would abort the whole upgrade transaction, or
|
||||||
|
-- * the user already has a MEMO_VIEWS row, which would violate UNIQUE(user_id, key).
|
||||||
|
-- The conflict check goes through a derived table because MySQL cannot read the
|
||||||
|
-- target table of an UPDATE directly in a subquery.
|
||||||
|
UPDATE user_setting
|
||||||
|
SET
|
||||||
|
`key` = 'MEMO_VIEWS',
|
||||||
|
value = CASE
|
||||||
|
WHEN JSON_CONTAINS_PATH(value, 'one', '$.shortcuts') THEN JSON_SET(
|
||||||
|
JSON_REMOVE(value, '$.shortcuts'),
|
||||||
|
'$.memoViews',
|
||||||
|
JSON_EXTRACT(value, '$.shortcuts')
|
||||||
|
)
|
||||||
|
ELSE value
|
||||||
|
END
|
||||||
|
WHERE `key` = 'SHORTCUTS'
|
||||||
|
AND JSON_VALID(value)
|
||||||
|
AND user_id NOT IN (
|
||||||
|
SELECT user_id FROM (
|
||||||
|
SELECT user_id FROM user_setting WHERE `key` = 'MEMO_VIEWS'
|
||||||
|
) AS existing_memo_views
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
-- Renames the SHORTCUTS user setting to MEMO_VIEWS, rewriting the stored JSON
|
||||||
|
-- object key from `shortcuts` to `memoViews` to match the renamed proto field.
|
||||||
|
--
|
||||||
|
-- Invalid or non-object JSON values are skipped rather than aborting the upgrade,
|
||||||
|
-- while the conflict check preserves an existing MEMO_VIEWS setting.
|
||||||
|
UPDATE user_setting AS legacy
|
||||||
|
SET
|
||||||
|
key = 'MEMO_VIEWS',
|
||||||
|
value = CASE
|
||||||
|
WHEN legacy.value::jsonb ? 'shortcuts' THEN jsonb_set(
|
||||||
|
legacy.value::jsonb - 'shortcuts',
|
||||||
|
'{memoViews}',
|
||||||
|
legacy.value::jsonb->'shortcuts'
|
||||||
|
)::text
|
||||||
|
ELSE legacy.value
|
||||||
|
END
|
||||||
|
WHERE legacy.key = 'SHORTCUTS'
|
||||||
|
AND CASE
|
||||||
|
WHEN pg_input_is_valid(legacy.value, 'jsonb')
|
||||||
|
THEN jsonb_typeof(legacy.value::jsonb) = 'object'
|
||||||
|
ELSE FALSE
|
||||||
|
END
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM user_setting AS existing
|
||||||
|
WHERE existing.user_id = legacy.user_id
|
||||||
|
AND existing.key = 'MEMO_VIEWS'
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
-- Renames the SHORTCUTS user setting to MEMO_VIEWS, rewriting the stored JSON
|
||||||
|
-- object key from `shortcuts` to `memoViews` to match the renamed proto field.
|
||||||
|
--
|
||||||
|
-- Rows are skipped rather than failing the migration when either
|
||||||
|
-- * `value` is not valid JSON, which would abort the whole upgrade transaction, or
|
||||||
|
-- * the user already has a MEMO_VIEWS row, which would violate UNIQUE(user_id, key).
|
||||||
|
UPDATE user_setting
|
||||||
|
SET
|
||||||
|
key = 'MEMO_VIEWS',
|
||||||
|
value = CASE
|
||||||
|
WHEN json_type(value, '$.shortcuts') IS NOT NULL THEN json_set(
|
||||||
|
json_remove(value, '$.shortcuts'),
|
||||||
|
'$.memoViews',
|
||||||
|
json_extract(value, '$.shortcuts')
|
||||||
|
)
|
||||||
|
ELSE value
|
||||||
|
END
|
||||||
|
WHERE key = 'SHORTCUTS'
|
||||||
|
AND json_valid(value)
|
||||||
|
AND user_id NOT IN (
|
||||||
|
SELECT user_id FROM user_setting WHERE key = 'MEMO_VIEWS'
|
||||||
|
);
|
||||||
|
|
@ -17,6 +17,7 @@ type Store struct {
|
||||||
userCreateMu sync.Mutex
|
userCreateMu sync.Mutex
|
||||||
authConfigMu sync.Mutex
|
authConfigMu sync.Mutex
|
||||||
patMu sync.Mutex
|
patMu sync.Mutex
|
||||||
|
memoViewMu sync.Mutex
|
||||||
|
|
||||||
deploymentConfigMu sync.RWMutex
|
deploymentConfigMu sync.RWMutex
|
||||||
deploymentConfig *deploymentConfiguration
|
deploymentConfig *deploymentConfiguration
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,106 @@ func TestMigrationMultipleReRuns(t *testing.T) {
|
||||||
require.Equal(t, initialVersion, finalVersion, "version should remain unchanged after multiple re-runs")
|
require.Equal(t, initialVersion, finalVersion, "version should remain unchanged after multiple re-runs")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestMigrationMemoViewSetting verifies the 0.31 rename of the SHORTCUTS user setting
|
||||||
|
// to MEMO_VIEWS on every driver, since each one rewrites the stored JSON with its own
|
||||||
|
// dialect-specific functions.
|
||||||
|
func TestMigrationMemoViewSetting(t *testing.T) {
|
||||||
|
ctx := context.Background()
|
||||||
|
driver := getDriverFromEnv()
|
||||||
|
var dsn string
|
||||||
|
switch driver {
|
||||||
|
case "sqlite":
|
||||||
|
dsn = fmt.Sprintf("%s/memos_memo_view_migration.db", t.TempDir())
|
||||||
|
case "mysql":
|
||||||
|
dsn = GetMySQLDSN(t)
|
||||||
|
case "postgres":
|
||||||
|
dsn = GetPostgresDSN(t)
|
||||||
|
default:
|
||||||
|
t.Fatalf("unsupported driver: %s", driver)
|
||||||
|
}
|
||||||
|
|
||||||
|
db, err := sql.Open(driver, dsn)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
_, err = db.ExecContext(ctx, legacySchemaFixture(driver))
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
basicSettingBytes, err := protojson.Marshal(&storepb.InstanceBasicSetting{SchemaVersion: "0.30.2"})
|
||||||
|
require.NoError(t, err)
|
||||||
|
insertBasicSetting := "INSERT INTO system_setting (name, value, description) VALUES ('BASIC', ?, '')"
|
||||||
|
if driver == "postgres" {
|
||||||
|
insertBasicSetting = "INSERT INTO system_setting (name, value, description) VALUES ('BASIC', $1, '')"
|
||||||
|
}
|
||||||
|
_, err = db.ExecContext(ctx, insertBasicSetting, string(basicSettingBytes))
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
settingKeyColumn := "key"
|
||||||
|
if driver == "mysql" {
|
||||||
|
settingKeyColumn = "`key`"
|
||||||
|
}
|
||||||
|
// Bound rather than inlined: MySQL treats backslash as an escape character inside
|
||||||
|
// string literals, so an inlined \" would collapse and corrupt the fixture's JSON.
|
||||||
|
insertSetting := fmt.Sprintf("INSERT INTO user_setting (user_id, %[1]s, value) VALUES (?, ?, ?)", settingKeyColumn)
|
||||||
|
if driver == "postgres" {
|
||||||
|
insertSetting = fmt.Sprintf("INSERT INTO user_setting (user_id, %[1]s, value) VALUES ($1, $2, $3)", settingKeyColumn)
|
||||||
|
}
|
||||||
|
settingRows := []struct {
|
||||||
|
userID int
|
||||||
|
key string
|
||||||
|
value string
|
||||||
|
}{
|
||||||
|
// A normal legacy row, must be renamed and rewritten.
|
||||||
|
{1, "SHORTCUTS", `{"shortcuts":[{"id":"work","title":"shortcuts","filter":"tag in [\"work\"]"}]}`},
|
||||||
|
// A corrupt value, must be left alone rather than aborting the upgrade.
|
||||||
|
{2, "SHORTCUTS", `{oops}`},
|
||||||
|
// Already has a MEMO_VIEWS row, must not trip UNIQUE(user_id, key).
|
||||||
|
{3, "SHORTCUTS", `{"shortcuts":[{"id":"old","title":"old","filter":"tag in [\"old\"]"}]}`},
|
||||||
|
{3, "MEMO_VIEWS", `{"memoViews":[{"id":"new","title":"new","filter":"tag in [\"new\"]"}]}`},
|
||||||
|
}
|
||||||
|
for _, row := range settingRows {
|
||||||
|
_, err = db.ExecContext(ctx, insertSetting, row.userID, row.key, row.value)
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
require.NoError(t, db.Close())
|
||||||
|
|
||||||
|
ts := NewTestingStoreWithDSN(ctx, t, driver, dsn)
|
||||||
|
require.NoError(t, ts.Migrate(ctx))
|
||||||
|
defer ts.Close()
|
||||||
|
|
||||||
|
migratedUserID := int32(1)
|
||||||
|
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
|
UserID: &migratedUserID,
|
||||||
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
|
})
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, setting)
|
||||||
|
require.Len(t, setting.GetMemoViews().GetMemoViews(), 1)
|
||||||
|
require.Equal(t, "work", setting.GetMemoViews().GetMemoViews()[0].GetId())
|
||||||
|
require.Equal(t, "shortcuts", setting.GetMemoViews().GetMemoViews()[0].GetTitle())
|
||||||
|
require.Equal(t, `tag in ["work"]`, setting.GetMemoViews().GetMemoViews()[0].GetFilter())
|
||||||
|
|
||||||
|
// Malformed object-like JSON must neither abort the migration nor be renamed.
|
||||||
|
findCorruptSetting := fmt.Sprintf("SELECT value FROM user_setting WHERE user_id = ? AND %s = ?", settingKeyColumn)
|
||||||
|
if driver == "postgres" {
|
||||||
|
findCorruptSetting = fmt.Sprintf("SELECT value FROM user_setting WHERE user_id = $1 AND %s = $2", settingKeyColumn)
|
||||||
|
}
|
||||||
|
var corruptValue string
|
||||||
|
err = ts.GetDriver().GetDB().QueryRowContext(ctx, findCorruptSetting, 2, "SHORTCUTS").Scan(&corruptValue)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, `{oops}`, corruptValue)
|
||||||
|
|
||||||
|
// The pre-existing MEMO_VIEWS row wins; the legacy row is left behind untouched.
|
||||||
|
conflictUserID := int32(3)
|
||||||
|
conflicting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
|
UserID: &conflictUserID,
|
||||||
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
|
})
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, conflicting)
|
||||||
|
require.Len(t, conflicting.GetMemoViews().GetMemoViews(), 1)
|
||||||
|
require.Equal(t, "new", conflicting.GetMemoViews().GetMemoViews()[0].GetId())
|
||||||
|
}
|
||||||
|
|
||||||
// TestMigrationCopiesInstanceTagsToUserSettings verifies instance tag metadata is copied into user settings.
|
// TestMigrationCopiesInstanceTagsToUserSettings verifies instance tag metadata is copied into user settings.
|
||||||
func TestMigrationCopiesInstanceTagsToUserSettings(t *testing.T) {
|
func TestMigrationCopiesInstanceTagsToUserSettings(t *testing.T) {
|
||||||
if getDriverFromEnv() != "sqlite" {
|
if getDriverFromEnv() != "sqlite" {
|
||||||
|
|
@ -237,7 +337,7 @@ func TestCaseSensitiveUsernameMigration(t *testing.T) {
|
||||||
db, err := sql.Open(driver, dsn)
|
db, err := sql.Open(driver, dsn)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
_, err = db.ExecContext(ctx, caseSensitiveUsernameMigrationFixture(driver))
|
_, err = db.ExecContext(ctx, legacySchemaFixture(driver))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
basicSettingBytes, err := protojson.Marshal(&storepb.InstanceBasicSetting{SchemaVersion: "0.30.1"})
|
basicSettingBytes, err := protojson.Marshal(&storepb.InstanceBasicSetting{SchemaVersion: "0.30.1"})
|
||||||
|
|
@ -272,7 +372,7 @@ func TestCaseSensitiveUsernameMigration(t *testing.T) {
|
||||||
require.Equal(t, "Alice", upper.Username)
|
require.Equal(t, "Alice", upper.Username)
|
||||||
}
|
}
|
||||||
|
|
||||||
func caseSensitiveUsernameMigrationFixture(driver string) string {
|
func legacySchemaFixture(driver string) string {
|
||||||
switch driver {
|
switch driver {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
return `
|
return `
|
||||||
|
|
@ -294,6 +394,12 @@ func caseSensitiveUsernameMigrationFixture(driver string) string {
|
||||||
avatar_url LONGTEXT NOT NULL,
|
avatar_url LONGTEXT NOT NULL,
|
||||||
description VARCHAR(256) NOT NULL DEFAULT ''
|
description VARCHAR(256) NOT NULL DEFAULT ''
|
||||||
);
|
);
|
||||||
|
CREATE TABLE user_setting (
|
||||||
|
user_id INT NOT NULL,
|
||||||
|
` + "`key`" + ` VARCHAR(256) NOT NULL,
|
||||||
|
value LONGTEXT NOT NULL,
|
||||||
|
UNIQUE(user_id, ` + "`key`" + `)
|
||||||
|
);
|
||||||
CREATE TABLE memo (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
|
CREATE TABLE memo (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
|
||||||
`
|
`
|
||||||
case "postgres":
|
case "postgres":
|
||||||
|
|
@ -316,6 +422,12 @@ func caseSensitiveUsernameMigrationFixture(driver string) string {
|
||||||
avatar_url TEXT NOT NULL,
|
avatar_url TEXT NOT NULL,
|
||||||
description TEXT NOT NULL DEFAULT ''
|
description TEXT NOT NULL DEFAULT ''
|
||||||
);
|
);
|
||||||
|
CREATE TABLE user_setting (
|
||||||
|
user_id INTEGER NOT NULL,
|
||||||
|
key TEXT NOT NULL,
|
||||||
|
value TEXT NOT NULL,
|
||||||
|
UNIQUE(user_id, key)
|
||||||
|
);
|
||||||
CREATE TABLE memo (id SERIAL PRIMARY KEY);
|
CREATE TABLE memo (id SERIAL PRIMARY KEY);
|
||||||
`
|
`
|
||||||
case "sqlite":
|
case "sqlite":
|
||||||
|
|
@ -339,6 +451,12 @@ func caseSensitiveUsernameMigrationFixture(driver string) string {
|
||||||
avatar_url TEXT NOT NULL DEFAULT '',
|
avatar_url TEXT NOT NULL DEFAULT '',
|
||||||
description TEXT NOT NULL DEFAULT ''
|
description TEXT NOT NULL DEFAULT ''
|
||||||
);
|
);
|
||||||
|
CREATE TABLE user_setting (
|
||||||
|
user_id INTEGER NOT NULL,
|
||||||
|
key TEXT NOT NULL,
|
||||||
|
value TEXT NOT NULL,
|
||||||
|
UNIQUE(user_id, key)
|
||||||
|
);
|
||||||
CREATE TABLE memo (id INTEGER PRIMARY KEY AUTOINCREMENT);
|
CREATE TABLE memo (id INTEGER PRIMARY KEY AUTOINCREMENT);
|
||||||
`
|
`
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package test
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -58,7 +59,7 @@ func TestUserSettingGetByUserID(t *testing.T) {
|
||||||
// Get non-existent key
|
// Get non-existent key
|
||||||
nonExistentSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
nonExistentSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Nil(t, nonExistentSetting)
|
require.Nil(t, nonExistentSetting)
|
||||||
|
|
@ -285,36 +286,36 @@ func TestUserSettingWebhooks(t *testing.T) {
|
||||||
ts.Close()
|
ts.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUserSettingShortcuts(t *testing.T) {
|
func TestUserSettingMemoViews(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
ts := NewTestingStore(ctx, t)
|
ts := NewTestingStore(ctx, t)
|
||||||
user, err := createTestingHostUser(ctx, ts)
|
user, err := createTestingHostUser(ctx, ts)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Create shortcuts setting
|
// Create memoViews setting
|
||||||
shortcuts := &storepb.ShortcutsUserSetting{
|
memoViews := &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "shortcut-1", Title: "Work Notes", Filter: "tag:work"},
|
{Id: "memoView-1", Title: "Work Notes", Filter: "tag:work"},
|
||||||
{Id: "shortcut-2", Title: "Personal", Filter: "tag:personal"},
|
{Id: "memoView-2", Title: "Personal", Filter: "tag:personal"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Retrieve and verify
|
// Retrieve and verify
|
||||||
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.Len(t, setting.GetShortcuts().Shortcuts, 2)
|
require.Len(t, setting.GetMemoViews().MemoViews, 2)
|
||||||
require.Equal(t, "Work Notes", setting.GetShortcuts().Shortcuts[0].Title)
|
require.Equal(t, "Work Notes", setting.GetMemoViews().MemoViews[0].Title)
|
||||||
|
|
||||||
ts.Close()
|
ts.Close()
|
||||||
}
|
}
|
||||||
|
|
@ -744,13 +745,13 @@ func TestUserSettingMultipleSettingTypes(t *testing.T) {
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Create SHORTCUTS setting
|
// Create MEMO_VIEWS setting
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: &storepb.ShortcutsUserSetting{
|
Value: &storepb.UserSetting_MemoViews{MemoViews: &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s1", Title: "Shortcut 1"},
|
{Id: "s1", Title: "MemoView 1"},
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
|
@ -773,9 +774,9 @@ func TestUserSettingMultipleSettingTypes(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, "ja", generalSetting.GetGeneral().Locale)
|
require.Equal(t, "ja", generalSetting.GetGeneral().Locale)
|
||||||
|
|
||||||
shortcutsSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{UserID: &user.ID, Key: storepb.UserSetting_SHORTCUTS})
|
memoViewsSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{UserID: &user.ID, Key: storepb.UserSetting_MEMO_VIEWS})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, shortcutsSetting.GetShortcuts().Shortcuts, 1)
|
require.Len(t, memoViewsSetting.GetMemoViews().MemoViews, 1)
|
||||||
|
|
||||||
patsSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{UserID: &user.ID, Key: storepb.UserSetting_PERSONAL_ACCESS_TOKENS})
|
patsSetting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{UserID: &user.ID, Key: storepb.UserSetting_PERSONAL_ACCESS_TOKENS})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
@ -784,7 +785,7 @@ func TestUserSettingMultipleSettingTypes(t *testing.T) {
|
||||||
ts.Close()
|
ts.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUserSettingShortcutsEdgeCases(t *testing.T) {
|
func TestUserSettingMemoViewsEdgeCases(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
ts := NewTestingStore(ctx, t)
|
ts := NewTestingStore(ctx, t)
|
||||||
|
|
@ -795,101 +796,167 @@ func TestUserSettingShortcutsEdgeCases(t *testing.T) {
|
||||||
// Includes quotes, backslashes, newlines, and other JSON-sensitive characters
|
// Includes quotes, backslashes, newlines, and other JSON-sensitive characters
|
||||||
specialCharsFilter := `tag in ["work", "project"] && content.contains("urgent")`
|
specialCharsFilter := `tag in ["work", "project"] && content.contains("urgent")`
|
||||||
specialCharsTitle := `Work "Urgent" \ Notes`
|
specialCharsTitle := `Work "Urgent" \ Notes`
|
||||||
shortcuts := &storepb.ShortcutsUserSetting{
|
memoViews := &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s1", Title: specialCharsTitle, Filter: specialCharsFilter},
|
{Id: "s1", Title: specialCharsTitle, Filter: specialCharsFilter},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.Len(t, setting.GetShortcuts().Shortcuts, 1)
|
require.Len(t, setting.GetMemoViews().MemoViews, 1)
|
||||||
require.Equal(t, specialCharsTitle, setting.GetShortcuts().Shortcuts[0].Title)
|
require.Equal(t, specialCharsTitle, setting.GetMemoViews().MemoViews[0].Title)
|
||||||
require.Equal(t, specialCharsFilter, setting.GetShortcuts().Shortcuts[0].Filter)
|
require.Equal(t, specialCharsFilter, setting.GetMemoViews().MemoViews[0].Filter)
|
||||||
|
|
||||||
// Case 2: Unicode characters
|
// Case 2: Unicode characters
|
||||||
unicodeFilter := `tag in ["你好", "世界"]`
|
unicodeFilter := `tag in ["你好", "世界"]`
|
||||||
unicodeTitle := `My 🚀 Shortcuts`
|
unicodeTitle := `My 🚀 MemoViews`
|
||||||
shortcuts = &storepb.ShortcutsUserSetting{
|
memoViews = &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s2", Title: unicodeTitle, Filter: unicodeFilter},
|
{Id: "s2", Title: unicodeTitle, Filter: unicodeFilter},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.Len(t, setting.GetShortcuts().Shortcuts, 1)
|
require.Len(t, setting.GetMemoViews().MemoViews, 1)
|
||||||
require.Equal(t, unicodeTitle, setting.GetShortcuts().Shortcuts[0].Title)
|
require.Equal(t, unicodeTitle, setting.GetMemoViews().MemoViews[0].Title)
|
||||||
require.Equal(t, unicodeFilter, setting.GetShortcuts().Shortcuts[0].Filter)
|
require.Equal(t, unicodeFilter, setting.GetMemoViews().MemoViews[0].Filter)
|
||||||
|
|
||||||
// Case 3: Empty shortcuts list
|
// Case 3: Empty memoViews list
|
||||||
// Should allow saving an empty list (clearing shortcuts)
|
// Should allow saving an empty list (clearing memoViews)
|
||||||
shortcuts = &storepb.ShortcutsUserSetting{
|
memoViews = &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{},
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.NotNil(t, setting.GetShortcuts())
|
require.NotNil(t, setting.GetMemoViews())
|
||||||
require.Len(t, setting.GetShortcuts().Shortcuts, 0)
|
require.Len(t, setting.GetMemoViews().MemoViews, 0)
|
||||||
|
|
||||||
// Case 4: Large filter string
|
// Case 4: Large filter string
|
||||||
// Test reasonable large string handling (e.g. 4KB)
|
// Test reasonable large string handling (e.g. 4KB)
|
||||||
largeFilter := strings.Repeat("tag:long_tag_name ", 200)
|
largeFilter := strings.Repeat("tag:long_tag_name ", 200)
|
||||||
shortcuts = &storepb.ShortcutsUserSetting{
|
memoViews = &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s3", Title: "Large Filter", Filter: largeFilter},
|
{Id: "s3", Title: "Large Filter", Filter: largeFilter},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err = ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.Equal(t, largeFilter, setting.GetShortcuts().Shortcuts[0].Filter)
|
require.Equal(t, largeFilter, setting.GetMemoViews().MemoViews[0].Filter)
|
||||||
|
|
||||||
ts.Close()
|
ts.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUserSettingShortcutsPartialUpdate(t *testing.T) {
|
func TestUserMemoViewConcurrentPartialUpdates(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
ctx := context.Background()
|
||||||
|
ts := NewTestingStore(ctx, t)
|
||||||
|
defer ts.Close()
|
||||||
|
|
||||||
|
user, err := createTestingHostUser(ctx, ts)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NoError(t, ts.AddUserMemoView(ctx, user.ID, &storepb.MemoViewsUserSetting_MemoView{
|
||||||
|
Id: "work",
|
||||||
|
Title: "Original title",
|
||||||
|
Filter: `tag in ["original"]`,
|
||||||
|
}))
|
||||||
|
|
||||||
|
updatedTitle := "Updated title"
|
||||||
|
updatedFilter := `tag in ["updated"]`
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
errs := make([]error, 2)
|
||||||
|
start := make(chan struct{})
|
||||||
|
|
||||||
|
wg.Go(func() {
|
||||||
|
<-start
|
||||||
|
_, errs[0] = ts.UpdateUserMemoView(ctx, user.ID, "work", &updatedTitle, nil)
|
||||||
|
})
|
||||||
|
wg.Go(func() {
|
||||||
|
<-start
|
||||||
|
_, errs[1] = ts.UpdateUserMemoView(ctx, user.ID, "work", nil, &updatedFilter)
|
||||||
|
})
|
||||||
|
close(start)
|
||||||
|
wg.Wait()
|
||||||
|
for _, err := range errs {
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
memoViews, err := ts.GetUserMemoViews(ctx, user.ID)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Len(t, memoViews, 1)
|
||||||
|
require.Equal(t, updatedTitle, memoViews[0].GetTitle())
|
||||||
|
require.Equal(t, updatedFilter, memoViews[0].GetFilter())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetUserMemoViewsReturnsCopies(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
ctx := context.Background()
|
||||||
|
ts := NewTestingStore(ctx, t)
|
||||||
|
defer ts.Close()
|
||||||
|
user, err := createTestingHostUser(ctx, ts)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
require.NoError(t, ts.AddUserMemoView(ctx, user.ID, &storepb.MemoViewsUserSetting_MemoView{
|
||||||
|
Id: "work",
|
||||||
|
Title: "Original title",
|
||||||
|
Filter: `tag in ["original"]`,
|
||||||
|
}))
|
||||||
|
|
||||||
|
firstRead, err := ts.GetUserMemoViews(ctx, user.ID)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Len(t, firstRead, 1)
|
||||||
|
firstRead[0].Title = "Mutated title"
|
||||||
|
|
||||||
|
secondRead, err := ts.GetUserMemoViews(ctx, user.ID)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Len(t, secondRead, 1)
|
||||||
|
require.Equal(t, "Original title", secondRead[0].GetTitle())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUserSettingMemoViewsPartialUpdate(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
ts := NewTestingStore(ctx, t)
|
ts := NewTestingStore(ctx, t)
|
||||||
|
|
@ -897,23 +964,23 @@ func TestUserSettingShortcutsPartialUpdate(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Initial set
|
// Initial set
|
||||||
shortcuts := &storepb.ShortcutsUserSetting{
|
memoViews := &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s1", Title: "Note 1", Filter: "tag:1"},
|
{Id: "s1", Title: "Note 1", Filter: "tag:1"},
|
||||||
{Id: "s2", Title: "Note 2", Filter: "tag:2"},
|
{Id: "s2", Title: "Note 2", Filter: "tag:2"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: shortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: memoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Update by replacing the whole list (Store Upsert replaces the value for the key)
|
// Update by replacing the whole list (Store Upsert replaces the value for the key)
|
||||||
// We want to verify that we can "update" a single item by sending the modified list
|
// We want to verify that we can "update" a single item by sending the modified list
|
||||||
updatedShortcuts := &storepb.ShortcutsUserSetting{
|
updatedMemoViews := &storepb.MemoViewsUserSetting{
|
||||||
Shortcuts: []*storepb.ShortcutsUserSetting_Shortcut{
|
MemoViews: []*storepb.MemoViewsUserSetting_MemoView{
|
||||||
{Id: "s1", Title: "Note 1 Updated", Filter: "tag:1_updated"},
|
{Id: "s1", Title: "Note 1 Updated", Filter: "tag:1_updated"},
|
||||||
{Id: "s2", Title: "Note 2", Filter: "tag:2"},
|
{Id: "s2", Title: "Note 2", Filter: "tag:2"},
|
||||||
{Id: "s3", Title: "Note 3", Filter: "tag:3"}, // Add new one
|
{Id: "s3", Title: "Note 3", Filter: "tag:3"}, // Add new one
|
||||||
|
|
@ -921,21 +988,21 @@ func TestUserSettingShortcutsPartialUpdate(t *testing.T) {
|
||||||
}
|
}
|
||||||
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
UserId: user.ID,
|
UserId: user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
Value: &storepb.UserSetting_Shortcuts{Shortcuts: updatedShortcuts},
|
Value: &storepb.UserSetting_MemoViews{MemoViews: updatedMemoViews},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
setting, err := ts.GetUserSetting(ctx, &store.FindUserSetting{
|
||||||
UserID: &user.ID,
|
UserID: &user.ID,
|
||||||
Key: storepb.UserSetting_SHORTCUTS,
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotNil(t, setting)
|
require.NotNil(t, setting)
|
||||||
require.Len(t, setting.GetShortcuts().Shortcuts, 3)
|
require.Len(t, setting.GetMemoViews().MemoViews, 3)
|
||||||
|
|
||||||
// Verify updates
|
// Verify updates
|
||||||
for _, s := range setting.GetShortcuts().Shortcuts {
|
for _, s := range setting.GetMemoViews().MemoViews {
|
||||||
if s.Id == "s1" {
|
if s.Id == "s1" {
|
||||||
require.Equal(t, "Note 1 Updated", s.Title)
|
require.Equal(t, "Note 1 Updated", s.Title)
|
||||||
require.Equal(t, "tag:1_updated", s.Filter)
|
require.Equal(t, "tag:1_updated", s.Filter)
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,145 @@ func (s *Store) UpdateUserWebhook(ctx context.Context, userID int32, webhook *st
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUserMemoViews returns the memo views of the user.
|
||||||
|
func (s *Store) GetUserMemoViews(ctx context.Context, userID int32) ([]*storepb.MemoViewsUserSetting_MemoView, error) {
|
||||||
|
userSetting, err := s.GetUserSetting(ctx, &FindUserSetting{
|
||||||
|
UserID: &userID,
|
||||||
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "get memo views user setting")
|
||||||
|
}
|
||||||
|
if userSetting == nil {
|
||||||
|
return []*storepb.MemoViewsUserSetting_MemoView{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
memoViews := userSetting.GetMemoViews().GetMemoViews()
|
||||||
|
clonedMemoViews := make([]*storepb.MemoViewsUserSetting_MemoView, len(memoViews))
|
||||||
|
for i, memoView := range memoViews {
|
||||||
|
if memoView != nil {
|
||||||
|
clonedMemoView, ok := proto.Clone(memoView).(*storepb.MemoViewsUserSetting_MemoView)
|
||||||
|
if !ok {
|
||||||
|
return nil, errors.New("failed to clone memo view")
|
||||||
|
}
|
||||||
|
clonedMemoViews[i] = clonedMemoView
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clonedMemoViews, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddUserMemoView appends a new memo view for the user.
|
||||||
|
func (s *Store) AddUserMemoView(ctx context.Context, userID int32, memoView *storepb.MemoViewsUserSetting_MemoView) error {
|
||||||
|
s.memoViewMu.Lock()
|
||||||
|
defer s.memoViewMu.Unlock()
|
||||||
|
|
||||||
|
existing, err := s.GetUserMemoViews(ctx, userID)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "get existing memo views")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a fresh slice so the cached setting is never mutated in place.
|
||||||
|
memoViews := make([]*storepb.MemoViewsUserSetting_MemoView, 0, len(existing)+1)
|
||||||
|
memoViews = append(memoViews, existing...)
|
||||||
|
memoViews = append(memoViews, memoView)
|
||||||
|
|
||||||
|
if err := s.upsertUserMemoViews(ctx, userID, memoViews); err != nil {
|
||||||
|
return errors.Wrap(err, "add memo view")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateUserMemoView applies the non-nil field updates to the memo view carrying the same ID.
|
||||||
|
// It returns nil when no matching memo view is found.
|
||||||
|
func (s *Store) UpdateUserMemoView(
|
||||||
|
ctx context.Context,
|
||||||
|
userID int32,
|
||||||
|
memoViewID string,
|
||||||
|
title *string,
|
||||||
|
filter *string,
|
||||||
|
) (*storepb.MemoViewsUserSetting_MemoView, error) {
|
||||||
|
s.memoViewMu.Lock()
|
||||||
|
defer s.memoViewMu.Unlock()
|
||||||
|
|
||||||
|
existing, err := s.GetUserMemoViews(ctx, userID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "get existing memo views")
|
||||||
|
}
|
||||||
|
|
||||||
|
var updatedMemoView *storepb.MemoViewsUserSetting_MemoView
|
||||||
|
memoViews := make([]*storepb.MemoViewsUserSetting_MemoView, 0, len(existing))
|
||||||
|
for _, item := range existing {
|
||||||
|
if item.GetId() != memoViewID {
|
||||||
|
memoViews = append(memoViews, item)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
updatedMemoView = &storepb.MemoViewsUserSetting_MemoView{
|
||||||
|
Id: item.GetId(),
|
||||||
|
Title: item.GetTitle(),
|
||||||
|
Filter: item.GetFilter(),
|
||||||
|
}
|
||||||
|
if title != nil {
|
||||||
|
updatedMemoView.Title = *title
|
||||||
|
}
|
||||||
|
if filter != nil {
|
||||||
|
updatedMemoView.Filter = *filter
|
||||||
|
}
|
||||||
|
memoViews = append(memoViews, updatedMemoView)
|
||||||
|
}
|
||||||
|
if updatedMemoView == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.upsertUserMemoViews(ctx, userID, memoViews); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "update memo view")
|
||||||
|
}
|
||||||
|
return updatedMemoView, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveUserMemoView removes the memo view of the user.
|
||||||
|
// It reports whether a matching memo view was found.
|
||||||
|
func (s *Store) RemoveUserMemoView(ctx context.Context, userID int32, memoViewID string) (bool, error) {
|
||||||
|
s.memoViewMu.Lock()
|
||||||
|
defer s.memoViewMu.Unlock()
|
||||||
|
|
||||||
|
existing, err := s.GetUserMemoViews(ctx, userID)
|
||||||
|
if err != nil {
|
||||||
|
return false, errors.Wrap(err, "get existing memo views")
|
||||||
|
}
|
||||||
|
|
||||||
|
found := false
|
||||||
|
memoViews := make([]*storepb.MemoViewsUserSetting_MemoView, 0, len(existing))
|
||||||
|
for _, item := range existing {
|
||||||
|
if item.GetId() == memoViewID {
|
||||||
|
found = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
memoViews = append(memoViews, item)
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.upsertUserMemoViews(ctx, userID, memoViews); err != nil {
|
||||||
|
return false, errors.Wrap(err, "remove memo view")
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Store) upsertUserMemoViews(ctx context.Context, userID int32, memoViews []*storepb.MemoViewsUserSetting_MemoView) error {
|
||||||
|
_, err := s.UpsertUserSetting(ctx, &storepb.UserSetting{
|
||||||
|
UserId: userID,
|
||||||
|
Key: storepb.UserSetting_MEMO_VIEWS,
|
||||||
|
Value: &storepb.UserSetting_MemoViews{
|
||||||
|
MemoViews: &storepb.MemoViewsUserSetting{
|
||||||
|
MemoViews: memoViews,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return errors.Wrap(err, "upsert memo views user setting")
|
||||||
|
}
|
||||||
|
|
||||||
func convertUserSettingFromRaw(raw *UserSetting) (*storepb.UserSetting, error) {
|
func convertUserSettingFromRaw(raw *UserSetting) (*storepb.UserSetting, error) {
|
||||||
userSetting := &storepb.UserSetting{
|
userSetting := &storepb.UserSetting{
|
||||||
UserId: raw.UserID,
|
UserId: raw.UserID,
|
||||||
|
|
@ -447,12 +586,12 @@ func convertUserSettingFromRaw(raw *UserSetting) (*storepb.UserSetting, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch raw.Key {
|
switch raw.Key {
|
||||||
case storepb.UserSetting_SHORTCUTS:
|
case storepb.UserSetting_MEMO_VIEWS:
|
||||||
shortcutsUserSetting := &storepb.ShortcutsUserSetting{}
|
memoViewsUserSetting := &storepb.MemoViewsUserSetting{}
|
||||||
if err := protojsonUnmarshaler.Unmarshal([]byte(raw.Value), shortcutsUserSetting); err != nil {
|
if err := protojsonUnmarshaler.Unmarshal([]byte(raw.Value), memoViewsUserSetting); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
userSetting.Value = &storepb.UserSetting_Shortcuts{Shortcuts: shortcutsUserSetting}
|
userSetting.Value = &storepb.UserSetting_MemoViews{MemoViews: memoViewsUserSetting}
|
||||||
case storepb.UserSetting_GENERAL:
|
case storepb.UserSetting_GENERAL:
|
||||||
generalUserSetting := &storepb.GeneralUserSetting{}
|
generalUserSetting := &storepb.GeneralUserSetting{}
|
||||||
if err := protojsonUnmarshaler.Unmarshal([]byte(raw.Value), generalUserSetting); err != nil {
|
if err := protojsonUnmarshaler.Unmarshal([]byte(raw.Value), generalUserSetting); err != nil {
|
||||||
|
|
@ -496,9 +635,9 @@ func convertUserSettingToRaw(userSetting *storepb.UserSetting) (*UserSetting, er
|
||||||
}
|
}
|
||||||
|
|
||||||
switch userSetting.Key {
|
switch userSetting.Key {
|
||||||
case storepb.UserSetting_SHORTCUTS:
|
case storepb.UserSetting_MEMO_VIEWS:
|
||||||
shortcutsUserSetting := userSetting.GetShortcuts()
|
memoViewsUserSetting := userSetting.GetMemoViews()
|
||||||
value, err := protojson.Marshal(shortcutsUserSetting)
|
value, err := protojson.Marshal(memoViewsUserSetting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { getTooltipText } from "./utils";
|
||||||
|
|
||||||
const GRID_STYLES: Record<CalendarSize, { gap: string; headerText: string }> = {
|
const GRID_STYLES: Record<CalendarSize, { gap: string; headerText: string }> = {
|
||||||
small: { gap: "gap-1", headerText: "text-[9px]" },
|
small: { gap: "gap-1", headerText: "text-[9px]" },
|
||||||
default: { gap: "gap-1", headerText: "text-[10px]" },
|
default: { gap: "gap-1", headerText: "text-2xs" },
|
||||||
};
|
};
|
||||||
|
|
||||||
interface WeekdayHeaderProps {
|
interface WeekdayHeaderProps {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
ArchiveIcon,
|
ArchiveIcon,
|
||||||
ArrowRightIcon,
|
ArrowRightIcon,
|
||||||
|
|
@ -11,7 +12,6 @@ import {
|
||||||
InfoIcon,
|
InfoIcon,
|
||||||
LayoutListIcon,
|
LayoutListIcon,
|
||||||
ListIcon,
|
ListIcon,
|
||||||
ListTodoIcon,
|
|
||||||
type LucideIcon,
|
type LucideIcon,
|
||||||
MapIcon,
|
MapIcon,
|
||||||
MenuIcon,
|
MenuIcon,
|
||||||
|
|
@ -19,7 +19,6 @@ import {
|
||||||
PaperclipIcon,
|
PaperclipIcon,
|
||||||
PlusIcon,
|
PlusIcon,
|
||||||
SearchIcon,
|
SearchIcon,
|
||||||
SparklesIcon,
|
|
||||||
Trash2Icon,
|
Trash2Icon,
|
||||||
UserRoundIcon,
|
UserRoundIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
@ -36,7 +35,7 @@ import { Button } from "@/components/ui/button";
|
||||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
||||||
import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
|
import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||||
import { shortcutServiceClient } from "@/connect";
|
import { memoViewServiceClient } from "@/connect";
|
||||||
import { type AttachmentSection, type InboxFilter, useAppSidebar } from "@/contexts/AppSidebarContext";
|
import { type AttachmentSection, type InboxFilter, useAppSidebar } from "@/contexts/AppSidebarContext";
|
||||||
import { useAuth } from "@/contexts/AuthContext";
|
import { useAuth } from "@/contexts/AuthContext";
|
||||||
import { useInstance } from "@/contexts/InstanceContext";
|
import { useInstance } from "@/contexts/InstanceContext";
|
||||||
|
|
@ -45,11 +44,12 @@ import { useAttachmentLibraryStats } from "@/hooks/useAttachmentLibrary";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import { type MemoStatsContext, useFilteredMemoStats } from "@/hooks/useFilteredMemoStats";
|
import { type MemoStatsContext, useFilteredMemoStats } from "@/hooks/useFilteredMemoStats";
|
||||||
import useMediaQuery from "@/hooks/useMediaQuery";
|
import useMediaQuery from "@/hooks/useMediaQuery";
|
||||||
import { useNotifications, useUser } from "@/hooks/useUserQueries";
|
import { useMemoViews, useNotifications, userKeys, useUser } from "@/hooks/useUserQueries";
|
||||||
|
import { handleError } from "@/lib/error";
|
||||||
import {
|
import {
|
||||||
BUILTIN_TASKS_VIEW_ID,
|
BUILTIN_TASKS_VIEW_ID,
|
||||||
getMemoScopePath,
|
getMemoScopePath,
|
||||||
getShortcutId,
|
getMemoViewId,
|
||||||
isMemoScopeRoute,
|
isMemoScopeRoute,
|
||||||
type MemoScope,
|
type MemoScope,
|
||||||
resolveMemoScope,
|
resolveMemoScope,
|
||||||
|
|
@ -57,13 +57,17 @@ import {
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { ROUTES } from "@/router/routes";
|
import { ROUTES } from "@/router/routes";
|
||||||
import { State } from "@/types/proto/api/v1/common_pb";
|
import { State } from "@/types/proto/api/v1/common_pb";
|
||||||
import type { Shortcut } from "@/types/proto/api/v1/shortcut_service_pb";
|
import type { MemoView } from "@/types/proto/api/v1/memo_view_service_pb";
|
||||||
import { User_Role, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb";
|
import { User_Role, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import MemosLogo from "../MemosLogo";
|
import MemosLogo from "../MemosLogo";
|
||||||
import { getSidebarRouteKind } from "./routes";
|
import { getSidebarRouteKind } from "./routes";
|
||||||
import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_ICON_CLASSES } from "./SidebarRow";
|
import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_ICON_CLASSES, sidebarRowStateClasses } from "./SidebarRow";
|
||||||
import SidebarSectionHeader from "./SidebarSectionHeader";
|
import SidebarSection, {
|
||||||
|
SIDEBAR_SECTION_ACTION_BUTTON_CLASSES,
|
||||||
|
SIDEBAR_SECTION_ACTION_ICON_CLASSES,
|
||||||
|
SIDEBAR_SECTION_STACK_CLASSES,
|
||||||
|
} from "./SidebarSection";
|
||||||
import TagsSection from "./TagsSection";
|
import TagsSection from "./TagsSection";
|
||||||
|
|
||||||
const SIDEBAR_HORIZONTAL_PADDING = "px-3";
|
const SIDEBAR_HORIZONTAL_PADDING = "px-3";
|
||||||
|
|
@ -71,35 +75,42 @@ const SIDEBAR_HORIZONTAL_PADDING = "px-3";
|
||||||
const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { shortcuts, refetchSettings } = useAuth();
|
const currentUser = useCurrentUser();
|
||||||
const { shortcut: selectedShortcut, setShortcut } = useMemoFilterContext();
|
const queryClient = useQueryClient();
|
||||||
|
const { data: memoViews = [] } = useMemoViews(currentUser?.name);
|
||||||
|
const { memoView: selectedMemoView, setMemoView } = useMemoFilterContext();
|
||||||
const { setMobileOpen } = useAppSidebar();
|
const { setMobileOpen } = useAppSidebar();
|
||||||
const [deleteTarget, setDeleteTarget] = useState<Shortcut>();
|
const [deleteTarget, setDeleteTarget] = useState<MemoView>();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const handleView = (viewId: string) => {
|
const handleView = (viewId: string) => {
|
||||||
setShortcut(selectedShortcut === viewId ? undefined : viewId);
|
setMemoView(selectedMemoView === viewId ? undefined : viewId);
|
||||||
if (!isMemoScopeRoute(location.pathname)) navigate(ROUTES.HOME);
|
if (!isMemoScopeRoute(location.pathname)) navigate(ROUTES.HOME);
|
||||||
setMobileOpen(false);
|
setMobileOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
navigate(ROUTES.SHORTCUTS, { state: { openCreate: true } });
|
navigate(ROUTES.VIEWS, { state: { openCreate: true } });
|
||||||
setMobileOpen(false);
|
setMobileOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = async () => {
|
const handleDelete = async () => {
|
||||||
if (!deleteTarget) return;
|
if (!deleteTarget) return;
|
||||||
await shortcutServiceClient.deleteShortcut({ name: deleteTarget.name });
|
try {
|
||||||
await refetchSettings();
|
await memoViewServiceClient.deleteMemoView({ name: deleteTarget.name });
|
||||||
if (selectedShortcut === getShortcutId(deleteTarget.name)) setShortcut(undefined);
|
await queryClient.invalidateQueries({ queryKey: userKeys.memoViews(currentUser?.name) });
|
||||||
toast.success(t("setting.shortcut.delete-success", { title: deleteTarget.title }));
|
if (selectedMemoView === getMemoViewId(deleteTarget.name)) setMemoView(undefined);
|
||||||
|
toast.success(t("setting.memo-view.delete-success", { title: deleteTarget.title }));
|
||||||
|
} catch (error: unknown) {
|
||||||
|
handleError(error, toast.error, { context: "Delete memo view" });
|
||||||
|
} finally {
|
||||||
setDeleteTarget(undefined);
|
setDeleteTarget(undefined);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<SidebarSection
|
||||||
<SidebarSectionHeader
|
label={t("common.views")}
|
||||||
action={
|
action={
|
||||||
!manageActive && (
|
!manageActive && (
|
||||||
<div className="flex items-center gap-0.5">
|
<div className="flex items-center gap-0.5">
|
||||||
|
|
@ -107,47 +118,33 @@ const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
className="size-5 rounded text-muted-foreground"
|
className={SIDEBAR_SECTION_ACTION_BUTTON_CLASSES}
|
||||||
onClick={handleCreate}
|
onClick={handleCreate}
|
||||||
aria-label={t("common.create")}
|
aria-label={t("common.create")}
|
||||||
>
|
>
|
||||||
<PlusIcon className="size-3.5" />
|
<PlusIcon className={SIDEBAR_SECTION_ACTION_ICON_CLASSES} strokeWidth={1.8} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t("common.views")}
|
|
||||||
</SidebarSectionHeader>
|
|
||||||
<div className="space-y-0.5">
|
|
||||||
<SidebarRow
|
<SidebarRow
|
||||||
active={!manageActive && selectedShortcut === BUILTIN_TASKS_VIEW_ID}
|
active={!manageActive && selectedMemoView === BUILTIN_TASKS_VIEW_ID}
|
||||||
icon={ListTodoIcon}
|
|
||||||
label={t("common.tasks")}
|
label={t("common.tasks")}
|
||||||
onClick={() => handleView(BUILTIN_TASKS_VIEW_ID)}
|
onClick={() => handleView(BUILTIN_TASKS_VIEW_ID)}
|
||||||
/>
|
/>
|
||||||
{shortcuts.map((shortcut) => {
|
{memoViews.map((memoView) => {
|
||||||
const id = getShortcutId(shortcut.name);
|
const id = getMemoViewId(memoView.name);
|
||||||
const active = !manageActive && selectedShortcut === id;
|
const active = !manageActive && selectedMemoView === id;
|
||||||
return (
|
return (
|
||||||
<div
|
<div key={memoView.name} className={cn(SIDEBAR_ROW_CLASSES, "group/view", sidebarRowStateClasses(active))}>
|
||||||
key={shortcut.name}
|
|
||||||
className={cn(
|
|
||||||
SIDEBAR_ROW_CLASSES,
|
|
||||||
"group/view",
|
|
||||||
active
|
|
||||||
? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
|
|
||||||
: "text-muted-foreground hover:bg-sidebar-accent/65 hover:text-foreground",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleView(id)}
|
onClick={() => handleView(id)}
|
||||||
aria-pressed={active || undefined}
|
aria-pressed={active || undefined}
|
||||||
className="flex h-full min-w-0 flex-1 items-center gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
|
className="flex h-full min-w-0 flex-1 items-center gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
|
||||||
>
|
>
|
||||||
<SparklesIcon className={SIDEBAR_ROW_ICON_CLASSES} strokeWidth={1.8} />
|
<span className="min-w-0 flex-1 truncate">{memoView.title}</span>
|
||||||
<span className="min-w-0 flex-1 truncate">{shortcut.title}</span>
|
|
||||||
</button>
|
</button>
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger
|
<DropdownMenuTrigger
|
||||||
|
|
@ -156,24 +153,23 @@ const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
||||||
<span
|
<span
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
aria-label={`${t("common.edit")} ${shortcut.title}`}
|
aria-label={`${t("common.edit")} ${memoView.title}`}
|
||||||
className="-mr-1 flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-opacity hover:bg-background/70 md:opacity-0 md:group-hover/view:opacity-100 md:focus-visible:opacity-100 data-popup-open:opacity-100"
|
className="-mr-1 flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-opacity hover:bg-background/70 md:opacity-0 md:group-hover/view:opacity-100 md:focus-visible:opacity-100 data-popup-open:opacity-100"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MoreHorizontalIcon className="size-3.5" />
|
<MoreHorizontalIcon className="size-3.5" />
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end" sideOffset={2} size="sm">
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(ROUTES.SHORTCUTS, { state: { shortcut } });
|
navigate(ROUTES.VIEWS, { state: { memoView } });
|
||||||
setMobileOpen(false);
|
setMobileOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common.edit")}
|
{t("common.edit")}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem variant="destructive" onClick={() => setDeleteTarget(shortcut)}>
|
<DropdownMenuItem variant="destructive" onClick={() => setDeleteTarget(memoView)}>
|
||||||
<Trash2Icon className="size-4" />
|
|
||||||
{t("common.delete")}
|
{t("common.delete")}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|
@ -181,18 +177,17 @@ const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
{manageActive && <SidebarRow active icon={MoreHorizontalIcon} label={t("common.shortcuts")} />}
|
{manageActive && <SidebarRow active icon={MoreHorizontalIcon} label={t("common.manage")} />}
|
||||||
</div>
|
|
||||||
<ConfirmDialog
|
<ConfirmDialog
|
||||||
open={!!deleteTarget}
|
open={!!deleteTarget}
|
||||||
onOpenChange={(open) => !open && setDeleteTarget(undefined)}
|
onOpenChange={(open) => !open && setDeleteTarget(undefined)}
|
||||||
title={t("setting.shortcut.delete-confirm", { title: deleteTarget?.title ?? "" })}
|
title={t("setting.memo-view.delete-confirm", { title: deleteTarget?.title ?? "" })}
|
||||||
confirmLabel={t("common.delete")}
|
confirmLabel={t("common.delete")}
|
||||||
cancelLabel={t("common.cancel")}
|
cancelLabel={t("common.cancel")}
|
||||||
onConfirm={handleDelete}
|
onConfirm={handleDelete}
|
||||||
confirmVariant="destructive"
|
confirmVariant="destructive"
|
||||||
/>
|
/>
|
||||||
</section>
|
</SidebarSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -210,14 +205,15 @@ const ProfileMode = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-0.5">
|
<SidebarSection label={t("common.profile")}>
|
||||||
<SidebarRow active={active === "memos"} icon={LayoutListIcon} label={t("common.memos")} onClick={() => setMode("memos")} />
|
<SidebarRow active={active === "memos"} icon={LayoutListIcon} label={t("common.memos")} onClick={() => setMode("memos")} />
|
||||||
<SidebarRow active={active === "map"} icon={MapIcon} label={t("common.map")} onClick={() => setMode("map")} />
|
<SidebarRow active={active === "map"} icon={MapIcon} label={t("common.map")} onClick={() => setMode("map")} />
|
||||||
</div>
|
</SidebarSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) => {
|
const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) => {
|
||||||
|
const t = useTranslate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const currentUser = useCurrentUser();
|
const currentUser = useCurrentUser();
|
||||||
const md = useMediaQuery("md");
|
const md = useMediaQuery("md");
|
||||||
|
|
@ -243,11 +239,11 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) =>
|
||||||
const filterTarget = onCollectionRoute ? undefined : context === "explore" ? ROUTES.EXPLORE : ROUTES.HOME;
|
const filterTarget = onCollectionRoute ? undefined : context === "explore" ? ROUTES.EXPLORE : ROUTES.HOME;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3.5">
|
<div className={SIDEBAR_SECTION_STACK_CLASSES}>
|
||||||
{context === "profile" && <ProfileMode />}
|
{context === "profile" && <ProfileMode />}
|
||||||
<section>
|
<SidebarSection ariaLabel={t("common.statistics")}>
|
||||||
<StatisticsView statisticsData={statistics} navigationTarget={filterTarget} onDateSelect={() => setMobileOpen(false)} />
|
<StatisticsView statisticsData={statistics} navigationTarget={filterTarget} onDateSelect={() => setMobileOpen(false)} />
|
||||||
</section>
|
</SidebarSection>
|
||||||
{showViews && <ViewsSection />}
|
{showViews && <ViewsSection />}
|
||||||
<TagsSection tagCount={tags} navigationTarget={filterTarget} scope={statsUserName ?? context} onSelect={() => setMobileOpen(false)} />
|
<TagsSection tagCount={tags} navigationTarget={filterTarget} scope={statsUserName ?? context} onSelect={() => setMobileOpen(false)} />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -272,7 +268,7 @@ const AttachmentsSidebarContent = () => {
|
||||||
{ value: "unused", icon: Trash2Icon, label: t("attachment-library.labels.unused"), count: isComplete ? stats.unused : undefined },
|
{ value: "unused", icon: Trash2Icon, label: t("attachment-library.labels.unused"), count: isComplete ? stats.unused : undefined },
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div className="space-y-0.5">
|
<SidebarSection label={t("common.attachments")}>
|
||||||
{rows.map((row) => (
|
{rows.map((row) => (
|
||||||
<SidebarRow
|
<SidebarRow
|
||||||
key={row.value}
|
key={row.value}
|
||||||
|
|
@ -286,7 +282,7 @@ const AttachmentsSidebarContent = () => {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</SidebarSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -310,7 +306,7 @@ const InboxSidebarContent = () => {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div className="space-y-0.5">
|
<SidebarSection label={t("common.inbox")}>
|
||||||
{rows.map((row) => (
|
{rows.map((row) => (
|
||||||
<SidebarRow
|
<SidebarRow
|
||||||
key={row.value}
|
key={row.value}
|
||||||
|
|
@ -324,7 +320,7 @@ const InboxSidebarContent = () => {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</SidebarSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -343,29 +339,16 @@ const SettingsSidebarContent = () => {
|
||||||
key={section.key}
|
key={section.key}
|
||||||
to={`${ROUTES.SETTING}#${section.key}`}
|
to={`${ROUTES.SETTING}#${section.key}`}
|
||||||
onClick={() => setMobileOpen(false)}
|
onClick={() => setMobileOpen(false)}
|
||||||
className={cn(
|
className={cn(SIDEBAR_ROW_CLASSES, sidebarRowStateClasses(currentSection === section.key))}
|
||||||
SIDEBAR_ROW_CLASSES,
|
|
||||||
currentSection === section.key
|
|
||||||
? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
|
|
||||||
: "text-muted-foreground hover:bg-sidebar-accent/65 hover:text-foreground",
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<section.icon className={SIDEBAR_ROW_ICON_CLASSES} strokeWidth={1.8} />
|
<section.icon className={SIDEBAR_ROW_ICON_CLASSES} strokeWidth={1.8} />
|
||||||
<span className="truncate">{t(section.labelKey)}</span>
|
<span className="truncate">{t(section.labelKey)}</span>
|
||||||
</Link>
|
</Link>
|
||||||
));
|
));
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3.5">
|
<div className={SIDEBAR_SECTION_STACK_CLASSES}>
|
||||||
<section>
|
<SidebarSection label={t("common.basic")}>{renderSections(basic)}</SidebarSection>
|
||||||
<SidebarSectionHeader>{t("common.basic")}</SidebarSectionHeader>
|
{isHost && <SidebarSection label={t("common.admin")}>{renderSections(admin)}</SidebarSection>}
|
||||||
<div className="space-y-0.5">{renderSections(basic)}</div>
|
|
||||||
</section>
|
|
||||||
{isHost && (
|
|
||||||
<section>
|
|
||||||
<SidebarSectionHeader>{t("common.admin")}</SidebarSectionHeader>
|
|
||||||
<div className="space-y-0.5">{renderSections(admin)}</div>
|
|
||||||
</section>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -391,7 +374,7 @@ const RouteSidebarContent = () => {
|
||||||
if (kind === "home" || kind === "archived" || kind === "explore" || kind === "profile") {
|
if (kind === "home" || kind === "archived" || kind === "explore" || kind === "profile") {
|
||||||
return <CollectionSidebarContent context={kind} />;
|
return <CollectionSidebarContent context={kind} />;
|
||||||
}
|
}
|
||||||
if (kind === "shortcuts") return <ViewsSection manageActive />;
|
if (kind === "views") return <ViewsSection manageActive />;
|
||||||
if (kind === "attachments") return <AttachmentsSidebarContent />;
|
if (kind === "attachments") return <AttachmentsSidebarContent />;
|
||||||
if (kind === "inbox") return <InboxSidebarContent />;
|
if (kind === "inbox") return <InboxSidebarContent />;
|
||||||
if (kind === "settings") return <SettingsSidebarContent />;
|
if (kind === "settings") return <SettingsSidebarContent />;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ import { Button } from "@/components/ui/button";
|
||||||
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog";
|
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { useAppSidebar } from "@/contexts/AppSidebarContext";
|
import { useAppSidebar } from "@/contexts/AppSidebarContext";
|
||||||
import { useAuth } from "@/contexts/AuthContext";
|
|
||||||
import { type MemoFilter, replaceFiltersByFactor, stringifyFilters, useMemoFilterContext } from "@/contexts/MemoFilterContext";
|
import { type MemoFilter, replaceFiltersByFactor, stringifyFilters, useMemoFilterContext } from "@/contexts/MemoFilterContext";
|
||||||
import { BUILTIN_TASKS_VIEW_ID, getShortcutId, isMemoScopeRoute } from "@/lib/memo-views";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
|
import { useMemoViews } from "@/hooks/useUserQueries";
|
||||||
|
import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoScopeRoute } from "@/lib/memo-views";
|
||||||
import { ROUTES } from "@/router/routes";
|
import { ROUTES } from "@/router/routes";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
|
|
@ -30,15 +31,16 @@ const QuickFindDialog = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { shortcuts } = useAuth();
|
const currentUser = useCurrentUser();
|
||||||
const { filters, setFilters, setShortcut, shortcut } = useMemoFilterContext();
|
const { data: memoViews = [] } = useMemoViews(currentUser?.name);
|
||||||
|
const { filters, setFilters, setMemoView, memoView } = useMemoFilterContext();
|
||||||
const { quickFindOpen, setQuickFindOpen } = useAppSidebar();
|
const { quickFindOpen, setQuickFindOpen } = useAppSidebar();
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const collectionRoute = isQuickFindCollectionRoute(location.pathname);
|
const collectionRoute = isQuickFindCollectionRoute(location.pathname);
|
||||||
const viewApplies = isMemoScopeRoute(location.pathname);
|
const viewApplies = isMemoScopeRoute(location.pathname);
|
||||||
const selectedShortcut = viewApplies ? shortcuts.find((item) => getShortcutId(item.name) === shortcut) : undefined;
|
const selectedMemoView = viewApplies ? memoViews.find((item) => getMemoViewId(item.name) === memoView) : undefined;
|
||||||
const scopeLabel =
|
const scopeLabel =
|
||||||
viewApplies && shortcut === BUILTIN_TASKS_VIEW_ID ? t("common.tasks") : selectedShortcut?.title || getScopeLabel(location.pathname, t);
|
viewApplies && memoView === BUILTIN_TASKS_VIEW_ID ? t("common.tasks") : selectedMemoView?.title || getScopeLabel(location.pathname, t);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
|
|
@ -70,7 +72,7 @@ const QuickFindDialog = () => {
|
||||||
} else {
|
} else {
|
||||||
const filterQuery = stringifyFilters(nextFilters);
|
const filterQuery = stringifyFilters(nextFilters);
|
||||||
setFilters(nextFilters);
|
setFilters(nextFilters);
|
||||||
setShortcut(undefined);
|
setMemoView(undefined);
|
||||||
navigate(filterQuery ? `${ROUTES.HOME}?filter=${filterQuery}` : ROUTES.HOME);
|
navigate(filterQuery ? `${ROUTES.HOME}?filter=${filterQuery}` : ROUTES.HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ import { cn } from "@/lib/utils";
|
||||||
* rows that carry a trailing control put the box on a wrapper and focus on the button
|
* rows that carry a trailing control put the box on a wrapper and focus on the button
|
||||||
* inside it.
|
* inside it.
|
||||||
*/
|
*/
|
||||||
export const SIDEBAR_ROW_BOX_CLASSES =
|
export const SIDEBAR_ROW_BOX_CLASSES = "group flex h-[30px] w-full min-w-0 items-center gap-2 rounded-md px-2 text-ui transition-colors";
|
||||||
"group flex h-[30px] w-full min-w-0 items-center gap-2 rounded-md px-2 text-[13px] leading-[18px] transition-colors";
|
|
||||||
|
|
||||||
/** Goes on whichever element in a row actually takes focus. */
|
/** Goes on whichever element in a row actually takes focus. */
|
||||||
export const SIDEBAR_ROW_FOCUS_CLASSES = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";
|
export const SIDEBAR_ROW_FOCUS_CLASSES = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";
|
||||||
|
|
@ -18,7 +17,7 @@ export const SIDEBAR_ROW_FOCUS_CLASSES = "focus-visible:outline-none focus-visib
|
||||||
export const SIDEBAR_ROW_CLASSES = `${SIDEBAR_ROW_BOX_CLASSES} ${SIDEBAR_ROW_FOCUS_CLASSES}`;
|
export const SIDEBAR_ROW_CLASSES = `${SIDEBAR_ROW_BOX_CLASSES} ${SIDEBAR_ROW_FOCUS_CLASSES}`;
|
||||||
|
|
||||||
export const SIDEBAR_ROW_ICON_CLASSES = "size-[15px] shrink-0 opacity-75";
|
export const SIDEBAR_ROW_ICON_CLASSES = "size-[15px] shrink-0 opacity-75";
|
||||||
export const SIDEBAR_ROW_COUNT_CLASSES = "text-[11px] tabular-nums text-muted-foreground/60";
|
export const SIDEBAR_ROW_COUNT_CLASSES = "text-2xs tabular-nums text-muted-foreground/60";
|
||||||
|
|
||||||
/** Idle and selected colouring for a row box, kept in one place so lists cannot drift apart. */
|
/** Idle and selected colouring for a row box, kept in one place so lists cannot drift apart. */
|
||||||
export const sidebarRowStateClasses = (active?: boolean) =>
|
export const sidebarRowStateClasses = (active?: boolean) =>
|
||||||
|
|
@ -28,7 +27,7 @@ export const sidebarRowStateClasses = (active?: boolean) =>
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
icon: LucideIcon;
|
icon?: LucideIcon;
|
||||||
label: ReactNode;
|
label: ReactNode;
|
||||||
count?: number;
|
count?: number;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
|
@ -42,7 +41,7 @@ const SidebarRow = ({ active, icon: Icon, label, count, onClick, trailing }: Pro
|
||||||
aria-pressed={active || undefined}
|
aria-pressed={active || undefined}
|
||||||
className={cn(SIDEBAR_ROW_CLASSES, sidebarRowStateClasses(active))}
|
className={cn(SIDEBAR_ROW_CLASSES, sidebarRowStateClasses(active))}
|
||||||
>
|
>
|
||||||
<Icon className={SIDEBAR_ROW_ICON_CLASSES} strokeWidth={1.8} />
|
{Icon && <Icon className={SIDEBAR_ROW_ICON_CLASSES} strokeWidth={1.8} />}
|
||||||
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
|
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
|
||||||
{count != null && count > 0 && <span className={SIDEBAR_ROW_COUNT_CLASSES}>{count}</span>}
|
{count != null && count > 0 && <span className={SIDEBAR_ROW_COUNT_CLASSES}>{count}</span>}
|
||||||
{trailing}
|
{trailing}
|
||||||
|
|
|
||||||
26
web/src/components/AppSidebar/SidebarSection.tsx
Normal file
26
web/src/components/AppSidebar/SidebarSection.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
import type { ReactNode } from "react";
|
||||||
|
import SidebarSectionHeader from "./SidebarSectionHeader";
|
||||||
|
|
||||||
|
export const SIDEBAR_SECTION_STACK_CLASSES = "flex flex-col gap-3.5";
|
||||||
|
export const SIDEBAR_SECTION_CONTENT_CLASSES = "flex flex-col gap-0.5";
|
||||||
|
export const SIDEBAR_SECTION_ACTION_BUTTON_CLASSES =
|
||||||
|
"size-5 rounded text-muted-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";
|
||||||
|
export const SIDEBAR_SECTION_ACTION_ACTIVE_CLASSES = "bg-sidebar-accent text-foreground";
|
||||||
|
export const SIDEBAR_SECTION_ACTION_ICON_CLASSES = "size-3.5";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
label?: ReactNode;
|
||||||
|
ariaLabel?: string;
|
||||||
|
children: ReactNode;
|
||||||
|
action?: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SidebarSection = ({ label, ariaLabel, children, action }: Props) => (
|
||||||
|
<section className="w-full" aria-label={ariaLabel}>
|
||||||
|
{label !== undefined && <SidebarSectionHeader action={action}>{label}</SidebarSectionHeader>}
|
||||||
|
{/* Flex gap keeps popup focus guards from affecting the visible row rhythm. */}
|
||||||
|
<div className={SIDEBAR_SECTION_CONTENT_CLASSES}>{children}</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default SidebarSection;
|
||||||
|
|
@ -7,9 +7,7 @@ interface Props {
|
||||||
|
|
||||||
const SidebarSectionHeader = ({ children, action }: Props) => (
|
const SidebarSectionHeader = ({ children, action }: Props) => (
|
||||||
<div className="mb-0.5 flex h-5 min-w-0 items-center justify-between gap-2">
|
<div className="mb-0.5 flex h-5 min-w-0 items-center justify-between gap-2">
|
||||||
<span className="min-w-0 truncate ps-2 text-[10px] font-semibold uppercase tracking-[0.09em] text-muted-foreground/55 select-none">
|
<h2 className="min-w-0 truncate ps-2 text-2xs font-normal uppercase tracking-wide text-muted-foreground/55 select-none">{children}</h2>
|
||||||
{children}
|
|
||||||
</span>
|
|
||||||
{action}
|
{action}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,11 @@ import { cn } from "@/lib/utils";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import TagTree from "../TagTree";
|
import TagTree from "../TagTree";
|
||||||
import { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_COUNT_CLASSES, SIDEBAR_ROW_ICON_CLASSES, sidebarRowStateClasses } from "./SidebarRow";
|
import { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_COUNT_CLASSES, SIDEBAR_ROW_ICON_CLASSES, sidebarRowStateClasses } from "./SidebarRow";
|
||||||
import SidebarSectionHeader from "./SidebarSectionHeader";
|
import SidebarSection, {
|
||||||
|
SIDEBAR_SECTION_ACTION_ACTIVE_CLASSES,
|
||||||
|
SIDEBAR_SECTION_ACTION_BUTTON_CLASSES,
|
||||||
|
SIDEBAR_SECTION_ACTION_ICON_CLASSES,
|
||||||
|
} from "./SidebarSection";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
tagCount: Record<string, number>;
|
tagCount: Record<string, number>;
|
||||||
|
|
@ -92,48 +96,43 @@ const TagsSection = ({ tagCount, onSelect, navigationTarget, scope }: Props) =>
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<SidebarSection
|
||||||
<SidebarSectionHeader
|
label={t("common.tags")}
|
||||||
action={
|
action={
|
||||||
<div className="flex items-center gap-0.5" role="group" aria-label={t("common.tags")}>
|
<div className="flex items-center gap-0.5" role="group" aria-label={t("common.tags")}>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
aria-label={t("common.tags")}
|
aria-label={`${t("common.tags")}: ${t("memo.layout-list")}`}
|
||||||
aria-pressed={!treeMode}
|
aria-pressed={!treeMode}
|
||||||
className={cn("size-5 rounded text-muted-foreground", !treeMode && "bg-accent text-foreground")}
|
className={cn(SIDEBAR_SECTION_ACTION_BUTTON_CLASSES, !treeMode && SIDEBAR_SECTION_ACTION_ACTIVE_CLASSES)}
|
||||||
onClick={() => setTreeMode(false)}
|
onClick={() => setTreeMode(false)}
|
||||||
>
|
>
|
||||||
<ListIcon className="size-3.5" strokeWidth={1.8} />
|
<ListIcon className={SIDEBAR_SECTION_ACTION_ICON_CLASSES} strokeWidth={1.8} />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
aria-label={`${t("common.tags")}: ${t("common.tree-mode")}`}
|
aria-label={`${t("common.tags")}: ${t("common.tree-mode")}`}
|
||||||
aria-pressed={treeMode}
|
aria-pressed={treeMode}
|
||||||
className={cn("size-5 rounded text-muted-foreground", treeMode && "bg-accent text-foreground")}
|
className={cn(SIDEBAR_SECTION_ACTION_BUTTON_CLASSES, treeMode && SIDEBAR_SECTION_ACTION_ACTIVE_CLASSES)}
|
||||||
onClick={() => setTreeMode(true)}
|
onClick={() => setTreeMode(true)}
|
||||||
>
|
>
|
||||||
<ListTreeIcon className="size-3.5" strokeWidth={1.8} />
|
<ListTreeIcon className={SIDEBAR_SECTION_ACTION_ICON_CLASSES} strokeWidth={1.8} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="inline-flex items-center gap-1.5 leading-none">
|
|
||||||
{t("common.tags")}
|
|
||||||
<span className="font-normal leading-none tracking-normal text-muted-foreground/45">{tags.length}</span>
|
|
||||||
</span>
|
|
||||||
</SidebarSectionHeader>
|
|
||||||
{treeMode ? (
|
{treeMode ? (
|
||||||
<TagTree key={scope} tagAmounts={tags} activeTag={activeTag} scope={scope} onTagClick={handleTagClick} />
|
<TagTree key={scope} tagAmounts={tags} activeTag={activeTag} scope={scope} onTagClick={handleTagClick} />
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-0.5">
|
<>
|
||||||
{tags.map(([tag, amount]) => (
|
{tags.map(([tag, amount]) => (
|
||||||
<FlatTagRow key={tag} tag={tag} amount={amount} active={activeTags.has(tag)} onClick={() => handleTagClick(tag)} />
|
<FlatTagRow key={tag} tag={tag} amount={amount} active={activeTags.has(tag)} onClick={() => handleTagClick(tag)} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</>
|
||||||
)}
|
)}
|
||||||
</section>
|
</SidebarSection>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ import { matchPath } from "react-router-dom";
|
||||||
import { isMemoScopeRoute, type MemoScope, resolveMemoScope } from "@/lib/memo-views";
|
import { isMemoScopeRoute, type MemoScope, resolveMemoScope } from "@/lib/memo-views";
|
||||||
import { ROUTES } from "@/router/routes";
|
import { ROUTES } from "@/router/routes";
|
||||||
|
|
||||||
export type SidebarRouteKind = MemoScope | "profile" | "shortcuts" | "attachments" | "inbox" | "settings" | "memo" | "empty";
|
export type SidebarRouteKind = MemoScope | "profile" | "views" | "attachments" | "inbox" | "settings" | "memo" | "empty";
|
||||||
|
|
||||||
export const getSidebarRouteKind = (path: string): SidebarRouteKind => {
|
export const getSidebarRouteKind = (path: string): SidebarRouteKind => {
|
||||||
if (isMemoScopeRoute(path)) return resolveMemoScope(path);
|
if (isMemoScopeRoute(path)) return resolveMemoScope(path);
|
||||||
if (matchPath("/u/:username", path)) return "profile";
|
if (matchPath("/u/:username", path)) return "profile";
|
||||||
if (path === ROUTES.SHORTCUTS) return "shortcuts";
|
if (path === ROUTES.VIEWS) return "views";
|
||||||
if (path === ROUTES.ATTACHMENTS) return "attachments";
|
if (path === ROUTES.ATTACHMENTS) return "attachments";
|
||||||
if (path === ROUTES.INBOX) return "inbox";
|
if (path === ROUTES.INBOX) return "inbox";
|
||||||
if (path === ROUTES.SETTING) return "settings";
|
if (path === ROUTES.SETTING) return "settings";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { useMemo, useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_ICON_CLASSES } from "@/components/AppSidebar/SidebarRow";
|
import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_ICON_CLASSES } from "@/components/AppSidebar/SidebarRow";
|
||||||
import SidebarSectionHeader from "@/components/AppSidebar/SidebarSectionHeader";
|
import SidebarSection, { SIDEBAR_SECTION_STACK_CLASSES } from "@/components/AppSidebar/SidebarSection";
|
||||||
import { extractHeadings } from "@/components/MemoContent/pipeline";
|
import { extractHeadings } from "@/components/MemoContent/pipeline";
|
||||||
import { getRelationBuckets, getRelationMemo } from "@/components/MemoMetadata/Relation/relationHelpers";
|
import { getRelationBuckets, getRelationMemo } from "@/components/MemoMetadata/Relation/relationHelpers";
|
||||||
import { useResolvedRelationMemos } from "@/components/MemoMetadata/Relation/useResolvedRelationMemos";
|
import { useResolvedRelationMemos } from "@/components/MemoMetadata/Relation/useResolvedRelationMemos";
|
||||||
|
|
@ -28,15 +28,6 @@ interface Props {
|
||||||
forceReadonly?: boolean;
|
forceReadonly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Section = ({ label, children }: { label: string; children: React.ReactNode }) => (
|
|
||||||
<section className="w-full">
|
|
||||||
<SidebarSectionHeader>{label}</SidebarSectionHeader>
|
|
||||||
{/* flex gap, not space-y: open popups insert fixed-position focus guards next to
|
|
||||||
their trigger, and space-y's :not(:last-child) margin would count them (#6154). */}
|
|
||||||
<div className="flex flex-col gap-0.5">{children}</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
|
|
||||||
const BacklinkRow = ({ relation, snippet }: { relation: MemoRelation; snippet: string }) => {
|
const BacklinkRow = ({ relation, snippet }: { relation: MemoRelation; snippet: string }) => {
|
||||||
const { ref, title } = useOverflowTitle<HTMLSpanElement>(snippet);
|
const { ref, title } = useOverflowTitle<HTMLSpanElement>(snippet);
|
||||||
const relatedMemo = getRelationMemo(relation, "referenced");
|
const relatedMemo = getRelationMemo(relation, "referenced");
|
||||||
|
|
@ -103,8 +94,8 @@ const MemoDetailSidebar = ({ memo, className, onShareImageOpen, forceReadonly =
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("relative flex w-full select-none flex-col gap-3.5", className)}>
|
<div className={cn("relative w-full select-none", SIDEBAR_SECTION_STACK_CLASSES, className)}>
|
||||||
<Section label={t("common.actions")}>
|
<SidebarSection label={t("common.actions")}>
|
||||||
{canPin && (
|
{canPin && (
|
||||||
<SidebarRow
|
<SidebarRow
|
||||||
icon={memo.pinned ? BookmarkCheckIcon : BookmarkIcon}
|
icon={memo.pinned ? BookmarkCheckIcon : BookmarkIcon}
|
||||||
|
|
@ -143,21 +134,21 @@ const MemoDetailSidebar = ({ memo, className, onShareImageOpen, forceReadonly =
|
||||||
)}
|
)}
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Section>
|
</SidebarSection>
|
||||||
|
|
||||||
{headings.length > 1 && (
|
{headings.length > 1 && (
|
||||||
<Section label={t("memo.outline")}>
|
<SidebarSection label={t("memo.outline")}>
|
||||||
<MemoOutline headings={headings} memoName={memo.name} />
|
<MemoOutline headings={headings} memoName={memo.name} />
|
||||||
</Section>
|
</SidebarSection>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!forceReadonly && referenced.length > 0 && (
|
{!forceReadonly && referenced.length > 0 && (
|
||||||
<Section label={t("common.referenced-by")}>
|
<SidebarSection label={t("common.referenced-by")}>
|
||||||
{referenced.map((relation) => {
|
{referenced.map((relation) => {
|
||||||
const relatedMemo = getRelationMemo(relation, "referenced");
|
const relatedMemo = getRelationMemo(relation, "referenced");
|
||||||
return <BacklinkRow key={`referenced-${relatedMemo?.name}`} relation={relation} snippet={backlinkSnippet(relation)} />;
|
return <BacklinkRow key={`referenced-${relatedMemo?.name}`} relation={relation} snippet={backlinkSnippet(relation)} />;
|
||||||
})}
|
})}
|
||||||
</Section>
|
</SidebarSection>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{sharePanelOpen && <MemoSharePanel memoName={memo.name} open={sharePanelOpen} onClose={() => setSharePanelOpen(false)} />}
|
{sharePanelOpen && <MemoSharePanel memoName={memo.name} open={sharePanelOpen} onClose={() => setSharePanelOpen(false)} />}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { useEffect, useMemo, useRef, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
|
import { SIDEBAR_ROW_BOX_CLASSES } from "@/components/AppSidebar/SidebarRow";
|
||||||
import type { HeadingItem } from "@/components/MemoContent/pipeline";
|
import type { HeadingItem } from "@/components/MemoContent/pipeline";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { findAnchorTarget, findMemoContentRoot } from "@/utils/markdown-manipulation";
|
import { findAnchorTarget, findMemoContentRoot } from "@/utils/markdown-manipulation";
|
||||||
|
|
@ -62,7 +63,7 @@ const MemoOutline = ({ headings, memoName }: MemoOutlineProps) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="relative flex flex-col">
|
<nav className="relative flex flex-col gap-0.5">
|
||||||
{headings.map((heading, index) => {
|
{headings.map((heading, index) => {
|
||||||
const active = heading.slug === activeSlug;
|
const active = heading.slug === activeSlug;
|
||||||
return (
|
return (
|
||||||
|
|
@ -72,7 +73,8 @@ const MemoOutline = ({ headings, memoName }: MemoOutlineProps) => {
|
||||||
onClick={(e) => handleClick(e, heading.slug)}
|
onClick={(e) => handleClick(e, heading.slug)}
|
||||||
aria-current={active ? "location" : undefined}
|
aria-current={active ? "location" : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
"relative flex h-[30px] min-w-0 items-center rounded-md pr-2 text-[13px] leading-[18px] transition-colors",
|
SIDEBAR_ROW_BOX_CLASSES,
|
||||||
|
"relative",
|
||||||
heading.level === minLevel && "font-medium",
|
heading.level === minLevel && "font-medium",
|
||||||
active ? "text-foreground" : "text-muted-foreground/70 hover:bg-sidebar-accent/65 hover:text-foreground",
|
active ? "text-foreground" : "text-muted-foreground/70 hover:bg-sidebar-accent/65 hover:text-foreground",
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { Columns2Icon, Columns3Icon, InfinityIcon, type LucideIcon, Rows3Icon, SlidersHorizontalIcon } from "lucide-react";
|
import { Columns2Icon, Columns3Icon, InfinityIcon, type LucideIcon, Rows3Icon, SlidersHorizontalIcon } from "lucide-react";
|
||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
|
import { SIDEBAR_SECTION_ACTION_BUTTON_CLASSES, SIDEBAR_SECTION_ACTION_ICON_CLASSES } from "@/components/AppSidebar/SidebarSection";
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||||
import { Switch } from "@/components/ui/switch";
|
import { Switch } from "@/components/ui/switch";
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||||
|
|
@ -181,11 +182,13 @@ function MemoDisplaySettingMenu({ className }: Props) {
|
||||||
<PopoverTrigger
|
<PopoverTrigger
|
||||||
aria-label={t("memo.view-options")}
|
aria-label={t("memo.view-options")}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex size-5 items-center justify-center rounded-[4px] text-muted-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:bg-sidebar-accent focus-visible:text-foreground data-popup-open:bg-sidebar-accent data-popup-open:text-foreground",
|
"flex items-center justify-center",
|
||||||
|
SIDEBAR_SECTION_ACTION_BUTTON_CLASSES,
|
||||||
|
"data-popup-open:bg-sidebar-accent data-popup-open:text-foreground",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<SlidersHorizontalIcon className="size-3" strokeWidth={1.8} />
|
<SlidersHorizontalIcon className={SIDEBAR_SECTION_ACTION_ICON_CLASSES} strokeWidth={1.8} />
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent side="top">{t("memo.view-options")}</TooltipContent>
|
<TooltipContent side="top">{t("memo.view-options")}</TooltipContent>
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ const PagedMemoList = (props: Props) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Tag settings decide whether sensitive memo content must be blurred. Keep that
|
// Tag settings decide whether sensitive memo content must be blurred. Keep that
|
||||||
// privacy boundary, but do not wait for unrelated shortcuts or instance settings.
|
// privacy boundary, but do not wait for unrelated memo views or instance settings.
|
||||||
const isDisplayPending = isLoading || !isUserSettingsInitialized;
|
const isDisplayPending = isLoading || !isUserSettingsInitialized;
|
||||||
const showLoader = useDelayedFlag(isDisplayPending, LOADING_INDICATOR_DELAY_MS);
|
const showLoader = useDelayedFlag(isDisplayPending, LOADING_INDICATOR_DELAY_MS);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@ import dayjs from "dayjs";
|
||||||
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
||||||
import { memo } from "react";
|
import { memo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { SIDEBAR_ROW_BOX_CLASSES } from "@/components/AppSidebar/SidebarRow";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { addMonths } from "@/lib/calendar-utils";
|
import { addMonths } from "@/lib/calendar-utils";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
import type { MonthNavigatorProps } from "@/types/statistics";
|
import type { MonthNavigatorProps } from "@/types/statistics";
|
||||||
|
|
||||||
export const MonthNavigator = memo(({ visibleMonth, onMonthChange }: MonthNavigatorProps) => {
|
export const MonthNavigator = memo(({ visibleMonth, onMonthChange }: MonthNavigatorProps) => {
|
||||||
|
|
@ -13,20 +15,18 @@ export const MonthNavigator = memo(({ visibleMonth, onMonthChange }: MonthNaviga
|
||||||
const handleNextMonth = () => onMonthChange(addMonths(visibleMonth, 1));
|
const handleNextMonth = () => onMonthChange(addMonths(visibleMonth, 1));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="mb-1.5 flex w-full items-center justify-between gap-3">
|
<header className={cn(SIDEBAR_ROW_BOX_CLASSES, "mb-1.5 justify-between")}>
|
||||||
<h2 className="min-w-0 truncate text-[15px] font-semibold leading-7 tracking-[-0.015em] text-foreground/90 select-none">
|
<h2 className="min-w-0 truncate font-medium tracking-[-0.015em] text-foreground/90 select-none">{monthLabel}</h2>
|
||||||
{monthLabel}
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<nav className="flex shrink-0 items-center gap-1" aria-label={t("common.month-navigation")}>
|
<nav className="flex shrink-0 items-center gap-0.5" aria-label={t("common.month-navigation")}>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
onClick={handlePrevMonth}
|
onClick={handlePrevMonth}
|
||||||
aria-label={t("common.previous-month")}
|
aria-label={t("common.previous-month")}
|
||||||
className="size-7 rounded-md text-muted-foreground/65 hover:bg-muted/50 hover:text-foreground/90"
|
className="size-6 rounded text-muted-foreground/65 hover:bg-muted/50 hover:text-foreground/90"
|
||||||
>
|
>
|
||||||
<ChevronLeftIcon className="size-[15px]" strokeWidth={1.75} />
|
<ChevronLeftIcon className="size-4" strokeWidth={1.75} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|
@ -34,9 +34,9 @@ export const MonthNavigator = memo(({ visibleMonth, onMonthChange }: MonthNaviga
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
onClick={handleNextMonth}
|
onClick={handleNextMonth}
|
||||||
aria-label={t("common.next-month")}
|
aria-label={t("common.next-month")}
|
||||||
className="size-7 rounded-md text-muted-foreground/65 hover:bg-muted/50 hover:text-foreground/90"
|
className="size-6 rounded text-muted-foreground/65 hover:bg-muted/50 hover:text-foreground/90"
|
||||||
>
|
>
|
||||||
<ChevronRightIcon className="size-[15px]" strokeWidth={1.75} />
|
<ChevronRightIcon className="size-4" strokeWidth={1.75} />
|
||||||
</Button>
|
</Button>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const StatisticsView = (props: Props) => {
|
||||||
const selectedDate = filters.find((filter) => filter.factor === "displayTime")?.value;
|
const selectedDate = filters.find((filter) => filter.factor === "displayTime")?.value;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="group mt-0.5 flex w-full flex-col text-muted-foreground animate-fade-in">
|
<div className="group flex w-full flex-col text-muted-foreground animate-fade-in">
|
||||||
<MonthNavigator visibleMonth={visibleMonthString} onMonthChange={setVisibleMonthString} />
|
<MonthNavigator visibleMonth={visibleMonthString} onMonthChange={setVisibleMonthString} />
|
||||||
|
|
||||||
<div className="w-full animate-scale-in">
|
<div className="w-full animate-scale-in">
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,24 @@ const DropdownMenu = ({ ...props }: DropdownMenuPrimitive.Root.Props) => {
|
||||||
|
|
||||||
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
||||||
|
|
||||||
|
type DropdownMenuSize = "default" | "sm";
|
||||||
|
|
||||||
|
const DropdownMenuSizeContext = React.createContext<DropdownMenuSize>("default");
|
||||||
|
|
||||||
const DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuPrimitive.Trigger.Props>(({ ...props }, ref) => {
|
const DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuPrimitive.Trigger.Props>(({ ...props }, ref) => {
|
||||||
return <DropdownMenuPrimitive.Trigger ref={ref} data-slot="dropdown-menu-trigger" {...props} />;
|
return <DropdownMenuPrimitive.Trigger ref={ref} data-slot="dropdown-menu-trigger" {...props} />;
|
||||||
});
|
});
|
||||||
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
||||||
|
|
||||||
type DropdownMenuContentProps = DropdownMenuPrimitive.Popup.Props &
|
type DropdownMenuContentProps = DropdownMenuPrimitive.Popup.Props &
|
||||||
Pick<DropdownMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">;
|
Pick<DropdownMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset"> & {
|
||||||
|
size?: DropdownMenuSize;
|
||||||
|
};
|
||||||
|
|
||||||
const DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(
|
const DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(
|
||||||
({ className, align, alignOffset, side, sideOffset = 4, ...props }, ref) => {
|
({ className, align, alignOffset, side, sideOffset = 4, size = "default", ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
|
<DropdownMenuSizeContext.Provider value={size}>
|
||||||
<DropdownMenuPrimitive.Portal>
|
<DropdownMenuPrimitive.Portal>
|
||||||
<DropdownMenuPrimitive.Positioner
|
<DropdownMenuPrimitive.Positioner
|
||||||
align={align}
|
align={align}
|
||||||
|
|
@ -32,8 +39,10 @@ const DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContent
|
||||||
<DropdownMenuPrimitive.Popup
|
<DropdownMenuPrimitive.Popup
|
||||||
ref={ref}
|
ref={ref}
|
||||||
data-slot="dropdown-menu-content"
|
data-slot="dropdown-menu-content"
|
||||||
|
data-size={size}
|
||||||
className={cn(
|
className={cn(
|
||||||
"bg-popover text-popover-foreground z-dropdown max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",
|
"bg-popover text-popover-foreground z-dropdown max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto border outline-none",
|
||||||
|
size === "sm" ? "min-w-24 rounded p-0.5 shadow-sm" : "min-w-[8rem] rounded-md p-1 shadow-md",
|
||||||
popupMotionClasses,
|
popupMotionClasses,
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
|
@ -41,6 +50,7 @@ const DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContent
|
||||||
/>
|
/>
|
||||||
</DropdownMenuPrimitive.Positioner>
|
</DropdownMenuPrimitive.Positioner>
|
||||||
</DropdownMenuPrimitive.Portal>
|
</DropdownMenuPrimitive.Portal>
|
||||||
|
</DropdownMenuSizeContext.Provider>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
@ -59,13 +69,18 @@ function DropdownMenuItem({
|
||||||
inset?: boolean;
|
inset?: boolean;
|
||||||
variant?: "default" | "destructive";
|
variant?: "default" | "destructive";
|
||||||
}) {
|
}) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.Item
|
<DropdownMenuPrimitive.Item
|
||||||
data-slot="dropdown-menu-item"
|
data-slot="dropdown-menu-item"
|
||||||
data-inset={inset}
|
data-inset={inset}
|
||||||
data-variant={variant}
|
data-variant={variant}
|
||||||
className={cn(
|
className={cn(
|
||||||
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
||||||
|
size === "sm"
|
||||||
|
? "min-h-7 gap-1.5 px-2 py-1 text-ui data-[inset]:pl-7 [&_svg:not([class*='size-'])]:size-3.5"
|
||||||
|
: "gap-2 px-2 py-1.5 text-sm data-[inset]:pl-8 [&_svg:not([class*='size-'])]:size-4",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
@ -74,11 +89,16 @@ function DropdownMenuItem({
|
||||||
}
|
}
|
||||||
|
|
||||||
function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuPrimitive.CheckboxItem.Props) {
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuPrimitive.CheckboxItem.Props) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.CheckboxItem
|
<DropdownMenuPrimitive.CheckboxItem
|
||||||
data-slot="dropdown-menu-checkbox-item"
|
data-slot="dropdown-menu-checkbox-item"
|
||||||
className={cn(
|
className={cn(
|
||||||
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
||||||
|
size === "sm"
|
||||||
|
? "min-h-7 gap-1.5 py-1 pr-2 pl-7 text-ui [&_svg:not([class*='size-'])]:size-3.5"
|
||||||
|
: "gap-2 py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
checked={checked}
|
checked={checked}
|
||||||
|
|
@ -86,7 +106,7 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }: Dr
|
||||||
>
|
>
|
||||||
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
||||||
<DropdownMenuPrimitive.CheckboxItemIndicator>
|
<DropdownMenuPrimitive.CheckboxItemIndicator>
|
||||||
<CheckIcon className="size-4" />
|
<CheckIcon className={size === "sm" ? "size-3.5" : "size-4"} />
|
||||||
</DropdownMenuPrimitive.CheckboxItemIndicator>
|
</DropdownMenuPrimitive.CheckboxItemIndicator>
|
||||||
</span>
|
</span>
|
||||||
{children}
|
{children}
|
||||||
|
|
@ -99,11 +119,16 @@ function DropdownMenuRadioGroup({ ...props }: DropdownMenuPrimitive.RadioGroup.P
|
||||||
}
|
}
|
||||||
|
|
||||||
function DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuPrimitive.RadioItem.Props) {
|
function DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuPrimitive.RadioItem.Props) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.RadioItem
|
<DropdownMenuPrimitive.RadioItem
|
||||||
data-slot="dropdown-menu-radio-item"
|
data-slot="dropdown-menu-radio-item"
|
||||||
className={cn(
|
className={cn(
|
||||||
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
||||||
|
size === "sm"
|
||||||
|
? "min-h-7 gap-1.5 py-1 pr-2 pl-7 text-ui [&_svg:not([class*='size-'])]:size-3.5"
|
||||||
|
: "gap-2 py-1.5 pr-2 pl-8 text-sm [&_svg:not([class*='size-'])]:size-4",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
@ -125,31 +150,37 @@ function DropdownMenuLabel({
|
||||||
}: DropdownMenuPrimitive.GroupLabel.Props & {
|
}: DropdownMenuPrimitive.GroupLabel.Props & {
|
||||||
inset?: boolean;
|
inset?: boolean;
|
||||||
}) {
|
}) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.GroupLabel
|
<DropdownMenuPrimitive.GroupLabel
|
||||||
data-slot="dropdown-menu-label"
|
data-slot="dropdown-menu-label"
|
||||||
data-inset={inset}
|
data-inset={inset}
|
||||||
className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)}
|
className={cn("px-2 font-medium", size === "sm" ? "py-1 text-ui data-[inset]:pl-7" : "py-1.5 text-sm data-[inset]:pl-8", className)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DropdownMenuSeparator({ className, ...props }: DropdownMenuPrimitive.Separator.Props) {
|
function DropdownMenuSeparator({ className, ...props }: DropdownMenuPrimitive.Separator.Props) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.Separator
|
<DropdownMenuPrimitive.Separator
|
||||||
data-slot="dropdown-menu-separator"
|
data-slot="dropdown-menu-separator"
|
||||||
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
className={cn("bg-border h-px", size === "sm" ? "-mx-0.5 my-0.5" : "-mx-1 my-1", className)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
data-slot="dropdown-menu-shortcut"
|
data-slot="dropdown-menu-shortcut"
|
||||||
className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)}
|
className={cn("text-muted-foreground ml-auto tracking-widest", size === "sm" ? "text-2xs" : "text-xs", className)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
@ -167,24 +198,41 @@ function DropdownMenuSubTrigger({
|
||||||
}: DropdownMenuPrimitive.SubmenuTrigger.Props & {
|
}: DropdownMenuPrimitive.SubmenuTrigger.Props & {
|
||||||
inset?: boolean;
|
inset?: boolean;
|
||||||
}) {
|
}) {
|
||||||
|
const size = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenuPrimitive.SubmenuTrigger
|
<DropdownMenuPrimitive.SubmenuTrigger
|
||||||
data-slot="dropdown-menu-sub-trigger"
|
data-slot="dropdown-menu-sub-trigger"
|
||||||
data-inset={inset}
|
data-inset={inset}
|
||||||
className={cn(
|
className={cn(
|
||||||
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
||||||
|
size === "sm"
|
||||||
|
? "min-h-7 gap-1.5 px-2 py-1 text-ui data-[inset]:pl-7 [&_svg:not([class*='size-'])]:size-3.5"
|
||||||
|
: "gap-2 px-2 py-1.5 text-sm data-[inset]:pl-8 [&_svg:not([class*='size-'])]:size-4",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
<ChevronRightIcon className="ml-auto size-4" />
|
<ChevronRightIcon className={cn("ml-auto", size === "sm" ? "size-3.5" : "size-4")} />
|
||||||
</DropdownMenuPrimitive.SubmenuTrigger>
|
</DropdownMenuPrimitive.SubmenuTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DropdownMenuSubContent({ className, ...props }: DropdownMenuContentProps) {
|
function DropdownMenuSubContent({ className, size, ...props }: DropdownMenuContentProps) {
|
||||||
return <DropdownMenuContent align="start" alignOffset={-3} side="right" sideOffset={0} className={cn("w-auto", className)} {...props} />;
|
const inheritedSize = React.useContext(DropdownMenuSizeContext);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DropdownMenuContent
|
||||||
|
align="start"
|
||||||
|
alignOffset={-3}
|
||||||
|
side="right"
|
||||||
|
sideOffset={0}
|
||||||
|
size={size ?? inheritedSize}
|
||||||
|
className={cn("w-auto", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { AuthService } from "./types/proto/api/v1/auth_service_pb";
|
||||||
import { IdentityProviderService } from "./types/proto/api/v1/idp_service_pb";
|
import { IdentityProviderService } from "./types/proto/api/v1/idp_service_pb";
|
||||||
import { InstanceService } from "./types/proto/api/v1/instance_service_pb";
|
import { InstanceService } from "./types/proto/api/v1/instance_service_pb";
|
||||||
import { MemoService } from "./types/proto/api/v1/memo_service_pb";
|
import { MemoService } from "./types/proto/api/v1/memo_service_pb";
|
||||||
import { ShortcutService } from "./types/proto/api/v1/shortcut_service_pb";
|
import { MemoViewService } from "./types/proto/api/v1/memo_view_service_pb";
|
||||||
import { UserService } from "./types/proto/api/v1/user_service_pb";
|
import { UserService } from "./types/proto/api/v1/user_service_pb";
|
||||||
import { redirectOnAuthFailure } from "./utils/auth-redirect";
|
import { redirectOnAuthFailure } from "./utils/auth-redirect";
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@ export const userServiceClient = createClient(UserService, transport);
|
||||||
export const memoServiceClient = createClient(MemoService, transport);
|
export const memoServiceClient = createClient(MemoService, transport);
|
||||||
export const attachmentServiceClient = createClient(AttachmentService, transport);
|
export const attachmentServiceClient = createClient(AttachmentService, transport);
|
||||||
export const aiServiceClient = createClient(AIService, transport);
|
export const aiServiceClient = createClient(AIService, transport);
|
||||||
export const shortcutServiceClient = createClient(ShortcutService, transport);
|
export const memoViewServiceClient = createClient(MemoViewService, transport);
|
||||||
|
|
||||||
// Configuration service clients
|
// Configuration service clients
|
||||||
export const identityProviderServiceClient = createClient(IdentityProviderService, transport);
|
export const identityProviderServiceClient = createClient(IdentityProviderService, transport);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { createContext, type ReactNode, useCallback, useContext, useMemo, useState } from "react";
|
import { createContext, type ReactNode, useCallback, useContext, useMemo, useState } from "react";
|
||||||
import { clearAccessToken, getAccessToken } from "@/auth-state";
|
import { clearAccessToken, getAccessToken } from "@/auth-state";
|
||||||
import { authServiceClient, refreshAccessToken, shortcutServiceClient, userServiceClient } from "@/connect";
|
import { authServiceClient, refreshAccessToken, userServiceClient } from "@/connect";
|
||||||
import { userKeys } from "@/hooks/useUserQueries";
|
import { userKeys } from "@/hooks/useUserQueries";
|
||||||
import type { Shortcut } from "@/types/proto/api/v1/shortcut_service_pb";
|
|
||||||
import type {
|
import type {
|
||||||
User,
|
User,
|
||||||
UserSetting_GeneralSetting,
|
UserSetting_GeneralSetting,
|
||||||
|
|
@ -16,7 +15,6 @@ interface AuthState {
|
||||||
userGeneralSetting: UserSetting_GeneralSetting | undefined;
|
userGeneralSetting: UserSetting_GeneralSetting | undefined;
|
||||||
userWebhooksSetting: UserSetting_WebhooksSetting | undefined;
|
userWebhooksSetting: UserSetting_WebhooksSetting | undefined;
|
||||||
userTagsSetting: UserSetting_TagsSetting | undefined;
|
userTagsSetting: UserSetting_TagsSetting | undefined;
|
||||||
shortcuts: Shortcut[];
|
|
||||||
/** Authentication identity has settled, while user settings may still be loading. */
|
/** Authentication identity has settled, while user settings may still be loading. */
|
||||||
isIdentityInitialized: boolean;
|
isIdentityInitialized: boolean;
|
||||||
/** User settings that affect memo presentation are safe to consume. */
|
/** User settings that affect memo presentation are safe to consume. */
|
||||||
|
|
@ -40,7 +38,6 @@ const UNAUTHENTICATED_STATE: AuthState = {
|
||||||
userGeneralSetting: undefined,
|
userGeneralSetting: undefined,
|
||||||
userWebhooksSetting: undefined,
|
userWebhooksSetting: undefined,
|
||||||
userTagsSetting: undefined,
|
userTagsSetting: undefined,
|
||||||
shortcuts: [],
|
|
||||||
isIdentityInitialized: true,
|
isIdentityInitialized: true,
|
||||||
isUserSettingsInitialized: true,
|
isUserSettingsInitialized: true,
|
||||||
isInitialized: true,
|
isInitialized: true,
|
||||||
|
|
@ -54,7 +51,6 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||||
userGeneralSetting: undefined,
|
userGeneralSetting: undefined,
|
||||||
userWebhooksSetting: undefined,
|
userWebhooksSetting: undefined,
|
||||||
userTagsSetting: undefined,
|
userTagsSetting: undefined,
|
||||||
shortcuts: [],
|
|
||||||
isIdentityInitialized: false,
|
isIdentityInitialized: false,
|
||||||
isUserSettingsInitialized: false,
|
isUserSettingsInitialized: false,
|
||||||
isInitialized: false,
|
isInitialized: false,
|
||||||
|
|
@ -62,7 +58,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchUserSettings = useCallback(async (userName: string) => {
|
const fetchUserSettings = useCallback(async (userName: string) => {
|
||||||
const userSettingsPromise = userServiceClient.listUserSettings({ parent: userName }).then(({ settings }) => {
|
const { settings } = await userServiceClient.listUserSettings({ parent: userName });
|
||||||
const generalSetting = settings.find((s) => s.value.case === "generalSetting");
|
const generalSetting = settings.find((s) => s.value.case === "generalSetting");
|
||||||
const webhooksSetting = settings.find((s) => s.value.case === "webhooksSetting");
|
const webhooksSetting = settings.find((s) => s.value.case === "webhooksSetting");
|
||||||
const tagsSetting = settings.find((s) => s.value.case === "tagsSetting");
|
const tagsSetting = settings.find((s) => s.value.case === "tagsSetting");
|
||||||
|
|
@ -72,8 +68,8 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||||
userTagsSetting: tagsSetting?.value.case === "tagsSetting" ? tagsSetting.value.value : undefined,
|
userTagsSetting: tagsSetting?.value.case === "tagsSetting" ? tagsSetting.value.value : undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tag settings control sensitive-content blurring. Publish them as soon
|
// Tag settings control sensitive-content blurring. Publish them as soon as
|
||||||
// as this request settles instead of waiting for unrelated shortcuts.
|
// this request settles; memo views are managed separately by React Query.
|
||||||
setState((prev) =>
|
setState((prev) =>
|
||||||
prev.currentUser?.name === userName
|
prev.currentUser?.name === userName
|
||||||
? {
|
? {
|
||||||
|
|
@ -85,17 +81,6 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||||
);
|
);
|
||||||
|
|
||||||
return userSettings;
|
return userSettings;
|
||||||
});
|
|
||||||
|
|
||||||
const [userSettings, { shortcuts }] = await Promise.all([
|
|
||||||
userSettingsPromise,
|
|
||||||
shortcutServiceClient.listShortcuts({ parent: userName }),
|
|
||||||
]);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...userSettings,
|
|
||||||
shortcuts,
|
|
||||||
};
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const initialize = useCallback(async () => {
|
const initialize = useCallback(async () => {
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ export const replaceFiltersByFactor = (filters: MemoFilter[], factor: FilterFact
|
||||||
|
|
||||||
interface MemoFilterContextValue {
|
interface MemoFilterContextValue {
|
||||||
filters: MemoFilter[];
|
filters: MemoFilter[];
|
||||||
shortcut: string | undefined;
|
memoView: string | undefined;
|
||||||
hasActiveFilters: boolean;
|
hasActiveFilters: boolean;
|
||||||
getFiltersByFactor: (factor: FilterFactor) => MemoFilter[];
|
getFiltersByFactor: (factor: FilterFactor) => MemoFilter[];
|
||||||
setFilters: (filters: MemoFilter[]) => void;
|
setFilters: (filters: MemoFilter[]) => void;
|
||||||
|
|
@ -55,7 +55,7 @@ interface MemoFilterContextValue {
|
||||||
removeFilter: (predicate: (f: MemoFilter) => boolean) => void;
|
removeFilter: (predicate: (f: MemoFilter) => boolean) => void;
|
||||||
removeFiltersByFactor: (factor: FilterFactor) => void;
|
removeFiltersByFactor: (factor: FilterFactor) => void;
|
||||||
clearAllFilters: () => void;
|
clearAllFilters: () => void;
|
||||||
setShortcut: (shortcut?: string) => void;
|
setMemoView: (memoView?: string) => void;
|
||||||
hasFilter: (filter: MemoFilter) => boolean;
|
hasFilter: (filter: MemoFilter) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ export function MemoFilterProvider({ children }: { children: ReactNode }) {
|
||||||
const [filters, setFiltersState] = useState<MemoFilter[]>(() => {
|
const [filters, setFiltersState] = useState<MemoFilter[]>(() => {
|
||||||
return parseFilterQuery(searchParams.get("filter"));
|
return parseFilterQuery(searchParams.get("filter"));
|
||||||
});
|
});
|
||||||
const [shortcut, setShortcutState] = useState<string | undefined>(undefined);
|
const [memoView, setMemoViewState] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
// Sync URL to state when URL changes externally
|
// Sync URL to state when URL changes externally
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -119,20 +119,20 @@ export function MemoFilterProvider({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
const clearAllFilters = useCallback(() => {
|
const clearAllFilters = useCallback(() => {
|
||||||
setFiltersState([]);
|
setFiltersState([]);
|
||||||
setShortcutState(undefined);
|
setMemoViewState(undefined);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const setShortcut = useCallback((newShortcut?: string) => {
|
const setMemoView = useCallback((newMemoView?: string) => {
|
||||||
setShortcutState(newShortcut);
|
setMemoViewState(newMemoView);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const hasFilter = useCallback((filter: MemoFilter) => filters.some((f) => getMemoFilterKey(f) === getMemoFilterKey(filter)), [filters]);
|
const hasFilter = useCallback((filter: MemoFilter) => filters.some((f) => getMemoFilterKey(f) === getMemoFilterKey(filter)), [filters]);
|
||||||
|
|
||||||
const hasActiveFilters = filters.length > 0 || shortcut !== undefined;
|
const hasActiveFilters = filters.length > 0 || memoView !== undefined;
|
||||||
const value = useMemo(
|
const value = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
filters,
|
filters,
|
||||||
shortcut,
|
memoView,
|
||||||
hasActiveFilters,
|
hasActiveFilters,
|
||||||
getFiltersByFactor,
|
getFiltersByFactor,
|
||||||
setFilters,
|
setFilters,
|
||||||
|
|
@ -140,12 +140,12 @@ export function MemoFilterProvider({ children }: { children: ReactNode }) {
|
||||||
removeFilter,
|
removeFilter,
|
||||||
removeFiltersByFactor,
|
removeFiltersByFactor,
|
||||||
clearAllFilters,
|
clearAllFilters,
|
||||||
setShortcut,
|
setMemoView,
|
||||||
hasFilter,
|
hasFilter,
|
||||||
}),
|
}),
|
||||||
[
|
[
|
||||||
filters,
|
filters,
|
||||||
shortcut,
|
memoView,
|
||||||
hasActiveFilters,
|
hasActiveFilters,
|
||||||
getFiltersByFactor,
|
getFiltersByFactor,
|
||||||
setFilters,
|
setFilters,
|
||||||
|
|
@ -153,7 +153,7 @@ export function MemoFilterProvider({ children }: { children: ReactNode }) {
|
||||||
removeFilter,
|
removeFilter,
|
||||||
removeFiltersByFactor,
|
removeFiltersByFactor,
|
||||||
clearAllFilters,
|
clearAllFilters,
|
||||||
setShortcut,
|
setMemoView,
|
||||||
hasFilter,
|
hasFilter,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { useAuth } from "@/contexts/AuthContext";
|
|
||||||
import { type MemoFilter, useMemoFilterContext } from "@/contexts/MemoFilterContext";
|
import { type MemoFilter, useMemoFilterContext } from "@/contexts/MemoFilterContext";
|
||||||
import { BUILTIN_TASKS_VIEW_FILTER, BUILTIN_TASKS_VIEW_ID, getShortcutId } from "@/lib/memo-views";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
|
import { useMemoViews } from "@/hooks/useUserQueries";
|
||||||
|
import { BUILTIN_TASKS_VIEW_FILTER, BUILTIN_TASKS_VIEW_ID, getMemoViewId } from "@/lib/memo-views";
|
||||||
import { buildMemoCreatorFilter } from "@/lib/resource-names";
|
import { buildMemoCreatorFilter } from "@/lib/resource-names";
|
||||||
import { Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
import { Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||||
|
|
||||||
|
|
@ -40,26 +41,26 @@ const getLocalDayTimestampRange = (value: string): { startTimestamp: number; end
|
||||||
|
|
||||||
export interface UseMemoFiltersOptions {
|
export interface UseMemoFiltersOptions {
|
||||||
creatorName?: string;
|
creatorName?: string;
|
||||||
includeShortcuts?: boolean;
|
includeMemoViews?: boolean;
|
||||||
includePinned?: boolean;
|
includePinned?: boolean;
|
||||||
visibilities?: Visibility[];
|
visibilities?: Visibility[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BuildMemoFilterOptions {
|
interface BuildMemoFilterOptions {
|
||||||
creatorName?: string;
|
creatorName?: string;
|
||||||
currentShortcut?: string;
|
currentMemoView?: string;
|
||||||
filters: MemoFilter[];
|
filters: MemoFilter[];
|
||||||
includePinned: boolean;
|
includePinned: boolean;
|
||||||
selectedShortcutFilter?: string;
|
selectedMemoViewFilter?: string;
|
||||||
visibilities?: Visibility[];
|
visibilities?: Visibility[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buildMemoFilter = ({
|
export const buildMemoFilter = ({
|
||||||
creatorName,
|
creatorName,
|
||||||
currentShortcut,
|
currentMemoView,
|
||||||
filters,
|
filters,
|
||||||
includePinned,
|
includePinned,
|
||||||
selectedShortcutFilter,
|
selectedMemoViewFilter,
|
||||||
visibilities,
|
visibilities,
|
||||||
}: BuildMemoFilterOptions): string | undefined => {
|
}: BuildMemoFilterOptions): string | undefined => {
|
||||||
const conditions: string[] = [];
|
const conditions: string[] = [];
|
||||||
|
|
@ -71,10 +72,10 @@ export const buildMemoFilter = ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentShortcut === BUILTIN_TASKS_VIEW_ID) {
|
if (currentMemoView === BUILTIN_TASKS_VIEW_ID) {
|
||||||
conditions.push(BUILTIN_TASKS_VIEW_FILTER);
|
conditions.push(BUILTIN_TASKS_VIEW_FILTER);
|
||||||
} else if (selectedShortcutFilter) {
|
} else if (selectedMemoViewFilter) {
|
||||||
conditions.push(selectedShortcutFilter);
|
conditions.push(selectedMemoViewFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const filter of filters) {
|
for (const filter of filters) {
|
||||||
|
|
@ -109,27 +110,28 @@ export const buildMemoFilter = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useMemoFilters = (options: UseMemoFiltersOptions = {}): string | undefined => {
|
export const useMemoFilters = (options: UseMemoFiltersOptions = {}): string | undefined => {
|
||||||
const { creatorName, includeShortcuts = false, includePinned = false, visibilities } = options;
|
const { creatorName, includeMemoViews = false, includePinned = false, visibilities } = options;
|
||||||
|
|
||||||
const { shortcuts } = useAuth();
|
const currentUser = useCurrentUser();
|
||||||
const { filters, shortcut: currentShortcut } = useMemoFilterContext();
|
const { data: memoViews = [] } = useMemoViews(includeMemoViews ? currentUser?.name : undefined);
|
||||||
|
const { filters, memoView: currentMemoView } = useMemoFilterContext();
|
||||||
|
|
||||||
// Get selected shortcut if needed
|
// Get the selected memo view if needed.
|
||||||
const selectedShortcutFilter = useMemo(() => {
|
const selectedMemoViewFilter = useMemo(() => {
|
||||||
if (!includeShortcuts || currentShortcut === BUILTIN_TASKS_VIEW_ID) return undefined;
|
if (!includeMemoViews || currentMemoView === BUILTIN_TASKS_VIEW_ID) return undefined;
|
||||||
return shortcuts.find((shortcut) => getShortcutId(shortcut.name) === currentShortcut)?.filter;
|
return memoViews.find((memoView) => getMemoViewId(memoView.name) === currentMemoView)?.filter;
|
||||||
}, [includeShortcuts, currentShortcut, shortcuts]);
|
}, [includeMemoViews, currentMemoView, memoViews]);
|
||||||
|
|
||||||
return useMemo(
|
return useMemo(
|
||||||
() =>
|
() =>
|
||||||
buildMemoFilter({
|
buildMemoFilter({
|
||||||
creatorName,
|
creatorName,
|
||||||
currentShortcut: includeShortcuts ? currentShortcut : undefined,
|
currentMemoView: includeMemoViews ? currentMemoView : undefined,
|
||||||
filters,
|
filters,
|
||||||
includePinned,
|
includePinned,
|
||||||
selectedShortcutFilter,
|
selectedMemoViewFilter,
|
||||||
visibilities,
|
visibilities,
|
||||||
}),
|
}),
|
||||||
[creatorName, currentShortcut, filters, includePinned, includeShortcuts, selectedShortcutFilter, visibilities],
|
[creatorName, currentMemoView, filters, includePinned, includeMemoViews, selectedMemoViewFilter, visibilities],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { create } from "@bufbuild/protobuf";
|
import { create } from "@bufbuild/protobuf";
|
||||||
import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";
|
import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";
|
||||||
import { queryOptions, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
import { queryOptions, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { shortcutServiceClient, userServiceClient } from "@/connect";
|
import { memoViewServiceClient, userServiceClient } from "@/connect";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import { buildUserSettingName, userNamePrefix } from "@/lib/resource-names";
|
import { buildUserSettingName, userNamePrefix } from "@/lib/resource-names";
|
||||||
import { mergeTagCounts } from "@/lib/tag";
|
import { mergeTagCounts } from "@/lib/tag";
|
||||||
|
|
@ -29,7 +29,7 @@ export const userKeys = {
|
||||||
userStats: (name: string) => [...userKeys.stats(), name] as const,
|
userStats: (name: string) => [...userKeys.stats(), name] as const,
|
||||||
allUserStats: (request: Partial<ListAllUserStatsQuery>) => [...userKeys.stats(), "all", request] as const,
|
allUserStats: (request: Partial<ListAllUserStatsQuery>) => [...userKeys.stats(), "all", request] as const,
|
||||||
currentUser: () => [...userKeys.all, "current"] as const,
|
currentUser: () => [...userKeys.all, "current"] as const,
|
||||||
shortcuts: () => [...userKeys.all, "shortcuts"] as const,
|
memoViews: (parent?: string) => [...userKeys.all, "memoViews", parent] as const,
|
||||||
notifications: () => [...userKeys.all, "notifications"] as const,
|
notifications: () => [...userKeys.all, "notifications"] as const,
|
||||||
byNames: (names: string[]) => [...userKeys.all, "byNames", ...[...names].sort()] as const,
|
byNames: (names: string[]) => [...userKeys.all, "byNames", ...[...names].sort()] as const,
|
||||||
byUsernames: (usernames: string[]) => [...userKeys.all, "byUsernames", ...[...usernames].sort()] as const,
|
byUsernames: (usernames: string[]) => [...userKeys.all, "byUsernames", ...[...usernames].sort()] as const,
|
||||||
|
|
@ -74,13 +74,15 @@ export function useAllUserStats(request: Partial<ListAllUserStatsQuery> = {}, op
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useShortcuts() {
|
export function useMemoViews(parent?: string) {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: userKeys.shortcuts(),
|
queryKey: userKeys.memoViews(parent),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { shortcuts } = await shortcutServiceClient.listShortcuts({});
|
if (!parent) return [];
|
||||||
return shortcuts;
|
const { memoViews } = await memoViewServiceClient.listMemoViews({ parent });
|
||||||
|
return memoViews;
|
||||||
},
|
},
|
||||||
|
enabled: !!parent,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,12 +174,9 @@ export function useUserSettings(parent?: string) {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: [...userKeys.all, "settings", parent],
|
queryKey: [...userKeys.all, "settings", parent],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!parent) return { settings: [], shortcuts: [] };
|
if (!parent) return { settings: [] };
|
||||||
const [{ settings }, { shortcuts }] = await Promise.all([
|
const { settings } = await userServiceClient.listUserSettings({ parent });
|
||||||
userServiceClient.listUserSettings({ parent }),
|
return { settings };
|
||||||
shortcutServiceClient.listShortcuts({ parent }),
|
|
||||||
]);
|
|
||||||
return { settings, shortcuts };
|
|
||||||
},
|
},
|
||||||
enabled: !!parent,
|
enabled: !!parent,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ export type MemoScope = "home" | "explore" | "archived";
|
||||||
export const BUILTIN_TASKS_VIEW_ID = "__built_in_tasks__";
|
export const BUILTIN_TASKS_VIEW_ID = "__built_in_tasks__";
|
||||||
export const BUILTIN_TASKS_VIEW_FILTER = "has_task_list && has_incomplete_tasks";
|
export const BUILTIN_TASKS_VIEW_FILTER = "has_task_list && has_incomplete_tasks";
|
||||||
|
|
||||||
export const getShortcutId = (name: string): string => {
|
export const getMemoViewId = (name: string): string => {
|
||||||
const parts = name.split("/");
|
const parts = name.split("/");
|
||||||
return parts.length === 4 ? parts[3] : name;
|
return parts.length === 4 ? parts[3] : name;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { extendTailwindMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
const mergeTailwindClasses = extendTailwindMerge({
|
||||||
|
extend: {
|
||||||
|
theme: {
|
||||||
|
text: ["2xs", "ui"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return mergeTailwindClasses(clsx(inputs));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "آخر تحديث في",
|
"last-updated-at": "آخر تحديث في",
|
||||||
"learn-more": "تعلم المزيد",
|
"learn-more": "تعلم المزيد",
|
||||||
"link": "الرابط",
|
"link": "الرابط",
|
||||||
|
"manage": "إدارة",
|
||||||
"map": "خريطة",
|
"map": "خريطة",
|
||||||
"mark": "تعليم",
|
"mark": "تعليم",
|
||||||
"memo": "مذكرة",
|
"memo": "مذكرة",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "تحديد",
|
"select": "تحديد",
|
||||||
"settings": "الإعدادات",
|
"settings": "الإعدادات",
|
||||||
"share": "مشاركة",
|
"share": "مشاركة",
|
||||||
"shortcut-filter": "تصفية الاختصارات",
|
|
||||||
"shortcuts": "اختصارات",
|
|
||||||
"sign-in": "تسجيل الدخول",
|
"sign-in": "تسجيل الدخول",
|
||||||
"sign-in-with": "تسجيل دخول بواسطة {{provider}}",
|
"sign-in-with": "تسجيل دخول بواسطة {{provider}}",
|
||||||
"sign-out": "تسجيل خروج",
|
"sign-out": "تسجيل خروج",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "اسم المستخدم",
|
"username": "اسم المستخدم",
|
||||||
"version": "الإصدار",
|
"version": "الإصدار",
|
||||||
"visibility": "الرؤية",
|
"visibility": "الرؤية",
|
||||||
|
"views": "طرق العرض",
|
||||||
"yourself": "نفسك"
|
"yourself": "نفسك"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "السمة",
|
"theme": "السمة",
|
||||||
"label": "التفضيلات"
|
"label": "التفضيلات"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "هل أنت متأكد من حذف الاختصار `{{title}}`؟",
|
"delete-confirm": "هل أنت متأكد من حذف طريقة العرض `{{title}}`؟",
|
||||||
"delete-success": "تم حذف الاختصار `{{title}}` بنجاح"
|
"delete-success": "تم حذف طريقة العرض `{{title}}` بنجاح"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "نقطة نهاية التفويض",
|
"authorization-endpoint": "نقطة نهاية التفويض",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Последна актуализация на",
|
"last-updated-at": "Последна актуализация на",
|
||||||
"learn-more": "Научете повече",
|
"learn-more": "Научете повече",
|
||||||
"link": "Връзка",
|
"link": "Връзка",
|
||||||
|
"manage": "Управление",
|
||||||
"map": "Карта",
|
"map": "Карта",
|
||||||
"mark": "Марк",
|
"mark": "Марк",
|
||||||
"memo": "Бележка",
|
"memo": "Бележка",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Изберете",
|
"select": "Изберете",
|
||||||
"settings": "Настройки",
|
"settings": "Настройки",
|
||||||
"share": "Споделете",
|
"share": "Споделете",
|
||||||
"shortcut-filter": "Филтър за бърз достъп",
|
|
||||||
"shortcuts": "Преки пътища",
|
|
||||||
"sign-in": "влезте",
|
"sign-in": "влезте",
|
||||||
"sign-in-with": "Влезте с {{provider}}",
|
"sign-in-with": "Влезте с {{provider}}",
|
||||||
"sign-out": "Излезте",
|
"sign-out": "Излезте",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Потребителско име",
|
"username": "Потребителско име",
|
||||||
"version": "Версия",
|
"version": "Версия",
|
||||||
"visibility": "Видимост",
|
"visibility": "Видимост",
|
||||||
|
"views": "Изгледи",
|
||||||
"yourself": "Себе си"
|
"yourself": "Себе си"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Прилага избраната тема веднага на това устройство.",
|
"theme-description": "Прилага избраната тема веднага на това устройство.",
|
||||||
"theme": "Тема"
|
"theme": "Тема"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Сигурни ли сте, че искате да изтриете пряк път `{{title}}`?",
|
"delete-confirm": "Сигурни ли сте, че искате да изтриете изгледа `{{title}}`?",
|
||||||
"delete-success": "Пряк път `{{title}}` изтрит успешно"
|
"delete-success": "Изгледът `{{title}}` е изтрит успешно"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "акаунт",
|
"account": "акаунт",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Darrera actualització el",
|
"last-updated-at": "Darrera actualització el",
|
||||||
"learn-more": "Saber-ne més",
|
"learn-more": "Saber-ne més",
|
||||||
"link": "Enllaç",
|
"link": "Enllaç",
|
||||||
|
"manage": "Gestiona",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Marca",
|
"mark": "Marca",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Selecciona",
|
"select": "Selecciona",
|
||||||
"settings": "Configuració",
|
"settings": "Configuració",
|
||||||
"share": "Comparteix",
|
"share": "Comparteix",
|
||||||
"shortcut-filter": "Filtre de dreceres",
|
|
||||||
"shortcuts": "Dreceres",
|
|
||||||
"sign-in": "Identifica't",
|
"sign-in": "Identifica't",
|
||||||
"sign-in-with": "Identifica't via {{provider}}",
|
"sign-in-with": "Identifica't via {{provider}}",
|
||||||
"sign-out": "Surt",
|
"sign-out": "Surt",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Nom d'usuari",
|
"username": "Nom d'usuari",
|
||||||
"version": "Versió",
|
"version": "Versió",
|
||||||
"visibility": "Visibilitat",
|
"visibility": "Visibilitat",
|
||||||
|
"views": "Vistes",
|
||||||
"yourself": "Tu mateix",
|
"yourself": "Tu mateix",
|
||||||
"empty-placeholder": "Buit",
|
"empty-placeholder": "Buit",
|
||||||
"unlink": "Desenllaça"
|
"unlink": "Desenllaça"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Memo per defecte",
|
"memo-defaults-title": "Memo per defecte",
|
||||||
"theme-description": "Aplica el tema seleccionat immediatament en aquest dispositiu."
|
"theme-description": "Aplica el tema seleccionat immediatament en aquest dispositiu."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Estàs segur que vols eliminar la drecera `{{title}}`?",
|
"delete-confirm": "Estàs segur que vols eliminar la vista `{{title}}`?",
|
||||||
"delete-success": "Drecera `{{title}}` eliminada correctament"
|
"delete-success": "Vista `{{title}}` eliminada correctament"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Punt final d'autorització",
|
"authorization-endpoint": "Punt final d'autorització",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Změněno",
|
"last-updated-at": "Změněno",
|
||||||
"learn-more": "Více informací",
|
"learn-more": "Více informací",
|
||||||
"link": "Odkaz",
|
"link": "Odkaz",
|
||||||
|
"manage": "Spravovat",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Značka",
|
"mark": "Značka",
|
||||||
"memo": "Poznámka",
|
"memo": "Poznámka",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Vybrat",
|
"select": "Vybrat",
|
||||||
"settings": "Nastavení",
|
"settings": "Nastavení",
|
||||||
"share": "Sdílet",
|
"share": "Sdílet",
|
||||||
"shortcut-filter": "Filtr zkratek",
|
|
||||||
"shortcuts": "Zkratky",
|
|
||||||
"sign-in": "Přihlásit se",
|
"sign-in": "Přihlásit se",
|
||||||
"sign-in-with": "Přihlásit se pomocí {{provider}}",
|
"sign-in-with": "Přihlásit se pomocí {{provider}}",
|
||||||
"sign-out": "Odhlásit se",
|
"sign-out": "Odhlásit se",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Uživatelské jméno",
|
"username": "Uživatelské jméno",
|
||||||
"version": "Verze",
|
"version": "Verze",
|
||||||
"visibility": "Viditelnost",
|
"visibility": "Viditelnost",
|
||||||
|
"views": "Zobrazení",
|
||||||
"yourself": "Vy sami",
|
"yourself": "Vy sami",
|
||||||
"empty-placeholder": "Prázdný",
|
"empty-placeholder": "Prázdný",
|
||||||
"unlink": "Odpojit"
|
"unlink": "Odpojit"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Výchozí nastavení poznámek",
|
"memo-defaults-title": "Výchozí nastavení poznámek",
|
||||||
"theme-description": "Okamžitě použije vybraný motiv na tomto zařízení."
|
"theme-description": "Okamžitě použije vybraný motiv na tomto zařízení."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Jste si jisti, že chcete odstranit zkratku `{{title}}`?",
|
"delete-confirm": "Jste si jisti, že chcete odstranit zobrazení `{{title}}`?",
|
||||||
"delete-success": "Zkratka `{{title}}` úspěšně odstraněna"
|
"delete-success": "Zobrazení `{{title}}` bylo úspěšně odstraněno"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Autorizační koncový bod",
|
"authorization-endpoint": "Autorizační koncový bod",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Sidst opdateret kl",
|
"last-updated-at": "Sidst opdateret kl",
|
||||||
"learn-more": "Få flere oplysninger",
|
"learn-more": "Få flere oplysninger",
|
||||||
"link": "Forbindelse",
|
"link": "Forbindelse",
|
||||||
|
"manage": "Administrer",
|
||||||
"map": "Kort",
|
"map": "Kort",
|
||||||
"mark": "Mærke",
|
"mark": "Mærke",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Vælge",
|
"select": "Vælge",
|
||||||
"settings": "Indstillinger",
|
"settings": "Indstillinger",
|
||||||
"share": "Dele",
|
"share": "Dele",
|
||||||
"shortcut-filter": "Genvejsfilter",
|
|
||||||
"shortcuts": "Genveje",
|
|
||||||
"sign-in": "Log ind",
|
"sign-in": "Log ind",
|
||||||
"sign-in-with": "Log ind med {{provider}}",
|
"sign-in-with": "Log ind med {{provider}}",
|
||||||
"sign-out": "Log ud",
|
"sign-out": "Log ud",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Brugernavn",
|
"username": "Brugernavn",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"visibility": "Sigtbarhed",
|
"visibility": "Sigtbarhed",
|
||||||
|
"views": "Visninger",
|
||||||
"yourself": "Dig selv"
|
"yourself": "Dig selv"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Anvender det valgte tema med det samme på denne enhed.",
|
"theme-description": "Anvender det valgte tema med det samme på denne enhed.",
|
||||||
"theme": "Tema"
|
"theme": "Tema"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Er du sikker på, at du vil slette genvejen `{{title}}`?",
|
"delete-confirm": "Er du sikker på, at du vil slette visningen `{{title}}`?",
|
||||||
"delete-success": "Genvejen `{{title}}` blev slettet"
|
"delete-success": "Visningen `{{title}}` blev slettet"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Konto",
|
"account": "Konto",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Zuletzt aktualisiert am",
|
"last-updated-at": "Zuletzt aktualisiert am",
|
||||||
"learn-more": "Mehr erfahren",
|
"learn-more": "Mehr erfahren",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Verwalten",
|
||||||
"map": "Karte",
|
"map": "Karte",
|
||||||
"mark": "Markieren",
|
"mark": "Markieren",
|
||||||
"memo": "Notiz",
|
"memo": "Notiz",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Auswählen",
|
"select": "Auswählen",
|
||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"share": "Teilen",
|
"share": "Teilen",
|
||||||
"shortcut-filter": "Verknüpfungsfilter",
|
|
||||||
"shortcuts": "Verknüpfungen",
|
|
||||||
"sign-in": "Anmelden",
|
"sign-in": "Anmelden",
|
||||||
"sign-in-with": "Anmelden mit {{provider}}",
|
"sign-in-with": "Anmelden mit {{provider}}",
|
||||||
"sign-out": "Abmelden",
|
"sign-out": "Abmelden",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Benutzername",
|
"username": "Benutzername",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"visibility": "Sichtbarkeit",
|
"visibility": "Sichtbarkeit",
|
||||||
|
"views": "Ansichten",
|
||||||
"yourself": "Du selbst",
|
"yourself": "Du selbst",
|
||||||
"empty-placeholder": "Leer",
|
"empty-placeholder": "Leer",
|
||||||
"unlink": "Verknüpfung aufheben"
|
"unlink": "Verknüpfung aufheben"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Memo-Standardwerte",
|
"memo-defaults-title": "Memo-Standardwerte",
|
||||||
"theme-description": "Wendet das ausgewählte Thema sofort auf diesem Gerät an."
|
"theme-description": "Wendet das ausgewählte Thema sofort auf diesem Gerät an."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Bist du sicher, dass du die Verknüpfung `{{title}}` löschen möchtest?",
|
"delete-confirm": "Bist du sicher, dass du die Ansicht `{{title}}` löschen möchtest?",
|
||||||
"delete-success": "Verknüpfung `{{title}}` erfolgreich gelöscht"
|
"delete-success": "Ansicht `{{title}}` erfolgreich gelöscht"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Autorisierungsendpunkt",
|
"authorization-endpoint": "Autorisierungsendpunkt",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Τελευταία ενημέρωση στις",
|
"last-updated-at": "Τελευταία ενημέρωση στις",
|
||||||
"learn-more": "Μάθετε περισσότερα",
|
"learn-more": "Μάθετε περισσότερα",
|
||||||
"link": "Σύνδεσμος",
|
"link": "Σύνδεσμος",
|
||||||
|
"manage": "Διαχείριση",
|
||||||
"map": "Χάρτης",
|
"map": "Χάρτης",
|
||||||
"mark": "Σημάδι",
|
"mark": "Σημάδι",
|
||||||
"memo": "Σημείωμα",
|
"memo": "Σημείωμα",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Επιλέγω",
|
"select": "Επιλέγω",
|
||||||
"settings": "Ρυθμίσεις",
|
"settings": "Ρυθμίσεις",
|
||||||
"share": "Μερίδιο",
|
"share": "Μερίδιο",
|
||||||
"shortcut-filter": "Φίλτρο συντόμευσης",
|
|
||||||
"shortcuts": "Συντομεύσεις",
|
|
||||||
"sign-in": "Συνδεθείτε",
|
"sign-in": "Συνδεθείτε",
|
||||||
"sign-in-with": "Συνδεθείτε με το {{provider}}",
|
"sign-in-with": "Συνδεθείτε με το {{provider}}",
|
||||||
"sign-out": "Αποσυνδεθείτε",
|
"sign-out": "Αποσυνδεθείτε",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Όνομα χρήστη",
|
"username": "Όνομα χρήστη",
|
||||||
"version": "Εκδοχή",
|
"version": "Εκδοχή",
|
||||||
"visibility": "Ορατότητα",
|
"visibility": "Ορατότητα",
|
||||||
|
"views": "Προβολές",
|
||||||
"yourself": "Σύ ο ίδιος"
|
"yourself": "Σύ ο ίδιος"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Εφαρμόζει το επιλεγμένο θέμα αμέσως σε αυτήν τη συσκευή.",
|
"theme-description": "Εφαρμόζει το επιλεγμένο θέμα αμέσως σε αυτήν τη συσκευή.",
|
||||||
"theme": "Θέμα"
|
"theme": "Θέμα"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Είστε βέβαιοι ότι θέλετε να διαγράψετε τη συντόμευση `{{title}}`;",
|
"delete-confirm": "Είστε βέβαιοι ότι θέλετε να διαγράψετε την προβολή `{{title}}`;",
|
||||||
"delete-success": "Η συντόμευση `{{title}}` διαγράφηκε με επιτυχία"
|
"delete-success": "Η προβολή `{{title}}` διαγράφηκε με επιτυχία"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Λογαριασμός",
|
"account": "Λογαριασμός",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Last updated at",
|
"last-updated-at": "Last updated at",
|
||||||
"learn-more": "Learn more",
|
"learn-more": "Learn more",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Manage",
|
||||||
"map": "Map",
|
"map": "Map",
|
||||||
"mark": "Mark",
|
"mark": "Mark",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Select",
|
"select": "Select",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"share": "Share",
|
"share": "Share",
|
||||||
"shortcut-filter": "Shortcut filter",
|
|
||||||
"shortcuts": "Shortcuts",
|
|
||||||
"sign-in": "Sign in",
|
"sign-in": "Sign in",
|
||||||
"sign-in-with": "Sign in with {{provider}}",
|
"sign-in-with": "Sign in with {{provider}}",
|
||||||
"sign-out": "Sign out",
|
"sign-out": "Sign out",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"visibility": "Visibility",
|
"visibility": "Visibility",
|
||||||
|
"views": "Views",
|
||||||
"yourself": "Yourself",
|
"yourself": "Yourself",
|
||||||
"empty-placeholder": "Empty",
|
"empty-placeholder": "Empty",
|
||||||
"unlink": "Unlink"
|
"unlink": "Unlink"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Memo defaults",
|
"memo-defaults-title": "Memo defaults",
|
||||||
"theme-description": "Applies the selected theme immediately on this device."
|
"theme-description": "Applies the selected theme immediately on this device."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Are you sure you want to delete shortcut `{{title}}`?",
|
"delete-confirm": "Are you sure you want to delete view `{{title}}`?",
|
||||||
"delete-success": "Shortcut `{{title}}` deleted successfully"
|
"delete-success": "View `{{title}}` deleted successfully"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Authorisation endpoint",
|
"authorization-endpoint": "Authorisation endpoint",
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@
|
||||||
"learn-more": "Learn more",
|
"learn-more": "Learn more",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"location": "Location",
|
"location": "Location",
|
||||||
|
"manage": "Manage",
|
||||||
"map": "Map",
|
"map": "Map",
|
||||||
"mark": "Mark",
|
"mark": "Mark",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -173,8 +174,6 @@
|
||||||
"select": "Select",
|
"select": "Select",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"share": "Share",
|
"share": "Share",
|
||||||
"shortcut-filter": "Shortcut filter",
|
|
||||||
"shortcuts": "Shortcuts",
|
|
||||||
"sign-in": "Sign in",
|
"sign-in": "Sign in",
|
||||||
"sign-in-to-memos": "Sign in to Memos",
|
"sign-in-to-memos": "Sign in to Memos",
|
||||||
"sign-out": "Sign out",
|
"sign-out": "Sign out",
|
||||||
|
|
@ -660,9 +659,9 @@
|
||||||
"theme-description": "Applies the selected theme immediately on this device.",
|
"theme-description": "Applies the selected theme immediately on this device.",
|
||||||
"theme": "Theme"
|
"theme": "Theme"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Are you sure you want to delete shortcut `{{title}}`?",
|
"delete-confirm": "Are you sure you want to delete view `{{title}}`?",
|
||||||
"delete-success": "Shortcut `{{title}}` deleted successfully"
|
"delete-success": "View `{{title}}` deleted successfully"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Account",
|
"account": "Account",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Última actualización en",
|
"last-updated-at": "Última actualización en",
|
||||||
"learn-more": "Saber más",
|
"learn-more": "Saber más",
|
||||||
"link": "Enlace",
|
"link": "Enlace",
|
||||||
|
"manage": "Gestionar",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Marcar",
|
"mark": "Marcar",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Seleccionar",
|
"select": "Seleccionar",
|
||||||
"settings": "Configuración",
|
"settings": "Configuración",
|
||||||
"share": "Compartir",
|
"share": "Compartir",
|
||||||
"shortcut-filter": "Filtro de atajos",
|
|
||||||
"shortcuts": "Atajos",
|
|
||||||
"sign-in": "Iniciar sesión",
|
"sign-in": "Iniciar sesión",
|
||||||
"sign-in-with": "Iniciar sesión con {{provider}}",
|
"sign-in-with": "Iniciar sesión con {{provider}}",
|
||||||
"sign-out": "Cerrar sesión",
|
"sign-out": "Cerrar sesión",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Usuario",
|
"username": "Usuario",
|
||||||
"version": "Versión",
|
"version": "Versión",
|
||||||
"visibility": "Visibilidad",
|
"visibility": "Visibilidad",
|
||||||
|
"views": "Vistas",
|
||||||
"yourself": "Tú mismo",
|
"yourself": "Tú mismo",
|
||||||
"empty-placeholder": "Vacía",
|
"empty-placeholder": "Vacía",
|
||||||
"unlink": "Desconectar"
|
"unlink": "Desconectar"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Valores predeterminados de notas",
|
"memo-defaults-title": "Valores predeterminados de notas",
|
||||||
"theme-description": "Aplica el tema seleccionado inmediatamente en este dispositivo."
|
"theme-description": "Aplica el tema seleccionado inmediatamente en este dispositivo."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "¿Estás seguro de que quieres eliminar el atajo `{{title}}`?",
|
"delete-confirm": "¿Estás seguro de que quieres eliminar la vista `{{title}}`?",
|
||||||
"delete-success": "Atajo `{{title}}` eliminado correctamente"
|
"delete-success": "Vista `{{title}}` eliminada correctamente"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Punto final de autorización",
|
"authorization-endpoint": "Punto final de autorización",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Viimati värskendatud kell",
|
"last-updated-at": "Viimati värskendatud kell",
|
||||||
"learn-more": "Lisateavet",
|
"learn-more": "Lisateavet",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Halda",
|
||||||
"map": "Kaart",
|
"map": "Kaart",
|
||||||
"mark": "Mark",
|
"mark": "Mark",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Valige",
|
"select": "Valige",
|
||||||
"settings": "Seaded",
|
"settings": "Seaded",
|
||||||
"share": "Jaga",
|
"share": "Jaga",
|
||||||
"shortcut-filter": "Otsetee filter",
|
|
||||||
"shortcuts": "Otseteed",
|
|
||||||
"sign-in": "Logi sisse",
|
"sign-in": "Logi sisse",
|
||||||
"sign-in-with": "Logige sisse {{provider}}-iga",
|
"sign-in-with": "Logige sisse {{provider}}-iga",
|
||||||
"sign-out": "Logi välja",
|
"sign-out": "Logi välja",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Kasutajanimi",
|
"username": "Kasutajanimi",
|
||||||
"version": "Versioon",
|
"version": "Versioon",
|
||||||
"visibility": "Nähtavus",
|
"visibility": "Nähtavus",
|
||||||
|
"views": "Vaated",
|
||||||
"yourself": "iseennast"
|
"yourself": "iseennast"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Rakendab valitud teema kohe selles seadmes.",
|
"theme-description": "Rakendab valitud teema kohe selles seadmes.",
|
||||||
"theme": "Teema"
|
"theme": "Teema"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Kas olete kindel, et soovite otsetee `{{title}}` kustutada?",
|
"delete-confirm": "Kas olete kindel, et soovite vaate `{{title}}` kustutada?",
|
||||||
"delete-success": "Otsetee `{{title}}` kustutati edukalt"
|
"delete-success": "Vaade `{{title}}` kustutati edukalt"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "konto",
|
"account": "konto",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "آخرین بروزرسانی در",
|
"last-updated-at": "آخرین بروزرسانی در",
|
||||||
"learn-more": "اطلاعات بیشتر",
|
"learn-more": "اطلاعات بیشتر",
|
||||||
"link": "پیوست",
|
"link": "پیوست",
|
||||||
|
"manage": "مدیریت",
|
||||||
"map": "نقشه",
|
"map": "نقشه",
|
||||||
"mark": "علامتگذاری",
|
"mark": "علامتگذاری",
|
||||||
"memo": "یادداشت",
|
"memo": "یادداشت",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "انتخاب کردن",
|
"select": "انتخاب کردن",
|
||||||
"settings": "تنظیمات",
|
"settings": "تنظیمات",
|
||||||
"share": "اشتراک",
|
"share": "اشتراک",
|
||||||
"shortcut-filter": "فیلتر میانبر",
|
|
||||||
"shortcuts": "میانبرها",
|
|
||||||
"sign-in": "ورود به حساب کاربری",
|
"sign-in": "ورود به حساب کاربری",
|
||||||
"sign-in-with": "{{provider}} ورود با",
|
"sign-in-with": "{{provider}} ورود با",
|
||||||
"sign-out": "خروج از حساب کاربری",
|
"sign-out": "خروج از حساب کاربری",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "نام کاربری",
|
"username": "نام کاربری",
|
||||||
"version": "نسخه",
|
"version": "نسخه",
|
||||||
"visibility": "قابل مشاهده توسط",
|
"visibility": "قابل مشاهده توسط",
|
||||||
|
"views": "نماها",
|
||||||
"yourself": "خودتان"
|
"yourself": "خودتان"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "پوسته",
|
"theme": "پوسته",
|
||||||
"label": "ترجیحات"
|
"label": "ترجیحات"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "آیا مطمئن هستید که میخواهید میانبر «{{title}}» را حذف کنید؟",
|
"delete-confirm": "آیا مطمئن هستید که میخواهید نمای «{{title}}» را حذف کنید؟",
|
||||||
"delete-success": "میانبر «{{title}}» با موفقیت حذف شد"
|
"delete-success": "نمای «{{title}}» با موفقیت حذف شد"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "آدرس نقطه مجوز",
|
"authorization-endpoint": "آدرس نقطه مجوز",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Viimeksi päivitetty klo",
|
"last-updated-at": "Viimeksi päivitetty klo",
|
||||||
"learn-more": "Lue lisää",
|
"learn-more": "Lue lisää",
|
||||||
"link": "Linkki",
|
"link": "Linkki",
|
||||||
|
"manage": "Hallinnoi",
|
||||||
"map": "Kartta",
|
"map": "Kartta",
|
||||||
"mark": "Mark",
|
"mark": "Mark",
|
||||||
"memo": "Muistio",
|
"memo": "Muistio",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Valitse",
|
"select": "Valitse",
|
||||||
"settings": "Asetukset",
|
"settings": "Asetukset",
|
||||||
"share": "Jakaa",
|
"share": "Jakaa",
|
||||||
"shortcut-filter": "Pikakuvakesuodatin",
|
|
||||||
"shortcuts": "Pikanäppäimet",
|
|
||||||
"sign-in": "Kirjaudu sisään",
|
"sign-in": "Kirjaudu sisään",
|
||||||
"sign-in-with": "Kirjaudu sisään {{provider}}:llä",
|
"sign-in-with": "Kirjaudu sisään {{provider}}:llä",
|
||||||
"sign-out": "Kirjaudu ulos",
|
"sign-out": "Kirjaudu ulos",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Käyttäjätunnus",
|
"username": "Käyttäjätunnus",
|
||||||
"version": "Versio",
|
"version": "Versio",
|
||||||
"visibility": "Näkyvyys",
|
"visibility": "Näkyvyys",
|
||||||
|
"views": "Näkymät",
|
||||||
"yourself": "itseäsi"
|
"yourself": "itseäsi"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Ottaa valitun teeman käyttöön välittömästi tässä laitteessa.",
|
"theme-description": "Ottaa valitun teeman käyttöön välittömästi tässä laitteessa.",
|
||||||
"theme": "Teema"
|
"theme": "Teema"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Haluatko varmasti poistaa pikakuvakkeen `{{title}}`?",
|
"delete-confirm": "Haluatko varmasti poistaa näkymän `{{title}}`?",
|
||||||
"delete-success": "Pikakuvake `{{title}}` poistettu onnistuneesti"
|
"delete-success": "Näkymä `{{title}}` poistettu onnistuneesti"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Tili",
|
"account": "Tili",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Dernière mise à jour le",
|
"last-updated-at": "Dernière mise à jour le",
|
||||||
"learn-more": "En savoir plus",
|
"learn-more": "En savoir plus",
|
||||||
"link": "Lien",
|
"link": "Lien",
|
||||||
|
"manage": "Gérer",
|
||||||
"map": "Carte",
|
"map": "Carte",
|
||||||
"mark": "Marquer",
|
"mark": "Marquer",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Sélectionner",
|
"select": "Sélectionner",
|
||||||
"settings": "Paramètres",
|
"settings": "Paramètres",
|
||||||
"share": "Partager",
|
"share": "Partager",
|
||||||
"shortcut-filter": "Filtre de raccourcis",
|
|
||||||
"shortcuts": "Raccourcis",
|
|
||||||
"sign-in": "Connexion",
|
"sign-in": "Connexion",
|
||||||
"sign-in-with": "Se connecter avec {{provider}}",
|
"sign-in-with": "Se connecter avec {{provider}}",
|
||||||
"sign-out": "Déconnexion",
|
"sign-out": "Déconnexion",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Nom d'utilisateur",
|
"username": "Nom d'utilisateur",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"visibility": "Visibilité",
|
"visibility": "Visibilité",
|
||||||
|
"views": "Vues",
|
||||||
"yourself": "Vous-même",
|
"yourself": "Vous-même",
|
||||||
"empty-placeholder": "Vide",
|
"empty-placeholder": "Vide",
|
||||||
"unlink": "Dissocier"
|
"unlink": "Dissocier"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Valeurs par défaut du mémo",
|
"memo-defaults-title": "Valeurs par défaut du mémo",
|
||||||
"theme-description": "Applique immédiatement le thème sélectionné sur cet appareil."
|
"theme-description": "Applique immédiatement le thème sélectionné sur cet appareil."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Êtes-vous sûr de vouloir supprimer le raccourci `{{title}}` ?",
|
"delete-confirm": "Êtes-vous sûr de vouloir supprimer la vue `{{title}}` ?",
|
||||||
"delete-success": "Raccourci `{{title}}` supprimé avec succès"
|
"delete-success": "Vue `{{title}}` supprimée avec succès"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Point de terminaison d'autorisation",
|
"authorization-endpoint": "Point de terminaison d'autorisation",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Última actualización",
|
"last-updated-at": "Última actualización",
|
||||||
"learn-more": "Saber máis",
|
"learn-more": "Saber máis",
|
||||||
"link": "Ligar",
|
"link": "Ligar",
|
||||||
|
"manage": "Xestionar",
|
||||||
"map": "Map",
|
"map": "Map",
|
||||||
"mark": "Marcar",
|
"mark": "Marcar",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Seleccionar",
|
"select": "Seleccionar",
|
||||||
"settings": "Axustes",
|
"settings": "Axustes",
|
||||||
"share": "Compartir",
|
"share": "Compartir",
|
||||||
"shortcut-filter": "Filtrar co atallo",
|
|
||||||
"shortcuts": "Atallos",
|
|
||||||
"sign-in": "Acceder",
|
"sign-in": "Acceder",
|
||||||
"sign-in-with": "Acceder con {{provider}}",
|
"sign-in-with": "Acceder con {{provider}}",
|
||||||
"sign-out": "Fechar sesión",
|
"sign-out": "Fechar sesión",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Identificador",
|
"username": "Identificador",
|
||||||
"version": "Versión",
|
"version": "Versión",
|
||||||
"visibility": "Visibilidade",
|
"visibility": "Visibilidade",
|
||||||
|
"views": "Vistas",
|
||||||
"yourself": "Ti",
|
"yourself": "Ti",
|
||||||
"empty-placeholder": "Baleiro",
|
"empty-placeholder": "Baleiro",
|
||||||
"unlink": "Desvincular"
|
"unlink": "Desvincular"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Valores predeterminados da nota",
|
"memo-defaults-title": "Valores predeterminados da nota",
|
||||||
"theme-description": "Aplica o tema seleccionado inmediatamente neste dispositivo."
|
"theme-description": "Aplica o tema seleccionado inmediatamente neste dispositivo."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Tes certeza de querer eliminar o atallo `{{title}}`?",
|
"delete-confirm": "Tes certeza de querer eliminar a vista `{{title}}`?",
|
||||||
"delete-success": "Eliminouse correctamente o atallo `{{title}}`"
|
"delete-success": "Eliminouse correctamente a vista `{{title}}`"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Punto de acceso para autorización",
|
"authorization-endpoint": "Punto de acceso para autorización",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "अंतिम अपडेट",
|
"last-updated-at": "अंतिम अपडेट",
|
||||||
"learn-more": "अधिक जानें",
|
"learn-more": "अधिक जानें",
|
||||||
"link": "लिंक",
|
"link": "लिंक",
|
||||||
|
"manage": "प्रबंधित करें",
|
||||||
"map": "नक्शा",
|
"map": "नक्शा",
|
||||||
"mark": "चिह्नित",
|
"mark": "चिह्नित",
|
||||||
"memo": "मेमो",
|
"memo": "मेमो",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "चयन करें",
|
"select": "चयन करें",
|
||||||
"settings": "सेटिंग्स",
|
"settings": "सेटिंग्स",
|
||||||
"share": "साझा करें",
|
"share": "साझा करें",
|
||||||
"shortcut-filter": "शॉर्टकट फ़िल्टर",
|
|
||||||
"shortcuts": "शॉर्टकट्स",
|
|
||||||
"sign-in": "साइन इन करें",
|
"sign-in": "साइन इन करें",
|
||||||
"sign-in-with": "{{provider}} के साथ साइन इन करें",
|
"sign-in-with": "{{provider}} के साथ साइन इन करें",
|
||||||
"sign-out": "साइन आउट करें",
|
"sign-out": "साइन आउट करें",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "उपयोगकर्ता नाम",
|
"username": "उपयोगकर्ता नाम",
|
||||||
"version": "संस्करण",
|
"version": "संस्करण",
|
||||||
"visibility": "दृश्यता",
|
"visibility": "दृश्यता",
|
||||||
|
"views": "दृश्य",
|
||||||
"yourself": "खुद"
|
"yourself": "खुद"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "थीम",
|
"theme": "थीम",
|
||||||
"label": "प्राथमिकता"
|
"label": "प्राथमिकता"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "क्या आप वाकई शॉर्टकट `{{title}}` हटाना चाहते हैं?",
|
"delete-confirm": "क्या आप वाकई दृश्य `{{title}}` हटाना चाहते हैं?",
|
||||||
"delete-success": "शॉर्टकट `{{title}}` सफलतापूर्वक हटाया गया"
|
"delete-success": "दृश्य `{{title}}` सफलतापूर्वक हटाया गया"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "प्राधिकरण एंडपॉइंट",
|
"authorization-endpoint": "प्राधिकरण एंडपॉइंट",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Zadnje ažurirano",
|
"last-updated-at": "Zadnje ažurirano",
|
||||||
"learn-more": "Nauči više",
|
"learn-more": "Nauči više",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Upravljaj",
|
||||||
"map": "Karta",
|
"map": "Karta",
|
||||||
"mark": "Označi",
|
"mark": "Označi",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Odaberi",
|
"select": "Odaberi",
|
||||||
"settings": "Postavke",
|
"settings": "Postavke",
|
||||||
"share": "Podijeli",
|
"share": "Podijeli",
|
||||||
"shortcut-filter": "Filter prečaca",
|
|
||||||
"shortcuts": "Prečaci",
|
|
||||||
"sign-in": "Prijavi se",
|
"sign-in": "Prijavi se",
|
||||||
"sign-in-with": "Prijavi se s {{provider}}",
|
"sign-in-with": "Prijavi se s {{provider}}",
|
||||||
"sign-out": "Odjavi se",
|
"sign-out": "Odjavi se",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Korisničko ime",
|
"username": "Korisničko ime",
|
||||||
"version": "Verzija",
|
"version": "Verzija",
|
||||||
"visibility": "Vidljivost",
|
"visibility": "Vidljivost",
|
||||||
|
"views": "Prikazi",
|
||||||
"yourself": "Ti",
|
"yourself": "Ti",
|
||||||
"empty-placeholder": "Prazan",
|
"empty-placeholder": "Prazan",
|
||||||
"unlink": "Prekini vezu"
|
"unlink": "Prekini vezu"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Zadane postavke bilješke",
|
"memo-defaults-title": "Zadane postavke bilješke",
|
||||||
"theme-description": "Odmah primjenjuje odabranu temu na ovom uređaju."
|
"theme-description": "Odmah primjenjuje odabranu temu na ovom uređaju."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Jesi li siguran da želiš obrisati prečac `{{title}}`?",
|
"delete-confirm": "Jesi li siguran da želiš obrisati prikaz `{{title}}`?",
|
||||||
"delete-success": "Prečac `{{title}}` uspješno obrisan"
|
"delete-success": "Prikaz `{{title}}` uspješno obrisan"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Krajnja točka autorizacije",
|
"authorization-endpoint": "Krajnja točka autorizacije",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Utoljára frissítve",
|
"last-updated-at": "Utoljára frissítve",
|
||||||
"learn-more": "További információ",
|
"learn-more": "További információ",
|
||||||
"link": "Hivatkozás",
|
"link": "Hivatkozás",
|
||||||
|
"manage": "Kezelés",
|
||||||
"map": "Térkép",
|
"map": "Térkép",
|
||||||
"mark": "Megjelölés",
|
"mark": "Megjelölés",
|
||||||
"memo": "Jegyzet",
|
"memo": "Jegyzet",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Kijelölés",
|
"select": "Kijelölés",
|
||||||
"settings": "Beállítások",
|
"settings": "Beállítások",
|
||||||
"share": "Megosztás",
|
"share": "Megosztás",
|
||||||
"shortcut-filter": "Gyorsbillentyű szűrő",
|
|
||||||
"shortcuts": "Gyorsbillentyűk",
|
|
||||||
"sign-in": "Bejelentkezés",
|
"sign-in": "Bejelentkezés",
|
||||||
"sign-in-with": "Bejelentkezés {{provider}} használatával",
|
"sign-in-with": "Bejelentkezés {{provider}} használatával",
|
||||||
"sign-out": "Kijelentkezés",
|
"sign-out": "Kijelentkezés",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Felhasználónév",
|
"username": "Felhasználónév",
|
||||||
"version": "Verzió",
|
"version": "Verzió",
|
||||||
"visibility": "Láthatóság",
|
"visibility": "Láthatóság",
|
||||||
|
"views": "Nézetek",
|
||||||
"yourself": "Magad",
|
"yourself": "Magad",
|
||||||
"empty-placeholder": "Üres",
|
"empty-placeholder": "Üres",
|
||||||
"unlink": "Leválasztás"
|
"unlink": "Leválasztás"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "A jegyzet alapbeállításai",
|
"memo-defaults-title": "A jegyzet alapbeállításai",
|
||||||
"theme-description": "Azonnal alkalmazza a kiválasztott témát ezen az eszközön."
|
"theme-description": "Azonnal alkalmazza a kiválasztott témát ezen az eszközön."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Biztosan törlöd a `{{title}}` gyorsbillentyűt?",
|
"delete-confirm": "Biztosan törlöd a `{{title}}` nézetet?",
|
||||||
"delete-success": "`{{title}}` gyorsbillentyű sikeresen törölve"
|
"delete-success": "`{{title}}` nézet sikeresen törölve"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Hitelesítési végpont",
|
"authorization-endpoint": "Hitelesítési végpont",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "Terakhir diperbarui pada",
|
"last-updated-at": "Terakhir diperbarui pada",
|
||||||
"learn-more": "Pelajari lebih lanjut",
|
"learn-more": "Pelajari lebih lanjut",
|
||||||
"link": "Tautan",
|
"link": "Tautan",
|
||||||
|
"manage": "Kelola",
|
||||||
"map": "Peta",
|
"map": "Peta",
|
||||||
"mark": "Tandai",
|
"mark": "Tandai",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "Pilih",
|
"select": "Pilih",
|
||||||
"settings": "Pengaturan",
|
"settings": "Pengaturan",
|
||||||
"share": "Bagikan",
|
"share": "Bagikan",
|
||||||
"shortcut-filter": "Saring pintasan",
|
|
||||||
"shortcuts": "Pintasan",
|
|
||||||
"sign-in": "Masuk",
|
"sign-in": "Masuk",
|
||||||
"sign-in-with": "Masuk dengan {{provider}}",
|
"sign-in-with": "Masuk dengan {{provider}}",
|
||||||
"sign-out": "Keluar",
|
"sign-out": "Keluar",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "Nama pengguna",
|
"username": "Nama pengguna",
|
||||||
"version": "Versi",
|
"version": "Versi",
|
||||||
"visibility": "Visibilitas",
|
"visibility": "Visibilitas",
|
||||||
|
"views": "Tampilan",
|
||||||
"yourself": "Anda sendiri"
|
"yourself": "Anda sendiri"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "Tema",
|
"theme": "Tema",
|
||||||
"label": "Preferensi"
|
"label": "Preferensi"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Apakah Anda yakin ingin menghapus pintasan `{{title}}`?",
|
"delete-confirm": "Apakah Anda yakin ingin menghapus tampilan `{{title}}`?",
|
||||||
"delete-success": "Pintasan `{{title}}` berhasil dihapus"
|
"delete-success": "Tampilan `{{title}}` berhasil dihapus"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Akhir Otorisasi",
|
"authorization-endpoint": "Akhir Otorisasi",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Ultimo aggiornamento",
|
"last-updated-at": "Ultimo aggiornamento",
|
||||||
"learn-more": "Scopri di più",
|
"learn-more": "Scopri di più",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Gestisci",
|
||||||
"map": "Mappa",
|
"map": "Mappa",
|
||||||
"mark": "Cita",
|
"mark": "Cita",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Seleziona",
|
"select": "Seleziona",
|
||||||
"settings": "Impostazioni",
|
"settings": "Impostazioni",
|
||||||
"share": "Condividi",
|
"share": "Condividi",
|
||||||
"shortcut-filter": "Filtro scorciatoie",
|
|
||||||
"shortcuts": "Scorciatoie",
|
|
||||||
"sign-in": "Accedi",
|
"sign-in": "Accedi",
|
||||||
"sign-in-with": "Accedi con {{provider}}",
|
"sign-in-with": "Accedi con {{provider}}",
|
||||||
"sign-out": "Esci",
|
"sign-out": "Esci",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Nome utente",
|
"username": "Nome utente",
|
||||||
"version": "Versione",
|
"version": "Versione",
|
||||||
"visibility": "Visibilità",
|
"visibility": "Visibilità",
|
||||||
|
"views": "Viste",
|
||||||
"yourself": "Te stesso",
|
"yourself": "Te stesso",
|
||||||
"empty-placeholder": "Vuota",
|
"empty-placeholder": "Vuota",
|
||||||
"unlink": "Scollega"
|
"unlink": "Scollega"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Impostazioni predefinite del promemoria",
|
"memo-defaults-title": "Impostazioni predefinite del promemoria",
|
||||||
"theme-description": "Applica immediatamente il tema selezionato su questo dispositivo."
|
"theme-description": "Applica immediatamente il tema selezionato su questo dispositivo."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Confermi di voler eliminare la scorciatoia `{{title}}`?",
|
"delete-confirm": "Confermi di voler eliminare la vista `{{title}}`?",
|
||||||
"delete-success": "Scorciatoia `{{title}}` eliminata con successo"
|
"delete-success": "Vista `{{title}}` eliminata con successo"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Endpoint autorizzazione",
|
"authorization-endpoint": "Endpoint autorizzazione",
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@
|
||||||
"learn-more": "さらに詳しく",
|
"learn-more": "さらに詳しく",
|
||||||
"link": "リンク",
|
"link": "リンク",
|
||||||
"location": "場所",
|
"location": "場所",
|
||||||
|
"manage": "管理",
|
||||||
"map": "マップ",
|
"map": "マップ",
|
||||||
"mark": "マーク",
|
"mark": "マーク",
|
||||||
"memo": "メモ",
|
"memo": "メモ",
|
||||||
|
|
@ -134,8 +135,6 @@
|
||||||
"select": "選択",
|
"select": "選択",
|
||||||
"settings": "設定",
|
"settings": "設定",
|
||||||
"share": "共有する",
|
"share": "共有する",
|
||||||
"shortcut-filter": "ショートカットフィルター",
|
|
||||||
"shortcuts": "ショートカット",
|
|
||||||
"sign-in": "サインイン",
|
"sign-in": "サインイン",
|
||||||
"sign-in-to-memos": "Memosにサインイン",
|
"sign-in-to-memos": "Memosにサインイン",
|
||||||
"sign-out": "サインアウト",
|
"sign-out": "サインアウト",
|
||||||
|
|
@ -542,9 +541,9 @@
|
||||||
"memo-defaults-title": "メモのデフォルト",
|
"memo-defaults-title": "メモのデフォルト",
|
||||||
"theme-description": "選択したテーマをこのデバイスにすぐに適用します。"
|
"theme-description": "選択したテーマをこのデバイスにすぐに適用します。"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "ショートカット `{{title}}` を削除してもよろしいですか?",
|
"delete-confirm": "ビュー `{{title}}` を削除してもよろしいですか?",
|
||||||
"delete-success": "ショートカット `{{title}}` を削除しました"
|
"delete-success": "ビュー `{{title}}` を削除しました"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "認証エンドポイント",
|
"authorization-endpoint": "認証エンドポイント",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "ბოლო განახლება",
|
"last-updated-at": "ბოლო განახლება",
|
||||||
"learn-more": "გაიგეთ მეტი",
|
"learn-more": "გაიგეთ მეტი",
|
||||||
"link": "ლინკი",
|
"link": "ლინკი",
|
||||||
|
"manage": "მართვა",
|
||||||
"map": "რუკა",
|
"map": "რუკა",
|
||||||
"mark": "მონიშვნა",
|
"mark": "მონიშვნა",
|
||||||
"memo": "მემო",
|
"memo": "მემო",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "არჩევა",
|
"select": "არჩევა",
|
||||||
"settings": "პარამეტრები",
|
"settings": "პარამეტრები",
|
||||||
"share": "გაზიარება",
|
"share": "გაზიარება",
|
||||||
"shortcut-filter": "მოკლე გზების ფილტრი",
|
|
||||||
"shortcuts": "მოკლე გზები",
|
|
||||||
"sign-in": "შესვლა",
|
"sign-in": "შესვლა",
|
||||||
"sign-in-with": "შედით {{provider}}-ით",
|
"sign-in-with": "შედით {{provider}}-ით",
|
||||||
"sign-out": "გამოსვლა",
|
"sign-out": "გამოსვლა",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "მომხმარებლის სახელი",
|
"username": "მომხმარებლის სახელი",
|
||||||
"version": "ვერსია",
|
"version": "ვერსია",
|
||||||
"visibility": "ხილვადობა",
|
"visibility": "ხილვადობა",
|
||||||
|
"views": "ხედები",
|
||||||
"yourself": "თქვენ",
|
"yourself": "თქვენ",
|
||||||
"empty-placeholder": "ცარიელი",
|
"empty-placeholder": "ცარიელი",
|
||||||
"unlink": "გაუქმება"
|
"unlink": "გაუქმება"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Memo ნაგულისხმევი",
|
"memo-defaults-title": "Memo ნაგულისხმევი",
|
||||||
"theme-description": "არჩეულ თემას დაუყოვნებლივ იყენებს ამ მოწყობილობაზე."
|
"theme-description": "არჩეულ თემას დაუყოვნებლივ იყენებს ამ მოწყობილობაზე."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "დარწმუნებული ხართ, რომ გინდათ მოკლე გზის `{{title}}` წაშლა?",
|
"delete-confirm": "დარწმუნებული ხართ, რომ გინდათ ხედის `{{title}}` წაშლა?",
|
||||||
"delete-success": "მოკლე გზა `{{title}}` წარმატებით წაიშალა"
|
"delete-success": "ხედი `{{title}}` წარმატებით წაიშალა"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "ავტორიზაციის წერტილი",
|
"authorization-endpoint": "ავტორიზაციის წერტილი",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "마지막 수정일",
|
"last-updated-at": "마지막 수정일",
|
||||||
"learn-more": "더 보기",
|
"learn-more": "더 보기",
|
||||||
"link": "링크",
|
"link": "링크",
|
||||||
|
"manage": "관리",
|
||||||
"map": "지도",
|
"map": "지도",
|
||||||
"mark": "연결",
|
"mark": "연결",
|
||||||
"memo": "메모",
|
"memo": "메모",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "선택",
|
"select": "선택",
|
||||||
"settings": "설정",
|
"settings": "설정",
|
||||||
"share": "공유",
|
"share": "공유",
|
||||||
"shortcut-filter": "단축키 필터",
|
|
||||||
"shortcuts": "단축키",
|
|
||||||
"sign-in": "로그인",
|
"sign-in": "로그인",
|
||||||
"sign-in-with": "{{provider}}(으)로 로그인",
|
"sign-in-with": "{{provider}}(으)로 로그인",
|
||||||
"sign-out": "로그아웃",
|
"sign-out": "로그아웃",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "유저네임",
|
"username": "유저네임",
|
||||||
"version": "버전",
|
"version": "버전",
|
||||||
"visibility": "공개 범위",
|
"visibility": "공개 범위",
|
||||||
|
"views": "보기",
|
||||||
"yourself": "자기 자신"
|
"yourself": "자기 자신"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "테마",
|
"theme": "테마",
|
||||||
"label": "개인 설정"
|
"label": "개인 설정"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "바로가기 `{{title}}`를 정말로 삭제하시겠습니까?",
|
"delete-confirm": "보기 `{{title}}`를 정말로 삭제하시겠습니까?",
|
||||||
"delete-success": "바로가기 `{{title}}`가 성공적으로 삭제되었습니다"
|
"delete-success": "보기 `{{title}}`가 성공적으로 삭제되었습니다"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "인증 엔드포인트",
|
"authorization-endpoint": "인증 엔드포인트",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Paskutinį kartą atnaujinta",
|
"last-updated-at": "Paskutinį kartą atnaujinta",
|
||||||
"learn-more": "Sužinokite daugiau",
|
"learn-more": "Sužinokite daugiau",
|
||||||
"link": "Nuoroda",
|
"link": "Nuoroda",
|
||||||
|
"manage": "Tvarkyti",
|
||||||
"map": "Žemėlapis",
|
"map": "Žemėlapis",
|
||||||
"mark": "Pažymėti",
|
"mark": "Pažymėti",
|
||||||
"memo": "Atmintinė",
|
"memo": "Atmintinė",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Pasirinkite",
|
"select": "Pasirinkite",
|
||||||
"settings": "Nustatymai",
|
"settings": "Nustatymai",
|
||||||
"share": "Dalintis",
|
"share": "Dalintis",
|
||||||
"shortcut-filter": "Nuorodų filtras",
|
|
||||||
"shortcuts": "Spartieji klavišai",
|
|
||||||
"sign-in": "Prisijunkite",
|
"sign-in": "Prisijunkite",
|
||||||
"sign-in-with": "Prisijunkite naudodami {{provider}}",
|
"sign-in-with": "Prisijunkite naudodami {{provider}}",
|
||||||
"sign-out": "Atsijungti",
|
"sign-out": "Atsijungti",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Vartotojo vardas",
|
"username": "Vartotojo vardas",
|
||||||
"version": "Versija",
|
"version": "Versija",
|
||||||
"visibility": "Matomumas",
|
"visibility": "Matomumas",
|
||||||
|
"views": "Rodiniai",
|
||||||
"yourself": "save"
|
"yourself": "save"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Šiame įrenginyje iš karto pritaiko pasirinktą temą.",
|
"theme-description": "Šiame įrenginyje iš karto pritaiko pasirinktą temą.",
|
||||||
"theme": "tema"
|
"theme": "tema"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Ar tikrai norite ištrinti spartųjį klavišą `{{title}}`?",
|
"delete-confirm": "Ar tikrai norite ištrinti rodinį `{{title}}`?",
|
||||||
"delete-success": "Spartusis klavišas `{{title}}` sėkmingai ištrintas"
|
"delete-success": "Rodinys `{{title}}` sėkmingai ištrintas"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "sąskaita",
|
"account": "sąskaita",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Pēdējo reizi atjaunināts plkst",
|
"last-updated-at": "Pēdējo reizi atjaunināts plkst",
|
||||||
"learn-more": "Uzziniet vairāk",
|
"learn-more": "Uzziniet vairāk",
|
||||||
"link": "Saite",
|
"link": "Saite",
|
||||||
|
"manage": "Pārvaldīt",
|
||||||
"map": "Karte",
|
"map": "Karte",
|
||||||
"mark": "Atzīmēt",
|
"mark": "Atzīmēt",
|
||||||
"memo": "Piezīme",
|
"memo": "Piezīme",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Izvēlieties",
|
"select": "Izvēlieties",
|
||||||
"settings": "Iestatījumi",
|
"settings": "Iestatījumi",
|
||||||
"share": "Dalīties",
|
"share": "Dalīties",
|
||||||
"shortcut-filter": "Īsceļu filtrs",
|
|
||||||
"shortcuts": "Īsceļi",
|
|
||||||
"sign-in": "Pierakstīties",
|
"sign-in": "Pierakstīties",
|
||||||
"sign-in-with": "Pierakstieties ar {{provider}}",
|
"sign-in-with": "Pierakstieties ar {{provider}}",
|
||||||
"sign-out": "Izrakstīties",
|
"sign-out": "Izrakstīties",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Lietotājvārds",
|
"username": "Lietotājvārds",
|
||||||
"version": "Versija",
|
"version": "Versija",
|
||||||
"visibility": "Redzamība",
|
"visibility": "Redzamība",
|
||||||
|
"views": "Skati",
|
||||||
"yourself": "sevi"
|
"yourself": "sevi"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Šajā ierīcē nekavējoties tiek lietots atlasītais motīvs.",
|
"theme-description": "Šajā ierīcē nekavējoties tiek lietots atlasītais motīvs.",
|
||||||
"theme": "Tēma"
|
"theme": "Tēma"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Vai tiešām vēlaties dzēst saīsni `{{title}}`?",
|
"delete-confirm": "Vai tiešām vēlaties dzēst skatu `{{title}}`?",
|
||||||
"delete-success": "Īsceļš `{{title}}` veiksmīgi izdzēsts"
|
"delete-success": "Skats `{{title}}` veiksmīgi izdzēsts"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Konts",
|
"account": "Konts",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "शेवटचे अद्यतन",
|
"last-updated-at": "शेवटचे अद्यतन",
|
||||||
"learn-more": "अधिक जाणून घ्या",
|
"learn-more": "अधिक जाणून घ्या",
|
||||||
"link": "लिंक",
|
"link": "लिंक",
|
||||||
|
"manage": "व्यवस्थापित करा",
|
||||||
"map": "नकाशा",
|
"map": "नकाशा",
|
||||||
"mark": "खूण",
|
"mark": "खूण",
|
||||||
"memo": "मेमो",
|
"memo": "मेमो",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "निवडा",
|
"select": "निवडा",
|
||||||
"settings": "सेटिंग्ज",
|
"settings": "सेटिंग्ज",
|
||||||
"share": "शेअर करा",
|
"share": "शेअर करा",
|
||||||
"shortcut-filter": "शॉर्टकट फिल्टर",
|
|
||||||
"shortcuts": "शॉर्टकट्स",
|
|
||||||
"sign-in": "साइन इन करा",
|
"sign-in": "साइन इन करा",
|
||||||
"sign-in-with": "{{provider}} सह साइन इन करा",
|
"sign-in-with": "{{provider}} सह साइन इन करा",
|
||||||
"sign-out": "साइन आउट करा",
|
"sign-out": "साइन आउट करा",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "वापरकर्तानाव",
|
"username": "वापरकर्तानाव",
|
||||||
"version": "आवृत्ती",
|
"version": "आवृत्ती",
|
||||||
"visibility": "दृश्यमानता",
|
"visibility": "दृश्यमानता",
|
||||||
|
"views": "दृश्ये",
|
||||||
"yourself": "स्वतः"
|
"yourself": "स्वतः"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "थीम",
|
"theme": "थीम",
|
||||||
"label": "प्राधान्ये"
|
"label": "प्राधान्ये"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "तुम्हाला शॉर्टकट `{{title}}` हटवायची खात्री आहे का?",
|
"delete-confirm": "तुम्हाला दृश्य `{{title}}` हटवायचे आहे याची खात्री आहे का?",
|
||||||
"delete-success": "शॉर्टकट `{{title}}` यशस्वीरित्या हटवले"
|
"delete-success": "दृश्य `{{title}}` यशस्वीरित्या हटवले"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "अधिकृतता एन्डपाॅंइन्ट",
|
"authorization-endpoint": "अधिकृतता एन्डपाॅंइन्ट",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Sist oppdatert",
|
"last-updated-at": "Sist oppdatert",
|
||||||
"learn-more": "Lær mer",
|
"learn-more": "Lær mer",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Administrer",
|
||||||
"map": "Kart",
|
"map": "Kart",
|
||||||
"mark": "Merk",
|
"mark": "Merk",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Velg",
|
"select": "Velg",
|
||||||
"settings": "Innstillinger",
|
"settings": "Innstillinger",
|
||||||
"share": "Del",
|
"share": "Del",
|
||||||
"shortcut-filter": "Snarveifilter",
|
|
||||||
"shortcuts": "Snarveier",
|
|
||||||
"sign-in": "Logg inn",
|
"sign-in": "Logg inn",
|
||||||
"sign-in-with": "Logg inn med {{provider}}",
|
"sign-in-with": "Logg inn med {{provider}}",
|
||||||
"sign-out": "Logg ut",
|
"sign-out": "Logg ut",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Brukernavn",
|
"username": "Brukernavn",
|
||||||
"version": "Versjon",
|
"version": "Versjon",
|
||||||
"visibility": "Synlighet",
|
"visibility": "Synlighet",
|
||||||
|
"views": "Visninger",
|
||||||
"yourself": "Deg selv",
|
"yourself": "Deg selv",
|
||||||
"empty-placeholder": "Tømme",
|
"empty-placeholder": "Tømme",
|
||||||
"unlink": "Fjern tilknytningen"
|
"unlink": "Fjern tilknytningen"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Memo standarder",
|
"memo-defaults-title": "Memo standarder",
|
||||||
"theme-description": "Bruker det valgte temaet umiddelbart på denne enheten."
|
"theme-description": "Bruker det valgte temaet umiddelbart på denne enheten."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Er du sikker på at du vil slette snarveien `{{title}}`?",
|
"delete-confirm": "Er du sikker på at du vil slette visningen `{{title}}`?",
|
||||||
"delete-success": "Snarvei `{{title}}` slettet vellykket"
|
"delete-success": "Visning `{{title}}` slettet vellykket"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Autorisasjon endepunkt",
|
"authorization-endpoint": "Autorisasjon endepunkt",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Laatst bijgewerkt op",
|
"last-updated-at": "Laatst bijgewerkt op",
|
||||||
"learn-more": "Meer informatie",
|
"learn-more": "Meer informatie",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Beheren",
|
||||||
"map": "Kaart",
|
"map": "Kaart",
|
||||||
"mark": "Markeren",
|
"mark": "Markeren",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Selecteren",
|
"select": "Selecteren",
|
||||||
"settings": "Instellingen",
|
"settings": "Instellingen",
|
||||||
"share": "Delen",
|
"share": "Delen",
|
||||||
"shortcut-filter": "Sneltoetsfilter",
|
|
||||||
"shortcuts": "Sneltoetsen",
|
|
||||||
"sign-in": "Inloggen",
|
"sign-in": "Inloggen",
|
||||||
"sign-in-with": "Inloggen met {{provider}}",
|
"sign-in-with": "Inloggen met {{provider}}",
|
||||||
"sign-out": "Uitloggen",
|
"sign-out": "Uitloggen",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Gebruikersnaam",
|
"username": "Gebruikersnaam",
|
||||||
"version": "Versie",
|
"version": "Versie",
|
||||||
"visibility": "Zichtbaarheid",
|
"visibility": "Zichtbaarheid",
|
||||||
|
"views": "Weergaven",
|
||||||
"yourself": "Jijzelf",
|
"yourself": "Jijzelf",
|
||||||
"empty-placeholder": "Leeg",
|
"empty-placeholder": "Leeg",
|
||||||
"unlink": "Ontkoppelen"
|
"unlink": "Ontkoppelen"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Standaardinstellingen voor memo's",
|
"memo-defaults-title": "Standaardinstellingen voor memo's",
|
||||||
"theme-description": "Past het geselecteerde thema onmiddellijk toe op dit apparaat."
|
"theme-description": "Past het geselecteerde thema onmiddellijk toe op dit apparaat."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Weet je zeker dat je sneltoets `{{title}}` wilt verwijderen?",
|
"delete-confirm": "Weet je zeker dat je weergave `{{title}}` wilt verwijderen?",
|
||||||
"delete-success": "Sneltoets `{{title}}` succesvol verwijderd"
|
"delete-success": "Weergave `{{title}}` succesvol verwijderd"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Autorisatie-eindpunt",
|
"authorization-endpoint": "Autorisatie-eindpunt",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Ostatnia aktualizacja",
|
"last-updated-at": "Ostatnia aktualizacja",
|
||||||
"learn-more": "Dowiedz się więcej",
|
"learn-more": "Dowiedz się więcej",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Zarządzaj",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Oznacz",
|
"mark": "Oznacz",
|
||||||
"memo": "Notatka",
|
"memo": "Notatka",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Wybierz",
|
"select": "Wybierz",
|
||||||
"settings": "Ustawienia",
|
"settings": "Ustawienia",
|
||||||
"share": "Udostępnij",
|
"share": "Udostępnij",
|
||||||
"shortcut-filter": "Filtr skrótów",
|
|
||||||
"shortcuts": "Skróty",
|
|
||||||
"sign-in": "Zaloguj się",
|
"sign-in": "Zaloguj się",
|
||||||
"sign-in-with": "Zaloguj się za pomocą {{provider}}",
|
"sign-in-with": "Zaloguj się za pomocą {{provider}}",
|
||||||
"sign-out": "Wyloguj się",
|
"sign-out": "Wyloguj się",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Nazwa użytkownika",
|
"username": "Nazwa użytkownika",
|
||||||
"version": "Wersja",
|
"version": "Wersja",
|
||||||
"visibility": "Widoczność",
|
"visibility": "Widoczność",
|
||||||
|
"views": "Widoki",
|
||||||
"yourself": "Ty sam",
|
"yourself": "Ty sam",
|
||||||
"empty-placeholder": "Pusty",
|
"empty-placeholder": "Pusty",
|
||||||
"unlink": "Odczepić"
|
"unlink": "Odczepić"
|
||||||
|
|
@ -473,9 +473,9 @@
|
||||||
"memo-defaults-title": "Domyślne ustawienia notatki",
|
"memo-defaults-title": "Domyślne ustawienia notatki",
|
||||||
"theme-description": "Natychmiast stosuje wybrany motyw na tym urządzeniu."
|
"theme-description": "Natychmiast stosuje wybrany motyw na tym urządzeniu."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Czy na pewno chcesz usunąć skrót `{{title}}`?",
|
"delete-confirm": "Czy na pewno chcesz usunąć widok `{{title}}`?",
|
||||||
"delete-success": "Skrót `{{title}}` usunięty pomyślnie"
|
"delete-success": "Widok `{{title}}` usunięty pomyślnie"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Endpoint autoryzacji",
|
"authorization-endpoint": "Endpoint autoryzacji",
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"last-updated-at": "Atualizado em",
|
"last-updated-at": "Atualizado em",
|
||||||
"learn-more": "Saiba mais",
|
"learn-more": "Saiba mais",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Gerenciar",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Vincular",
|
"mark": "Vincular",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -94,8 +95,6 @@
|
||||||
"select": "Selecionar",
|
"select": "Selecionar",
|
||||||
"settings": "Ajustes",
|
"settings": "Ajustes",
|
||||||
"share": "Compartilhar",
|
"share": "Compartilhar",
|
||||||
"shortcut-filter": "Filtro de atalhos",
|
|
||||||
"shortcuts": "Atalhos",
|
|
||||||
"sign-in": "Entrar",
|
"sign-in": "Entrar",
|
||||||
"sign-in-with": "Entrar com {{provider}}",
|
"sign-in-with": "Entrar com {{provider}}",
|
||||||
"sign-out": "Sair",
|
"sign-out": "Sair",
|
||||||
|
|
@ -113,6 +112,7 @@
|
||||||
"username": "Nome de usuário",
|
"username": "Nome de usuário",
|
||||||
"version": "Versão",
|
"version": "Versão",
|
||||||
"visibility": "Visibilidade",
|
"visibility": "Visibilidade",
|
||||||
|
"views": "Vistas",
|
||||||
"yourself": "Você mesmo"
|
"yourself": "Você mesmo"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -333,9 +333,9 @@
|
||||||
"theme": "Tema",
|
"theme": "Tema",
|
||||||
"label": "Preferências"
|
"label": "Preferências"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Tem certeza de que deseja deletar o atalho `{{title}}`?",
|
"delete-confirm": "Tem certeza de que deseja excluir a vista `{{title}}`?",
|
||||||
"delete-success": "Atalho `{{title}}` deletado com êxito"
|
"delete-success": "Vista `{{title}}` excluída com sucesso"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Endpoint de autenticação",
|
"authorization-endpoint": "Endpoint de autenticação",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Última atualização em",
|
"last-updated-at": "Última atualização em",
|
||||||
"learn-more": "Saiba mais",
|
"learn-more": "Saiba mais",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
|
"manage": "Gerir",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Marcar",
|
"mark": "Marcar",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Selecionar",
|
"select": "Selecionar",
|
||||||
"settings": "Definições",
|
"settings": "Definições",
|
||||||
"share": "Partilhar",
|
"share": "Partilhar",
|
||||||
"shortcut-filter": "Filtro de atalho",
|
|
||||||
"shortcuts": "Atalhos",
|
|
||||||
"sign-in": "Iniciar sessão",
|
"sign-in": "Iniciar sessão",
|
||||||
"sign-in-with": "Iniciar sessão com {{provider}}",
|
"sign-in-with": "Iniciar sessão com {{provider}}",
|
||||||
"sign-out": "Terminar sessão",
|
"sign-out": "Terminar sessão",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Nome de utilizador",
|
"username": "Nome de utilizador",
|
||||||
"version": "Versão",
|
"version": "Versão",
|
||||||
"visibility": "Visibilidade",
|
"visibility": "Visibilidade",
|
||||||
|
"views": "Vistas",
|
||||||
"yourself": "Você próprio",
|
"yourself": "Você próprio",
|
||||||
"empty-placeholder": "Vazia",
|
"empty-placeholder": "Vazia",
|
||||||
"unlink": "Desvincular"
|
"unlink": "Desvincular"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Padrões de memorando",
|
"memo-defaults-title": "Padrões de memorando",
|
||||||
"theme-description": "Aplica o tema selecionado imediatamente neste dispositivo."
|
"theme-description": "Aplica o tema selecionado imediatamente neste dispositivo."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Tem a certeza de que deseja eliminar o atalho `{{title}}`?",
|
"delete-confirm": "Tem a certeza de que deseja eliminar a vista `{{title}}`?",
|
||||||
"delete-success": "Atalho `{{title}}` eliminado com sucesso"
|
"delete-success": "Vista `{{title}}` eliminada com sucesso"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Ponto de Autorização",
|
"authorization-endpoint": "Ponto de Autorização",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Ultima actualizare la",
|
"last-updated-at": "Ultima actualizare la",
|
||||||
"learn-more": "Află mai multe",
|
"learn-more": "Află mai multe",
|
||||||
"link": "Legătură",
|
"link": "Legătură",
|
||||||
|
"manage": "Gestionează",
|
||||||
"map": "Hartă",
|
"map": "Hartă",
|
||||||
"mark": "Marca",
|
"mark": "Marca",
|
||||||
"memo": "Notă",
|
"memo": "Notă",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Selecta",
|
"select": "Selecta",
|
||||||
"settings": "Setări",
|
"settings": "Setări",
|
||||||
"share": "Distribuie",
|
"share": "Distribuie",
|
||||||
"shortcut-filter": "Filtru de comenzi rapide",
|
|
||||||
"shortcuts": "Comenzi rapide",
|
|
||||||
"sign-in": "Conectare",
|
"sign-in": "Conectare",
|
||||||
"sign-in-with": "Conectați-vă cu {{provider}}",
|
"sign-in-with": "Conectați-vă cu {{provider}}",
|
||||||
"sign-out": "Sign out",
|
"sign-out": "Sign out",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Nume de utilizator",
|
"username": "Nume de utilizator",
|
||||||
"version": "Versiune",
|
"version": "Versiune",
|
||||||
"visibility": "Vizibilitate",
|
"visibility": "Vizibilitate",
|
||||||
|
"views": "Vizualizări",
|
||||||
"yourself": "Te"
|
"yourself": "Te"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Aplică tema selectată imediat pe acest dispozitiv.",
|
"theme-description": "Aplică tema selectată imediat pe acest dispozitiv.",
|
||||||
"theme": "Temă"
|
"theme": "Temă"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Sigur doriți să ștergeți comanda rapidă `{{title}}`?",
|
"delete-confirm": "Sigur doriți să ștergeți vizualizarea `{{title}}`?",
|
||||||
"delete-success": "Comanda rapidă `{{title}}` a fost ștearsă cu succes"
|
"delete-success": "Vizualizarea `{{title}}` a fost ștearsă cu succes"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "Cont",
|
"account": "Cont",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Изменено",
|
"last-updated-at": "Изменено",
|
||||||
"learn-more": "Узнать больше",
|
"learn-more": "Узнать больше",
|
||||||
"link": "Ссылка",
|
"link": "Ссылка",
|
||||||
|
"manage": "Управление",
|
||||||
"map": "Карта",
|
"map": "Карта",
|
||||||
"mark": "Связать",
|
"mark": "Связать",
|
||||||
"memo": "Заметка",
|
"memo": "Заметка",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Выбрать",
|
"select": "Выбрать",
|
||||||
"settings": "Настройки",
|
"settings": "Настройки",
|
||||||
"share": "Поделиться",
|
"share": "Поделиться",
|
||||||
"shortcut-filter": "Условие отбора",
|
|
||||||
"shortcuts": "Ярлыки",
|
|
||||||
"sign-in": "Войти",
|
"sign-in": "Войти",
|
||||||
"sign-in-with": "Войти через {{provider}}",
|
"sign-in-with": "Войти через {{provider}}",
|
||||||
"sign-out": "Выйти",
|
"sign-out": "Выйти",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Имя пользователя",
|
"username": "Имя пользователя",
|
||||||
"version": "Версия",
|
"version": "Версия",
|
||||||
"visibility": "Видимость",
|
"visibility": "Видимость",
|
||||||
|
"views": "Представления",
|
||||||
"yourself": "Вы",
|
"yourself": "Вы",
|
||||||
"empty-placeholder": "Пустой",
|
"empty-placeholder": "Пустой",
|
||||||
"unlink": "Отсоединить"
|
"unlink": "Отсоединить"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Памятка по умолчанию",
|
"memo-defaults-title": "Памятка по умолчанию",
|
||||||
"theme-description": "Немедленно применяет выбранную тему на этом устройстве."
|
"theme-description": "Немедленно применяет выбранную тему на этом устройстве."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Вы уверены, что хотите удалить ярлык `{{title}}`?",
|
"delete-confirm": "Вы уверены, что хотите удалить представление `{{title}}`?",
|
||||||
"delete-success": "Ярлык `{{title}}` успешно удален"
|
"delete-success": "Представление `{{title}}` успешно удалено"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Конечная точка авторизации",
|
"authorization-endpoint": "Конечная точка авторизации",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
"last-updated-at": "Naposledy aktualizované o",
|
"last-updated-at": "Naposledy aktualizované o",
|
||||||
"learn-more": "Zistite viac",
|
"learn-more": "Zistite viac",
|
||||||
"link": "Odkaz",
|
"link": "Odkaz",
|
||||||
|
"manage": "Spravovať",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"mark": "Marka",
|
"mark": "Marka",
|
||||||
"memo": "Memo",
|
"memo": "Memo",
|
||||||
|
|
@ -133,8 +134,6 @@
|
||||||
"select": "Vyberte",
|
"select": "Vyberte",
|
||||||
"settings": "Nastavenia",
|
"settings": "Nastavenia",
|
||||||
"share": "zdieľať",
|
"share": "zdieľať",
|
||||||
"shortcut-filter": "Filter skratiek",
|
|
||||||
"shortcuts": "Skratky",
|
|
||||||
"sign-in": "Prihláste sa",
|
"sign-in": "Prihláste sa",
|
||||||
"sign-in-with": "Prihláste sa pomocou {{provider}}",
|
"sign-in-with": "Prihláste sa pomocou {{provider}}",
|
||||||
"sign-out": "Odhláste sa",
|
"sign-out": "Odhláste sa",
|
||||||
|
|
@ -153,6 +152,7 @@
|
||||||
"username": "Používateľské meno",
|
"username": "Používateľské meno",
|
||||||
"version": "Verzia",
|
"version": "Verzia",
|
||||||
"visibility": "Viditeľnosť",
|
"visibility": "Viditeľnosť",
|
||||||
|
"views": "Zobrazenia",
|
||||||
"yourself": "seba"
|
"yourself": "seba"
|
||||||
},
|
},
|
||||||
"locale-picker": {
|
"locale-picker": {
|
||||||
|
|
@ -571,9 +571,9 @@
|
||||||
"theme-description": "Ihneď použije vybratú tému na tomto zariadení.",
|
"theme-description": "Ihneď použije vybratú tému na tomto zariadení.",
|
||||||
"theme": "Téma"
|
"theme": "Téma"
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Naozaj chcete odstrániť skratku `{{title}}`?",
|
"delete-confirm": "Naozaj chcete odstrániť zobrazenie `{{title}}`?",
|
||||||
"delete-success": "Skratka `{{title}}` bola úspešne odstránená"
|
"delete-success": "Zobrazenie `{{title}}` bolo úspešne odstránené"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"account": "účtu",
|
"account": "účtu",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
"last-updated-at": "Zadnja posodobitev",
|
"last-updated-at": "Zadnja posodobitev",
|
||||||
"learn-more": "Spoznaj več",
|
"learn-more": "Spoznaj več",
|
||||||
"link": "Povezava",
|
"link": "Povezava",
|
||||||
|
"manage": "Upravljaj",
|
||||||
"map": "Zemljevid",
|
"map": "Zemljevid",
|
||||||
"mark": "Označi",
|
"mark": "Označi",
|
||||||
"memo": "Beležka",
|
"memo": "Beležka",
|
||||||
|
|
@ -95,8 +96,6 @@
|
||||||
"select": "Izberi",
|
"select": "Izberi",
|
||||||
"settings": "Nastavitve",
|
"settings": "Nastavitve",
|
||||||
"share": "Deli",
|
"share": "Deli",
|
||||||
"shortcut-filter": "Filter bližnjic",
|
|
||||||
"shortcuts": "Bližnjice",
|
|
||||||
"sign-in": "Prijavi se",
|
"sign-in": "Prijavi se",
|
||||||
"sign-in-with": "Prijavi se z {{provider}}",
|
"sign-in-with": "Prijavi se z {{provider}}",
|
||||||
"sign-out": "Odjavi se",
|
"sign-out": "Odjavi se",
|
||||||
|
|
@ -114,6 +113,7 @@
|
||||||
"username": "Uporabniško ime",
|
"username": "Uporabniško ime",
|
||||||
"version": "Verzija",
|
"version": "Verzija",
|
||||||
"visibility": "Vidnost",
|
"visibility": "Vidnost",
|
||||||
|
"views": "Pogledi",
|
||||||
"yourself": "Ti",
|
"yourself": "Ti",
|
||||||
"empty-placeholder": "prazno",
|
"empty-placeholder": "prazno",
|
||||||
"unlink": "Prekini povezavo"
|
"unlink": "Prekini povezavo"
|
||||||
|
|
@ -454,9 +454,9 @@
|
||||||
"memo-defaults-title": "Privzete nastavitve beležke",
|
"memo-defaults-title": "Privzete nastavitve beležke",
|
||||||
"theme-description": "Izbrano temo takoj uporabi v tej napravi."
|
"theme-description": "Izbrano temo takoj uporabi v tej napravi."
|
||||||
},
|
},
|
||||||
"shortcut": {
|
"memo-view": {
|
||||||
"delete-confirm": "Ali ste prepričani, da želite izbrisati bližnjico \"{{title}}\"?",
|
"delete-confirm": "Ali ste prepričani, da želite izbrisati pogled \"{{title}}\"?",
|
||||||
"delete-success": "Bližnjica \"{{title}}\" je uspešno izbrisana"
|
"delete-success": "Pogled \"{{title}}\" je uspešno izbrisan"
|
||||||
},
|
},
|
||||||
"sso": {
|
"sso": {
|
||||||
"authorization-endpoint": "Končna točka avtorizacije",
|
"authorization-endpoint": "Končna točka avtorizacije",
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue