@fraym/proto 0.9.1 → 0.10.0
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/freym/sync/management/lease.d.ts +29 -0
- package/freym/sync/management/lease.js +214 -3
- package/freym/sync/management/service.d.ts +1 -15
- package/freym/sync/management/service.js +0 -10
- package/freym/sync/management.d.ts +1 -2
- package/freym/sync/management.js +3 -12
- package/package.json +1 -1
- package/freym/sync/management/locking.d.ts +0 -156
- package/freym/sync/management/locking.js +0 -824
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import _m0 from "protobufjs/minimal";
|
|
2
2
|
export declare const protobufPackage = "freym.sync.management";
|
|
3
|
+
export interface LocalLock {
|
|
4
|
+
leaseId: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
globalConcern: string;
|
|
7
|
+
localConcern: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GlobalLock {
|
|
10
|
+
leaseId: string;
|
|
11
|
+
tenantId: string;
|
|
12
|
+
globalConcern: string;
|
|
13
|
+
}
|
|
3
14
|
export interface CreateLeaseRequest {
|
|
4
15
|
ip: string;
|
|
5
16
|
app: string;
|
|
6
17
|
ttl: number;
|
|
18
|
+
alreadyRegisteredLocalLocks: LocalLock[];
|
|
19
|
+
alreadyRegisteredGlobalLocks: GlobalLock[];
|
|
7
20
|
}
|
|
8
21
|
export interface CreateLeaseResponse {
|
|
9
22
|
leaseId: string;
|
|
@@ -19,6 +32,22 @@ export interface DropLeaseRequest {
|
|
|
19
32
|
}
|
|
20
33
|
export interface DropLeaseResponse {
|
|
21
34
|
}
|
|
35
|
+
export declare const LocalLock: {
|
|
36
|
+
encode(message: LocalLock, writer?: _m0.Writer): _m0.Writer;
|
|
37
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LocalLock;
|
|
38
|
+
fromJSON(object: any): LocalLock;
|
|
39
|
+
toJSON(message: LocalLock): unknown;
|
|
40
|
+
create(base?: DeepPartial<LocalLock>): LocalLock;
|
|
41
|
+
fromPartial(object: DeepPartial<LocalLock>): LocalLock;
|
|
42
|
+
};
|
|
43
|
+
export declare const GlobalLock: {
|
|
44
|
+
encode(message: GlobalLock, writer?: _m0.Writer): _m0.Writer;
|
|
45
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): GlobalLock;
|
|
46
|
+
fromJSON(object: any): GlobalLock;
|
|
47
|
+
toJSON(message: GlobalLock): unknown;
|
|
48
|
+
create(base?: DeepPartial<GlobalLock>): GlobalLock;
|
|
49
|
+
fromPartial(object: DeepPartial<GlobalLock>): GlobalLock;
|
|
50
|
+
};
|
|
22
51
|
export declare const CreateLeaseRequest: {
|
|
23
52
|
encode(message: CreateLeaseRequest, writer?: _m0.Writer): _m0.Writer;
|
|
24
53
|
decode(input: _m0.Reader | Uint8Array, length?: number): CreateLeaseRequest;
|
|
@@ -3,11 +3,187 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DropLeaseResponse = exports.DropLeaseRequest = exports.KeepLeaseResponse = exports.KeepLeaseRequest = exports.CreateLeaseResponse = exports.CreateLeaseRequest = exports.protobufPackage = void 0;
|
|
6
|
+
exports.DropLeaseResponse = exports.DropLeaseRequest = exports.KeepLeaseResponse = exports.KeepLeaseRequest = exports.CreateLeaseResponse = exports.CreateLeaseRequest = exports.GlobalLock = exports.LocalLock = exports.protobufPackage = void 0;
|
|
7
7
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
8
8
|
exports.protobufPackage = "freym.sync.management";
|
|
9
|
+
function createBaseLocalLock() {
|
|
10
|
+
return { leaseId: "", tenantId: "", globalConcern: "", localConcern: "" };
|
|
11
|
+
}
|
|
12
|
+
exports.LocalLock = {
|
|
13
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
14
|
+
if (message.leaseId !== "") {
|
|
15
|
+
writer.uint32(10).string(message.leaseId);
|
|
16
|
+
}
|
|
17
|
+
if (message.tenantId !== "") {
|
|
18
|
+
writer.uint32(18).string(message.tenantId);
|
|
19
|
+
}
|
|
20
|
+
if (message.globalConcern !== "") {
|
|
21
|
+
writer.uint32(26).string(message.globalConcern);
|
|
22
|
+
}
|
|
23
|
+
if (message.localConcern !== "") {
|
|
24
|
+
writer.uint32(34).string(message.localConcern);
|
|
25
|
+
}
|
|
26
|
+
return writer;
|
|
27
|
+
},
|
|
28
|
+
decode(input, length) {
|
|
29
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
30
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
31
|
+
const message = createBaseLocalLock();
|
|
32
|
+
while (reader.pos < end) {
|
|
33
|
+
const tag = reader.uint32();
|
|
34
|
+
switch (tag >>> 3) {
|
|
35
|
+
case 1:
|
|
36
|
+
if (tag !== 10) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
message.leaseId = reader.string();
|
|
40
|
+
continue;
|
|
41
|
+
case 2:
|
|
42
|
+
if (tag !== 18) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
message.tenantId = reader.string();
|
|
46
|
+
continue;
|
|
47
|
+
case 3:
|
|
48
|
+
if (tag !== 26) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
message.globalConcern = reader.string();
|
|
52
|
+
continue;
|
|
53
|
+
case 4:
|
|
54
|
+
if (tag !== 34) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
message.localConcern = reader.string();
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
reader.skipType(tag & 7);
|
|
64
|
+
}
|
|
65
|
+
return message;
|
|
66
|
+
},
|
|
67
|
+
fromJSON(object) {
|
|
68
|
+
return {
|
|
69
|
+
leaseId: isSet(object.leaseId) ? globalThis.String(object.leaseId) : "",
|
|
70
|
+
tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
|
|
71
|
+
globalConcern: isSet(object.globalConcern) ? globalThis.String(object.globalConcern) : "",
|
|
72
|
+
localConcern: isSet(object.localConcern) ? globalThis.String(object.localConcern) : "",
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
toJSON(message) {
|
|
76
|
+
const obj = {};
|
|
77
|
+
if (message.leaseId !== "") {
|
|
78
|
+
obj.leaseId = message.leaseId;
|
|
79
|
+
}
|
|
80
|
+
if (message.tenantId !== "") {
|
|
81
|
+
obj.tenantId = message.tenantId;
|
|
82
|
+
}
|
|
83
|
+
if (message.globalConcern !== "") {
|
|
84
|
+
obj.globalConcern = message.globalConcern;
|
|
85
|
+
}
|
|
86
|
+
if (message.localConcern !== "") {
|
|
87
|
+
obj.localConcern = message.localConcern;
|
|
88
|
+
}
|
|
89
|
+
return obj;
|
|
90
|
+
},
|
|
91
|
+
create(base) {
|
|
92
|
+
return exports.LocalLock.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
93
|
+
},
|
|
94
|
+
fromPartial(object) {
|
|
95
|
+
var _a, _b, _c, _d;
|
|
96
|
+
const message = createBaseLocalLock();
|
|
97
|
+
message.leaseId = (_a = object.leaseId) !== null && _a !== void 0 ? _a : "";
|
|
98
|
+
message.tenantId = (_b = object.tenantId) !== null && _b !== void 0 ? _b : "";
|
|
99
|
+
message.globalConcern = (_c = object.globalConcern) !== null && _c !== void 0 ? _c : "";
|
|
100
|
+
message.localConcern = (_d = object.localConcern) !== null && _d !== void 0 ? _d : "";
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
function createBaseGlobalLock() {
|
|
105
|
+
return { leaseId: "", tenantId: "", globalConcern: "" };
|
|
106
|
+
}
|
|
107
|
+
exports.GlobalLock = {
|
|
108
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
109
|
+
if (message.leaseId !== "") {
|
|
110
|
+
writer.uint32(10).string(message.leaseId);
|
|
111
|
+
}
|
|
112
|
+
if (message.tenantId !== "") {
|
|
113
|
+
writer.uint32(18).string(message.tenantId);
|
|
114
|
+
}
|
|
115
|
+
if (message.globalConcern !== "") {
|
|
116
|
+
writer.uint32(26).string(message.globalConcern);
|
|
117
|
+
}
|
|
118
|
+
return writer;
|
|
119
|
+
},
|
|
120
|
+
decode(input, length) {
|
|
121
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
122
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
123
|
+
const message = createBaseGlobalLock();
|
|
124
|
+
while (reader.pos < end) {
|
|
125
|
+
const tag = reader.uint32();
|
|
126
|
+
switch (tag >>> 3) {
|
|
127
|
+
case 1:
|
|
128
|
+
if (tag !== 10) {
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
message.leaseId = reader.string();
|
|
132
|
+
continue;
|
|
133
|
+
case 2:
|
|
134
|
+
if (tag !== 18) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
message.tenantId = reader.string();
|
|
138
|
+
continue;
|
|
139
|
+
case 3:
|
|
140
|
+
if (tag !== 26) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
message.globalConcern = reader.string();
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
reader.skipType(tag & 7);
|
|
150
|
+
}
|
|
151
|
+
return message;
|
|
152
|
+
},
|
|
153
|
+
fromJSON(object) {
|
|
154
|
+
return {
|
|
155
|
+
leaseId: isSet(object.leaseId) ? globalThis.String(object.leaseId) : "",
|
|
156
|
+
tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
|
|
157
|
+
globalConcern: isSet(object.globalConcern) ? globalThis.String(object.globalConcern) : "",
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
toJSON(message) {
|
|
161
|
+
const obj = {};
|
|
162
|
+
if (message.leaseId !== "") {
|
|
163
|
+
obj.leaseId = message.leaseId;
|
|
164
|
+
}
|
|
165
|
+
if (message.tenantId !== "") {
|
|
166
|
+
obj.tenantId = message.tenantId;
|
|
167
|
+
}
|
|
168
|
+
if (message.globalConcern !== "") {
|
|
169
|
+
obj.globalConcern = message.globalConcern;
|
|
170
|
+
}
|
|
171
|
+
return obj;
|
|
172
|
+
},
|
|
173
|
+
create(base) {
|
|
174
|
+
return exports.GlobalLock.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
175
|
+
},
|
|
176
|
+
fromPartial(object) {
|
|
177
|
+
var _a, _b, _c;
|
|
178
|
+
const message = createBaseGlobalLock();
|
|
179
|
+
message.leaseId = (_a = object.leaseId) !== null && _a !== void 0 ? _a : "";
|
|
180
|
+
message.tenantId = (_b = object.tenantId) !== null && _b !== void 0 ? _b : "";
|
|
181
|
+
message.globalConcern = (_c = object.globalConcern) !== null && _c !== void 0 ? _c : "";
|
|
182
|
+
return message;
|
|
183
|
+
},
|
|
184
|
+
};
|
|
9
185
|
function createBaseCreateLeaseRequest() {
|
|
10
|
-
return { ip: "", app: "", ttl: 0 };
|
|
186
|
+
return { ip: "", app: "", ttl: 0, alreadyRegisteredLocalLocks: [], alreadyRegisteredGlobalLocks: [] };
|
|
11
187
|
}
|
|
12
188
|
exports.CreateLeaseRequest = {
|
|
13
189
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
@@ -20,6 +196,12 @@ exports.CreateLeaseRequest = {
|
|
|
20
196
|
if (message.ttl !== 0) {
|
|
21
197
|
writer.uint32(24).int32(message.ttl);
|
|
22
198
|
}
|
|
199
|
+
for (const v of message.alreadyRegisteredLocalLocks) {
|
|
200
|
+
exports.LocalLock.encode(v, writer.uint32(34).fork()).ldelim();
|
|
201
|
+
}
|
|
202
|
+
for (const v of message.alreadyRegisteredGlobalLocks) {
|
|
203
|
+
exports.GlobalLock.encode(v, writer.uint32(42).fork()).ldelim();
|
|
204
|
+
}
|
|
23
205
|
return writer;
|
|
24
206
|
},
|
|
25
207
|
decode(input, length) {
|
|
@@ -47,6 +229,18 @@ exports.CreateLeaseRequest = {
|
|
|
47
229
|
}
|
|
48
230
|
message.ttl = reader.int32();
|
|
49
231
|
continue;
|
|
232
|
+
case 4:
|
|
233
|
+
if (tag !== 34) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
message.alreadyRegisteredLocalLocks.push(exports.LocalLock.decode(reader, reader.uint32()));
|
|
237
|
+
continue;
|
|
238
|
+
case 5:
|
|
239
|
+
if (tag !== 42) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
message.alreadyRegisteredGlobalLocks.push(exports.GlobalLock.decode(reader, reader.uint32()));
|
|
243
|
+
continue;
|
|
50
244
|
}
|
|
51
245
|
if ((tag & 7) === 4 || tag === 0) {
|
|
52
246
|
break;
|
|
@@ -60,9 +254,16 @@ exports.CreateLeaseRequest = {
|
|
|
60
254
|
ip: isSet(object.ip) ? globalThis.String(object.ip) : "",
|
|
61
255
|
app: isSet(object.app) ? globalThis.String(object.app) : "",
|
|
62
256
|
ttl: isSet(object.ttl) ? globalThis.Number(object.ttl) : 0,
|
|
257
|
+
alreadyRegisteredLocalLocks: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.alreadyRegisteredLocalLocks)
|
|
258
|
+
? object.alreadyRegisteredLocalLocks.map((e) => exports.LocalLock.fromJSON(e))
|
|
259
|
+
: [],
|
|
260
|
+
alreadyRegisteredGlobalLocks: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.alreadyRegisteredGlobalLocks)
|
|
261
|
+
? object.alreadyRegisteredGlobalLocks.map((e) => exports.GlobalLock.fromJSON(e))
|
|
262
|
+
: [],
|
|
63
263
|
};
|
|
64
264
|
},
|
|
65
265
|
toJSON(message) {
|
|
266
|
+
var _a, _b;
|
|
66
267
|
const obj = {};
|
|
67
268
|
if (message.ip !== "") {
|
|
68
269
|
obj.ip = message.ip;
|
|
@@ -73,17 +274,27 @@ exports.CreateLeaseRequest = {
|
|
|
73
274
|
if (message.ttl !== 0) {
|
|
74
275
|
obj.ttl = Math.round(message.ttl);
|
|
75
276
|
}
|
|
277
|
+
if ((_a = message.alreadyRegisteredLocalLocks) === null || _a === void 0 ? void 0 : _a.length) {
|
|
278
|
+
obj.alreadyRegisteredLocalLocks = message.alreadyRegisteredLocalLocks.map((e) => exports.LocalLock.toJSON(e));
|
|
279
|
+
}
|
|
280
|
+
if ((_b = message.alreadyRegisteredGlobalLocks) === null || _b === void 0 ? void 0 : _b.length) {
|
|
281
|
+
obj.alreadyRegisteredGlobalLocks = message.alreadyRegisteredGlobalLocks.map((e) => exports.GlobalLock.toJSON(e));
|
|
282
|
+
}
|
|
76
283
|
return obj;
|
|
77
284
|
},
|
|
78
285
|
create(base) {
|
|
79
286
|
return exports.CreateLeaseRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
80
287
|
},
|
|
81
288
|
fromPartial(object) {
|
|
82
|
-
var _a, _b, _c;
|
|
289
|
+
var _a, _b, _c, _d, _e;
|
|
83
290
|
const message = createBaseCreateLeaseRequest();
|
|
84
291
|
message.ip = (_a = object.ip) !== null && _a !== void 0 ? _a : "";
|
|
85
292
|
message.app = (_b = object.app) !== null && _b !== void 0 ? _b : "";
|
|
86
293
|
message.ttl = (_c = object.ttl) !== null && _c !== void 0 ? _c : 0;
|
|
294
|
+
message.alreadyRegisteredLocalLocks = ((_d = object.alreadyRegisteredLocalLocks) === null || _d === void 0 ? void 0 : _d.map((e) => exports.LocalLock.fromPartial(e))) ||
|
|
295
|
+
[];
|
|
296
|
+
message.alreadyRegisteredGlobalLocks = ((_e = object.alreadyRegisteredGlobalLocks) === null || _e === void 0 ? void 0 : _e.map((e) => exports.GlobalLock.fromPartial(e))) ||
|
|
297
|
+
[];
|
|
87
298
|
return message;
|
|
88
299
|
},
|
|
89
300
|
};
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ChannelCredentials, Client,
|
|
2
|
+
import { ChannelCredentials, Client, ClientReadableStream, handleServerStreamingCall, Metadata } from "@grpc/grpc-js";
|
|
3
3
|
import type { CallOptions, ClientOptions, ClientUnaryCall, handleUnaryCall, ServiceError, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
4
4
|
import { CreateLeaseRequest, CreateLeaseResponse, DropLeaseRequest, DropLeaseResponse, KeepLeaseRequest, KeepLeaseResponse } from "./lease";
|
|
5
5
|
import { GlobalLockRequest, GlobalLockResponse, GlobalUnlockRequest, GlobalUnlockResponse, LocalLockRequest, LocalLockResponse, LocalUnlockRequest, LocalUnlockResponse } from "./lock";
|
|
6
|
-
import { LockingRequest, LockingResponse } from "./locking";
|
|
7
6
|
import { GetPeerNodesRequest, GetPeerNodesResponse } from "./peer_nodes";
|
|
8
7
|
export declare const protobufPackage = "freym.sync.management";
|
|
9
8
|
export type ServiceService = typeof ServiceService;
|
|
10
9
|
export declare const ServiceService: {
|
|
11
|
-
readonly locking: {
|
|
12
|
-
readonly path: "/freym.sync.management.Service/Locking";
|
|
13
|
-
readonly requestStream: true;
|
|
14
|
-
readonly responseStream: true;
|
|
15
|
-
readonly requestSerialize: (value: LockingRequest) => Buffer;
|
|
16
|
-
readonly requestDeserialize: (value: Buffer) => LockingRequest;
|
|
17
|
-
readonly responseSerialize: (value: LockingResponse) => Buffer;
|
|
18
|
-
readonly responseDeserialize: (value: Buffer) => LockingResponse;
|
|
19
|
-
};
|
|
20
10
|
readonly createLease: {
|
|
21
11
|
readonly path: "/freym.sync.management.Service/CreateLease";
|
|
22
12
|
readonly requestStream: false;
|
|
@@ -91,7 +81,6 @@ export declare const ServiceService: {
|
|
|
91
81
|
};
|
|
92
82
|
};
|
|
93
83
|
export interface ServiceServer extends UntypedServiceImplementation {
|
|
94
|
-
locking: handleBidiStreamingCall<LockingRequest, LockingResponse>;
|
|
95
84
|
createLease: handleUnaryCall<CreateLeaseRequest, CreateLeaseResponse>;
|
|
96
85
|
keepLease: handleUnaryCall<KeepLeaseRequest, KeepLeaseResponse>;
|
|
97
86
|
dropLease: handleUnaryCall<DropLeaseRequest, DropLeaseResponse>;
|
|
@@ -102,9 +91,6 @@ export interface ServiceServer extends UntypedServiceImplementation {
|
|
|
102
91
|
globalUnlock: handleUnaryCall<GlobalUnlockRequest, GlobalUnlockResponse>;
|
|
103
92
|
}
|
|
104
93
|
export interface ServiceClient extends Client {
|
|
105
|
-
locking(): ClientDuplexStream<LockingRequest, LockingResponse>;
|
|
106
|
-
locking(options: Partial<CallOptions>): ClientDuplexStream<LockingRequest, LockingResponse>;
|
|
107
|
-
locking(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<LockingRequest, LockingResponse>;
|
|
108
94
|
createLease(request: CreateLeaseRequest, callback: (error: ServiceError | null, response: CreateLeaseResponse) => void): ClientUnaryCall;
|
|
109
95
|
createLease(request: CreateLeaseRequest, metadata: Metadata, callback: (error: ServiceError | null, response: CreateLeaseResponse) => void): ClientUnaryCall;
|
|
110
96
|
createLease(request: CreateLeaseRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: CreateLeaseResponse) => void): ClientUnaryCall;
|
|
@@ -4,19 +4,9 @@ exports.ServiceClient = exports.ServiceService = exports.protobufPackage = void
|
|
|
4
4
|
const grpc_js_1 = require("@grpc/grpc-js");
|
|
5
5
|
const lease_1 = require("./lease");
|
|
6
6
|
const lock_1 = require("./lock");
|
|
7
|
-
const locking_1 = require("./locking");
|
|
8
7
|
const peer_nodes_1 = require("./peer_nodes");
|
|
9
8
|
exports.protobufPackage = "freym.sync.management";
|
|
10
9
|
exports.ServiceService = {
|
|
11
|
-
locking: {
|
|
12
|
-
path: "/freym.sync.management.Service/Locking",
|
|
13
|
-
requestStream: true,
|
|
14
|
-
responseStream: true,
|
|
15
|
-
requestSerialize: (value) => Buffer.from(locking_1.LockingRequest.encode(value).finish()),
|
|
16
|
-
requestDeserialize: (value) => locking_1.LockingRequest.decode(value),
|
|
17
|
-
responseSerialize: (value) => Buffer.from(locking_1.LockingResponse.encode(value).finish()),
|
|
18
|
-
responseDeserialize: (value) => locking_1.LockingResponse.decode(value),
|
|
19
|
-
},
|
|
20
10
|
createLease: {
|
|
21
11
|
path: "/freym.sync.management.Service/CreateLease",
|
|
22
12
|
requestStream: false,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { ServiceClient, ServiceServer, ServiceService } from "./management/service";
|
|
2
|
-
export { CreateLeaseRequest, CreateLeaseResponse, DropLeaseRequest, DropLeaseResponse, KeepLeaseRequest, KeepLeaseResponse, } from "./management/lease";
|
|
2
|
+
export { CreateLeaseRequest, CreateLeaseResponse, DropLeaseRequest, DropLeaseResponse, KeepLeaseRequest, KeepLeaseResponse, GlobalLock, LocalLock, } from "./management/lease";
|
|
3
3
|
export { GlobalLockRequest, GlobalLockResponse, GlobalUnlockRequest, GlobalUnlockResponse, LocalLockRequest, LocalLockResponse, LocalUnlockRequest, LocalUnlockResponse, } from "./management/lock";
|
|
4
4
|
export { GetPeerNodesRequest, GetPeerNodesResponse } from "./management/peer_nodes";
|
|
5
|
-
export { LockingRequest, LockingRequest_Init, LockingRequest_LockGlobal, LockingRequest_LockLocal, LockingRequest_UnlockGlobal, LockingRequest_UnlockLocal, LockingResponse, LockingResponse_InitAck, LockingResponse_LockGlobalAck, LockingResponse_LockLocalAck, } from "./management/locking";
|
package/freym/sync/management.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GetPeerNodesResponse = exports.GetPeerNodesRequest = exports.LocalUnlockResponse = exports.LocalUnlockRequest = exports.LocalLockResponse = exports.LocalLockRequest = exports.GlobalUnlockResponse = exports.GlobalUnlockRequest = exports.GlobalLockResponse = exports.GlobalLockRequest = exports.LocalLock = exports.GlobalLock = exports.KeepLeaseResponse = exports.KeepLeaseRequest = exports.DropLeaseResponse = exports.DropLeaseRequest = exports.CreateLeaseResponse = exports.CreateLeaseRequest = exports.ServiceService = exports.ServiceClient = void 0;
|
|
4
4
|
var service_1 = require("./management/service");
|
|
5
5
|
Object.defineProperty(exports, "ServiceClient", { enumerable: true, get: function () { return service_1.ServiceClient; } });
|
|
6
6
|
Object.defineProperty(exports, "ServiceService", { enumerable: true, get: function () { return service_1.ServiceService; } });
|
|
@@ -11,6 +11,8 @@ Object.defineProperty(exports, "DropLeaseRequest", { enumerable: true, get: func
|
|
|
11
11
|
Object.defineProperty(exports, "DropLeaseResponse", { enumerable: true, get: function () { return lease_1.DropLeaseResponse; } });
|
|
12
12
|
Object.defineProperty(exports, "KeepLeaseRequest", { enumerable: true, get: function () { return lease_1.KeepLeaseRequest; } });
|
|
13
13
|
Object.defineProperty(exports, "KeepLeaseResponse", { enumerable: true, get: function () { return lease_1.KeepLeaseResponse; } });
|
|
14
|
+
Object.defineProperty(exports, "GlobalLock", { enumerable: true, get: function () { return lease_1.GlobalLock; } });
|
|
15
|
+
Object.defineProperty(exports, "LocalLock", { enumerable: true, get: function () { return lease_1.LocalLock; } });
|
|
14
16
|
var lock_1 = require("./management/lock");
|
|
15
17
|
Object.defineProperty(exports, "GlobalLockRequest", { enumerable: true, get: function () { return lock_1.GlobalLockRequest; } });
|
|
16
18
|
Object.defineProperty(exports, "GlobalLockResponse", { enumerable: true, get: function () { return lock_1.GlobalLockResponse; } });
|
|
@@ -23,14 +25,3 @@ Object.defineProperty(exports, "LocalUnlockResponse", { enumerable: true, get: f
|
|
|
23
25
|
var peer_nodes_1 = require("./management/peer_nodes");
|
|
24
26
|
Object.defineProperty(exports, "GetPeerNodesRequest", { enumerable: true, get: function () { return peer_nodes_1.GetPeerNodesRequest; } });
|
|
25
27
|
Object.defineProperty(exports, "GetPeerNodesResponse", { enumerable: true, get: function () { return peer_nodes_1.GetPeerNodesResponse; } });
|
|
26
|
-
var locking_1 = require("./management/locking");
|
|
27
|
-
Object.defineProperty(exports, "LockingRequest", { enumerable: true, get: function () { return locking_1.LockingRequest; } });
|
|
28
|
-
Object.defineProperty(exports, "LockingRequest_Init", { enumerable: true, get: function () { return locking_1.LockingRequest_Init; } });
|
|
29
|
-
Object.defineProperty(exports, "LockingRequest_LockGlobal", { enumerable: true, get: function () { return locking_1.LockingRequest_LockGlobal; } });
|
|
30
|
-
Object.defineProperty(exports, "LockingRequest_LockLocal", { enumerable: true, get: function () { return locking_1.LockingRequest_LockLocal; } });
|
|
31
|
-
Object.defineProperty(exports, "LockingRequest_UnlockGlobal", { enumerable: true, get: function () { return locking_1.LockingRequest_UnlockGlobal; } });
|
|
32
|
-
Object.defineProperty(exports, "LockingRequest_UnlockLocal", { enumerable: true, get: function () { return locking_1.LockingRequest_UnlockLocal; } });
|
|
33
|
-
Object.defineProperty(exports, "LockingResponse", { enumerable: true, get: function () { return locking_1.LockingResponse; } });
|
|
34
|
-
Object.defineProperty(exports, "LockingResponse_InitAck", { enumerable: true, get: function () { return locking_1.LockingResponse_InitAck; } });
|
|
35
|
-
Object.defineProperty(exports, "LockingResponse_LockGlobalAck", { enumerable: true, get: function () { return locking_1.LockingResponse_LockGlobalAck; } });
|
|
36
|
-
Object.defineProperty(exports, "LockingResponse_LockLocalAck", { enumerable: true, get: function () { return locking_1.LockingResponse_LockLocalAck; } });
|
package/package.json
CHANGED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import _m0 from "protobufjs/minimal";
|
|
2
|
-
export declare const protobufPackage = "freym.sync.management";
|
|
3
|
-
export interface LockingRequest {
|
|
4
|
-
payload?: {
|
|
5
|
-
$case: "init";
|
|
6
|
-
init: LockingRequest_Init;
|
|
7
|
-
} | {
|
|
8
|
-
$case: "lockGlobal";
|
|
9
|
-
lockGlobal: LockingRequest_LockGlobal;
|
|
10
|
-
} | {
|
|
11
|
-
$case: "lockLocal";
|
|
12
|
-
lockLocal: LockingRequest_LockLocal;
|
|
13
|
-
} | {
|
|
14
|
-
$case: "unlockGlobal";
|
|
15
|
-
unlockGlobal: LockingRequest_UnlockGlobal;
|
|
16
|
-
} | {
|
|
17
|
-
$case: "unlockLocal";
|
|
18
|
-
unlockLocal: LockingRequest_UnlockLocal;
|
|
19
|
-
} | undefined;
|
|
20
|
-
}
|
|
21
|
-
export interface LockingRequest_Init {
|
|
22
|
-
ip: string;
|
|
23
|
-
app: string;
|
|
24
|
-
}
|
|
25
|
-
export interface LockingRequest_LockGlobal {
|
|
26
|
-
lockId: string;
|
|
27
|
-
tenantId: string;
|
|
28
|
-
globalConcern: string;
|
|
29
|
-
}
|
|
30
|
-
export interface LockingRequest_LockLocal {
|
|
31
|
-
lockId: string;
|
|
32
|
-
tenantId: string;
|
|
33
|
-
globalConcern: string;
|
|
34
|
-
localConcern: string;
|
|
35
|
-
}
|
|
36
|
-
export interface LockingRequest_UnlockGlobal {
|
|
37
|
-
tenantId: string;
|
|
38
|
-
globalConcern: string;
|
|
39
|
-
}
|
|
40
|
-
export interface LockingRequest_UnlockLocal {
|
|
41
|
-
tenantId: string;
|
|
42
|
-
globalConcern: string;
|
|
43
|
-
localConcern: string;
|
|
44
|
-
}
|
|
45
|
-
export interface LockingResponse {
|
|
46
|
-
data?: {
|
|
47
|
-
$case: "initAck";
|
|
48
|
-
initAck: LockingResponse_InitAck;
|
|
49
|
-
} | {
|
|
50
|
-
$case: "lockGlobalAck";
|
|
51
|
-
lockGlobalAck: LockingResponse_LockGlobalAck;
|
|
52
|
-
} | {
|
|
53
|
-
$case: "lockLocalAck";
|
|
54
|
-
lockLocalAck: LockingResponse_LockLocalAck;
|
|
55
|
-
} | undefined;
|
|
56
|
-
}
|
|
57
|
-
export interface LockingResponse_InitAck {
|
|
58
|
-
error: string;
|
|
59
|
-
}
|
|
60
|
-
export interface LockingResponse_LockGlobalAck {
|
|
61
|
-
error: string;
|
|
62
|
-
}
|
|
63
|
-
export interface LockingResponse_LockLocalAck {
|
|
64
|
-
error: string;
|
|
65
|
-
}
|
|
66
|
-
export declare const LockingRequest: {
|
|
67
|
-
encode(message: LockingRequest, writer?: _m0.Writer): _m0.Writer;
|
|
68
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest;
|
|
69
|
-
fromJSON(object: any): LockingRequest;
|
|
70
|
-
toJSON(message: LockingRequest): unknown;
|
|
71
|
-
create(base?: DeepPartial<LockingRequest>): LockingRequest;
|
|
72
|
-
fromPartial(object: DeepPartial<LockingRequest>): LockingRequest;
|
|
73
|
-
};
|
|
74
|
-
export declare const LockingRequest_Init: {
|
|
75
|
-
encode(message: LockingRequest_Init, writer?: _m0.Writer): _m0.Writer;
|
|
76
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest_Init;
|
|
77
|
-
fromJSON(object: any): LockingRequest_Init;
|
|
78
|
-
toJSON(message: LockingRequest_Init): unknown;
|
|
79
|
-
create(base?: DeepPartial<LockingRequest_Init>): LockingRequest_Init;
|
|
80
|
-
fromPartial(object: DeepPartial<LockingRequest_Init>): LockingRequest_Init;
|
|
81
|
-
};
|
|
82
|
-
export declare const LockingRequest_LockGlobal: {
|
|
83
|
-
encode(message: LockingRequest_LockGlobal, writer?: _m0.Writer): _m0.Writer;
|
|
84
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest_LockGlobal;
|
|
85
|
-
fromJSON(object: any): LockingRequest_LockGlobal;
|
|
86
|
-
toJSON(message: LockingRequest_LockGlobal): unknown;
|
|
87
|
-
create(base?: DeepPartial<LockingRequest_LockGlobal>): LockingRequest_LockGlobal;
|
|
88
|
-
fromPartial(object: DeepPartial<LockingRequest_LockGlobal>): LockingRequest_LockGlobal;
|
|
89
|
-
};
|
|
90
|
-
export declare const LockingRequest_LockLocal: {
|
|
91
|
-
encode(message: LockingRequest_LockLocal, writer?: _m0.Writer): _m0.Writer;
|
|
92
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest_LockLocal;
|
|
93
|
-
fromJSON(object: any): LockingRequest_LockLocal;
|
|
94
|
-
toJSON(message: LockingRequest_LockLocal): unknown;
|
|
95
|
-
create(base?: DeepPartial<LockingRequest_LockLocal>): LockingRequest_LockLocal;
|
|
96
|
-
fromPartial(object: DeepPartial<LockingRequest_LockLocal>): LockingRequest_LockLocal;
|
|
97
|
-
};
|
|
98
|
-
export declare const LockingRequest_UnlockGlobal: {
|
|
99
|
-
encode(message: LockingRequest_UnlockGlobal, writer?: _m0.Writer): _m0.Writer;
|
|
100
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest_UnlockGlobal;
|
|
101
|
-
fromJSON(object: any): LockingRequest_UnlockGlobal;
|
|
102
|
-
toJSON(message: LockingRequest_UnlockGlobal): unknown;
|
|
103
|
-
create(base?: DeepPartial<LockingRequest_UnlockGlobal>): LockingRequest_UnlockGlobal;
|
|
104
|
-
fromPartial(object: DeepPartial<LockingRequest_UnlockGlobal>): LockingRequest_UnlockGlobal;
|
|
105
|
-
};
|
|
106
|
-
export declare const LockingRequest_UnlockLocal: {
|
|
107
|
-
encode(message: LockingRequest_UnlockLocal, writer?: _m0.Writer): _m0.Writer;
|
|
108
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingRequest_UnlockLocal;
|
|
109
|
-
fromJSON(object: any): LockingRequest_UnlockLocal;
|
|
110
|
-
toJSON(message: LockingRequest_UnlockLocal): unknown;
|
|
111
|
-
create(base?: DeepPartial<LockingRequest_UnlockLocal>): LockingRequest_UnlockLocal;
|
|
112
|
-
fromPartial(object: DeepPartial<LockingRequest_UnlockLocal>): LockingRequest_UnlockLocal;
|
|
113
|
-
};
|
|
114
|
-
export declare const LockingResponse: {
|
|
115
|
-
encode(message: LockingResponse, writer?: _m0.Writer): _m0.Writer;
|
|
116
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingResponse;
|
|
117
|
-
fromJSON(object: any): LockingResponse;
|
|
118
|
-
toJSON(message: LockingResponse): unknown;
|
|
119
|
-
create(base?: DeepPartial<LockingResponse>): LockingResponse;
|
|
120
|
-
fromPartial(object: DeepPartial<LockingResponse>): LockingResponse;
|
|
121
|
-
};
|
|
122
|
-
export declare const LockingResponse_InitAck: {
|
|
123
|
-
encode(message: LockingResponse_InitAck, writer?: _m0.Writer): _m0.Writer;
|
|
124
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingResponse_InitAck;
|
|
125
|
-
fromJSON(object: any): LockingResponse_InitAck;
|
|
126
|
-
toJSON(message: LockingResponse_InitAck): unknown;
|
|
127
|
-
create(base?: DeepPartial<LockingResponse_InitAck>): LockingResponse_InitAck;
|
|
128
|
-
fromPartial(object: DeepPartial<LockingResponse_InitAck>): LockingResponse_InitAck;
|
|
129
|
-
};
|
|
130
|
-
export declare const LockingResponse_LockGlobalAck: {
|
|
131
|
-
encode(message: LockingResponse_LockGlobalAck, writer?: _m0.Writer): _m0.Writer;
|
|
132
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingResponse_LockGlobalAck;
|
|
133
|
-
fromJSON(object: any): LockingResponse_LockGlobalAck;
|
|
134
|
-
toJSON(message: LockingResponse_LockGlobalAck): unknown;
|
|
135
|
-
create(base?: DeepPartial<LockingResponse_LockGlobalAck>): LockingResponse_LockGlobalAck;
|
|
136
|
-
fromPartial(object: DeepPartial<LockingResponse_LockGlobalAck>): LockingResponse_LockGlobalAck;
|
|
137
|
-
};
|
|
138
|
-
export declare const LockingResponse_LockLocalAck: {
|
|
139
|
-
encode(message: LockingResponse_LockLocalAck, writer?: _m0.Writer): _m0.Writer;
|
|
140
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): LockingResponse_LockLocalAck;
|
|
141
|
-
fromJSON(object: any): LockingResponse_LockLocalAck;
|
|
142
|
-
toJSON(message: LockingResponse_LockLocalAck): unknown;
|
|
143
|
-
create(base?: DeepPartial<LockingResponse_LockLocalAck>): LockingResponse_LockLocalAck;
|
|
144
|
-
fromPartial(object: DeepPartial<LockingResponse_LockLocalAck>): LockingResponse_LockLocalAck;
|
|
145
|
-
};
|
|
146
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
147
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
148
|
-
$case: string;
|
|
149
|
-
} ? {
|
|
150
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
151
|
-
} & {
|
|
152
|
-
$case: T["$case"];
|
|
153
|
-
} : T extends {} ? {
|
|
154
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
155
|
-
} : Partial<T>;
|
|
156
|
-
export {};
|