@aws-amplify/api-graphql 2.3.13 → 2.3.14

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.3.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@2.3.13...@aws-amplify/api-graphql@2.3.14) (2022-08-18)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/api-graphql
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.3.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@2.3.12...@aws-amplify/api-graphql@2.3.13) (2022-08-16)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/api-graphql
@@ -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__(/*! ./constants */ "../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/constants.js");
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) {
@@ -12429,14 +12298,17 @@ function (_super) {
12429
12298
 
12430
12299
  _this.awsRealTimeSocket.send(JSON.stringify(gqlInit));
12431
12300
 
12432
- setTimeout(checkAckOk.bind(_this, ackOk_1), _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"]);
12433
- }
12301
+ var checkAckOk_1 = function checkAckOk_1(ackOk) {
12302
+ if (!ackOk) {
12303
+ _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].CONNECTION_FAILED);
12434
12304
 
12435
- function checkAckOk(ackOk) {
12436
- if (!ackOk) {
12437
- this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].CONNECTION_FAILED);
12438
- rej(new Error("Connection timeout: ack from AWSRealTime was not received on " + _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"] + " ms"));
12439
- }
12305
+ rej(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after " + _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"] + " ms"));
12306
+ }
12307
+ };
12308
+
12309
+ setTimeout(function () {
12310
+ return checkAckOk_1(ackOk_1);
12311
+ }, _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"]);
12440
12312
  }
12441
12313
  });
12442
12314
  }()];
@@ -13003,6 +12875,9 @@ __webpack_require__.r(__webpack_exports__);
13003
12875
  /* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
13004
12876
  /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
13005
12877
  /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__);
12878
+ /* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
12879
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "../pubsub/lib-esm/Providers/constants.js");
12880
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! .. */ "../pubsub/lib-esm/index.js");
13006
12881
  function _typeof(obj) {
13007
12882
  "@babel/helpers - typeof";
13008
12883
 
@@ -13229,6 +13104,9 @@ var __rest = undefined && undefined.__rest || function (s, e) {
13229
13104
 
13230
13105
 
13231
13106
 
13107
+
13108
+
13109
+
13232
13110
  var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["ConsoleLogger"]('MqttOverWSProvider');
13233
13111
  function mqttTopicMatch(filter, topic) {
13234
13112
  var filterArray = filter.split('/');
@@ -13294,6 +13172,14 @@ function () {
13294
13172
  return ClientsQueue;
13295
13173
  }();
13296
13174
 
13175
+ var dispatchPubSubEvent = function dispatchPubSubEvent(event, data, message) {
13176
+ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["Hub"].dispatch('pubsub', {
13177
+ event: event,
13178
+ data: data,
13179
+ message: message
13180
+ }, 'PubSub', _constants__WEBPACK_IMPORTED_MODULE_6__["AMPLIFY_SYMBOL"]);
13181
+ };
13182
+
13297
13183
  var topicSymbol = typeof Symbol !== 'undefined' ? Symbol('topic') : '@@topic';
13298
13184
 
13299
13185
  var MqttOverWSProvider =
@@ -13311,8 +13197,17 @@ function (_super) {
13311
13197
  })) || this;
13312
13198
 
13313
13199
  _this._clientsQueue = new ClientsQueue();
13200
+ _this.connectionStateMonitor = new _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["ConnectionStateMonitor"]();
13314
13201
  _this._topicObservers = new Map();
13315
- _this._clientIdObservers = new Map();
13202
+ _this._clientIdObservers = new Map(); // Monitor the connection health state and pass changes along to Hub
13203
+
13204
+ _this.connectionStateMonitor.connectionStateObservable.subscribe(function (connectionStateChange) {
13205
+ dispatchPubSubEvent(___WEBPACK_IMPORTED_MODULE_7__["CONNECTION_STATE_CHANGE"], {
13206
+ provider: _this,
13207
+ connectionState: connectionStateChange
13208
+ }, "Connection state is " + connectionStateChange);
13209
+ });
13210
+
13316
13211
  return _this;
13317
13212
  }
13318
13213
 
@@ -13409,6 +13304,7 @@ function (_super) {
13409
13304
  switch (_b.label) {
13410
13305
  case 0:
13411
13306
  logger.debug('Creating new MQTT client', clientId);
13307
+ this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].OPENING_CONNECTION);
13412
13308
  client = new paho_mqtt__WEBPACK_IMPORTED_MODULE_0__["Client"](url, clientId); // client.trace = (args) => logger.debug(clientId, JSON.stringify(args, null, 2));
13413
13309
 
13414
13310
  client.onMessageArrived = function (_a) {
@@ -13426,6 +13322,8 @@ function (_super) {
13426
13322
  clientId: clientId,
13427
13323
  errorCode: errorCode
13428
13324
  }, args));
13325
+
13326
+ _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
13429
13327
  };
13430
13328
 
13431
13329
  return [4
@@ -13437,13 +13335,18 @@ function (_super) {
13437
13335
  onSuccess: function onSuccess() {
13438
13336
  return resolve(client);
13439
13337
  },
13440
- onFailure: reject
13338
+ onFailure: function onFailure() {
13339
+ reject();
13340
+
13341
+ _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_FAILED);
13342
+ }
13441
13343
  });
13442
13344
  })];
13443
13345
 
13444
13346
  case 1:
13445
13347
  _b.sent();
13446
13348
 
13349
+ this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_ESTABLISHED);
13447
13350
  return [2
13448
13351
  /*return*/
13449
13352
  , client];
@@ -13495,6 +13398,7 @@ function (_super) {
13495
13398
 
13496
13399
  if (client && client.isConnected()) {
13497
13400
  client.disconnect();
13401
+ this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
13498
13402
  }
13499
13403
 
13500
13404
  this.clientsQueue.remove(clientId);
@@ -13675,6 +13579,8 @@ function (_super) {
13675
13579
  (_a = _this._clientIdObservers.get(clientId)) === null || _a === void 0 ? void 0 : _a["delete"](observer); // No more observers per client => client not needed anymore
13676
13580
 
13677
13581
  if (((_b = _this._clientIdObservers.get(clientId)) === null || _b === void 0 ? void 0 : _b.size) === 0) {
13582
+ _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSING_CONNECTION);
13583
+
13678
13584
  _this.disconnect(clientId);
13679
13585
 
13680
13586
  _this._clientIdObservers["delete"](clientId);
@@ -13774,6 +13680,137 @@ function () {
13774
13680
 
13775
13681
 
13776
13682
 
13683
+ /***/ }),
13684
+
13685
+ /***/ "../pubsub/lib-esm/Providers/constants.js":
13686
+ /*!************************************************!*\
13687
+ !*** ../pubsub/lib-esm/Providers/constants.js ***!
13688
+ \************************************************/
13689
+ /*! 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 */
13690
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
13691
+
13692
+ "use strict";
13693
+ __webpack_require__.r(__webpack_exports__);
13694
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_DELAY_MS", function() { return MAX_DELAY_MS; });
13695
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NON_RETRYABLE_CODES", function() { return NON_RETRYABLE_CODES; });
13696
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGE_TYPES", function() { return MESSAGE_TYPES; });
13697
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBSCRIPTION_STATUS", function() { return SUBSCRIPTION_STATUS; });
13698
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOCKET_STATUS", function() { return SOCKET_STATUS; });
13699
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMPLIFY_SYMBOL", function() { return AMPLIFY_SYMBOL; });
13700
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_APPSYNC_REALTIME_HEADERS", function() { return AWS_APPSYNC_REALTIME_HEADERS; });
13701
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_INIT_TIMEOUT", function() { return CONNECTION_INIT_TIMEOUT; });
13702
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ACK_TIMEOUT", function() { return START_ACK_TIMEOUT; });
13703
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_TIMEOUT; });
13704
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT; });
13705
+ var MAX_DELAY_MS = 5000;
13706
+ var NON_RETRYABLE_CODES = [400, 401, 403];
13707
+ var MESSAGE_TYPES;
13708
+
13709
+ (function (MESSAGE_TYPES) {
13710
+ /**
13711
+ * Client -> Server message.
13712
+ * This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
13713
+ */
13714
+ MESSAGE_TYPES["GQL_CONNECTION_INIT"] = "connection_init";
13715
+ /**
13716
+ * Server -> Client message
13717
+ * This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
13718
+ */
13719
+
13720
+ MESSAGE_TYPES["GQL_CONNECTION_ERROR"] = "connection_error";
13721
+ /**
13722
+ * Server -> Client message.
13723
+ * This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
13724
+ */
13725
+
13726
+ MESSAGE_TYPES["GQL_CONNECTION_ACK"] = "connection_ack";
13727
+ /**
13728
+ * Client -> Server message.
13729
+ * This message type is for register subscriptions with AWS AppSync RealTime
13730
+ */
13731
+
13732
+ MESSAGE_TYPES["GQL_START"] = "start";
13733
+ /**
13734
+ * Server -> Client message.
13735
+ * This message type is for the ack response from AWS AppSync RealTime for GQL_START message
13736
+ */
13737
+
13738
+ MESSAGE_TYPES["GQL_START_ACK"] = "start_ack";
13739
+ /**
13740
+ * Server -> Client message.
13741
+ * This message type is for subscription message from AWS AppSync RealTime
13742
+ */
13743
+
13744
+ MESSAGE_TYPES["GQL_DATA"] = "data";
13745
+ /**
13746
+ * Server -> Client message.
13747
+ * This message type helps the client to know is still receiving messages from AWS AppSync RealTime
13748
+ */
13749
+
13750
+ MESSAGE_TYPES["GQL_CONNECTION_KEEP_ALIVE"] = "ka";
13751
+ /**
13752
+ * Client -> Server message.
13753
+ * This message type is for unregister subscriptions with AWS AppSync RealTime
13754
+ */
13755
+
13756
+ MESSAGE_TYPES["GQL_STOP"] = "stop";
13757
+ /**
13758
+ * Server -> Client message.
13759
+ * This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
13760
+ */
13761
+
13762
+ MESSAGE_TYPES["GQL_COMPLETE"] = "complete";
13763
+ /**
13764
+ * Server -> Client message.
13765
+ * This message type is for sending error messages from AWS AppSync RealTime to the client
13766
+ */
13767
+
13768
+ MESSAGE_TYPES["GQL_ERROR"] = "error";
13769
+ })(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
13770
+
13771
+ var SUBSCRIPTION_STATUS;
13772
+
13773
+ (function (SUBSCRIPTION_STATUS) {
13774
+ SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
13775
+ SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
13776
+ SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
13777
+ })(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
13778
+
13779
+ var SOCKET_STATUS;
13780
+
13781
+ (function (SOCKET_STATUS) {
13782
+ SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
13783
+ SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
13784
+ SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
13785
+ })(SOCKET_STATUS || (SOCKET_STATUS = {}));
13786
+
13787
+ var AMPLIFY_SYMBOL = typeof Symbol !== 'undefined' && typeof Symbol["for"] === 'function' ? Symbol["for"]('amplify_default') : '@@amplify_default';
13788
+ var AWS_APPSYNC_REALTIME_HEADERS = {
13789
+ accept: 'application/json, text/javascript',
13790
+ 'content-encoding': 'amz-1.0',
13791
+ 'content-type': 'application/json; charset=UTF-8'
13792
+ };
13793
+ /**
13794
+ * Time in milleseconds to wait for GQL_CONNECTION_INIT message
13795
+ */
13796
+
13797
+ var CONNECTION_INIT_TIMEOUT = 15000;
13798
+ /**
13799
+ * Time in milleseconds to wait for GQL_START_ACK message
13800
+ */
13801
+
13802
+ var START_ACK_TIMEOUT = 15000;
13803
+ /**
13804
+ * Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
13805
+ */
13806
+
13807
+ var DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
13808
+ /**
13809
+ * Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
13810
+ */
13811
+
13812
+ var DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
13813
+
13777
13814
  /***/ }),
13778
13815
 
13779
13816
  /***/ "../pubsub/lib-esm/Providers/index.js":