Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
19e7731a
Unverified
Commit
19e7731a
authored
Aug 20, 2023
by
boojack
Committed by
GitHub
Aug 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: generate ts definition (#2156)
* chore: generate ts definition * chore: update
parent
609b24f2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
989 additions
and
9 deletions
+989
-9
memos.go
cmd/memos.go
+19
-7
logger.go
common/log/logger.go
+0
-1
buf.gen.yaml
proto/buf.gen.yaml
+3
-0
backup.go
server/backup.go
+1
-1
common_pb.d.ts
web/src/types/proto/api/v2/common_pb.d.ts
+25
-0
common_pb.js
web/src/types/proto/api/v2/common_pb.js
+19
-0
memo_service_pb.d.ts
web/src/types/proto/api/v2/memo_service_pb.d.ts
+206
-0
memo_service_pb.js
web/src/types/proto/api/v2/memo_service_pb.js
+81
-0
system_service_pb.d.ts
web/src/types/proto/api/v2/system_service_pb.d.ts
+105
-0
system_service_pb.js
web/src/types/proto/api/v2/system_service_pb.js
+41
-0
tag_service_pb.d.ts
web/src/types/proto/api/v2/tag_service_pb.d.ts
+85
-0
tag_service_pb.js
web/src/types/proto/api/v2/tag_service_pb.js
+38
-0
user_service_pb.d.ts
web/src/types/proto/api/v2/user_service_pb.d.ts
+268
-0
user_service_pb.js
web/src/types/proto/api/v2/user_service_pb.js
+98
-0
No files found.
cmd/memos.go
View file @
19e7731a
...
@@ -10,11 +10,12 @@ import (
...
@@ -10,11 +10,12 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/spf13/viper"
"github.com/usememos/memos/common/log"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server"
_profile
"github.com/usememos/memos/server/profile"
_profile
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store/db"
"github.com/usememos/memos/store/db"
"go.uber.org/zap"
)
)
const
(
const
(
...
@@ -42,7 +43,7 @@ var (
...
@@ -42,7 +43,7 @@ var (
db
:=
db
.
NewDB
(
profile
)
db
:=
db
.
NewDB
(
profile
)
if
err
:=
db
.
Open
(
ctx
);
err
!=
nil
{
if
err
:=
db
.
Open
(
ctx
);
err
!=
nil
{
cancel
()
cancel
()
fmt
.
Printf
(
"failed to open db, error: %+v
\n
"
,
err
)
log
.
Error
(
"failed to open db"
,
zap
.
Error
(
err
)
)
return
return
}
}
...
@@ -50,7 +51,7 @@ var (
...
@@ -50,7 +51,7 @@ var (
s
,
err
:=
server
.
NewServer
(
ctx
,
profile
,
store
)
s
,
err
:=
server
.
NewServer
(
ctx
,
profile
,
store
)
if
err
!=
nil
{
if
err
!=
nil
{
cancel
()
cancel
()
fmt
.
Printf
(
"failed to create server, error: %+v
\n
"
,
err
)
log
.
Error
(
"failed to create server"
,
zap
.
Error
(
err
)
)
return
return
}
}
...
@@ -61,16 +62,16 @@ var (
...
@@ -61,16 +62,16 @@ var (
signal
.
Notify
(
c
,
os
.
Interrupt
,
syscall
.
SIGTERM
)
signal
.
Notify
(
c
,
os
.
Interrupt
,
syscall
.
SIGTERM
)
go
func
()
{
go
func
()
{
sig
:=
<-
c
sig
:=
<-
c
fmt
.
Printf
(
"%s received.
\n
"
,
sig
.
String
(
))
log
.
Info
(
fmt
.
Sprintf
(
"%s received.
\n
"
,
sig
.
String
()
))
s
.
Shutdown
(
ctx
)
s
.
Shutdown
(
ctx
)
cancel
()
cancel
()
}()
}()
print
ln
(
greetingBanner
)
print
Greetings
(
)
fmt
.
Printf
(
"Version %s has started at :%d
\n
"
,
profile
.
Version
,
profile
.
Port
)
if
err
:=
s
.
Start
(
ctx
);
err
!=
nil
{
if
err
:=
s
.
Start
(
ctx
);
err
!=
nil
{
if
err
!=
http
.
ErrServerClosed
{
if
err
!=
http
.
ErrServerClosed
{
fmt
.
Printf
(
"failed to start server, error: %+v
\n
"
,
err
)
log
.
Error
(
"failed to start server"
,
zap
.
Error
(
err
)
)
cancel
()
cancel
()
}
}
}
}
...
@@ -82,6 +83,7 @@ var (
...
@@ -82,6 +83,7 @@ var (
)
)
func
Execute
()
error
{
func
Execute
()
error
{
defer
log
.
Sync
()
return
rootCmd
.
Execute
()
return
rootCmd
.
Execute
()
}
}
...
@@ -127,3 +129,13 @@ func initConfig() {
...
@@ -127,3 +129,13 @@ func initConfig() {
println
(
"version:"
,
profile
.
Version
)
println
(
"version:"
,
profile
.
Version
)
println
(
"---"
)
println
(
"---"
)
}
}
func
printGreetings
()
{
fmt
.
Print
(
greetingBanner
)
fmt
.
Printf
(
"Version %s has been started on port %d
\n
"
,
profile
.
Version
,
profile
.
Port
)
fmt
.
Println
(
"---"
)
fmt
.
Println
(
"See more in:"
)
fmt
.
Printf
(
"👉Website: %s
\n
"
,
"https://usememos.com"
)
fmt
.
Printf
(
"👉GitHub: %s
\n
"
,
"https://github.com/usememos/memos"
)
fmt
.
Println
(
"---"
)
}
common/log/logger.go
View file @
19e7731a
// Package log implements a simple logging package.
package
log
package
log
import
(
import
(
...
...
proto/buf.gen.yaml
View file @
19e7731a
...
@@ -18,6 +18,9 @@ plugins:
...
@@ -18,6 +18,9 @@ plugins:
out
:
gen
out
:
gen
opt
:
opt
:
-
paths=source_relative
-
paths=source_relative
# Build the TypeScript definitions for the web.
-
plugin
:
buf.build/bufbuild/es:v1.3.0
out
:
../web/src/types/proto
-
plugin
:
buf.build/community/pseudomuto-doc:v1.5.1
-
plugin
:
buf.build/community/pseudomuto-doc:v1.5.1
out
:
gen
out
:
gen
opt
:
opt
:
...
...
server/backup.go
View file @
19e7731a
...
@@ -25,7 +25,7 @@ func NewBackupRunner(store *store.Store) *BackupRunner {
...
@@ -25,7 +25,7 @@ func NewBackupRunner(store *store.Store) *BackupRunner {
func
(
r
*
BackupRunner
)
Run
(
ctx
context
.
Context
)
{
func
(
r
*
BackupRunner
)
Run
(
ctx
context
.
Context
)
{
intervalStr
:=
r
.
Store
.
GetSystemSettingValueWithDefault
(
&
ctx
,
apiv1
.
SystemSettingAutoBackupIntervalName
.
String
(),
""
)
intervalStr
:=
r
.
Store
.
GetSystemSettingValueWithDefault
(
&
ctx
,
apiv1
.
SystemSettingAutoBackupIntervalName
.
String
(),
""
)
if
intervalStr
==
""
{
if
intervalStr
==
""
{
log
.
Info
(
"no SystemSettingAutoBackupIntervalName setting, disable auto backup"
)
log
.
Debug
(
"no SystemSettingAutoBackupIntervalName setting, disable auto backup"
)
return
return
}
}
...
...
web/src/types/proto/api/v2/common_pb.d.ts
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/common.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
/**
* @generated from enum memos.api.v2.RowStatus
*/
export
declare
enum
RowStatus
{
/**
* @generated from enum value: ROW_STATUS_UNSPECIFIED = 0;
*/
ROW_STATUS_UNSPECIFIED
=
0
,
/**
* @generated from enum value: ACTIVE = 1;
*/
ACTIVE
=
1
,
/**
* @generated from enum value: ARCHIVED = 2;
*/
ARCHIVED
=
2
,
}
web/src/types/proto/api/v2/common_pb.js
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/common.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
{
proto3
}
from
"@bufbuild/protobuf"
;
/**
* @generated from enum memos.api.v2.RowStatus
*/
export
const
RowStatus
=
proto3
.
makeEnum
(
"memos.api.v2.RowStatus"
,
[
{
no
:
0
,
name
:
"ROW_STATUS_UNSPECIFIED"
},
{
no
:
1
,
name
:
"ACTIVE"
},
{
no
:
2
,
name
:
"ARCHIVED"
},
],
);
web/src/types/proto/api/v2/memo_service_pb.d.ts
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/memo_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
type
{
BinaryReadOptions
,
FieldList
,
JsonReadOptions
,
JsonValue
,
PartialMessage
,
PlainMessage
}
from
"@bufbuild/protobuf"
;
import
{
Message
,
proto3
}
from
"@bufbuild/protobuf"
;
import
type
{
RowStatus
}
from
"./common_pb.js"
;
/**
* @generated from enum memos.api.v2.Visibility
*/
export
declare
enum
Visibility
{
/**
* @generated from enum value: VISIBILITY_UNSPECIFIED = 0;
*/
VISIBILITY_UNSPECIFIED
=
0
,
/**
* @generated from enum value: PRIVATE = 1;
*/
PRIVATE
=
1
,
/**
* @generated from enum value: PROTECTED = 2;
*/
PROTECTED
=
2
,
/**
* @generated from enum value: PUBLIC = 3;
*/
PUBLIC
=
3
,
}
/**
* @generated from message memos.api.v2.Memo
*/
export
declare
class
Memo
extends
Message
<
Memo
>
{
/**
* @generated from field: int32 id = 1;
*/
id
:
number
;
/**
* @generated from field: memos.api.v2.RowStatus row_status = 2;
*/
rowStatus
:
RowStatus
;
/**
* @generated from field: int32 creator_id = 3;
*/
creatorId
:
number
;
/**
* @generated from field: int64 created_ts = 4;
*/
createdTs
:
bigint
;
/**
* @generated from field: int64 updated_ts = 5;
*/
updatedTs
:
bigint
;
/**
* @generated from field: string content = 6;
*/
content
:
string
;
/**
* @generated from field: memos.api.v2.Visibility visibility = 7;
*/
visibility
:
Visibility
;
/**
* @generated from field: bool pinned = 8;
*/
pinned
:
boolean
;
constructor
(
data
?:
PartialMessage
<
Memo
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.Memo"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
Memo
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
Memo
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
Memo
;
static
equals
(
a
:
Memo
|
PlainMessage
<
Memo
>
|
undefined
,
b
:
Memo
|
PlainMessage
<
Memo
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.ListMemosRequest
*/
export
declare
class
ListMemosRequest
extends
Message
<
ListMemosRequest
>
{
/**
* @generated from field: int32 page = 1;
*/
page
:
number
;
/**
* @generated from field: int32 page_size = 2;
*/
pageSize
:
number
;
/**
* Filter is used to filter memos returned in the list.
*
* @generated from field: string filter = 3;
*/
filter
:
string
;
constructor
(
data
?:
PartialMessage
<
ListMemosRequest
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.ListMemosRequest"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
ListMemosRequest
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
ListMemosRequest
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
ListMemosRequest
;
static
equals
(
a
:
ListMemosRequest
|
PlainMessage
<
ListMemosRequest
>
|
undefined
,
b
:
ListMemosRequest
|
PlainMessage
<
ListMemosRequest
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.ListMemosResponse
*/
export
declare
class
ListMemosResponse
extends
Message
<
ListMemosResponse
>
{
/**
* @generated from field: repeated memos.api.v2.Memo memos = 1;
*/
memos
:
Memo
[];
/**
* @generated from field: int32 total = 2;
*/
total
:
number
;
constructor
(
data
?:
PartialMessage
<
ListMemosResponse
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.ListMemosResponse"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
ListMemosResponse
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
ListMemosResponse
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
ListMemosResponse
;
static
equals
(
a
:
ListMemosResponse
|
PlainMessage
<
ListMemosResponse
>
|
undefined
,
b
:
ListMemosResponse
|
PlainMessage
<
ListMemosResponse
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetMemoRequest
*/
export
declare
class
GetMemoRequest
extends
Message
<
GetMemoRequest
>
{
/**
* @generated from field: int32 id = 1;
*/
id
:
number
;
constructor
(
data
?:
PartialMessage
<
GetMemoRequest
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetMemoRequest"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetMemoRequest
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetMemoRequest
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetMemoRequest
;
static
equals
(
a
:
GetMemoRequest
|
PlainMessage
<
GetMemoRequest
>
|
undefined
,
b
:
GetMemoRequest
|
PlainMessage
<
GetMemoRequest
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetMemoResponse
*/
export
declare
class
GetMemoResponse
extends
Message
<
GetMemoResponse
>
{
/**
* @generated from field: memos.api.v2.Memo memo = 1;
*/
memo
?:
Memo
;
constructor
(
data
?:
PartialMessage
<
GetMemoResponse
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetMemoResponse"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetMemoResponse
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetMemoResponse
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetMemoResponse
;
static
equals
(
a
:
GetMemoResponse
|
PlainMessage
<
GetMemoResponse
>
|
undefined
,
b
:
GetMemoResponse
|
PlainMessage
<
GetMemoResponse
>
|
undefined
):
boolean
;
}
web/src/types/proto/api/v2/memo_service_pb.js
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/memo_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
{
proto3
}
from
"@bufbuild/protobuf"
;
import
{
RowStatus
}
from
"./common_pb.js"
;
/**
* @generated from enum memos.api.v2.Visibility
*/
export
const
Visibility
=
proto3
.
makeEnum
(
"memos.api.v2.Visibility"
,
[
{
no
:
0
,
name
:
"VISIBILITY_UNSPECIFIED"
},
{
no
:
1
,
name
:
"PRIVATE"
},
{
no
:
2
,
name
:
"PROTECTED"
},
{
no
:
3
,
name
:
"PUBLIC"
},
],
);
/**
* @generated from message memos.api.v2.Memo
*/
export
const
Memo
=
proto3
.
makeMessageType
(
"memos.api.v2.Memo"
,
()
=>
[
{
no
:
1
,
name
:
"id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
2
,
name
:
"row_status"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
RowStatus
)
},
{
no
:
3
,
name
:
"creator_id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
4
,
name
:
"created_ts"
,
kind
:
"scalar"
,
T
:
3
/* ScalarType.INT64 */
},
{
no
:
5
,
name
:
"updated_ts"
,
kind
:
"scalar"
,
T
:
3
/* ScalarType.INT64 */
},
{
no
:
6
,
name
:
"content"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
7
,
name
:
"visibility"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
Visibility
)
},
{
no
:
8
,
name
:
"pinned"
,
kind
:
"scalar"
,
T
:
8
/* ScalarType.BOOL */
},
],
);
/**
* @generated from message memos.api.v2.ListMemosRequest
*/
export
const
ListMemosRequest
=
proto3
.
makeMessageType
(
"memos.api.v2.ListMemosRequest"
,
()
=>
[
{
no
:
1
,
name
:
"page"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
2
,
name
:
"page_size"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
3
,
name
:
"filter"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
],
);
/**
* @generated from message memos.api.v2.ListMemosResponse
*/
export
const
ListMemosResponse
=
proto3
.
makeMessageType
(
"memos.api.v2.ListMemosResponse"
,
()
=>
[
{
no
:
1
,
name
:
"memos"
,
kind
:
"message"
,
T
:
Memo
,
repeated
:
true
},
{
no
:
2
,
name
:
"total"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
],
);
/**
* @generated from message memos.api.v2.GetMemoRequest
*/
export
const
GetMemoRequest
=
proto3
.
makeMessageType
(
"memos.api.v2.GetMemoRequest"
,
()
=>
[
{
no
:
1
,
name
:
"id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
],
);
/**
* @generated from message memos.api.v2.GetMemoResponse
*/
export
const
GetMemoResponse
=
proto3
.
makeMessageType
(
"memos.api.v2.GetMemoResponse"
,
()
=>
[
{
no
:
1
,
name
:
"memo"
,
kind
:
"message"
,
T
:
Memo
},
],
);
web/src/types/proto/api/v2/system_service_pb.d.ts
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/system_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
type
{
BinaryReadOptions
,
FieldList
,
JsonReadOptions
,
JsonValue
,
PartialMessage
,
PlainMessage
}
from
"@bufbuild/protobuf"
;
import
{
Message
,
proto3
}
from
"@bufbuild/protobuf"
;
/**
* @generated from message memos.api.v2.SystemInfo
*/
export
declare
class
SystemInfo
extends
Message
<
SystemInfo
>
{
/**
* @generated from field: string version = 1;
*/
version
:
string
;
/**
* @generated from field: string mode = 2;
*/
mode
:
string
;
/**
* @generated from field: bool allow_registration = 3;
*/
allowRegistration
:
boolean
;
/**
* @generated from field: bool disable_password_login = 4;
*/
disablePasswordLogin
:
boolean
;
/**
* @generated from field: string additional_script = 5;
*/
additionalScript
:
string
;
/**
* @generated from field: string additional_style = 6;
*/
additionalStyle
:
string
;
/**
* @generated from field: int64 db_size = 7;
*/
dbSize
:
bigint
;
constructor
(
data
?:
PartialMessage
<
SystemInfo
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.SystemInfo"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
SystemInfo
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
SystemInfo
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
SystemInfo
;
static
equals
(
a
:
SystemInfo
|
PlainMessage
<
SystemInfo
>
|
undefined
,
b
:
SystemInfo
|
PlainMessage
<
SystemInfo
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetSystemInfoRequest
*/
export
declare
class
GetSystemInfoRequest
extends
Message
<
GetSystemInfoRequest
>
{
constructor
(
data
?:
PartialMessage
<
GetSystemInfoRequest
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetSystemInfoRequest"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetSystemInfoRequest
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetSystemInfoRequest
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetSystemInfoRequest
;
static
equals
(
a
:
GetSystemInfoRequest
|
PlainMessage
<
GetSystemInfoRequest
>
|
undefined
,
b
:
GetSystemInfoRequest
|
PlainMessage
<
GetSystemInfoRequest
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetSystemInfoResponse
*/
export
declare
class
GetSystemInfoResponse
extends
Message
<
GetSystemInfoResponse
>
{
/**
* @generated from field: memos.api.v2.SystemInfo system_info = 1;
*/
systemInfo
?:
SystemInfo
;
constructor
(
data
?:
PartialMessage
<
GetSystemInfoResponse
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetSystemInfoResponse"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetSystemInfoResponse
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetSystemInfoResponse
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetSystemInfoResponse
;
static
equals
(
a
:
GetSystemInfoResponse
|
PlainMessage
<
GetSystemInfoResponse
>
|
undefined
,
b
:
GetSystemInfoResponse
|
PlainMessage
<
GetSystemInfoResponse
>
|
undefined
):
boolean
;
}
web/src/types/proto/api/v2/system_service_pb.js
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/system_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
{
proto3
}
from
"@bufbuild/protobuf"
;
/**
* @generated from message memos.api.v2.SystemInfo
*/
export
const
SystemInfo
=
proto3
.
makeMessageType
(
"memos.api.v2.SystemInfo"
,
()
=>
[
{
no
:
1
,
name
:
"version"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
2
,
name
:
"mode"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
3
,
name
:
"allow_registration"
,
kind
:
"scalar"
,
T
:
8
/* ScalarType.BOOL */
},
{
no
:
4
,
name
:
"disable_password_login"
,
kind
:
"scalar"
,
T
:
8
/* ScalarType.BOOL */
},
{
no
:
5
,
name
:
"additional_script"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
6
,
name
:
"additional_style"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
7
,
name
:
"db_size"
,
kind
:
"scalar"
,
T
:
3
/* ScalarType.INT64 */
},
],
);
/**
* @generated from message memos.api.v2.GetSystemInfoRequest
*/
export
const
GetSystemInfoRequest
=
proto3
.
makeMessageType
(
"memos.api.v2.GetSystemInfoRequest"
,
[],
);
/**
* @generated from message memos.api.v2.GetSystemInfoResponse
*/
export
const
GetSystemInfoResponse
=
proto3
.
makeMessageType
(
"memos.api.v2.GetSystemInfoResponse"
,
()
=>
[
{
no
:
1
,
name
:
"system_info"
,
kind
:
"message"
,
T
:
SystemInfo
},
],
);
web/src/types/proto/api/v2/tag_service_pb.d.ts
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/tag_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
type
{
BinaryReadOptions
,
FieldList
,
JsonReadOptions
,
JsonValue
,
PartialMessage
,
PlainMessage
}
from
"@bufbuild/protobuf"
;
import
{
Message
,
proto3
}
from
"@bufbuild/protobuf"
;
/**
* @generated from message memos.api.v2.Tag
*/
export
declare
class
Tag
extends
Message
<
Tag
>
{
/**
* @generated from field: string name = 1;
*/
name
:
string
;
/**
* @generated from field: int32 creator_id = 2;
*/
creatorId
:
number
;
constructor
(
data
?:
PartialMessage
<
Tag
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.Tag"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
Tag
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
Tag
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
Tag
;
static
equals
(
a
:
Tag
|
PlainMessage
<
Tag
>
|
undefined
,
b
:
Tag
|
PlainMessage
<
Tag
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.ListTagsRequest
*/
export
declare
class
ListTagsRequest
extends
Message
<
ListTagsRequest
>
{
/**
* @generated from field: int32 creator_id = 1;
*/
creatorId
:
number
;
constructor
(
data
?:
PartialMessage
<
ListTagsRequest
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.ListTagsRequest"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
ListTagsRequest
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
ListTagsRequest
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
ListTagsRequest
;
static
equals
(
a
:
ListTagsRequest
|
PlainMessage
<
ListTagsRequest
>
|
undefined
,
b
:
ListTagsRequest
|
PlainMessage
<
ListTagsRequest
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.ListTagsResponse
*/
export
declare
class
ListTagsResponse
extends
Message
<
ListTagsResponse
>
{
/**
* @generated from field: repeated memos.api.v2.Tag tags = 1;
*/
tags
:
Tag
[];
constructor
(
data
?:
PartialMessage
<
ListTagsResponse
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.ListTagsResponse"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
ListTagsResponse
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
ListTagsResponse
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
ListTagsResponse
;
static
equals
(
a
:
ListTagsResponse
|
PlainMessage
<
ListTagsResponse
>
|
undefined
,
b
:
ListTagsResponse
|
PlainMessage
<
ListTagsResponse
>
|
undefined
):
boolean
;
}
web/src/types/proto/api/v2/tag_service_pb.js
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/tag_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
{
proto3
}
from
"@bufbuild/protobuf"
;
/**
* @generated from message memos.api.v2.Tag
*/
export
const
Tag
=
proto3
.
makeMessageType
(
"memos.api.v2.Tag"
,
()
=>
[
{
no
:
1
,
name
:
"name"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
2
,
name
:
"creator_id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
],
);
/**
* @generated from message memos.api.v2.ListTagsRequest
*/
export
const
ListTagsRequest
=
proto3
.
makeMessageType
(
"memos.api.v2.ListTagsRequest"
,
()
=>
[
{
no
:
1
,
name
:
"creator_id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
],
);
/**
* @generated from message memos.api.v2.ListTagsResponse
*/
export
const
ListTagsResponse
=
proto3
.
makeMessageType
(
"memos.api.v2.ListTagsResponse"
,
()
=>
[
{
no
:
1
,
name
:
"tags"
,
kind
:
"message"
,
T
:
Tag
,
repeated
:
true
},
],
);
web/src/types/proto/api/v2/user_service_pb.d.ts
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/user_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
type
{
BinaryReadOptions
,
FieldList
,
JsonReadOptions
,
JsonValue
,
PartialMessage
,
PlainMessage
}
from
"@bufbuild/protobuf"
;
import
{
Message
,
proto3
}
from
"@bufbuild/protobuf"
;
import
type
{
RowStatus
}
from
"./common_pb.js"
;
import
type
{
Visibility
}
from
"./memo_service_pb.js"
;
/**
* @generated from enum memos.api.v2.Role
*/
export
declare
enum
Role
{
/**
* @generated from enum value: ROLE_UNSPECIFIED = 0;
*/
ROLE_UNSPECIFIED
=
0
,
/**
* @generated from enum value: HOST = 1;
*/
HOST
=
1
,
/**
* @generated from enum value: ADMIN = 2;
*/
ADMIN
=
2
,
/**
* @generated from enum value: USER = 3;
*/
USER
=
3
,
}
/**
* @generated from message memos.api.v2.User
*/
export
declare
class
User
extends
Message
<
User
>
{
/**
* @generated from field: int32 id = 1;
*/
id
:
number
;
/**
* @generated from field: memos.api.v2.RowStatus row_status = 2;
*/
rowStatus
:
RowStatus
;
/**
* @generated from field: int64 created_ts = 3;
*/
createdTs
:
bigint
;
/**
* @generated from field: int64 updated_ts = 4;
*/
updatedTs
:
bigint
;
/**
* @generated from field: string username = 5;
*/
username
:
string
;
/**
* @generated from field: memos.api.v2.Role role = 6;
*/
role
:
Role
;
/**
* @generated from field: string email = 7;
*/
email
:
string
;
/**
* @generated from field: string nickname = 8;
*/
nickname
:
string
;
/**
* @generated from field: string open_id = 9;
*/
openId
:
string
;
/**
* @generated from field: string avatar_url = 10;
*/
avatarUrl
:
string
;
constructor
(
data
?:
PartialMessage
<
User
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.User"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
User
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
User
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
User
;
static
equals
(
a
:
User
|
PlainMessage
<
User
>
|
undefined
,
b
:
User
|
PlainMessage
<
User
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetUserRequest
*/
export
declare
class
GetUserRequest
extends
Message
<
GetUserRequest
>
{
/**
* @generated from field: string name = 1;
*/
name
:
string
;
constructor
(
data
?:
PartialMessage
<
GetUserRequest
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetUserRequest"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetUserRequest
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetUserRequest
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetUserRequest
;
static
equals
(
a
:
GetUserRequest
|
PlainMessage
<
GetUserRequest
>
|
undefined
,
b
:
GetUserRequest
|
PlainMessage
<
GetUserRequest
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.GetUserResponse
*/
export
declare
class
GetUserResponse
extends
Message
<
GetUserResponse
>
{
/**
* @generated from field: memos.api.v2.User user = 1;
*/
user
?:
User
;
constructor
(
data
?:
PartialMessage
<
GetUserResponse
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.GetUserResponse"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
GetUserResponse
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
GetUserResponse
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
GetUserResponse
;
static
equals
(
a
:
GetUserResponse
|
PlainMessage
<
GetUserResponse
>
|
undefined
,
b
:
GetUserResponse
|
PlainMessage
<
GetUserResponse
>
|
undefined
):
boolean
;
}
/**
* @generated from message memos.api.v2.UserSetting
*/
export
declare
class
UserSetting
extends
Message
<
UserSetting
>
{
/**
* The user id of the setting.
*
* @generated from field: int32 user_id = 1;
*/
userId
:
number
;
/**
* The key of the setting.
*
* @generated from field: memos.api.v2.UserSetting.Key key = 2;
*/
key
:
UserSetting_Key
;
/**
* The value of the setting.
*
* @generated from field: memos.api.v2.UserSettingValue value = 3;
*/
value
?:
UserSettingValue
;
constructor
(
data
?:
PartialMessage
<
UserSetting
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.UserSetting"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
UserSetting
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
UserSetting
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
UserSetting
;
static
equals
(
a
:
UserSetting
|
PlainMessage
<
UserSetting
>
|
undefined
,
b
:
UserSetting
|
PlainMessage
<
UserSetting
>
|
undefined
):
boolean
;
}
/**
* @generated from enum memos.api.v2.UserSetting.Key
*/
export
declare
enum
UserSetting_Key
{
/**
* @generated from enum value: KEY_UNSPECIFIED = 0;
*/
KEY_UNSPECIFIED
=
0
,
/**
* The preferred locale.
*
* @generated from enum value: LOCALE = 1;
*/
LOCALE
=
1
,
/**
* The preferred appearance.
*
* @generated from enum value: APPEARANCE = 2;
*/
APPEARANCE
=
2
,
/**
* The default visibility of the memo when creating a new memo.
*
* @generated from enum value: MEMO_VISIBILITY = 3;
*/
MEMO_VISIBILITY
=
3
,
/**
* User's telegram id
*
* @generated from enum value: TELEGRAM_USER_ID = 4;
*/
TELEGRAM_USER_ID
=
4
,
}
/**
* @generated from message memos.api.v2.UserSettingValue
*/
export
declare
class
UserSettingValue
extends
Message
<
UserSettingValue
>
{
/**
* @generated from oneof memos.api.v2.UserSettingValue.value
*/
value
:
{
/**
* Default value as a string.
*
* @generated from field: string string_value = 1;
*/
value
:
string
;
case
:
"stringValue"
;
}
|
{
/**
* @generated from field: memos.api.v2.Visibility visibility_value = 2;
*/
value
:
Visibility
;
case
:
"visibilityValue"
;
}
|
{
case
:
undefined
;
value
?:
undefined
};
constructor
(
data
?:
PartialMessage
<
UserSettingValue
>
);
static
readonly
runtime
:
typeof
proto3
;
static
readonly
typeName
=
"memos.api.v2.UserSettingValue"
;
static
readonly
fields
:
FieldList
;
static
fromBinary
(
bytes
:
Uint8Array
,
options
?:
Partial
<
BinaryReadOptions
>
):
UserSettingValue
;
static
fromJson
(
jsonValue
:
JsonValue
,
options
?:
Partial
<
JsonReadOptions
>
):
UserSettingValue
;
static
fromJsonString
(
jsonString
:
string
,
options
?:
Partial
<
JsonReadOptions
>
):
UserSettingValue
;
static
equals
(
a
:
UserSettingValue
|
PlainMessage
<
UserSettingValue
>
|
undefined
,
b
:
UserSettingValue
|
PlainMessage
<
UserSettingValue
>
|
undefined
):
boolean
;
}
web/src/types/proto/api/v2/user_service_pb.js
0 → 100644
View file @
19e7731a
// @generated by protoc-gen-es v1.3.0
// @generated from file api/v2/user_service.proto (package memos.api.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
import
{
proto3
}
from
"@bufbuild/protobuf"
;
import
{
RowStatus
}
from
"./common_pb.js"
;
import
{
Visibility
}
from
"./memo_service_pb.js"
;
/**
* @generated from enum memos.api.v2.Role
*/
export
const
Role
=
proto3
.
makeEnum
(
"memos.api.v2.Role"
,
[
{
no
:
0
,
name
:
"ROLE_UNSPECIFIED"
},
{
no
:
1
,
name
:
"HOST"
},
{
no
:
2
,
name
:
"ADMIN"
},
{
no
:
3
,
name
:
"USER"
},
],
);
/**
* @generated from message memos.api.v2.User
*/
export
const
User
=
proto3
.
makeMessageType
(
"memos.api.v2.User"
,
()
=>
[
{
no
:
1
,
name
:
"id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
2
,
name
:
"row_status"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
RowStatus
)
},
{
no
:
3
,
name
:
"created_ts"
,
kind
:
"scalar"
,
T
:
3
/* ScalarType.INT64 */
},
{
no
:
4
,
name
:
"updated_ts"
,
kind
:
"scalar"
,
T
:
3
/* ScalarType.INT64 */
},
{
no
:
5
,
name
:
"username"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
6
,
name
:
"role"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
Role
)
},
{
no
:
7
,
name
:
"email"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
8
,
name
:
"nickname"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
9
,
name
:
"open_id"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
{
no
:
10
,
name
:
"avatar_url"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
],
);
/**
* @generated from message memos.api.v2.GetUserRequest
*/
export
const
GetUserRequest
=
proto3
.
makeMessageType
(
"memos.api.v2.GetUserRequest"
,
()
=>
[
{
no
:
1
,
name
:
"name"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
},
],
);
/**
* @generated from message memos.api.v2.GetUserResponse
*/
export
const
GetUserResponse
=
proto3
.
makeMessageType
(
"memos.api.v2.GetUserResponse"
,
()
=>
[
{
no
:
1
,
name
:
"user"
,
kind
:
"message"
,
T
:
User
},
],
);
/**
* @generated from message memos.api.v2.UserSetting
*/
export
const
UserSetting
=
proto3
.
makeMessageType
(
"memos.api.v2.UserSetting"
,
()
=>
[
{
no
:
1
,
name
:
"user_id"
,
kind
:
"scalar"
,
T
:
5
/* ScalarType.INT32 */
},
{
no
:
2
,
name
:
"key"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
UserSetting_Key
)
},
{
no
:
3
,
name
:
"value"
,
kind
:
"message"
,
T
:
UserSettingValue
},
],
);
/**
* @generated from enum memos.api.v2.UserSetting.Key
*/
export
const
UserSetting_Key
=
proto3
.
makeEnum
(
"memos.api.v2.UserSetting.Key"
,
[
{
no
:
0
,
name
:
"KEY_UNSPECIFIED"
},
{
no
:
1
,
name
:
"LOCALE"
},
{
no
:
2
,
name
:
"APPEARANCE"
},
{
no
:
3
,
name
:
"MEMO_VISIBILITY"
},
{
no
:
4
,
name
:
"TELEGRAM_USER_ID"
},
],
);
/**
* @generated from message memos.api.v2.UserSettingValue
*/
export
const
UserSettingValue
=
proto3
.
makeMessageType
(
"memos.api.v2.UserSettingValue"
,
()
=>
[
{
no
:
1
,
name
:
"string_value"
,
kind
:
"scalar"
,
T
:
9
/* ScalarType.STRING */
,
oneof
:
"value"
},
{
no
:
2
,
name
:
"visibility_value"
,
kind
:
"enum"
,
T
:
proto3
.
getEnumType
(
Visibility
),
oneof
:
"value"
},
],
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment