web-dc-api 0.0.73 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dc.min.js +15 -3
- package/dist/index.cjs.js +15 -3
- package/dist/index.d.ts +445 -23
- package/dist/index.esm.js +15 -3
- package/lib/implements/aiproxy/manager.ts +7 -7
- package/lib/implements/keyvalue/client.ts +4 -4
- package/lib/implements/keyvalue/manager.ts +13 -11
- package/lib/implements/threaddb/common/key.ts +1 -1
- package/lib/index.ts +4 -0
- package/lib/interfaces/keyvalue-interface.ts +17 -6
- package/lib/modules/keyvalue-module.ts +25 -7
- package/lib/polyfills/process-env-browser.ts +1 -0
- package/lib/proto/dcnet.proto +1 -0
- package/lib/proto/dcnet_proto.d.ts +251 -0
- package/lib/proto/dcnet_proto.js +649 -1
- package/lib/serverless/babel-browser.ts +39 -0
- package/lib/serverless/base_entity.ts +78 -0
- package/lib/serverless/base_repository.ts +284 -0
- package/lib/serverless/browser_schema_extractor.ts +282 -0
- package/lib/serverless/decorator_factory.ts +322 -0
- package/package.json +4 -1
|
@@ -209,7 +209,7 @@ export class AIProxyManager {
|
|
|
209
209
|
const signature = await this.context.sign(preSign);
|
|
210
210
|
const keyValueClient = new KeyValueClient(client, this.context);
|
|
211
211
|
try {
|
|
212
|
-
const
|
|
212
|
+
const [resFlag,_] = await keyValueClient.setKeyValue(
|
|
213
213
|
configTheme,
|
|
214
214
|
appId,
|
|
215
215
|
configAuthor,
|
|
@@ -223,8 +223,8 @@ export class AIProxyManager {
|
|
|
223
223
|
vaccount
|
|
224
224
|
);
|
|
225
225
|
|
|
226
|
-
if (
|
|
227
|
-
return [null, new Error(`configAIProxy fail, resFlag:${
|
|
226
|
+
if (resFlag !== 0) {
|
|
227
|
+
return [null, new Error(`configAIProxy fail, resFlag:${resFlag}`)];
|
|
228
228
|
}
|
|
229
229
|
return [true, null];
|
|
230
230
|
} catch (error) {
|
|
@@ -517,11 +517,11 @@ export class AIProxyManager {
|
|
|
517
517
|
const extraStr = valueParts[1] || "{}";
|
|
518
518
|
const extra = JSON.parse(extraStr);
|
|
519
519
|
if (extra) {
|
|
520
|
-
if (extra.
|
|
521
|
-
content.timestamp = extra.
|
|
520
|
+
if (extra.dc_timestamp) {
|
|
521
|
+
content.timestamp = extra.dc_timestamp;
|
|
522
522
|
}
|
|
523
|
-
if (extra.
|
|
524
|
-
content.userPubkey = extra.
|
|
523
|
+
if (extra.dc_opuser) {
|
|
524
|
+
content.userPubkey = extra.dc_opuser;
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
}
|
|
@@ -101,7 +101,7 @@ export class KeyValueClient {
|
|
|
101
101
|
type: number,
|
|
102
102
|
signature: Uint8Array,
|
|
103
103
|
vaccount?: string,
|
|
104
|
-
): Promise<number> {
|
|
104
|
+
): Promise<[number,number]> {
|
|
105
105
|
const message = new dcnet.pb.SetKeyValueRequest({});
|
|
106
106
|
message.appId = new TextEncoder().encode(appId);
|
|
107
107
|
message.themeAuthor = new TextEncoder().encode(themeAuthor);
|
|
@@ -132,7 +132,7 @@ export class KeyValueClient {
|
|
|
132
132
|
console.log("SetKeyValue reply", reply);
|
|
133
133
|
const decoded = dcnet.pb.SetKeyValueReply.decode(reply);
|
|
134
134
|
console.log("SetKeyValue decoded", decoded);
|
|
135
|
-
return decoded.flag;
|
|
135
|
+
return [decoded.flag, decoded.timestamp as number];
|
|
136
136
|
} catch (error: any) {
|
|
137
137
|
if (error.message.indexOf(Errors.INVALID_TOKEN.message) != -1) {
|
|
138
138
|
// try to get token
|
|
@@ -152,9 +152,9 @@ export class KeyValueClient {
|
|
|
152
152
|
30000
|
|
153
153
|
);
|
|
154
154
|
console.log("SetKeyValue reply", reply);
|
|
155
|
-
const decoded = dcnet.pb.
|
|
155
|
+
const decoded = dcnet.pb.SetKeyValueReply.decode(reply);
|
|
156
156
|
console.log("SetKeyValue decoded", decoded);
|
|
157
|
-
return decoded.flag;
|
|
157
|
+
return [decoded.flag, decoded.timestamp as number];
|
|
158
158
|
}
|
|
159
159
|
console.error("SetKeyValue error:", error);
|
|
160
160
|
throw error;
|
|
@@ -58,7 +58,7 @@ export class KeyValueDB {
|
|
|
58
58
|
value: any,
|
|
59
59
|
indexs: string = "",
|
|
60
60
|
vaccount: string = ""
|
|
61
|
-
): Promise<[boolean | null, Error | null]> {
|
|
61
|
+
): Promise<[boolean | null,number | null, Error | null]> {
|
|
62
62
|
return this.manager.setKeyValue(
|
|
63
63
|
this.appId,
|
|
64
64
|
this.themeAuthor,
|
|
@@ -70,6 +70,8 @@ export class KeyValueDB {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
|
|
74
|
+
|
|
73
75
|
//获取键值对
|
|
74
76
|
async get(
|
|
75
77
|
key: string,
|
|
@@ -486,9 +488,9 @@ export class KeyValueManager {
|
|
|
486
488
|
value: string,
|
|
487
489
|
indexs: string, //索引列表,格式为key1:value1$$$key2:value2
|
|
488
490
|
vaccount?: string
|
|
489
|
-
): Promise<[boolean | null, Error | null]> {
|
|
490
|
-
if(!this.context.publicKey){
|
|
491
|
-
return [null, Errors.ErrPublicKeyIsNull];
|
|
491
|
+
): Promise<[boolean | null, number | null, Error | null]> {
|
|
492
|
+
if (!this.context.publicKey) {
|
|
493
|
+
return [null, null, Errors.ErrPublicKeyIsNull];
|
|
492
494
|
}
|
|
493
495
|
if (!theme.startsWith("keyvalue_")) {
|
|
494
496
|
theme = "keyvalue_" + theme;
|
|
@@ -501,11 +503,11 @@ export class KeyValueManager {
|
|
|
501
503
|
}
|
|
502
504
|
|
|
503
505
|
if (client === null) {
|
|
504
|
-
return [null, new Error("ErrConnectToAccountPeersFail")];
|
|
506
|
+
return [null, null, new Error("ErrConnectToAccountPeersFail")];
|
|
505
507
|
}
|
|
506
508
|
|
|
507
509
|
if (client.peerAddr === null) {
|
|
508
|
-
return [null, new Error("ErrConnectToAccountPeersFail")];
|
|
510
|
+
return [null, null, new Error("ErrConnectToAccountPeersFail")];
|
|
509
511
|
}
|
|
510
512
|
if (client.token == "") {
|
|
511
513
|
await client.GetToken(appId, this.context.publicKey.string(), this.context.sign);
|
|
@@ -545,7 +547,7 @@ export class KeyValueManager {
|
|
|
545
547
|
const signature = await this.context.sign(preSign);
|
|
546
548
|
const keyValueClient = new KeyValueClient(client, this.context);
|
|
547
549
|
try {
|
|
548
|
-
const
|
|
550
|
+
const [resFlag,resTimestamp] = await keyValueClient.setKeyValue(
|
|
549
551
|
theme,
|
|
550
552
|
appId,
|
|
551
553
|
themeAuthor,
|
|
@@ -559,12 +561,12 @@ export class KeyValueManager {
|
|
|
559
561
|
vaccount
|
|
560
562
|
);
|
|
561
563
|
|
|
562
|
-
if (
|
|
563
|
-
return [null, new Error(`setKeyValue fail, resFlag:${
|
|
564
|
+
if (resFlag !== 0) {
|
|
565
|
+
return [null, resTimestamp, new Error(`setKeyValue fail, resFlag:${resFlag}`)];
|
|
564
566
|
}
|
|
565
|
-
return [true, null];
|
|
567
|
+
return [true, resTimestamp, null];
|
|
566
568
|
} catch (error: any) {
|
|
567
|
-
return [null, error];
|
|
569
|
+
return [null, null, error];
|
|
568
570
|
}
|
|
569
571
|
}
|
|
570
572
|
|
package/lib/index.ts
CHANGED
|
@@ -24,6 +24,10 @@ if (typeof Promise !== 'undefined' && !Promise.withResolvers) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
export { DC } from './dc';
|
|
27
|
+
export {BaseEntity} from './serverless/base_entity';
|
|
28
|
+
export { EntityRepository,type FindIndexOptions, type FindValuesOptions,composeCompositeIndexValue} from './serverless/base_repository';
|
|
29
|
+
export * from './serverless/decorator_factory';
|
|
30
|
+
export * from './serverless/browser_schema_extractor';
|
|
27
31
|
export { registerServiceWorker, isServiceWorkerActive, updateServiceWorker } from './common/service-worker';
|
|
28
32
|
export * from './common/types/types';
|
|
29
33
|
export * from './interfaces';
|
|
@@ -62,7 +62,7 @@ export interface IKeyValueOperations {
|
|
|
62
62
|
* @param value 值内容
|
|
63
63
|
* @param indexs 索引列表,格式为json字符串:[{key:"indexkey1",type:"string",value:"value"},{key:"indexkey2",type:"number", value:12}],设置索引后,后续查询可以通过索引快速定位
|
|
64
64
|
* @param vaccount 可选的虚拟账户
|
|
65
|
-
* @returns [是否设置成功, 错误信息]
|
|
65
|
+
* @returns [是否设置成功, 时间戳, 错误信息]
|
|
66
66
|
*/
|
|
67
67
|
set(
|
|
68
68
|
kvdb: KeyValueDB,
|
|
@@ -70,7 +70,18 @@ export interface IKeyValueOperations {
|
|
|
70
70
|
value: string,
|
|
71
71
|
indexs: string,
|
|
72
72
|
vaccount?: string
|
|
73
|
-
): Promise<[boolean | null, Error | null]>;
|
|
73
|
+
): Promise<[boolean | null, number | null, Error | null]>;
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 获取当前用户设置的指定键的元数据
|
|
78
|
+
* @param kvdb
|
|
79
|
+
* @param key
|
|
80
|
+
* @param vaccount
|
|
81
|
+
* @returns [值, 错误信息],值的格式: value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
82
|
+
*/
|
|
83
|
+
getValueSetByCurrentUser(kvdb: KeyValueDB, key: string,vaccount?: string): Promise<[string | null, Error | null]> ;
|
|
84
|
+
|
|
74
85
|
|
|
75
86
|
/**
|
|
76
87
|
* 获取指定键的值
|
|
@@ -78,7 +89,7 @@ export interface IKeyValueOperations {
|
|
|
78
89
|
* @param key 键名
|
|
79
90
|
* @param writerPubkey 写入者的公钥,如果不指定,则获取所有用户写入的该key的最新值
|
|
80
91
|
* @param vaccount 可选的虚拟账户
|
|
81
|
-
* @returns [值内容, 错误信息] 值的格式: value$$$dckv_extra$$${'
|
|
92
|
+
* @returns [值内容, 错误信息] 值的格式: value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
82
93
|
*/
|
|
83
94
|
get(
|
|
84
95
|
kvdb: KeyValueDB,
|
|
@@ -97,7 +108,7 @@ export interface IKeyValueOperations {
|
|
|
97
108
|
* @param direction 查询方向
|
|
98
109
|
* @param offset 结果偏移量
|
|
99
110
|
* @param vaccount 可选的虚拟账户
|
|
100
|
-
* @returns [
|
|
111
|
+
* @returns [值列表数组生成的json字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
101
112
|
*/
|
|
102
113
|
getValues(
|
|
103
114
|
kvdb: KeyValueDB,
|
|
@@ -113,7 +124,7 @@ export interface IKeyValueOperations {
|
|
|
113
124
|
* @param keys 多个键名,逗号分隔
|
|
114
125
|
* @param writerPubkey 写入者的公钥,可选,默认为主题作者
|
|
115
126
|
* @param vaccount 可选的虚拟账户
|
|
116
|
-
* @returns [
|
|
127
|
+
* @returns [值列表数组生成的json字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
117
128
|
*/
|
|
118
129
|
getBatch(
|
|
119
130
|
kvdb: KeyValueDB,
|
|
@@ -133,7 +144,7 @@ export interface IKeyValueOperations {
|
|
|
133
144
|
* @param direction 查询方向 (Forward/Backward)
|
|
134
145
|
* @param limit 返回结果数量限制
|
|
135
146
|
* @param vaccount 可选的虚拟账户
|
|
136
|
-
* @returns [
|
|
147
|
+
* @returns [值列表数组生成的json字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
137
148
|
*/
|
|
138
149
|
getWithIndex(
|
|
139
150
|
kvdb: KeyValueDB,
|
|
@@ -20,6 +20,7 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
20
20
|
readonly moduleName = CoreModuleName.KEYVALUE;
|
|
21
21
|
private keyValueManager!: KeyValueManager;
|
|
22
22
|
private initialized: boolean = false;
|
|
23
|
+
private context: DCContext = {} as DCContext;
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* 初始化键值存储模块
|
|
@@ -28,6 +29,7 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
28
29
|
*/
|
|
29
30
|
async initialize(context: DCContext): Promise<boolean> {
|
|
30
31
|
try {
|
|
32
|
+
this.context = context;
|
|
31
33
|
this.keyValueManager = new KeyValueManager(
|
|
32
34
|
context.dcutil,
|
|
33
35
|
context.dcChain,
|
|
@@ -154,10 +156,10 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
154
156
|
value: string,
|
|
155
157
|
indexs: string, //索引列表,格式为json字符串:[{key:"indexkey1",type:"string",value:"value"},{key:"indexkey2",type:"number", value:12}],这里统一转换格式为key1:value1$$$key2:value2
|
|
156
158
|
vaccount?: string
|
|
157
|
-
): Promise<[boolean | null, Error | null]> {
|
|
159
|
+
): Promise<[boolean | null, number | null, Error | null]> {
|
|
158
160
|
const err = this.assertInitialized();
|
|
159
161
|
if (err) {
|
|
160
|
-
return [null, err];
|
|
162
|
+
return [null, null, err];
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
try {
|
|
@@ -189,17 +191,33 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
189
191
|
return res;
|
|
190
192
|
} catch (error) {
|
|
191
193
|
logger.error(`设置set-value失败:`, error);
|
|
192
|
-
return [null, error instanceof Error ? error : new Error(String(error))];
|
|
194
|
+
return [null,null, error instanceof Error ? error : new Error(String(error))];
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 获取当前用户设置的指定键的元数据
|
|
201
|
+
* @param kvdb
|
|
202
|
+
* @param key
|
|
203
|
+
* @param vaccount
|
|
204
|
+
* @returns [值, 错误信息],值的格式: value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
205
|
+
*/
|
|
206
|
+
async getValueSetByCurrentUser(kvdb: KeyValueDB, key: string,vaccount?: string): Promise<[string | null, Error | null]> {
|
|
207
|
+
if(!this.context.publicKey){
|
|
208
|
+
return [null, new Error("当前用户公钥未设置")];
|
|
209
|
+
}
|
|
210
|
+
return this.get(kvdb,key, this.context.publicKey.string(), vaccount);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
196
214
|
/**
|
|
197
215
|
* 获取指定键的元数据
|
|
198
216
|
* @param kvdb
|
|
199
217
|
* @param key
|
|
200
218
|
* @param writerPubkey
|
|
201
219
|
* @param vaccount
|
|
202
|
-
* @returns [值, 错误信息],值的格式: value$$$dckv_extra$$${'
|
|
220
|
+
* @returns [值, 错误信息],值的格式: value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
203
221
|
*/
|
|
204
222
|
async get(
|
|
205
223
|
kvdb: KeyValueDB,
|
|
@@ -230,7 +248,7 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
230
248
|
* @param seekKey 查询起始键,用于分页查询
|
|
231
249
|
* @param offset 结果偏移量
|
|
232
250
|
* @param vaccount 可选的虚拟账户
|
|
233
|
-
* @returns [
|
|
251
|
+
* @returns [值列表数组生成的json字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
234
252
|
*/
|
|
235
253
|
async getValues(
|
|
236
254
|
kvdb: KeyValueDB,
|
|
@@ -261,7 +279,7 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
261
279
|
* @param keys 逗号分隔的键列表
|
|
262
280
|
* @param writerPubkey 可选,指定写入者公钥
|
|
263
281
|
* @param vaccount 可选的虚拟账户
|
|
264
|
-
* @returns [
|
|
282
|
+
* @returns [值的数组的JSON字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
265
283
|
*/
|
|
266
284
|
async getBatch(
|
|
267
285
|
kvdb: KeyValueDB,
|
|
@@ -293,7 +311,7 @@ export class KeyValueModule implements DCModule, IKeyValueOperations {
|
|
|
293
311
|
* @param direction 查询方向
|
|
294
312
|
* @param offset 结果偏移量
|
|
295
313
|
* @param vaccount 可选的虚拟账户
|
|
296
|
-
* @returns [
|
|
314
|
+
* @returns [值的数组形式的JSON字符串, 错误信息] 数组的每个元素的格式: key:value$$$dckv_extra$$${'dc_timestamp':'%d','dc_opuser':'%s'}
|
|
297
315
|
*/
|
|
298
316
|
async getWithIndex(
|
|
299
317
|
kvdb: KeyValueDB,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if (!(globalThis as any).process) (globalThis as any).process = { env: {} };
|
package/lib/proto/dcnet.proto
CHANGED
|
@@ -11180,6 +11180,9 @@ export namespace dcnet {
|
|
|
11180
11180
|
|
|
11181
11181
|
/** SetKeyValueReply flag */
|
|
11182
11182
|
flag?: (number|null);
|
|
11183
|
+
|
|
11184
|
+
/** SetKeyValueReply timestamp */
|
|
11185
|
+
timestamp?: (number|Long|null);
|
|
11183
11186
|
}
|
|
11184
11187
|
|
|
11185
11188
|
/** Represents a SetKeyValueReply. */
|
|
@@ -11194,6 +11197,9 @@ export namespace dcnet {
|
|
|
11194
11197
|
/** SetKeyValueReply flag. */
|
|
11195
11198
|
public flag: number;
|
|
11196
11199
|
|
|
11200
|
+
/** SetKeyValueReply timestamp. */
|
|
11201
|
+
public timestamp: (number|Long);
|
|
11202
|
+
|
|
11197
11203
|
/**
|
|
11198
11204
|
* Creates a new SetKeyValueReply instance using the specified properties.
|
|
11199
11205
|
* @param [properties] Properties to set
|
|
@@ -14116,6 +14122,230 @@ export namespace dcnet {
|
|
|
14116
14122
|
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
14117
14123
|
}
|
|
14118
14124
|
|
|
14125
|
+
/** Properties of a GetUserThemeConfigInfoRequest. */
|
|
14126
|
+
interface IGetUserThemeConfigInfoRequest {
|
|
14127
|
+
|
|
14128
|
+
/** GetUserThemeConfigInfoRequest theme */
|
|
14129
|
+
theme?: (Uint8Array|null);
|
|
14130
|
+
|
|
14131
|
+
/** GetUserThemeConfigInfoRequest appId */
|
|
14132
|
+
appId?: (Uint8Array|null);
|
|
14133
|
+
|
|
14134
|
+
/** GetUserThemeConfigInfoRequest themeAuthor */
|
|
14135
|
+
themeAuthor?: (Uint8Array|null);
|
|
14136
|
+
|
|
14137
|
+
/** GetUserThemeConfigInfoRequest UserPubkey */
|
|
14138
|
+
UserPubkey?: (Uint8Array|null);
|
|
14139
|
+
|
|
14140
|
+
/** GetUserThemeConfigInfoRequest Vaccount */
|
|
14141
|
+
Vaccount?: (Uint8Array|null);
|
|
14142
|
+
}
|
|
14143
|
+
|
|
14144
|
+
/** Represents a GetUserThemeConfigInfoRequest. */
|
|
14145
|
+
class GetUserThemeConfigInfoRequest implements IGetUserThemeConfigInfoRequest {
|
|
14146
|
+
|
|
14147
|
+
/**
|
|
14148
|
+
* Constructs a new GetUserThemeConfigInfoRequest.
|
|
14149
|
+
* @param [properties] Properties to set
|
|
14150
|
+
*/
|
|
14151
|
+
constructor(properties?: dcnet.pb.IGetUserThemeConfigInfoRequest);
|
|
14152
|
+
|
|
14153
|
+
/** GetUserThemeConfigInfoRequest theme. */
|
|
14154
|
+
public theme: Uint8Array;
|
|
14155
|
+
|
|
14156
|
+
/** GetUserThemeConfigInfoRequest appId. */
|
|
14157
|
+
public appId: Uint8Array;
|
|
14158
|
+
|
|
14159
|
+
/** GetUserThemeConfigInfoRequest themeAuthor. */
|
|
14160
|
+
public themeAuthor: Uint8Array;
|
|
14161
|
+
|
|
14162
|
+
/** GetUserThemeConfigInfoRequest UserPubkey. */
|
|
14163
|
+
public UserPubkey: Uint8Array;
|
|
14164
|
+
|
|
14165
|
+
/** GetUserThemeConfigInfoRequest Vaccount. */
|
|
14166
|
+
public Vaccount: Uint8Array;
|
|
14167
|
+
|
|
14168
|
+
/**
|
|
14169
|
+
* Creates a new GetUserThemeConfigInfoRequest instance using the specified properties.
|
|
14170
|
+
* @param [properties] Properties to set
|
|
14171
|
+
* @returns GetUserThemeConfigInfoRequest instance
|
|
14172
|
+
*/
|
|
14173
|
+
public static create(properties?: dcnet.pb.IGetUserThemeConfigInfoRequest): dcnet.pb.GetUserThemeConfigInfoRequest;
|
|
14174
|
+
|
|
14175
|
+
/**
|
|
14176
|
+
* Encodes the specified GetUserThemeConfigInfoRequest message. Does not implicitly {@link dcnet.pb.GetUserThemeConfigInfoRequest.verify|verify} messages.
|
|
14177
|
+
* @param message GetUserThemeConfigInfoRequest message or plain object to encode
|
|
14178
|
+
* @param [writer] Writer to encode to
|
|
14179
|
+
* @returns Writer
|
|
14180
|
+
*/
|
|
14181
|
+
public static encode(message: dcnet.pb.IGetUserThemeConfigInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
14182
|
+
|
|
14183
|
+
/**
|
|
14184
|
+
* Encodes the specified GetUserThemeConfigInfoRequest message, length delimited. Does not implicitly {@link dcnet.pb.GetUserThemeConfigInfoRequest.verify|verify} messages.
|
|
14185
|
+
* @param message GetUserThemeConfigInfoRequest message or plain object to encode
|
|
14186
|
+
* @param [writer] Writer to encode to
|
|
14187
|
+
* @returns Writer
|
|
14188
|
+
*/
|
|
14189
|
+
public static encodeDelimited(message: dcnet.pb.IGetUserThemeConfigInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
14190
|
+
|
|
14191
|
+
/**
|
|
14192
|
+
* Decodes a GetUserThemeConfigInfoRequest message from the specified reader or buffer.
|
|
14193
|
+
* @param reader Reader or buffer to decode from
|
|
14194
|
+
* @param [length] Message length if known beforehand
|
|
14195
|
+
* @returns GetUserThemeConfigInfoRequest
|
|
14196
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
14197
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
14198
|
+
*/
|
|
14199
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): dcnet.pb.GetUserThemeConfigInfoRequest;
|
|
14200
|
+
|
|
14201
|
+
/**
|
|
14202
|
+
* Decodes a GetUserThemeConfigInfoRequest message from the specified reader or buffer, length delimited.
|
|
14203
|
+
* @param reader Reader or buffer to decode from
|
|
14204
|
+
* @returns GetUserThemeConfigInfoRequest
|
|
14205
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
14206
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
14207
|
+
*/
|
|
14208
|
+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): dcnet.pb.GetUserThemeConfigInfoRequest;
|
|
14209
|
+
|
|
14210
|
+
/**
|
|
14211
|
+
* Verifies a GetUserThemeConfigInfoRequest message.
|
|
14212
|
+
* @param message Plain object to verify
|
|
14213
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
14214
|
+
*/
|
|
14215
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
14216
|
+
|
|
14217
|
+
/**
|
|
14218
|
+
* Creates a GetUserThemeConfigInfoRequest message from a plain object. Also converts values to their respective internal types.
|
|
14219
|
+
* @param object Plain object
|
|
14220
|
+
* @returns GetUserThemeConfigInfoRequest
|
|
14221
|
+
*/
|
|
14222
|
+
public static fromObject(object: { [k: string]: any }): dcnet.pb.GetUserThemeConfigInfoRequest;
|
|
14223
|
+
|
|
14224
|
+
/**
|
|
14225
|
+
* Creates a plain object from a GetUserThemeConfigInfoRequest message. Also converts values to other types if specified.
|
|
14226
|
+
* @param message GetUserThemeConfigInfoRequest
|
|
14227
|
+
* @param [options] Conversion options
|
|
14228
|
+
* @returns Plain object
|
|
14229
|
+
*/
|
|
14230
|
+
public static toObject(message: dcnet.pb.GetUserThemeConfigInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
14231
|
+
|
|
14232
|
+
/**
|
|
14233
|
+
* Converts this GetUserThemeConfigInfoRequest to JSON.
|
|
14234
|
+
* @returns JSON object
|
|
14235
|
+
*/
|
|
14236
|
+
public toJSON(): { [k: string]: any };
|
|
14237
|
+
|
|
14238
|
+
/**
|
|
14239
|
+
* Gets the default type url for GetUserThemeConfigInfoRequest
|
|
14240
|
+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
14241
|
+
* @returns The default type url
|
|
14242
|
+
*/
|
|
14243
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
14244
|
+
}
|
|
14245
|
+
|
|
14246
|
+
/** Properties of a GetUserThemeConfigInfoReply. */
|
|
14247
|
+
interface IGetUserThemeConfigInfoReply {
|
|
14248
|
+
|
|
14249
|
+
/** GetUserThemeConfigInfoReply flag */
|
|
14250
|
+
flag?: (number|null);
|
|
14251
|
+
|
|
14252
|
+
/** GetUserThemeConfigInfoReply authInfo */
|
|
14253
|
+
authInfo?: (Uint8Array|null);
|
|
14254
|
+
}
|
|
14255
|
+
|
|
14256
|
+
/** Represents a GetUserThemeConfigInfoReply. */
|
|
14257
|
+
class GetUserThemeConfigInfoReply implements IGetUserThemeConfigInfoReply {
|
|
14258
|
+
|
|
14259
|
+
/**
|
|
14260
|
+
* Constructs a new GetUserThemeConfigInfoReply.
|
|
14261
|
+
* @param [properties] Properties to set
|
|
14262
|
+
*/
|
|
14263
|
+
constructor(properties?: dcnet.pb.IGetUserThemeConfigInfoReply);
|
|
14264
|
+
|
|
14265
|
+
/** GetUserThemeConfigInfoReply flag. */
|
|
14266
|
+
public flag: number;
|
|
14267
|
+
|
|
14268
|
+
/** GetUserThemeConfigInfoReply authInfo. */
|
|
14269
|
+
public authInfo: Uint8Array;
|
|
14270
|
+
|
|
14271
|
+
/**
|
|
14272
|
+
* Creates a new GetUserThemeConfigInfoReply instance using the specified properties.
|
|
14273
|
+
* @param [properties] Properties to set
|
|
14274
|
+
* @returns GetUserThemeConfigInfoReply instance
|
|
14275
|
+
*/
|
|
14276
|
+
public static create(properties?: dcnet.pb.IGetUserThemeConfigInfoReply): dcnet.pb.GetUserThemeConfigInfoReply;
|
|
14277
|
+
|
|
14278
|
+
/**
|
|
14279
|
+
* Encodes the specified GetUserThemeConfigInfoReply message. Does not implicitly {@link dcnet.pb.GetUserThemeConfigInfoReply.verify|verify} messages.
|
|
14280
|
+
* @param message GetUserThemeConfigInfoReply message or plain object to encode
|
|
14281
|
+
* @param [writer] Writer to encode to
|
|
14282
|
+
* @returns Writer
|
|
14283
|
+
*/
|
|
14284
|
+
public static encode(message: dcnet.pb.IGetUserThemeConfigInfoReply, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
14285
|
+
|
|
14286
|
+
/**
|
|
14287
|
+
* Encodes the specified GetUserThemeConfigInfoReply message, length delimited. Does not implicitly {@link dcnet.pb.GetUserThemeConfigInfoReply.verify|verify} messages.
|
|
14288
|
+
* @param message GetUserThemeConfigInfoReply message or plain object to encode
|
|
14289
|
+
* @param [writer] Writer to encode to
|
|
14290
|
+
* @returns Writer
|
|
14291
|
+
*/
|
|
14292
|
+
public static encodeDelimited(message: dcnet.pb.IGetUserThemeConfigInfoReply, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
14293
|
+
|
|
14294
|
+
/**
|
|
14295
|
+
* Decodes a GetUserThemeConfigInfoReply message from the specified reader or buffer.
|
|
14296
|
+
* @param reader Reader or buffer to decode from
|
|
14297
|
+
* @param [length] Message length if known beforehand
|
|
14298
|
+
* @returns GetUserThemeConfigInfoReply
|
|
14299
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
14300
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
14301
|
+
*/
|
|
14302
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): dcnet.pb.GetUserThemeConfigInfoReply;
|
|
14303
|
+
|
|
14304
|
+
/**
|
|
14305
|
+
* Decodes a GetUserThemeConfigInfoReply message from the specified reader or buffer, length delimited.
|
|
14306
|
+
* @param reader Reader or buffer to decode from
|
|
14307
|
+
* @returns GetUserThemeConfigInfoReply
|
|
14308
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
14309
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
14310
|
+
*/
|
|
14311
|
+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): dcnet.pb.GetUserThemeConfigInfoReply;
|
|
14312
|
+
|
|
14313
|
+
/**
|
|
14314
|
+
* Verifies a GetUserThemeConfigInfoReply message.
|
|
14315
|
+
* @param message Plain object to verify
|
|
14316
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
14317
|
+
*/
|
|
14318
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
14319
|
+
|
|
14320
|
+
/**
|
|
14321
|
+
* Creates a GetUserThemeConfigInfoReply message from a plain object. Also converts values to their respective internal types.
|
|
14322
|
+
* @param object Plain object
|
|
14323
|
+
* @returns GetUserThemeConfigInfoReply
|
|
14324
|
+
*/
|
|
14325
|
+
public static fromObject(object: { [k: string]: any }): dcnet.pb.GetUserThemeConfigInfoReply;
|
|
14326
|
+
|
|
14327
|
+
/**
|
|
14328
|
+
* Creates a plain object from a GetUserThemeConfigInfoReply message. Also converts values to other types if specified.
|
|
14329
|
+
* @param message GetUserThemeConfigInfoReply
|
|
14330
|
+
* @param [options] Conversion options
|
|
14331
|
+
* @returns Plain object
|
|
14332
|
+
*/
|
|
14333
|
+
public static toObject(message: dcnet.pb.GetUserThemeConfigInfoReply, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
14334
|
+
|
|
14335
|
+
/**
|
|
14336
|
+
* Converts this GetUserThemeConfigInfoReply to JSON.
|
|
14337
|
+
* @returns JSON object
|
|
14338
|
+
*/
|
|
14339
|
+
public toJSON(): { [k: string]: any };
|
|
14340
|
+
|
|
14341
|
+
/**
|
|
14342
|
+
* Gets the default type url for GetUserThemeConfigInfoReply
|
|
14343
|
+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
14344
|
+
* @returns The default type url
|
|
14345
|
+
*/
|
|
14346
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
14347
|
+
}
|
|
14348
|
+
|
|
14119
14349
|
/** Properties of a GetUserCommentsRequest. */
|
|
14120
14350
|
interface IGetUserCommentsRequest {
|
|
14121
14351
|
|
|
@@ -21493,6 +21723,20 @@ export namespace dcnet {
|
|
|
21493
21723
|
*/
|
|
21494
21724
|
public getThemeComments(request: dcnet.pb.IGetThemeCommentsRequest): Promise<dcnet.pb.GetThemeCommentsReply>;
|
|
21495
21725
|
|
|
21726
|
+
/**
|
|
21727
|
+
* Calls GetUserThemeConfigInfo.
|
|
21728
|
+
* @param request GetUserThemeConfigInfoRequest message or plain object
|
|
21729
|
+
* @param callback Node-style callback called with the error, if any, and GetUserThemeConfigInfoReply
|
|
21730
|
+
*/
|
|
21731
|
+
public getUserThemeConfigInfo(request: dcnet.pb.IGetUserThemeConfigInfoRequest, callback: dcnet.pb.Service.GetUserThemeConfigInfoCallback): void;
|
|
21732
|
+
|
|
21733
|
+
/**
|
|
21734
|
+
* Calls GetUserThemeConfigInfo.
|
|
21735
|
+
* @param request GetUserThemeConfigInfoRequest message or plain object
|
|
21736
|
+
* @returns Promise
|
|
21737
|
+
*/
|
|
21738
|
+
public getUserThemeConfigInfo(request: dcnet.pb.IGetUserThemeConfigInfoRequest): Promise<dcnet.pb.GetUserThemeConfigInfoReply>;
|
|
21739
|
+
|
|
21496
21740
|
/**
|
|
21497
21741
|
* Calls GetThemeAuthList.
|
|
21498
21742
|
* @param request GetThemeAuthListRequest message or plain object
|
|
@@ -22378,6 +22622,13 @@ export namespace dcnet {
|
|
|
22378
22622
|
*/
|
|
22379
22623
|
type GetThemeCommentsCallback = (error: (Error|null), response?: dcnet.pb.GetThemeCommentsReply) => void;
|
|
22380
22624
|
|
|
22625
|
+
/**
|
|
22626
|
+
* Callback as used by {@link dcnet.pb.Service#getUserThemeConfigInfo}.
|
|
22627
|
+
* @param error Error, if any
|
|
22628
|
+
* @param [response] GetUserThemeConfigInfoReply
|
|
22629
|
+
*/
|
|
22630
|
+
type GetUserThemeConfigInfoCallback = (error: (Error|null), response?: dcnet.pb.GetUserThemeConfigInfoReply) => void;
|
|
22631
|
+
|
|
22381
22632
|
/**
|
|
22382
22633
|
* Callback as used by {@link dcnet.pb.Service#getThemeAuthList}.
|
|
22383
22634
|
* @param error Error, if any
|