livekit-server-sdk 0.5.9 → 0.5.10
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/EgressClient.d.ts +45 -0
- package/dist/EgressClient.js +132 -0
- package/dist/EgressClient.js.map +1 -0
- package/dist/RoomServiceClient.d.ts +1 -2
- package/dist/RoomServiceClient.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/proto/google/protobuf/empty.d.ts +6 -2
- package/dist/proto/google/protobuf/empty.js +31 -11
- package/dist/proto/google/protobuf/empty.js.map +1 -1
- package/dist/proto/google/protobuf/timestamp.d.ts +132 -0
- package/dist/proto/google/protobuf/timestamp.js +108 -0
- package/dist/proto/google/protobuf/timestamp.js.map +1 -0
- package/dist/proto/livekit_egress.d.ts +1948 -0
- package/dist/proto/livekit_egress.js +1834 -0
- package/dist/proto/livekit_egress.js.map +1 -0
- package/dist/proto/livekit_models.d.ts +659 -13
- package/dist/proto/livekit_models.js +1379 -734
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_recording.d.ts +198 -16
- package/dist/proto/livekit_recording.js +265 -515
- package/dist/proto/livekit_recording.js.map +1 -1
- package/dist/proto/livekit_room.d.ts +556 -34
- package/dist/proto/livekit_room.js +298 -639
- package/dist/proto/livekit_room.js.map +1 -1
- package/dist/proto/livekit_webhook.d.ts +926 -5
- package/dist/proto/livekit_webhook.js +103 -84
- package/dist/proto/livekit_webhook.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EgressInfo, EncodedFileOutput, EncodingOptions, EncodingOptionsPreset, StreamOutput } from './proto/livekit_egress';
|
|
2
|
+
/**
|
|
3
|
+
* Client to access Egress APIs
|
|
4
|
+
*/
|
|
5
|
+
export default class EgressClient {
|
|
6
|
+
private readonly rpc;
|
|
7
|
+
private readonly apiKey?;
|
|
8
|
+
private readonly secret?;
|
|
9
|
+
/**
|
|
10
|
+
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
|
|
11
|
+
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
|
|
12
|
+
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
|
|
13
|
+
*/
|
|
14
|
+
constructor(host: string, apiKey?: string, secret?: string);
|
|
15
|
+
/**
|
|
16
|
+
* @param roomName room name
|
|
17
|
+
* @param layout egress layout
|
|
18
|
+
* @param output output filepath or RtmpOutput
|
|
19
|
+
* @param options egress options or preset
|
|
20
|
+
* @param audioOnly record audio only
|
|
21
|
+
* @param videoOnly record video only
|
|
22
|
+
* @param customBaseUrl custom template url
|
|
23
|
+
*/
|
|
24
|
+
startWebCompositeEgress(roomName: string, layout: string, output: EncodedFileOutput | StreamOutput, options?: EncodingOptionsPreset | EncodingOptions, audioOnly?: boolean, videoOnly?: boolean, customBaseUrl?: string): Promise<EgressInfo>;
|
|
25
|
+
/**
|
|
26
|
+
* @param egressId
|
|
27
|
+
* @param layout
|
|
28
|
+
*/
|
|
29
|
+
updateLayout(egressId: string, layout: string): Promise<EgressInfo>;
|
|
30
|
+
/**
|
|
31
|
+
* @param egressId
|
|
32
|
+
* @param addOutputUrls
|
|
33
|
+
* @param removeOutputUrls
|
|
34
|
+
*/
|
|
35
|
+
updateStream(egressId: string, addOutputUrls?: string[], removeOutputUrls?: string[]): Promise<EgressInfo>;
|
|
36
|
+
/**
|
|
37
|
+
* @param roomName list egress for one room only
|
|
38
|
+
*/
|
|
39
|
+
listEgress(roomName?: string): Promise<EgressInfo>;
|
|
40
|
+
/**
|
|
41
|
+
* @param egressId
|
|
42
|
+
*/
|
|
43
|
+
stopEgress(egressId: string): Promise<EgressInfo>;
|
|
44
|
+
private authHeader;
|
|
45
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const AccessToken_1 = require("./AccessToken");
|
|
13
|
+
const livekit_egress_1 = require("./proto/livekit_egress");
|
|
14
|
+
const TwirpRPC_1 = require("./TwirpRPC");
|
|
15
|
+
const svc = 'Egress';
|
|
16
|
+
/**
|
|
17
|
+
* Client to access Egress APIs
|
|
18
|
+
*/
|
|
19
|
+
class EgressClient {
|
|
20
|
+
/**
|
|
21
|
+
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
|
|
22
|
+
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
|
|
23
|
+
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
|
|
24
|
+
*/
|
|
25
|
+
constructor(host, apiKey, secret) {
|
|
26
|
+
this.rpc = new TwirpRPC_1.TwirpRpc(host, TwirpRPC_1.livekitPackage);
|
|
27
|
+
this.apiKey = apiKey;
|
|
28
|
+
this.secret = secret;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @param roomName room name
|
|
32
|
+
* @param layout egress layout
|
|
33
|
+
* @param output output filepath or RtmpOutput
|
|
34
|
+
* @param options egress options or preset
|
|
35
|
+
* @param audioOnly record audio only
|
|
36
|
+
* @param videoOnly record video only
|
|
37
|
+
* @param customBaseUrl custom template url
|
|
38
|
+
*/
|
|
39
|
+
startWebCompositeEgress(roomName, layout, output, options, audioOnly, videoOnly, customBaseUrl) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
let file;
|
|
42
|
+
let stream;
|
|
43
|
+
let preset;
|
|
44
|
+
let advanced;
|
|
45
|
+
if (!audioOnly) {
|
|
46
|
+
audioOnly = false;
|
|
47
|
+
}
|
|
48
|
+
if (!videoOnly) {
|
|
49
|
+
videoOnly = false;
|
|
50
|
+
}
|
|
51
|
+
if (!customBaseUrl) {
|
|
52
|
+
customBaseUrl = '';
|
|
53
|
+
}
|
|
54
|
+
if (output.filepath !== undefined) {
|
|
55
|
+
file = output;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
stream = output;
|
|
59
|
+
}
|
|
60
|
+
if (options) {
|
|
61
|
+
if (typeof options === 'number') {
|
|
62
|
+
preset = options;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
advanced = options;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const req = livekit_egress_1.WebCompositeEgressRequest.toJSON({
|
|
69
|
+
roomName, layout, audioOnly, videoOnly, file, stream, preset, advanced, customBaseUrl,
|
|
70
|
+
});
|
|
71
|
+
const data = yield this.rpc.request(svc, 'StartWebCompositeEgress', req, this.authHeader({ roomRecord: true }));
|
|
72
|
+
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @param egressId
|
|
77
|
+
* @param layout
|
|
78
|
+
*/
|
|
79
|
+
updateLayout(egressId, layout) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const data = yield this.rpc.request(svc, 'UpdateLayout', livekit_egress_1.UpdateLayoutRequest.toJSON({ egressId, layout }), this.authHeader({ roomRecord: true }));
|
|
82
|
+
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param egressId
|
|
87
|
+
* @param addOutputUrls
|
|
88
|
+
* @param removeOutputUrls
|
|
89
|
+
*/
|
|
90
|
+
updateStream(egressId, addOutputUrls, removeOutputUrls) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (!addOutputUrls) {
|
|
93
|
+
addOutputUrls = [];
|
|
94
|
+
}
|
|
95
|
+
if (!removeOutputUrls) {
|
|
96
|
+
removeOutputUrls = [];
|
|
97
|
+
}
|
|
98
|
+
const data = yield this.rpc.request(svc, 'UpdateStream', livekit_egress_1.UpdateStreamRequest.toJSON({ egressId, addOutputUrls, removeOutputUrls }), this.authHeader({ roomRecord: true }));
|
|
99
|
+
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @param roomName list egress for one room only
|
|
104
|
+
*/
|
|
105
|
+
listEgress(roomName) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
if (!roomName) {
|
|
108
|
+
roomName = '';
|
|
109
|
+
}
|
|
110
|
+
const data = yield this.rpc.request(svc, 'ListEgress', livekit_egress_1.ListEgressRequest.toJSON({ roomName }), this.authHeader({ roomRecord: true }));
|
|
111
|
+
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @param egressId
|
|
116
|
+
*/
|
|
117
|
+
stopEgress(egressId) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const data = yield this.rpc.request(svc, 'StopEgress', livekit_egress_1.StopEgressRequest.toJSON({ egressId }), this.authHeader({ roomRecord: true }));
|
|
120
|
+
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
authHeader(grant) {
|
|
124
|
+
const at = new AccessToken_1.AccessToken(this.apiKey, this.secret, { ttl: '10m' });
|
|
125
|
+
at.addGrant(grant);
|
|
126
|
+
return {
|
|
127
|
+
Authorization: `Bearer ${at.toJwt()}`,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.default = EgressClient;
|
|
132
|
+
//# sourceMappingURL=EgressClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EgressClient.js","sourceRoot":"","sources":["../src/EgressClient.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAWgC;AAChC,yCAA2D;AAE3D,MAAM,GAAG,GAAG,QAAQ,CAAC;AAErB;;EAEE;AACF,MAAqB,YAAY;IAO/B;;;;MAIE;IACF,YAAY,IAAY,EAAE,MAAe,EAAE,MAAe;QACxD,IAAI,CAAC,GAAG,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,yBAAc,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;MAQE;IACI,uBAAuB,CAC3B,QAAgB,EAChB,MAAc,EACd,MAAwC,EACxC,OAAiD,EACjD,SAAmB,EACnB,SAAmB,EACnB,aAAsB;;YAEtB,IAAI,IAAmC,CAAC;YACxC,IAAI,MAAgC,CAAC;YACrC,IAAI,MAAyC,CAAC;YAC9C,IAAI,QAAqC,CAAC;YAE1C,IAAI,CAAC,SAAS,EAAE;gBACd,SAAS,GAAG,KAAK,CAAC;aACnB;YACD,IAAI,CAAC,SAAS,EAAE;gBACd,SAAS,GAAG,KAAK,CAAC;aACnB;YACD,IAAI,CAAC,aAAa,EAAE;gBAClB,aAAa,GAAG,EAAE,CAAC;aACpB;YAED,IAAwB,MAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;gBACtD,IAAI,GAAsB,MAAM,CAAC;aAClC;iBAAM;gBACL,MAAM,GAAiB,MAAM,CAAC;aAC/B;YAED,IAAI,OAAO,EAAE;gBACX,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;oBAC/B,MAAM,GAA0B,OAAO,CAAC;iBAC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ipantInfo, Room, TrackInfo } from './proto/livekit_models';
|
|
2
|
-
import { ParticipantPermission } from './proto/livekit_room';
|
|
1
|
+
import { DataPacket_Kind, ParticipantInfo, ParticipantPermission, Room, TrackInfo } from './proto/livekit_models';
|
|
3
2
|
/**
|
|
4
3
|
* Options for when creating a room
|
|
5
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAEgC;AAChC,
|
|
1
|
+
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAEgC;AAChC,uDAY8B;AAC9B,yCAA2D;AA2B3D,MAAM,GAAG,GAAG,aAAa,CAAC;AAE1B;;GAEG;AACH,MAAa,iBAAiB;IAO5B;;;;;OAKG;IACH,YAAY,IAAY,EAAE,MAAe,EAAE,MAAe;QACxD,IAAI,CAAC,GAAG,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,yBAAc,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACG,UAAU,CAAC,OAAsB;;YACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CACjC,GAAG,EACH,YAAY,EACZ,gCAAiB,CAAC,MAAM,CAAC,gCAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAChE,IAAI,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACtC,CAAC;YACF,OAAO,qBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;KAAA;IAED;;;;;OAKG;IACG,SAAS,CAAC,KAAgB;;YAC9B,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ChB,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CACpB,GAAG,EACH,UAAU,EACV,GAAG,EACH,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAC3C,CAAC;QACJ,CAAC;KAAA;IAEO,UAAU,CAAC,KAAiB;QAClC,MAAM,EAAE,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACrE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO;YACL,aAAa,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAtPD,8CAsPC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './AccessToken';
|
|
2
|
+
export { default as EgressClient } from './EgressClient';
|
|
2
3
|
export * from './grants';
|
|
3
|
-
export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, Room, TrackInfo, TrackType, } from './proto/livekit_models';
|
|
4
|
-
export { default } from './RecordingServiceClient';
|
|
4
|
+
export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, TrackInfo, TrackType, } from './proto/livekit_models';
|
|
5
|
+
export { default as RecordingServiceClient } from './RecordingServiceClient';
|
|
5
6
|
export * from './RoomServiceClient';
|
|
6
7
|
export * from './WebhookReceiver';
|
package/dist/index.js
CHANGED
|
@@ -13,18 +13,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
16
|
+
exports.RecordingServiceClient = exports.TrackType = exports.TrackInfo = exports.Room = exports.ParticipantPermission = exports.ParticipantInfo_State = exports.ParticipantInfo = exports.DataPacket_Kind = exports.EgressClient = void 0;
|
|
17
17
|
__exportStar(require("./AccessToken"), exports);
|
|
18
|
+
var EgressClient_1 = require("./EgressClient");
|
|
19
|
+
Object.defineProperty(exports, "EgressClient", { enumerable: true, get: function () { return __importDefault(EgressClient_1).default; } });
|
|
18
20
|
__exportStar(require("./grants"), exports);
|
|
19
21
|
var livekit_models_1 = require("./proto/livekit_models");
|
|
20
22
|
Object.defineProperty(exports, "DataPacket_Kind", { enumerable: true, get: function () { return livekit_models_1.DataPacket_Kind; } });
|
|
21
23
|
Object.defineProperty(exports, "ParticipantInfo", { enumerable: true, get: function () { return livekit_models_1.ParticipantInfo; } });
|
|
22
24
|
Object.defineProperty(exports, "ParticipantInfo_State", { enumerable: true, get: function () { return livekit_models_1.ParticipantInfo_State; } });
|
|
25
|
+
Object.defineProperty(exports, "ParticipantPermission", { enumerable: true, get: function () { return livekit_models_1.ParticipantPermission; } });
|
|
23
26
|
Object.defineProperty(exports, "Room", { enumerable: true, get: function () { return livekit_models_1.Room; } });
|
|
24
27
|
Object.defineProperty(exports, "TrackInfo", { enumerable: true, get: function () { return livekit_models_1.TrackInfo; } });
|
|
25
28
|
Object.defineProperty(exports, "TrackType", { enumerable: true, get: function () { return livekit_models_1.TrackType; } });
|
|
26
29
|
var RecordingServiceClient_1 = require("./RecordingServiceClient");
|
|
27
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "RecordingServiceClient", { enumerable: true, get: function () { return __importDefault(RecordingServiceClient_1).default; } });
|
|
28
31
|
__exportStar(require("./RoomServiceClient"), exports);
|
|
29
32
|
__exportStar(require("./WebhookReceiver"), exports);
|
|
30
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,2CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,2CAAyB;AACzB,yDAMgC;AAL9B,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AAAE,uHAAA,qBAAqB,OAAA;AAAE,sGAAA,IAAI,OAAA;AAClD,2GAAA,SAAS,OAAA;AACT,2GAAA,SAAS,OAAA;AAEX,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,sDAAoC;AACpC,oDAAkC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _m0 from "protobufjs/minimal";
|
|
1
|
+
import * as _m0 from "protobufjs/minimal";
|
|
2
2
|
export declare const protobufPackage = "google.protobuf";
|
|
3
3
|
/**
|
|
4
4
|
* A generic empty message that you can re-use to avoid defining duplicated
|
|
@@ -18,10 +18,14 @@ export declare const Empty: {
|
|
|
18
18
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Empty;
|
|
19
19
|
fromJSON(_: any): Empty;
|
|
20
20
|
toJSON(_: Empty): unknown;
|
|
21
|
-
fromPartial(_:
|
|
21
|
+
fromPartial<I extends {} & {} & Record<Exclude<keyof I, never>, never>>(_: I): Empty;
|
|
22
22
|
};
|
|
23
23
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
24
24
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
25
25
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
26
26
|
} : Partial<T>;
|
|
27
|
+
declare type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
28
|
+
export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
29
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
30
|
+
} & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
|
|
27
31
|
export {};
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -6,17 +25,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
25
|
exports.Empty = exports.protobufPackage = void 0;
|
|
7
26
|
/* eslint-disable */
|
|
8
27
|
const long_1 = __importDefault(require("long"));
|
|
9
|
-
const
|
|
28
|
+
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
10
29
|
exports.protobufPackage = "google.protobuf";
|
|
11
|
-
|
|
30
|
+
function createBaseEmpty() {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
12
33
|
exports.Empty = {
|
|
13
|
-
encode(_, writer =
|
|
34
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
14
35
|
return writer;
|
|
15
36
|
},
|
|
16
37
|
decode(input, length) {
|
|
17
|
-
const reader = input instanceof
|
|
38
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
18
39
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
19
|
-
const message =
|
|
40
|
+
const message = createBaseEmpty();
|
|
20
41
|
while (reader.pos < end) {
|
|
21
42
|
const tag = reader.uint32();
|
|
22
43
|
switch (tag >>> 3) {
|
|
@@ -28,20 +49,19 @@ exports.Empty = {
|
|
|
28
49
|
return message;
|
|
29
50
|
},
|
|
30
51
|
fromJSON(_) {
|
|
31
|
-
|
|
32
|
-
return message;
|
|
52
|
+
return {};
|
|
33
53
|
},
|
|
34
54
|
toJSON(_) {
|
|
35
55
|
const obj = {};
|
|
36
56
|
return obj;
|
|
37
57
|
},
|
|
38
58
|
fromPartial(_) {
|
|
39
|
-
const message =
|
|
59
|
+
const message = createBaseEmpty();
|
|
40
60
|
return message;
|
|
41
61
|
},
|
|
42
62
|
};
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
if (_m0.util.Long !== long_1.default) {
|
|
64
|
+
_m0.util.Long = long_1.default;
|
|
65
|
+
_m0.configure();
|
|
46
66
|
}
|
|
47
67
|
//# sourceMappingURL=empty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/empty.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/empty.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,gDAAwB;AACxB,wDAA0C;AAE7B,QAAA,eAAe,GAAG,iBAAiB,CAAC;AAejD,SAAS,eAAe;IACtB,OAAO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 @@
|
|
|
1
|
+
import * as _m0 from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
5
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
7
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
8
|
+
* Gregorian calendar backwards to year one.
|
|
9
|
+
*
|
|
10
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
11
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
12
|
+
* smear](https://developers.google.com/time/smear).
|
|
13
|
+
*
|
|
14
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
15
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
16
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
17
|
+
*
|
|
18
|
+
* # Examples
|
|
19
|
+
*
|
|
20
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
21
|
+
*
|
|
22
|
+
* Timestamp timestamp;
|
|
23
|
+
* timestamp.set_seconds(time(NULL));
|
|
24
|
+
* timestamp.set_nanos(0);
|
|
25
|
+
*
|
|
26
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
27
|
+
*
|
|
28
|
+
* struct timeval tv;
|
|
29
|
+
* gettimeofday(&tv, NULL);
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
33
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
34
|
+
*
|
|
35
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
36
|
+
*
|
|
37
|
+
* FILETIME ft;
|
|
38
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
39
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
40
|
+
*
|
|
41
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
42
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
43
|
+
* Timestamp timestamp;
|
|
44
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
45
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
46
|
+
*
|
|
47
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
48
|
+
*
|
|
49
|
+
* long millis = System.currentTimeMillis();
|
|
50
|
+
*
|
|
51
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
56
|
+
*
|
|
57
|
+
* Instant now = Instant.now();
|
|
58
|
+
*
|
|
59
|
+
* Timestamp timestamp =
|
|
60
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
61
|
+
* .setNanos(now.getNano()).build();
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
65
|
+
*
|
|
66
|
+
* timestamp = Timestamp()
|
|
67
|
+
* timestamp.GetCurrentTime()
|
|
68
|
+
*
|
|
69
|
+
* # JSON Mapping
|
|
70
|
+
*
|
|
71
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
72
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
73
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
74
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
75
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
76
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
77
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
78
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
79
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
80
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
81
|
+
*
|
|
82
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
83
|
+
* 01:30 UTC on January 15, 2017.
|
|
84
|
+
*
|
|
85
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
86
|
+
* standard
|
|
87
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
88
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
89
|
+
* to this format using
|
|
90
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
91
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
92
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
93
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
94
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
95
|
+
*/
|
|
96
|
+
export interface Timestamp {
|
|
97
|
+
/**
|
|
98
|
+
* Represents seconds of UTC time since Unix epoch
|
|
99
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
100
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
101
|
+
*/
|
|
102
|
+
seconds: number;
|
|
103
|
+
/**
|
|
104
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
105
|
+
* second values with fractions must still have non-negative nanos values
|
|
106
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
107
|
+
* inclusive.
|
|
108
|
+
*/
|
|
109
|
+
nanos: number;
|
|
110
|
+
}
|
|
111
|
+
export declare const Timestamp: {
|
|
112
|
+
encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer;
|
|
113
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Timestamp;
|
|
114
|
+
fromJSON(object: any): Timestamp;
|
|
115
|
+
toJSON(message: Timestamp): unknown;
|
|
116
|
+
fromPartial<I extends {
|
|
117
|
+
seconds?: number | undefined;
|
|
118
|
+
nanos?: number | undefined;
|
|
119
|
+
} & {
|
|
120
|
+
seconds?: number | undefined;
|
|
121
|
+
nanos?: number | undefined;
|
|
122
|
+
} & Record<Exclude<keyof I, keyof Timestamp>, never>>(object: I): Timestamp;
|
|
123
|
+
};
|
|
124
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
125
|
+
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
126
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
127
|
+
} : Partial<T>;
|
|
128
|
+
declare type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
129
|
+
export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
130
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
131
|
+
} & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Timestamp = exports.protobufPackage = void 0;
|
|
26
|
+
/* eslint-disable */
|
|
27
|
+
const long_1 = __importDefault(require("long"));
|
|
28
|
+
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
29
|
+
exports.protobufPackage = "google.protobuf";
|
|
30
|
+
function createBaseTimestamp() {
|
|
31
|
+
return { seconds: 0, nanos: 0 };
|
|
32
|
+
}
|
|
33
|
+
exports.Timestamp = {
|
|
34
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
35
|
+
if (message.seconds !== 0) {
|
|
36
|
+
writer.uint32(8).int64(message.seconds);
|
|
37
|
+
}
|
|
38
|
+
if (message.nanos !== 0) {
|
|
39
|
+
writer.uint32(16).int32(message.nanos);
|
|
40
|
+
}
|
|
41
|
+
return writer;
|
|
42
|
+
},
|
|
43
|
+
decode(input, length) {
|
|
44
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
45
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
46
|
+
const message = createBaseTimestamp();
|
|
47
|
+
while (reader.pos < end) {
|
|
48
|
+
const tag = reader.uint32();
|
|
49
|
+
switch (tag >>> 3) {
|
|
50
|
+
case 1:
|
|
51
|
+
message.seconds = longToNumber(reader.int64());
|
|
52
|
+
break;
|
|
53
|
+
case 2:
|
|
54
|
+
message.nanos = reader.int32();
|
|
55
|
+
break;
|
|
56
|
+
default:
|
|
57
|
+
reader.skipType(tag & 7);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return message;
|
|
62
|
+
},
|
|
63
|
+
fromJSON(object) {
|
|
64
|
+
return {
|
|
65
|
+
seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
|
|
66
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
toJSON(message) {
|
|
70
|
+
const obj = {};
|
|
71
|
+
message.seconds !== undefined &&
|
|
72
|
+
(obj.seconds = Math.round(message.seconds));
|
|
73
|
+
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
|
74
|
+
return obj;
|
|
75
|
+
},
|
|
76
|
+
fromPartial(object) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const message = createBaseTimestamp();
|
|
79
|
+
message.seconds = (_a = object.seconds) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
+
message.nanos = (_b = object.nanos) !== null && _b !== void 0 ? _b : 0;
|
|
81
|
+
return message;
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
var globalThis = (() => {
|
|
85
|
+
if (typeof globalThis !== "undefined")
|
|
86
|
+
return globalThis;
|
|
87
|
+
if (typeof self !== "undefined")
|
|
88
|
+
return self;
|
|
89
|
+
if (typeof window !== "undefined")
|
|
90
|
+
return window;
|
|
91
|
+
if (typeof global !== "undefined")
|
|
92
|
+
return global;
|
|
93
|
+
throw "Unable to locate global object";
|
|
94
|
+
})();
|
|
95
|
+
function longToNumber(long) {
|
|
96
|
+
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
97
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
98
|
+
}
|
|
99
|
+
return long.toNumber();
|
|
100
|
+
}
|
|
101
|
+
if (_m0.util.Long !== long_1.default) {
|
|
102
|
+
_m0.util.Long = long_1.default;
|
|
103
|
+
_m0.configure();
|
|
104
|
+
}
|
|
105
|
+
function isSet(value) {
|
|
106
|
+
return value !== null && value !== undefined;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=timestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/timestamp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,gDAAwB;AACxB,wDAA0C;AAE7B,QAAA,eAAe,GAAG,iBAAiB,CAAC;AA+GjD,SAAS,mBAAmB;IAC1B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAClC,CAAC;AAEY,QAAA,SAAS,GAAG;IACvB,MAAM,CACJ,OAAkB,EAClB,SAAqB,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE;QAExC,IAAI,OAAO,CAAC,OAAO,KAAK,CAAC,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SACzC;QACD,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACxC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,KAA8B,EAAE,MAAe;QACpD,MAAM,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3E,IAAI,GAAG,GAAG,MAAM,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