@fatehan/tsrp 1.3.11 → 1.3.13
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/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAUnD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;IACvE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;gBAEvC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc;YAKzC,KAAK;IAgCN,OAAO,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,SAAS,GAClD,OAAO,CAAC,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAK1C,WAAW,CACtB,OAAO,EAAE,OAAO,wBAAwB,EAAE,aAAa,GACtD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,UAAU,CACrB,OAAO,EAAE,OAAO,wBAAwB,EAAE,iBAAiB,GAC1D,OAAO,CAAC,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;IAYlD,SAAS,CACpB,OAAO,EAAE,OAAO,wBAAwB,EAAE,gBAAgB,GACzD,OAAO,CAAC,OAAO,wBAAwB,EAAE,iBAAiB,CAAC;IAYjD,WAAW,CACtB,OAAO,EAAE,OAAO,wBAAwB,EAAE,aAAa,GACtD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,SAAS,CACpB,OAAO,EAAE,OAAO,wBAAwB,EAAE,WAAW,GACpD,OAAO,CAAC,OAAO,w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AC;IAO5C,OAAO,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,SAAS,GAClD,OAAO,CAAC,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAwC1C,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAgBpD"}
|
package/dist/api.js
CHANGED
|
@@ -93,64 +93,46 @@ class ApiService {
|
|
|
93
93
|
}
|
|
94
94
|
async IoIndex(request) {
|
|
95
95
|
if (request.deviceId != null) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
102
|
-
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
103
|
-
if (response.records > 0) {
|
|
104
|
-
(0, system_io_1.setDeviceIoCache)(request.deviceId.toString(), response.ios);
|
|
105
|
-
}
|
|
106
|
-
return response;
|
|
96
|
+
// trying to fetch from cache
|
|
97
|
+
const cachedIo = (0, system_io_1.getDeviceIoCache)(request.deviceId.toString());
|
|
98
|
+
if (cachedIo != null && cachedIo != undefined) {
|
|
99
|
+
return { cost: 0, ios: cachedIo, records: cachedIo.length };
|
|
107
100
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
// trying to fetch from server
|
|
102
|
+
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
103
|
+
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
104
|
+
if (response.records > 0) {
|
|
105
|
+
(0, system_io_1.setDeviceIoCache)(request.deviceId.toString(), response.ios);
|
|
111
106
|
}
|
|
107
|
+
return response;
|
|
112
108
|
}
|
|
113
109
|
else {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
120
|
-
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
121
|
-
(0, system_io_1.setSystemIoCache)(response.ios);
|
|
122
|
-
return response;
|
|
110
|
+
// trying to fetch from cache
|
|
111
|
+
const cachedIo = (0, system_io_1.getSystemIoCache)();
|
|
112
|
+
if (cachedIo != null && cachedIo != undefined) {
|
|
113
|
+
return { cost: 0, ios: cachedIo, records: cachedIo.length };
|
|
123
114
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
// trying to fetch from server
|
|
116
|
+
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
117
|
+
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
118
|
+
if (response.records > 0) {
|
|
119
|
+
(0, system_io_1.setSystemIoCache)(response.ios);
|
|
127
120
|
}
|
|
121
|
+
return response;
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
124
|
async IoCast(data) {
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return [];
|
|
137
|
-
ioData = result.ios;
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
console.error("Failed to fetch SystemIoReport in SystemIoCast:", error);
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
const result = await this.IoIndex({ deviceId: data.deviceId });
|
|
145
|
-
if (!((_b = result === null || result === void 0 ? void 0 : result.ios) === null || _b === void 0 ? void 0 : _b.length))
|
|
146
|
-
return [];
|
|
147
|
-
deviceIo = result.ios;
|
|
125
|
+
var ioData = api_1.IoResponse.create({ ios: [] });
|
|
126
|
+
var deviceIo = api_1.IoResponse.create({ ios: [] });
|
|
127
|
+
const systemIoResult = await this.IoIndex({});
|
|
128
|
+
if (systemIoResult != undefined && systemIoResult != null) {
|
|
129
|
+
ioData = systemIoResult;
|
|
148
130
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
131
|
+
const deviceIoResult = await this.IoIndex({ deviceId: data.deviceId });
|
|
132
|
+
if (deviceIoResult != undefined && deviceIoResult != null) {
|
|
133
|
+
deviceIo = deviceIoResult;
|
|
152
134
|
}
|
|
153
|
-
return (0, system_io_2.default)(ioData, deviceIo, data);
|
|
135
|
+
return (0, system_io_2.default)(ioData.ios, deviceIo.ios, data);
|
|
154
136
|
}
|
|
155
137
|
}
|
|
156
138
|
exports.ApiService = ApiService;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import Long from "long";
|
|
3
3
|
export declare const protobufPackage = "com.fatehan.identities";
|
|
4
|
+
export interface LogoutRequest {
|
|
5
|
+
token: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LogoutResponse {
|
|
8
|
+
result: boolean;
|
|
9
|
+
cost: number;
|
|
10
|
+
}
|
|
11
|
+
export interface VerifyRequest {
|
|
12
|
+
token: string;
|
|
13
|
+
}
|
|
14
|
+
export interface VerifyResponse {
|
|
15
|
+
identity?: Identity | undefined;
|
|
16
|
+
accessToken?: AccessToken | undefined;
|
|
17
|
+
cost: number;
|
|
18
|
+
}
|
|
4
19
|
export interface OtpCodeRequest {
|
|
5
20
|
phone: Long;
|
|
6
21
|
}
|
|
@@ -58,6 +73,7 @@ export interface AccessToken {
|
|
|
58
73
|
deviceType: string;
|
|
59
74
|
expiresAt?: Date | undefined;
|
|
60
75
|
createdAt?: Date | undefined;
|
|
76
|
+
logoutAt?: Date | undefined;
|
|
61
77
|
}
|
|
62
78
|
export interface OtpRequest {
|
|
63
79
|
id: Long;
|
|
@@ -76,6 +92,10 @@ export interface Credential {
|
|
|
76
92
|
token: Long;
|
|
77
93
|
domain: string;
|
|
78
94
|
}
|
|
95
|
+
export declare const LogoutRequest: MessageFns<LogoutRequest>;
|
|
96
|
+
export declare const LogoutResponse: MessageFns<LogoutResponse>;
|
|
97
|
+
export declare const VerifyRequest: MessageFns<VerifyRequest>;
|
|
98
|
+
export declare const VerifyResponse: MessageFns<VerifyResponse>;
|
|
79
99
|
export declare const OtpCodeRequest: MessageFns<OtpCodeRequest>;
|
|
80
100
|
export declare const OtpCodeResponse: MessageFns<OtpCodeResponse>;
|
|
81
101
|
export declare const AuthResponse: MessageFns<AuthResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/fatehan/identities/authentication.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;CAC1B;AAED,MAAM,WAAW,YAAY;CAC5B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,UAAU,CAAC;IAC3B,SAAS,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,IAAI,CAAC;IACT,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,CAAC;IACZ,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/fatehan/identities/authentication.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,M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CAAC,CAAC;IACxD,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;CAC/D"}
|
|
@@ -8,12 +8,273 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.Credential = exports.OtpRequest = exports.AccessToken = exports.Identity = exports.TelegramAuth = exports.GoogleAuth = exports.OtpAuth = exports.QrCodeAuth = exports.PasswordAuth = exports.AuthRequest = exports.AuthResponse = exports.OtpCodeResponse = exports.OtpCodeRequest = exports.protobufPackage = void 0;
|
|
11
|
+
exports.Credential = exports.OtpRequest = exports.AccessToken = exports.Identity = exports.TelegramAuth = exports.GoogleAuth = exports.OtpAuth = exports.QrCodeAuth = exports.PasswordAuth = exports.AuthRequest = exports.AuthResponse = exports.OtpCodeResponse = exports.OtpCodeRequest = exports.VerifyResponse = exports.VerifyRequest = exports.LogoutResponse = exports.LogoutRequest = exports.protobufPackage = void 0;
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
14
14
|
const long_1 = __importDefault(require("long"));
|
|
15
15
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
16
16
|
exports.protobufPackage = "com.fatehan.identities";
|
|
17
|
+
function createBaseLogoutRequest() {
|
|
18
|
+
return { token: "" };
|
|
19
|
+
}
|
|
20
|
+
exports.LogoutRequest = {
|
|
21
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
22
|
+
if (message.token !== "") {
|
|
23
|
+
writer.uint32(10).string(message.token);
|
|
24
|
+
}
|
|
25
|
+
return writer;
|
|
26
|
+
},
|
|
27
|
+
decode(input, length) {
|
|
28
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
29
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
30
|
+
const message = createBaseLogoutRequest();
|
|
31
|
+
while (reader.pos < end) {
|
|
32
|
+
const tag = reader.uint32();
|
|
33
|
+
switch (tag >>> 3) {
|
|
34
|
+
case 1: {
|
|
35
|
+
if (tag !== 10) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
message.token = reader.string();
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
reader.skip(tag & 7);
|
|
46
|
+
}
|
|
47
|
+
return message;
|
|
48
|
+
},
|
|
49
|
+
fromJSON(object) {
|
|
50
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
51
|
+
},
|
|
52
|
+
toJSON(message) {
|
|
53
|
+
const obj = {};
|
|
54
|
+
if (message.token !== "") {
|
|
55
|
+
obj.token = message.token;
|
|
56
|
+
}
|
|
57
|
+
return obj;
|
|
58
|
+
},
|
|
59
|
+
create(base) {
|
|
60
|
+
return exports.LogoutRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
61
|
+
},
|
|
62
|
+
fromPartial(object) {
|
|
63
|
+
var _a;
|
|
64
|
+
const message = createBaseLogoutRequest();
|
|
65
|
+
message.token = (_a = object.token) !== null && _a !== void 0 ? _a : "";
|
|
66
|
+
return message;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
function createBaseLogoutResponse() {
|
|
70
|
+
return { result: false, cost: 0 };
|
|
71
|
+
}
|
|
72
|
+
exports.LogoutResponse = {
|
|
73
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
74
|
+
if (message.result !== false) {
|
|
75
|
+
writer.uint32(8).bool(message.result);
|
|
76
|
+
}
|
|
77
|
+
if (message.cost !== 0) {
|
|
78
|
+
writer.uint32(16).uint32(message.cost);
|
|
79
|
+
}
|
|
80
|
+
return writer;
|
|
81
|
+
},
|
|
82
|
+
decode(input, length) {
|
|
83
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
84
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
85
|
+
const message = createBaseLogoutResponse();
|
|
86
|
+
while (reader.pos < end) {
|
|
87
|
+
const tag = reader.uint32();
|
|
88
|
+
switch (tag >>> 3) {
|
|
89
|
+
case 1: {
|
|
90
|
+
if (tag !== 8) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
message.result = reader.bool();
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
case 2: {
|
|
97
|
+
if (tag !== 16) {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
message.cost = reader.uint32();
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
reader.skip(tag & 7);
|
|
108
|
+
}
|
|
109
|
+
return message;
|
|
110
|
+
},
|
|
111
|
+
fromJSON(object) {
|
|
112
|
+
return {
|
|
113
|
+
result: isSet(object.result) ? globalThis.Boolean(object.result) : false,
|
|
114
|
+
cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0,
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
toJSON(message) {
|
|
118
|
+
const obj = {};
|
|
119
|
+
if (message.result !== false) {
|
|
120
|
+
obj.result = message.result;
|
|
121
|
+
}
|
|
122
|
+
if (message.cost !== 0) {
|
|
123
|
+
obj.cost = Math.round(message.cost);
|
|
124
|
+
}
|
|
125
|
+
return obj;
|
|
126
|
+
},
|
|
127
|
+
create(base) {
|
|
128
|
+
return exports.LogoutResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
129
|
+
},
|
|
130
|
+
fromPartial(object) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const message = createBaseLogoutResponse();
|
|
133
|
+
message.result = (_a = object.result) !== null && _a !== void 0 ? _a : false;
|
|
134
|
+
message.cost = (_b = object.cost) !== null && _b !== void 0 ? _b : 0;
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
function createBaseVerifyRequest() {
|
|
139
|
+
return { token: "" };
|
|
140
|
+
}
|
|
141
|
+
exports.VerifyRequest = {
|
|
142
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
143
|
+
if (message.token !== "") {
|
|
144
|
+
writer.uint32(10).string(message.token);
|
|
145
|
+
}
|
|
146
|
+
return writer;
|
|
147
|
+
},
|
|
148
|
+
decode(input, length) {
|
|
149
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
150
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
151
|
+
const message = createBaseVerifyRequest();
|
|
152
|
+
while (reader.pos < end) {
|
|
153
|
+
const tag = reader.uint32();
|
|
154
|
+
switch (tag >>> 3) {
|
|
155
|
+
case 1: {
|
|
156
|
+
if (tag !== 10) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
message.token = reader.string();
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
reader.skip(tag & 7);
|
|
167
|
+
}
|
|
168
|
+
return message;
|
|
169
|
+
},
|
|
170
|
+
fromJSON(object) {
|
|
171
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
172
|
+
},
|
|
173
|
+
toJSON(message) {
|
|
174
|
+
const obj = {};
|
|
175
|
+
if (message.token !== "") {
|
|
176
|
+
obj.token = message.token;
|
|
177
|
+
}
|
|
178
|
+
return obj;
|
|
179
|
+
},
|
|
180
|
+
create(base) {
|
|
181
|
+
return exports.VerifyRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
182
|
+
},
|
|
183
|
+
fromPartial(object) {
|
|
184
|
+
var _a;
|
|
185
|
+
const message = createBaseVerifyRequest();
|
|
186
|
+
message.token = (_a = object.token) !== null && _a !== void 0 ? _a : "";
|
|
187
|
+
return message;
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
function createBaseVerifyResponse() {
|
|
191
|
+
return { identity: undefined, accessToken: undefined, cost: 0 };
|
|
192
|
+
}
|
|
193
|
+
exports.VerifyResponse = {
|
|
194
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
195
|
+
if (message.identity !== undefined) {
|
|
196
|
+
exports.Identity.encode(message.identity, writer.uint32(10).fork()).join();
|
|
197
|
+
}
|
|
198
|
+
if (message.accessToken !== undefined) {
|
|
199
|
+
exports.AccessToken.encode(message.accessToken, writer.uint32(18).fork()).join();
|
|
200
|
+
}
|
|
201
|
+
if (message.cost !== 0) {
|
|
202
|
+
writer.uint32(24).uint32(message.cost);
|
|
203
|
+
}
|
|
204
|
+
return writer;
|
|
205
|
+
},
|
|
206
|
+
decode(input, length) {
|
|
207
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
208
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
209
|
+
const message = createBaseVerifyResponse();
|
|
210
|
+
while (reader.pos < end) {
|
|
211
|
+
const tag = reader.uint32();
|
|
212
|
+
switch (tag >>> 3) {
|
|
213
|
+
case 1: {
|
|
214
|
+
if (tag !== 10) {
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
message.identity = exports.Identity.decode(reader, reader.uint32());
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
case 2: {
|
|
221
|
+
if (tag !== 18) {
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
message.accessToken = exports.AccessToken.decode(reader, reader.uint32());
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
case 3: {
|
|
228
|
+
if (tag !== 24) {
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
message.cost = reader.uint32();
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
reader.skip(tag & 7);
|
|
239
|
+
}
|
|
240
|
+
return message;
|
|
241
|
+
},
|
|
242
|
+
fromJSON(object) {
|
|
243
|
+
return {
|
|
244
|
+
identity: isSet(object.identity) ? exports.Identity.fromJSON(object.identity) : undefined,
|
|
245
|
+
accessToken: isSet(object.accessToken) ? exports.AccessToken.fromJSON(object.accessToken) : undefined,
|
|
246
|
+
cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0,
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
toJSON(message) {
|
|
250
|
+
const obj = {};
|
|
251
|
+
if (message.identity !== undefined) {
|
|
252
|
+
obj.identity = exports.Identity.toJSON(message.identity);
|
|
253
|
+
}
|
|
254
|
+
if (message.accessToken !== undefined) {
|
|
255
|
+
obj.accessToken = exports.AccessToken.toJSON(message.accessToken);
|
|
256
|
+
}
|
|
257
|
+
if (message.cost !== 0) {
|
|
258
|
+
obj.cost = Math.round(message.cost);
|
|
259
|
+
}
|
|
260
|
+
return obj;
|
|
261
|
+
},
|
|
262
|
+
create(base) {
|
|
263
|
+
return exports.VerifyResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
264
|
+
},
|
|
265
|
+
fromPartial(object) {
|
|
266
|
+
var _a;
|
|
267
|
+
const message = createBaseVerifyResponse();
|
|
268
|
+
message.identity = (object.identity !== undefined && object.identity !== null)
|
|
269
|
+
? exports.Identity.fromPartial(object.identity)
|
|
270
|
+
: undefined;
|
|
271
|
+
message.accessToken = (object.accessToken !== undefined && object.accessToken !== null)
|
|
272
|
+
? exports.AccessToken.fromPartial(object.accessToken)
|
|
273
|
+
: undefined;
|
|
274
|
+
message.cost = (_a = object.cost) !== null && _a !== void 0 ? _a : 0;
|
|
275
|
+
return message;
|
|
276
|
+
},
|
|
277
|
+
};
|
|
17
278
|
function createBaseOtpCodeRequest() {
|
|
18
279
|
return { phone: long_1.default.UZERO };
|
|
19
280
|
}
|
|
@@ -821,6 +1082,7 @@ function createBaseAccessToken() {
|
|
|
821
1082
|
deviceType: "",
|
|
822
1083
|
expiresAt: undefined,
|
|
823
1084
|
createdAt: undefined,
|
|
1085
|
+
logoutAt: undefined,
|
|
824
1086
|
};
|
|
825
1087
|
}
|
|
826
1088
|
exports.AccessToken = {
|
|
@@ -855,6 +1117,9 @@ exports.AccessToken = {
|
|
|
855
1117
|
if (message.createdAt !== undefined) {
|
|
856
1118
|
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
|
|
857
1119
|
}
|
|
1120
|
+
if (message.logoutAt !== undefined) {
|
|
1121
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.logoutAt), writer.uint32(90).fork()).join();
|
|
1122
|
+
}
|
|
858
1123
|
return writer;
|
|
859
1124
|
},
|
|
860
1125
|
decode(input, length) {
|
|
@@ -934,6 +1199,13 @@ exports.AccessToken = {
|
|
|
934
1199
|
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
935
1200
|
continue;
|
|
936
1201
|
}
|
|
1202
|
+
case 11: {
|
|
1203
|
+
if (tag !== 90) {
|
|
1204
|
+
break;
|
|
1205
|
+
}
|
|
1206
|
+
message.logoutAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1207
|
+
continue;
|
|
1208
|
+
}
|
|
937
1209
|
}
|
|
938
1210
|
if ((tag & 7) === 4 || tag === 0) {
|
|
939
1211
|
break;
|
|
@@ -954,6 +1226,7 @@ exports.AccessToken = {
|
|
|
954
1226
|
deviceType: isSet(object.device_type) ? globalThis.String(object.device_type) : "",
|
|
955
1227
|
expiresAt: isSet(object.expires_at) ? fromJsonTimestamp(object.expires_at) : undefined,
|
|
956
1228
|
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
1229
|
+
logoutAt: isSet(object.logout_at) ? fromJsonTimestamp(object.logout_at) : undefined,
|
|
957
1230
|
};
|
|
958
1231
|
},
|
|
959
1232
|
toJSON(message) {
|
|
@@ -988,13 +1261,16 @@ exports.AccessToken = {
|
|
|
988
1261
|
if (message.createdAt !== undefined) {
|
|
989
1262
|
obj.created_at = message.createdAt.toISOString();
|
|
990
1263
|
}
|
|
1264
|
+
if (message.logoutAt !== undefined) {
|
|
1265
|
+
obj.logout_at = message.logoutAt.toISOString();
|
|
1266
|
+
}
|
|
991
1267
|
return obj;
|
|
992
1268
|
},
|
|
993
1269
|
create(base) {
|
|
994
1270
|
return exports.AccessToken.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
995
1271
|
},
|
|
996
1272
|
fromPartial(object) {
|
|
997
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1273
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
998
1274
|
const message = createBaseAccessToken();
|
|
999
1275
|
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
1000
1276
|
message.identityId = (object.identityId !== undefined && object.identityId !== null)
|
|
@@ -1008,6 +1284,7 @@ exports.AccessToken = {
|
|
|
1008
1284
|
message.deviceType = (_e = object.deviceType) !== null && _e !== void 0 ? _e : "";
|
|
1009
1285
|
message.expiresAt = (_f = object.expiresAt) !== null && _f !== void 0 ? _f : undefined;
|
|
1010
1286
|
message.createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;
|
|
1287
|
+
message.logoutAt = (_h = object.logoutAt) !== null && _h !== void 0 ? _h : undefined;
|
|
1011
1288
|
return message;
|
|
1012
1289
|
},
|
|
1013
1290
|
};
|