quiver-protobuf-typescript 1.0.1686822719 → 1.0.1686828126
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/{shared → audit}/user_group.ts +1 -1
- package/merchant/merchant.ts +1 -1
- package/object/object_assignment.ts +32 -2
- package/object/object_status.ts +494 -0
- package/package.json +1 -1
- package/shared/task_status.ts +0 -149
- package/shared/task_status_update.ts +0 -201
package/merchant/merchant.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import Long from "long";
|
|
3
3
|
import _m0 from "protobufjs/minimal";
|
|
4
|
+
import { UserGroup, userGroupFromJSON, userGroupToJSON, userGroupToNumber } from "../audit/user_group";
|
|
4
5
|
import { Struct } from "../google/protobuf/struct";
|
|
5
6
|
import { Timestamp } from "../google/protobuf/timestamp";
|
|
6
|
-
import { UserGroup, userGroupFromJSON, userGroupToJSON, userGroupToNumber } from "../shared/user_group";
|
|
7
7
|
|
|
8
8
|
export const protobufPackage = "merchant";
|
|
9
9
|
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Timestamp } from "../google/protobuf/timestamp";
|
|
4
|
+
import { ObjectType, objectTypeFromJSON, objectTypeToJSON, objectTypeToNumber } from "./object";
|
|
4
5
|
|
|
5
6
|
export const protobufPackage = "object";
|
|
6
7
|
|
|
7
8
|
export interface QueryObjectAssignmentsRequest {
|
|
8
9
|
objectId?: number | undefined;
|
|
10
|
+
courierId?: number | undefined;
|
|
11
|
+
objectType?: ObjectType | undefined;
|
|
9
12
|
deleted?: boolean | undefined;
|
|
10
13
|
}
|
|
11
14
|
|
|
@@ -52,7 +55,7 @@ export interface ObjectAssignment {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
function createBaseQueryObjectAssignmentsRequest(): QueryObjectAssignmentsRequest {
|
|
55
|
-
return { objectId: undefined, deleted: undefined };
|
|
58
|
+
return { objectId: undefined, courierId: undefined, objectType: undefined, deleted: undefined };
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
export const QueryObjectAssignmentsRequest = {
|
|
@@ -60,8 +63,14 @@ export const QueryObjectAssignmentsRequest = {
|
|
|
60
63
|
if (message.objectId !== undefined) {
|
|
61
64
|
writer.uint32(8).int32(message.objectId);
|
|
62
65
|
}
|
|
66
|
+
if (message.courierId !== undefined) {
|
|
67
|
+
writer.uint32(16).int32(message.courierId);
|
|
68
|
+
}
|
|
69
|
+
if (message.objectType !== undefined) {
|
|
70
|
+
writer.uint32(24).int32(objectTypeToNumber(message.objectType));
|
|
71
|
+
}
|
|
63
72
|
if (message.deleted !== undefined) {
|
|
64
|
-
writer.uint32(
|
|
73
|
+
writer.uint32(32).bool(message.deleted);
|
|
65
74
|
}
|
|
66
75
|
return writer;
|
|
67
76
|
},
|
|
@@ -85,6 +94,20 @@ export const QueryObjectAssignmentsRequest = {
|
|
|
85
94
|
break;
|
|
86
95
|
}
|
|
87
96
|
|
|
97
|
+
message.courierId = reader.int32();
|
|
98
|
+
continue;
|
|
99
|
+
case 3:
|
|
100
|
+
if (tag !== 24) {
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message.objectType = objectTypeFromJSON(reader.int32());
|
|
105
|
+
continue;
|
|
106
|
+
case 4:
|
|
107
|
+
if (tag !== 32) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
|
|
88
111
|
message.deleted = reader.bool();
|
|
89
112
|
continue;
|
|
90
113
|
}
|
|
@@ -99,6 +122,8 @@ export const QueryObjectAssignmentsRequest = {
|
|
|
99
122
|
fromJSON(object: any): QueryObjectAssignmentsRequest {
|
|
100
123
|
return {
|
|
101
124
|
objectId: isSet(object.objectId) ? Number(object.objectId) : undefined,
|
|
125
|
+
courierId: isSet(object.courierId) ? Number(object.courierId) : undefined,
|
|
126
|
+
objectType: isSet(object.objectType) ? objectTypeFromJSON(object.objectType) : undefined,
|
|
102
127
|
deleted: isSet(object.deleted) ? Boolean(object.deleted) : undefined,
|
|
103
128
|
};
|
|
104
129
|
},
|
|
@@ -106,6 +131,9 @@ export const QueryObjectAssignmentsRequest = {
|
|
|
106
131
|
toJSON(message: QueryObjectAssignmentsRequest): unknown {
|
|
107
132
|
const obj: any = {};
|
|
108
133
|
message.objectId !== undefined && (obj.objectId = Math.round(message.objectId));
|
|
134
|
+
message.courierId !== undefined && (obj.courierId = Math.round(message.courierId));
|
|
135
|
+
message.objectType !== undefined &&
|
|
136
|
+
(obj.objectType = message.objectType !== undefined ? objectTypeToJSON(message.objectType) : undefined);
|
|
109
137
|
message.deleted !== undefined && (obj.deleted = message.deleted);
|
|
110
138
|
return obj;
|
|
111
139
|
},
|
|
@@ -119,6 +147,8 @@ export const QueryObjectAssignmentsRequest = {
|
|
|
119
147
|
): QueryObjectAssignmentsRequest {
|
|
120
148
|
const message = createBaseQueryObjectAssignmentsRequest();
|
|
121
149
|
message.objectId = object.objectId ?? undefined;
|
|
150
|
+
message.courierId = object.courierId ?? undefined;
|
|
151
|
+
message.objectType = object.objectType ?? undefined;
|
|
122
152
|
message.deleted = object.deleted ?? undefined;
|
|
123
153
|
return message;
|
|
124
154
|
},
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Timestamp } from "../google/protobuf/timestamp";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "object";
|
|
6
|
+
|
|
7
|
+
export enum ObjectStatus {
|
|
8
|
+
OBJECT_STATUS_UNSPECIFIED = "OBJECT_STATUS_UNSPECIFIED",
|
|
9
|
+
ACTIVE = "ACTIVE",
|
|
10
|
+
INACTIVE = "INACTIVE",
|
|
11
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function objectStatusFromJSON(object: any): ObjectStatus {
|
|
15
|
+
switch (object) {
|
|
16
|
+
case 0:
|
|
17
|
+
case "OBJECT_STATUS_UNSPECIFIED":
|
|
18
|
+
return ObjectStatus.OBJECT_STATUS_UNSPECIFIED;
|
|
19
|
+
case 1:
|
|
20
|
+
case "ACTIVE":
|
|
21
|
+
return ObjectStatus.ACTIVE;
|
|
22
|
+
case 2:
|
|
23
|
+
case "INACTIVE":
|
|
24
|
+
return ObjectStatus.INACTIVE;
|
|
25
|
+
case -1:
|
|
26
|
+
case "UNRECOGNIZED":
|
|
27
|
+
default:
|
|
28
|
+
return ObjectStatus.UNRECOGNIZED;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function objectStatusToJSON(object: ObjectStatus): string {
|
|
33
|
+
switch (object) {
|
|
34
|
+
case ObjectStatus.OBJECT_STATUS_UNSPECIFIED:
|
|
35
|
+
return "OBJECT_STATUS_UNSPECIFIED";
|
|
36
|
+
case ObjectStatus.ACTIVE:
|
|
37
|
+
return "ACTIVE";
|
|
38
|
+
case ObjectStatus.INACTIVE:
|
|
39
|
+
return "INACTIVE";
|
|
40
|
+
case ObjectStatus.UNRECOGNIZED:
|
|
41
|
+
default:
|
|
42
|
+
return "UNRECOGNIZED";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function objectStatusToNumber(object: ObjectStatus): number {
|
|
47
|
+
switch (object) {
|
|
48
|
+
case ObjectStatus.OBJECT_STATUS_UNSPECIFIED:
|
|
49
|
+
return 0;
|
|
50
|
+
case ObjectStatus.ACTIVE:
|
|
51
|
+
return 1;
|
|
52
|
+
case ObjectStatus.INACTIVE:
|
|
53
|
+
return 2;
|
|
54
|
+
case ObjectStatus.UNRECOGNIZED:
|
|
55
|
+
default:
|
|
56
|
+
return -1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface QueryObjectStatusUpdates {
|
|
61
|
+
objectId: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface QueryObjectStatusUpdatesResponse {
|
|
65
|
+
objectStatusUpdates: ObjectStatusUpdate[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface CreateObjectStatusUpdate {
|
|
69
|
+
objectId: number;
|
|
70
|
+
status: ObjectStatus;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface UpdateObjectStatusUpdate {
|
|
74
|
+
objectId: number;
|
|
75
|
+
status: ObjectStatus;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ObjectStatusUpdate {
|
|
79
|
+
objectStatusId: number;
|
|
80
|
+
objectId: number;
|
|
81
|
+
createdAt: string | undefined;
|
|
82
|
+
updatedAt: string | undefined;
|
|
83
|
+
status: ObjectStatus;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function createBaseQueryObjectStatusUpdates(): QueryObjectStatusUpdates {
|
|
87
|
+
return { objectId: 0 };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const QueryObjectStatusUpdates = {
|
|
91
|
+
encode(message: QueryObjectStatusUpdates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
92
|
+
if (message.objectId !== 0) {
|
|
93
|
+
writer.uint32(8).int32(message.objectId);
|
|
94
|
+
}
|
|
95
|
+
return writer;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): QueryObjectStatusUpdates {
|
|
99
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
100
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
101
|
+
const message = createBaseQueryObjectStatusUpdates();
|
|
102
|
+
while (reader.pos < end) {
|
|
103
|
+
const tag = reader.uint32();
|
|
104
|
+
switch (tag >>> 3) {
|
|
105
|
+
case 1:
|
|
106
|
+
if (tag !== 8) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message.objectId = reader.int32();
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
reader.skipType(tag & 7);
|
|
117
|
+
}
|
|
118
|
+
return message;
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
fromJSON(object: any): QueryObjectStatusUpdates {
|
|
122
|
+
return { objectId: isSet(object.objectId) ? Number(object.objectId) : 0 };
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
toJSON(message: QueryObjectStatusUpdates): unknown {
|
|
126
|
+
const obj: any = {};
|
|
127
|
+
message.objectId !== undefined && (obj.objectId = Math.round(message.objectId));
|
|
128
|
+
return obj;
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
create<I extends Exact<DeepPartial<QueryObjectStatusUpdates>, I>>(base?: I): QueryObjectStatusUpdates {
|
|
132
|
+
return QueryObjectStatusUpdates.fromPartial(base ?? {});
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
fromPartial<I extends Exact<DeepPartial<QueryObjectStatusUpdates>, I>>(object: I): QueryObjectStatusUpdates {
|
|
136
|
+
const message = createBaseQueryObjectStatusUpdates();
|
|
137
|
+
message.objectId = object.objectId ?? 0;
|
|
138
|
+
return message;
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
function createBaseQueryObjectStatusUpdatesResponse(): QueryObjectStatusUpdatesResponse {
|
|
143
|
+
return { objectStatusUpdates: [] };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const QueryObjectStatusUpdatesResponse = {
|
|
147
|
+
encode(message: QueryObjectStatusUpdatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
148
|
+
for (const v of message.objectStatusUpdates) {
|
|
149
|
+
ObjectStatusUpdate.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
150
|
+
}
|
|
151
|
+
return writer;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): QueryObjectStatusUpdatesResponse {
|
|
155
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
156
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
157
|
+
const message = createBaseQueryObjectStatusUpdatesResponse();
|
|
158
|
+
while (reader.pos < end) {
|
|
159
|
+
const tag = reader.uint32();
|
|
160
|
+
switch (tag >>> 3) {
|
|
161
|
+
case 1:
|
|
162
|
+
if (tag !== 10) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
message.objectStatusUpdates.push(ObjectStatusUpdate.decode(reader, reader.uint32()));
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
reader.skipType(tag & 7);
|
|
173
|
+
}
|
|
174
|
+
return message;
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
fromJSON(object: any): QueryObjectStatusUpdatesResponse {
|
|
178
|
+
return {
|
|
179
|
+
objectStatusUpdates: Array.isArray(object?.objectStatusUpdates)
|
|
180
|
+
? object.objectStatusUpdates.map((e: any) => ObjectStatusUpdate.fromJSON(e))
|
|
181
|
+
: [],
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
toJSON(message: QueryObjectStatusUpdatesResponse): unknown {
|
|
186
|
+
const obj: any = {};
|
|
187
|
+
if (message.objectStatusUpdates) {
|
|
188
|
+
obj.objectStatusUpdates = message.objectStatusUpdates.map((e) => e ? ObjectStatusUpdate.toJSON(e) : undefined);
|
|
189
|
+
} else {
|
|
190
|
+
obj.objectStatusUpdates = [];
|
|
191
|
+
}
|
|
192
|
+
return obj;
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
create<I extends Exact<DeepPartial<QueryObjectStatusUpdatesResponse>, I>>(
|
|
196
|
+
base?: I,
|
|
197
|
+
): QueryObjectStatusUpdatesResponse {
|
|
198
|
+
return QueryObjectStatusUpdatesResponse.fromPartial(base ?? {});
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
fromPartial<I extends Exact<DeepPartial<QueryObjectStatusUpdatesResponse>, I>>(
|
|
202
|
+
object: I,
|
|
203
|
+
): QueryObjectStatusUpdatesResponse {
|
|
204
|
+
const message = createBaseQueryObjectStatusUpdatesResponse();
|
|
205
|
+
message.objectStatusUpdates = object.objectStatusUpdates?.map((e) => ObjectStatusUpdate.fromPartial(e)) || [];
|
|
206
|
+
return message;
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
function createBaseCreateObjectStatusUpdate(): CreateObjectStatusUpdate {
|
|
211
|
+
return { objectId: 0, status: ObjectStatus.OBJECT_STATUS_UNSPECIFIED };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const CreateObjectStatusUpdate = {
|
|
215
|
+
encode(message: CreateObjectStatusUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
216
|
+
if (message.objectId !== 0) {
|
|
217
|
+
writer.uint32(8).int32(message.objectId);
|
|
218
|
+
}
|
|
219
|
+
if (message.status !== ObjectStatus.OBJECT_STATUS_UNSPECIFIED) {
|
|
220
|
+
writer.uint32(16).int32(objectStatusToNumber(message.status));
|
|
221
|
+
}
|
|
222
|
+
return writer;
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): CreateObjectStatusUpdate {
|
|
226
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
227
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
228
|
+
const message = createBaseCreateObjectStatusUpdate();
|
|
229
|
+
while (reader.pos < end) {
|
|
230
|
+
const tag = reader.uint32();
|
|
231
|
+
switch (tag >>> 3) {
|
|
232
|
+
case 1:
|
|
233
|
+
if (tag !== 8) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message.objectId = reader.int32();
|
|
238
|
+
continue;
|
|
239
|
+
case 2:
|
|
240
|
+
if (tag !== 16) {
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
message.status = objectStatusFromJSON(reader.int32());
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
reader.skipType(tag & 7);
|
|
251
|
+
}
|
|
252
|
+
return message;
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
fromJSON(object: any): CreateObjectStatusUpdate {
|
|
256
|
+
return {
|
|
257
|
+
objectId: isSet(object.objectId) ? Number(object.objectId) : 0,
|
|
258
|
+
status: isSet(object.status) ? objectStatusFromJSON(object.status) : ObjectStatus.OBJECT_STATUS_UNSPECIFIED,
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
toJSON(message: CreateObjectStatusUpdate): unknown {
|
|
263
|
+
const obj: any = {};
|
|
264
|
+
message.objectId !== undefined && (obj.objectId = Math.round(message.objectId));
|
|
265
|
+
message.status !== undefined && (obj.status = objectStatusToJSON(message.status));
|
|
266
|
+
return obj;
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
create<I extends Exact<DeepPartial<CreateObjectStatusUpdate>, I>>(base?: I): CreateObjectStatusUpdate {
|
|
270
|
+
return CreateObjectStatusUpdate.fromPartial(base ?? {});
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
fromPartial<I extends Exact<DeepPartial<CreateObjectStatusUpdate>, I>>(object: I): CreateObjectStatusUpdate {
|
|
274
|
+
const message = createBaseCreateObjectStatusUpdate();
|
|
275
|
+
message.objectId = object.objectId ?? 0;
|
|
276
|
+
message.status = object.status ?? ObjectStatus.OBJECT_STATUS_UNSPECIFIED;
|
|
277
|
+
return message;
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
function createBaseUpdateObjectStatusUpdate(): UpdateObjectStatusUpdate {
|
|
282
|
+
return { objectId: 0, status: ObjectStatus.OBJECT_STATUS_UNSPECIFIED };
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export const UpdateObjectStatusUpdate = {
|
|
286
|
+
encode(message: UpdateObjectStatusUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
287
|
+
if (message.objectId !== 0) {
|
|
288
|
+
writer.uint32(8).int32(message.objectId);
|
|
289
|
+
}
|
|
290
|
+
if (message.status !== ObjectStatus.OBJECT_STATUS_UNSPECIFIED) {
|
|
291
|
+
writer.uint32(16).int32(objectStatusToNumber(message.status));
|
|
292
|
+
}
|
|
293
|
+
return writer;
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateObjectStatusUpdate {
|
|
297
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
298
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
299
|
+
const message = createBaseUpdateObjectStatusUpdate();
|
|
300
|
+
while (reader.pos < end) {
|
|
301
|
+
const tag = reader.uint32();
|
|
302
|
+
switch (tag >>> 3) {
|
|
303
|
+
case 1:
|
|
304
|
+
if (tag !== 8) {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
message.objectId = reader.int32();
|
|
309
|
+
continue;
|
|
310
|
+
case 2:
|
|
311
|
+
if (tag !== 16) {
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
message.status = objectStatusFromJSON(reader.int32());
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
reader.skipType(tag & 7);
|
|
322
|
+
}
|
|
323
|
+
return message;
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
fromJSON(object: any): UpdateObjectStatusUpdate {
|
|
327
|
+
return {
|
|
328
|
+
objectId: isSet(object.objectId) ? Number(object.objectId) : 0,
|
|
329
|
+
status: isSet(object.status) ? objectStatusFromJSON(object.status) : ObjectStatus.OBJECT_STATUS_UNSPECIFIED,
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
toJSON(message: UpdateObjectStatusUpdate): unknown {
|
|
334
|
+
const obj: any = {};
|
|
335
|
+
message.objectId !== undefined && (obj.objectId = Math.round(message.objectId));
|
|
336
|
+
message.status !== undefined && (obj.status = objectStatusToJSON(message.status));
|
|
337
|
+
return obj;
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
create<I extends Exact<DeepPartial<UpdateObjectStatusUpdate>, I>>(base?: I): UpdateObjectStatusUpdate {
|
|
341
|
+
return UpdateObjectStatusUpdate.fromPartial(base ?? {});
|
|
342
|
+
},
|
|
343
|
+
|
|
344
|
+
fromPartial<I extends Exact<DeepPartial<UpdateObjectStatusUpdate>, I>>(object: I): UpdateObjectStatusUpdate {
|
|
345
|
+
const message = createBaseUpdateObjectStatusUpdate();
|
|
346
|
+
message.objectId = object.objectId ?? 0;
|
|
347
|
+
message.status = object.status ?? ObjectStatus.OBJECT_STATUS_UNSPECIFIED;
|
|
348
|
+
return message;
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
function createBaseObjectStatusUpdate(): ObjectStatusUpdate {
|
|
353
|
+
return {
|
|
354
|
+
objectStatusId: 0,
|
|
355
|
+
objectId: 0,
|
|
356
|
+
createdAt: undefined,
|
|
357
|
+
updatedAt: undefined,
|
|
358
|
+
status: ObjectStatus.OBJECT_STATUS_UNSPECIFIED,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export const ObjectStatusUpdate = {
|
|
363
|
+
encode(message: ObjectStatusUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
364
|
+
if (message.objectStatusId !== 0) {
|
|
365
|
+
writer.uint32(8).int32(message.objectStatusId);
|
|
366
|
+
}
|
|
367
|
+
if (message.objectId !== 0) {
|
|
368
|
+
writer.uint32(16).int32(message.objectId);
|
|
369
|
+
}
|
|
370
|
+
if (message.createdAt !== undefined) {
|
|
371
|
+
Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).ldelim();
|
|
372
|
+
}
|
|
373
|
+
if (message.updatedAt !== undefined) {
|
|
374
|
+
Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(34).fork()).ldelim();
|
|
375
|
+
}
|
|
376
|
+
if (message.status !== ObjectStatus.OBJECT_STATUS_UNSPECIFIED) {
|
|
377
|
+
writer.uint32(40).int32(objectStatusToNumber(message.status));
|
|
378
|
+
}
|
|
379
|
+
return writer;
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ObjectStatusUpdate {
|
|
383
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
384
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
385
|
+
const message = createBaseObjectStatusUpdate();
|
|
386
|
+
while (reader.pos < end) {
|
|
387
|
+
const tag = reader.uint32();
|
|
388
|
+
switch (tag >>> 3) {
|
|
389
|
+
case 1:
|
|
390
|
+
if (tag !== 8) {
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
message.objectStatusId = reader.int32();
|
|
395
|
+
continue;
|
|
396
|
+
case 2:
|
|
397
|
+
if (tag !== 16) {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
message.objectId = reader.int32();
|
|
402
|
+
continue;
|
|
403
|
+
case 3:
|
|
404
|
+
if (tag !== 26) {
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
409
|
+
continue;
|
|
410
|
+
case 4:
|
|
411
|
+
if (tag !== 34) {
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
416
|
+
continue;
|
|
417
|
+
case 5:
|
|
418
|
+
if (tag !== 40) {
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
message.status = objectStatusFromJSON(reader.int32());
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
reader.skipType(tag & 7);
|
|
429
|
+
}
|
|
430
|
+
return message;
|
|
431
|
+
},
|
|
432
|
+
|
|
433
|
+
fromJSON(object: any): ObjectStatusUpdate {
|
|
434
|
+
return {
|
|
435
|
+
objectStatusId: isSet(object.objectStatusId) ? Number(object.objectStatusId) : 0,
|
|
436
|
+
objectId: isSet(object.objectId) ? Number(object.objectId) : 0,
|
|
437
|
+
createdAt: isSet(object.createdAt) ? String(object.createdAt) : undefined,
|
|
438
|
+
updatedAt: isSet(object.updatedAt) ? String(object.updatedAt) : undefined,
|
|
439
|
+
status: isSet(object.status) ? objectStatusFromJSON(object.status) : ObjectStatus.OBJECT_STATUS_UNSPECIFIED,
|
|
440
|
+
};
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
toJSON(message: ObjectStatusUpdate): unknown {
|
|
444
|
+
const obj: any = {};
|
|
445
|
+
message.objectStatusId !== undefined && (obj.objectStatusId = Math.round(message.objectStatusId));
|
|
446
|
+
message.objectId !== undefined && (obj.objectId = Math.round(message.objectId));
|
|
447
|
+
message.createdAt !== undefined && (obj.createdAt = message.createdAt);
|
|
448
|
+
message.updatedAt !== undefined && (obj.updatedAt = message.updatedAt);
|
|
449
|
+
message.status !== undefined && (obj.status = objectStatusToJSON(message.status));
|
|
450
|
+
return obj;
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
create<I extends Exact<DeepPartial<ObjectStatusUpdate>, I>>(base?: I): ObjectStatusUpdate {
|
|
454
|
+
return ObjectStatusUpdate.fromPartial(base ?? {});
|
|
455
|
+
},
|
|
456
|
+
|
|
457
|
+
fromPartial<I extends Exact<DeepPartial<ObjectStatusUpdate>, I>>(object: I): ObjectStatusUpdate {
|
|
458
|
+
const message = createBaseObjectStatusUpdate();
|
|
459
|
+
message.objectStatusId = object.objectStatusId ?? 0;
|
|
460
|
+
message.objectId = object.objectId ?? 0;
|
|
461
|
+
message.createdAt = object.createdAt ?? undefined;
|
|
462
|
+
message.updatedAt = object.updatedAt ?? undefined;
|
|
463
|
+
message.status = object.status ?? ObjectStatus.OBJECT_STATUS_UNSPECIFIED;
|
|
464
|
+
return message;
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
469
|
+
|
|
470
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
471
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
472
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
473
|
+
: Partial<T>;
|
|
474
|
+
|
|
475
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
476
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
477
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
478
|
+
|
|
479
|
+
function toTimestamp(dateStr: string): Timestamp {
|
|
480
|
+
const date = new Date(dateStr);
|
|
481
|
+
const seconds = date.getTime() / 1_000;
|
|
482
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
483
|
+
return { seconds, nanos };
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function fromTimestamp(t: Timestamp): string {
|
|
487
|
+
let millis = (t.seconds || 0) * 1_000;
|
|
488
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
489
|
+
return new Date(millis).toISOString();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function isSet(value: any): boolean {
|
|
493
|
+
return value !== null && value !== undefined;
|
|
494
|
+
}
|
package/package.json
CHANGED
package/shared/task_status.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
export const protobufPackage = "shared";
|
|
4
|
-
|
|
5
|
-
export enum TaskStatus {
|
|
6
|
-
TASK_STATUS_UNSPECIFIED = "TASK_STATUS_UNSPECIFIED",
|
|
7
|
-
NOT_STARTED = "NOT_STARTED",
|
|
8
|
-
READY_FOR_COLLECTION = "READY_FOR_COLLECTION",
|
|
9
|
-
OUT_FOR_COLLECTION = "OUT_FOR_COLLECTION",
|
|
10
|
-
COLLECTED = "COLLECTED",
|
|
11
|
-
OUT_FOR_DELIVERY = "OUT_FOR_DELIVERY",
|
|
12
|
-
COMPLETED = "COMPLETED",
|
|
13
|
-
FAILED = "FAILED",
|
|
14
|
-
CANCELLED = "CANCELLED",
|
|
15
|
-
UNRECOGNIZED = "UNRECOGNIZED",
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function taskStatusFromJSON(object: any): TaskStatus {
|
|
19
|
-
switch (object) {
|
|
20
|
-
case 0:
|
|
21
|
-
case "TASK_STATUS_UNSPECIFIED":
|
|
22
|
-
return TaskStatus.TASK_STATUS_UNSPECIFIED;
|
|
23
|
-
case 1:
|
|
24
|
-
case "NOT_STARTED":
|
|
25
|
-
return TaskStatus.NOT_STARTED;
|
|
26
|
-
case 2:
|
|
27
|
-
case "READY_FOR_COLLECTION":
|
|
28
|
-
return TaskStatus.READY_FOR_COLLECTION;
|
|
29
|
-
case 3:
|
|
30
|
-
case "OUT_FOR_COLLECTION":
|
|
31
|
-
return TaskStatus.OUT_FOR_COLLECTION;
|
|
32
|
-
case 4:
|
|
33
|
-
case "COLLECTED":
|
|
34
|
-
return TaskStatus.COLLECTED;
|
|
35
|
-
case 5:
|
|
36
|
-
case "OUT_FOR_DELIVERY":
|
|
37
|
-
return TaskStatus.OUT_FOR_DELIVERY;
|
|
38
|
-
case 6:
|
|
39
|
-
case "COMPLETED":
|
|
40
|
-
return TaskStatus.COMPLETED;
|
|
41
|
-
case 7:
|
|
42
|
-
case "FAILED":
|
|
43
|
-
return TaskStatus.FAILED;
|
|
44
|
-
case 8:
|
|
45
|
-
case "CANCELLED":
|
|
46
|
-
return TaskStatus.CANCELLED;
|
|
47
|
-
case -1:
|
|
48
|
-
case "UNRECOGNIZED":
|
|
49
|
-
default:
|
|
50
|
-
return TaskStatus.UNRECOGNIZED;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function taskStatusToJSON(object: TaskStatus): string {
|
|
55
|
-
switch (object) {
|
|
56
|
-
case TaskStatus.TASK_STATUS_UNSPECIFIED:
|
|
57
|
-
return "TASK_STATUS_UNSPECIFIED";
|
|
58
|
-
case TaskStatus.NOT_STARTED:
|
|
59
|
-
return "NOT_STARTED";
|
|
60
|
-
case TaskStatus.READY_FOR_COLLECTION:
|
|
61
|
-
return "READY_FOR_COLLECTION";
|
|
62
|
-
case TaskStatus.OUT_FOR_COLLECTION:
|
|
63
|
-
return "OUT_FOR_COLLECTION";
|
|
64
|
-
case TaskStatus.COLLECTED:
|
|
65
|
-
return "COLLECTED";
|
|
66
|
-
case TaskStatus.OUT_FOR_DELIVERY:
|
|
67
|
-
return "OUT_FOR_DELIVERY";
|
|
68
|
-
case TaskStatus.COMPLETED:
|
|
69
|
-
return "COMPLETED";
|
|
70
|
-
case TaskStatus.FAILED:
|
|
71
|
-
return "FAILED";
|
|
72
|
-
case TaskStatus.CANCELLED:
|
|
73
|
-
return "CANCELLED";
|
|
74
|
-
case TaskStatus.UNRECOGNIZED:
|
|
75
|
-
default:
|
|
76
|
-
return "UNRECOGNIZED";
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function taskStatusToNumber(object: TaskStatus): number {
|
|
81
|
-
switch (object) {
|
|
82
|
-
case TaskStatus.TASK_STATUS_UNSPECIFIED:
|
|
83
|
-
return 0;
|
|
84
|
-
case TaskStatus.NOT_STARTED:
|
|
85
|
-
return 1;
|
|
86
|
-
case TaskStatus.READY_FOR_COLLECTION:
|
|
87
|
-
return 2;
|
|
88
|
-
case TaskStatus.OUT_FOR_COLLECTION:
|
|
89
|
-
return 3;
|
|
90
|
-
case TaskStatus.COLLECTED:
|
|
91
|
-
return 4;
|
|
92
|
-
case TaskStatus.OUT_FOR_DELIVERY:
|
|
93
|
-
return 5;
|
|
94
|
-
case TaskStatus.COMPLETED:
|
|
95
|
-
return 6;
|
|
96
|
-
case TaskStatus.FAILED:
|
|
97
|
-
return 7;
|
|
98
|
-
case TaskStatus.CANCELLED:
|
|
99
|
-
return 8;
|
|
100
|
-
case TaskStatus.UNRECOGNIZED:
|
|
101
|
-
default:
|
|
102
|
-
return -1;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export enum TaskSubstatus {
|
|
107
|
-
TASK_SUBSTATUS_UNSPECIFIED = "TASK_SUBSTATUS_UNSPECIFIED",
|
|
108
|
-
UNDELIVERABLE = "UNDELIVERABLE",
|
|
109
|
-
UNRECOGNIZED = "UNRECOGNIZED",
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function taskSubstatusFromJSON(object: any): TaskSubstatus {
|
|
113
|
-
switch (object) {
|
|
114
|
-
case 0:
|
|
115
|
-
case "TASK_SUBSTATUS_UNSPECIFIED":
|
|
116
|
-
return TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED;
|
|
117
|
-
case 1:
|
|
118
|
-
case "UNDELIVERABLE":
|
|
119
|
-
return TaskSubstatus.UNDELIVERABLE;
|
|
120
|
-
case -1:
|
|
121
|
-
case "UNRECOGNIZED":
|
|
122
|
-
default:
|
|
123
|
-
return TaskSubstatus.UNRECOGNIZED;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function taskSubstatusToJSON(object: TaskSubstatus): string {
|
|
128
|
-
switch (object) {
|
|
129
|
-
case TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED:
|
|
130
|
-
return "TASK_SUBSTATUS_UNSPECIFIED";
|
|
131
|
-
case TaskSubstatus.UNDELIVERABLE:
|
|
132
|
-
return "UNDELIVERABLE";
|
|
133
|
-
case TaskSubstatus.UNRECOGNIZED:
|
|
134
|
-
default:
|
|
135
|
-
return "UNRECOGNIZED";
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export function taskSubstatusToNumber(object: TaskSubstatus): number {
|
|
140
|
-
switch (object) {
|
|
141
|
-
case TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED:
|
|
142
|
-
return 0;
|
|
143
|
-
case TaskSubstatus.UNDELIVERABLE:
|
|
144
|
-
return 1;
|
|
145
|
-
case TaskSubstatus.UNRECOGNIZED:
|
|
146
|
-
default:
|
|
147
|
-
return -1;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Timestamp } from "../google/protobuf/timestamp";
|
|
4
|
-
import {
|
|
5
|
-
TaskStatus,
|
|
6
|
-
taskStatusFromJSON,
|
|
7
|
-
taskStatusToJSON,
|
|
8
|
-
taskStatusToNumber,
|
|
9
|
-
TaskSubstatus,
|
|
10
|
-
taskSubstatusFromJSON,
|
|
11
|
-
taskSubstatusToJSON,
|
|
12
|
-
taskSubstatusToNumber,
|
|
13
|
-
} from "./task_status";
|
|
14
|
-
import { UserGroup, userGroupFromJSON, userGroupToJSON, userGroupToNumber } from "./user_group";
|
|
15
|
-
|
|
16
|
-
export const protobufPackage = "shared";
|
|
17
|
-
|
|
18
|
-
/** In controller service this is used as the create request as well as the type */
|
|
19
|
-
export interface TaskStatusUpdate {
|
|
20
|
-
taskStatusId: number;
|
|
21
|
-
createdAt: string | undefined;
|
|
22
|
-
userGroup: UserGroup;
|
|
23
|
-
taskId: number;
|
|
24
|
-
value: TaskStatus;
|
|
25
|
-
subvalue: TaskSubstatus;
|
|
26
|
-
note: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function createBaseTaskStatusUpdate(): TaskStatusUpdate {
|
|
30
|
-
return {
|
|
31
|
-
taskStatusId: 0,
|
|
32
|
-
createdAt: undefined,
|
|
33
|
-
userGroup: UserGroup.USER_GROUP_UNSPECIFIED,
|
|
34
|
-
taskId: 0,
|
|
35
|
-
value: TaskStatus.TASK_STATUS_UNSPECIFIED,
|
|
36
|
-
subvalue: TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED,
|
|
37
|
-
note: "",
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const TaskStatusUpdate = {
|
|
42
|
-
encode(message: TaskStatusUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
43
|
-
if (message.taskStatusId !== 0) {
|
|
44
|
-
writer.uint32(8).int32(message.taskStatusId);
|
|
45
|
-
}
|
|
46
|
-
if (message.createdAt !== undefined) {
|
|
47
|
-
Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(18).fork()).ldelim();
|
|
48
|
-
}
|
|
49
|
-
if (message.userGroup !== UserGroup.USER_GROUP_UNSPECIFIED) {
|
|
50
|
-
writer.uint32(24).int32(userGroupToNumber(message.userGroup));
|
|
51
|
-
}
|
|
52
|
-
if (message.taskId !== 0) {
|
|
53
|
-
writer.uint32(32).int32(message.taskId);
|
|
54
|
-
}
|
|
55
|
-
if (message.value !== TaskStatus.TASK_STATUS_UNSPECIFIED) {
|
|
56
|
-
writer.uint32(40).int32(taskStatusToNumber(message.value));
|
|
57
|
-
}
|
|
58
|
-
if (message.subvalue !== TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED) {
|
|
59
|
-
writer.uint32(48).int32(taskSubstatusToNumber(message.subvalue));
|
|
60
|
-
}
|
|
61
|
-
if (message.note !== "") {
|
|
62
|
-
writer.uint32(58).string(message.note);
|
|
63
|
-
}
|
|
64
|
-
return writer;
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): TaskStatusUpdate {
|
|
68
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
69
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
70
|
-
const message = createBaseTaskStatusUpdate();
|
|
71
|
-
while (reader.pos < end) {
|
|
72
|
-
const tag = reader.uint32();
|
|
73
|
-
switch (tag >>> 3) {
|
|
74
|
-
case 1:
|
|
75
|
-
if (tag !== 8) {
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
message.taskStatusId = reader.int32();
|
|
80
|
-
continue;
|
|
81
|
-
case 2:
|
|
82
|
-
if (tag !== 18) {
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
87
|
-
continue;
|
|
88
|
-
case 3:
|
|
89
|
-
if (tag !== 24) {
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
message.userGroup = userGroupFromJSON(reader.int32());
|
|
94
|
-
continue;
|
|
95
|
-
case 4:
|
|
96
|
-
if (tag !== 32) {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
message.taskId = reader.int32();
|
|
101
|
-
continue;
|
|
102
|
-
case 5:
|
|
103
|
-
if (tag !== 40) {
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
message.value = taskStatusFromJSON(reader.int32());
|
|
108
|
-
continue;
|
|
109
|
-
case 6:
|
|
110
|
-
if (tag !== 48) {
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
message.subvalue = taskSubstatusFromJSON(reader.int32());
|
|
115
|
-
continue;
|
|
116
|
-
case 7:
|
|
117
|
-
if (tag !== 58) {
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
message.note = reader.string();
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
reader.skipType(tag & 7);
|
|
128
|
-
}
|
|
129
|
-
return message;
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
fromJSON(object: any): TaskStatusUpdate {
|
|
133
|
-
return {
|
|
134
|
-
taskStatusId: isSet(object.taskStatusId) ? Number(object.taskStatusId) : 0,
|
|
135
|
-
createdAt: isSet(object.createdAt) ? String(object.createdAt) : undefined,
|
|
136
|
-
userGroup: isSet(object.userGroup) ? userGroupFromJSON(object.userGroup) : UserGroup.USER_GROUP_UNSPECIFIED,
|
|
137
|
-
taskId: isSet(object.taskId) ? Number(object.taskId) : 0,
|
|
138
|
-
value: isSet(object.value) ? taskStatusFromJSON(object.value) : TaskStatus.TASK_STATUS_UNSPECIFIED,
|
|
139
|
-
subvalue: isSet(object.subvalue)
|
|
140
|
-
? taskSubstatusFromJSON(object.subvalue)
|
|
141
|
-
: TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED,
|
|
142
|
-
note: isSet(object.note) ? String(object.note) : "",
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
toJSON(message: TaskStatusUpdate): unknown {
|
|
147
|
-
const obj: any = {};
|
|
148
|
-
message.taskStatusId !== undefined && (obj.taskStatusId = Math.round(message.taskStatusId));
|
|
149
|
-
message.createdAt !== undefined && (obj.createdAt = message.createdAt);
|
|
150
|
-
message.userGroup !== undefined && (obj.userGroup = userGroupToJSON(message.userGroup));
|
|
151
|
-
message.taskId !== undefined && (obj.taskId = Math.round(message.taskId));
|
|
152
|
-
message.value !== undefined && (obj.value = taskStatusToJSON(message.value));
|
|
153
|
-
message.subvalue !== undefined && (obj.subvalue = taskSubstatusToJSON(message.subvalue));
|
|
154
|
-
message.note !== undefined && (obj.note = message.note);
|
|
155
|
-
return obj;
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
create<I extends Exact<DeepPartial<TaskStatusUpdate>, I>>(base?: I): TaskStatusUpdate {
|
|
159
|
-
return TaskStatusUpdate.fromPartial(base ?? {});
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
fromPartial<I extends Exact<DeepPartial<TaskStatusUpdate>, I>>(object: I): TaskStatusUpdate {
|
|
163
|
-
const message = createBaseTaskStatusUpdate();
|
|
164
|
-
message.taskStatusId = object.taskStatusId ?? 0;
|
|
165
|
-
message.createdAt = object.createdAt ?? undefined;
|
|
166
|
-
message.userGroup = object.userGroup ?? UserGroup.USER_GROUP_UNSPECIFIED;
|
|
167
|
-
message.taskId = object.taskId ?? 0;
|
|
168
|
-
message.value = object.value ?? TaskStatus.TASK_STATUS_UNSPECIFIED;
|
|
169
|
-
message.subvalue = object.subvalue ?? TaskSubstatus.TASK_SUBSTATUS_UNSPECIFIED;
|
|
170
|
-
message.note = object.note ?? "";
|
|
171
|
-
return message;
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
176
|
-
|
|
177
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
178
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
179
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
180
|
-
: Partial<T>;
|
|
181
|
-
|
|
182
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
183
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
184
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
185
|
-
|
|
186
|
-
function toTimestamp(dateStr: string): Timestamp {
|
|
187
|
-
const date = new Date(dateStr);
|
|
188
|
-
const seconds = date.getTime() / 1_000;
|
|
189
|
-
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
190
|
-
return { seconds, nanos };
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function fromTimestamp(t: Timestamp): string {
|
|
194
|
-
let millis = (t.seconds || 0) * 1_000;
|
|
195
|
-
millis += (t.nanos || 0) / 1_000_000;
|
|
196
|
-
return new Date(millis).toISOString();
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function isSet(value: any): boolean {
|
|
200
|
-
return value !== null && value !== undefined;
|
|
201
|
-
}
|