@aws-amplify/api-graphql 2.3.13 → 2.3.14-unstable.4
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.
|
@@ -11214,137 +11214,6 @@ function (_super) {
|
|
|
11214
11214
|
|
|
11215
11215
|
|
|
11216
11216
|
|
|
11217
|
-
/***/ }),
|
|
11218
|
-
|
|
11219
|
-
/***/ "../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/constants.js":
|
|
11220
|
-
/*!***************************************************************************!*\
|
|
11221
|
-
!*** ../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/constants.js ***!
|
|
11222
|
-
\***************************************************************************/
|
|
11223
|
-
/*! exports provided: MAX_DELAY_MS, NON_RETRYABLE_CODES, MESSAGE_TYPES, SUBSCRIPTION_STATUS, SOCKET_STATUS, AMPLIFY_SYMBOL, AWS_APPSYNC_REALTIME_HEADERS, CONNECTION_INIT_TIMEOUT, START_ACK_TIMEOUT, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT */
|
|
11224
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
11225
|
-
|
|
11226
|
-
"use strict";
|
|
11227
|
-
__webpack_require__.r(__webpack_exports__);
|
|
11228
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_DELAY_MS", function() { return MAX_DELAY_MS; });
|
|
11229
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NON_RETRYABLE_CODES", function() { return NON_RETRYABLE_CODES; });
|
|
11230
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGE_TYPES", function() { return MESSAGE_TYPES; });
|
|
11231
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBSCRIPTION_STATUS", function() { return SUBSCRIPTION_STATUS; });
|
|
11232
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOCKET_STATUS", function() { return SOCKET_STATUS; });
|
|
11233
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMPLIFY_SYMBOL", function() { return AMPLIFY_SYMBOL; });
|
|
11234
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_APPSYNC_REALTIME_HEADERS", function() { return AWS_APPSYNC_REALTIME_HEADERS; });
|
|
11235
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_INIT_TIMEOUT", function() { return CONNECTION_INIT_TIMEOUT; });
|
|
11236
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ACK_TIMEOUT", function() { return START_ACK_TIMEOUT; });
|
|
11237
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_TIMEOUT; });
|
|
11238
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT; });
|
|
11239
|
-
var MAX_DELAY_MS = 5000;
|
|
11240
|
-
var NON_RETRYABLE_CODES = [400, 401, 403];
|
|
11241
|
-
var MESSAGE_TYPES;
|
|
11242
|
-
|
|
11243
|
-
(function (MESSAGE_TYPES) {
|
|
11244
|
-
/**
|
|
11245
|
-
* Client -> Server message.
|
|
11246
|
-
* This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
|
11247
|
-
*/
|
|
11248
|
-
MESSAGE_TYPES["GQL_CONNECTION_INIT"] = "connection_init";
|
|
11249
|
-
/**
|
|
11250
|
-
* Server -> Client message
|
|
11251
|
-
* This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
|
11252
|
-
*/
|
|
11253
|
-
|
|
11254
|
-
MESSAGE_TYPES["GQL_CONNECTION_ERROR"] = "connection_error";
|
|
11255
|
-
/**
|
|
11256
|
-
* Server -> Client message.
|
|
11257
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
|
11258
|
-
*/
|
|
11259
|
-
|
|
11260
|
-
MESSAGE_TYPES["GQL_CONNECTION_ACK"] = "connection_ack";
|
|
11261
|
-
/**
|
|
11262
|
-
* Client -> Server message.
|
|
11263
|
-
* This message type is for register subscriptions with AWS AppSync RealTime
|
|
11264
|
-
*/
|
|
11265
|
-
|
|
11266
|
-
MESSAGE_TYPES["GQL_START"] = "start";
|
|
11267
|
-
/**
|
|
11268
|
-
* Server -> Client message.
|
|
11269
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
|
11270
|
-
*/
|
|
11271
|
-
|
|
11272
|
-
MESSAGE_TYPES["GQL_START_ACK"] = "start_ack";
|
|
11273
|
-
/**
|
|
11274
|
-
* Server -> Client message.
|
|
11275
|
-
* This message type is for subscription message from AWS AppSync RealTime
|
|
11276
|
-
*/
|
|
11277
|
-
|
|
11278
|
-
MESSAGE_TYPES["GQL_DATA"] = "data";
|
|
11279
|
-
/**
|
|
11280
|
-
* Server -> Client message.
|
|
11281
|
-
* This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
|
11282
|
-
*/
|
|
11283
|
-
|
|
11284
|
-
MESSAGE_TYPES["GQL_CONNECTION_KEEP_ALIVE"] = "ka";
|
|
11285
|
-
/**
|
|
11286
|
-
* Client -> Server message.
|
|
11287
|
-
* This message type is for unregister subscriptions with AWS AppSync RealTime
|
|
11288
|
-
*/
|
|
11289
|
-
|
|
11290
|
-
MESSAGE_TYPES["GQL_STOP"] = "stop";
|
|
11291
|
-
/**
|
|
11292
|
-
* Server -> Client message.
|
|
11293
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
|
11294
|
-
*/
|
|
11295
|
-
|
|
11296
|
-
MESSAGE_TYPES["GQL_COMPLETE"] = "complete";
|
|
11297
|
-
/**
|
|
11298
|
-
* Server -> Client message.
|
|
11299
|
-
* This message type is for sending error messages from AWS AppSync RealTime to the client
|
|
11300
|
-
*/
|
|
11301
|
-
|
|
11302
|
-
MESSAGE_TYPES["GQL_ERROR"] = "error";
|
|
11303
|
-
})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
|
|
11304
|
-
|
|
11305
|
-
var SUBSCRIPTION_STATUS;
|
|
11306
|
-
|
|
11307
|
-
(function (SUBSCRIPTION_STATUS) {
|
|
11308
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
|
|
11309
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
|
|
11310
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
|
|
11311
|
-
})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
|
|
11312
|
-
|
|
11313
|
-
var SOCKET_STATUS;
|
|
11314
|
-
|
|
11315
|
-
(function (SOCKET_STATUS) {
|
|
11316
|
-
SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
|
|
11317
|
-
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
11318
|
-
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
11319
|
-
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
11320
|
-
|
|
11321
|
-
var AMPLIFY_SYMBOL = typeof Symbol !== 'undefined' && typeof Symbol["for"] === 'function' ? Symbol["for"]('amplify_default') : '@@amplify_default';
|
|
11322
|
-
var AWS_APPSYNC_REALTIME_HEADERS = {
|
|
11323
|
-
accept: 'application/json, text/javascript',
|
|
11324
|
-
'content-encoding': 'amz-1.0',
|
|
11325
|
-
'content-type': 'application/json; charset=UTF-8'
|
|
11326
|
-
};
|
|
11327
|
-
/**
|
|
11328
|
-
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
11329
|
-
*/
|
|
11330
|
-
|
|
11331
|
-
var CONNECTION_INIT_TIMEOUT = 15000;
|
|
11332
|
-
/**
|
|
11333
|
-
* Time in milleseconds to wait for GQL_START_ACK message
|
|
11334
|
-
*/
|
|
11335
|
-
|
|
11336
|
-
var START_ACK_TIMEOUT = 15000;
|
|
11337
|
-
/**
|
|
11338
|
-
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
11339
|
-
*/
|
|
11340
|
-
|
|
11341
|
-
var DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
11342
|
-
/**
|
|
11343
|
-
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
11344
|
-
*/
|
|
11345
|
-
|
|
11346
|
-
var DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
11347
|
-
|
|
11348
11217
|
/***/ }),
|
|
11349
11218
|
|
|
11350
11219
|
/***/ "../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js":
|
|
@@ -11374,7 +11243,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11374
11243
|
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7__);
|
|
11375
11244
|
/* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
|
|
11376
11245
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../index */ "../pubsub/lib-esm/index.js");
|
|
11377
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*!
|
|
11246
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "../pubsub/lib-esm/Providers/constants.js");
|
|
11378
11247
|
/* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
|
|
11379
11248
|
var __extends = undefined && undefined.__extends || function () {
|
|
11380
11249
|
var _extendStatics = function extendStatics(d, b) {
|
|
@@ -13003,6 +12872,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13003
12872
|
/* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
|
|
13004
12873
|
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
13005
12874
|
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__);
|
|
12875
|
+
/* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
|
|
12876
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "../pubsub/lib-esm/Providers/constants.js");
|
|
12877
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! .. */ "../pubsub/lib-esm/index.js");
|
|
13006
12878
|
function _typeof(obj) {
|
|
13007
12879
|
"@babel/helpers - typeof";
|
|
13008
12880
|
|
|
@@ -13229,6 +13101,9 @@ var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
13229
13101
|
|
|
13230
13102
|
|
|
13231
13103
|
|
|
13104
|
+
|
|
13105
|
+
|
|
13106
|
+
|
|
13232
13107
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["ConsoleLogger"]('MqttOverWSProvider');
|
|
13233
13108
|
function mqttTopicMatch(filter, topic) {
|
|
13234
13109
|
var filterArray = filter.split('/');
|
|
@@ -13294,6 +13169,14 @@ function () {
|
|
|
13294
13169
|
return ClientsQueue;
|
|
13295
13170
|
}();
|
|
13296
13171
|
|
|
13172
|
+
var dispatchPubSubEvent = function dispatchPubSubEvent(event, data, message) {
|
|
13173
|
+
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["Hub"].dispatch('pubsub', {
|
|
13174
|
+
event: event,
|
|
13175
|
+
data: data,
|
|
13176
|
+
message: message
|
|
13177
|
+
}, 'PubSub', _constants__WEBPACK_IMPORTED_MODULE_6__["AMPLIFY_SYMBOL"]);
|
|
13178
|
+
};
|
|
13179
|
+
|
|
13297
13180
|
var topicSymbol = typeof Symbol !== 'undefined' ? Symbol('topic') : '@@topic';
|
|
13298
13181
|
|
|
13299
13182
|
var MqttOverWSProvider =
|
|
@@ -13311,8 +13194,17 @@ function (_super) {
|
|
|
13311
13194
|
})) || this;
|
|
13312
13195
|
|
|
13313
13196
|
_this._clientsQueue = new ClientsQueue();
|
|
13197
|
+
_this.connectionStateMonitor = new _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["ConnectionStateMonitor"]();
|
|
13314
13198
|
_this._topicObservers = new Map();
|
|
13315
|
-
_this._clientIdObservers = new Map();
|
|
13199
|
+
_this._clientIdObservers = new Map(); // Monitor the connection health state and pass changes along to Hub
|
|
13200
|
+
|
|
13201
|
+
_this.connectionStateMonitor.connectionStateObservable.subscribe(function (connectionStateChange) {
|
|
13202
|
+
dispatchPubSubEvent(___WEBPACK_IMPORTED_MODULE_7__["CONNECTION_STATE_CHANGE"], {
|
|
13203
|
+
provider: _this,
|
|
13204
|
+
connectionState: connectionStateChange
|
|
13205
|
+
}, "Connection state is " + connectionStateChange);
|
|
13206
|
+
});
|
|
13207
|
+
|
|
13316
13208
|
return _this;
|
|
13317
13209
|
}
|
|
13318
13210
|
|
|
@@ -13409,6 +13301,7 @@ function (_super) {
|
|
|
13409
13301
|
switch (_b.label) {
|
|
13410
13302
|
case 0:
|
|
13411
13303
|
logger.debug('Creating new MQTT client', clientId);
|
|
13304
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].OPENING_CONNECTION);
|
|
13412
13305
|
client = new paho_mqtt__WEBPACK_IMPORTED_MODULE_0__["Client"](url, clientId); // client.trace = (args) => logger.debug(clientId, JSON.stringify(args, null, 2));
|
|
13413
13306
|
|
|
13414
13307
|
client.onMessageArrived = function (_a) {
|
|
@@ -13426,6 +13319,8 @@ function (_super) {
|
|
|
13426
13319
|
clientId: clientId,
|
|
13427
13320
|
errorCode: errorCode
|
|
13428
13321
|
}, args));
|
|
13322
|
+
|
|
13323
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
|
|
13429
13324
|
};
|
|
13430
13325
|
|
|
13431
13326
|
return [4
|
|
@@ -13437,13 +13332,18 @@ function (_super) {
|
|
|
13437
13332
|
onSuccess: function onSuccess() {
|
|
13438
13333
|
return resolve(client);
|
|
13439
13334
|
},
|
|
13440
|
-
onFailure:
|
|
13335
|
+
onFailure: function onFailure() {
|
|
13336
|
+
reject();
|
|
13337
|
+
|
|
13338
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_FAILED);
|
|
13339
|
+
}
|
|
13441
13340
|
});
|
|
13442
13341
|
})];
|
|
13443
13342
|
|
|
13444
13343
|
case 1:
|
|
13445
13344
|
_b.sent();
|
|
13446
13345
|
|
|
13346
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_ESTABLISHED);
|
|
13447
13347
|
return [2
|
|
13448
13348
|
/*return*/
|
|
13449
13349
|
, client];
|
|
@@ -13495,6 +13395,7 @@ function (_super) {
|
|
|
13495
13395
|
|
|
13496
13396
|
if (client && client.isConnected()) {
|
|
13497
13397
|
client.disconnect();
|
|
13398
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
|
|
13498
13399
|
}
|
|
13499
13400
|
|
|
13500
13401
|
this.clientsQueue.remove(clientId);
|
|
@@ -13675,6 +13576,8 @@ function (_super) {
|
|
|
13675
13576
|
(_a = _this._clientIdObservers.get(clientId)) === null || _a === void 0 ? void 0 : _a["delete"](observer); // No more observers per client => client not needed anymore
|
|
13676
13577
|
|
|
13677
13578
|
if (((_b = _this._clientIdObservers.get(clientId)) === null || _b === void 0 ? void 0 : _b.size) === 0) {
|
|
13579
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSING_CONNECTION);
|
|
13580
|
+
|
|
13678
13581
|
_this.disconnect(clientId);
|
|
13679
13582
|
|
|
13680
13583
|
_this._clientIdObservers["delete"](clientId);
|
|
@@ -13774,6 +13677,137 @@ function () {
|
|
|
13774
13677
|
|
|
13775
13678
|
|
|
13776
13679
|
|
|
13680
|
+
/***/ }),
|
|
13681
|
+
|
|
13682
|
+
/***/ "../pubsub/lib-esm/Providers/constants.js":
|
|
13683
|
+
/*!************************************************!*\
|
|
13684
|
+
!*** ../pubsub/lib-esm/Providers/constants.js ***!
|
|
13685
|
+
\************************************************/
|
|
13686
|
+
/*! exports provided: MAX_DELAY_MS, NON_RETRYABLE_CODES, MESSAGE_TYPES, SUBSCRIPTION_STATUS, SOCKET_STATUS, AMPLIFY_SYMBOL, AWS_APPSYNC_REALTIME_HEADERS, CONNECTION_INIT_TIMEOUT, START_ACK_TIMEOUT, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT */
|
|
13687
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
13688
|
+
|
|
13689
|
+
"use strict";
|
|
13690
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13691
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_DELAY_MS", function() { return MAX_DELAY_MS; });
|
|
13692
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NON_RETRYABLE_CODES", function() { return NON_RETRYABLE_CODES; });
|
|
13693
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGE_TYPES", function() { return MESSAGE_TYPES; });
|
|
13694
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBSCRIPTION_STATUS", function() { return SUBSCRIPTION_STATUS; });
|
|
13695
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOCKET_STATUS", function() { return SOCKET_STATUS; });
|
|
13696
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMPLIFY_SYMBOL", function() { return AMPLIFY_SYMBOL; });
|
|
13697
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_APPSYNC_REALTIME_HEADERS", function() { return AWS_APPSYNC_REALTIME_HEADERS; });
|
|
13698
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_INIT_TIMEOUT", function() { return CONNECTION_INIT_TIMEOUT; });
|
|
13699
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ACK_TIMEOUT", function() { return START_ACK_TIMEOUT; });
|
|
13700
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_TIMEOUT; });
|
|
13701
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT; });
|
|
13702
|
+
var MAX_DELAY_MS = 5000;
|
|
13703
|
+
var NON_RETRYABLE_CODES = [400, 401, 403];
|
|
13704
|
+
var MESSAGE_TYPES;
|
|
13705
|
+
|
|
13706
|
+
(function (MESSAGE_TYPES) {
|
|
13707
|
+
/**
|
|
13708
|
+
* Client -> Server message.
|
|
13709
|
+
* This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
|
13710
|
+
*/
|
|
13711
|
+
MESSAGE_TYPES["GQL_CONNECTION_INIT"] = "connection_init";
|
|
13712
|
+
/**
|
|
13713
|
+
* Server -> Client message
|
|
13714
|
+
* This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
|
13715
|
+
*/
|
|
13716
|
+
|
|
13717
|
+
MESSAGE_TYPES["GQL_CONNECTION_ERROR"] = "connection_error";
|
|
13718
|
+
/**
|
|
13719
|
+
* Server -> Client message.
|
|
13720
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
|
13721
|
+
*/
|
|
13722
|
+
|
|
13723
|
+
MESSAGE_TYPES["GQL_CONNECTION_ACK"] = "connection_ack";
|
|
13724
|
+
/**
|
|
13725
|
+
* Client -> Server message.
|
|
13726
|
+
* This message type is for register subscriptions with AWS AppSync RealTime
|
|
13727
|
+
*/
|
|
13728
|
+
|
|
13729
|
+
MESSAGE_TYPES["GQL_START"] = "start";
|
|
13730
|
+
/**
|
|
13731
|
+
* Server -> Client message.
|
|
13732
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
|
13733
|
+
*/
|
|
13734
|
+
|
|
13735
|
+
MESSAGE_TYPES["GQL_START_ACK"] = "start_ack";
|
|
13736
|
+
/**
|
|
13737
|
+
* Server -> Client message.
|
|
13738
|
+
* This message type is for subscription message from AWS AppSync RealTime
|
|
13739
|
+
*/
|
|
13740
|
+
|
|
13741
|
+
MESSAGE_TYPES["GQL_DATA"] = "data";
|
|
13742
|
+
/**
|
|
13743
|
+
* Server -> Client message.
|
|
13744
|
+
* This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
|
13745
|
+
*/
|
|
13746
|
+
|
|
13747
|
+
MESSAGE_TYPES["GQL_CONNECTION_KEEP_ALIVE"] = "ka";
|
|
13748
|
+
/**
|
|
13749
|
+
* Client -> Server message.
|
|
13750
|
+
* This message type is for unregister subscriptions with AWS AppSync RealTime
|
|
13751
|
+
*/
|
|
13752
|
+
|
|
13753
|
+
MESSAGE_TYPES["GQL_STOP"] = "stop";
|
|
13754
|
+
/**
|
|
13755
|
+
* Server -> Client message.
|
|
13756
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
|
13757
|
+
*/
|
|
13758
|
+
|
|
13759
|
+
MESSAGE_TYPES["GQL_COMPLETE"] = "complete";
|
|
13760
|
+
/**
|
|
13761
|
+
* Server -> Client message.
|
|
13762
|
+
* This message type is for sending error messages from AWS AppSync RealTime to the client
|
|
13763
|
+
*/
|
|
13764
|
+
|
|
13765
|
+
MESSAGE_TYPES["GQL_ERROR"] = "error";
|
|
13766
|
+
})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
|
|
13767
|
+
|
|
13768
|
+
var SUBSCRIPTION_STATUS;
|
|
13769
|
+
|
|
13770
|
+
(function (SUBSCRIPTION_STATUS) {
|
|
13771
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
|
|
13772
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
|
|
13773
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
|
|
13774
|
+
})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
|
|
13775
|
+
|
|
13776
|
+
var SOCKET_STATUS;
|
|
13777
|
+
|
|
13778
|
+
(function (SOCKET_STATUS) {
|
|
13779
|
+
SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
|
|
13780
|
+
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
13781
|
+
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
13782
|
+
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
13783
|
+
|
|
13784
|
+
var AMPLIFY_SYMBOL = typeof Symbol !== 'undefined' && typeof Symbol["for"] === 'function' ? Symbol["for"]('amplify_default') : '@@amplify_default';
|
|
13785
|
+
var AWS_APPSYNC_REALTIME_HEADERS = {
|
|
13786
|
+
accept: 'application/json, text/javascript',
|
|
13787
|
+
'content-encoding': 'amz-1.0',
|
|
13788
|
+
'content-type': 'application/json; charset=UTF-8'
|
|
13789
|
+
};
|
|
13790
|
+
/**
|
|
13791
|
+
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
13792
|
+
*/
|
|
13793
|
+
|
|
13794
|
+
var CONNECTION_INIT_TIMEOUT = 15000;
|
|
13795
|
+
/**
|
|
13796
|
+
* Time in milleseconds to wait for GQL_START_ACK message
|
|
13797
|
+
*/
|
|
13798
|
+
|
|
13799
|
+
var START_ACK_TIMEOUT = 15000;
|
|
13800
|
+
/**
|
|
13801
|
+
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
13802
|
+
*/
|
|
13803
|
+
|
|
13804
|
+
var DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
13805
|
+
/**
|
|
13806
|
+
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
13807
|
+
*/
|
|
13808
|
+
|
|
13809
|
+
var DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
13810
|
+
|
|
13777
13811
|
/***/ }),
|
|
13778
13812
|
|
|
13779
13813
|
/***/ "../pubsub/lib-esm/Providers/index.js":
|