mirror of
https://github.com/usememos/memos.git
synced 2026-11-19 10:29:11 +01:00
feat(export): serve memo exports as a streamed, admin-only file download (#6514)
This commit is contained in:
@@ -115,7 +115,7 @@ A `ratelimit.Policy` is a table. Each row names a scope, the kind of key it is c
|
||||
| `upload_user` | user id | upload start, `CreateAttachment` | every start | 120 per minute |
|
||||
| `transcribe_user` | user id | `Transcribe` | every call | 20 per hour |
|
||||
| `write_user` | user id | memo, comment, reaction, share, memo-view, and webhook creation | every call | 120 per minute |
|
||||
| `archive_user` | user id | `ExportMemos`, `ImportMemos` upload start | every call | 10 per hour |
|
||||
| `archive_user` | user id | `GET /file/users/{username}/export` (administrators only), `ImportMemos` upload start | every call | 10 per hour |
|
||||
|
||||
The two catch-all scopes are what make the table complete: a procedure nobody thought to list is still bounded. The specific scopes sit on top with tighter numbers. A request can therefore be refused by either its catch-all or its specific scope, and the first refusal wins.
|
||||
|
||||
|
||||
@@ -296,3 +296,29 @@ Each version has its own schema directory, `docs/design/memo-export/<MAJOR.MINOR
|
||||
- A `SELECTION` scope for a filtered subset, for example one Space or one tag, using the same record layout.
|
||||
- Persisting a content digest on stored attachments so that import can find identical bytes anywhere in the account instead of only under the same UID.
|
||||
- Firing memo webhooks and mention notifications for imported memos. An import currently publishes one live-refresh event and nothing else.
|
||||
|
||||
## Amendments
|
||||
|
||||
### 2026-10-31: export is an administrator download
|
||||
|
||||
Export left `UserService`. `ExportMemos` and `ExportMemosRequest` are removed; `ImportMemos` is unchanged and every
|
||||
member still imports into their own account.
|
||||
|
||||
The archive is now served by the file server at `GET /file/users/{username}/export`, which authenticates like
|
||||
attachments do, with the `Authorization` header or the session cookie. Only an instance administrator may call it, for
|
||||
any user, so an administrator can hand a departing member their archive. The archive is still personal: `scope.kind` is
|
||||
`USER` and the content rules above are unchanged.
|
||||
|
||||
Why: the RPC built the whole ZIP, attachment bytes included, in server memory before answering, and the browser then
|
||||
held it twice more. The route writes the ZIP straight into the response: attachment bytes pass through without being
|
||||
held, so server memory no longer grows with the attachments, only with the memo rows, and the browser streams the
|
||||
download to disk. One export runs per instance at a time; a second request receives
|
||||
`429` with `another export is running`. The `archive_user` budget of ten per hour still applies, charged to the
|
||||
administrator. `HEAD` runs every check and returns the headers alone, which the web client uses as a preflight so a
|
||||
refusal becomes a message rather than a downloaded error document. Every memo row the archive needs is loaded before
|
||||
the first byte, so permission, not-found, and database errors on those rows arrive as status codes. Attachment content
|
||||
is read while the archive streams; a missing file or a storage error there ends the download as a truncated ZIP, which
|
||||
the reader rejects.
|
||||
|
||||
The export route is a plain HTTP route and no longer appears in the generated clients or the OpenAPI document. The
|
||||
`Export semantics` and `Transport` sections above describe the RPC as it shipped in 26.10.0-rc.2.
|
||||
|
||||
@@ -29,6 +29,10 @@ instead, and update `core/configuration/testdata/compat/` in the same change. Af
|
||||
|
||||
### Breaking
|
||||
|
||||
- `UserService.ExportMemos` and `ExportMemosRequest` are removed. Export is an instance-administrator download at
|
||||
`GET /file/users/{username}/export`, authenticated like attachments (Bearer header or session cookie), streaming the
|
||||
archive with `Content-Disposition`. One export runs at a time per instance; a second request receives `429`. Members
|
||||
ask an administrator for their archive. `ImportMemos` is unchanged.
|
||||
- Access tokens are now bound to the user's password hash and become invalid immediately after a password change or
|
||||
an administrator password reset. Pre-upgrade access tokens are also rejected; clients must refresh them or sign in
|
||||
again. The browser session that changes its own password can still refresh; other refresh sessions are revoked.
|
||||
|
||||
@@ -7,7 +7,6 @@ import "api/space_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/api/httpbody.proto";
|
||||
import "google/api/resource.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
@@ -273,15 +272,6 @@ service UserService {
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// ExportMemos writes every memo the user created, with comments, archived
|
||||
// memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
// docs/design/memos-export-format.md). Only the user may export their own
|
||||
// memos. The body is the archive; content_type is its media type.
|
||||
rpc ExportMemos(ExportMemosRequest) returns (google.api.HttpBody) {
|
||||
option (google.api.http) = {get: "/api/{name=users/*}:exportMemos"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// ImportMemos uploads a Memos export file in bounded chunks and imports it
|
||||
// into the user's memos. The first call carries the spec and returns an
|
||||
// upload_id; later calls carry that upload_id. A finishing call with
|
||||
@@ -1310,16 +1300,6 @@ message DeletePersonalAccessTokenRequest {
|
||||
];
|
||||
}
|
||||
|
||||
// Request message for UserService.ExportMemos.
|
||||
message ExportMemosRequest {
|
||||
// Required. The user whose memos are exported. Must be the caller.
|
||||
// Format: users/{user}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {type: "memos.api/User"}
|
||||
];
|
||||
}
|
||||
|
||||
// Request message for UserService.ImportMemos.
|
||||
message ImportMemosRequest {
|
||||
// Required. The user who receives the memos. Must be the caller.
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
api "github.com/usememos/memos/proto/gen/api"
|
||||
httpbody "google.golang.org/genproto/googleapis/api/httpbody"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
http "net/http"
|
||||
strings "strings"
|
||||
@@ -125,8 +124,6 @@ const (
|
||||
// UserServiceDeletePersonalAccessTokenProcedure is the fully-qualified name of the UserService's
|
||||
// DeletePersonalAccessToken RPC.
|
||||
UserServiceDeletePersonalAccessTokenProcedure = "/memos.api.UserService/DeletePersonalAccessToken"
|
||||
// UserServiceExportMemosProcedure is the fully-qualified name of the UserService's ExportMemos RPC.
|
||||
UserServiceExportMemosProcedure = "/memos.api.UserService/ExportMemos"
|
||||
// UserServiceImportMemosProcedure is the fully-qualified name of the UserService's ImportMemos RPC.
|
||||
UserServiceImportMemosProcedure = "/memos.api.UserService/ImportMemos"
|
||||
)
|
||||
@@ -228,11 +225,6 @@ type UserServiceClient interface {
|
||||
// DeletePersonalAccessToken deletes a personal access token, which stops
|
||||
// working immediately. Only the owner may call it.
|
||||
DeletePersonalAccessToken(context.Context, *connect.Request[api.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ExportMemos writes every memo the user created, with comments, archived
|
||||
// memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
// docs/design/memos-export-format.md). Only the user may export their own
|
||||
// memos. The body is the archive; content_type is its media type.
|
||||
ExportMemos(context.Context, *connect.Request[api.ExportMemosRequest]) (*connect.Response[httpbody.HttpBody], error)
|
||||
// ImportMemos uploads a Memos export file in bounded chunks and imports it
|
||||
// into the user's memos. The first call carries the spec and returns an
|
||||
// upload_id; later calls carry that upload_id. A finishing call with
|
||||
@@ -446,12 +438,6 @@ func NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts ..
|
||||
connect.WithSchema(userServiceMethods.ByName("DeletePersonalAccessToken")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
exportMemos: connect.NewClient[api.ExportMemosRequest, httpbody.HttpBody](
|
||||
httpClient,
|
||||
baseURL+UserServiceExportMemosProcedure,
|
||||
connect.WithSchema(userServiceMethods.ByName("ExportMemos")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
importMemos: connect.NewClient[api.ImportMemosRequest, api.ImportMemosResponse](
|
||||
httpClient,
|
||||
baseURL+UserServiceImportMemosProcedure,
|
||||
@@ -495,7 +481,6 @@ type userServiceClient struct {
|
||||
listPersonalAccessTokens *connect.Client[api.ListPersonalAccessTokensRequest, api.ListPersonalAccessTokensResponse]
|
||||
createPersonalAccessToken *connect.Client[api.CreatePersonalAccessTokenRequest, api.CreatePersonalAccessTokenResponse]
|
||||
deletePersonalAccessToken *connect.Client[api.DeletePersonalAccessTokenRequest, emptypb.Empty]
|
||||
exportMemos *connect.Client[api.ExportMemosRequest, httpbody.HttpBody]
|
||||
importMemos *connect.Client[api.ImportMemosRequest, api.ImportMemosResponse]
|
||||
}
|
||||
|
||||
@@ -659,11 +644,6 @@ func (c *userServiceClient) DeletePersonalAccessToken(ctx context.Context, req *
|
||||
return c.deletePersonalAccessToken.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ExportMemos calls memos.api.UserService.ExportMemos.
|
||||
func (c *userServiceClient) ExportMemos(ctx context.Context, req *connect.Request[api.ExportMemosRequest]) (*connect.Response[httpbody.HttpBody], error) {
|
||||
return c.exportMemos.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ImportMemos calls memos.api.UserService.ImportMemos.
|
||||
func (c *userServiceClient) ImportMemos(ctx context.Context, req *connect.Request[api.ImportMemosRequest]) (*connect.Response[api.ImportMemosResponse], error) {
|
||||
return c.importMemos.CallUnary(ctx, req)
|
||||
@@ -766,11 +746,6 @@ type UserServiceHandler interface {
|
||||
// DeletePersonalAccessToken deletes a personal access token, which stops
|
||||
// working immediately. Only the owner may call it.
|
||||
DeletePersonalAccessToken(context.Context, *connect.Request[api.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ExportMemos writes every memo the user created, with comments, archived
|
||||
// memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
// docs/design/memos-export-format.md). Only the user may export their own
|
||||
// memos. The body is the archive; content_type is its media type.
|
||||
ExportMemos(context.Context, *connect.Request[api.ExportMemosRequest]) (*connect.Response[httpbody.HttpBody], error)
|
||||
// ImportMemos uploads a Memos export file in bounded chunks and imports it
|
||||
// into the user's memos. The first call carries the spec and returns an
|
||||
// upload_id; later calls carry that upload_id. A finishing call with
|
||||
@@ -980,12 +955,6 @@ func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption
|
||||
connect.WithSchema(userServiceMethods.ByName("DeletePersonalAccessToken")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
userServiceExportMemosHandler := connect.NewUnaryHandler(
|
||||
UserServiceExportMemosProcedure,
|
||||
svc.ExportMemos,
|
||||
connect.WithSchema(userServiceMethods.ByName("ExportMemos")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
userServiceImportMemosHandler := connect.NewUnaryHandler(
|
||||
UserServiceImportMemosProcedure,
|
||||
svc.ImportMemos,
|
||||
@@ -1058,8 +1027,6 @@ func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption
|
||||
userServiceCreatePersonalAccessTokenHandler.ServeHTTP(w, r)
|
||||
case UserServiceDeletePersonalAccessTokenProcedure:
|
||||
userServiceDeletePersonalAccessTokenHandler.ServeHTTP(w, r)
|
||||
case UserServiceExportMemosProcedure:
|
||||
userServiceExportMemosHandler.ServeHTTP(w, r)
|
||||
case UserServiceImportMemosProcedure:
|
||||
userServiceImportMemosHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
@@ -1199,10 +1166,6 @@ func (UnimplementedUserServiceHandler) DeletePersonalAccessToken(context.Context
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.UserService.DeletePersonalAccessToken is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedUserServiceHandler) ExportMemos(context.Context, *connect.Request[api.ExportMemosRequest]) (*connect.Response[httpbody.HttpBody], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.UserService.ExportMemos is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedUserServiceHandler) ImportMemos(context.Context, *connect.Request[api.ImportMemosRequest]) (*connect.Response[api.ImportMemosResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.UserService.ImportMemos is not implemented"))
|
||||
}
|
||||
|
||||
+214
-270
@@ -8,7 +8,6 @@ package api
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
httpbody "google.golang.org/genproto/googleapis/api/httpbody"
|
||||
color "google.golang.org/genproto/googleapis/type/color"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
@@ -353,7 +352,7 @@ func (x ImportMemosRequest_ConflictPolicy) Number() protoreflect.EnumNumber {
|
||||
|
||||
// Deprecated: Use ImportMemosRequest_ConflictPolicy.Descriptor instead.
|
||||
func (ImportMemosRequest_ConflictPolicy) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{53, 0}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{52, 0}
|
||||
}
|
||||
|
||||
// User is an account on the instance.
|
||||
@@ -3701,53 +3700,6 @@ func (x *DeletePersonalAccessTokenRequest) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Request message for UserService.ExportMemos.
|
||||
type ExportMemosRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// Required. The user whose memos are exported. Must be the caller.
|
||||
// Format: users/{user}
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ExportMemosRequest) Reset() {
|
||||
*x = ExportMemosRequest{}
|
||||
mi := &file_api_user_service_proto_msgTypes[52]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ExportMemosRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExportMemosRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ExportMemosRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[52]
|
||||
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 ExportMemosRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ExportMemosRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{52}
|
||||
}
|
||||
|
||||
func (x *ExportMemosRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Request message for UserService.ImportMemos.
|
||||
type ImportMemosRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -3786,7 +3738,7 @@ type ImportMemosRequest struct {
|
||||
|
||||
func (x *ImportMemosRequest) Reset() {
|
||||
*x = ImportMemosRequest{}
|
||||
mi := &file_api_user_service_proto_msgTypes[53]
|
||||
mi := &file_api_user_service_proto_msgTypes[52]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3798,7 +3750,7 @@ func (x *ImportMemosRequest) String() string {
|
||||
func (*ImportMemosRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[53]
|
||||
mi := &file_api_user_service_proto_msgTypes[52]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3811,7 +3763,7 @@ func (x *ImportMemosRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{53}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{52}
|
||||
}
|
||||
|
||||
func (x *ImportMemosRequest) GetName() string {
|
||||
@@ -3921,7 +3873,7 @@ type ImportMemosResponse struct {
|
||||
|
||||
func (x *ImportMemosResponse) Reset() {
|
||||
*x = ImportMemosResponse{}
|
||||
mi := &file_api_user_service_proto_msgTypes[54]
|
||||
mi := &file_api_user_service_proto_msgTypes[53]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3933,7 +3885,7 @@ func (x *ImportMemosResponse) String() string {
|
||||
func (*ImportMemosResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[54]
|
||||
mi := &file_api_user_service_proto_msgTypes[53]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3946,7 +3898,7 @@ func (x *ImportMemosResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{54}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{53}
|
||||
}
|
||||
|
||||
func (x *ImportMemosResponse) GetUploadId() string {
|
||||
@@ -4024,7 +3976,7 @@ type ImportMemosSpec struct {
|
||||
|
||||
func (x *ImportMemosSpec) Reset() {
|
||||
*x = ImportMemosSpec{}
|
||||
mi := &file_api_user_service_proto_msgTypes[55]
|
||||
mi := &file_api_user_service_proto_msgTypes[54]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4036,7 +3988,7 @@ func (x *ImportMemosSpec) String() string {
|
||||
func (*ImportMemosSpec) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosSpec) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[55]
|
||||
mi := &file_api_user_service_proto_msgTypes[54]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4049,7 +4001,7 @@ func (x *ImportMemosSpec) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosSpec.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosSpec) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{55}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{54}
|
||||
}
|
||||
|
||||
func (x *ImportMemosSpec) GetTotalSize() int64 {
|
||||
@@ -4086,7 +4038,7 @@ type ImportMemosPlan struct {
|
||||
|
||||
func (x *ImportMemosPlan) Reset() {
|
||||
*x = ImportMemosPlan{}
|
||||
mi := &file_api_user_service_proto_msgTypes[56]
|
||||
mi := &file_api_user_service_proto_msgTypes[55]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4098,7 +4050,7 @@ func (x *ImportMemosPlan) String() string {
|
||||
func (*ImportMemosPlan) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosPlan) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[56]
|
||||
mi := &file_api_user_service_proto_msgTypes[55]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4111,7 +4063,7 @@ func (x *ImportMemosPlan) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosPlan.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosPlan) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{56}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{55}
|
||||
}
|
||||
|
||||
func (x *ImportMemosPlan) GetExportTime() *timestamppb.Timestamp {
|
||||
@@ -4198,7 +4150,7 @@ type ImportMemosReport struct {
|
||||
|
||||
func (x *ImportMemosReport) Reset() {
|
||||
*x = ImportMemosReport{}
|
||||
mi := &file_api_user_service_proto_msgTypes[57]
|
||||
mi := &file_api_user_service_proto_msgTypes[56]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4210,7 +4162,7 @@ func (x *ImportMemosReport) String() string {
|
||||
func (*ImportMemosReport) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosReport) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[57]
|
||||
mi := &file_api_user_service_proto_msgTypes[56]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4223,7 +4175,7 @@ func (x *ImportMemosReport) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosReport.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosReport) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{57}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{56}
|
||||
}
|
||||
|
||||
func (x *ImportMemosReport) GetCreated() int32 {
|
||||
@@ -4282,7 +4234,7 @@ type ImportMemosIssue struct {
|
||||
|
||||
func (x *ImportMemosIssue) Reset() {
|
||||
*x = ImportMemosIssue{}
|
||||
mi := &file_api_user_service_proto_msgTypes[58]
|
||||
mi := &file_api_user_service_proto_msgTypes[57]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4294,7 +4246,7 @@ func (x *ImportMemosIssue) String() string {
|
||||
func (*ImportMemosIssue) ProtoMessage() {}
|
||||
|
||||
func (x *ImportMemosIssue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[58]
|
||||
mi := &file_api_user_service_proto_msgTypes[57]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4307,7 +4259,7 @@ func (x *ImportMemosIssue) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ImportMemosIssue.ProtoReflect.Descriptor instead.
|
||||
func (*ImportMemosIssue) Descriptor() ([]byte, []int) {
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{58}
|
||||
return file_api_user_service_proto_rawDescGZIP(), []int{57}
|
||||
}
|
||||
|
||||
func (x *ImportMemosIssue) GetMemoUid() string {
|
||||
@@ -4344,7 +4296,7 @@ type UserSetting_GeneralSetting struct {
|
||||
|
||||
func (x *UserSetting_GeneralSetting) Reset() {
|
||||
*x = UserSetting_GeneralSetting{}
|
||||
mi := &file_api_user_service_proto_msgTypes[59]
|
||||
mi := &file_api_user_service_proto_msgTypes[58]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4356,7 +4308,7 @@ func (x *UserSetting_GeneralSetting) String() string {
|
||||
func (*UserSetting_GeneralSetting) ProtoMessage() {}
|
||||
|
||||
func (x *UserSetting_GeneralSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[59]
|
||||
mi := &file_api_user_service_proto_msgTypes[58]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4411,7 +4363,7 @@ type UserSetting_WebhooksSetting struct {
|
||||
|
||||
func (x *UserSetting_WebhooksSetting) Reset() {
|
||||
*x = UserSetting_WebhooksSetting{}
|
||||
mi := &file_api_user_service_proto_msgTypes[60]
|
||||
mi := &file_api_user_service_proto_msgTypes[59]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4423,7 +4375,7 @@ func (x *UserSetting_WebhooksSetting) String() string {
|
||||
func (*UserSetting_WebhooksSetting) ProtoMessage() {}
|
||||
|
||||
func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[60]
|
||||
mi := &file_api_user_service_proto_msgTypes[59]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4458,7 +4410,7 @@ type UserSetting_TagsSetting struct {
|
||||
|
||||
func (x *UserSetting_TagsSetting) Reset() {
|
||||
*x = UserSetting_TagsSetting{}
|
||||
mi := &file_api_user_service_proto_msgTypes[61]
|
||||
mi := &file_api_user_service_proto_msgTypes[60]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4470,7 +4422,7 @@ func (x *UserSetting_TagsSetting) String() string {
|
||||
func (*UserSetting_TagsSetting) ProtoMessage() {}
|
||||
|
||||
func (x *UserSetting_TagsSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[61]
|
||||
mi := &file_api_user_service_proto_msgTypes[60]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4507,7 +4459,7 @@ type UserSetting_TagMetadata struct {
|
||||
|
||||
func (x *UserSetting_TagMetadata) Reset() {
|
||||
*x = UserSetting_TagMetadata{}
|
||||
mi := &file_api_user_service_proto_msgTypes[62]
|
||||
mi := &file_api_user_service_proto_msgTypes[61]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4519,7 +4471,7 @@ func (x *UserSetting_TagMetadata) String() string {
|
||||
func (*UserSetting_TagMetadata) ProtoMessage() {}
|
||||
|
||||
func (x *UserSetting_TagMetadata) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[62]
|
||||
mi := &file_api_user_service_proto_msgTypes[61]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4562,7 +4514,7 @@ type UserSetting_EditorSetting struct {
|
||||
|
||||
func (x *UserSetting_EditorSetting) Reset() {
|
||||
*x = UserSetting_EditorSetting{}
|
||||
mi := &file_api_user_service_proto_msgTypes[63]
|
||||
mi := &file_api_user_service_proto_msgTypes[62]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4574,7 +4526,7 @@ func (x *UserSetting_EditorSetting) String() string {
|
||||
func (*UserSetting_EditorSetting) ProtoMessage() {}
|
||||
|
||||
func (x *UserSetting_EditorSetting) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[63]
|
||||
mi := &file_api_user_service_proto_msgTypes[62]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4614,7 +4566,7 @@ type UserStats_MemoTypeStats struct {
|
||||
|
||||
func (x *UserStats_MemoTypeStats) Reset() {
|
||||
*x = UserStats_MemoTypeStats{}
|
||||
mi := &file_api_user_service_proto_msgTypes[66]
|
||||
mi := &file_api_user_service_proto_msgTypes[65]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4626,7 +4578,7 @@ func (x *UserStats_MemoTypeStats) String() string {
|
||||
func (*UserStats_MemoTypeStats) ProtoMessage() {}
|
||||
|
||||
func (x *UserStats_MemoTypeStats) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[66]
|
||||
mi := &file_api_user_service_proto_msgTypes[65]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4687,7 +4639,7 @@ type UserUsage_Limits struct {
|
||||
|
||||
func (x *UserUsage_Limits) Reset() {
|
||||
*x = UserUsage_Limits{}
|
||||
mi := &file_api_user_service_proto_msgTypes[67]
|
||||
mi := &file_api_user_service_proto_msgTypes[66]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4699,7 +4651,7 @@ func (x *UserUsage_Limits) String() string {
|
||||
func (*UserUsage_Limits) ProtoMessage() {}
|
||||
|
||||
func (x *UserUsage_Limits) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[67]
|
||||
mi := &file_api_user_service_proto_msgTypes[66]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4759,7 +4711,7 @@ type MemoView_Icon struct {
|
||||
|
||||
func (x *MemoView_Icon) Reset() {
|
||||
*x = MemoView_Icon{}
|
||||
mi := &file_api_user_service_proto_msgTypes[68]
|
||||
mi := &file_api_user_service_proto_msgTypes[67]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4771,7 +4723,7 @@ func (x *MemoView_Icon) String() string {
|
||||
func (*MemoView_Icon) ProtoMessage() {}
|
||||
|
||||
func (x *MemoView_Icon) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[68]
|
||||
mi := &file_api_user_service_proto_msgTypes[67]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4849,7 +4801,7 @@ type UserNotification_MemoCommentPayload struct {
|
||||
|
||||
func (x *UserNotification_MemoCommentPayload) Reset() {
|
||||
*x = UserNotification_MemoCommentPayload{}
|
||||
mi := &file_api_user_service_proto_msgTypes[69]
|
||||
mi := &file_api_user_service_proto_msgTypes[68]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4861,7 +4813,7 @@ func (x *UserNotification_MemoCommentPayload) String() string {
|
||||
func (*UserNotification_MemoCommentPayload) ProtoMessage() {}
|
||||
|
||||
func (x *UserNotification_MemoCommentPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[69]
|
||||
mi := &file_api_user_service_proto_msgTypes[68]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4924,7 +4876,7 @@ type UserNotification_MemoMentionPayload struct {
|
||||
|
||||
func (x *UserNotification_MemoMentionPayload) Reset() {
|
||||
*x = UserNotification_MemoMentionPayload{}
|
||||
mi := &file_api_user_service_proto_msgTypes[70]
|
||||
mi := &file_api_user_service_proto_msgTypes[69]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4936,7 +4888,7 @@ func (x *UserNotification_MemoMentionPayload) String() string {
|
||||
func (*UserNotification_MemoMentionPayload) ProtoMessage() {}
|
||||
|
||||
func (x *UserNotification_MemoMentionPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[70]
|
||||
mi := &file_api_user_service_proto_msgTypes[69]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4999,7 +4951,7 @@ type UserNotification_SpaceInvitationPayload struct {
|
||||
|
||||
func (x *UserNotification_SpaceInvitationPayload) Reset() {
|
||||
*x = UserNotification_SpaceInvitationPayload{}
|
||||
mi := &file_api_user_service_proto_msgTypes[71]
|
||||
mi := &file_api_user_service_proto_msgTypes[70]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -5011,7 +4963,7 @@ func (x *UserNotification_SpaceInvitationPayload) String() string {
|
||||
func (*UserNotification_SpaceInvitationPayload) ProtoMessage() {}
|
||||
|
||||
func (x *UserNotification_SpaceInvitationPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_user_service_proto_msgTypes[71]
|
||||
mi := &file_api_user_service_proto_msgTypes[70]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -5059,7 +5011,7 @@ var File_api_user_service_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_user_service_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x16api/user_service.proto\x12\tmemos.api\x1a\x10api/common.proto\x1a\x17api/space_service.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/color.proto\"\xb2\x04\n" +
|
||||
"\x16api/user_service.proto\x12\tmemos.api\x1a\x10api/common.proto\x1a\x17api/space_service.proto\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\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/color.proto\"\xb2\x04\n" +
|
||||
"\x04User\x12\x17\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x1f\n" +
|
||||
"\busername\x18\x02 \x01(\tB\x03\xe0A\x02R\busername\x12&\n" +
|
||||
@@ -5396,10 +5348,7 @@ const file_api_user_service_proto_rawDesc = "" +
|
||||
"\x05token\x18\x02 \x01(\tR\x05token\"]\n" +
|
||||
" DeletePersonalAccessTokenRequest\x129\n" +
|
||||
"\x04name\x18\x01 \x01(\tB%\xe0A\x02\xfaA\x1f\n" +
|
||||
"\x1dmemos.api/PersonalAccessTokenR\x04name\"@\n" +
|
||||
"\x12ExportMemosRequest\x12*\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\x16\xe0A\x02\xfaA\x10\n" +
|
||||
"\x0ememos.api/UserR\x04name\"\xe3\x03\n" +
|
||||
"\x1dmemos.api/PersonalAccessTokenR\x04name\"\xe3\x03\n" +
|
||||
"\x12ImportMemosRequest\x12*\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\x16\xe0A\x02\xfaA\x10\n" +
|
||||
"\x0ememos.api/UserR\x04name\x120\n" +
|
||||
@@ -5447,7 +5396,7 @@ const file_api_user_service_proto_rawDesc = "" +
|
||||
"\bfailures\x18\x06 \x03(\v2\x1b.memos.api.ImportMemosIssueR\bfailures\"G\n" +
|
||||
"\x10ImportMemosIssue\x12\x19\n" +
|
||||
"\bmemo_uid\x18\x01 \x01(\tR\amemoUid\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage2\x8a%\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage2\x96$\n" +
|
||||
"\vUserService\x12Z\n" +
|
||||
"\tListUsers\x12\x1b.memos.api.ListUsersRequest\x1a\x1c.memos.api.ListUsersResponse\"\x12\x82\xd3\xe4\x93\x02\f\x12\n" +
|
||||
"/api/users\x12Y\n" +
|
||||
@@ -5485,8 +5434,7 @@ const file_api_user_service_proto_rawDesc = "" +
|
||||
"\x14DeleteLinkedIdentity\x12&.memos.api.DeleteLinkedIdentityRequest\x1a\x16.google.protobuf.Empty\"5\xdaA\x04name\x82\xd3\xe4\x93\x02(*&/api/{name=users/*/linkedIdentities/*}\x12\xb0\x01\n" +
|
||||
"\x18ListPersonalAccessTokens\x12*.memos.api.ListPersonalAccessTokensRequest\x1a+.memos.api.ListPersonalAccessTokensResponse\";\xdaA\x06parent\x82\xd3\xe4\x93\x02,\x12*/api/{parent=users/*}/personalAccessTokens\x12\xad\x01\n" +
|
||||
"\x19CreatePersonalAccessToken\x12+.memos.api.CreatePersonalAccessTokenRequest\x1a,.memos.api.CreatePersonalAccessTokenResponse\"5\x82\xd3\xe4\x93\x02/:\x01*\"*/api/{parent=users/*}/personalAccessTokens\x12\x9b\x01\n" +
|
||||
"\x19DeletePersonalAccessToken\x12+.memos.api.DeletePersonalAccessTokenRequest\x1a\x16.google.protobuf.Empty\"9\xdaA\x04name\x82\xd3\xe4\x93\x02,**/api/{name=users/*/personalAccessTokens/*}\x12r\n" +
|
||||
"\vExportMemos\x12\x1d.memos.api.ExportMemosRequest\x1a\x14.google.api.HttpBody\".\xdaA\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/api/{name=users/*}:exportMemos\x12x\n" +
|
||||
"\x19DeletePersonalAccessToken\x12+.memos.api.DeletePersonalAccessTokenRequest\x1a\x16.google.protobuf.Empty\"9\xdaA\x04name\x82\xd3\xe4\x93\x02,**/api/{name=users/*/personalAccessTokens/*}\x12x\n" +
|
||||
"\vImportMemos\x12\x1d.memos.api.ImportMemosRequest\x1a\x1e.memos.api.ImportMemosResponse\"*\x82\xd3\xe4\x93\x02$:\x01*\"\x1f/api/{name=users/*}:importMemosB\x8f\x01\n" +
|
||||
"\rcom.memos.apiB\x10UserServiceProtoP\x01Z'github.com/usememos/memos/proto/gen/api\xa2\x02\x03MAX\xaa\x02\tMemos.Api\xca\x02\tMemos\\Api\xe2\x02\x15Memos\\Api\\GPBMetadata\xea\x02\n" +
|
||||
"Memos::Apib\x06proto3"
|
||||
@@ -5504,7 +5452,7 @@ func file_api_user_service_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_api_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
|
||||
var file_api_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 72)
|
||||
var file_api_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 71)
|
||||
var file_api_user_service_proto_goTypes = []any{
|
||||
(User_Role)(0), // 0: memos.api.User.Role
|
||||
(UserSetting_Key)(0), // 1: memos.api.UserSetting.Key
|
||||
@@ -5564,175 +5512,171 @@ var file_api_user_service_proto_goTypes = []any{
|
||||
(*CreatePersonalAccessTokenRequest)(nil), // 55: memos.api.CreatePersonalAccessTokenRequest
|
||||
(*CreatePersonalAccessTokenResponse)(nil), // 56: memos.api.CreatePersonalAccessTokenResponse
|
||||
(*DeletePersonalAccessTokenRequest)(nil), // 57: memos.api.DeletePersonalAccessTokenRequest
|
||||
(*ExportMemosRequest)(nil), // 58: memos.api.ExportMemosRequest
|
||||
(*ImportMemosRequest)(nil), // 59: memos.api.ImportMemosRequest
|
||||
(*ImportMemosResponse)(nil), // 60: memos.api.ImportMemosResponse
|
||||
(*ImportMemosSpec)(nil), // 61: memos.api.ImportMemosSpec
|
||||
(*ImportMemosPlan)(nil), // 62: memos.api.ImportMemosPlan
|
||||
(*ImportMemosReport)(nil), // 63: memos.api.ImportMemosReport
|
||||
(*ImportMemosIssue)(nil), // 64: memos.api.ImportMemosIssue
|
||||
(*UserSetting_GeneralSetting)(nil), // 65: memos.api.UserSetting.GeneralSetting
|
||||
(*UserSetting_WebhooksSetting)(nil), // 66: memos.api.UserSetting.WebhooksSetting
|
||||
(*UserSetting_TagsSetting)(nil), // 67: memos.api.UserSetting.TagsSetting
|
||||
(*UserSetting_TagMetadata)(nil), // 68: memos.api.UserSetting.TagMetadata
|
||||
(*UserSetting_EditorSetting)(nil), // 69: memos.api.UserSetting.EditorSetting
|
||||
nil, // 70: memos.api.UserSetting.TagsSetting.TagsEntry
|
||||
nil, // 71: memos.api.UserStats.TagCountsEntry
|
||||
(*UserStats_MemoTypeStats)(nil), // 72: memos.api.UserStats.MemoTypeStats
|
||||
(*UserUsage_Limits)(nil), // 73: memos.api.UserUsage.Limits
|
||||
(*MemoView_Icon)(nil), // 74: memos.api.MemoView.Icon
|
||||
(*UserNotification_MemoCommentPayload)(nil), // 75: memos.api.UserNotification.MemoCommentPayload
|
||||
(*UserNotification_MemoMentionPayload)(nil), // 76: memos.api.UserNotification.MemoMentionPayload
|
||||
(*UserNotification_SpaceInvitationPayload)(nil), // 77: memos.api.UserNotification.SpaceInvitationPayload
|
||||
(State)(0), // 78: memos.api.State
|
||||
(*timestamppb.Timestamp)(nil), // 79: google.protobuf.Timestamp
|
||||
(*fieldmaskpb.FieldMask)(nil), // 80: google.protobuf.FieldMask
|
||||
(*color.Color)(nil), // 81: google.type.Color
|
||||
(*Space)(nil), // 82: memos.api.Space
|
||||
(SpaceMember_Role)(0), // 83: memos.api.SpaceMember.Role
|
||||
(*emptypb.Empty)(nil), // 84: google.protobuf.Empty
|
||||
(*httpbody.HttpBody)(nil), // 85: google.api.HttpBody
|
||||
(*ImportMemosRequest)(nil), // 58: memos.api.ImportMemosRequest
|
||||
(*ImportMemosResponse)(nil), // 59: memos.api.ImportMemosResponse
|
||||
(*ImportMemosSpec)(nil), // 60: memos.api.ImportMemosSpec
|
||||
(*ImportMemosPlan)(nil), // 61: memos.api.ImportMemosPlan
|
||||
(*ImportMemosReport)(nil), // 62: memos.api.ImportMemosReport
|
||||
(*ImportMemosIssue)(nil), // 63: memos.api.ImportMemosIssue
|
||||
(*UserSetting_GeneralSetting)(nil), // 64: memos.api.UserSetting.GeneralSetting
|
||||
(*UserSetting_WebhooksSetting)(nil), // 65: memos.api.UserSetting.WebhooksSetting
|
||||
(*UserSetting_TagsSetting)(nil), // 66: memos.api.UserSetting.TagsSetting
|
||||
(*UserSetting_TagMetadata)(nil), // 67: memos.api.UserSetting.TagMetadata
|
||||
(*UserSetting_EditorSetting)(nil), // 68: memos.api.UserSetting.EditorSetting
|
||||
nil, // 69: memos.api.UserSetting.TagsSetting.TagsEntry
|
||||
nil, // 70: memos.api.UserStats.TagCountsEntry
|
||||
(*UserStats_MemoTypeStats)(nil), // 71: memos.api.UserStats.MemoTypeStats
|
||||
(*UserUsage_Limits)(nil), // 72: memos.api.UserUsage.Limits
|
||||
(*MemoView_Icon)(nil), // 73: memos.api.MemoView.Icon
|
||||
(*UserNotification_MemoCommentPayload)(nil), // 74: memos.api.UserNotification.MemoCommentPayload
|
||||
(*UserNotification_MemoMentionPayload)(nil), // 75: memos.api.UserNotification.MemoMentionPayload
|
||||
(*UserNotification_SpaceInvitationPayload)(nil), // 76: memos.api.UserNotification.SpaceInvitationPayload
|
||||
(State)(0), // 77: memos.api.State
|
||||
(*timestamppb.Timestamp)(nil), // 78: google.protobuf.Timestamp
|
||||
(*fieldmaskpb.FieldMask)(nil), // 79: google.protobuf.FieldMask
|
||||
(*color.Color)(nil), // 80: google.type.Color
|
||||
(*Space)(nil), // 81: memos.api.Space
|
||||
(SpaceMember_Role)(0), // 82: memos.api.SpaceMember.Role
|
||||
(*emptypb.Empty)(nil), // 83: google.protobuf.Empty
|
||||
}
|
||||
var file_api_user_service_proto_depIdxs = []int32{
|
||||
0, // 0: memos.api.User.role:type_name -> memos.api.User.Role
|
||||
78, // 1: memos.api.User.state:type_name -> memos.api.State
|
||||
79, // 2: memos.api.User.create_time:type_name -> google.protobuf.Timestamp
|
||||
79, // 3: memos.api.User.update_time:type_name -> google.protobuf.Timestamp
|
||||
6, // 4: memos.api.ListUsersResponse.users:type_name -> memos.api.User
|
||||
80, // 5: memos.api.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask
|
||||
6, // 6: memos.api.BatchGetUsersResponse.users:type_name -> memos.api.User
|
||||
6, // 7: memos.api.CreateUserRequest.user:type_name -> memos.api.User
|
||||
6, // 8: memos.api.UpdateUserRequest.user:type_name -> memos.api.User
|
||||
80, // 9: memos.api.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
65, // 10: memos.api.UserSetting.general_setting:type_name -> memos.api.UserSetting.GeneralSetting
|
||||
66, // 11: memos.api.UserSetting.webhooks_setting:type_name -> memos.api.UserSetting.WebhooksSetting
|
||||
67, // 12: memos.api.UserSetting.tags_setting:type_name -> memos.api.UserSetting.TagsSetting
|
||||
69, // 13: memos.api.UserSetting.editor_setting:type_name -> memos.api.UserSetting.EditorSetting
|
||||
15, // 14: memos.api.ListUserSettingsResponse.user_settings:type_name -> memos.api.UserSetting
|
||||
15, // 15: memos.api.UpdateUserSettingRequest.user_setting:type_name -> memos.api.UserSetting
|
||||
80, // 16: memos.api.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
72, // 17: memos.api.UserStats.memo_type_stats:type_name -> memos.api.UserStats.MemoTypeStats
|
||||
71, // 18: memos.api.UserStats.tag_counts:type_name -> memos.api.UserStats.TagCountsEntry
|
||||
79, // 19: memos.api.UserStats.memo_created_timestamps:type_name -> google.protobuf.Timestamp
|
||||
79, // 20: memos.api.UserStats.memo_updated_timestamps:type_name -> google.protobuf.Timestamp
|
||||
78, // 21: memos.api.ListUserStatsRequest.state:type_name -> memos.api.State
|
||||
20, // 22: memos.api.ListUserStatsResponse.user_stats:type_name -> memos.api.UserStats
|
||||
73, // 23: memos.api.UserUsage.limits:type_name -> memos.api.UserUsage.Limits
|
||||
74, // 24: memos.api.MemoView.icon:type_name -> memos.api.MemoView.Icon
|
||||
26, // 25: memos.api.ListMemoViewsResponse.memo_views:type_name -> memos.api.MemoView
|
||||
26, // 26: memos.api.CreateMemoViewRequest.memo_view:type_name -> memos.api.MemoView
|
||||
26, // 27: memos.api.UpdateMemoViewRequest.memo_view:type_name -> memos.api.MemoView
|
||||
80, // 28: memos.api.UpdateMemoViewRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
6, // 29: memos.api.UserNotification.sender_user:type_name -> memos.api.User
|
||||
3, // 30: memos.api.UserNotification.type:type_name -> memos.api.UserNotification.Type
|
||||
75, // 31: memos.api.UserNotification.memo_comment:type_name -> memos.api.UserNotification.MemoCommentPayload
|
||||
76, // 32: memos.api.UserNotification.memo_mention:type_name -> memos.api.UserNotification.MemoMentionPayload
|
||||
77, // 33: memos.api.UserNotification.space_invitation:type_name -> memos.api.UserNotification.SpaceInvitationPayload
|
||||
2, // 34: memos.api.UserNotification.status:type_name -> memos.api.UserNotification.Status
|
||||
79, // 35: memos.api.UserNotification.create_time:type_name -> google.protobuf.Timestamp
|
||||
33, // 36: memos.api.ListUserNotificationsResponse.notifications:type_name -> memos.api.UserNotification
|
||||
33, // 37: memos.api.UpdateUserNotificationRequest.notification:type_name -> memos.api.UserNotification
|
||||
80, // 38: memos.api.UpdateUserNotificationRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
79, // 39: memos.api.UserWebhook.create_time:type_name -> google.protobuf.Timestamp
|
||||
79, // 40: memos.api.UserWebhook.update_time:type_name -> google.protobuf.Timestamp
|
||||
38, // 41: memos.api.ListUserWebhooksResponse.webhooks:type_name -> memos.api.UserWebhook
|
||||
38, // 42: memos.api.CreateUserWebhookRequest.webhook:type_name -> memos.api.UserWebhook
|
||||
38, // 43: memos.api.UpdateUserWebhookRequest.webhook:type_name -> memos.api.UserWebhook
|
||||
80, // 44: memos.api.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
46, // 45: memos.api.ListLinkedIdentitiesResponse.linked_identities:type_name -> memos.api.LinkedIdentity
|
||||
79, // 46: memos.api.PersonalAccessToken.create_time:type_name -> google.protobuf.Timestamp
|
||||
79, // 47: memos.api.PersonalAccessToken.expire_time:type_name -> google.protobuf.Timestamp
|
||||
79, // 48: memos.api.PersonalAccessToken.last_use_time:type_name -> google.protobuf.Timestamp
|
||||
52, // 49: memos.api.ListPersonalAccessTokensResponse.personal_access_tokens:type_name -> memos.api.PersonalAccessToken
|
||||
52, // 50: memos.api.CreatePersonalAccessTokenResponse.personal_access_token:type_name -> memos.api.PersonalAccessToken
|
||||
61, // 51: memos.api.ImportMemosRequest.spec:type_name -> memos.api.ImportMemosSpec
|
||||
5, // 52: memos.api.ImportMemosRequest.conflict_policy:type_name -> memos.api.ImportMemosRequest.ConflictPolicy
|
||||
62, // 53: memos.api.ImportMemosResponse.plan:type_name -> memos.api.ImportMemosPlan
|
||||
63, // 54: memos.api.ImportMemosResponse.report:type_name -> memos.api.ImportMemosReport
|
||||
79, // 55: memos.api.ImportMemosPlan.export_time:type_name -> google.protobuf.Timestamp
|
||||
64, // 56: memos.api.ImportMemosPlan.warnings:type_name -> memos.api.ImportMemosIssue
|
||||
64, // 57: memos.api.ImportMemosReport.warnings:type_name -> memos.api.ImportMemosIssue
|
||||
64, // 58: memos.api.ImportMemosReport.failures:type_name -> memos.api.ImportMemosIssue
|
||||
38, // 59: memos.api.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.UserWebhook
|
||||
70, // 60: memos.api.UserSetting.TagsSetting.tags:type_name -> memos.api.UserSetting.TagsSetting.TagsEntry
|
||||
81, // 61: memos.api.UserSetting.TagMetadata.background_color:type_name -> google.type.Color
|
||||
68, // 62: memos.api.UserSetting.TagsSetting.TagsEntry.value:type_name -> memos.api.UserSetting.TagMetadata
|
||||
82, // 63: memos.api.UserNotification.SpaceInvitationPayload.space:type_name -> memos.api.Space
|
||||
83, // 64: memos.api.UserNotification.SpaceInvitationPayload.role:type_name -> memos.api.SpaceMember.Role
|
||||
4, // 65: memos.api.UserNotification.SpaceInvitationPayload.state:type_name -> memos.api.UserNotification.SpaceInvitationPayload.InvitationState
|
||||
7, // 66: memos.api.UserService.ListUsers:input_type -> memos.api.ListUsersRequest
|
||||
9, // 67: memos.api.UserService.GetUser:input_type -> memos.api.GetUserRequest
|
||||
10, // 68: memos.api.UserService.BatchGetUsers:input_type -> memos.api.BatchGetUsersRequest
|
||||
12, // 69: memos.api.UserService.CreateUser:input_type -> memos.api.CreateUserRequest
|
||||
13, // 70: memos.api.UserService.UpdateUser:input_type -> memos.api.UpdateUserRequest
|
||||
14, // 71: memos.api.UserService.DeleteUser:input_type -> memos.api.DeleteUserRequest
|
||||
16, // 72: memos.api.UserService.ListUserSettings:input_type -> memos.api.ListUserSettingsRequest
|
||||
18, // 73: memos.api.UserService.GetUserSetting:input_type -> memos.api.GetUserSettingRequest
|
||||
19, // 74: memos.api.UserService.UpdateUserSetting:input_type -> memos.api.UpdateUserSettingRequest
|
||||
21, // 75: memos.api.UserService.ListUserStats:input_type -> memos.api.ListUserStatsRequest
|
||||
23, // 76: memos.api.UserService.GetUserStats:input_type -> memos.api.GetUserStatsRequest
|
||||
25, // 77: memos.api.UserService.GetUserUsage:input_type -> memos.api.GetUserUsageRequest
|
||||
27, // 78: memos.api.UserService.ListMemoViews:input_type -> memos.api.ListMemoViewsRequest
|
||||
29, // 79: memos.api.UserService.GetMemoView:input_type -> memos.api.GetMemoViewRequest
|
||||
30, // 80: memos.api.UserService.CreateMemoView:input_type -> memos.api.CreateMemoViewRequest
|
||||
31, // 81: memos.api.UserService.UpdateMemoView:input_type -> memos.api.UpdateMemoViewRequest
|
||||
32, // 82: memos.api.UserService.DeleteMemoView:input_type -> memos.api.DeleteMemoViewRequest
|
||||
34, // 83: memos.api.UserService.ListUserNotifications:input_type -> memos.api.ListUserNotificationsRequest
|
||||
36, // 84: memos.api.UserService.UpdateUserNotification:input_type -> memos.api.UpdateUserNotificationRequest
|
||||
37, // 85: memos.api.UserService.DeleteUserNotification:input_type -> memos.api.DeleteUserNotificationRequest
|
||||
39, // 86: memos.api.UserService.ListUserWebhooks:input_type -> memos.api.ListUserWebhooksRequest
|
||||
41, // 87: memos.api.UserService.CreateUserWebhook:input_type -> memos.api.CreateUserWebhookRequest
|
||||
42, // 88: memos.api.UserService.UpdateUserWebhook:input_type -> memos.api.UpdateUserWebhookRequest
|
||||
43, // 89: memos.api.UserService.DeleteUserWebhook:input_type -> memos.api.DeleteUserWebhookRequest
|
||||
44, // 90: memos.api.UserService.GetUserWebhookSigningSecret:input_type -> memos.api.GetUserWebhookSigningSecretRequest
|
||||
47, // 91: memos.api.UserService.ListLinkedIdentities:input_type -> memos.api.ListLinkedIdentitiesRequest
|
||||
49, // 92: memos.api.UserService.GetLinkedIdentity:input_type -> memos.api.GetLinkedIdentityRequest
|
||||
50, // 93: memos.api.UserService.CreateLinkedIdentity:input_type -> memos.api.CreateLinkedIdentityRequest
|
||||
51, // 94: memos.api.UserService.DeleteLinkedIdentity:input_type -> memos.api.DeleteLinkedIdentityRequest
|
||||
53, // 95: memos.api.UserService.ListPersonalAccessTokens:input_type -> memos.api.ListPersonalAccessTokensRequest
|
||||
55, // 96: memos.api.UserService.CreatePersonalAccessToken:input_type -> memos.api.CreatePersonalAccessTokenRequest
|
||||
57, // 97: memos.api.UserService.DeletePersonalAccessToken:input_type -> memos.api.DeletePersonalAccessTokenRequest
|
||||
58, // 98: memos.api.UserService.ExportMemos:input_type -> memos.api.ExportMemosRequest
|
||||
59, // 99: memos.api.UserService.ImportMemos:input_type -> memos.api.ImportMemosRequest
|
||||
8, // 100: memos.api.UserService.ListUsers:output_type -> memos.api.ListUsersResponse
|
||||
6, // 101: memos.api.UserService.GetUser:output_type -> memos.api.User
|
||||
11, // 102: memos.api.UserService.BatchGetUsers:output_type -> memos.api.BatchGetUsersResponse
|
||||
6, // 103: memos.api.UserService.CreateUser:output_type -> memos.api.User
|
||||
6, // 104: memos.api.UserService.UpdateUser:output_type -> memos.api.User
|
||||
84, // 105: memos.api.UserService.DeleteUser:output_type -> google.protobuf.Empty
|
||||
17, // 106: memos.api.UserService.ListUserSettings:output_type -> memos.api.ListUserSettingsResponse
|
||||
15, // 107: memos.api.UserService.GetUserSetting:output_type -> memos.api.UserSetting
|
||||
15, // 108: memos.api.UserService.UpdateUserSetting:output_type -> memos.api.UserSetting
|
||||
22, // 109: memos.api.UserService.ListUserStats:output_type -> memos.api.ListUserStatsResponse
|
||||
20, // 110: memos.api.UserService.GetUserStats:output_type -> memos.api.UserStats
|
||||
24, // 111: memos.api.UserService.GetUserUsage:output_type -> memos.api.UserUsage
|
||||
28, // 112: memos.api.UserService.ListMemoViews:output_type -> memos.api.ListMemoViewsResponse
|
||||
26, // 113: memos.api.UserService.GetMemoView:output_type -> memos.api.MemoView
|
||||
26, // 114: memos.api.UserService.CreateMemoView:output_type -> memos.api.MemoView
|
||||
26, // 115: memos.api.UserService.UpdateMemoView:output_type -> memos.api.MemoView
|
||||
84, // 116: memos.api.UserService.DeleteMemoView:output_type -> google.protobuf.Empty
|
||||
35, // 117: memos.api.UserService.ListUserNotifications:output_type -> memos.api.ListUserNotificationsResponse
|
||||
33, // 118: memos.api.UserService.UpdateUserNotification:output_type -> memos.api.UserNotification
|
||||
84, // 119: memos.api.UserService.DeleteUserNotification:output_type -> google.protobuf.Empty
|
||||
40, // 120: memos.api.UserService.ListUserWebhooks:output_type -> memos.api.ListUserWebhooksResponse
|
||||
38, // 121: memos.api.UserService.CreateUserWebhook:output_type -> memos.api.UserWebhook
|
||||
38, // 122: memos.api.UserService.UpdateUserWebhook:output_type -> memos.api.UserWebhook
|
||||
84, // 123: memos.api.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty
|
||||
45, // 124: memos.api.UserService.GetUserWebhookSigningSecret:output_type -> memos.api.GetUserWebhookSigningSecretResponse
|
||||
48, // 125: memos.api.UserService.ListLinkedIdentities:output_type -> memos.api.ListLinkedIdentitiesResponse
|
||||
46, // 126: memos.api.UserService.GetLinkedIdentity:output_type -> memos.api.LinkedIdentity
|
||||
46, // 127: memos.api.UserService.CreateLinkedIdentity:output_type -> memos.api.LinkedIdentity
|
||||
84, // 128: memos.api.UserService.DeleteLinkedIdentity:output_type -> google.protobuf.Empty
|
||||
54, // 129: memos.api.UserService.ListPersonalAccessTokens:output_type -> memos.api.ListPersonalAccessTokensResponse
|
||||
56, // 130: memos.api.UserService.CreatePersonalAccessToken:output_type -> memos.api.CreatePersonalAccessTokenResponse
|
||||
84, // 131: memos.api.UserService.DeletePersonalAccessToken:output_type -> google.protobuf.Empty
|
||||
85, // 132: memos.api.UserService.ExportMemos:output_type -> google.api.HttpBody
|
||||
60, // 133: memos.api.UserService.ImportMemos:output_type -> memos.api.ImportMemosResponse
|
||||
100, // [100:134] is the sub-list for method output_type
|
||||
66, // [66:100] is the sub-list for method input_type
|
||||
66, // [66:66] is the sub-list for extension type_name
|
||||
66, // [66:66] is the sub-list for extension extendee
|
||||
0, // [0:66] is the sub-list for field type_name
|
||||
0, // 0: memos.api.User.role:type_name -> memos.api.User.Role
|
||||
77, // 1: memos.api.User.state:type_name -> memos.api.State
|
||||
78, // 2: memos.api.User.create_time:type_name -> google.protobuf.Timestamp
|
||||
78, // 3: memos.api.User.update_time:type_name -> google.protobuf.Timestamp
|
||||
6, // 4: memos.api.ListUsersResponse.users:type_name -> memos.api.User
|
||||
79, // 5: memos.api.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask
|
||||
6, // 6: memos.api.BatchGetUsersResponse.users:type_name -> memos.api.User
|
||||
6, // 7: memos.api.CreateUserRequest.user:type_name -> memos.api.User
|
||||
6, // 8: memos.api.UpdateUserRequest.user:type_name -> memos.api.User
|
||||
79, // 9: memos.api.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
64, // 10: memos.api.UserSetting.general_setting:type_name -> memos.api.UserSetting.GeneralSetting
|
||||
65, // 11: memos.api.UserSetting.webhooks_setting:type_name -> memos.api.UserSetting.WebhooksSetting
|
||||
66, // 12: memos.api.UserSetting.tags_setting:type_name -> memos.api.UserSetting.TagsSetting
|
||||
68, // 13: memos.api.UserSetting.editor_setting:type_name -> memos.api.UserSetting.EditorSetting
|
||||
15, // 14: memos.api.ListUserSettingsResponse.user_settings:type_name -> memos.api.UserSetting
|
||||
15, // 15: memos.api.UpdateUserSettingRequest.user_setting:type_name -> memos.api.UserSetting
|
||||
79, // 16: memos.api.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
71, // 17: memos.api.UserStats.memo_type_stats:type_name -> memos.api.UserStats.MemoTypeStats
|
||||
70, // 18: memos.api.UserStats.tag_counts:type_name -> memos.api.UserStats.TagCountsEntry
|
||||
78, // 19: memos.api.UserStats.memo_created_timestamps:type_name -> google.protobuf.Timestamp
|
||||
78, // 20: memos.api.UserStats.memo_updated_timestamps:type_name -> google.protobuf.Timestamp
|
||||
77, // 21: memos.api.ListUserStatsRequest.state:type_name -> memos.api.State
|
||||
20, // 22: memos.api.ListUserStatsResponse.user_stats:type_name -> memos.api.UserStats
|
||||
72, // 23: memos.api.UserUsage.limits:type_name -> memos.api.UserUsage.Limits
|
||||
73, // 24: memos.api.MemoView.icon:type_name -> memos.api.MemoView.Icon
|
||||
26, // 25: memos.api.ListMemoViewsResponse.memo_views:type_name -> memos.api.MemoView
|
||||
26, // 26: memos.api.CreateMemoViewRequest.memo_view:type_name -> memos.api.MemoView
|
||||
26, // 27: memos.api.UpdateMemoViewRequest.memo_view:type_name -> memos.api.MemoView
|
||||
79, // 28: memos.api.UpdateMemoViewRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
6, // 29: memos.api.UserNotification.sender_user:type_name -> memos.api.User
|
||||
3, // 30: memos.api.UserNotification.type:type_name -> memos.api.UserNotification.Type
|
||||
74, // 31: memos.api.UserNotification.memo_comment:type_name -> memos.api.UserNotification.MemoCommentPayload
|
||||
75, // 32: memos.api.UserNotification.memo_mention:type_name -> memos.api.UserNotification.MemoMentionPayload
|
||||
76, // 33: memos.api.UserNotification.space_invitation:type_name -> memos.api.UserNotification.SpaceInvitationPayload
|
||||
2, // 34: memos.api.UserNotification.status:type_name -> memos.api.UserNotification.Status
|
||||
78, // 35: memos.api.UserNotification.create_time:type_name -> google.protobuf.Timestamp
|
||||
33, // 36: memos.api.ListUserNotificationsResponse.notifications:type_name -> memos.api.UserNotification
|
||||
33, // 37: memos.api.UpdateUserNotificationRequest.notification:type_name -> memos.api.UserNotification
|
||||
79, // 38: memos.api.UpdateUserNotificationRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
78, // 39: memos.api.UserWebhook.create_time:type_name -> google.protobuf.Timestamp
|
||||
78, // 40: memos.api.UserWebhook.update_time:type_name -> google.protobuf.Timestamp
|
||||
38, // 41: memos.api.ListUserWebhooksResponse.webhooks:type_name -> memos.api.UserWebhook
|
||||
38, // 42: memos.api.CreateUserWebhookRequest.webhook:type_name -> memos.api.UserWebhook
|
||||
38, // 43: memos.api.UpdateUserWebhookRequest.webhook:type_name -> memos.api.UserWebhook
|
||||
79, // 44: memos.api.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
46, // 45: memos.api.ListLinkedIdentitiesResponse.linked_identities:type_name -> memos.api.LinkedIdentity
|
||||
78, // 46: memos.api.PersonalAccessToken.create_time:type_name -> google.protobuf.Timestamp
|
||||
78, // 47: memos.api.PersonalAccessToken.expire_time:type_name -> google.protobuf.Timestamp
|
||||
78, // 48: memos.api.PersonalAccessToken.last_use_time:type_name -> google.protobuf.Timestamp
|
||||
52, // 49: memos.api.ListPersonalAccessTokensResponse.personal_access_tokens:type_name -> memos.api.PersonalAccessToken
|
||||
52, // 50: memos.api.CreatePersonalAccessTokenResponse.personal_access_token:type_name -> memos.api.PersonalAccessToken
|
||||
60, // 51: memos.api.ImportMemosRequest.spec:type_name -> memos.api.ImportMemosSpec
|
||||
5, // 52: memos.api.ImportMemosRequest.conflict_policy:type_name -> memos.api.ImportMemosRequest.ConflictPolicy
|
||||
61, // 53: memos.api.ImportMemosResponse.plan:type_name -> memos.api.ImportMemosPlan
|
||||
62, // 54: memos.api.ImportMemosResponse.report:type_name -> memos.api.ImportMemosReport
|
||||
78, // 55: memos.api.ImportMemosPlan.export_time:type_name -> google.protobuf.Timestamp
|
||||
63, // 56: memos.api.ImportMemosPlan.warnings:type_name -> memos.api.ImportMemosIssue
|
||||
63, // 57: memos.api.ImportMemosReport.warnings:type_name -> memos.api.ImportMemosIssue
|
||||
63, // 58: memos.api.ImportMemosReport.failures:type_name -> memos.api.ImportMemosIssue
|
||||
38, // 59: memos.api.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.UserWebhook
|
||||
69, // 60: memos.api.UserSetting.TagsSetting.tags:type_name -> memos.api.UserSetting.TagsSetting.TagsEntry
|
||||
80, // 61: memos.api.UserSetting.TagMetadata.background_color:type_name -> google.type.Color
|
||||
67, // 62: memos.api.UserSetting.TagsSetting.TagsEntry.value:type_name -> memos.api.UserSetting.TagMetadata
|
||||
81, // 63: memos.api.UserNotification.SpaceInvitationPayload.space:type_name -> memos.api.Space
|
||||
82, // 64: memos.api.UserNotification.SpaceInvitationPayload.role:type_name -> memos.api.SpaceMember.Role
|
||||
4, // 65: memos.api.UserNotification.SpaceInvitationPayload.state:type_name -> memos.api.UserNotification.SpaceInvitationPayload.InvitationState
|
||||
7, // 66: memos.api.UserService.ListUsers:input_type -> memos.api.ListUsersRequest
|
||||
9, // 67: memos.api.UserService.GetUser:input_type -> memos.api.GetUserRequest
|
||||
10, // 68: memos.api.UserService.BatchGetUsers:input_type -> memos.api.BatchGetUsersRequest
|
||||
12, // 69: memos.api.UserService.CreateUser:input_type -> memos.api.CreateUserRequest
|
||||
13, // 70: memos.api.UserService.UpdateUser:input_type -> memos.api.UpdateUserRequest
|
||||
14, // 71: memos.api.UserService.DeleteUser:input_type -> memos.api.DeleteUserRequest
|
||||
16, // 72: memos.api.UserService.ListUserSettings:input_type -> memos.api.ListUserSettingsRequest
|
||||
18, // 73: memos.api.UserService.GetUserSetting:input_type -> memos.api.GetUserSettingRequest
|
||||
19, // 74: memos.api.UserService.UpdateUserSetting:input_type -> memos.api.UpdateUserSettingRequest
|
||||
21, // 75: memos.api.UserService.ListUserStats:input_type -> memos.api.ListUserStatsRequest
|
||||
23, // 76: memos.api.UserService.GetUserStats:input_type -> memos.api.GetUserStatsRequest
|
||||
25, // 77: memos.api.UserService.GetUserUsage:input_type -> memos.api.GetUserUsageRequest
|
||||
27, // 78: memos.api.UserService.ListMemoViews:input_type -> memos.api.ListMemoViewsRequest
|
||||
29, // 79: memos.api.UserService.GetMemoView:input_type -> memos.api.GetMemoViewRequest
|
||||
30, // 80: memos.api.UserService.CreateMemoView:input_type -> memos.api.CreateMemoViewRequest
|
||||
31, // 81: memos.api.UserService.UpdateMemoView:input_type -> memos.api.UpdateMemoViewRequest
|
||||
32, // 82: memos.api.UserService.DeleteMemoView:input_type -> memos.api.DeleteMemoViewRequest
|
||||
34, // 83: memos.api.UserService.ListUserNotifications:input_type -> memos.api.ListUserNotificationsRequest
|
||||
36, // 84: memos.api.UserService.UpdateUserNotification:input_type -> memos.api.UpdateUserNotificationRequest
|
||||
37, // 85: memos.api.UserService.DeleteUserNotification:input_type -> memos.api.DeleteUserNotificationRequest
|
||||
39, // 86: memos.api.UserService.ListUserWebhooks:input_type -> memos.api.ListUserWebhooksRequest
|
||||
41, // 87: memos.api.UserService.CreateUserWebhook:input_type -> memos.api.CreateUserWebhookRequest
|
||||
42, // 88: memos.api.UserService.UpdateUserWebhook:input_type -> memos.api.UpdateUserWebhookRequest
|
||||
43, // 89: memos.api.UserService.DeleteUserWebhook:input_type -> memos.api.DeleteUserWebhookRequest
|
||||
44, // 90: memos.api.UserService.GetUserWebhookSigningSecret:input_type -> memos.api.GetUserWebhookSigningSecretRequest
|
||||
47, // 91: memos.api.UserService.ListLinkedIdentities:input_type -> memos.api.ListLinkedIdentitiesRequest
|
||||
49, // 92: memos.api.UserService.GetLinkedIdentity:input_type -> memos.api.GetLinkedIdentityRequest
|
||||
50, // 93: memos.api.UserService.CreateLinkedIdentity:input_type -> memos.api.CreateLinkedIdentityRequest
|
||||
51, // 94: memos.api.UserService.DeleteLinkedIdentity:input_type -> memos.api.DeleteLinkedIdentityRequest
|
||||
53, // 95: memos.api.UserService.ListPersonalAccessTokens:input_type -> memos.api.ListPersonalAccessTokensRequest
|
||||
55, // 96: memos.api.UserService.CreatePersonalAccessToken:input_type -> memos.api.CreatePersonalAccessTokenRequest
|
||||
57, // 97: memos.api.UserService.DeletePersonalAccessToken:input_type -> memos.api.DeletePersonalAccessTokenRequest
|
||||
58, // 98: memos.api.UserService.ImportMemos:input_type -> memos.api.ImportMemosRequest
|
||||
8, // 99: memos.api.UserService.ListUsers:output_type -> memos.api.ListUsersResponse
|
||||
6, // 100: memos.api.UserService.GetUser:output_type -> memos.api.User
|
||||
11, // 101: memos.api.UserService.BatchGetUsers:output_type -> memos.api.BatchGetUsersResponse
|
||||
6, // 102: memos.api.UserService.CreateUser:output_type -> memos.api.User
|
||||
6, // 103: memos.api.UserService.UpdateUser:output_type -> memos.api.User
|
||||
83, // 104: memos.api.UserService.DeleteUser:output_type -> google.protobuf.Empty
|
||||
17, // 105: memos.api.UserService.ListUserSettings:output_type -> memos.api.ListUserSettingsResponse
|
||||
15, // 106: memos.api.UserService.GetUserSetting:output_type -> memos.api.UserSetting
|
||||
15, // 107: memos.api.UserService.UpdateUserSetting:output_type -> memos.api.UserSetting
|
||||
22, // 108: memos.api.UserService.ListUserStats:output_type -> memos.api.ListUserStatsResponse
|
||||
20, // 109: memos.api.UserService.GetUserStats:output_type -> memos.api.UserStats
|
||||
24, // 110: memos.api.UserService.GetUserUsage:output_type -> memos.api.UserUsage
|
||||
28, // 111: memos.api.UserService.ListMemoViews:output_type -> memos.api.ListMemoViewsResponse
|
||||
26, // 112: memos.api.UserService.GetMemoView:output_type -> memos.api.MemoView
|
||||
26, // 113: memos.api.UserService.CreateMemoView:output_type -> memos.api.MemoView
|
||||
26, // 114: memos.api.UserService.UpdateMemoView:output_type -> memos.api.MemoView
|
||||
83, // 115: memos.api.UserService.DeleteMemoView:output_type -> google.protobuf.Empty
|
||||
35, // 116: memos.api.UserService.ListUserNotifications:output_type -> memos.api.ListUserNotificationsResponse
|
||||
33, // 117: memos.api.UserService.UpdateUserNotification:output_type -> memos.api.UserNotification
|
||||
83, // 118: memos.api.UserService.DeleteUserNotification:output_type -> google.protobuf.Empty
|
||||
40, // 119: memos.api.UserService.ListUserWebhooks:output_type -> memos.api.ListUserWebhooksResponse
|
||||
38, // 120: memos.api.UserService.CreateUserWebhook:output_type -> memos.api.UserWebhook
|
||||
38, // 121: memos.api.UserService.UpdateUserWebhook:output_type -> memos.api.UserWebhook
|
||||
83, // 122: memos.api.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty
|
||||
45, // 123: memos.api.UserService.GetUserWebhookSigningSecret:output_type -> memos.api.GetUserWebhookSigningSecretResponse
|
||||
48, // 124: memos.api.UserService.ListLinkedIdentities:output_type -> memos.api.ListLinkedIdentitiesResponse
|
||||
46, // 125: memos.api.UserService.GetLinkedIdentity:output_type -> memos.api.LinkedIdentity
|
||||
46, // 126: memos.api.UserService.CreateLinkedIdentity:output_type -> memos.api.LinkedIdentity
|
||||
83, // 127: memos.api.UserService.DeleteLinkedIdentity:output_type -> google.protobuf.Empty
|
||||
54, // 128: memos.api.UserService.ListPersonalAccessTokens:output_type -> memos.api.ListPersonalAccessTokensResponse
|
||||
56, // 129: memos.api.UserService.CreatePersonalAccessToken:output_type -> memos.api.CreatePersonalAccessTokenResponse
|
||||
83, // 130: memos.api.UserService.DeletePersonalAccessToken:output_type -> google.protobuf.Empty
|
||||
59, // 131: memos.api.UserService.ImportMemos:output_type -> memos.api.ImportMemosResponse
|
||||
99, // [99:132] is the sub-list for method output_type
|
||||
66, // [66:99] is the sub-list for method input_type
|
||||
66, // [66:66] is the sub-list for extension type_name
|
||||
66, // [66:66] is the sub-list for extension extendee
|
||||
0, // [0:66] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_user_service_proto_init() }
|
||||
@@ -5754,16 +5698,16 @@ func file_api_user_service_proto_init() {
|
||||
(*UserNotification_MemoMention)(nil),
|
||||
(*UserNotification_SpaceInvitation)(nil),
|
||||
}
|
||||
file_api_user_service_proto_msgTypes[53].OneofWrappers = []any{
|
||||
file_api_user_service_proto_msgTypes[52].OneofWrappers = []any{
|
||||
(*ImportMemosRequest_Spec)(nil),
|
||||
(*ImportMemosRequest_UploadId)(nil),
|
||||
}
|
||||
file_api_user_service_proto_msgTypes[54].OneofWrappers = []any{
|
||||
file_api_user_service_proto_msgTypes[53].OneofWrappers = []any{
|
||||
(*ImportMemosResponse_Plan)(nil),
|
||||
(*ImportMemosResponse_Report)(nil),
|
||||
}
|
||||
file_api_user_service_proto_msgTypes[67].OneofWrappers = []any{}
|
||||
file_api_user_service_proto_msgTypes[68].OneofWrappers = []any{
|
||||
file_api_user_service_proto_msgTypes[66].OneofWrappers = []any{}
|
||||
file_api_user_service_proto_msgTypes[67].OneofWrappers = []any{
|
||||
(*MemoView_Icon_Emoji)(nil),
|
||||
(*MemoView_Icon_Lucide)(nil),
|
||||
}
|
||||
@@ -5773,7 +5717,7 @@ func file_api_user_service_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_user_service_proto_rawDesc), len(file_api_user_service_proto_rawDesc)),
|
||||
NumEnums: 6,
|
||||
NumMessages: 72,
|
||||
NumMessages: 71,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -1615,45 +1615,6 @@ func local_request_UserService_DeletePersonalAccessToken_0(ctx context.Context,
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_UserService_ExportMemos_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq ExportMemosRequest
|
||||
metadata runtime.ServerMetadata
|
||||
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 {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.ExportMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_UserService_ExportMemos_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq ExportMemosRequest
|
||||
metadata runtime.ServerMetadata
|
||||
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)
|
||||
}
|
||||
msg, err := server.ExportMemos(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func request_UserService_ImportMemos_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq ImportMemosRequest
|
||||
@@ -2345,26 +2306,6 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
||||
}
|
||||
forward_UserService_DeletePersonalAccessToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_UserService_ExportMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.UserService/ExportMemos", runtime.WithHTTPPathPattern("/api/{name=users/*}:exportMemos"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_UserService_ExportMemos_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_UserService_ExportMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_UserService_ImportMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -2969,23 +2910,6 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
||||
}
|
||||
forward_UserService_DeletePersonalAccessToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodGet, pattern_UserService_ExportMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.UserService/ExportMemos", runtime.WithHTTPPathPattern("/api/{name=users/*}:exportMemos"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_UserService_ExportMemos_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_UserService_ExportMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
mux.Handle(http.MethodPost, pattern_UserService_ImportMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -3039,7 +2963,6 @@ var (
|
||||
pattern_UserService_ListPersonalAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"api", "users", "parent", "personalAccessTokens"}, ""))
|
||||
pattern_UserService_CreatePersonalAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"api", "users", "parent", "personalAccessTokens"}, ""))
|
||||
pattern_UserService_DeletePersonalAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"api", "users", "personalAccessTokens", "name"}, ""))
|
||||
pattern_UserService_ExportMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"api", "users", "name"}, "exportMemos"))
|
||||
pattern_UserService_ImportMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"api", "users", "name"}, "importMemos"))
|
||||
)
|
||||
|
||||
@@ -3076,6 +2999,5 @@ var (
|
||||
forward_UserService_ListPersonalAccessTokens_0 = runtime.ForwardResponseMessage
|
||||
forward_UserService_CreatePersonalAccessToken_0 = runtime.ForwardResponseMessage
|
||||
forward_UserService_DeletePersonalAccessToken_0 = runtime.ForwardResponseMessage
|
||||
forward_UserService_ExportMemos_0 = runtime.ForwardResponseMessage
|
||||
forward_UserService_ImportMemos_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
@@ -8,7 +8,6 @@ package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
httpbody "google.golang.org/genproto/googleapis/api/httpbody"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
@@ -53,7 +52,6 @@ const (
|
||||
UserService_ListPersonalAccessTokens_FullMethodName = "/memos.api.UserService/ListPersonalAccessTokens"
|
||||
UserService_CreatePersonalAccessToken_FullMethodName = "/memos.api.UserService/CreatePersonalAccessToken"
|
||||
UserService_DeletePersonalAccessToken_FullMethodName = "/memos.api.UserService/DeletePersonalAccessToken"
|
||||
UserService_ExportMemos_FullMethodName = "/memos.api.UserService/ExportMemos"
|
||||
UserService_ImportMemos_FullMethodName = "/memos.api.UserService/ImportMemos"
|
||||
)
|
||||
|
||||
@@ -160,11 +158,6 @@ type UserServiceClient interface {
|
||||
// DeletePersonalAccessToken deletes a personal access token, which stops
|
||||
// working immediately. Only the owner may call it.
|
||||
DeletePersonalAccessToken(ctx context.Context, in *DeletePersonalAccessTokenRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// ExportMemos writes every memo the user created, with comments, archived
|
||||
// memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
// docs/design/memos-export-format.md). Only the user may export their own
|
||||
// memos. The body is the archive; content_type is its media type.
|
||||
ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
|
||||
// ImportMemos uploads a Memos export file in bounded chunks and imports it
|
||||
// into the user's memos. The first call carries the spec and returns an
|
||||
// upload_id; later calls carry that upload_id. A finishing call with
|
||||
@@ -503,16 +496,6 @@ func (c *userServiceClient) DeletePersonalAccessToken(ctx context.Context, in *D
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(httpbody.HttpBody)
|
||||
err := c.cc.Invoke(ctx, UserService_ExportMemos_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) ImportMemos(ctx context.Context, in *ImportMemosRequest, opts ...grpc.CallOption) (*ImportMemosResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ImportMemosResponse)
|
||||
@@ -626,11 +609,6 @@ type UserServiceServer interface {
|
||||
// DeletePersonalAccessToken deletes a personal access token, which stops
|
||||
// working immediately. Only the owner may call it.
|
||||
DeletePersonalAccessToken(context.Context, *DeletePersonalAccessTokenRequest) (*emptypb.Empty, error)
|
||||
// ExportMemos writes every memo the user created, with comments, archived
|
||||
// memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
// docs/design/memos-export-format.md). Only the user may export their own
|
||||
// memos. The body is the archive; content_type is its media type.
|
||||
ExportMemos(context.Context, *ExportMemosRequest) (*httpbody.HttpBody, error)
|
||||
// ImportMemos uploads a Memos export file in bounded chunks and imports it
|
||||
// into the user's memos. The first call carries the spec and returns an
|
||||
// upload_id; later calls carry that upload_id. A finishing call with
|
||||
@@ -745,9 +723,6 @@ func (UnimplementedUserServiceServer) CreatePersonalAccessToken(context.Context,
|
||||
func (UnimplementedUserServiceServer) DeletePersonalAccessToken(context.Context, *DeletePersonalAccessTokenRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeletePersonalAccessToken not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) ExportMemos(context.Context, *ExportMemosRequest) (*httpbody.HttpBody, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ExportMemos not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) ImportMemos(context.Context, *ImportMemosRequest) (*ImportMemosResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ImportMemos not implemented")
|
||||
}
|
||||
@@ -1348,24 +1323,6 @@ func _UserService_DeletePersonalAccessToken_Handler(srv interface{}, ctx context
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_ExportMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExportMemosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).ExportMemos(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_ExportMemos_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).ExportMemos(ctx, req.(*ExportMemosRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_ImportMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ImportMemosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -1519,10 +1476,6 @@ var UserService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "DeletePersonalAccessToken",
|
||||
Handler: _UserService_DeletePersonalAccessToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExportMemos",
|
||||
Handler: _UserService_ExportMemos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ImportMemos",
|
||||
Handler: _UserService_ImportMemos_Handler,
|
||||
|
||||
@@ -3095,34 +3095,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/users/{user}:exportMemos:
|
||||
get:
|
||||
tags:
|
||||
- UserService
|
||||
description: |-
|
||||
ExportMemos writes every memo the user created, with comments, archived
|
||||
memos, and attachment files, as a Memos export file (a ZIP file, see
|
||||
docs/design/memos-export-format.md). Only the user may export their own
|
||||
memos. The body is the archive; content_type is its media type.
|
||||
operationId: UserService_ExportMemos
|
||||
parameters:
|
||||
- name: user
|
||||
in: path
|
||||
description: The user id.
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
'*/*': {}
|
||||
default:
|
||||
description: Default error response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Status'
|
||||
/api/users/{user}:getStats:
|
||||
get:
|
||||
tags:
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
|
||||
"connectrpc.com/connect"
|
||||
"google.golang.org/genproto/googleapis/api/httpbody"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
|
||||
apipb "github.com/usememos/memos/proto/gen/api"
|
||||
@@ -174,14 +173,6 @@ func (s *ConnectServiceHandler) GetUserUsage(ctx context.Context, req *connect.R
|
||||
return connect.NewResponse(resp), nil
|
||||
}
|
||||
|
||||
func (s *ConnectServiceHandler) ExportMemos(ctx context.Context, req *connect.Request[apipb.ExportMemosRequest]) (*connect.Response[httpbody.HttpBody], error) {
|
||||
resp, err := s.APIService.ExportMemos(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, convertGRPCError(err)
|
||||
}
|
||||
return connect.NewResponse(resp), nil
|
||||
}
|
||||
|
||||
func (s *ConnectServiceHandler) ImportMemos(ctx context.Context, req *connect.Request[apipb.ImportMemosRequest]) (*connect.Response[apipb.ImportMemosResponse], error) {
|
||||
resp, err := s.APIService.ImportMemos(ctx, req.Msg)
|
||||
if err != nil {
|
||||
|
||||
@@ -139,7 +139,7 @@ func exportArchive(t *testing.T, ts *TestService, user *store.User) *memoexport.
|
||||
func exportArchiveBytes(t *testing.T, ts *TestService, user *store.User) []byte {
|
||||
t.Helper()
|
||||
var buffer bytes.Buffer
|
||||
require.NoError(t, ts.Service.WriteMemoExport(context.Background(), user, &buffer))
|
||||
require.NoError(t, ts.Service.WriteMemoExport(context.Background(), user, &buffer, time.Now()))
|
||||
return buffer.Bytes()
|
||||
}
|
||||
|
||||
@@ -412,27 +412,6 @@ func userName(user *store.User) string {
|
||||
return api.BuildUserName(user.Username)
|
||||
}
|
||||
|
||||
func TestExportMemos(t *testing.T) {
|
||||
ts := NewTestService(t)
|
||||
defer ts.Cleanup()
|
||||
fixture := buildArchiveFixture(t, ts, "owner")
|
||||
ctx := context.Background()
|
||||
|
||||
body, err := ts.Service.ExportMemos(fixture.userCtx, &apipb.ExportMemosRequest{Name: userName(fixture.user)})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "application/vnd.usememos.export+zip", body.ContentType)
|
||||
exported := readArchive(t, body.Data)
|
||||
require.Equal(t, "memos-export", exported.Manifest.Format)
|
||||
require.Len(t, exported.Memos, 5)
|
||||
|
||||
other, err := ts.CreateRegularUser(ctx, "other")
|
||||
require.NoError(t, err)
|
||||
_, err = ts.Service.ExportMemos(ts.CreateUserContext(ctx, other.ID), &apipb.ExportMemosRequest{Name: userName(fixture.user)})
|
||||
require.Equal(t, codes.PermissionDenied, status.Code(err))
|
||||
_, err = ts.Service.ExportMemos(ctx, &apipb.ExportMemosRequest{Name: userName(fixture.user)})
|
||||
require.Equal(t, codes.Unauthenticated, status.Code(err))
|
||||
}
|
||||
|
||||
func TestImportMemosExportFormats(t *testing.T) {
|
||||
for _, filename := range []string{"golden.zip", "legacy.zip"} {
|
||||
t.Run(filename, func(t *testing.T) {
|
||||
|
||||
@@ -33,8 +33,12 @@ type memoExportData struct {
|
||||
|
||||
// WriteMemoExport writes a Memos export file holding every memo the user
|
||||
// created, including comments and archived memos, and the attachments linked
|
||||
// to them. Nothing another user created is included.
|
||||
func (s *APIService) WriteMemoExport(ctx context.Context, user *store.User, w io.Writer) error {
|
||||
// to them. Nothing another user created is included. exportTime is recorded
|
||||
// in the manifest; callers name the download after the same instant. Every
|
||||
// memo row the archive needs is loaded before the first byte is written, so a
|
||||
// failure loading them surfaces before the response is committed. Attachment
|
||||
// content is read while writing; a failure there truncates the archive.
|
||||
func (s *APIService) WriteMemoExport(ctx context.Context, user *store.User, w io.Writer, exportTime time.Time) error {
|
||||
if user == nil {
|
||||
return errors.New("user is required")
|
||||
}
|
||||
@@ -43,7 +47,7 @@ func (s *APIService) WriteMemoExport(ctx context.Context, user *store.User, w io
|
||||
return err
|
||||
}
|
||||
|
||||
exportTime := time.Now().UTC().Truncate(time.Second)
|
||||
exportTime = exportTime.UTC().Truncate(time.Second)
|
||||
writer := memoexport.NewWriter(w, exportTime)
|
||||
if err := writer.WriteManifest(&memoexport.Manifest{
|
||||
Generator: memoexport.Generator{Name: "memos", Version: s.Profile.Version},
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"log/slog"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"google.golang.org/genproto/googleapis/api/httpbody"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
@@ -47,23 +45,6 @@ func (s *APIService) resolveMemoTransferOwner(ctx context.Context, name string)
|
||||
return user, nil
|
||||
}
|
||||
|
||||
// ExportMemos writes the caller's Memos export file into the response body.
|
||||
func (s *APIService) ExportMemos(ctx context.Context, request *apipb.ExportMemosRequest) (*httpbody.HttpBody, error) {
|
||||
user, err := s.resolveMemoTransferOwner(ctx, request.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.throttleAndCharge(ratelimit.ScopeArchiveUser, userKey(user.ID), 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var archive bytes.Buffer
|
||||
if err := s.WriteMemoExport(ctx, user, &archive); err != nil {
|
||||
slog.Error("memo export failed", slog.Int("user", int(user.ID)), slog.Any("error", err))
|
||||
return nil, status.Error(codes.Internal, "failed to export memos")
|
||||
}
|
||||
return &httpbody.HttpBody{ContentType: memoexport.MediaType, Data: archive.Bytes()}, nil
|
||||
}
|
||||
|
||||
// ImportMemos stages an archive in chunks and, on the finishing call, plans
|
||||
// or imports it. See the proto comment for the protocol.
|
||||
func (s *APIService) ImportMemos(ctx context.Context, request *apipb.ImportMemosRequest) (*apipb.ImportMemosResponse, error) {
|
||||
|
||||
@@ -10,6 +10,7 @@ GET /file/attachments/:uid[/:filename] # attachment binary
|
||||
?motion=true # embedded motion-photo video clip
|
||||
?share_token={uid} # access via a memo share link
|
||||
GET /file/users/:identifier/avatar # user avatar (by username)
|
||||
GET /file/users/:identifier/export # Memos export file of that user (administrators only; HEAD = preflight)
|
||||
```
|
||||
|
||||
## Authentication
|
||||
@@ -28,6 +29,11 @@ Attachment access follows memo visibility, evaluated by `core/access.CheckMemoRe
|
||||
|
||||
Avatars are public on instances that allow anonymous access; private instances require authentication.
|
||||
|
||||
The export route requires an instance administrator and may name any user. It streams the ZIP as `core/memoexport`
|
||||
writes it, admits one export at a time (a second request gets `429`), and charges the caller's `archive_user` budget.
|
||||
`HEAD` runs the same checks and answers with the headers alone. The archive itself is assembled by `server/api`, which
|
||||
the server injects as `MemoExporter`; without it the route answers `404`.
|
||||
|
||||
## Serving behavior
|
||||
|
||||
- **Video/audio** are streamed with range-request support (`http.ServeFile` / `http.ServeContent` for local and database storage); S3-backed media is proxied with ranged `GetObject` requests.
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/usememos/memos/internal/imagelimit"
|
||||
"github.com/usememos/memos/internal/motionphoto"
|
||||
"github.com/usememos/memos/internal/profile"
|
||||
"github.com/usememos/memos/internal/ratelimit"
|
||||
storepb "github.com/usememos/memos/proto/gen/store"
|
||||
"github.com/usememos/memos/provider/storage"
|
||||
"github.com/usememos/memos/server/auth"
|
||||
@@ -110,17 +111,25 @@ type FileServerService struct {
|
||||
Store *store.Store
|
||||
authenticator *auth.Authenticator
|
||||
|
||||
// MemoExporter writes memo export archives; nil disables the export route.
|
||||
MemoExporter MemoExporter
|
||||
// RateLimiter bounds export requests; nil disables the limit.
|
||||
RateLimiter ratelimit.Limiter
|
||||
|
||||
// thumbnailSemaphore limits concurrent thumbnail generation.
|
||||
thumbnailSemaphore *semaphore.Weighted
|
||||
// memoExportSemaphore admits one export at a time.
|
||||
memoExportSemaphore *semaphore.Weighted
|
||||
}
|
||||
|
||||
// NewFileServerService creates a new file server service.
|
||||
func NewFileServerService(profile *profile.Profile, store *store.Store, secret string) *FileServerService {
|
||||
return &FileServerService{
|
||||
Profile: profile,
|
||||
Store: store,
|
||||
authenticator: auth.NewAuthenticator(store, secret),
|
||||
thumbnailSemaphore: semaphore.NewWeighted(maxConcurrentThumbnails),
|
||||
Profile: profile,
|
||||
Store: store,
|
||||
authenticator: auth.NewAuthenticator(store, secret),
|
||||
thumbnailSemaphore: semaphore.NewWeighted(maxConcurrentThumbnails),
|
||||
memoExportSemaphore: semaphore.NewWeighted(1),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +138,9 @@ func (s *FileServerService) RegisterRoutes(mux *http.ServeMux, fallback http.Han
|
||||
mux.Handle("/file/attachments/{uid}", httphandler.GET(httphandler.Func(s.serveAttachmentFile), fallback))
|
||||
mux.Handle("/file/attachments/{uid}/{filename}", httphandler.GET(httphandler.Func(s.serveAttachmentFile), fallback))
|
||||
mux.Handle("/file/users/{identifier}/avatar", httphandler.GET(httphandler.Func(s.serveUserAvatar), fallback))
|
||||
// A method pattern so that HEAD is served too: the web client sends a HEAD
|
||||
// preflight before it hands the download to the browser.
|
||||
mux.Handle("GET "+memoExportRoute, httphandler.Func(s.serveMemoExport))
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package fileserver
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"log/slog"
|
||||
"math"
|
||||
"mime"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/usememos/memos/core/access"
|
||||
"github.com/usememos/memos/core/memoexport"
|
||||
"github.com/usememos/memos/internal/httphandler"
|
||||
"github.com/usememos/memos/internal/ratelimit"
|
||||
"github.com/usememos/memos/store"
|
||||
)
|
||||
|
||||
// memoExportRoute downloads one user's Memos export file. The identifier is
|
||||
// the username, as for avatars.
|
||||
const memoExportRoute = "/file/users/{identifier}/export"
|
||||
|
||||
// MemoExporter writes one user's Memos export file. The API service
|
||||
// implements it; the file server owns the HTTP side of an export so the
|
||||
// archive streams to the client instead of being held in memory.
|
||||
type MemoExporter interface {
|
||||
WriteMemoExport(ctx context.Context, user *store.User, w io.Writer, exportTime time.Time) error
|
||||
}
|
||||
|
||||
// serveMemoExport streams a user's Memos export file to an instance
|
||||
// administrator. Only one export runs at a time; a second request is refused
|
||||
// with 429. HEAD runs every check and answers with the headers alone, so a
|
||||
// client can learn about a refusal before the browser starts a download.
|
||||
func (s *FileServerService) serveMemoExport(w http.ResponseWriter, r *http.Request) error {
|
||||
ctx := r.Context()
|
||||
if s.MemoExporter == nil {
|
||||
return &httphandler.Error{Code: http.StatusNotFound, Message: http.StatusText(http.StatusNotFound)}
|
||||
}
|
||||
setSecurityHeaders(w)
|
||||
w.Header().Set("Cache-Control", privateAttachmentCacheControl)
|
||||
|
||||
caller, err := s.getCurrentUser(ctx, r)
|
||||
if err != nil {
|
||||
return &httphandler.Error{Code: http.StatusInternalServerError, Message: "failed to get current user", Cause: err}
|
||||
}
|
||||
if caller == nil {
|
||||
return &httphandler.Error{Code: http.StatusUnauthorized, Message: "unauthorized access"}
|
||||
}
|
||||
if !access.IsInstanceAdmin(caller) {
|
||||
return &httphandler.Error{Code: http.StatusForbidden, Message: "forbidden access"}
|
||||
}
|
||||
|
||||
identifier := r.PathValue("identifier")
|
||||
user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &identifier})
|
||||
if err != nil {
|
||||
return &httphandler.Error{Code: http.StatusInternalServerError, Message: "failed to get user", Cause: err}
|
||||
}
|
||||
if user == nil {
|
||||
return &httphandler.Error{Code: http.StatusNotFound, Message: "user not found"}
|
||||
}
|
||||
|
||||
preflight := r.Method == http.MethodHead
|
||||
if err := s.admitMemoExport(w, caller, preflight); err != nil {
|
||||
return err
|
||||
}
|
||||
if !preflight {
|
||||
defer s.memoExportSemaphore.Release(1)
|
||||
}
|
||||
|
||||
exportTime := time.Now().UTC().Truncate(time.Second)
|
||||
w.Header().Set("Content-Type", memoexport.MediaType)
|
||||
w.Header().Set("Content-Disposition", mime.FormatMediaType("attachment", map[string]string{"filename": memoExportFilename(user.Username, exportTime)}))
|
||||
if preflight {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return nil
|
||||
}
|
||||
|
||||
body := &commitOnWrite{ResponseWriter: w}
|
||||
if err := s.MemoExporter.WriteMemoExport(ctx, user, body, exportTime); err != nil {
|
||||
if ctx.Err() == nil {
|
||||
slog.Error("memo export failed", slog.Int("user", int(user.ID)), slog.Int("caller", int(caller.ID)), slog.Bool("committed", body.committed), slog.Any("error", err))
|
||||
}
|
||||
// Before the first byte this becomes a JSON 500, so the archive
|
||||
// headers must go or the client would save the error as the ZIP.
|
||||
// After it, the response is already committed and the client
|
||||
// receives a truncated archive, which the handler wrapper leaves alone.
|
||||
if !body.committed {
|
||||
w.Header().Del("Content-Type")
|
||||
w.Header().Del("Content-Disposition")
|
||||
}
|
||||
return &httphandler.Error{Code: http.StatusInternalServerError, Message: "failed to export memos", Cause: err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// admitMemoExport charges the caller's archive budget and takes the export
|
||||
// lock. A preflight only looks: it consumes no budget and releases the lock at
|
||||
// once, so it reports what a GET would meet without doing its work.
|
||||
func (s *FileServerService) admitMemoExport(w http.ResponseWriter, caller *store.User, preflight bool) error {
|
||||
key := strconv.Itoa(int(caller.ID))
|
||||
if s.RateLimiter != nil {
|
||||
var decision ratelimit.Decision
|
||||
if preflight {
|
||||
decision = s.RateLimiter.Allowed(ratelimit.ScopeArchiveUser, key, 1)
|
||||
} else {
|
||||
decision = s.RateLimiter.Consume(ratelimit.ScopeArchiveUser, key, 1)
|
||||
}
|
||||
if !decision.Allowed {
|
||||
w.Header().Set("Retry-After", strconv.Itoa(max(int(math.Ceil(decision.RetryAfter.Seconds())), 1)))
|
||||
return &httphandler.Error{Code: http.StatusTooManyRequests, Message: "too many exports, try again later"}
|
||||
}
|
||||
}
|
||||
if !s.memoExportSemaphore.TryAcquire(1) {
|
||||
if s.RateLimiter != nil && !preflight {
|
||||
s.RateLimiter.Refund(ratelimit.ScopeArchiveUser, key, 1)
|
||||
}
|
||||
return &httphandler.Error{Code: http.StatusTooManyRequests, Message: "another export is running, try again later"}
|
||||
}
|
||||
if preflight {
|
||||
s.memoExportSemaphore.Release(1)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// memoExportFilename is memos-export-<username>-<YYYYMMDDTHHMMSSZ>.zip, the
|
||||
// name the export format document specifies.
|
||||
func memoExportFilename(username string, exportTime time.Time) string {
|
||||
return "memos-export-" + memoexport.SafeFilename(username) + "-" + exportTime.UTC().Format("20060102T150405Z") + ".zip"
|
||||
}
|
||||
|
||||
// commitOnWrite records whether any byte reached the client, so a failure
|
||||
// can be reported as an error response only while that is still possible.
|
||||
type commitOnWrite struct {
|
||||
http.ResponseWriter
|
||||
committed bool
|
||||
}
|
||||
|
||||
func (c *commitOnWrite) Write(p []byte) (int, error) {
|
||||
c.committed = true
|
||||
return c.ResponseWriter.Write(p)
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package fileserver
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/usememos/memos/core/memoexport"
|
||||
"github.com/usememos/memos/internal/httphandler"
|
||||
"github.com/usememos/memos/internal/ratelimit"
|
||||
apipb "github.com/usememos/memos/proto/gen/api"
|
||||
"github.com/usememos/memos/server/api"
|
||||
"github.com/usememos/memos/server/auth"
|
||||
"github.com/usememos/memos/store"
|
||||
)
|
||||
|
||||
type memoExportFixture struct {
|
||||
svc *api.APIService
|
||||
fs *FileServerService
|
||||
stores *store.Store
|
||||
mux *http.ServeMux
|
||||
admin *store.User
|
||||
member *store.User
|
||||
}
|
||||
|
||||
func newMemoExportFixture(ctx context.Context, t *testing.T) (*memoExportFixture, func()) {
|
||||
t.Helper()
|
||||
svc, fs, stores, cleanup := newShareAttachmentTestServices(ctx, t)
|
||||
fs.MemoExporter = svc
|
||||
fs.RateLimiter = ratelimit.NewMemoryLimiter(ratelimit.DefaultPolicy())
|
||||
|
||||
admin, err := stores.CreateUser(ctx, &store.User{Username: "export-admin", Role: store.RoleAdmin, Email: "export-admin@example.com"})
|
||||
require.NoError(t, err)
|
||||
member, err := stores.CreateUser(ctx, &store.User{Username: "export-member", Role: store.RoleUser, Email: "export-member@example.com"})
|
||||
require.NoError(t, err)
|
||||
for _, owner := range []*store.User{admin, member} {
|
||||
ownerCtx := context.WithValue(ctx, auth.UserIDContextKey, owner.ID)
|
||||
for i := range 2 {
|
||||
_, err := svc.CreateMemo(ownerCtx, &apipb.CreateMemoRequest{Memo: &apipb.Memo{
|
||||
Content: fmt.Sprintf("%s memo %d", owner.Username, i),
|
||||
Visibility: apipb.Visibility_PRIVATE,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
fs.RegisterRoutes(mux, http.HandlerFunc(httphandler.NotFound))
|
||||
return &memoExportFixture{svc: svc, fs: fs, stores: stores, mux: mux, admin: admin, member: member}, cleanup
|
||||
}
|
||||
|
||||
func (f *memoExportFixture) request(ctx context.Context, t *testing.T, method, username string, as *store.User) *httptest.ResponseRecorder {
|
||||
t.Helper()
|
||||
req := httptest.NewRequest(method, "/file/users/"+username+"/export", nil)
|
||||
if as != nil {
|
||||
req.AddCookie(newRefreshTokenCookie(ctx, t, f.stores, as.ID, f.svc.Secret))
|
||||
}
|
||||
recorder := httptest.NewRecorder()
|
||||
f.mux.ServeHTTP(recorder, req)
|
||||
return recorder
|
||||
}
|
||||
|
||||
func TestServeMemoExport_AdminStreamsAnotherUsersArchive(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
recorder := f.request(ctx, t, http.MethodGet, f.member.Username, f.admin)
|
||||
require.Equal(t, http.StatusOK, recorder.Code)
|
||||
require.Equal(t, memoexport.MediaType, recorder.Header().Get("Content-Type"))
|
||||
require.Regexp(t, `^attachment; filename=memos-export-export-member-\d{8}T\d{6}Z\.zip$`, recorder.Header().Get("Content-Disposition"))
|
||||
require.Equal(t, privateAttachmentCacheControl, recorder.Header().Get("Cache-Control"))
|
||||
require.Equal(t, "nosniff", recorder.Header().Get("X-Content-Type-Options"))
|
||||
|
||||
archive, err := memoexport.Read(bytes.NewReader(recorder.Body.Bytes()), int64(recorder.Body.Len()))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "export-member", archive.Manifest.Scope.User.Username)
|
||||
require.Len(t, archive.Memos, 2)
|
||||
for _, memo := range archive.Memos {
|
||||
require.Equal(t, "export-member", memo.Creator)
|
||||
}
|
||||
|
||||
own := f.request(ctx, t, http.MethodGet, f.admin.Username, f.admin)
|
||||
require.Equal(t, http.StatusOK, own.Code)
|
||||
ownArchive, err := memoexport.Read(bytes.NewReader(own.Body.Bytes()), int64(own.Body.Len()))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "export-admin", ownArchive.Manifest.Scope.User.Username)
|
||||
}
|
||||
|
||||
func TestServeMemoExport_RefusesMembersAndAnonymous(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
require.Equal(t, http.StatusForbidden, f.request(ctx, t, http.MethodGet, f.member.Username, f.member).Code)
|
||||
require.Equal(t, http.StatusForbidden, f.request(ctx, t, http.MethodGet, f.admin.Username, f.member).Code)
|
||||
require.Equal(t, http.StatusUnauthorized, f.request(ctx, t, http.MethodGet, f.member.Username, nil).Code)
|
||||
require.Equal(t, http.StatusNotFound, f.request(ctx, t, http.MethodGet, "nobody", f.admin).Code)
|
||||
|
||||
// The error envelope is JSON; nothing of the archive leaks.
|
||||
forbidden := f.request(ctx, t, http.MethodGet, f.member.Username, f.member)
|
||||
require.Equal(t, "application/json", forbidden.Header().Get("Content-Type"))
|
||||
require.Contains(t, forbidden.Body.String(), "forbidden access")
|
||||
}
|
||||
|
||||
func TestServeMemoExport_HeadPreflightChecksWithoutExporting(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
head := f.request(ctx, t, http.MethodHead, f.member.Username, f.admin)
|
||||
require.Equal(t, http.StatusOK, head.Code)
|
||||
require.Equal(t, memoexport.MediaType, head.Header().Get("Content-Type"))
|
||||
require.Regexp(t, `^attachment; filename=memos-export-export-member-`, head.Header().Get("Content-Disposition"))
|
||||
require.Zero(t, head.Body.Len())
|
||||
|
||||
require.Equal(t, http.StatusForbidden, f.request(ctx, t, http.MethodHead, f.member.Username, f.member).Code)
|
||||
require.Equal(t, http.StatusUnauthorized, f.request(ctx, t, http.MethodHead, f.member.Username, nil).Code)
|
||||
|
||||
// A preflight charges nothing: the full hourly budget is still available.
|
||||
budget := ratelimit.DefaultPolicy()[ratelimit.ScopeArchiveUser].Limit
|
||||
for range budget {
|
||||
require.Equal(t, http.StatusOK, f.request(ctx, t, http.MethodHead, f.member.Username, f.admin).Code)
|
||||
}
|
||||
for range budget {
|
||||
require.Equal(t, http.StatusOK, f.request(ctx, t, http.MethodGet, f.member.Username, f.admin).Code)
|
||||
}
|
||||
exhausted := f.request(ctx, t, http.MethodGet, f.member.Username, f.admin)
|
||||
require.Equal(t, http.StatusTooManyRequests, exhausted.Code)
|
||||
require.NotEmpty(t, exhausted.Header().Get("Retry-After"))
|
||||
require.Equal(t, http.StatusTooManyRequests, f.request(ctx, t, http.MethodHead, f.member.Username, f.admin).Code)
|
||||
}
|
||||
|
||||
// stubExporter stands in for the API service. It parks inside WriteMemoExport
|
||||
// until released, so a test can observe a running export, or fails before
|
||||
// writing a byte when err is set.
|
||||
type stubExporter struct {
|
||||
started chan struct{}
|
||||
release chan struct{}
|
||||
err error
|
||||
}
|
||||
|
||||
func (e *stubExporter) WriteMemoExport(ctx context.Context, _ *store.User, w io.Writer, _ time.Time) error {
|
||||
if e.err != nil {
|
||||
return e.err
|
||||
}
|
||||
close(e.started)
|
||||
select {
|
||||
case <-e.release:
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
}
|
||||
_, err := w.Write([]byte("PK"))
|
||||
return err
|
||||
}
|
||||
|
||||
func TestServeMemoExport_OneExportAtATime(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
exporter := &stubExporter{started: make(chan struct{}), release: make(chan struct{})}
|
||||
f.fs.MemoExporter = exporter
|
||||
running := make(chan *httptest.ResponseRecorder, 1)
|
||||
go func() { running <- f.request(ctx, t, http.MethodGet, f.member.Username, f.admin) }()
|
||||
<-exporter.started
|
||||
|
||||
// The lock spans the whole export: while one streams, another is refused.
|
||||
busy := f.request(ctx, t, http.MethodGet, f.member.Username, f.admin)
|
||||
require.Equal(t, http.StatusTooManyRequests, busy.Code)
|
||||
require.Contains(t, busy.Body.String(), "another export is running")
|
||||
require.Equal(t, http.StatusTooManyRequests, f.request(ctx, t, http.MethodHead, f.member.Username, f.admin).Code)
|
||||
|
||||
close(exporter.release)
|
||||
require.Equal(t, http.StatusOK, (<-running).Code)
|
||||
|
||||
// The refused request refunded its budget unit and the lock is free again.
|
||||
f.fs.MemoExporter = f.svc
|
||||
require.Equal(t, http.StatusOK, f.request(ctx, t, http.MethodGet, f.member.Username, f.admin).Code)
|
||||
require.Equal(t, ratelimit.DefaultPolicy()[ratelimit.ScopeArchiveUser].Limit-2,
|
||||
f.fs.RateLimiter.Allowed(ratelimit.ScopeArchiveUser, fmt.Sprint(f.admin.ID), 1).Remaining)
|
||||
}
|
||||
|
||||
func TestServeMemoExport_FailureBeforeFirstByteIsAnErrorResponse(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
f.fs.MemoExporter = &stubExporter{err: errors.New("storage unavailable")}
|
||||
failed := f.request(ctx, t, http.MethodGet, f.member.Username, f.admin)
|
||||
require.Equal(t, http.StatusInternalServerError, failed.Code)
|
||||
require.Equal(t, "application/json", failed.Header().Get("Content-Type"))
|
||||
require.Empty(t, failed.Header().Get("Content-Disposition"))
|
||||
require.Contains(t, failed.Body.String(), "failed to export memos")
|
||||
require.NotContains(t, failed.Body.String(), "storage unavailable")
|
||||
|
||||
// The lock is released after a failure.
|
||||
f.fs.MemoExporter = f.svc
|
||||
require.Equal(t, http.StatusOK, f.request(ctx, t, http.MethodGet, f.member.Username, f.admin).Code)
|
||||
}
|
||||
|
||||
func TestServeMemoExport_RouteDisabledWithoutExporter(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
f, cleanup := newMemoExportFixture(ctx, t)
|
||||
defer cleanup()
|
||||
|
||||
f.fs.MemoExporter = nil
|
||||
require.Equal(t, http.StatusNotFound, f.request(ctx, t, http.MethodGet, f.member.Username, f.admin).Code)
|
||||
}
|
||||
@@ -103,6 +103,8 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
frontendService := frontend.NewFrontendService(profile, store)
|
||||
frontendService.Serve(ctx, mux, apiHandler)
|
||||
fileServerService := fileserver.NewFileServerService(s.Profile, s.Store, s.Secret)
|
||||
fileServerService.MemoExporter = apiService
|
||||
fileServerService.RateLimiter = apiService.RateLimiter
|
||||
fileServerService.RegisterRoutes(mux, apiHandler)
|
||||
// Preserve unclean-path routing without ServeMux's automatic redirects.
|
||||
fallback := frontendService.Handler(apiHandler)
|
||||
|
||||
@@ -23,6 +23,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
||||
import ManagedByConfigurationChip from "./ManagedByConfigurationChip";
|
||||
import SettingSection from "./SettingSection";
|
||||
import SettingTable from "./SettingTable";
|
||||
import { useExportMemos } from "./useExportMemos";
|
||||
|
||||
const MemberSection = () => {
|
||||
const t = useTranslate();
|
||||
@@ -30,6 +31,7 @@ const MemberSection = () => {
|
||||
const currentUser = useCurrentUser();
|
||||
const { data: users = [], refetch: refetchUsers } = useListUsers();
|
||||
const deleteUserMutation = useDeleteUser();
|
||||
const { exportMemos, exporting } = useExportMemos();
|
||||
const createDialog = useDialog();
|
||||
const editDialog = useDialog();
|
||||
const [editingUser, setEditingUser] = useState<User | undefined>();
|
||||
@@ -177,6 +179,9 @@ const MemberSection = () => {
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" sideOffset={2}>
|
||||
<DropdownMenuItem onClick={() => handleEditUser(user)}>{t("common.update")}</DropdownMenuItem>
|
||||
<DropdownMenuItem disabled={exporting} onClick={() => exportMemos(user.username)}>
|
||||
{t("setting.member.export-memos")}
|
||||
</DropdownMenuItem>
|
||||
{user.state === State.NORMAL ? (
|
||||
<DropdownMenuItem onClick={() => handleArchiveUserClick(user)}>{t("setting.member.archive-member")}</DropdownMenuItem>
|
||||
) : (
|
||||
|
||||
@@ -9,13 +9,14 @@ import { Label } from "@/components/ui/label";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { getErrorMessage } from "@/lib/error";
|
||||
import { exportMemos, importStagedMemos, type StagedMemoImport, stageMemoImport } from "@/lib/memo-export";
|
||||
import { importStagedMemos, type StagedMemoImport, stageMemoImport } from "@/lib/memo-export";
|
||||
import type { ImportMemosIssue, ImportMemosReport } from "@/types/proto/api/user_service_pb";
|
||||
import { ImportMemosRequest_ConflictPolicy } from "@/types/proto/api/user_service_pb";
|
||||
import { ImportMemosRequest_ConflictPolicy, User_Role } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import { SettingList, SettingListItem, StatRow } from "./SettingList";
|
||||
import SettingSection from "./SettingSection";
|
||||
import { useExportMemos } from "./useExportMemos";
|
||||
|
||||
const POLICIES = [
|
||||
{
|
||||
@@ -58,22 +59,10 @@ const MemoExportSection = () => {
|
||||
const t = useTranslate();
|
||||
const user = useCurrentUser();
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const [exporting, setExporting] = useState(false);
|
||||
const { exportMemos, exporting } = useExportMemos();
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [stage, setStage] = useState<ImportStage>({ kind: "idle" });
|
||||
|
||||
const handleExport = async () => {
|
||||
if (!user) return;
|
||||
setExporting(true);
|
||||
try {
|
||||
await exportMemos(user.name, user.username);
|
||||
toast.success(t("setting.memo-export.export-success"));
|
||||
} catch (error) {
|
||||
toast.error(getErrorMessage(error, t("setting.memo-export.export-failed")));
|
||||
} finally {
|
||||
setExporting(false);
|
||||
}
|
||||
};
|
||||
const isAdmin = user?.role === User_Role.ADMIN;
|
||||
|
||||
const handleFileChosen = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = event.target.files?.[0];
|
||||
@@ -112,15 +101,20 @@ const MemoExportSection = () => {
|
||||
|
||||
return (
|
||||
<SettingSection title={t("setting.memo-export.label")} description={t("setting.memo-export.description")}>
|
||||
<SettingGroup title={t("setting.memo-export.export-title")} description={t("setting.memo-export.export-description")}>
|
||||
<SettingList>
|
||||
<SettingListItem label={t("setting.memo-export.export-label")} description={t("setting.memo-export.export-detail")}>
|
||||
<Button variant="outline" size="sm" disabled={exporting} onClick={handleExport}>
|
||||
<DownloadIcon className="w-4 h-4 mr-1.5" />
|
||||
{exporting ? t("setting.memo-export.exporting") : t("setting.memo-export.export-action")}
|
||||
</Button>
|
||||
</SettingListItem>
|
||||
</SettingList>
|
||||
<SettingGroup
|
||||
title={t("setting.memo-export.export-title")}
|
||||
description={isAdmin ? t("setting.memo-export.export-description") : t("setting.memo-export.export-admin-only")}
|
||||
>
|
||||
{isAdmin && (
|
||||
<SettingList>
|
||||
<SettingListItem label={t("setting.memo-export.export-label")} description={t("setting.memo-export.export-detail")}>
|
||||
<Button variant="outline" size="sm" disabled={exporting} onClick={() => exportMemos(user.username)}>
|
||||
<DownloadIcon className="w-4 h-4 mr-1.5" />
|
||||
{exporting ? t("setting.memo-export.exporting") : t("setting.memo-export.export-action")}
|
||||
</Button>
|
||||
</SettingListItem>
|
||||
</SettingList>
|
||||
)}
|
||||
</SettingGroup>
|
||||
|
||||
<SettingGroup showSeparator title={t("setting.memo-export.import-title")} description={t("setting.memo-export.import-description")}>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { getErrorMessage } from "@/lib/error";
|
||||
import { exportMemos, MemoExportError } from "@/lib/memo-export";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
// useExportMemos starts a memo export download for a username and reports the
|
||||
// outcome with a toast. Only instance administrators may export.
|
||||
export const useExportMemos = () => {
|
||||
const t = useTranslate();
|
||||
const [exporting, setExporting] = useState(false);
|
||||
|
||||
const run = async (username: string) => {
|
||||
setExporting(true);
|
||||
try {
|
||||
await exportMemos(username);
|
||||
toast.success(t("setting.memo-export.export-success"));
|
||||
} catch (error) {
|
||||
if (error instanceof MemoExportError && error.status === 429) {
|
||||
toast.error(t("setting.memo-export.export-busy"));
|
||||
} else {
|
||||
toast.error(getErrorMessage(error, t("setting.memo-export.export-failed")));
|
||||
}
|
||||
} finally {
|
||||
setExporting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return { exportMemos: run, exporting };
|
||||
};
|
||||
@@ -7,14 +7,39 @@ import { ImportMemosRequest_ConflictPolicy, ImportMemosSpecSchema } from "@/type
|
||||
|
||||
const DEFAULT_CHUNK_SIZE = 2 * 1024 * 1024;
|
||||
|
||||
// exportMemos downloads the user's Memos export file.
|
||||
export async function exportMemos(userName: string, username: string): Promise<void> {
|
||||
const body = await userServiceClient.exportMemos({ name: userName });
|
||||
const stamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d+/, "");
|
||||
const url = URL.createObjectURL(new Blob([body.data as BlobPart], { type: body.contentType }));
|
||||
downloadFileFromUrl(url, `memos-export-${username}-${stamp}.zip`);
|
||||
// Give the browser a tick to start the download before revoking.
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
// MemoExportError is a refused export preflight, carrying the HTTP status so
|
||||
// the caller can tell a busy server (429) from a denied request.
|
||||
export class MemoExportError extends Error {
|
||||
constructor(readonly status: number) {
|
||||
super(`Export refused with status ${status}`);
|
||||
this.name = "MemoExportError";
|
||||
}
|
||||
}
|
||||
|
||||
export const memoExportUrl = (username: string) => `/file/users/${encodeURIComponent(username)}/export`;
|
||||
|
||||
const filenameFromDisposition = (disposition: string | null): string | undefined => {
|
||||
const match = disposition?.match(/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i);
|
||||
if (!match) return undefined;
|
||||
try {
|
||||
return decodeURIComponent(match[1]);
|
||||
} catch {
|
||||
// A plain filename may hold a literal percent sign; keep it as sent.
|
||||
return match[1];
|
||||
}
|
||||
};
|
||||
|
||||
// exportMemos downloads a user's Memos export file. The archive streams from
|
||||
// the file server straight into the browser's download, so it is never held
|
||||
// in page memory. A HEAD preflight runs the server's checks first, so a
|
||||
// refusal arrives as an error instead of a downloaded error document.
|
||||
export async function exportMemos(username: string): Promise<void> {
|
||||
const url = memoExportUrl(username);
|
||||
const response = await fetch(url, { method: "HEAD", credentials: "same-origin" });
|
||||
if (!response.ok) {
|
||||
throw new MemoExportError(response.status);
|
||||
}
|
||||
downloadFileFromUrl(url, filenameFromDisposition(response.headers.get("Content-Disposition")) ?? `memos-export-${username}.zip`);
|
||||
}
|
||||
|
||||
export interface StagedMemoImport {
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "المؤرشفة",
|
||||
"member-column": "عضو",
|
||||
"active": "نشط",
|
||||
"summary-column": "ملخص"
|
||||
"summary-column": "ملخص",
|
||||
"export-memos": "تصدير الملاحظات"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "حسابي"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "موجودة بالفعل في حسابك",
|
||||
"review-exported": "تم التصدير بواسطة",
|
||||
"review-memos": "مذكرات في الملف",
|
||||
"review-new": "سيتم الإنشاء"
|
||||
"review-new": "سيتم الإنشاء",
|
||||
"export-admin-only": "يمكن للمسؤولين فقط تصدير الملاحظات. اطلب من مسؤول ملف التصدير الخاص بك.",
|
||||
"export-busy": "هناك عملية تصدير أخرى قيد التنفيذ. حاول مرة أخرى بعد قليل."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "عام",
|
||||
|
||||
@@ -643,7 +643,8 @@
|
||||
"restore-success": "{{username}} uğurla bərpa edildi",
|
||||
"summary-column": "Xülasə",
|
||||
"user": "İstifadəçi",
|
||||
"no-members-found": "Üzv tapılmadı"
|
||||
"no-members-found": "Üzv tapılmadı",
|
||||
"export-memos": "Qeydləri ixrac et"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Reaksiya əlavə et",
|
||||
@@ -693,7 +694,9 @@
|
||||
"review-exported": "İxrac edən",
|
||||
"review-file": "Fayl",
|
||||
"review-memos": "Fayldakı qeydlər",
|
||||
"review-new": "Yaradılacaq"
|
||||
"review-new": "Yaradılacaq",
|
||||
"export-admin-only": "Qeydləri yalnız administratorlar ixrac edə bilər. İxrac faylınız üçün administratora müraciət edin.",
|
||||
"export-busy": "Başqa bir ixrac davam edir. Bir az sonra yenidən cəhd edin."
|
||||
},
|
||||
"my-account": {
|
||||
"label": "Hesabım"
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} възстановен успешно",
|
||||
"summary-column": "Резюме",
|
||||
"user": "Потребител",
|
||||
"no-members-found": "Няма намерени членове"
|
||||
"no-members-found": "Няма намерени членове",
|
||||
"export-memos": "Експортиране на бележки"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Добавете реакция",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Вече е във вашия акаунт",
|
||||
"review-exported": "Експортирано от",
|
||||
"review-memos": "Memos в файла",
|
||||
"review-new": "Ще бъде създадено"
|
||||
"review-new": "Ще бъде създадено",
|
||||
"export-admin-only": "Само администратори могат да експортират бележки. Поискайте експортния си файл от администратор.",
|
||||
"export-busy": "В момента се изпълнява друг експорт. Опитайте отново след малко."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "генерал",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Actius",
|
||||
"archived": "Arxivat",
|
||||
"member-column": "Membre",
|
||||
"summary-column": "Resum"
|
||||
"summary-column": "Resum",
|
||||
"export-memos": "Exportar notes"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Nota",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Ja al vostre compte",
|
||||
"review-exported": "Exportat per",
|
||||
"review-memos": "Memos a el fitxer",
|
||||
"review-new": "Es crearà"
|
||||
"review-new": "Es crearà",
|
||||
"export-admin-only": "Només els administradors poden exportar notes. Demana el fitxer d'exportació a un administrador.",
|
||||
"export-busy": "Hi ha una altra exportació en curs. Torna-ho a provar d'aquí a un moment."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "General",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktivní",
|
||||
"archived": "Archivováno",
|
||||
"member-column": "Člen",
|
||||
"summary-column": "Shrnutí"
|
||||
"summary-column": "Shrnutí",
|
||||
"export-memos": "Exportovat poznámky"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Poznámky",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Již ve vašem účtu",
|
||||
"review-exported": "Exportováno uživatelem",
|
||||
"review-memos": "Poznámky v souboru",
|
||||
"review-new": "Bude vytvořeno"
|
||||
"review-new": "Bude vytvořeno",
|
||||
"export-admin-only": "Poznámky mohou exportovat pouze správci. Požádejte správce o svůj exportní soubor.",
|
||||
"export-busy": "Právě probíhá jiný export. Zkuste to za chvíli znovu."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Obecné",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} gendannet med succes",
|
||||
"summary-column": "Oversigt",
|
||||
"user": "Bruger",
|
||||
"no-members-found": "Ingen medlemmer fundet"
|
||||
"no-members-found": "Ingen medlemmer fundet",
|
||||
"export-memos": "Eksportér noter"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Tilføj reaktion",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Allerede på din konto",
|
||||
"review-exported": "Eksporteret af",
|
||||
"review-memos": "Memos i fil",
|
||||
"review-new": "Vil blive oprettet"
|
||||
"review-new": "Vil blive oprettet",
|
||||
"export-admin-only": "Kun administratorer kan eksportere noter. Bed en administrator om din eksportfil.",
|
||||
"export-busy": "En anden eksport er i gang. Prøv igen om et øjeblik."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Generel",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktiv",
|
||||
"archived": "Archiviert",
|
||||
"member-column": "Mitglied",
|
||||
"summary-column": "Zusammenfassung"
|
||||
"summary-column": "Zusammenfassung",
|
||||
"export-memos": "Memos exportieren"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Notiz",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Bereits in Ihrem Konto",
|
||||
"review-exported": "Exportiert von",
|
||||
"review-memos": "Notizen in der Datei",
|
||||
"review-new": "Wird erstellt"
|
||||
"review-new": "Wird erstellt",
|
||||
"export-admin-only": "Nur Administratoren können Memos exportieren. Bitte einen Administrator um deine Exportdatei.",
|
||||
"export-busy": "Ein anderer Export läuft gerade. Versuche es gleich noch einmal."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Allgemein",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "Το {{username}} αποκαταστάθηκε με επιτυχία",
|
||||
"summary-column": "Περίληψη",
|
||||
"user": "Μεταχειριζόμενος",
|
||||
"no-members-found": "Δεν βρέθηκαν μέλη"
|
||||
"no-members-found": "Δεν βρέθηκαν μέλη",
|
||||
"export-memos": "Εξαγωγή σημειώσεων"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Προσθέστε την αντίδραση",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Ήδη στον λογαριασμό σας",
|
||||
"review-exported": "Εξήχθη από",
|
||||
"review-memos": "Memos στο αρχείο",
|
||||
"review-new": "Θα δημιουργηθεί"
|
||||
"review-new": "Θα δημιουργηθεί",
|
||||
"export-admin-only": "Μόνο οι διαχειριστές μπορούν να εξάγουν σημειώσεις. Ζητήστε το αρχείο εξαγωγής σας από έναν διαχειριστή.",
|
||||
"export-busy": "Μια άλλη εξαγωγή βρίσκεται σε εξέλιξη. Δοκιμάστε ξανά σε λίγο."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Γενικός",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Active",
|
||||
"archived": "Archived",
|
||||
"member-column": "Member",
|
||||
"summary-column": "Summary"
|
||||
"summary-column": "Summary",
|
||||
"export-memos": "Export memos"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-exported": "Exported by",
|
||||
"review-file": "File",
|
||||
"review-memos": "Memos in file",
|
||||
"review-new": "Will be created"
|
||||
"review-new": "Will be created",
|
||||
"export-admin-only": "Only administrators can export memos. Ask an administrator for your export file.",
|
||||
"export-busy": "Another export is running. Try again in a moment."
|
||||
},
|
||||
"spaces": {
|
||||
"accept": "Accept",
|
||||
|
||||
@@ -643,7 +643,8 @@
|
||||
"restore-success": "{{username}} restored successfully",
|
||||
"summary-column": "Summary",
|
||||
"user": "User",
|
||||
"no-members-found": "No members found"
|
||||
"no-members-found": "No members found",
|
||||
"export-memos": "Export memos"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Add reaction",
|
||||
@@ -693,7 +694,9 @@
|
||||
"review-exported": "Exported by",
|
||||
"review-file": "File",
|
||||
"review-memos": "Memos in file",
|
||||
"review-new": "Will be created"
|
||||
"review-new": "Will be created",
|
||||
"export-admin-only": "Only administrators can export memos. Ask an administrator for your export file.",
|
||||
"export-busy": "Another export is running. Try again in a moment."
|
||||
},
|
||||
"my-account": {
|
||||
"label": "My Account"
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Activa",
|
||||
"archived": "Archivada",
|
||||
"member-column": "Miembro",
|
||||
"summary-column": "Resumen"
|
||||
"summary-column": "Resumen",
|
||||
"export-memos": "Exportar notas"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Ya en tu cuenta",
|
||||
"review-exported": "Exportado por",
|
||||
"review-memos": "Memos en archivo",
|
||||
"review-new": "Se creará"
|
||||
"review-new": "Se creará",
|
||||
"export-admin-only": "Solo los administradores pueden exportar notas. Pide tu archivo de exportación a un administrador.",
|
||||
"export-busy": "Hay otra exportación en curso. Inténtalo de nuevo en un momento."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "General",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} taastati edukalt",
|
||||
"summary-column": "Kokkuvõte",
|
||||
"user": "Kasutaja",
|
||||
"no-members-found": "Ühtegi liiget ei leitud"
|
||||
"no-members-found": "Ühtegi liiget ei leitud",
|
||||
"export-memos": "Ekspordi märkmed"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Lisa reaktsioon",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Juba teie kontol",
|
||||
"review-exported": "Eksporditud",
|
||||
"review-memos": "Memos failis",
|
||||
"review-new": "Luuakse"
|
||||
"review-new": "Luuakse",
|
||||
"export-admin-only": "Märkmeid saavad eksportida ainult administraatorid. Küsi oma ekspordifaili administraatorilt.",
|
||||
"export-busy": "Teine eksport on pooleli. Proovi hetke pärast uuesti."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Kindral",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "آرشیو شده",
|
||||
"member-column": "عضو",
|
||||
"active": "فعال",
|
||||
"summary-column": "خلاصه"
|
||||
"summary-column": "خلاصه",
|
||||
"export-memos": "خروجی گرفتن از یادداشتها"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "حساب من"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "قبلاً در حساب شما",
|
||||
"review-exported": "صادر شده توسط",
|
||||
"review-memos": "یادداشتها در فایل",
|
||||
"review-new": "ایجاد خواهد شد"
|
||||
"review-new": "ایجاد خواهد شد",
|
||||
"export-admin-only": "فقط مدیران میتوانند یادداشتها را خروجی بگیرند. فایل خروجی خود را از یک مدیر بخواهید.",
|
||||
"export-busy": "یک خروجی دیگر در حال انجام است. لحظهای دیگر دوباره تلاش کنید."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "عمومی",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} palautettiin onnistuneesti",
|
||||
"summary-column": "Yhteenveto",
|
||||
"user": "Käyttäjä",
|
||||
"no-members-found": "Jäseniä ei löytynyt"
|
||||
"no-members-found": "Jäseniä ei löytynyt",
|
||||
"export-memos": "Vie muistiinpanot"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Lisää reaktio",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Jo tililläsi.",
|
||||
"review-exported": "Vienti.",
|
||||
"review-memos": "Memos tiedostossa.",
|
||||
"review-new": "Luodaan."
|
||||
"review-new": "Luodaan.",
|
||||
"export-admin-only": "Vain järjestelmänvalvojat voivat viedä muistiinpanoja. Pyydä vientitiedostosi järjestelmänvalvojalta.",
|
||||
"export-busy": "Toinen vienti on käynnissä. Yritä hetken päästä uudelleen."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Kenraali",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Active",
|
||||
"archived": "Archivé",
|
||||
"member-column": "Membre",
|
||||
"summary-column": "Résumé"
|
||||
"summary-column": "Résumé",
|
||||
"export-memos": "Exporter les mémos"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Note",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-exported": "Exporté par",
|
||||
"review-memos": "Memos dans le fichier",
|
||||
"review-new": "Sera créé",
|
||||
"import-success": "{{created}} nouveaux mémos importés et {{updated}} mémos mis à jour."
|
||||
"import-success": "{{created}} nouveaux mémos importés et {{updated}} mémos mis à jour.",
|
||||
"export-admin-only": "Seuls les administrateurs peuvent exporter les mémos. Demandez votre fichier d'export à un administrateur.",
|
||||
"export-busy": "Un autre export est en cours. Réessayez dans un instant."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Général",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Activo",
|
||||
"archived": "Arquivado",
|
||||
"member-column": "Membro",
|
||||
"summary-column": "Resumo"
|
||||
"summary-column": "Resumo",
|
||||
"export-memos": "Exportar notas"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Xa na túa conta",
|
||||
"review-exported": "Exportado por",
|
||||
"review-memos": "Memos no ficheiro",
|
||||
"review-new": "Crearase"
|
||||
"review-new": "Crearase",
|
||||
"export-admin-only": "Só os administradores poden exportar notas. Pídelle o teu ficheiro de exportación a un administrador.",
|
||||
"export-busy": "Hai outra exportación en curso. Téntao de novo nun momento."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Xeral",
|
||||
|
||||
@@ -603,7 +603,8 @@
|
||||
"restore-success": "{{username}} שוחזר/ה בהצלחה",
|
||||
"summary-column": "סיכום",
|
||||
"user": "משתמש",
|
||||
"no-members-found": "לא נמצאו חברים"
|
||||
"no-members-found": "לא נמצאו חברים",
|
||||
"export-memos": "ייצוא פתקים"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "הוסף תגובה",
|
||||
@@ -960,7 +961,9 @@
|
||||
"review-memos": "פתקים בקובץ",
|
||||
"review-new": "ייווצר",
|
||||
"import-confirm": "ייבוא {{count}} תזכירים",
|
||||
"import-success": "יובאו {{created}} תזכירים חדשים ועודכנו {{updated}} תזכירים."
|
||||
"import-success": "יובאו {{created}} תזכירים חדשים ועודכנו {{updated}} תזכירים.",
|
||||
"export-admin-only": "רק מנהלים יכולים לייצא פתקים. בקשו ממנהל את קובץ הייצוא שלכם.",
|
||||
"export-busy": "ייצוא אחר מתבצע כעת. נסו שוב בעוד רגע."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "כללי",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "संग्रहीत",
|
||||
"member-column": "सदस्य",
|
||||
"active": "एक्टिव",
|
||||
"summary-column": "समरी"
|
||||
"summary-column": "समरी",
|
||||
"export-memos": "मेमो निर्यात करें"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "मेरा खाता"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "आपके अकाउंट में पहले से हैं",
|
||||
"review-exported": "एक्सपोर्ट किया गया",
|
||||
"review-memos": "Memos एक्सपोर्ट फ़ाइल में",
|
||||
"review-new": "बनाया जाएगा"
|
||||
"review-new": "बनाया जाएगा",
|
||||
"export-admin-only": "केवल प्रशासक ही मेमो निर्यात कर सकते हैं। अपनी निर्यात फ़ाइल के लिए किसी प्रशासक से कहें।",
|
||||
"export-busy": "एक अन्य निर्यात चल रहा है। कुछ क्षण बाद पुनः प्रयास करें।"
|
||||
},
|
||||
"spaces": {
|
||||
"general": "सामान्य",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktivan",
|
||||
"archived": "Arhivirano",
|
||||
"member-column": "Član",
|
||||
"summary-column": "Sažetak"
|
||||
"summary-column": "Sažetak",
|
||||
"export-memos": "Izvezi bilješke"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Već na vašem računu",
|
||||
"review-exported": "Izvezeno od strane",
|
||||
"review-memos": "Memos u datoteci",
|
||||
"review-new": "Bit će kreirano"
|
||||
"review-new": "Bit će kreirano",
|
||||
"export-admin-only": "Samo administratori mogu izvoziti bilješke. Zatražite svoju datoteku izvoza od administratora.",
|
||||
"export-busy": "Drugi izvoz je u tijeku. Pokušajte ponovno za trenutak."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Općenito",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktív",
|
||||
"archived": "Archivált",
|
||||
"member-column": "Tag",
|
||||
"summary-column": "Összegzés"
|
||||
"summary-column": "Összegzés",
|
||||
"export-memos": "Jegyzetek exportálása"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Jegyzet",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Már a fiókodban van",
|
||||
"review-exported": "Exportálta:",
|
||||
"review-memos": "Jegyzetek a fájlban",
|
||||
"review-new": "Létrehozva lesz"
|
||||
"review-new": "Létrehozva lesz",
|
||||
"export-admin-only": "Csak az adminisztrátorok exportálhatnak jegyzeteket. Kérd az exportfájlodat egy adminisztrátortól.",
|
||||
"export-busy": "Egy másik exportálás folyamatban van. Próbáld újra egy pillanat múlva."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Általános",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "Diarsipkan",
|
||||
"member-column": "Anggota",
|
||||
"active": "Aktif",
|
||||
"summary-column": "Ringkasan"
|
||||
"summary-column": "Ringkasan",
|
||||
"export-memos": "Ekspor memo"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "Akun Saya"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "Sudah ada di akun Anda",
|
||||
"review-exported": "Diekspor oleh",
|
||||
"review-memos": "Memo di file",
|
||||
"review-new": "Akan dibuat"
|
||||
"review-new": "Akan dibuat",
|
||||
"export-admin-only": "Hanya administrator yang dapat mengekspor memo. Minta berkas ekspor Anda kepada administrator.",
|
||||
"export-busy": "Ekspor lain sedang berjalan. Coba lagi sebentar."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Umum",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Attiva",
|
||||
"archived": "Archiviata",
|
||||
"member-column": "Membro",
|
||||
"summary-column": "Riepilogo"
|
||||
"summary-column": "Riepilogo",
|
||||
"export-memos": "Esporta note"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Già presenti nel tuo account",
|
||||
"review-exported": "Esportato da",
|
||||
"review-memos": "Memo nelil file",
|
||||
"review-new": "Verrà creato"
|
||||
"review-new": "Verrà creato",
|
||||
"export-admin-only": "Solo gli amministratori possono esportare le note. Chiedi il file di esportazione a un amministratore.",
|
||||
"export-busy": "Un'altra esportazione è in corso. Riprova tra un momento."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Generale",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "アクティブ",
|
||||
"archived": "アーカイブ済み",
|
||||
"member-column": "メンバー",
|
||||
"summary-column": "まとめ"
|
||||
"summary-column": "まとめ",
|
||||
"export-memos": "メモをエクスポート"
|
||||
},
|
||||
"memo": {
|
||||
"label": "メモ",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "アカウントに既に存在します",
|
||||
"review-exported": "エクスポート元",
|
||||
"review-memos": "ファイル内のメモ",
|
||||
"review-new": "作成されます"
|
||||
"review-new": "作成されます",
|
||||
"export-admin-only": "メモをエクスポートできるのは管理者のみです。エクスポートファイルは管理者に依頼してください。",
|
||||
"export-busy": "別のエクスポートが実行中です。しばらくしてからもう一度お試しください。"
|
||||
},
|
||||
"spaces": {
|
||||
"general": "全般",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "აქტიური",
|
||||
"archived": "დაარქივებულია",
|
||||
"member-column": "წევრი",
|
||||
"summary-column": "რეზიუმე"
|
||||
"summary-column": "რეზიუმე",
|
||||
"export-memos": "ჩანაწერების ექსპორტი"
|
||||
},
|
||||
"memo": {
|
||||
"label": "მემო",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "უკვე თქვენს ანგარიშშია",
|
||||
"review-exported": "ექსპორტირებულია",
|
||||
"review-memos": "მემოები ფაილშია",
|
||||
"review-new": "შეიქმნება"
|
||||
"review-new": "შეიქმნება",
|
||||
"export-admin-only": "ჩანაწერების ექსპორტი მხოლოდ ადმინისტრატორებს შეუძლიათ. ექსპორტის ფაილი ადმინისტრატორს სთხოვეთ.",
|
||||
"export-busy": "სხვა ექსპორტი მიმდინარეობს. სცადეთ ხელახლა ცოტა ხანში."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "ზოგადი",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "보관 목록",
|
||||
"member-column": "멤버",
|
||||
"active": "활성",
|
||||
"summary-column": "요약"
|
||||
"summary-column": "요약",
|
||||
"export-memos": "메모 내보내기"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "내 계정"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-exported": "내보낸 사용자",
|
||||
"review-memos": "파일의 메모",
|
||||
"review-new": "생성 예정",
|
||||
"import-success": "새 메모 {{created}}개를 가져오고 메모 {{updated}}개를 업데이트했습니다."
|
||||
"import-success": "새 메모 {{created}}개를 가져오고 메모 {{updated}}개를 업데이트했습니다.",
|
||||
"export-admin-only": "관리자만 메모를 내보낼 수 있습니다. 내보내기 파일은 관리자에게 요청하세요.",
|
||||
"export-busy": "다른 내보내기가 진행 중입니다. 잠시 후 다시 시도하세요."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "일반",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} sėkmingai atkurtas",
|
||||
"summary-column": "Santrauka",
|
||||
"user": "Vartotojas",
|
||||
"no-members-found": "Narių nerasta"
|
||||
"no-members-found": "Narių nerasta",
|
||||
"export-memos": "Eksportuoti užrašus"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Pridėti reakciją",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Jau jūsų paskyroje",
|
||||
"review-exported": "Eksportavo",
|
||||
"review-memos": "Memos faile",
|
||||
"review-new": "Bus sukurta"
|
||||
"review-new": "Bus sukurta",
|
||||
"export-admin-only": "Užrašus eksportuoti gali tik administratoriai. Eksporto failo paprašykite administratoriaus.",
|
||||
"export-busy": "Vyksta kitas eksportas. Po akimirkos bandykite dar kartą."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Generolas",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} ir veiksmīgi atjaunots",
|
||||
"summary-column": "Kopsavilkums",
|
||||
"user": "Lietotājs",
|
||||
"no-members-found": "Nav atrasts neviens dalībnieks"
|
||||
"no-members-found": "Nav atrasts neviens dalībnieks",
|
||||
"export-memos": "Eksportēt piezīmes"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Pievienojiet reakciju",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Jau ir jūsu kontā",
|
||||
"review-exported": "Eksportējis",
|
||||
"review-memos": "Memos failā",
|
||||
"review-new": "Tiks izveidots"
|
||||
"review-new": "Tiks izveidots",
|
||||
"export-admin-only": "Piezīmes var eksportēt tikai administratori. Lūdziet administratoram savu eksporta failu.",
|
||||
"export-busy": "Notiek cits eksports. Pēc brīža mēģiniet vēlreiz."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Ģenerālis",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "संग्रहित",
|
||||
"member-column": "सदस्य",
|
||||
"active": "सक्रिय",
|
||||
"summary-column": "सारांश"
|
||||
"summary-column": "सारांश",
|
||||
"export-memos": "मेमो निर्यात करा"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "माझे खाते"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "तुमच्या खात्यात आधीच आहे",
|
||||
"review-exported": "यांच्याद्वारे निर्यात केले",
|
||||
"review-memos": "फाइलमध्ये मेमो",
|
||||
"review-new": "तयार केले जाईल"
|
||||
"review-new": "तयार केले जाईल",
|
||||
"export-admin-only": "फक्त प्रशासक मेमो निर्यात करू शकतात. तुमच्या निर्यात फाइलसाठी प्रशासकाला विचारा.",
|
||||
"export-busy": "दुसरी निर्यात सुरू आहे. थोड्या वेळाने पुन्हा प्रयत्न करा."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "सामान्य",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktiv",
|
||||
"archived": "Arkivert",
|
||||
"member-column": "Medlem",
|
||||
"summary-column": "Sammendrag"
|
||||
"summary-column": "Sammendrag",
|
||||
"export-memos": "Eksporter notater"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Allerede i kontoen din",
|
||||
"review-exported": "Eksportert av",
|
||||
"review-memos": "Memoer i filen",
|
||||
"review-new": "Vil bli opprettet"
|
||||
"review-new": "Vil bli opprettet",
|
||||
"export-admin-only": "Bare administratorer kan eksportere notater. Be en administrator om eksportfilen din.",
|
||||
"export-busy": "En annen eksport kjører. Prøv igjen om et øyeblikk."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Generelt",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Actief",
|
||||
"archived": "Gearchiveerd",
|
||||
"member-column": "Lid",
|
||||
"summary-column": "Samenvatting"
|
||||
"summary-column": "Samenvatting",
|
||||
"export-memos": "Memo's exporteren"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Al in uw account",
|
||||
"review-exported": "Geëxporteerd door",
|
||||
"review-memos": "Memos in bestand",
|
||||
"review-new": "Wordt aangemaakt"
|
||||
"review-new": "Wordt aangemaakt",
|
||||
"export-admin-only": "Alleen beheerders kunnen memo's exporteren. Vraag een beheerder om je exportbestand.",
|
||||
"export-busy": "Er loopt al een andere export. Probeer het zo opnieuw."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Algemeen",
|
||||
|
||||
@@ -643,7 +643,8 @@
|
||||
"no-members-found": "Ingen medlemer funne",
|
||||
"restore-success": "{{username}} er gjenoppretta",
|
||||
"summary-column": "Samandrag",
|
||||
"user": "Brukar"
|
||||
"user": "Brukar",
|
||||
"export-memos": "Eksporter notat"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Legg til reaksjon",
|
||||
@@ -693,7 +694,9 @@
|
||||
"review-exported": "Eksportert av",
|
||||
"review-file": "Fil",
|
||||
"review-memos": "Notat i fila",
|
||||
"review-new": "Vert oppretta"
|
||||
"review-new": "Vert oppretta",
|
||||
"export-admin-only": "Berre administratorar kan eksportere notat. Be ein administrator om eksportfila di.",
|
||||
"export-busy": "Ein annan eksport køyrer. Prøv igjen om ei lita stund."
|
||||
},
|
||||
"memo-view": {
|
||||
"change-icon": "Endre visingsikon",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktywny",
|
||||
"archived": "Zarchiwizowane",
|
||||
"member-column": "Członek",
|
||||
"summary-column": "Streszczenie"
|
||||
"summary-column": "Streszczenie",
|
||||
"export-memos": "Eksportuj notatki"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Notatki",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Już na Twoim koncie",
|
||||
"review-exported": "Wyeksportowano przez",
|
||||
"review-memos": "Notatki w pliku",
|
||||
"review-new": "Zostanie utworzone"
|
||||
"review-new": "Zostanie utworzone",
|
||||
"export-admin-only": "Tylko administratorzy mogą eksportować notatki. Poproś administratora o plik eksportu.",
|
||||
"export-busy": "Trwa inny eksport. Spróbuj ponownie za chwilę."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Ogólne",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "Arquivo",
|
||||
"member-column": "Membro",
|
||||
"active": "Ativo",
|
||||
"summary-column": "Resumo"
|
||||
"summary-column": "Resumo",
|
||||
"export-memos": "Exportar memos"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "Minha conta"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "Já está na sua conta",
|
||||
"review-exported": "Exportado por",
|
||||
"review-memos": "Memos no arquivo",
|
||||
"review-new": "Será criado"
|
||||
"review-new": "Será criado",
|
||||
"export-admin-only": "Somente administradores podem exportar memos. Peça seu arquivo de exportação a um administrador.",
|
||||
"export-busy": "Outra exportação está em andamento. Tente novamente em instantes."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Geral",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Ativa",
|
||||
"archived": "Arquivada",
|
||||
"member-column": "Membro",
|
||||
"summary-column": "Resumo"
|
||||
"summary-column": "Resumo",
|
||||
"export-memos": "Exportar memos"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Memo",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Já está na sua conta",
|
||||
"review-exported": "Exportado por",
|
||||
"review-memos": "Memos no ficheiro",
|
||||
"review-new": "Será criado"
|
||||
"review-new": "Será criado",
|
||||
"export-admin-only": "Apenas administradores podem exportar memos. Peça o seu ficheiro de exportação a um administrador.",
|
||||
"export-busy": "Está a decorrer outra exportação. Tente novamente dentro de momentos."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Geral",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} a fost restaurat cu succes",
|
||||
"summary-column": "Rezumat",
|
||||
"user": "Utilizator",
|
||||
"no-members-found": "Nu s-au găsit membri"
|
||||
"no-members-found": "Nu s-au găsit membri",
|
||||
"export-memos": "Exportă notițele"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Adăugați reacția",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Deja în contul dvs.",
|
||||
"review-exported": "Exportat de",
|
||||
"review-memos": "Memos în fișier",
|
||||
"review-new": "Va fi creat"
|
||||
"review-new": "Va fi creat",
|
||||
"export-admin-only": "Doar administratorii pot exporta notițe. Cere-i unui administrator fișierul tău de export.",
|
||||
"export-busy": "Un alt export este în curs. Încearcă din nou peste câteva momente."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "General",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Активный",
|
||||
"archived": "В архиве",
|
||||
"member-column": "Член",
|
||||
"summary-column": "Краткое содержание"
|
||||
"summary-column": "Краткое содержание",
|
||||
"export-memos": "Экспортировать заметки"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Заметки",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Уже в вашей учетной записи",
|
||||
"review-exported": "Экспортировано пользователем",
|
||||
"review-memos": "Заметки в файле",
|
||||
"review-new": "Будет создано"
|
||||
"review-new": "Будет создано",
|
||||
"export-admin-only": "Экспортировать заметки могут только администраторы. Запросите файл экспорта у администратора.",
|
||||
"export-busy": "Уже выполняется другой экспорт. Повторите попытку чуть позже."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Общие",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} bol úspešne obnovený",
|
||||
"summary-column": "Zhrnutie",
|
||||
"user": "Používateľ",
|
||||
"no-members-found": "Nenašli sa žiadni členovia"
|
||||
"no-members-found": "Nenašli sa žiadni členovia",
|
||||
"export-memos": "Exportovať poznámky"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Pridajte reakciu",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Už vo vašom účte",
|
||||
"review-exported": "Exportované používateľom",
|
||||
"review-memos": "Memos v súbore",
|
||||
"review-new": "Bude vytvorené"
|
||||
"review-new": "Bude vytvorené",
|
||||
"export-admin-only": "Poznámky môžu exportovať iba správcovia. Požiadajte správcu o svoj exportný súbor.",
|
||||
"export-busy": "Práve prebieha iný export. Skúste to o chvíľu znova."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "generál",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktiven",
|
||||
"archived": "Arhivirano",
|
||||
"member-column": "član",
|
||||
"summary-column": "Povzetek"
|
||||
"summary-column": "Povzetek",
|
||||
"export-memos": "Izvozi zapiske"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Beležka",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Že v vašem računu",
|
||||
"review-exported": "Izvozil/a",
|
||||
"review-memos": "Beležke v datoteki",
|
||||
"review-new": "Bo ustvarjeno"
|
||||
"review-new": "Bo ustvarjeno",
|
||||
"export-admin-only": "Zapiske lahko izvozijo samo skrbniki. Za svojo izvozno datoteko prosite skrbnika.",
|
||||
"export-busy": "Drug izvoz je v teku. Poskusite znova čez trenutek."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Splošno",
|
||||
|
||||
@@ -570,7 +570,8 @@
|
||||
"restore-success": "{{username}} је успешно враћен",
|
||||
"summary-column": "Резиме",
|
||||
"user": "Корисник",
|
||||
"no-members-found": "Није пронађен ниједан члан"
|
||||
"no-members-found": "Није пронађен ниједан члан",
|
||||
"export-memos": "Извези белешке"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "Додајте реакцију",
|
||||
@@ -927,7 +928,9 @@
|
||||
"review-existing": "Већ је на вашем налогу",
|
||||
"review-exported": "Извезено од стране",
|
||||
"review-memos": "Memos у датотеци",
|
||||
"review-new": "Биће креирано"
|
||||
"review-new": "Биће креирано",
|
||||
"export-admin-only": "Само администратори могу да извозе белешке. Затражите своју датотеку извоза од администратора.",
|
||||
"export-busy": "Други извоз је у току. Покушајте поново за тренутак."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "генерал",
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Aktiv",
|
||||
"archived": "Arkiverad",
|
||||
"member-column": "Medlem",
|
||||
"summary-column": "Sammanfattning"
|
||||
"summary-column": "Sammanfattning",
|
||||
"export-memos": "Exportera anteckningar"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Anteckning",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Redan i ditt konto",
|
||||
"review-exported": "Exporterad av",
|
||||
"review-memos": "Anteckningar i filen",
|
||||
"review-new": "Kommer att skapas"
|
||||
"review-new": "Kommer att skapas",
|
||||
"export-admin-only": "Endast administratörer kan exportera anteckningar. Be en administratör om din exportfil.",
|
||||
"export-busy": "En annan export pågår. Försök igen om en stund."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Allmänt",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "เก็บถาวรแล้ว",
|
||||
"member-column": "สมาชิก",
|
||||
"active": "ใช้งานอยู่",
|
||||
"summary-column": "สรุป"
|
||||
"summary-column": "สรุป",
|
||||
"export-memos": "ส่งออกบันทึก"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "บัญชีผู้ใช้ของฉัน"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "มีอยู่ในบัญชีของคุณแล้ว",
|
||||
"review-exported": "ส่งออกโดย",
|
||||
"review-memos": "บันทึกช่วยจำ ในไฟล์",
|
||||
"review-new": "จะถูกสร้าง"
|
||||
"review-new": "จะถูกสร้าง",
|
||||
"export-admin-only": "มีเพียงผู้ดูแลระบบเท่านั้นที่ส่งออกบันทึกได้ โปรดขอไฟล์ส่งออกจากผู้ดูแลระบบ",
|
||||
"export-busy": "มีการส่งออกอื่นกำลังทำงานอยู่ โปรดลองอีกครั้งในอีกสักครู่"
|
||||
},
|
||||
"spaces": {
|
||||
"general": "ทั่วไป",
|
||||
|
||||
@@ -529,7 +529,8 @@
|
||||
"active": "Aktif",
|
||||
"archived": "Arşivlendi",
|
||||
"member-column": "Üye",
|
||||
"summary-column": "Özet"
|
||||
"summary-column": "Özet",
|
||||
"export-memos": "Notları dışa aktar"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Not",
|
||||
@@ -579,7 +580,9 @@
|
||||
"review-exported": "Dışa aktaran",
|
||||
"review-file": "Dosya",
|
||||
"review-memos": "Dosyadaki notlar",
|
||||
"review-new": "Oluşturulacak"
|
||||
"review-new": "Oluşturulacak",
|
||||
"export-admin-only": "Notları yalnızca yöneticiler dışa aktarabilir. Dışa aktarma dosyanızı bir yöneticiden isteyin.",
|
||||
"export-busy": "Başka bir dışa aktarma sürüyor. Biraz sonra yeniden deneyin."
|
||||
},
|
||||
"my-account": {
|
||||
"label": "Hesabım"
|
||||
|
||||
@@ -489,7 +489,8 @@
|
||||
"active": "Активний",
|
||||
"archived": "Архівовано",
|
||||
"member-column": "Член",
|
||||
"summary-column": "Резюме"
|
||||
"summary-column": "Резюме",
|
||||
"export-memos": "Експортувати нотатки"
|
||||
},
|
||||
"memo": {
|
||||
"label": "Нотатка",
|
||||
@@ -889,7 +890,9 @@
|
||||
"review-existing": "Вже у вашому обліковому записі",
|
||||
"review-exported": "Експортовано користувачем",
|
||||
"review-memos": "Нотатки в файлі",
|
||||
"review-new": "Буде створено"
|
||||
"review-new": "Буде створено",
|
||||
"export-admin-only": "Експортувати нотатки можуть лише адміністратори. Запитайте файл експорту в адміністратора.",
|
||||
"export-busy": "Уже виконується інший експорт. Спробуйте ще раз за мить."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Загальні",
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
"archived": "Đã lưu trữ",
|
||||
"member-column": "Thành viên",
|
||||
"active": "Đang hoạt động",
|
||||
"summary-column": "Tóm tắt"
|
||||
"summary-column": "Tóm tắt",
|
||||
"export-memos": "Xuất ghi chú"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "Tài khoản của tôi"
|
||||
@@ -831,7 +832,9 @@
|
||||
"review-existing": "Đã có trong tài khoản của bạn",
|
||||
"review-exported": "Được xuất bởi",
|
||||
"review-memos": "Ghi chú trong tệp",
|
||||
"review-new": "Sẽ được tạo"
|
||||
"review-new": "Sẽ được tạo",
|
||||
"export-admin-only": "Chỉ quản trị viên mới có thể xuất ghi chú. Hãy yêu cầu quản trị viên cung cấp tệp xuất của bạn.",
|
||||
"export-busy": "Một quá trình xuất khác đang chạy. Hãy thử lại sau ít phút."
|
||||
},
|
||||
"spaces": {
|
||||
"general": "Chung",
|
||||
|
||||
@@ -441,7 +441,8 @@
|
||||
"list-title": "成员列表",
|
||||
"member-column": "成员",
|
||||
"summary-column": "摘要",
|
||||
"no-members-found": "没有找到会员"
|
||||
"no-members-found": "没有找到会员",
|
||||
"export-memos": "导出备忘录"
|
||||
},
|
||||
"my-account": {
|
||||
"label": "我的账号"
|
||||
@@ -915,7 +916,9 @@
|
||||
"review-existing": "您的账户中已存在",
|
||||
"review-exported": "导出者",
|
||||
"review-memos": "文件中的备忘录",
|
||||
"review-new": "将新建"
|
||||
"review-new": "将新建",
|
||||
"export-admin-only": "只有管理员可以导出备忘录。请向管理员索取你的导出文件。",
|
||||
"export-busy": "另一个导出正在进行。请稍后再试。"
|
||||
},
|
||||
"spaces": {
|
||||
"general": "一般设置",
|
||||
|
||||
@@ -611,7 +611,8 @@
|
||||
"restore-success": "{{username}} 恢復成功",
|
||||
"summary-column": "摘要",
|
||||
"user": "使用者",
|
||||
"no-members-found": "沒有找到成員"
|
||||
"no-members-found": "沒有找到成員",
|
||||
"export-memos": "匯出備忘錄"
|
||||
},
|
||||
"memo": {
|
||||
"add-reaction": "新增表情回應",
|
||||
@@ -1049,7 +1050,9 @@
|
||||
"review-existing": "您的帳號中已存在",
|
||||
"review-exported": "匯出者",
|
||||
"review-memos": "檔案中的備忘錄",
|
||||
"review-new": "將建立"
|
||||
"review-new": "將建立",
|
||||
"export-admin-only": "只有管理員可以匯出備忘錄。請向管理員索取你的匯出檔案。",
|
||||
"export-busy": "另一個匯出正在進行。請稍後再試。"
|
||||
}
|
||||
},
|
||||
"space": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,13 +3,12 @@ import { resolve } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { exportMemos, stageMemoImport } from "@/lib/memo-export";
|
||||
|
||||
const { exportRequest, importRequest, download } = vi.hoisted(() => ({
|
||||
exportRequest: vi.fn(),
|
||||
const { importRequest, download } = vi.hoisted(() => ({
|
||||
importRequest: vi.fn(),
|
||||
download: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/connect", () => ({ userServiceClient: { exportMemos: exportRequest, importMemos: importRequest } }));
|
||||
vi.mock("@/connect", () => ({ userServiceClient: { importMemos: importRequest } }));
|
||||
vi.mock("@/lib/browser", () => ({ downloadFileFromUrl: download }));
|
||||
|
||||
describe("memo export files", () => {
|
||||
@@ -19,24 +18,55 @@ describe("memo export files", () => {
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it("downloads a ZIP with the export name and releases its object URL", async () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2026-09-20T08:30:00Z"));
|
||||
const createURL = vi.spyOn(URL, "createObjectURL").mockReturnValue("blob:export");
|
||||
const revokeURL = vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {});
|
||||
exportRequest.mockResolvedValue({ contentType: "application/vnd.usememos.export+zip", data: new Uint8Array([80, 75]) });
|
||||
it("preflights the export route with HEAD and hands the download to the browser", async () => {
|
||||
const fetchSpy = vi.spyOn(globalThis, "fetch").mockResolvedValue(
|
||||
new Response(null, {
|
||||
status: 200,
|
||||
headers: { "Content-Disposition": "attachment; filename=memos-export-alice-20260920T083000Z.zip" },
|
||||
}),
|
||||
);
|
||||
|
||||
await exportMemos("users/alice", "alice");
|
||||
await exportMemos("alice");
|
||||
|
||||
expect(exportRequest).toHaveBeenCalledWith({ name: "users/alice" });
|
||||
expect(createURL.mock.calls[0][0]).toMatchObject({ type: "application/vnd.usememos.export+zip", size: 2 });
|
||||
expect(download).toHaveBeenCalledWith("blob:export", "memos-export-alice-20260920T083000Z.zip");
|
||||
expect(revokeURL).not.toHaveBeenCalled();
|
||||
await vi.runAllTimersAsync();
|
||||
expect(revokeURL).toHaveBeenCalledWith("blob:export");
|
||||
expect(fetchSpy).toHaveBeenCalledWith("/file/users/alice/export", { method: "HEAD", credentials: "same-origin" });
|
||||
expect(download).toHaveBeenCalledWith("/file/users/alice/export", "memos-export-alice-20260920T083000Z.zip");
|
||||
});
|
||||
|
||||
it("keeps a filename that is not percent-encoded as sent", async () => {
|
||||
vi.spyOn(globalThis, "fetch").mockResolvedValue(
|
||||
new Response(null, {
|
||||
status: 200,
|
||||
headers: { "Content-Disposition": 'attachment; filename="memos-export-100%25-20260920T083000Z.zip"' },
|
||||
}),
|
||||
);
|
||||
await exportMemos("100%");
|
||||
expect(download).toHaveBeenCalledWith("/file/users/100%25/export", "memos-export-100%-20260920T083000Z.zip");
|
||||
|
||||
vi.spyOn(globalThis, "fetch").mockResolvedValue(
|
||||
new Response(null, {
|
||||
status: 200,
|
||||
headers: { "Content-Disposition": 'attachment; filename="memos-export-50%-20260920T083000Z.zip"' },
|
||||
}),
|
||||
);
|
||||
await exportMemos("50%");
|
||||
expect(download).toHaveBeenLastCalledWith("/file/users/50%25/export", "memos-export-50%-20260920T083000Z.zip");
|
||||
});
|
||||
|
||||
it("reports a refused preflight with its status instead of downloading", async () => {
|
||||
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(null, { status: 429 }));
|
||||
|
||||
await expect(exportMemos("alice")).rejects.toMatchObject({ name: "MemoExportError", status: 429 });
|
||||
expect(download).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("escapes the username in the route", async () => {
|
||||
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(null, { status: 200 }));
|
||||
|
||||
await exportMemos("a b");
|
||||
|
||||
expect(download).toHaveBeenCalledWith("/file/users/a%20b/export", "memos-export-a b.zip");
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
Reference in New Issue
Block a user