@aslaluroba/help-center-react 3.2.0 → 3.2.1
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/index.esm.js +453 -328
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +453 -328
- package/dist/index.js.map +1 -1
- package/dist/services.esm.js +453 -328
- package/dist/services.esm.js.map +1 -1
- package/dist/services.js +453 -328
- package/dist/services.js.map +1 -1
- package/package.json +1 -1
- package/src/core/AblyService.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -6988,7 +6988,7 @@ var ably = {exports: {}};
|
|
|
6988
6988
|
});
|
|
6989
6989
|
return _withTimeoutAsync2.apply(this, arguments);
|
|
6990
6990
|
}
|
|
6991
|
-
var version = "2.
|
|
6991
|
+
var version = "2.15.0";
|
|
6992
6992
|
|
|
6993
6993
|
// src/common/lib/util/defaults.ts
|
|
6994
6994
|
var agent = "ably-js/" + version;
|
|
@@ -7236,10 +7236,10 @@ var ably = {exports: {}};
|
|
|
7236
7236
|
};
|
|
7237
7237
|
function defaultGetHeaders(options) {
|
|
7238
7238
|
var {
|
|
7239
|
-
format
|
|
7239
|
+
format,
|
|
7240
7240
|
protocolVersion = defaultHeadersOptions.protocolVersion
|
|
7241
7241
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7242
|
-
var accept = contentTypes[format];
|
|
7242
|
+
var accept = contentTypes[format != null ? format : options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */];
|
|
7243
7243
|
return {
|
|
7244
7244
|
accept,
|
|
7245
7245
|
"X-Ably-Version": protocolVersion.toString(),
|
|
@@ -7248,11 +7248,11 @@ var ably = {exports: {}};
|
|
|
7248
7248
|
}
|
|
7249
7249
|
function defaultPostHeaders(options) {
|
|
7250
7250
|
var {
|
|
7251
|
-
format
|
|
7251
|
+
format,
|
|
7252
7252
|
protocolVersion = defaultHeadersOptions.protocolVersion
|
|
7253
7253
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7254
|
-
var
|
|
7255
|
-
var
|
|
7254
|
+
var accept = contentTypes[format != null ? format : options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */];
|
|
7255
|
+
var contentType = accept;
|
|
7256
7256
|
return {
|
|
7257
7257
|
accept,
|
|
7258
7258
|
"content-type": contentType,
|
|
@@ -7576,7 +7576,9 @@ var ably = {exports: {}};
|
|
|
7576
7576
|
tokenUri = function tokenUri(host) {
|
|
7577
7577
|
return client.baseUri(host) + path;
|
|
7578
7578
|
};
|
|
7579
|
-
var requestHeaders = defaults_default.defaultPostHeaders(_this3.client.options
|
|
7579
|
+
var requestHeaders = defaults_default.defaultPostHeaders(_this3.client.options, {
|
|
7580
|
+
format: "json" /* json */
|
|
7581
|
+
});
|
|
7580
7582
|
if (resolvedAuthOptions.requestHeaders) _mixin(requestHeaders, resolvedAuthOptions.requestHeaders);
|
|
7581
7583
|
logger_default.logAction(_this3.logger, logger_default.LOG_MICRO, "Auth.requestToken().requestToken", "Sending POST to " + path + "; Token params: " + JSON.stringify(signedTokenParams));
|
|
7582
7584
|
_whenPromiseSettles(_this3.client.http.do(HttpMethods_default.Post, tokenUri, requestHeaders, JSON.stringify(signedTokenParams), null), (err, result) => err ? tokenCb(err) : tokenCb(result.error, result.body, result.unpacked));
|
|
@@ -9268,9 +9270,7 @@ var ably = {exports: {}};
|
|
|
9268
9270
|
return _asyncToGenerator(function* () {
|
|
9269
9271
|
var client = _this26.client;
|
|
9270
9272
|
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9271
|
-
headers = defaults_default.defaultPostHeaders(client.options,
|
|
9272
|
-
format
|
|
9273
|
-
}),
|
|
9273
|
+
headers = defaults_default.defaultPostHeaders(client.options),
|
|
9274
9274
|
params = {};
|
|
9275
9275
|
var body = _mixin({
|
|
9276
9276
|
recipient
|
|
@@ -9294,9 +9294,7 @@ var ably = {exports: {}};
|
|
|
9294
9294
|
var client = _this27.client;
|
|
9295
9295
|
var body = devicedetails_default.fromValues(device);
|
|
9296
9296
|
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9297
|
-
headers = defaults_default.defaultPostHeaders(client.options,
|
|
9298
|
-
format
|
|
9299
|
-
}),
|
|
9297
|
+
headers = defaults_default.defaultPostHeaders(client.options),
|
|
9300
9298
|
params = {};
|
|
9301
9299
|
_mixin(headers, client.options.headers);
|
|
9302
9300
|
if (client.options.pushFullWait) _mixin(params, {
|
|
@@ -9312,9 +9310,7 @@ var ably = {exports: {}};
|
|
|
9312
9310
|
return _asyncToGenerator(function* () {
|
|
9313
9311
|
var client = _this28.client,
|
|
9314
9312
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9315
|
-
headers = defaults_default.defaultGetHeaders(client.options,
|
|
9316
|
-
format
|
|
9317
|
-
}),
|
|
9313
|
+
headers = defaults_default.defaultGetHeaders(client.options),
|
|
9318
9314
|
deviceId = deviceIdOrDetails.id || deviceIdOrDetails;
|
|
9319
9315
|
if (typeof deviceId !== "string" || !deviceId.length) {
|
|
9320
9316
|
throw new _ErrorInfo2("First argument to DeviceRegistrations#get must be a deviceId string or DeviceDetails", 4e4, 400);
|
|
@@ -9330,9 +9326,7 @@ var ably = {exports: {}};
|
|
|
9330
9326
|
var client = _this29.client,
|
|
9331
9327
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9332
9328
|
envelope = _this29.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9333
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9334
|
-
format
|
|
9335
|
-
});
|
|
9329
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9336
9330
|
_mixin(headers, client.options.headers);
|
|
9337
9331
|
return new paginatedresource_default(client, "/push/deviceRegistrations", headers, envelope, /*#__PURE__*/function () {
|
|
9338
9332
|
var _ref3 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
@@ -9348,10 +9342,7 @@ var ably = {exports: {}};
|
|
|
9348
9342
|
var _this30 = this;
|
|
9349
9343
|
return _asyncToGenerator(function* () {
|
|
9350
9344
|
var client = _this30.client,
|
|
9351
|
-
|
|
9352
|
-
headers = defaults_default.defaultGetHeaders(client.options, {
|
|
9353
|
-
format
|
|
9354
|
-
}),
|
|
9345
|
+
headers = defaults_default.defaultGetHeaders(client.options),
|
|
9355
9346
|
params = {},
|
|
9356
9347
|
deviceId = deviceIdOrDetails.id || deviceIdOrDetails;
|
|
9357
9348
|
if (typeof deviceId !== "string" || !deviceId.length) {
|
|
@@ -9392,9 +9383,7 @@ var ably = {exports: {}};
|
|
|
9392
9383
|
var client = _this32.client;
|
|
9393
9384
|
var body = pushchannelsubscription_default.fromValues(subscription);
|
|
9394
9385
|
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9395
|
-
headers = defaults_default.defaultPostHeaders(client.options,
|
|
9396
|
-
format
|
|
9397
|
-
}),
|
|
9386
|
+
headers = defaults_default.defaultPostHeaders(client.options),
|
|
9398
9387
|
params = {};
|
|
9399
9388
|
_mixin(headers, client.options.headers);
|
|
9400
9389
|
if (client.options.pushFullWait) _mixin(params, {
|
|
@@ -9411,9 +9400,7 @@ var ably = {exports: {}};
|
|
|
9411
9400
|
var client = _this33.client,
|
|
9412
9401
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9413
9402
|
envelope = _this33.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9414
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9415
|
-
format
|
|
9416
|
-
});
|
|
9403
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9417
9404
|
_mixin(headers, client.options.headers);
|
|
9418
9405
|
return new paginatedresource_default(client, "/push/channelSubscriptions", headers, envelope, /*#__PURE__*/function () {
|
|
9419
9406
|
var _ref4 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
@@ -9446,9 +9433,7 @@ var ably = {exports: {}};
|
|
|
9446
9433
|
var client = _this35.client,
|
|
9447
9434
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9448
9435
|
envelope = _this35.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9449
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9450
|
-
format
|
|
9451
|
-
});
|
|
9436
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9452
9437
|
_mixin(headers, client.options.headers);
|
|
9453
9438
|
if (client.options.pushFullWait) _mixin(params, {
|
|
9454
9439
|
fullWait: "true"
|
|
@@ -9611,9 +9596,7 @@ var ably = {exports: {}};
|
|
|
9611
9596
|
var client = _this38.channel.client,
|
|
9612
9597
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9613
9598
|
envelope = _this38.channel.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9614
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9615
|
-
format
|
|
9616
|
-
});
|
|
9599
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9617
9600
|
_mixin(headers, client.options.headers);
|
|
9618
9601
|
return new paginatedresource_default(client, _this38.channel.client.rest.presenceMixin.basePath(_this38), headers, envelope, /*#__PURE__*/function () {
|
|
9619
9602
|
var _ref6 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
@@ -9737,6 +9720,21 @@ var ably = {exports: {}};
|
|
|
9737
9720
|
} else if (!this.annotations.summary) {
|
|
9738
9721
|
this.annotations.summary = {};
|
|
9739
9722
|
}
|
|
9723
|
+
if (this.annotations && this.annotations.summary) {
|
|
9724
|
+
for (var [type, summaryEntry] of Object.entries(this.annotations.summary)) {
|
|
9725
|
+
if (type.endsWith(":distinct.v1") || type.endsWith(":unique.v1") || type.endsWith(":multiple.v1")) {
|
|
9726
|
+
for (var [, entry] of Object.entries(summaryEntry)) {
|
|
9727
|
+
if (!entry.clipped) {
|
|
9728
|
+
entry.clipped = false;
|
|
9729
|
+
}
|
|
9730
|
+
}
|
|
9731
|
+
} else if (type.endsWith(":flag.v1")) {
|
|
9732
|
+
if (!summaryEntry.clipped) {
|
|
9733
|
+
summaryEntry.clipped = false;
|
|
9734
|
+
}
|
|
9735
|
+
}
|
|
9736
|
+
}
|
|
9737
|
+
}
|
|
9740
9738
|
}
|
|
9741
9739
|
encode(options) {
|
|
9742
9740
|
var _this40 = this;
|
|
@@ -9886,9 +9884,7 @@ var ably = {exports: {}};
|
|
|
9886
9884
|
options = client.options,
|
|
9887
9885
|
format = options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9888
9886
|
idempotentRestPublishing = client.options.idempotentRestPublishing,
|
|
9889
|
-
headers = defaults_default.defaultPostHeaders(client.options
|
|
9890
|
-
format
|
|
9891
|
-
});
|
|
9887
|
+
headers = defaults_default.defaultPostHeaders(client.options);
|
|
9892
9888
|
_mixin(headers, options.headers);
|
|
9893
9889
|
if (idempotentRestPublishing && allEmptyIds(messages)) {
|
|
9894
9890
|
var msgIdBase = yield _randomString(MSG_ID_ENTROPY_BYTES);
|
|
@@ -9917,6 +9913,38 @@ var ably = {exports: {}};
|
|
|
9917
9913
|
return _this46.client.rest.channelMixin.status(_this46);
|
|
9918
9914
|
})();
|
|
9919
9915
|
}
|
|
9916
|
+
getMessage(serialOrMessage) {
|
|
9917
|
+
var _this47 = this;
|
|
9918
|
+
return _asyncToGenerator(function* () {
|
|
9919
|
+
logger_default.logAction(_this47.logger, logger_default.LOG_MICRO, "RestChannel.getMessage()", "channel = " + _this47.name);
|
|
9920
|
+
return _this47.client.rest.channelMixin.getMessage(_this47, serialOrMessage);
|
|
9921
|
+
})();
|
|
9922
|
+
}
|
|
9923
|
+
updateMessage(message, operation, params) {
|
|
9924
|
+
var _this48 = this;
|
|
9925
|
+
return _asyncToGenerator(function* () {
|
|
9926
|
+
logger_default.logAction(_this48.logger, logger_default.LOG_MICRO, "RestChannel.updateMessage()", "channel = " + _this48.name);
|
|
9927
|
+
return _this48.client.rest.channelMixin.updateDeleteMessage(_this48, {
|
|
9928
|
+
isDelete: false
|
|
9929
|
+
}, message, operation, params);
|
|
9930
|
+
})();
|
|
9931
|
+
}
|
|
9932
|
+
deleteMessage(message, operation, params) {
|
|
9933
|
+
var _this49 = this;
|
|
9934
|
+
return _asyncToGenerator(function* () {
|
|
9935
|
+
logger_default.logAction(_this49.logger, logger_default.LOG_MICRO, "RestChannel.deleteMessage()", "channel = " + _this49.name);
|
|
9936
|
+
return _this49.client.rest.channelMixin.updateDeleteMessage(_this49, {
|
|
9937
|
+
isDelete: true
|
|
9938
|
+
}, message, operation, params);
|
|
9939
|
+
})();
|
|
9940
|
+
}
|
|
9941
|
+
getMessageVersions(serialOrMessage, params) {
|
|
9942
|
+
var _this50 = this;
|
|
9943
|
+
return _asyncToGenerator(function* () {
|
|
9944
|
+
logger_default.logAction(_this50.logger, logger_default.LOG_MICRO, "RestChannel.getMessageVersions()", "channel = " + _this50.name);
|
|
9945
|
+
return _this50.client.rest.channelMixin.getMessageVersions(_this50, serialOrMessage, params);
|
|
9946
|
+
})();
|
|
9947
|
+
}
|
|
9920
9948
|
};
|
|
9921
9949
|
var restchannel_default = RestChannel;
|
|
9922
9950
|
|
|
@@ -9945,9 +9973,7 @@ var ably = {exports: {}};
|
|
|
9945
9973
|
var client = channel.client,
|
|
9946
9974
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9947
9975
|
envelope = channel.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9948
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9949
|
-
format
|
|
9950
|
-
});
|
|
9976
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9951
9977
|
_mixin(headers, client.options.headers);
|
|
9952
9978
|
return new paginatedresource_default(client, this.basePath(channel) + "/messages", headers, envelope, /*#__PURE__*/function () {
|
|
9953
9979
|
var _ref7 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
@@ -9960,16 +9986,81 @@ var ably = {exports: {}};
|
|
|
9960
9986
|
}()).get(params);
|
|
9961
9987
|
}
|
|
9962
9988
|
static status(channel) {
|
|
9963
|
-
var
|
|
9989
|
+
var _this51 = this;
|
|
9964
9990
|
return _asyncToGenerator(function* () {
|
|
9965
9991
|
var format = channel.client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */;
|
|
9966
|
-
var headers = defaults_default.defaultPostHeaders(channel.client.options
|
|
9967
|
-
|
|
9968
|
-
});
|
|
9969
|
-
var response = yield resource_default.get(channel.client, _this47.basePath(channel), headers, {}, format, true);
|
|
9992
|
+
var headers = defaults_default.defaultPostHeaders(channel.client.options);
|
|
9993
|
+
var response = yield resource_default.get(channel.client, _this51.basePath(channel), headers, {}, format, true);
|
|
9970
9994
|
return response.body;
|
|
9971
9995
|
})();
|
|
9972
9996
|
}
|
|
9997
|
+
static getMessage(channel, serialOrMessage) {
|
|
9998
|
+
var _this52 = this;
|
|
9999
|
+
return _asyncToGenerator(function* () {
|
|
10000
|
+
var serial = typeof serialOrMessage === "string" ? serialOrMessage : serialOrMessage.serial;
|
|
10001
|
+
if (!serial) {
|
|
10002
|
+
throw new _ErrorInfo2('This message lacks a serial. Make sure you have enabled "Message annotations, updates, and deletes" in channel settings on your dashboard.', 40003, 400);
|
|
10003
|
+
}
|
|
10004
|
+
var client = channel.client;
|
|
10005
|
+
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */;
|
|
10006
|
+
var headers = defaults_default.defaultGetHeaders(client.options);
|
|
10007
|
+
_mixin(headers, client.options.headers);
|
|
10008
|
+
var {
|
|
10009
|
+
body,
|
|
10010
|
+
unpacked
|
|
10011
|
+
} = yield resource_default.get(client, _this52.basePath(channel) + "/messages/" + encodeURIComponent(serial), headers, {}, null, true);
|
|
10012
|
+
var decoded = unpacked ? body : _decodeBody(body, client._MsgPack, format);
|
|
10013
|
+
return _fromEncoded2(decoded, channel);
|
|
10014
|
+
})();
|
|
10015
|
+
}
|
|
10016
|
+
static updateDeleteMessage(channel, opts, message, operation, params) {
|
|
10017
|
+
var _this53 = this;
|
|
10018
|
+
return _asyncToGenerator(function* () {
|
|
10019
|
+
if (!message.serial) {
|
|
10020
|
+
throw new _ErrorInfo2('This message lacks a serial and cannot be updated. Make sure you have enabled "Message annotations, updates, and deletes" in channel settings on your dashboard.', 40003, 400);
|
|
10021
|
+
}
|
|
10022
|
+
var client = channel.client;
|
|
10023
|
+
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */;
|
|
10024
|
+
var headers = defaults_default.defaultPostHeaders(client.options);
|
|
10025
|
+
_mixin(headers, client.options.headers);
|
|
10026
|
+
var encoded = null;
|
|
10027
|
+
if (message.data !== void 0) {
|
|
10028
|
+
encoded = yield message_default.fromValues(message).encode(channel.channelOptions);
|
|
10029
|
+
}
|
|
10030
|
+
var req = {
|
|
10031
|
+
serial: message.serial,
|
|
10032
|
+
operation,
|
|
10033
|
+
name: message.name,
|
|
10034
|
+
data: encoded && encoded.data,
|
|
10035
|
+
encoding: encoded && encoded.encoding,
|
|
10036
|
+
extras: message.extras
|
|
10037
|
+
};
|
|
10038
|
+
var requestBody = serialize(req, client._MsgPack, format);
|
|
10039
|
+
var method = opts.isDelete ? resource_default.post : resource_default.patch;
|
|
10040
|
+
var pathSuffix = opts.isDelete ? "/delete" : "";
|
|
10041
|
+
yield method(client, _this53.basePath(channel) + "/messages/" + encodeURIComponent(message.serial) + pathSuffix, requestBody, headers, params || {}, null, true);
|
|
10042
|
+
})();
|
|
10043
|
+
}
|
|
10044
|
+
static getMessageVersions(channel, serialOrMessage, params) {
|
|
10045
|
+
var serial = typeof serialOrMessage === "string" ? serialOrMessage : serialOrMessage.serial;
|
|
10046
|
+
if (!serial) {
|
|
10047
|
+
throw new _ErrorInfo2('This message lacks a serial. Make sure you have enabled "Message annotations, updates, and deletes" in channel settings on your dashboard.', 40003, 400);
|
|
10048
|
+
}
|
|
10049
|
+
var client = channel.client;
|
|
10050
|
+
var format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */;
|
|
10051
|
+
var envelope = channel.client.http.supportsLinkHeaders ? void 0 : format;
|
|
10052
|
+
var headers = defaults_default.defaultGetHeaders(client.options);
|
|
10053
|
+
_mixin(headers, client.options.headers);
|
|
10054
|
+
return new paginatedresource_default(client, this.basePath(channel) + "/messages/" + encodeURIComponent(serial) + "/versions", headers, envelope, /*#__PURE__*/function () {
|
|
10055
|
+
var _ref8 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
10056
|
+
var decoded = unpacked ? body : _decodeBody(body, client._MsgPack, format);
|
|
10057
|
+
return _fromEncodedArray2(decoded, channel);
|
|
10058
|
+
});
|
|
10059
|
+
return function (_x62, _x63, _x64) {
|
|
10060
|
+
return _ref8.apply(this, arguments);
|
|
10061
|
+
};
|
|
10062
|
+
}()).get(params || {});
|
|
10063
|
+
}
|
|
9973
10064
|
};
|
|
9974
10065
|
|
|
9975
10066
|
// src/common/lib/client/restpresencemixin.ts
|
|
@@ -9978,22 +10069,20 @@ var ably = {exports: {}};
|
|
|
9978
10069
|
return RestChannelMixin.basePath(presence.channel) + "/presence";
|
|
9979
10070
|
}
|
|
9980
10071
|
static history(presence, params) {
|
|
9981
|
-
var
|
|
10072
|
+
var _this54 = this;
|
|
9982
10073
|
return _asyncToGenerator(function* () {
|
|
9983
10074
|
var client = presence.channel.client,
|
|
9984
10075
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
9985
10076
|
envelope = presence.channel.client.http.supportsLinkHeaders ? void 0 : format,
|
|
9986
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
9987
|
-
format
|
|
9988
|
-
});
|
|
10077
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
9989
10078
|
_mixin(headers, client.options.headers);
|
|
9990
|
-
return new paginatedresource_default(client,
|
|
9991
|
-
var
|
|
10079
|
+
return new paginatedresource_default(client, _this54.basePath(presence) + "/history", headers, envelope, /*#__PURE__*/function () {
|
|
10080
|
+
var _ref9 = _asyncToGenerator(function* (body, headers2, unpacked) {
|
|
9992
10081
|
var decoded = unpacked ? body : _decodeBody(body, client._MsgPack, format);
|
|
9993
10082
|
return _fromEncodedArray(decoded, presence.channel);
|
|
9994
10083
|
});
|
|
9995
|
-
return function (
|
|
9996
|
-
return
|
|
10084
|
+
return function (_x65, _x66, _x67) {
|
|
10085
|
+
return _ref9.apply(this, arguments);
|
|
9997
10086
|
};
|
|
9998
10087
|
}()).get(params);
|
|
9999
10088
|
})();
|
|
@@ -10015,32 +10104,39 @@ var ably = {exports: {}};
|
|
|
10015
10104
|
this.push = new push_default(this.client);
|
|
10016
10105
|
}
|
|
10017
10106
|
stats(params) {
|
|
10018
|
-
var
|
|
10107
|
+
var _this55 = this;
|
|
10019
10108
|
return _asyncToGenerator(function* () {
|
|
10020
|
-
var headers = defaults_default.defaultGetHeaders(
|
|
10021
|
-
format =
|
|
10022
|
-
envelope =
|
|
10023
|
-
_mixin(headers,
|
|
10024
|
-
return new paginatedresource_default(
|
|
10025
|
-
var
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10109
|
+
var headers = defaults_default.defaultGetHeaders(_this55.client.options),
|
|
10110
|
+
format = _this55.client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10111
|
+
envelope = _this55.client.http.supportsLinkHeaders ? void 0 : format;
|
|
10112
|
+
_mixin(headers, _this55.client.options.headers);
|
|
10113
|
+
return new paginatedresource_default(_this55.client, "/stats", headers, envelope, /*#__PURE__*/function () {
|
|
10114
|
+
var _ref0 = _asyncToGenerator(function* (body, _, unpacked) {
|
|
10115
|
+
var statsValues = unpacked ? body : _decodeBody(body, _this55.client._MsgPack, format);
|
|
10116
|
+
for (var i = 0; i < statsValues.length; i++) statsValues[i] = stats_default.fromValues(statsValues[i]);
|
|
10117
|
+
return statsValues;
|
|
10118
|
+
});
|
|
10119
|
+
return function (_x68, _x69, _x70) {
|
|
10120
|
+
return _ref0.apply(this, arguments);
|
|
10121
|
+
};
|
|
10122
|
+
}()).get(params);
|
|
10029
10123
|
})();
|
|
10030
10124
|
}
|
|
10031
10125
|
time(params) {
|
|
10032
|
-
var
|
|
10126
|
+
var _this56 = this;
|
|
10033
10127
|
return _asyncToGenerator(function* () {
|
|
10034
|
-
var headers = defaults_default.defaultGetHeaders(
|
|
10035
|
-
|
|
10128
|
+
var headers = defaults_default.defaultGetHeaders(_this56.client.options, {
|
|
10129
|
+
format: "json" /* json */
|
|
10130
|
+
});
|
|
10131
|
+
if (_this56.client.options.headers) _mixin(headers, _this56.client.options.headers);
|
|
10036
10132
|
var timeUri = host => {
|
|
10037
|
-
return
|
|
10133
|
+
return _this56.client.baseUri(host) + "/time";
|
|
10038
10134
|
};
|
|
10039
10135
|
var {
|
|
10040
10136
|
error,
|
|
10041
10137
|
body,
|
|
10042
10138
|
unpacked
|
|
10043
|
-
} = yield
|
|
10139
|
+
} = yield _this56.client.http.do(HttpMethods_default.Get, timeUri, headers, null, params);
|
|
10044
10140
|
if (error) {
|
|
10045
10141
|
throw error;
|
|
10046
10142
|
}
|
|
@@ -10049,47 +10145,47 @@ var ably = {exports: {}};
|
|
|
10049
10145
|
if (!time) {
|
|
10050
10146
|
throw new _ErrorInfo2("Internal error (unexpected result type from GET /time)", 5e4, 500);
|
|
10051
10147
|
}
|
|
10052
|
-
|
|
10148
|
+
_this56.client.serverTimeOffset = time - Date.now();
|
|
10053
10149
|
return time;
|
|
10054
10150
|
})();
|
|
10055
10151
|
}
|
|
10056
10152
|
request(method, path, version2, params, body, customHeaders) {
|
|
10057
|
-
var
|
|
10153
|
+
var _this57 = this;
|
|
10058
10154
|
return _asyncToGenerator(function* () {
|
|
10059
10155
|
var _a2;
|
|
10060
10156
|
var [encoder, decoder, format] = (() => {
|
|
10061
|
-
if (
|
|
10062
|
-
if (!
|
|
10157
|
+
if (_this57.client.options.useBinaryProtocol) {
|
|
10158
|
+
if (!_this57.client._MsgPack) {
|
|
10063
10159
|
_throwMissingPluginError("MsgPack");
|
|
10064
10160
|
}
|
|
10065
|
-
return [
|
|
10161
|
+
return [_this57.client._MsgPack.encode, _this57.client._MsgPack.decode, "msgpack" /* msgpack */];
|
|
10066
10162
|
} else {
|
|
10067
10163
|
return [JSON.stringify, JSON.parse, "json" /* json */];
|
|
10068
10164
|
}
|
|
10069
10165
|
})();
|
|
10070
|
-
var envelope =
|
|
10166
|
+
var envelope = _this57.client.http.supportsLinkHeaders ? void 0 : format;
|
|
10071
10167
|
params = params || {};
|
|
10072
10168
|
var _method = method.toLowerCase();
|
|
10073
|
-
var headers = _method == "get" ? defaults_default.defaultGetHeaders(
|
|
10169
|
+
var headers = _method == "get" ? defaults_default.defaultGetHeaders(_this57.client.options, {
|
|
10074
10170
|
format,
|
|
10075
10171
|
protocolVersion: version2
|
|
10076
|
-
}) : defaults_default.defaultPostHeaders(
|
|
10172
|
+
}) : defaults_default.defaultPostHeaders(_this57.client.options, {
|
|
10077
10173
|
format,
|
|
10078
10174
|
protocolVersion: version2
|
|
10079
10175
|
});
|
|
10080
10176
|
if (typeof body !== "string") {
|
|
10081
10177
|
body = (_a2 = encoder(body)) != null ? _a2 : null;
|
|
10082
10178
|
}
|
|
10083
|
-
_mixin(headers,
|
|
10179
|
+
_mixin(headers, _this57.client.options.headers);
|
|
10084
10180
|
if (customHeaders) {
|
|
10085
10181
|
_mixin(headers, customHeaders);
|
|
10086
10182
|
}
|
|
10087
|
-
var paginatedResource = new paginatedresource_default(
|
|
10088
|
-
var
|
|
10183
|
+
var paginatedResource = new paginatedresource_default(_this57.client, path, headers, envelope, /*#__PURE__*/function () {
|
|
10184
|
+
var _ref1 = _asyncToGenerator(function* (resbody, headers2, unpacked) {
|
|
10089
10185
|
return _ensureArray(unpacked ? resbody : decoder(resbody));
|
|
10090
10186
|
});
|
|
10091
|
-
return function (
|
|
10092
|
-
return
|
|
10187
|
+
return function (_x71, _x72, _x73) {
|
|
10188
|
+
return _ref1.apply(this, arguments);
|
|
10093
10189
|
};
|
|
10094
10190
|
}(), /* useHttpPaginatedResponse: */
|
|
10095
10191
|
true);
|
|
@@ -10104,7 +10200,7 @@ var ably = {exports: {}};
|
|
|
10104
10200
|
})();
|
|
10105
10201
|
}
|
|
10106
10202
|
batchPublish(specOrSpecs) {
|
|
10107
|
-
var
|
|
10203
|
+
var _this58 = this;
|
|
10108
10204
|
return _asyncToGenerator(function* () {
|
|
10109
10205
|
var requestBodyDTO;
|
|
10110
10206
|
var singleSpecMode;
|
|
@@ -10115,14 +10211,12 @@ var ably = {exports: {}};
|
|
|
10115
10211
|
requestBodyDTO = [specOrSpecs];
|
|
10116
10212
|
singleSpecMode = true;
|
|
10117
10213
|
}
|
|
10118
|
-
var format =
|
|
10119
|
-
headers = defaults_default.defaultPostHeaders(
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
var
|
|
10124
|
-
var response = yield resource_default.post(_this52.client, "/messages", requestBody, headers, {}, null, true);
|
|
10125
|
-
var batchResults = response.unpacked ? response.body : _decodeBody(response.body, _this52.client._MsgPack, format);
|
|
10214
|
+
var format = _this58.client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10215
|
+
headers = defaults_default.defaultPostHeaders(_this58.client.options);
|
|
10216
|
+
if (_this58.client.options.headers) _mixin(headers, _this58.client.options.headers);
|
|
10217
|
+
var requestBody = _encodeBody(requestBodyDTO, _this58.client._MsgPack, format);
|
|
10218
|
+
var response = yield resource_default.post(_this58.client, "/messages", requestBody, headers, {}, null, true);
|
|
10219
|
+
var batchResults = response.unpacked ? response.body : _decodeBody(response.body, _this58.client._MsgPack, format);
|
|
10126
10220
|
if (singleSpecMode) {
|
|
10127
10221
|
return batchResults[0];
|
|
10128
10222
|
} else {
|
|
@@ -10131,39 +10225,35 @@ var ably = {exports: {}};
|
|
|
10131
10225
|
})();
|
|
10132
10226
|
}
|
|
10133
10227
|
batchPresence(channels) {
|
|
10134
|
-
var
|
|
10228
|
+
var _this59 = this;
|
|
10135
10229
|
return _asyncToGenerator(function* () {
|
|
10136
|
-
var format =
|
|
10137
|
-
headers = defaults_default.
|
|
10138
|
-
|
|
10139
|
-
});
|
|
10140
|
-
if (_this53.client.options.headers) _mixin(headers, _this53.client.options.headers);
|
|
10230
|
+
var format = _this59.client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10231
|
+
headers = defaults_default.defaultGetHeaders(_this59.client.options);
|
|
10232
|
+
if (_this59.client.options.headers) _mixin(headers, _this59.client.options.headers);
|
|
10141
10233
|
var channelsParam = channels.join(",");
|
|
10142
|
-
var response = yield resource_default.get(
|
|
10234
|
+
var response = yield resource_default.get(_this59.client, "/presence", headers, {
|
|
10143
10235
|
channels: channelsParam
|
|
10144
10236
|
}, null, true);
|
|
10145
|
-
return response.unpacked ? response.body : _decodeBody(response.body,
|
|
10237
|
+
return response.unpacked ? response.body : _decodeBody(response.body, _this59.client._MsgPack, format);
|
|
10146
10238
|
})();
|
|
10147
10239
|
}
|
|
10148
10240
|
revokeTokens(specifiers, options) {
|
|
10149
|
-
var
|
|
10241
|
+
var _this60 = this;
|
|
10150
10242
|
return _asyncToGenerator(function* () {
|
|
10151
|
-
if (useTokenAuth(
|
|
10243
|
+
if (useTokenAuth(_this60.client.options)) {
|
|
10152
10244
|
throw new _ErrorInfo2("Cannot revoke tokens when using token auth", 40162, 401);
|
|
10153
10245
|
}
|
|
10154
|
-
var keyName =
|
|
10246
|
+
var keyName = _this60.client.options.keyName;
|
|
10155
10247
|
var resolvedOptions = options != null ? options : {};
|
|
10156
10248
|
var requestBodyDTO = __spreadValues({
|
|
10157
10249
|
targets: specifiers.map(specifier => "".concat(specifier.type, ":").concat(specifier.value))
|
|
10158
10250
|
}, resolvedOptions);
|
|
10159
|
-
var format =
|
|
10160
|
-
headers = defaults_default.defaultPostHeaders(
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
var response = yield resource_default.post(_this54.client, "/keys/".concat(keyName, "/revokeTokens"), requestBody, headers, {}, null, true);
|
|
10166
|
-
return response.unpacked ? response.body : _decodeBody(response.body, _this54.client._MsgPack, format);
|
|
10251
|
+
var format = _this60.client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10252
|
+
headers = defaults_default.defaultPostHeaders(_this60.client.options);
|
|
10253
|
+
if (_this60.client.options.headers) _mixin(headers, _this60.client.options.headers);
|
|
10254
|
+
var requestBody = _encodeBody(requestBodyDTO, _this60.client._MsgPack, format);
|
|
10255
|
+
var response = yield resource_default.post(_this60.client, "/keys/".concat(keyName, "/revokeTokens"), requestBody, headers, {}, null, true);
|
|
10256
|
+
return response.unpacked ? response.body : _decodeBody(response.body, _this60.client._MsgPack, format);
|
|
10167
10257
|
})();
|
|
10168
10258
|
}
|
|
10169
10259
|
};
|
|
@@ -10247,7 +10337,7 @@ var ably = {exports: {}};
|
|
|
10247
10337
|
|
|
10248
10338
|
// src/common/lib/types/annotation.ts
|
|
10249
10339
|
var actions4 = ["annotation.create", "annotation.delete"];
|
|
10250
|
-
function fromEncoded3(
|
|
10340
|
+
function fromEncoded3(_x74, _x75, _x76) {
|
|
10251
10341
|
return _fromEncoded8.apply(this, arguments);
|
|
10252
10342
|
}
|
|
10253
10343
|
function _fromEncoded8() {
|
|
@@ -10257,7 +10347,7 @@ var ably = {exports: {}};
|
|
|
10257
10347
|
});
|
|
10258
10348
|
return _fromEncoded8.apply(this, arguments);
|
|
10259
10349
|
}
|
|
10260
|
-
function fromEncodedArray3(
|
|
10350
|
+
function fromEncodedArray3(_x77, _x78, _x79) {
|
|
10261
10351
|
return _fromEncodedArray8.apply(this, arguments);
|
|
10262
10352
|
}
|
|
10263
10353
|
function _fromEncodedArray8() {
|
|
@@ -10268,7 +10358,7 @@ var ably = {exports: {}};
|
|
|
10268
10358
|
});
|
|
10269
10359
|
return _fromEncodedArray8.apply(this, arguments);
|
|
10270
10360
|
}
|
|
10271
|
-
function _fromEncoded3(
|
|
10361
|
+
function _fromEncoded3(_x80, _x81) {
|
|
10272
10362
|
return _fromEncoded9.apply(this, arguments);
|
|
10273
10363
|
}
|
|
10274
10364
|
function _fromEncoded9() {
|
|
@@ -10277,7 +10367,7 @@ var ably = {exports: {}};
|
|
|
10277
10367
|
});
|
|
10278
10368
|
return _fromEncoded9.apply(this, arguments);
|
|
10279
10369
|
}
|
|
10280
|
-
function _fromEncodedArray3(
|
|
10370
|
+
function _fromEncodedArray3(_x82, _x83) {
|
|
10281
10371
|
return _fromEncodedArray9.apply(this, arguments);
|
|
10282
10372
|
}
|
|
10283
10373
|
function _fromEncodedArray9() {
|
|
@@ -10290,10 +10380,10 @@ var ably = {exports: {}};
|
|
|
10290
10380
|
}
|
|
10291
10381
|
var Annotation = class _Annotation extends BaseMessage {
|
|
10292
10382
|
encode() {
|
|
10293
|
-
var
|
|
10383
|
+
var _this61 = this;
|
|
10294
10384
|
return _asyncToGenerator(function* () {
|
|
10295
|
-
var res = Object.assign(new WireAnnotation(),
|
|
10296
|
-
action: actions4.indexOf(
|
|
10385
|
+
var res = Object.assign(new WireAnnotation(), _this61, {
|
|
10386
|
+
action: actions4.indexOf(_this61.action || "annotation.create")
|
|
10297
10387
|
});
|
|
10298
10388
|
return encode(res, {});
|
|
10299
10389
|
})();
|
|
@@ -10322,10 +10412,10 @@ var ably = {exports: {}};
|
|
|
10322
10412
|
return values.map(v => _WireAnnotation.fromValues(v));
|
|
10323
10413
|
}
|
|
10324
10414
|
decode(channelOptions, logger) {
|
|
10325
|
-
var
|
|
10415
|
+
var _this62 = this;
|
|
10326
10416
|
return _asyncToGenerator(function* () {
|
|
10327
|
-
var res = Object.assign(new Annotation(), __spreadProps(__spreadValues({},
|
|
10328
|
-
action: actions4[
|
|
10417
|
+
var res = Object.assign(new Annotation(), __spreadProps(__spreadValues({}, _this62), {
|
|
10418
|
+
action: actions4[_this62.action]
|
|
10329
10419
|
}));
|
|
10330
10420
|
try {
|
|
10331
10421
|
yield decode(res, channelOptions);
|
|
@@ -10394,47 +10484,43 @@ var ably = {exports: {}};
|
|
|
10394
10484
|
this.channel = channel;
|
|
10395
10485
|
}
|
|
10396
10486
|
publish(msgOrSerial, annotationValues) {
|
|
10397
|
-
var
|
|
10487
|
+
var _this63 = this;
|
|
10398
10488
|
return _asyncToGenerator(function* () {
|
|
10399
10489
|
var annotation = constructValidateAnnotation(msgOrSerial, annotationValues);
|
|
10400
10490
|
var wireAnnotation = yield annotation.encode();
|
|
10401
|
-
var client =
|
|
10491
|
+
var client = _this63.channel.client,
|
|
10402
10492
|
options = client.options,
|
|
10403
10493
|
format = options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10404
|
-
headers = defaults_default.defaultPostHeaders(client.options,
|
|
10405
|
-
format
|
|
10406
|
-
}),
|
|
10494
|
+
headers = defaults_default.defaultPostHeaders(client.options),
|
|
10407
10495
|
params = {};
|
|
10408
10496
|
_mixin(headers, client.options.headers);
|
|
10409
10497
|
var requestBody = _encodeBody([wireAnnotation], client._MsgPack, format);
|
|
10410
|
-
yield resource_default.post(client, basePathForSerial(
|
|
10498
|
+
yield resource_default.post(client, basePathForSerial(_this63.channel, annotation.messageSerial), requestBody, headers, params, null, true);
|
|
10411
10499
|
})();
|
|
10412
10500
|
}
|
|
10413
10501
|
delete(msgOrSerial, annotationValues) {
|
|
10414
|
-
var
|
|
10502
|
+
var _this64 = this;
|
|
10415
10503
|
return _asyncToGenerator(function* () {
|
|
10416
10504
|
annotationValues.action = "annotation.delete";
|
|
10417
|
-
return
|
|
10505
|
+
return _this64.publish(msgOrSerial, annotationValues);
|
|
10418
10506
|
})();
|
|
10419
10507
|
}
|
|
10420
10508
|
get(msgOrSerial, params) {
|
|
10421
|
-
var
|
|
10509
|
+
var _this65 = this;
|
|
10422
10510
|
return _asyncToGenerator(function* () {
|
|
10423
|
-
var client =
|
|
10511
|
+
var client = _this65.channel.client,
|
|
10424
10512
|
messageSerial = serialFromMsgOrSerial(msgOrSerial),
|
|
10425
10513
|
format = client.options.useBinaryProtocol ? "msgpack" /* msgpack */ : "json" /* json */,
|
|
10426
10514
|
envelope = client.http.supportsLinkHeaders ? void 0 : format,
|
|
10427
|
-
headers = defaults_default.defaultGetHeaders(client.options
|
|
10428
|
-
format
|
|
10429
|
-
});
|
|
10515
|
+
headers = defaults_default.defaultGetHeaders(client.options);
|
|
10430
10516
|
_mixin(headers, client.options.headers);
|
|
10431
|
-
return new paginatedresource_default(client, basePathForSerial(
|
|
10432
|
-
var
|
|
10517
|
+
return new paginatedresource_default(client, basePathForSerial(_this65.channel, messageSerial), headers, envelope, /*#__PURE__*/function () {
|
|
10518
|
+
var _ref10 = _asyncToGenerator(function* (body, _, unpacked) {
|
|
10433
10519
|
var decoded = unpacked ? body : _decodeBody(body, client._MsgPack, format);
|
|
10434
|
-
return _fromEncodedArray3(decoded,
|
|
10520
|
+
return _fromEncodedArray3(decoded, _this65.channel);
|
|
10435
10521
|
});
|
|
10436
|
-
return function (
|
|
10437
|
-
return
|
|
10522
|
+
return function (_x84, _x85, _x86) {
|
|
10523
|
+
return _ref10.apply(this, arguments);
|
|
10438
10524
|
};
|
|
10439
10525
|
}()).get(params);
|
|
10440
10526
|
})();
|
|
@@ -10605,7 +10691,7 @@ var ably = {exports: {}};
|
|
|
10605
10691
|
this._mode = 0;
|
|
10606
10692
|
this.retryCount = 0;
|
|
10607
10693
|
this.history = /*#__PURE__*/function () {
|
|
10608
|
-
var
|
|
10694
|
+
var _ref11 = _asyncToGenerator(function* (params) {
|
|
10609
10695
|
logger_default.logAction(this.logger, logger_default.LOG_MICRO, "RealtimeChannel.history()", "channel = " + this.name);
|
|
10610
10696
|
var restMixin = this.client.rest.channelMixin;
|
|
10611
10697
|
if (params && params.untilAttach) {
|
|
@@ -10620,8 +10706,8 @@ var ably = {exports: {}};
|
|
|
10620
10706
|
}
|
|
10621
10707
|
return restMixin.history(this, params);
|
|
10622
10708
|
});
|
|
10623
|
-
return function (
|
|
10624
|
-
return
|
|
10709
|
+
return function (_x87) {
|
|
10710
|
+
return _ref11.apply(this, arguments);
|
|
10625
10711
|
};
|
|
10626
10712
|
}();
|
|
10627
10713
|
this.whenState = state => {
|
|
@@ -10700,20 +10786,20 @@ var ably = {exports: {}};
|
|
|
10700
10786
|
return args;
|
|
10701
10787
|
}
|
|
10702
10788
|
setOptions(options) {
|
|
10703
|
-
var
|
|
10789
|
+
var _this66 = this;
|
|
10704
10790
|
return _asyncToGenerator(function* () {
|
|
10705
10791
|
var _a2;
|
|
10706
|
-
var previousChannelOptions =
|
|
10792
|
+
var previousChannelOptions = _this66.channelOptions;
|
|
10707
10793
|
var err = validateChannelOptions(options);
|
|
10708
10794
|
if (err) {
|
|
10709
10795
|
throw err;
|
|
10710
10796
|
}
|
|
10711
|
-
|
|
10712
|
-
if (
|
|
10713
|
-
if (
|
|
10714
|
-
|
|
10797
|
+
_this66.channelOptions = normaliseChannelOptions((_a2 = _this66.client._Crypto) != null ? _a2 : null, _this66.logger, options);
|
|
10798
|
+
if (_this66._decodingContext) _this66._decodingContext.channelOptions = _this66.channelOptions;
|
|
10799
|
+
if (_this66._shouldReattachToSetOptions(options, previousChannelOptions)) {
|
|
10800
|
+
_this66.attachImpl();
|
|
10715
10801
|
return new Promise((resolve, reject) => {
|
|
10716
|
-
|
|
10802
|
+
_this66._allChannelChanges.once(["attached", "update", "detached", "failed"], function (stateChange) {
|
|
10717
10803
|
switch (this.event) {
|
|
10718
10804
|
case "update":
|
|
10719
10805
|
case "attached":
|
|
@@ -10750,7 +10836,7 @@ var ably = {exports: {}};
|
|
|
10750
10836
|
}
|
|
10751
10837
|
publish() {
|
|
10752
10838
|
var _arguments2 = arguments,
|
|
10753
|
-
|
|
10839
|
+
_this67 = this;
|
|
10754
10840
|
return _asyncToGenerator(function* () {
|
|
10755
10841
|
var messages;
|
|
10756
10842
|
var argCount = _arguments2.length;
|
|
@@ -10768,20 +10854,20 @@ var ably = {exports: {}};
|
|
|
10768
10854
|
data: _arguments2.length <= 1 ? undefined : _arguments2[1]
|
|
10769
10855
|
})];
|
|
10770
10856
|
}
|
|
10771
|
-
var maxMessageSize =
|
|
10772
|
-
var wireMessages = yield encodeArray(messages,
|
|
10857
|
+
var maxMessageSize = _this67.client.options.maxMessageSize;
|
|
10858
|
+
var wireMessages = yield encodeArray(messages, _this67.channelOptions);
|
|
10773
10859
|
var size = getMessagesSize(wireMessages);
|
|
10774
10860
|
if (size > maxMessageSize) {
|
|
10775
10861
|
throw new _ErrorInfo2("Maximum size of messages that can be published at once exceeded (was ".concat(size, " bytes; limit is ").concat(maxMessageSize, " bytes)"), 40009, 400);
|
|
10776
10862
|
}
|
|
10777
|
-
|
|
10778
|
-
logger_default.logAction(
|
|
10863
|
+
_this67.throwIfUnpublishableState();
|
|
10864
|
+
logger_default.logAction(_this67.logger, logger_default.LOG_MICRO, "RealtimeChannel.publish()", "sending message; channel state is " + _this67.state + ", message count = " + wireMessages.length);
|
|
10779
10865
|
var pm = fromValues({
|
|
10780
10866
|
action: actions.MESSAGE,
|
|
10781
|
-
channel:
|
|
10867
|
+
channel: _this67.name,
|
|
10782
10868
|
messages: wireMessages
|
|
10783
10869
|
});
|
|
10784
|
-
return
|
|
10870
|
+
return _this67.sendMessage(pm);
|
|
10785
10871
|
})();
|
|
10786
10872
|
}
|
|
10787
10873
|
throwIfUnpublishableState() {
|
|
@@ -10801,13 +10887,13 @@ var ably = {exports: {}};
|
|
|
10801
10887
|
}
|
|
10802
10888
|
}
|
|
10803
10889
|
attach() {
|
|
10804
|
-
var
|
|
10890
|
+
var _this68 = this;
|
|
10805
10891
|
return _asyncToGenerator(function* () {
|
|
10806
|
-
if (
|
|
10892
|
+
if (_this68.state === "attached") {
|
|
10807
10893
|
return null;
|
|
10808
10894
|
}
|
|
10809
10895
|
return new Promise((resolve, reject) => {
|
|
10810
|
-
|
|
10896
|
+
_this68._attach(false, null, (err, result) => err ? reject(err) : resolve(result));
|
|
10811
10897
|
});
|
|
10812
10898
|
})();
|
|
10813
10899
|
}
|
|
@@ -10865,25 +10951,25 @@ var ably = {exports: {}};
|
|
|
10865
10951
|
this.sendMessage(attachMsg).catch(noop);
|
|
10866
10952
|
}
|
|
10867
10953
|
detach() {
|
|
10868
|
-
var
|
|
10954
|
+
var _this69 = this;
|
|
10869
10955
|
return _asyncToGenerator(function* () {
|
|
10870
|
-
var connectionManager =
|
|
10956
|
+
var connectionManager = _this69.connectionManager;
|
|
10871
10957
|
if (!connectionManager.activeState()) {
|
|
10872
10958
|
throw connectionManager.getError();
|
|
10873
10959
|
}
|
|
10874
|
-
switch (
|
|
10960
|
+
switch (_this69.state) {
|
|
10875
10961
|
case "suspended":
|
|
10876
|
-
|
|
10962
|
+
_this69.notifyState("detached");
|
|
10877
10963
|
return;
|
|
10878
10964
|
case "detached":
|
|
10879
10965
|
return;
|
|
10880
10966
|
case "failed":
|
|
10881
10967
|
throw new _ErrorInfo2("Unable to detach; channel state = failed", 90001, 400);
|
|
10882
10968
|
default:
|
|
10883
|
-
|
|
10969
|
+
_this69.requestState("detaching");
|
|
10884
10970
|
case "detaching":
|
|
10885
10971
|
return new Promise((resolve, reject) => {
|
|
10886
|
-
|
|
10972
|
+
_this69.once(function (stateChange) {
|
|
10887
10973
|
switch (this.event) {
|
|
10888
10974
|
case "detached":
|
|
10889
10975
|
resolve();
|
|
@@ -10912,22 +10998,22 @@ var ably = {exports: {}};
|
|
|
10912
10998
|
}
|
|
10913
10999
|
subscribe() {
|
|
10914
11000
|
var _arguments3 = arguments,
|
|
10915
|
-
|
|
11001
|
+
_this70 = this;
|
|
10916
11002
|
return _asyncToGenerator(function* () {
|
|
10917
11003
|
for (var _len0 = _arguments3.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
|
10918
11004
|
args[_key0] = _arguments3[_key0];
|
|
10919
11005
|
}
|
|
10920
11006
|
var [event, listener] = _RealtimeChannel.processListenerArgs(args);
|
|
10921
|
-
if (
|
|
10922
|
-
throw _ErrorInfo2.fromValues(
|
|
11007
|
+
if (_this70.state === "failed") {
|
|
11008
|
+
throw _ErrorInfo2.fromValues(_this70.invalidStateError());
|
|
10923
11009
|
}
|
|
10924
11010
|
if (event && typeof event === "object" && !Array.isArray(event)) {
|
|
10925
|
-
|
|
11011
|
+
_this70.client._FilteredSubscriptions.subscribeFilter(_this70, event, listener);
|
|
10926
11012
|
} else {
|
|
10927
|
-
|
|
11013
|
+
_this70.subscriptions.on(event, listener);
|
|
10928
11014
|
}
|
|
10929
|
-
if (
|
|
10930
|
-
return
|
|
11015
|
+
if (_this70.channelOptions.attachOnSubscribe !== false) {
|
|
11016
|
+
return _this70.attach();
|
|
10931
11017
|
} else {
|
|
10932
11018
|
return null;
|
|
10933
11019
|
}
|
|
@@ -10966,10 +11052,10 @@ var ably = {exports: {}};
|
|
|
10966
11052
|
connectionManager.send(syncMessage);
|
|
10967
11053
|
}
|
|
10968
11054
|
sendMessage(msg) {
|
|
10969
|
-
var
|
|
11055
|
+
var _this71 = this;
|
|
10970
11056
|
return _asyncToGenerator(function* () {
|
|
10971
11057
|
return new Promise((resolve, reject) => {
|
|
10972
|
-
|
|
11058
|
+
_this71.connectionManager.send(msg, _this71.client.options.queueMessages, err => {
|
|
10973
11059
|
if (err) {
|
|
10974
11060
|
reject(err);
|
|
10975
11061
|
} else {
|
|
@@ -10980,14 +11066,14 @@ var ably = {exports: {}};
|
|
|
10980
11066
|
})();
|
|
10981
11067
|
}
|
|
10982
11068
|
sendPresence(presence) {
|
|
10983
|
-
var
|
|
11069
|
+
var _this72 = this;
|
|
10984
11070
|
return _asyncToGenerator(function* () {
|
|
10985
11071
|
var msg = fromValues({
|
|
10986
11072
|
action: actions.PRESENCE,
|
|
10987
|
-
channel:
|
|
11073
|
+
channel: _this72.name,
|
|
10988
11074
|
presence
|
|
10989
11075
|
});
|
|
10990
|
-
return
|
|
11076
|
+
return _this72.sendMessage(msg);
|
|
10991
11077
|
})();
|
|
10992
11078
|
}
|
|
10993
11079
|
sendState(objectMessages) {
|
|
@@ -11000,61 +11086,61 @@ var ably = {exports: {}};
|
|
|
11000
11086
|
}
|
|
11001
11087
|
// Access to this method is synchronised by ConnectionManager#processChannelMessage, in order to synchronise access to the state stored in _decodingContext.
|
|
11002
11088
|
processMessage(message) {
|
|
11003
|
-
var
|
|
11089
|
+
var _this73 = this;
|
|
11004
11090
|
return _asyncToGenerator(function* () {
|
|
11005
11091
|
if (message.action === actions.ATTACHED || message.action === actions.MESSAGE || message.action === actions.PRESENCE || message.action === actions.OBJECT || message.action === actions.ANNOTATION) {
|
|
11006
|
-
|
|
11092
|
+
_this73.setChannelSerial(message.channelSerial);
|
|
11007
11093
|
}
|
|
11008
11094
|
var syncChannelSerial,
|
|
11009
11095
|
isSync = false;
|
|
11010
11096
|
switch (message.action) {
|
|
11011
11097
|
case actions.ATTACHED:
|
|
11012
11098
|
{
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11099
|
+
_this73.properties.attachSerial = message.channelSerial;
|
|
11100
|
+
_this73._mode = message.getMode();
|
|
11101
|
+
_this73.params = message.params || {};
|
|
11016
11102
|
var modesFromFlags = message.decodeModesFromFlags();
|
|
11017
|
-
|
|
11103
|
+
_this73.modes = modesFromFlags && _allToLowerCase(modesFromFlags) || void 0;
|
|
11018
11104
|
var resumed = message.hasFlag("RESUMED");
|
|
11019
11105
|
var hasPresence = message.hasFlag("HAS_PRESENCE");
|
|
11020
11106
|
var hasBacklog = message.hasFlag("HAS_BACKLOG");
|
|
11021
11107
|
var hasObjects = message.hasFlag("HAS_OBJECTS");
|
|
11022
|
-
if (
|
|
11108
|
+
if (_this73.state === "attached") {
|
|
11023
11109
|
if (!resumed) {
|
|
11024
|
-
if (
|
|
11025
|
-
|
|
11110
|
+
if (_this73._presence) {
|
|
11111
|
+
_this73._presence.onAttached(hasPresence);
|
|
11026
11112
|
}
|
|
11027
|
-
if (
|
|
11028
|
-
|
|
11113
|
+
if (_this73._objects) {
|
|
11114
|
+
_this73._objects.onAttached(hasObjects);
|
|
11029
11115
|
}
|
|
11030
11116
|
}
|
|
11031
|
-
var change = new channelstatechange_default(
|
|
11032
|
-
|
|
11033
|
-
if (!resumed ||
|
|
11034
|
-
|
|
11117
|
+
var change = new channelstatechange_default(_this73.state, _this73.state, resumed, hasBacklog, message.error);
|
|
11118
|
+
_this73._allChannelChanges.emit("update", change);
|
|
11119
|
+
if (!resumed || _this73.channelOptions.updateOnAttached) {
|
|
11120
|
+
_this73.emit("update", change);
|
|
11035
11121
|
}
|
|
11036
|
-
} else if (
|
|
11037
|
-
|
|
11122
|
+
} else if (_this73.state === "detaching") {
|
|
11123
|
+
_this73.checkPendingState();
|
|
11038
11124
|
} else {
|
|
11039
|
-
|
|
11125
|
+
_this73.notifyState("attached", message.error, resumed, hasPresence, hasBacklog, hasObjects);
|
|
11040
11126
|
}
|
|
11041
11127
|
break;
|
|
11042
11128
|
}
|
|
11043
11129
|
case actions.DETACHED:
|
|
11044
11130
|
{
|
|
11045
11131
|
var detachErr = message.error ? _ErrorInfo2.fromValues(message.error) : new _ErrorInfo2("Channel detached", 90001, 404);
|
|
11046
|
-
if (
|
|
11047
|
-
|
|
11048
|
-
} else if (
|
|
11049
|
-
|
|
11050
|
-
} else if (
|
|
11051
|
-
|
|
11132
|
+
if (_this73.state === "detaching") {
|
|
11133
|
+
_this73.notifyState("detached", detachErr);
|
|
11134
|
+
} else if (_this73.state === "attaching") {
|
|
11135
|
+
_this73.notifyState("suspended", detachErr);
|
|
11136
|
+
} else if (_this73.state === "attached" || _this73.state === "suspended") {
|
|
11137
|
+
_this73.requestState("attaching", detachErr);
|
|
11052
11138
|
}
|
|
11053
11139
|
break;
|
|
11054
11140
|
}
|
|
11055
11141
|
case actions.SYNC:
|
|
11056
11142
|
isSync = true;
|
|
11057
|
-
syncChannelSerial =
|
|
11143
|
+
syncChannelSerial = _this73.syncChannelSerial = message.channelSerial;
|
|
11058
11144
|
if (!message.presence) break;
|
|
11059
11145
|
case actions.PRESENCE:
|
|
11060
11146
|
{
|
|
@@ -11062,45 +11148,45 @@ var ably = {exports: {}};
|
|
|
11062
11148
|
break;
|
|
11063
11149
|
}
|
|
11064
11150
|
populateFieldsFromParent(message);
|
|
11065
|
-
var options =
|
|
11066
|
-
if (
|
|
11151
|
+
var options = _this73.channelOptions;
|
|
11152
|
+
if (_this73._presence) {
|
|
11067
11153
|
var presenceMessages = yield Promise.all(message.presence.map(wpm => {
|
|
11068
|
-
return wpm.decode(options,
|
|
11154
|
+
return wpm.decode(options, _this73.logger);
|
|
11069
11155
|
}));
|
|
11070
|
-
|
|
11156
|
+
_this73._presence.setPresence(presenceMessages, isSync, syncChannelSerial);
|
|
11071
11157
|
}
|
|
11072
11158
|
break;
|
|
11073
11159
|
}
|
|
11074
11160
|
case actions.OBJECT:
|
|
11075
11161
|
case actions.OBJECT_SYNC:
|
|
11076
11162
|
{
|
|
11077
|
-
if (!
|
|
11163
|
+
if (!_this73._objects || !message.state) {
|
|
11078
11164
|
return;
|
|
11079
11165
|
}
|
|
11080
11166
|
populateFieldsFromParent(message);
|
|
11081
|
-
var format =
|
|
11082
|
-
var objectMessages = message.state.map(om => om.decode(
|
|
11167
|
+
var format = _this73.client.connection.connectionManager.getActiveTransportFormat();
|
|
11168
|
+
var objectMessages = message.state.map(om => om.decode(_this73.client, format));
|
|
11083
11169
|
if (message.action === actions.OBJECT) {
|
|
11084
|
-
|
|
11170
|
+
_this73._objects.handleObjectMessages(objectMessages);
|
|
11085
11171
|
} else {
|
|
11086
|
-
|
|
11172
|
+
_this73._objects.handleObjectSyncMessages(objectMessages, message.channelSerial);
|
|
11087
11173
|
}
|
|
11088
11174
|
break;
|
|
11089
11175
|
}
|
|
11090
11176
|
case actions.MESSAGE:
|
|
11091
11177
|
{
|
|
11092
|
-
if (
|
|
11093
|
-
logger_default.logAction(
|
|
11178
|
+
if (_this73.state !== "attached") {
|
|
11179
|
+
logger_default.logAction(_this73.logger, logger_default.LOG_MAJOR, "RealtimeChannel.processMessage()", 'Message "' + message.id + '" skipped as this channel "' + _this73.name + '" state is not "attached" (state is "' + _this73.state + '").');
|
|
11094
11180
|
return;
|
|
11095
11181
|
}
|
|
11096
11182
|
populateFieldsFromParent(message);
|
|
11097
11183
|
var encoded = message.messages,
|
|
11098
11184
|
firstMessage = encoded[0],
|
|
11099
11185
|
lastMessage = encoded[encoded.length - 1];
|
|
11100
|
-
if (firstMessage.extras && firstMessage.extras.delta && firstMessage.extras.delta.from !==
|
|
11101
|
-
var msg = 'Delta message decode failure - previous message not available for message "' + message.id + '" on this channel "' +
|
|
11102
|
-
logger_default.logAction(
|
|
11103
|
-
|
|
11186
|
+
if (firstMessage.extras && firstMessage.extras.delta && firstMessage.extras.delta.from !== _this73._lastPayload.messageId) {
|
|
11187
|
+
var msg = 'Delta message decode failure - previous message not available for message "' + message.id + '" on this channel "' + _this73.name + '".';
|
|
11188
|
+
logger_default.logAction(_this73.logger, logger_default.LOG_ERROR, "RealtimeChannel.processMessage()", msg);
|
|
11189
|
+
_this73._startDecodeFailureRecovery(new _ErrorInfo2(msg, 40018, 400));
|
|
11104
11190
|
break;
|
|
11105
11191
|
}
|
|
11106
11192
|
var messages = [];
|
|
@@ -11108,34 +11194,34 @@ var ably = {exports: {}};
|
|
|
11108
11194
|
var {
|
|
11109
11195
|
decoded,
|
|
11110
11196
|
err
|
|
11111
|
-
} = yield encoded[i].decodeWithErr(
|
|
11197
|
+
} = yield encoded[i].decodeWithErr(_this73._decodingContext, _this73.logger);
|
|
11112
11198
|
messages[i] = decoded;
|
|
11113
11199
|
if (err) {
|
|
11114
11200
|
switch (err.code) {
|
|
11115
11201
|
case 40018:
|
|
11116
|
-
|
|
11202
|
+
_this73._startDecodeFailureRecovery(err);
|
|
11117
11203
|
return;
|
|
11118
11204
|
case 40019:
|
|
11119
11205
|
case 40021:
|
|
11120
|
-
|
|
11206
|
+
_this73.notifyState("failed", err);
|
|
11121
11207
|
return;
|
|
11122
11208
|
}
|
|
11123
11209
|
}
|
|
11124
11210
|
}
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11211
|
+
_this73._lastPayload.messageId = lastMessage.id;
|
|
11212
|
+
_this73._lastPayload.protocolMessageChannelSerial = message.channelSerial;
|
|
11213
|
+
_this73.onEvent(messages);
|
|
11128
11214
|
break;
|
|
11129
11215
|
}
|
|
11130
11216
|
case actions.ANNOTATION:
|
|
11131
11217
|
{
|
|
11132
11218
|
populateFieldsFromParent(message);
|
|
11133
|
-
var _options =
|
|
11134
|
-
if (
|
|
11219
|
+
var _options = _this73.channelOptions;
|
|
11220
|
+
if (_this73._annotations) {
|
|
11135
11221
|
var annotations = yield Promise.all((message.annotations || []).map(wpm => {
|
|
11136
|
-
return wpm.decode(_options,
|
|
11222
|
+
return wpm.decode(_options, _this73.logger);
|
|
11137
11223
|
}));
|
|
11138
|
-
|
|
11224
|
+
_this73._annotations._processIncoming(annotations);
|
|
11139
11225
|
}
|
|
11140
11226
|
break;
|
|
11141
11227
|
}
|
|
@@ -11143,14 +11229,14 @@ var ably = {exports: {}};
|
|
|
11143
11229
|
{
|
|
11144
11230
|
var _err = message.error;
|
|
11145
11231
|
if (_err && _err.code == 80016) {
|
|
11146
|
-
|
|
11232
|
+
_this73.checkPendingState();
|
|
11147
11233
|
} else {
|
|
11148
|
-
|
|
11234
|
+
_this73.notifyState("failed", _ErrorInfo2.fromValues(_err));
|
|
11149
11235
|
}
|
|
11150
11236
|
break;
|
|
11151
11237
|
}
|
|
11152
11238
|
default:
|
|
11153
|
-
logger_default.logAction(
|
|
11239
|
+
logger_default.logAction(_this73.logger, logger_default.LOG_MAJOR, "RealtimeChannel.processMessage()", "Protocol error: unrecognised message action (" + message.action + ")");
|
|
11154
11240
|
}
|
|
11155
11241
|
})();
|
|
11156
11242
|
}
|
|
@@ -11306,9 +11392,45 @@ var ably = {exports: {}};
|
|
|
11306
11392
|
}
|
|
11307
11393
|
}
|
|
11308
11394
|
status() {
|
|
11309
|
-
var
|
|
11395
|
+
var _this74 = this;
|
|
11396
|
+
return _asyncToGenerator(function* () {
|
|
11397
|
+
return _this74.client.rest.channelMixin.status(_this74);
|
|
11398
|
+
})();
|
|
11399
|
+
}
|
|
11400
|
+
getMessage(serialOrMessage) {
|
|
11401
|
+
var _this75 = this;
|
|
11402
|
+
return _asyncToGenerator(function* () {
|
|
11403
|
+
logger_default.logAction(_this75.logger, logger_default.LOG_MICRO, "RealtimeChannel.getMessage()", "channel = " + _this75.name);
|
|
11404
|
+
var restMixin = _this75.client.rest.channelMixin;
|
|
11405
|
+
return restMixin.getMessage(_this75, serialOrMessage);
|
|
11406
|
+
})();
|
|
11407
|
+
}
|
|
11408
|
+
updateMessage(message, operation, params) {
|
|
11409
|
+
var _this76 = this;
|
|
11410
|
+
return _asyncToGenerator(function* () {
|
|
11411
|
+
logger_default.logAction(_this76.logger, logger_default.LOG_MICRO, "RealtimeChannel.updateMessage()", "channel = " + _this76.name);
|
|
11412
|
+
var restMixin = _this76.client.rest.channelMixin;
|
|
11413
|
+
return restMixin.updateDeleteMessage(_this76, {
|
|
11414
|
+
isDelete: false
|
|
11415
|
+
}, message, operation, params);
|
|
11416
|
+
})();
|
|
11417
|
+
}
|
|
11418
|
+
deleteMessage(message, operation, params) {
|
|
11419
|
+
var _this77 = this;
|
|
11310
11420
|
return _asyncToGenerator(function* () {
|
|
11311
|
-
|
|
11421
|
+
logger_default.logAction(_this77.logger, logger_default.LOG_MICRO, "RealtimeChannel.deleteMessage()", "channel = " + _this77.name);
|
|
11422
|
+
var restMixin = _this77.client.rest.channelMixin;
|
|
11423
|
+
return restMixin.updateDeleteMessage(_this77, {
|
|
11424
|
+
isDelete: true
|
|
11425
|
+
}, message, operation, params);
|
|
11426
|
+
})();
|
|
11427
|
+
}
|
|
11428
|
+
getMessageVersions(serialOrMessage, params) {
|
|
11429
|
+
var _this78 = this;
|
|
11430
|
+
return _asyncToGenerator(function* () {
|
|
11431
|
+
logger_default.logAction(_this78.logger, logger_default.LOG_MICRO, "RealtimeChannel.getMessageVersions()", "channel = " + _this78.name);
|
|
11432
|
+
var restMixin = _this78.client.rest.channelMixin;
|
|
11433
|
+
return restMixin.getMessageVersions(_this78, serialOrMessage, params);
|
|
11312
11434
|
})();
|
|
11313
11435
|
}
|
|
11314
11436
|
};
|
|
@@ -11327,31 +11449,31 @@ var ably = {exports: {}};
|
|
|
11327
11449
|
this.subscriptions = new eventemitter_default(this.logger);
|
|
11328
11450
|
}
|
|
11329
11451
|
publish(msgOrSerial, annotationValues) {
|
|
11330
|
-
var
|
|
11452
|
+
var _this79 = this;
|
|
11331
11453
|
return _asyncToGenerator(function* () {
|
|
11332
|
-
var channelName =
|
|
11454
|
+
var channelName = _this79.channel.name;
|
|
11333
11455
|
var annotation = constructValidateAnnotation(msgOrSerial, annotationValues);
|
|
11334
11456
|
var wireAnnotation = yield annotation.encode();
|
|
11335
|
-
|
|
11336
|
-
logger_default.logAction(
|
|
11457
|
+
_this79.channel.throwIfUnpublishableState();
|
|
11458
|
+
logger_default.logAction(_this79.logger, logger_default.LOG_MICRO, "RealtimeAnnotations.publish()", "channelName = " + channelName + ", sending annotation with messageSerial = " + annotation.messageSerial + ", type = " + annotation.type);
|
|
11337
11459
|
var pm = fromValues({
|
|
11338
11460
|
action: actions.ANNOTATION,
|
|
11339
11461
|
channel: channelName,
|
|
11340
11462
|
annotations: [wireAnnotation]
|
|
11341
11463
|
});
|
|
11342
|
-
return
|
|
11464
|
+
return _this79.channel.sendMessage(pm);
|
|
11343
11465
|
})();
|
|
11344
11466
|
}
|
|
11345
11467
|
delete(msgOrSerial, annotationValues) {
|
|
11346
|
-
var
|
|
11468
|
+
var _this80 = this;
|
|
11347
11469
|
return _asyncToGenerator(function* () {
|
|
11348
11470
|
annotationValues.action = "annotation.delete";
|
|
11349
|
-
return
|
|
11471
|
+
return _this80.publish(msgOrSerial, annotationValues);
|
|
11350
11472
|
})();
|
|
11351
11473
|
}
|
|
11352
11474
|
subscribe() {
|
|
11353
11475
|
var _arguments4 = arguments,
|
|
11354
|
-
|
|
11476
|
+
_this81 = this;
|
|
11355
11477
|
return _asyncToGenerator(function* () {
|
|
11356
11478
|
for (var _len10 = _arguments4.length, _args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
11357
11479
|
_args[_key10] = _arguments4[_key10];
|
|
@@ -11359,15 +11481,15 @@ var ably = {exports: {}};
|
|
|
11359
11481
|
var args = realtimechannel_default.processListenerArgs(_args);
|
|
11360
11482
|
var event = args[0];
|
|
11361
11483
|
var listener = args[1];
|
|
11362
|
-
var channel =
|
|
11484
|
+
var channel = _this81.channel;
|
|
11363
11485
|
if (channel.state === "failed") {
|
|
11364
11486
|
throw _ErrorInfo2.fromValues(channel.invalidStateError());
|
|
11365
11487
|
}
|
|
11366
|
-
|
|
11367
|
-
if (
|
|
11488
|
+
_this81.subscriptions.on(event, listener);
|
|
11489
|
+
if (_this81.channel.channelOptions.attachOnSubscribe !== false) {
|
|
11368
11490
|
yield channel.attach();
|
|
11369
11491
|
}
|
|
11370
|
-
if ((
|
|
11492
|
+
if ((_this81.channel.state === "attached" && _this81.channel._mode & flags.ANNOTATION_SUBSCRIBE) === 0) {
|
|
11371
11493
|
throw new _ErrorInfo2("You are trying to add an annotation listener, but you haven't requested the annotation_subscribe channel mode in ChannelOptions, so this won't do anything (we only deliver annotations to clients who have explicitly requested them)", 93001, 400);
|
|
11372
11494
|
}
|
|
11373
11495
|
})();
|
|
@@ -11387,9 +11509,9 @@ var ably = {exports: {}};
|
|
|
11387
11509
|
}
|
|
11388
11510
|
}
|
|
11389
11511
|
get(msgOrSerial, params) {
|
|
11390
|
-
var
|
|
11512
|
+
var _this82 = this;
|
|
11391
11513
|
return _asyncToGenerator(function* () {
|
|
11392
|
-
return restannotations_default.prototype.get.call(
|
|
11514
|
+
return restannotations_default.prototype.get.call(_this82, msgOrSerial, params);
|
|
11393
11515
|
})();
|
|
11394
11516
|
}
|
|
11395
11517
|
};
|
|
@@ -13051,23 +13173,23 @@ var ably = {exports: {}};
|
|
|
13051
13173
|
}
|
|
13052
13174
|
}
|
|
13053
13175
|
processChannelMessage(message) {
|
|
13054
|
-
var
|
|
13176
|
+
var _this83 = this;
|
|
13055
13177
|
return _asyncToGenerator(function* () {
|
|
13056
|
-
yield
|
|
13178
|
+
yield _this83.realtime.channels.processChannelMessage(message);
|
|
13057
13179
|
})();
|
|
13058
13180
|
}
|
|
13059
13181
|
ping() {
|
|
13060
|
-
var
|
|
13182
|
+
var _this84 = this;
|
|
13061
13183
|
return _asyncToGenerator(function* () {
|
|
13062
13184
|
var _a2;
|
|
13063
|
-
if (
|
|
13185
|
+
if (_this84.state.state !== "connected") {
|
|
13064
13186
|
throw new _ErrorInfo2("Unable to ping service; not connected", 4e4, 400);
|
|
13065
13187
|
}
|
|
13066
|
-
var transport = (_a2 =
|
|
13188
|
+
var transport = (_a2 = _this84.activeProtocol) == null ? void 0 : _a2.getTransport();
|
|
13067
13189
|
if (!transport) {
|
|
13068
|
-
throw
|
|
13190
|
+
throw _this84.getStateError();
|
|
13069
13191
|
}
|
|
13070
|
-
logger_default.logAction(
|
|
13192
|
+
logger_default.logAction(_this84.logger, logger_default.LOG_MINOR, "ConnectionManager.ping()", "transport = " + transport);
|
|
13071
13193
|
var pingStart = Date.now();
|
|
13072
13194
|
var id = _cheapRandStr();
|
|
13073
13195
|
return _withTimeoutAsync(new Promise(resolve => {
|
|
@@ -13079,7 +13201,7 @@ var ably = {exports: {}};
|
|
|
13079
13201
|
};
|
|
13080
13202
|
transport.on("heartbeat", onHeartbeat);
|
|
13081
13203
|
transport.ping(id);
|
|
13082
|
-
}),
|
|
13204
|
+
}), _this84.options.timeouts.realtimeRequestTimeout, "Timeout waiting for heartbeat response");
|
|
13083
13205
|
})();
|
|
13084
13206
|
}
|
|
13085
13207
|
abort(error) {
|
|
@@ -13228,10 +13350,10 @@ var ably = {exports: {}};
|
|
|
13228
13350
|
});
|
|
13229
13351
|
}
|
|
13230
13352
|
ping() {
|
|
13231
|
-
var
|
|
13353
|
+
var _this85 = this;
|
|
13232
13354
|
return _asyncToGenerator(function* () {
|
|
13233
|
-
logger_default.logAction(
|
|
13234
|
-
return
|
|
13355
|
+
logger_default.logAction(_this85.logger, logger_default.LOG_MINOR, "Connection.ping()", "");
|
|
13356
|
+
return _this85.connectionManager.ping();
|
|
13235
13357
|
})();
|
|
13236
13358
|
}
|
|
13237
13359
|
close() {
|
|
@@ -13287,6 +13409,9 @@ var ably = {exports: {}};
|
|
|
13287
13409
|
get channels() {
|
|
13288
13410
|
return this._channels;
|
|
13289
13411
|
}
|
|
13412
|
+
get clientId() {
|
|
13413
|
+
return this.auth.clientId;
|
|
13414
|
+
}
|
|
13290
13415
|
connect() {
|
|
13291
13416
|
logger_default.logAction(this.logger, logger_default.LOG_MINOR, "Realtime.connect()", "");
|
|
13292
13417
|
this.connection.connect();
|
|
@@ -13327,16 +13452,16 @@ var ably = {exports: {}};
|
|
|
13327
13452
|
}
|
|
13328
13453
|
// Access to this method is synchronised by ConnectionManager#processChannelMessage.
|
|
13329
13454
|
processChannelMessage(msg) {
|
|
13330
|
-
var
|
|
13455
|
+
var _this86 = this;
|
|
13331
13456
|
return _asyncToGenerator(function* () {
|
|
13332
13457
|
var channelName = msg.channel;
|
|
13333
13458
|
if (channelName === void 0) {
|
|
13334
|
-
logger_default.logAction(
|
|
13459
|
+
logger_default.logAction(_this86.logger, logger_default.LOG_ERROR, "Channels.processChannelMessage()", "received event unspecified channel, action = " + msg.action);
|
|
13335
13460
|
return;
|
|
13336
13461
|
}
|
|
13337
|
-
var channel =
|
|
13462
|
+
var channel = _this86.all[channelName];
|
|
13338
13463
|
if (!channel) {
|
|
13339
|
-
logger_default.logAction(
|
|
13464
|
+
logger_default.logAction(_this86.logger, logger_default.LOG_ERROR, "Channels.processChannelMessage()", "received event for non-existent channel: " + channelName);
|
|
13340
13465
|
return;
|
|
13341
13466
|
}
|
|
13342
13467
|
yield channel.processMessage(msg);
|
|
@@ -13591,43 +13716,43 @@ var ably = {exports: {}};
|
|
|
13591
13716
|
this.pendingPresence = [];
|
|
13592
13717
|
}
|
|
13593
13718
|
enter(data) {
|
|
13594
|
-
var
|
|
13719
|
+
var _this87 = this;
|
|
13595
13720
|
return _asyncToGenerator(function* () {
|
|
13596
|
-
if (isAnonymousOrWildcard(
|
|
13721
|
+
if (isAnonymousOrWildcard(_this87)) {
|
|
13597
13722
|
throw new _ErrorInfo2("clientId must be specified to enter a presence channel", 40012, 400);
|
|
13598
13723
|
}
|
|
13599
|
-
return
|
|
13724
|
+
return _this87._enterOrUpdateClient(void 0, void 0, data, "enter");
|
|
13600
13725
|
})();
|
|
13601
13726
|
}
|
|
13602
13727
|
update(data) {
|
|
13603
|
-
var
|
|
13728
|
+
var _this88 = this;
|
|
13604
13729
|
return _asyncToGenerator(function* () {
|
|
13605
|
-
if (isAnonymousOrWildcard(
|
|
13730
|
+
if (isAnonymousOrWildcard(_this88)) {
|
|
13606
13731
|
throw new _ErrorInfo2("clientId must be specified to update presence data", 40012, 400);
|
|
13607
13732
|
}
|
|
13608
|
-
return
|
|
13733
|
+
return _this88._enterOrUpdateClient(void 0, void 0, data, "update");
|
|
13609
13734
|
})();
|
|
13610
13735
|
}
|
|
13611
13736
|
enterClient(clientId, data) {
|
|
13612
|
-
var
|
|
13737
|
+
var _this89 = this;
|
|
13613
13738
|
return _asyncToGenerator(function* () {
|
|
13614
|
-
return
|
|
13739
|
+
return _this89._enterOrUpdateClient(void 0, clientId, data, "enter");
|
|
13615
13740
|
})();
|
|
13616
13741
|
}
|
|
13617
13742
|
updateClient(clientId, data) {
|
|
13618
|
-
var
|
|
13743
|
+
var _this90 = this;
|
|
13619
13744
|
return _asyncToGenerator(function* () {
|
|
13620
|
-
return
|
|
13745
|
+
return _this90._enterOrUpdateClient(void 0, clientId, data, "update");
|
|
13621
13746
|
})();
|
|
13622
13747
|
}
|
|
13623
13748
|
_enterOrUpdateClient(id, clientId, data, action) {
|
|
13624
|
-
var
|
|
13749
|
+
var _this91 = this;
|
|
13625
13750
|
return _asyncToGenerator(function* () {
|
|
13626
|
-
var channel =
|
|
13751
|
+
var channel = _this91.channel;
|
|
13627
13752
|
if (!channel.connectionManager.activeState()) {
|
|
13628
13753
|
throw channel.connectionManager.getError();
|
|
13629
13754
|
}
|
|
13630
|
-
logger_default.logAction(
|
|
13755
|
+
logger_default.logAction(_this91.logger, logger_default.LOG_MICRO, "RealtimePresence." + action + "Client()", "channel = " + channel.name + ", id = " + id + ", client = " + (clientId || "(implicit) " + getClientId(_this91)));
|
|
13631
13756
|
var presence = presencemessage_default.fromData(data);
|
|
13632
13757
|
presence.action = action;
|
|
13633
13758
|
if (id) {
|
|
@@ -13645,7 +13770,7 @@ var ably = {exports: {}};
|
|
|
13645
13770
|
channel.attach();
|
|
13646
13771
|
case "attaching":
|
|
13647
13772
|
return new Promise((resolve, reject) => {
|
|
13648
|
-
|
|
13773
|
+
_this91.pendingPresence.push({
|
|
13649
13774
|
presence: wirePresMsg,
|
|
13650
13775
|
callback: err => err ? reject(err) : resolve()
|
|
13651
13776
|
});
|
|
@@ -13660,22 +13785,22 @@ var ably = {exports: {}};
|
|
|
13660
13785
|
})();
|
|
13661
13786
|
}
|
|
13662
13787
|
leave(data) {
|
|
13663
|
-
var
|
|
13788
|
+
var _this92 = this;
|
|
13664
13789
|
return _asyncToGenerator(function* () {
|
|
13665
|
-
if (isAnonymousOrWildcard(
|
|
13790
|
+
if (isAnonymousOrWildcard(_this92)) {
|
|
13666
13791
|
throw new _ErrorInfo2("clientId must have been specified to enter or leave a presence channel", 40012, 400);
|
|
13667
13792
|
}
|
|
13668
|
-
return
|
|
13793
|
+
return _this92.leaveClient(void 0, data);
|
|
13669
13794
|
})();
|
|
13670
13795
|
}
|
|
13671
13796
|
leaveClient(clientId, data) {
|
|
13672
|
-
var
|
|
13797
|
+
var _this93 = this;
|
|
13673
13798
|
return _asyncToGenerator(function* () {
|
|
13674
|
-
var channel =
|
|
13799
|
+
var channel = _this93.channel;
|
|
13675
13800
|
if (!channel.connectionManager.activeState()) {
|
|
13676
13801
|
throw channel.connectionManager.getError();
|
|
13677
13802
|
}
|
|
13678
|
-
logger_default.logAction(
|
|
13803
|
+
logger_default.logAction(_this93.logger, logger_default.LOG_MICRO, "RealtimePresence.leaveClient()", "leaving; channel = " + _this93.channel.name + ", client = " + clientId);
|
|
13679
13804
|
var presence = presencemessage_default.fromData(data);
|
|
13680
13805
|
presence.action = "leave";
|
|
13681
13806
|
if (clientId) {
|
|
@@ -13687,7 +13812,7 @@ var ably = {exports: {}};
|
|
|
13687
13812
|
return channel.sendPresence([wirePresMsg]);
|
|
13688
13813
|
case "attaching":
|
|
13689
13814
|
return new Promise((resolve, reject) => {
|
|
13690
|
-
|
|
13815
|
+
_this93.pendingPresence.push({
|
|
13691
13816
|
presence: wirePresMsg,
|
|
13692
13817
|
callback: err => err ? reject(err) : resolve()
|
|
13693
13818
|
});
|
|
@@ -13703,14 +13828,14 @@ var ably = {exports: {}};
|
|
|
13703
13828
|
})();
|
|
13704
13829
|
}
|
|
13705
13830
|
get(params) {
|
|
13706
|
-
var
|
|
13831
|
+
var _this94 = this;
|
|
13707
13832
|
return _asyncToGenerator(function* () {
|
|
13708
13833
|
var waitForSync = !params || ("waitForSync" in params ? params.waitForSync : true);
|
|
13709
13834
|
return new Promise((resolve, reject) => {
|
|
13710
13835
|
function returnMembers(members) {
|
|
13711
13836
|
resolve(params ? members.list(params) : members.values());
|
|
13712
13837
|
}
|
|
13713
|
-
if (
|
|
13838
|
+
if (_this94.channel.state === "suspended") {
|
|
13714
13839
|
if (waitForSync) {
|
|
13715
13840
|
reject(_ErrorInfo2.fromValues({
|
|
13716
13841
|
statusCode: 400,
|
|
@@ -13718,12 +13843,12 @@ var ably = {exports: {}};
|
|
|
13718
13843
|
message: "Presence state is out of sync due to channel being in the SUSPENDED state"
|
|
13719
13844
|
}));
|
|
13720
13845
|
} else {
|
|
13721
|
-
returnMembers(
|
|
13846
|
+
returnMembers(_this94.members);
|
|
13722
13847
|
}
|
|
13723
13848
|
return;
|
|
13724
13849
|
}
|
|
13725
|
-
waitAttached(
|
|
13726
|
-
var members =
|
|
13850
|
+
waitAttached(_this94.channel, err => reject(err), () => {
|
|
13851
|
+
var members = _this94.members;
|
|
13727
13852
|
if (waitForSync) {
|
|
13728
13853
|
members.waitSync(function () {
|
|
13729
13854
|
returnMembers(members);
|
|
@@ -13736,19 +13861,19 @@ var ably = {exports: {}};
|
|
|
13736
13861
|
})();
|
|
13737
13862
|
}
|
|
13738
13863
|
history(params) {
|
|
13739
|
-
var
|
|
13864
|
+
var _this95 = this;
|
|
13740
13865
|
return _asyncToGenerator(function* () {
|
|
13741
|
-
logger_default.logAction(
|
|
13742
|
-
var restMixin =
|
|
13866
|
+
logger_default.logAction(_this95.logger, logger_default.LOG_MICRO, "RealtimePresence.history()", "channel = " + _this95.name);
|
|
13867
|
+
var restMixin = _this95.channel.client.rest.presenceMixin;
|
|
13743
13868
|
if (params && params.untilAttach) {
|
|
13744
|
-
if (
|
|
13869
|
+
if (_this95.channel.state === "attached") {
|
|
13745
13870
|
delete params.untilAttach;
|
|
13746
|
-
params.from_serial =
|
|
13871
|
+
params.from_serial = _this95.channel.properties.attachSerial;
|
|
13747
13872
|
} else {
|
|
13748
|
-
throw new _ErrorInfo2("option untilAttach requires the channel to be attached, was: " +
|
|
13873
|
+
throw new _ErrorInfo2("option untilAttach requires the channel to be attached, was: " + _this95.channel.state, 4e4, 400);
|
|
13749
13874
|
}
|
|
13750
13875
|
}
|
|
13751
|
-
return restMixin.history(
|
|
13876
|
+
return restMixin.history(_this95, params);
|
|
13752
13877
|
})();
|
|
13753
13878
|
}
|
|
13754
13879
|
setPresence(presenceSet, isSync, syncChannelSerial) {
|
|
@@ -13876,7 +14001,7 @@ var ably = {exports: {}};
|
|
|
13876
14001
|
}
|
|
13877
14002
|
subscribe() {
|
|
13878
14003
|
var _arguments5 = arguments,
|
|
13879
|
-
|
|
14004
|
+
_this96 = this;
|
|
13880
14005
|
return _asyncToGenerator(function* () {
|
|
13881
14006
|
for (var _len12 = _arguments5.length, _args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
13882
14007
|
_args[_key12] = _arguments5[_key12];
|
|
@@ -13884,11 +14009,11 @@ var ably = {exports: {}};
|
|
|
13884
14009
|
var args = realtimechannel_default.processListenerArgs(_args);
|
|
13885
14010
|
var event = args[0];
|
|
13886
14011
|
var listener = args[1];
|
|
13887
|
-
var channel =
|
|
14012
|
+
var channel = _this96.channel;
|
|
13888
14013
|
if (channel.state === "failed") {
|
|
13889
14014
|
throw _ErrorInfo2.fromValues(channel.invalidStateError());
|
|
13890
14015
|
}
|
|
13891
|
-
|
|
14016
|
+
_this96.subscriptions.on(event, listener);
|
|
13892
14017
|
if (channel.channelOptions.attachOnSubscribe !== false) {
|
|
13893
14018
|
yield channel.attach();
|
|
13894
14019
|
}
|
|
@@ -14060,8 +14185,8 @@ var ably = {exports: {}};
|
|
|
14060
14185
|
isRef: !!((_f = (_e = m.extras) == null ? void 0 : _e.ref) == null ? void 0 : _f.timeserial),
|
|
14061
14186
|
clientId: m.clientId
|
|
14062
14187
|
};
|
|
14063
|
-
if (Object.entries(filter).find(
|
|
14064
|
-
var [key, value] =
|
|
14188
|
+
if (Object.entries(filter).find(_ref12 => {
|
|
14189
|
+
var [key, value] = _ref12;
|
|
14065
14190
|
return value !== void 0 ? mapping[key] !== value : false;
|
|
14066
14191
|
})) {
|
|
14067
14192
|
return;
|
|
@@ -14089,8 +14214,8 @@ var ably = {exports: {}};
|
|
|
14089
14214
|
return [];
|
|
14090
14215
|
}
|
|
14091
14216
|
if (!realListener && filter) {
|
|
14092
|
-
return Array.from(channel.filteredSubscriptions.entries()).map(
|
|
14093
|
-
var [key, filterMaps] =
|
|
14217
|
+
return Array.from(channel.filteredSubscriptions.entries()).map(_ref13 => {
|
|
14218
|
+
var [key, filterMaps] = _ref13;
|
|
14094
14219
|
var _a2;
|
|
14095
14220
|
var listenerMaps = filterMaps.get(filter);
|
|
14096
14221
|
filterMaps.delete(filter);
|
|
@@ -14562,38 +14687,38 @@ var ably = {exports: {}};
|
|
|
14562
14687
|
return output;
|
|
14563
14688
|
}
|
|
14564
14689
|
encrypt(plaintext) {
|
|
14565
|
-
var
|
|
14690
|
+
var _this97 = this;
|
|
14566
14691
|
return _asyncToGenerator(function* () {
|
|
14567
|
-
logger_default.logAction(
|
|
14568
|
-
var iv = yield
|
|
14569
|
-
var cryptoKey = yield crypto.subtle.importKey("raw",
|
|
14692
|
+
logger_default.logAction(_this97.logger, logger_default.LOG_MICRO, "CBCCipher.encrypt()", "");
|
|
14693
|
+
var iv = yield _this97.getIv();
|
|
14694
|
+
var cryptoKey = yield crypto.subtle.importKey("raw", _this97.key, _this97.webCryptoAlgorithm, false, ["encrypt"]);
|
|
14570
14695
|
var ciphertext = yield crypto.subtle.encrypt({
|
|
14571
|
-
name:
|
|
14696
|
+
name: _this97.webCryptoAlgorithm,
|
|
14572
14697
|
iv
|
|
14573
14698
|
}, cryptoKey, plaintext);
|
|
14574
|
-
return
|
|
14699
|
+
return _this97.concat(iv, ciphertext);
|
|
14575
14700
|
})();
|
|
14576
14701
|
}
|
|
14577
14702
|
decrypt(ciphertext) {
|
|
14578
|
-
var
|
|
14703
|
+
var _this98 = this;
|
|
14579
14704
|
return _asyncToGenerator(function* () {
|
|
14580
|
-
logger_default.logAction(
|
|
14705
|
+
logger_default.logAction(_this98.logger, logger_default.LOG_MICRO, "CBCCipher.decrypt()", "");
|
|
14581
14706
|
var ciphertextArrayBuffer = bufferUtils.toArrayBuffer(ciphertext);
|
|
14582
14707
|
var iv = ciphertextArrayBuffer.slice(0, DEFAULT_BLOCKLENGTH);
|
|
14583
14708
|
var ciphertextBody = ciphertextArrayBuffer.slice(DEFAULT_BLOCKLENGTH);
|
|
14584
|
-
var cryptoKey = yield crypto.subtle.importKey("raw",
|
|
14709
|
+
var cryptoKey = yield crypto.subtle.importKey("raw", _this98.key, _this98.webCryptoAlgorithm, false, ["decrypt"]);
|
|
14585
14710
|
return crypto.subtle.decrypt({
|
|
14586
|
-
name:
|
|
14711
|
+
name: _this98.webCryptoAlgorithm,
|
|
14587
14712
|
iv
|
|
14588
14713
|
}, cryptoKey, ciphertextBody);
|
|
14589
14714
|
})();
|
|
14590
14715
|
}
|
|
14591
14716
|
getIv() {
|
|
14592
|
-
var
|
|
14717
|
+
var _this99 = this;
|
|
14593
14718
|
return _asyncToGenerator(function* () {
|
|
14594
|
-
if (
|
|
14595
|
-
var iv =
|
|
14596
|
-
|
|
14719
|
+
if (_this99.iv) {
|
|
14720
|
+
var iv = _this99.iv;
|
|
14721
|
+
_this99.iv = null;
|
|
14597
14722
|
return iv;
|
|
14598
14723
|
}
|
|
14599
14724
|
var randomBlock = yield config.getRandomArrayBuffer(DEFAULT_BLOCKLENGTH);
|
|
@@ -14640,7 +14765,7 @@ var ably = {exports: {}};
|
|
|
14640
14765
|
if (Platform.Config.xhrSupported && xhrRequestImplementation) {
|
|
14641
14766
|
this.supportsAuthHeaders = true;
|
|
14642
14767
|
this.Request = /*#__PURE__*/function () {
|
|
14643
|
-
var
|
|
14768
|
+
var _ref14 = _asyncToGenerator(function* (method, uri, headers, params, body) {
|
|
14644
14769
|
return new Promise(resolve => {
|
|
14645
14770
|
var _a3;
|
|
14646
14771
|
var req = xhrRequestImplementation.createRequest(uri, headers, params, body, XHRStates_default.REQ_SEND, (_a3 = client && client.options.timeouts) != null ? _a3 : null, this.logger, method);
|
|
@@ -14654,8 +14779,8 @@ var ably = {exports: {}};
|
|
|
14654
14779
|
req.exec();
|
|
14655
14780
|
});
|
|
14656
14781
|
});
|
|
14657
|
-
return function (
|
|
14658
|
-
return
|
|
14782
|
+
return function (_x88, _x89, _x90, _x91, _x92) {
|
|
14783
|
+
return _ref14.apply(this, arguments);
|
|
14659
14784
|
};
|
|
14660
14785
|
}();
|
|
14661
14786
|
if (client == null ? void 0 : client.options.disableConnectivityCheck) {
|
|
@@ -14680,11 +14805,11 @@ var ably = {exports: {}};
|
|
|
14680
14805
|
} else if (Platform.Config.fetchSupported && fetchRequestImplementation) {
|
|
14681
14806
|
this.supportsAuthHeaders = true;
|
|
14682
14807
|
this.Request = /*#__PURE__*/function () {
|
|
14683
|
-
var
|
|
14808
|
+
var _ref17 = _asyncToGenerator(function* (method, uri, headers, params, body) {
|
|
14684
14809
|
return fetchRequestImplementation(method, client != null ? client : null, uri, headers, params, body);
|
|
14685
14810
|
});
|
|
14686
|
-
return function (
|
|
14687
|
-
return
|
|
14811
|
+
return function (_x93, _x94, _x95, _x96, _x97) {
|
|
14812
|
+
return _ref17.apply(this, arguments);
|
|
14688
14813
|
};
|
|
14689
14814
|
}();
|
|
14690
14815
|
if (client == null ? void 0 : client.options.disableConnectivityCheck) {
|
|
@@ -14715,14 +14840,14 @@ var ably = {exports: {}};
|
|
|
14715
14840
|
return (_b = (_a2 = this.client) == null ? void 0 : _a2.logger) != null ? _b : logger_default.defaultLogger;
|
|
14716
14841
|
}
|
|
14717
14842
|
doUri(method, uri, headers, body, params) {
|
|
14718
|
-
var
|
|
14843
|
+
var _this100 = this;
|
|
14719
14844
|
return _asyncToGenerator(function* () {
|
|
14720
|
-
if (!
|
|
14845
|
+
if (!_this100.Request) {
|
|
14721
14846
|
return {
|
|
14722
14847
|
error: new PartialErrorInfo("Request invoked before assigned to", null, 500)
|
|
14723
14848
|
};
|
|
14724
14849
|
}
|
|
14725
|
-
return
|
|
14850
|
+
return _this100.Request(method, uri, headers, params, body);
|
|
14726
14851
|
})();
|
|
14727
14852
|
}
|
|
14728
14853
|
shouldFallback(errorInfo) {
|
|
@@ -14852,7 +14977,7 @@ var ably = {exports: {}};
|
|
|
14852
14977
|
globalObject4.crypto.getRandomValues(byteArray);
|
|
14853
14978
|
return byteArray.buffer;
|
|
14854
14979
|
});
|
|
14855
|
-
function getRandomArrayBuffer(
|
|
14980
|
+
function getRandomArrayBuffer(_x98) {
|
|
14856
14981
|
return _getRandomArrayBuffer.apply(this, arguments);
|
|
14857
14982
|
}
|
|
14858
14983
|
return getRandomArrayBuffer;
|
|
@@ -15997,7 +16122,7 @@ var ably = {exports: {}};
|
|
|
15997
16122
|
});
|
|
15998
16123
|
return result;
|
|
15999
16124
|
}
|
|
16000
|
-
function fetchRequest(
|
|
16125
|
+
function fetchRequest(_x99, _x100, _x101, _x102, _x103, _x104) {
|
|
16001
16126
|
return _fetchRequest.apply(this, arguments);
|
|
16002
16127
|
} // src/platform/web/lib/http/request/index.ts
|
|
16003
16128
|
function _fetchRequest() {
|
|
@@ -16193,12 +16318,12 @@ class ClientAblyService {
|
|
|
16193
16318
|
_this2.channel = _this2.client.channels.get(roomName);
|
|
16194
16319
|
// Subscribe to assistant/system responses
|
|
16195
16320
|
_this2.channel.subscribe('ReceiveMessage', message => {
|
|
16196
|
-
var _a, _b, _c, _d, _e;
|
|
16321
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16197
16322
|
try {
|
|
16198
16323
|
var messageContent = typeof message.data === 'string' ? message.data : ((_a = message.data) === null || _a === void 0 ? void 0 : _a.content) || ((_b = message.data) === null || _b === void 0 ? void 0 : _b.message);
|
|
16199
16324
|
var senderType = ((_c = message.data) === null || _c === void 0 ? void 0 : _c.senderType) || 3; // Assistant
|
|
16200
|
-
var needsAgent = ((_d = message.data) === null || _d === void 0 ? void 0 : _d.needsAgent) || false;
|
|
16201
|
-
var attachments = ((
|
|
16325
|
+
var needsAgent = ((_d = message.data) === null || _d === void 0 ? void 0 : _d.needsAgent) || ((_e = message.data) === null || _e === void 0 ? void 0 : _e.actionType) == "needs_agent" || false;
|
|
16326
|
+
var attachments = ((_f = message.data) === null || _f === void 0 ? void 0 : _f.attachments) || [];
|
|
16202
16327
|
onMessageReceived(messageContent, senderType, needsAgent, attachments);
|
|
16203
16328
|
} catch (error) {
|
|
16204
16329
|
// Handle error silently
|