@aws-amplify/api 4.0.49-unstable.13 → 4.0.50-unstable.5
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 +8 -0
- package/dist/aws-amplify-api.js +178 -141
- package/dist/aws-amplify-api.js.map +1 -1
- package/dist/aws-amplify-api.min.js +3 -3
- package/dist/aws-amplify-api.min.js.map +1 -1
- package/package.json +4 -4
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
|
+
## [4.0.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.48...@aws-amplify/api@4.0.49) (2022-08-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.0.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.47...@aws-amplify/api@4.0.48) (2022-08-01)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-amplify/api
|
package/dist/aws-amplify-api.js
CHANGED
|
@@ -12135,137 +12135,6 @@ function (_super) {
|
|
|
12135
12135
|
|
|
12136
12136
|
|
|
12137
12137
|
|
|
12138
|
-
/***/ }),
|
|
12139
|
-
|
|
12140
|
-
/***/ "../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/constants.js":
|
|
12141
|
-
/*!***************************************************************************!*\
|
|
12142
|
-
!*** ../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/constants.js ***!
|
|
12143
|
-
\***************************************************************************/
|
|
12144
|
-
/*! 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 */
|
|
12145
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
12146
|
-
|
|
12147
|
-
"use strict";
|
|
12148
|
-
__webpack_require__.r(__webpack_exports__);
|
|
12149
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_DELAY_MS", function() { return MAX_DELAY_MS; });
|
|
12150
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NON_RETRYABLE_CODES", function() { return NON_RETRYABLE_CODES; });
|
|
12151
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGE_TYPES", function() { return MESSAGE_TYPES; });
|
|
12152
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBSCRIPTION_STATUS", function() { return SUBSCRIPTION_STATUS; });
|
|
12153
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOCKET_STATUS", function() { return SOCKET_STATUS; });
|
|
12154
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMPLIFY_SYMBOL", function() { return AMPLIFY_SYMBOL; });
|
|
12155
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_APPSYNC_REALTIME_HEADERS", function() { return AWS_APPSYNC_REALTIME_HEADERS; });
|
|
12156
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_INIT_TIMEOUT", function() { return CONNECTION_INIT_TIMEOUT; });
|
|
12157
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ACK_TIMEOUT", function() { return START_ACK_TIMEOUT; });
|
|
12158
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_TIMEOUT; });
|
|
12159
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT; });
|
|
12160
|
-
var MAX_DELAY_MS = 5000;
|
|
12161
|
-
var NON_RETRYABLE_CODES = [400, 401, 403];
|
|
12162
|
-
var MESSAGE_TYPES;
|
|
12163
|
-
|
|
12164
|
-
(function (MESSAGE_TYPES) {
|
|
12165
|
-
/**
|
|
12166
|
-
* Client -> Server message.
|
|
12167
|
-
* This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
|
12168
|
-
*/
|
|
12169
|
-
MESSAGE_TYPES["GQL_CONNECTION_INIT"] = "connection_init";
|
|
12170
|
-
/**
|
|
12171
|
-
* Server -> Client message
|
|
12172
|
-
* This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
|
12173
|
-
*/
|
|
12174
|
-
|
|
12175
|
-
MESSAGE_TYPES["GQL_CONNECTION_ERROR"] = "connection_error";
|
|
12176
|
-
/**
|
|
12177
|
-
* Server -> Client message.
|
|
12178
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
|
12179
|
-
*/
|
|
12180
|
-
|
|
12181
|
-
MESSAGE_TYPES["GQL_CONNECTION_ACK"] = "connection_ack";
|
|
12182
|
-
/**
|
|
12183
|
-
* Client -> Server message.
|
|
12184
|
-
* This message type is for register subscriptions with AWS AppSync RealTime
|
|
12185
|
-
*/
|
|
12186
|
-
|
|
12187
|
-
MESSAGE_TYPES["GQL_START"] = "start";
|
|
12188
|
-
/**
|
|
12189
|
-
* Server -> Client message.
|
|
12190
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
|
12191
|
-
*/
|
|
12192
|
-
|
|
12193
|
-
MESSAGE_TYPES["GQL_START_ACK"] = "start_ack";
|
|
12194
|
-
/**
|
|
12195
|
-
* Server -> Client message.
|
|
12196
|
-
* This message type is for subscription message from AWS AppSync RealTime
|
|
12197
|
-
*/
|
|
12198
|
-
|
|
12199
|
-
MESSAGE_TYPES["GQL_DATA"] = "data";
|
|
12200
|
-
/**
|
|
12201
|
-
* Server -> Client message.
|
|
12202
|
-
* This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
|
12203
|
-
*/
|
|
12204
|
-
|
|
12205
|
-
MESSAGE_TYPES["GQL_CONNECTION_KEEP_ALIVE"] = "ka";
|
|
12206
|
-
/**
|
|
12207
|
-
* Client -> Server message.
|
|
12208
|
-
* This message type is for unregister subscriptions with AWS AppSync RealTime
|
|
12209
|
-
*/
|
|
12210
|
-
|
|
12211
|
-
MESSAGE_TYPES["GQL_STOP"] = "stop";
|
|
12212
|
-
/**
|
|
12213
|
-
* Server -> Client message.
|
|
12214
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
|
12215
|
-
*/
|
|
12216
|
-
|
|
12217
|
-
MESSAGE_TYPES["GQL_COMPLETE"] = "complete";
|
|
12218
|
-
/**
|
|
12219
|
-
* Server -> Client message.
|
|
12220
|
-
* This message type is for sending error messages from AWS AppSync RealTime to the client
|
|
12221
|
-
*/
|
|
12222
|
-
|
|
12223
|
-
MESSAGE_TYPES["GQL_ERROR"] = "error";
|
|
12224
|
-
})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
|
|
12225
|
-
|
|
12226
|
-
var SUBSCRIPTION_STATUS;
|
|
12227
|
-
|
|
12228
|
-
(function (SUBSCRIPTION_STATUS) {
|
|
12229
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
|
|
12230
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
|
|
12231
|
-
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
|
|
12232
|
-
})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
|
|
12233
|
-
|
|
12234
|
-
var SOCKET_STATUS;
|
|
12235
|
-
|
|
12236
|
-
(function (SOCKET_STATUS) {
|
|
12237
|
-
SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
|
|
12238
|
-
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
12239
|
-
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
12240
|
-
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
12241
|
-
|
|
12242
|
-
var AMPLIFY_SYMBOL = typeof Symbol !== 'undefined' && typeof Symbol["for"] === 'function' ? Symbol["for"]('amplify_default') : '@@amplify_default';
|
|
12243
|
-
var AWS_APPSYNC_REALTIME_HEADERS = {
|
|
12244
|
-
accept: 'application/json, text/javascript',
|
|
12245
|
-
'content-encoding': 'amz-1.0',
|
|
12246
|
-
'content-type': 'application/json; charset=UTF-8'
|
|
12247
|
-
};
|
|
12248
|
-
/**
|
|
12249
|
-
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
12250
|
-
*/
|
|
12251
|
-
|
|
12252
|
-
var CONNECTION_INIT_TIMEOUT = 15000;
|
|
12253
|
-
/**
|
|
12254
|
-
* Time in milleseconds to wait for GQL_START_ACK message
|
|
12255
|
-
*/
|
|
12256
|
-
|
|
12257
|
-
var START_ACK_TIMEOUT = 15000;
|
|
12258
|
-
/**
|
|
12259
|
-
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
12260
|
-
*/
|
|
12261
|
-
|
|
12262
|
-
var DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
12263
|
-
/**
|
|
12264
|
-
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
12265
|
-
*/
|
|
12266
|
-
|
|
12267
|
-
var DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
12268
|
-
|
|
12269
12138
|
/***/ }),
|
|
12270
12139
|
|
|
12271
12140
|
/***/ "../pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js":
|
|
@@ -12295,7 +12164,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12295
12164
|
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7__);
|
|
12296
12165
|
/* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
|
|
12297
12166
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../index */ "../pubsub/lib-esm/index.js");
|
|
12298
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*!
|
|
12167
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "../pubsub/lib-esm/Providers/constants.js");
|
|
12299
12168
|
/* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
|
|
12300
12169
|
var __extends = undefined && undefined.__extends || function () {
|
|
12301
12170
|
var _extendStatics = function extendStatics(d, b) {
|
|
@@ -13350,14 +13219,17 @@ function (_super) {
|
|
|
13350
13219
|
|
|
13351
13220
|
_this.awsRealTimeSocket.send(JSON.stringify(gqlInit));
|
|
13352
13221
|
|
|
13353
|
-
|
|
13354
|
-
|
|
13222
|
+
var checkAckOk_1 = function checkAckOk_1(ackOk) {
|
|
13223
|
+
if (!ackOk) {
|
|
13224
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].CONNECTION_FAILED);
|
|
13355
13225
|
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13226
|
+
rej(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after " + _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"] + " ms"));
|
|
13227
|
+
}
|
|
13228
|
+
};
|
|
13229
|
+
|
|
13230
|
+
setTimeout(function () {
|
|
13231
|
+
return checkAckOk_1(ackOk_1);
|
|
13232
|
+
}, _constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_INIT_TIMEOUT"]);
|
|
13361
13233
|
}
|
|
13362
13234
|
});
|
|
13363
13235
|
}()];
|
|
@@ -13924,6 +13796,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13924
13796
|
/* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
|
|
13925
13797
|
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
13926
13798
|
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__);
|
|
13799
|
+
/* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
|
|
13800
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "../pubsub/lib-esm/Providers/constants.js");
|
|
13801
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! .. */ "../pubsub/lib-esm/index.js");
|
|
13927
13802
|
function _typeof(obj) {
|
|
13928
13803
|
"@babel/helpers - typeof";
|
|
13929
13804
|
|
|
@@ -14150,6 +14025,9 @@ var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
14150
14025
|
|
|
14151
14026
|
|
|
14152
14027
|
|
|
14028
|
+
|
|
14029
|
+
|
|
14030
|
+
|
|
14153
14031
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["ConsoleLogger"]('MqttOverWSProvider');
|
|
14154
14032
|
function mqttTopicMatch(filter, topic) {
|
|
14155
14033
|
var filterArray = filter.split('/');
|
|
@@ -14215,6 +14093,14 @@ function () {
|
|
|
14215
14093
|
return ClientsQueue;
|
|
14216
14094
|
}();
|
|
14217
14095
|
|
|
14096
|
+
var dispatchPubSubEvent = function dispatchPubSubEvent(event, data, message) {
|
|
14097
|
+
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["Hub"].dispatch('pubsub', {
|
|
14098
|
+
event: event,
|
|
14099
|
+
data: data,
|
|
14100
|
+
message: message
|
|
14101
|
+
}, 'PubSub', _constants__WEBPACK_IMPORTED_MODULE_6__["AMPLIFY_SYMBOL"]);
|
|
14102
|
+
};
|
|
14103
|
+
|
|
14218
14104
|
var topicSymbol = typeof Symbol !== 'undefined' ? Symbol('topic') : '@@topic';
|
|
14219
14105
|
|
|
14220
14106
|
var MqttOverWSProvider =
|
|
@@ -14232,8 +14118,17 @@ function (_super) {
|
|
|
14232
14118
|
})) || this;
|
|
14233
14119
|
|
|
14234
14120
|
_this._clientsQueue = new ClientsQueue();
|
|
14121
|
+
_this.connectionStateMonitor = new _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["ConnectionStateMonitor"]();
|
|
14235
14122
|
_this._topicObservers = new Map();
|
|
14236
|
-
_this._clientIdObservers = new Map();
|
|
14123
|
+
_this._clientIdObservers = new Map(); // Monitor the connection health state and pass changes along to Hub
|
|
14124
|
+
|
|
14125
|
+
_this.connectionStateMonitor.connectionStateObservable.subscribe(function (connectionStateChange) {
|
|
14126
|
+
dispatchPubSubEvent(___WEBPACK_IMPORTED_MODULE_7__["CONNECTION_STATE_CHANGE"], {
|
|
14127
|
+
provider: _this,
|
|
14128
|
+
connectionState: connectionStateChange
|
|
14129
|
+
}, "Connection state is " + connectionStateChange);
|
|
14130
|
+
});
|
|
14131
|
+
|
|
14237
14132
|
return _this;
|
|
14238
14133
|
}
|
|
14239
14134
|
|
|
@@ -14330,6 +14225,7 @@ function (_super) {
|
|
|
14330
14225
|
switch (_b.label) {
|
|
14331
14226
|
case 0:
|
|
14332
14227
|
logger.debug('Creating new MQTT client', clientId);
|
|
14228
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].OPENING_CONNECTION);
|
|
14333
14229
|
client = new paho_mqtt__WEBPACK_IMPORTED_MODULE_0__["Client"](url, clientId); // client.trace = (args) => logger.debug(clientId, JSON.stringify(args, null, 2));
|
|
14334
14230
|
|
|
14335
14231
|
client.onMessageArrived = function (_a) {
|
|
@@ -14347,6 +14243,8 @@ function (_super) {
|
|
|
14347
14243
|
clientId: clientId,
|
|
14348
14244
|
errorCode: errorCode
|
|
14349
14245
|
}, args));
|
|
14246
|
+
|
|
14247
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
|
|
14350
14248
|
};
|
|
14351
14249
|
|
|
14352
14250
|
return [4
|
|
@@ -14358,13 +14256,18 @@ function (_super) {
|
|
|
14358
14256
|
onSuccess: function onSuccess() {
|
|
14359
14257
|
return resolve(client);
|
|
14360
14258
|
},
|
|
14361
|
-
onFailure:
|
|
14259
|
+
onFailure: function onFailure() {
|
|
14260
|
+
reject();
|
|
14261
|
+
|
|
14262
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_FAILED);
|
|
14263
|
+
}
|
|
14362
14264
|
});
|
|
14363
14265
|
})];
|
|
14364
14266
|
|
|
14365
14267
|
case 1:
|
|
14366
14268
|
_b.sent();
|
|
14367
14269
|
|
|
14270
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CONNECTION_ESTABLISHED);
|
|
14368
14271
|
return [2
|
|
14369
14272
|
/*return*/
|
|
14370
14273
|
, client];
|
|
@@ -14416,6 +14319,7 @@ function (_super) {
|
|
|
14416
14319
|
|
|
14417
14320
|
if (client && client.isConnected()) {
|
|
14418
14321
|
client.disconnect();
|
|
14322
|
+
this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSED);
|
|
14419
14323
|
}
|
|
14420
14324
|
|
|
14421
14325
|
this.clientsQueue.remove(clientId);
|
|
@@ -14596,6 +14500,8 @@ function (_super) {
|
|
|
14596
14500
|
(_a = _this._clientIdObservers.get(clientId)) === null || _a === void 0 ? void 0 : _a["delete"](observer); // No more observers per client => client not needed anymore
|
|
14597
14501
|
|
|
14598
14502
|
if (((_b = _this._clientIdObservers.get(clientId)) === null || _b === void 0 ? void 0 : _b.size) === 0) {
|
|
14503
|
+
_this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_5__["CONNECTION_CHANGE"].CLOSING_CONNECTION);
|
|
14504
|
+
|
|
14599
14505
|
_this.disconnect(clientId);
|
|
14600
14506
|
|
|
14601
14507
|
_this._clientIdObservers["delete"](clientId);
|
|
@@ -14695,6 +14601,137 @@ function () {
|
|
|
14695
14601
|
|
|
14696
14602
|
|
|
14697
14603
|
|
|
14604
|
+
/***/ }),
|
|
14605
|
+
|
|
14606
|
+
/***/ "../pubsub/lib-esm/Providers/constants.js":
|
|
14607
|
+
/*!************************************************!*\
|
|
14608
|
+
!*** ../pubsub/lib-esm/Providers/constants.js ***!
|
|
14609
|
+
\************************************************/
|
|
14610
|
+
/*! 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 */
|
|
14611
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
14612
|
+
|
|
14613
|
+
"use strict";
|
|
14614
|
+
__webpack_require__.r(__webpack_exports__);
|
|
14615
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_DELAY_MS", function() { return MAX_DELAY_MS; });
|
|
14616
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NON_RETRYABLE_CODES", function() { return NON_RETRYABLE_CODES; });
|
|
14617
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MESSAGE_TYPES", function() { return MESSAGE_TYPES; });
|
|
14618
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBSCRIPTION_STATUS", function() { return SUBSCRIPTION_STATUS; });
|
|
14619
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SOCKET_STATUS", function() { return SOCKET_STATUS; });
|
|
14620
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AMPLIFY_SYMBOL", function() { return AMPLIFY_SYMBOL; });
|
|
14621
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWS_APPSYNC_REALTIME_HEADERS", function() { return AWS_APPSYNC_REALTIME_HEADERS; });
|
|
14622
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_INIT_TIMEOUT", function() { return CONNECTION_INIT_TIMEOUT; });
|
|
14623
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ACK_TIMEOUT", function() { return START_ACK_TIMEOUT; });
|
|
14624
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_TIMEOUT; });
|
|
14625
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT", function() { return DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT; });
|
|
14626
|
+
var MAX_DELAY_MS = 5000;
|
|
14627
|
+
var NON_RETRYABLE_CODES = [400, 401, 403];
|
|
14628
|
+
var MESSAGE_TYPES;
|
|
14629
|
+
|
|
14630
|
+
(function (MESSAGE_TYPES) {
|
|
14631
|
+
/**
|
|
14632
|
+
* Client -> Server message.
|
|
14633
|
+
* This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
|
14634
|
+
*/
|
|
14635
|
+
MESSAGE_TYPES["GQL_CONNECTION_INIT"] = "connection_init";
|
|
14636
|
+
/**
|
|
14637
|
+
* Server -> Client message
|
|
14638
|
+
* This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
|
14639
|
+
*/
|
|
14640
|
+
|
|
14641
|
+
MESSAGE_TYPES["GQL_CONNECTION_ERROR"] = "connection_error";
|
|
14642
|
+
/**
|
|
14643
|
+
* Server -> Client message.
|
|
14644
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
|
14645
|
+
*/
|
|
14646
|
+
|
|
14647
|
+
MESSAGE_TYPES["GQL_CONNECTION_ACK"] = "connection_ack";
|
|
14648
|
+
/**
|
|
14649
|
+
* Client -> Server message.
|
|
14650
|
+
* This message type is for register subscriptions with AWS AppSync RealTime
|
|
14651
|
+
*/
|
|
14652
|
+
|
|
14653
|
+
MESSAGE_TYPES["GQL_START"] = "start";
|
|
14654
|
+
/**
|
|
14655
|
+
* Server -> Client message.
|
|
14656
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
|
14657
|
+
*/
|
|
14658
|
+
|
|
14659
|
+
MESSAGE_TYPES["GQL_START_ACK"] = "start_ack";
|
|
14660
|
+
/**
|
|
14661
|
+
* Server -> Client message.
|
|
14662
|
+
* This message type is for subscription message from AWS AppSync RealTime
|
|
14663
|
+
*/
|
|
14664
|
+
|
|
14665
|
+
MESSAGE_TYPES["GQL_DATA"] = "data";
|
|
14666
|
+
/**
|
|
14667
|
+
* Server -> Client message.
|
|
14668
|
+
* This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
|
14669
|
+
*/
|
|
14670
|
+
|
|
14671
|
+
MESSAGE_TYPES["GQL_CONNECTION_KEEP_ALIVE"] = "ka";
|
|
14672
|
+
/**
|
|
14673
|
+
* Client -> Server message.
|
|
14674
|
+
* This message type is for unregister subscriptions with AWS AppSync RealTime
|
|
14675
|
+
*/
|
|
14676
|
+
|
|
14677
|
+
MESSAGE_TYPES["GQL_STOP"] = "stop";
|
|
14678
|
+
/**
|
|
14679
|
+
* Server -> Client message.
|
|
14680
|
+
* This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
|
14681
|
+
*/
|
|
14682
|
+
|
|
14683
|
+
MESSAGE_TYPES["GQL_COMPLETE"] = "complete";
|
|
14684
|
+
/**
|
|
14685
|
+
* Server -> Client message.
|
|
14686
|
+
* This message type is for sending error messages from AWS AppSync RealTime to the client
|
|
14687
|
+
*/
|
|
14688
|
+
|
|
14689
|
+
MESSAGE_TYPES["GQL_ERROR"] = "error";
|
|
14690
|
+
})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
|
|
14691
|
+
|
|
14692
|
+
var SUBSCRIPTION_STATUS;
|
|
14693
|
+
|
|
14694
|
+
(function (SUBSCRIPTION_STATUS) {
|
|
14695
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
|
|
14696
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
|
|
14697
|
+
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
|
|
14698
|
+
})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
|
|
14699
|
+
|
|
14700
|
+
var SOCKET_STATUS;
|
|
14701
|
+
|
|
14702
|
+
(function (SOCKET_STATUS) {
|
|
14703
|
+
SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
|
|
14704
|
+
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
14705
|
+
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
14706
|
+
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
14707
|
+
|
|
14708
|
+
var AMPLIFY_SYMBOL = typeof Symbol !== 'undefined' && typeof Symbol["for"] === 'function' ? Symbol["for"]('amplify_default') : '@@amplify_default';
|
|
14709
|
+
var AWS_APPSYNC_REALTIME_HEADERS = {
|
|
14710
|
+
accept: 'application/json, text/javascript',
|
|
14711
|
+
'content-encoding': 'amz-1.0',
|
|
14712
|
+
'content-type': 'application/json; charset=UTF-8'
|
|
14713
|
+
};
|
|
14714
|
+
/**
|
|
14715
|
+
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
14716
|
+
*/
|
|
14717
|
+
|
|
14718
|
+
var CONNECTION_INIT_TIMEOUT = 15000;
|
|
14719
|
+
/**
|
|
14720
|
+
* Time in milleseconds to wait for GQL_START_ACK message
|
|
14721
|
+
*/
|
|
14722
|
+
|
|
14723
|
+
var START_ACK_TIMEOUT = 15000;
|
|
14724
|
+
/**
|
|
14725
|
+
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
14726
|
+
*/
|
|
14727
|
+
|
|
14728
|
+
var DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
14729
|
+
/**
|
|
14730
|
+
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
14731
|
+
*/
|
|
14732
|
+
|
|
14733
|
+
var DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
14734
|
+
|
|
14698
14735
|
/***/ }),
|
|
14699
14736
|
|
|
14700
14737
|
/***/ "../pubsub/lib-esm/Providers/index.js":
|