livekit-server-sdk 1.0.3 → 1.1.2
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/AccessToken.js +6 -0
- package/dist/AccessToken.js.map +1 -1
- package/dist/EgressClient.d.ts +38 -8
- package/dist/EgressClient.js +84 -21
- package/dist/EgressClient.js.map +1 -1
- package/dist/IngressClient.d.ts +84 -0
- package/dist/IngressClient.js +112 -0
- package/dist/IngressClient.js.map +1 -0
- package/dist/RoomServiceClient.d.ts +21 -6
- package/dist/RoomServiceClient.js +15 -22
- package/dist/RoomServiceClient.js.map +1 -1
- package/dist/ServiceBase.d.ts +16 -0
- package/dist/ServiceBase.js +27 -0
- package/dist/ServiceBase.js.map +1 -0
- package/dist/grants.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/proto/google/protobuf/timestamp.d.ts +5 -5
- package/dist/proto/google/protobuf/timestamp.js +17 -32
- package/dist/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/proto/livekit_egress.d.ts +9725 -1848
- package/dist/proto/livekit_egress.js +1131 -597
- package/dist/proto/livekit_egress.js.map +1 -1
- package/dist/proto/livekit_ingress.d.ts +744 -384
- package/dist/proto/livekit_ingress.js +492 -323
- package/dist/proto/livekit_ingress.js.map +1 -1
- package/dist/proto/livekit_models.d.ts +154 -59
- package/dist/proto/livekit_models.js +682 -446
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_room.d.ts +1746 -320
- package/dist/proto/livekit_room.js +198 -224
- package/dist/proto/livekit_room.js.map +1 -1
- package/dist/proto/livekit_webhook.d.ts +3277 -465
- package/dist/proto/livekit_webhook.js +43 -68
- package/dist/proto/livekit_webhook.js.map +1 -1
- package/generate-proto.sh +25 -0
- package/package.json +3 -3
- package/dist/proto/google/protobuf/empty.d.ts +0 -31
- package/dist/proto/google/protobuf/empty.js +0 -67
- package/dist/proto/google/protobuf/empty.js.map +0 -1
|
@@ -8,17 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.RoomServiceClient = void 0;
|
|
13
|
-
const AccessToken_1 = require("./AccessToken");
|
|
14
16
|
const livekit_models_1 = require("./proto/livekit_models");
|
|
15
17
|
const livekit_room_1 = require("./proto/livekit_room");
|
|
18
|
+
const ServiceBase_1 = __importDefault(require("./ServiceBase"));
|
|
16
19
|
const TwirpRPC_1 = require("./TwirpRPC");
|
|
17
20
|
const svc = 'RoomService';
|
|
18
21
|
/**
|
|
19
22
|
* Client to access Room APIs
|
|
20
23
|
*/
|
|
21
|
-
class RoomServiceClient {
|
|
24
|
+
class RoomServiceClient extends ServiceBase_1.default {
|
|
22
25
|
/**
|
|
23
26
|
*
|
|
24
27
|
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
|
|
@@ -26,9 +29,8 @@ class RoomServiceClient {
|
|
|
26
29
|
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
|
|
27
30
|
*/
|
|
28
31
|
constructor(host, apiKey, secret) {
|
|
32
|
+
super(apiKey, secret);
|
|
29
33
|
this.rpc = new TwirpRPC_1.TwirpRpc(host, TwirpRPC_1.livekitPackage);
|
|
30
|
-
this.apiKey = apiKey;
|
|
31
|
-
this.secret = secret;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Creates a new room. Explicit room creation is not required, since rooms will
|
|
@@ -49,10 +51,11 @@ class RoomServiceClient {
|
|
|
49
51
|
* @returns
|
|
50
52
|
*/
|
|
51
53
|
listRooms(names) {
|
|
54
|
+
var _a;
|
|
52
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
56
|
const data = yield this.rpc.request(svc, 'ListRooms', livekit_room_1.ListRoomsRequest.toJSON({ names: names !== null && names !== void 0 ? names : [] }), this.authHeader({ roomList: true }));
|
|
54
57
|
const res = livekit_room_1.ListRoomsResponse.fromJSON(data);
|
|
55
|
-
return res.rooms;
|
|
58
|
+
return (_a = res.rooms) !== null && _a !== void 0 ? _a : [];
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
61
|
deleteRoom(room) {
|
|
@@ -76,10 +79,11 @@ class RoomServiceClient {
|
|
|
76
79
|
* @param room name of the room
|
|
77
80
|
*/
|
|
78
81
|
listParticipants(room) {
|
|
82
|
+
var _a;
|
|
79
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
84
|
const data = yield this.rpc.request(svc, 'ListParticipants', livekit_room_1.ListParticipantsRequest.toJSON({ room }), this.authHeader({ roomAdmin: true, room }));
|
|
81
85
|
const res = livekit_room_1.ListParticipantsResponse.fromJSON(data);
|
|
82
|
-
return res.participants;
|
|
86
|
+
return (_a = res.participants) !== null && _a !== void 0 ? _a : [];
|
|
83
87
|
});
|
|
84
88
|
}
|
|
85
89
|
/**
|
|
@@ -166,31 +170,20 @@ class RoomServiceClient {
|
|
|
166
170
|
yield this.rpc.request(svc, 'UpdateSubscriptions', req, this.authHeader({ roomAdmin: true, room }));
|
|
167
171
|
});
|
|
168
172
|
}
|
|
169
|
-
|
|
170
|
-
* Sends data message to participants in the room
|
|
171
|
-
* @param room
|
|
172
|
-
* @param data opaque payload to send
|
|
173
|
-
* @param kind delivery reliability
|
|
174
|
-
* @param destinationSids optional. when empty, message is sent to everyone
|
|
175
|
-
*/
|
|
176
|
-
sendData(room, data, kind, destinationSids = []) {
|
|
173
|
+
sendData(room, data, kind, options = {}) {
|
|
177
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const destinationSids = Array.isArray(options) ? options : options.destinationSids;
|
|
176
|
+
const topic = Array.isArray(options) ? undefined : options.topic;
|
|
178
177
|
const req = livekit_room_1.SendDataRequest.toJSON({
|
|
179
178
|
room,
|
|
180
179
|
data,
|
|
181
180
|
kind,
|
|
182
|
-
destinationSids,
|
|
181
|
+
destinationSids: destinationSids !== null && destinationSids !== void 0 ? destinationSids : [],
|
|
182
|
+
topic,
|
|
183
183
|
});
|
|
184
184
|
yield this.rpc.request(svc, 'SendData', req, this.authHeader({ roomAdmin: true, room }));
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
authHeader(grant) {
|
|
188
|
-
const at = new AccessToken_1.AccessToken(this.apiKey, this.secret, { ttl: '10m' });
|
|
189
|
-
at.addGrant(grant);
|
|
190
|
-
return {
|
|
191
|
-
Authorization: `Bearer ${at.toJwt()}`,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
187
|
}
|
|
195
188
|
exports.RoomServiceClient = RoomServiceClient;
|
|
196
189
|
//# sourceMappingURL=RoomServiceClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAMgC;AAChC,uDAe8B;AAC9B,gEAAwC;AACxC,yCAA2D;AAwC3D,MAAM,GAAG,GAAG,aAAa,CAAC;AAE1B;;GAEG;AACH,MAAa,iBAAkB,SAAQ,qBAAW;IAGhD;;;;;OAKG;IACH,YAAY,IAAY,EAAE,MAAe,EAAE,MAAe;QACxD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,yBAAc,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACG,UAAU,CAAC,OAAsB;;YACrC,MAAM,IAAI,GAAG,MAAM,IAAI,C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AAC,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CACpB,GAAG,EACH,qBAAqB,EACrB,GAAG,EACH,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAC3C,CAAC;QACJ,CAAC;KAAA;IA4BK,QAAQ,CACZ,IAAY,EACZ,IAAgB,EAChB,IAAqB,EACrB,UAAsC,EAAE;;YAExC,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;YACnF,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;YACjE,MAAM,GAAG,GAAG,8BAAe,CAAC,MAAM,CAAC;gBACjC,IAAI;gBACJ,IAAI;gBACJ,IAAI;gBACJ,eAAe,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE;gBACtC,KAAK;aACN,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3F,CAAC;KAAA;CACF;AA1PD,8CA0PC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VideoGrant } from './grants';
|
|
2
|
+
/**
|
|
3
|
+
* Utilities to handle authentication
|
|
4
|
+
*/
|
|
5
|
+
export default class ServiceBase {
|
|
6
|
+
private readonly apiKey?;
|
|
7
|
+
private readonly secret?;
|
|
8
|
+
private readonly ttl;
|
|
9
|
+
/**
|
|
10
|
+
* @param apiKey API Key.
|
|
11
|
+
* @param secret API Secret.
|
|
12
|
+
* @param ttl token TTL
|
|
13
|
+
*/
|
|
14
|
+
constructor(apiKey?: string, secret?: string, ttl?: string);
|
|
15
|
+
authHeader(grant: VideoGrant): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AccessToken_1 = require("./AccessToken");
|
|
4
|
+
/**
|
|
5
|
+
* Utilities to handle authentication
|
|
6
|
+
*/
|
|
7
|
+
class ServiceBase {
|
|
8
|
+
/**
|
|
9
|
+
* @param apiKey API Key.
|
|
10
|
+
* @param secret API Secret.
|
|
11
|
+
* @param ttl token TTL
|
|
12
|
+
*/
|
|
13
|
+
constructor(apiKey, secret, ttl) {
|
|
14
|
+
this.apiKey = apiKey;
|
|
15
|
+
this.secret = secret;
|
|
16
|
+
this.ttl = ttl || '10m';
|
|
17
|
+
}
|
|
18
|
+
authHeader(grant) {
|
|
19
|
+
const at = new AccessToken_1.AccessToken(this.apiKey, this.secret, { ttl: this.ttl });
|
|
20
|
+
at.addGrant(grant);
|
|
21
|
+
return {
|
|
22
|
+
Authorization: `Bearer ${at.toJwt()}`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = ServiceBase;
|
|
27
|
+
//# sourceMappingURL=ServiceBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceBase.js","sourceRoot":"","sources":["../src/ServiceBase.ts"],"names":[],"mappings":";;AAAA,+CAA4C;AAG5C;;GAEG;AACH,MAAqB,WAAW;IAO9B;;;;OAIG;IACH,YAAY,MAAe,EAAE,MAAe,EAAE,GAAY;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,KAAK,CAAC;IAC1B,CAAC;IAED,UAAU,CAAC,KAAiB;QAC1B,MAAM,EAAE,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACxE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO;YACL,aAAa,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAzBD,8BAyBC"}
|
package/dist/grants.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface VideoGrant {
|
|
|
11
11
|
roomAdmin?: boolean;
|
|
12
12
|
/** name of the room, must be set for admin or join permissions */
|
|
13
13
|
room?: string;
|
|
14
|
+
/** permissions to control ingress, not specific to any room or ingress */
|
|
15
|
+
ingressAdmin?: boolean;
|
|
14
16
|
/**
|
|
15
17
|
* allow participant to publish. If neither canPublish or canSubscribe is set,
|
|
16
18
|
* both publish and subscribe are enabled
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './AccessToken';
|
|
2
2
|
export * from './EgressClient';
|
|
3
3
|
export * from './grants';
|
|
4
|
+
export * from './IngressClient';
|
|
4
5
|
export { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, } from './proto/livekit_egress';
|
|
6
|
+
export { IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoOptions, } from './proto/livekit_ingress';
|
|
5
7
|
export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, TrackInfo, TrackType, } from './proto/livekit_models';
|
|
6
8
|
export * from './RoomServiceClient';
|
|
7
9
|
export * from './WebhookReceiver';
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.TrackType = exports.TrackInfo = exports.Room = exports.ParticipantPermission = exports.ParticipantInfo_State = exports.ParticipantInfo = exports.DataPacket_Kind = exports.StreamProtocol = exports.StreamOutput = exports.SegmentedFileProtocol = exports.SegmentedFileOutput = exports.EncodingOptionsPreset = exports.EncodingOptions = exports.EncodedFileType = exports.EncodedFileOutput = exports.EgressInfo = exports.DirectFileOutput = void 0;
|
|
13
|
+
exports.TrackType = exports.TrackInfo = exports.Room = exports.ParticipantPermission = exports.ParticipantInfo_State = exports.ParticipantInfo = exports.DataPacket_Kind = exports.IngressVideoOptions = exports.IngressState = exports.IngressInput = exports.IngressInfo = exports.IngressAudioOptions = exports.StreamProtocol = exports.StreamOutput = exports.SegmentedFileProtocol = exports.SegmentedFileOutput = exports.EncodingOptionsPreset = exports.EncodingOptions = exports.EncodedFileType = exports.EncodedFileOutput = exports.EgressInfo = exports.DirectFileOutput = void 0;
|
|
14
14
|
__exportStar(require("./AccessToken"), exports);
|
|
15
15
|
__exportStar(require("./EgressClient"), exports);
|
|
16
16
|
__exportStar(require("./grants"), exports);
|
|
17
|
+
__exportStar(require("./IngressClient"), exports);
|
|
17
18
|
var livekit_egress_1 = require("./proto/livekit_egress");
|
|
18
19
|
Object.defineProperty(exports, "DirectFileOutput", { enumerable: true, get: function () { return livekit_egress_1.DirectFileOutput; } });
|
|
19
20
|
Object.defineProperty(exports, "EgressInfo", { enumerable: true, get: function () { return livekit_egress_1.EgressInfo; } });
|
|
@@ -25,6 +26,12 @@ Object.defineProperty(exports, "SegmentedFileOutput", { enumerable: true, get: f
|
|
|
25
26
|
Object.defineProperty(exports, "SegmentedFileProtocol", { enumerable: true, get: function () { return livekit_egress_1.SegmentedFileProtocol; } });
|
|
26
27
|
Object.defineProperty(exports, "StreamOutput", { enumerable: true, get: function () { return livekit_egress_1.StreamOutput; } });
|
|
27
28
|
Object.defineProperty(exports, "StreamProtocol", { enumerable: true, get: function () { return livekit_egress_1.StreamProtocol; } });
|
|
29
|
+
var livekit_ingress_1 = require("./proto/livekit_ingress");
|
|
30
|
+
Object.defineProperty(exports, "IngressAudioOptions", { enumerable: true, get: function () { return livekit_ingress_1.IngressAudioOptions; } });
|
|
31
|
+
Object.defineProperty(exports, "IngressInfo", { enumerable: true, get: function () { return livekit_ingress_1.IngressInfo; } });
|
|
32
|
+
Object.defineProperty(exports, "IngressInput", { enumerable: true, get: function () { return livekit_ingress_1.IngressInput; } });
|
|
33
|
+
Object.defineProperty(exports, "IngressState", { enumerable: true, get: function () { return livekit_ingress_1.IngressState; } });
|
|
34
|
+
Object.defineProperty(exports, "IngressVideoOptions", { enumerable: true, get: function () { return livekit_ingress_1.IngressVideoOptions; } });
|
|
28
35
|
var livekit_models_1 = require("./proto/livekit_models");
|
|
29
36
|
Object.defineProperty(exports, "DataPacket_Kind", { enumerable: true, get: function () { return livekit_models_1.DataPacket_Kind; } });
|
|
30
37
|
Object.defineProperty(exports, "ParticipantInfo", { enumerable: true, get: function () { return livekit_models_1.ParticipantInfo; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,2CAAyB;AACzB,yDAWgC;AAV9B,kHAAA,gBAAgB,OAAA;AAChB,4GAAA,UAAU,OAAA;AACV,mHAAA,iBAAiB,OAAA;AACjB,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,qHAAA,mBAAmB,OAAA;AACnB,uHAAA,qBAAqB,OAAA;AACrB,8GAAA,YAAY,OAAA;AACZ,gHAAA,cAAc,OAAA;AAEhB,yDAQgC;AAP9B,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,uHAAA,qBAAqB,OAAA;AACrB,sGAAA,IAAI,OAAA;AACJ,2GAAA,SAAS,OAAA;AACT,2GAAA,SAAS,OAAA;AAEX,sDAAoC;AACpC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,2CAAyB;AACzB,kDAAgC;AAChC,yDAWgC;AAV9B,kHAAA,gBAAgB,OAAA;AAChB,4GAAA,UAAU,OAAA;AACV,mHAAA,iBAAiB,OAAA;AACjB,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,qHAAA,mBAAmB,OAAA;AACnB,uHAAA,qBAAqB,OAAA;AACrB,8GAAA,YAAY,OAAA;AACZ,gHAAA,cAAc,OAAA;AAEhB,2DAMiC;AAL/B,sHAAA,mBAAmB,OAAA;AACnB,8GAAA,WAAW,OAAA;AACX,+GAAA,YAAY,OAAA;AACZ,+GAAA,YAAY,OAAA;AACZ,sHAAA,mBAAmB,OAAA;AAErB,yDAQgC;AAP9B,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,uHAAA,qBAAqB,OAAA;AACrB,sGAAA,IAAI,OAAA;AACJ,2GAAA,SAAS,OAAA;AACT,2GAAA,SAAS,OAAA;AAEX,sDAAoC;AACpC,oDAAkC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
2
|
export declare const protobufPackage = "google.protobuf";
|
|
3
3
|
/**
|
|
4
4
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
@@ -51,7 +51,6 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
51
51
|
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
52
|
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
54
|
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
56
55
|
*
|
|
57
56
|
* Instant now = Instant.now();
|
|
@@ -60,7 +59,6 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
60
59
|
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
61
60
|
* .setNanos(now.getNano()).build();
|
|
62
61
|
*
|
|
63
|
-
*
|
|
64
62
|
* Example 6: Compute Timestamp from current time in Python.
|
|
65
63
|
*
|
|
66
64
|
* timestamp = Timestamp()
|
|
@@ -119,7 +117,7 @@ export declare const Timestamp: {
|
|
|
119
117
|
} & {
|
|
120
118
|
seconds?: number | undefined;
|
|
121
119
|
nanos?: number | undefined;
|
|
122
|
-
} &
|
|
120
|
+
} & { [K in Exclude<keyof I, keyof Timestamp>]: never; }>(object: I): Timestamp;
|
|
123
121
|
};
|
|
124
122
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
125
123
|
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 {} ? {
|
|
@@ -128,5 +126,7 @@ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<inf
|
|
|
128
126
|
declare type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
129
127
|
export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
130
128
|
[K in keyof P]: Exact<P[K], I[K]>;
|
|
131
|
-
} &
|
|
129
|
+
} & {
|
|
130
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
131
|
+
};
|
|
132
132
|
export {};
|
|
@@ -1,23 +1,4 @@
|
|
|
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
|
-
};
|
|
21
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
4
|
};
|
|
@@ -25,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
6
|
exports.Timestamp = exports.protobufPackage = void 0;
|
|
26
7
|
/* eslint-disable */
|
|
27
8
|
const long_1 = __importDefault(require("long"));
|
|
28
|
-
const
|
|
29
|
-
exports.protobufPackage =
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
exports.protobufPackage = "google.protobuf";
|
|
30
11
|
function createBaseTimestamp() {
|
|
31
12
|
return { seconds: 0, nanos: 0 };
|
|
32
13
|
}
|
|
33
14
|
exports.Timestamp = {
|
|
34
|
-
encode(message, writer =
|
|
15
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
35
16
|
if (message.seconds !== 0) {
|
|
36
17
|
writer.uint32(8).int64(message.seconds);
|
|
37
18
|
}
|
|
@@ -41,7 +22,7 @@ exports.Timestamp = {
|
|
|
41
22
|
return writer;
|
|
42
23
|
},
|
|
43
24
|
decode(input, length) {
|
|
44
|
-
const reader = input instanceof
|
|
25
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
45
26
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
46
27
|
const message = createBaseTimestamp();
|
|
47
28
|
while (reader.pos < end) {
|
|
@@ -81,25 +62,29 @@ exports.Timestamp = {
|
|
|
81
62
|
},
|
|
82
63
|
};
|
|
83
64
|
var globalThis = (() => {
|
|
84
|
-
if (typeof globalThis !==
|
|
65
|
+
if (typeof globalThis !== "undefined") {
|
|
85
66
|
return globalThis;
|
|
86
|
-
|
|
67
|
+
}
|
|
68
|
+
if (typeof self !== "undefined") {
|
|
87
69
|
return self;
|
|
88
|
-
|
|
70
|
+
}
|
|
71
|
+
if (typeof window !== "undefined") {
|
|
89
72
|
return window;
|
|
90
|
-
|
|
73
|
+
}
|
|
74
|
+
if (typeof global !== "undefined") {
|
|
91
75
|
return global;
|
|
92
|
-
|
|
76
|
+
}
|
|
77
|
+
throw "Unable to locate global object";
|
|
93
78
|
})();
|
|
94
79
|
function longToNumber(long) {
|
|
95
80
|
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
96
|
-
throw new globalThis.Error(
|
|
81
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
97
82
|
}
|
|
98
83
|
return long.toNumber();
|
|
99
84
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
86
|
+
minimal_1.default.util.Long = long_1.default;
|
|
87
|
+
minimal_1.default.configure();
|
|
103
88
|
}
|
|
104
89
|
function isSet(value) {
|
|
105
90
|
return value !== null && value !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/timestamp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version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