@aws-amplify/api 4.0.54 → 4.0.56-unstable.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/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.55](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.53...@aws-amplify/api@4.0.55) (2022-09-30)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/api
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.0.54](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.53...@aws-amplify/api@4.0.54) (2022-09-20)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/api
@@ -10246,8 +10246,8 @@ function () {
10246
10246
  } : _c;
10247
10247
  var authenticationType = defaultAuthenticationType || aws_appsync_authenticationType || 'AWS_IAM';
10248
10248
 
10249
- if (_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["default"] && typeof _aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["default"].subscribe === 'function') {
10250
- return _aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["default"].subscribe('', {
10249
+ if (_aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["PubSub"] && typeof _aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["PubSub"].subscribe === 'function') {
10250
+ return _aws_amplify_pubsub__WEBPACK_IMPORTED_MODULE_2__["PubSub"].subscribe('', {
10251
10251
  provider: _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"],
10252
10252
  appSyncGraphqlEndpoint: appSyncGraphqlEndpoint,
10253
10253
  authenticationType: authenticationType,
@@ -12163,7 +12163,7 @@ __webpack_require__.r(__webpack_exports__);
12163
12163
  /* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @aws-amplify/auth */ "@aws-amplify/auth");
12164
12164
  /* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_auth__WEBPACK_IMPORTED_MODULE_7__);
12165
12165
  /* harmony import */ var _PubSubProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../PubSubProvider */ "../pubsub/lib-esm/Providers/PubSubProvider.js");
12166
- /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../index */ "../pubsub/lib-esm/index.js");
12166
+ /* harmony import */ var _types_PubSub__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../types/PubSub */ "../pubsub/lib-esm/types/PubSub.js");
12167
12167
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "../pubsub/lib-esm/Providers/constants.js");
12168
12168
  /* harmony import */ var _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/ConnectionStateMonitor */ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js");
12169
12169
  var __extends = undefined && undefined.__extends || function () {
@@ -12435,7 +12435,7 @@ function (_super) {
12435
12435
  _this.connectionStateMonitor = new _utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["ConnectionStateMonitor"](); // Monitor the connection state and pass changes along to Hub
12436
12436
 
12437
12437
  _this.connectionStateMonitor.connectionStateObservable.subscribe(function (ConnectionState) {
12438
- dispatchApiEvent(_index__WEBPACK_IMPORTED_MODULE_9__["CONNECTION_STATE_CHANGE"], {
12438
+ dispatchApiEvent(_constants__WEBPACK_IMPORTED_MODULE_10__["CONNECTION_STATE_CHANGE"], {
12439
12439
  provider: _this,
12440
12440
  connectionState: ConnectionState
12441
12441
  }, "Connection state is " + ConnectionState);
@@ -12488,7 +12488,7 @@ function (_super) {
12488
12488
  subscriptionId: subscriptionId_1
12489
12489
  })["catch"](function (err) {
12490
12490
  observer.error({
12491
- errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].REALTIME_SUBSCRIPTION_INIT_ERROR + ": " + err))]
12491
+ errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].REALTIME_SUBSCRIPTION_INIT_ERROR + ": " + err))]
12492
12492
  });
12493
12493
 
12494
12494
  _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].CLOSED);
@@ -12663,7 +12663,7 @@ function (_super) {
12663
12663
  message = (_b = err_2['message']) !== null && _b !== void 0 ? _b : '';
12664
12664
  this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].CLOSED);
12665
12665
  observer.error({
12666
- errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_FAILED + ": " + message))]
12666
+ errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_FAILED + ": " + message))]
12667
12667
  });
12668
12668
  observer.complete();
12669
12669
  subscriptionFailedCallback_1 = (this.subscriptionObserverMap.get(subscriptionId) || {}).subscriptionFailedCallback; // Notify concurrent unsubscription
@@ -12857,7 +12857,7 @@ function (_super) {
12857
12857
  }
12858
12858
 
12859
12859
  if (startAckTimeoutId) clearTimeout(startAckTimeoutId);
12860
- dispatchApiEvent(_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].SUBSCRIPTION_ACK, {
12860
+ dispatchApiEvent(_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].SUBSCRIPTION_ACK, {
12861
12861
  query: query,
12862
12862
  variables: variables
12863
12863
  }, 'Connection established for subscription');
@@ -12883,7 +12883,7 @@ function (_super) {
12883
12883
  if (this.keepAliveTimeoutId) clearTimeout(this.keepAliveTimeoutId);
12884
12884
  if (this.keepAliveAlertTimeoutId) clearTimeout(this.keepAliveAlertTimeoutId);
12885
12885
  this.keepAliveTimeoutId = setTimeout(function () {
12886
- return _this._errorDisconnect(_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].TIMEOUT_DISCONNECT);
12886
+ return _this._errorDisconnect(_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].TIMEOUT_DISCONNECT);
12887
12887
  }, this.keepAliveTimeout);
12888
12888
  this.keepAliveAlertTimeoutId = setTimeout(function () {
12889
12889
  _this.connectionStateMonitor.record(_utils_ConnectionStateMonitor__WEBPACK_IMPORTED_MODULE_11__["CONNECTION_CHANGE"].KEEP_ALIVE_MISSED);
@@ -12906,7 +12906,7 @@ function (_super) {
12906
12906
  subscriptionState: subscriptionState
12907
12907
  });
12908
12908
  observer.error({
12909
- errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_FAILED + ": " + JSON.stringify(payload)))]
12909
+ errors: [__assign({}, new graphql__WEBPACK_IMPORTED_MODULE_1__["GraphQLError"](_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_FAILED + ": " + JSON.stringify(payload)))]
12910
12910
  });
12911
12911
  if (startAckTimeoutId) clearTimeout(startAckTimeoutId);
12912
12912
  observer.complete();
@@ -13181,13 +13181,13 @@ function (_super) {
13181
13181
  _this.awsRealTimeSocket.onerror = function (err) {
13182
13182
  logger.debug(err);
13183
13183
 
13184
- _this._errorDisconnect(_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_CLOSED);
13184
+ _this._errorDisconnect(_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_CLOSED);
13185
13185
  };
13186
13186
 
13187
13187
  _this.awsRealTimeSocket.onclose = function (event) {
13188
13188
  logger.debug("WebSocket closed " + event.reason);
13189
13189
 
13190
- _this._errorDisconnect(_index__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_CLOSED);
13190
+ _this._errorDisconnect(_types_PubSub__WEBPACK_IMPORTED_MODULE_9__["CONTROL_MSG"].CONNECTION_CLOSED);
13191
13191
  };
13192
13192
  }
13193
13193
 
@@ -15165,12 +15165,11 @@ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Amplify"].register(PubSub);
15165
15165
  /*!**********************************!*\
15166
15166
  !*** ../pubsub/lib-esm/index.js ***!
15167
15167
  \**********************************/
15168
- /*! exports provided: AbstractPubSubProvider, AWSAppSyncProvider, AWSAppSyncRealTimeProvider, AWSIoTProvider, mqttTopicMatch, MqttOverWSProvider, CONNECTION_STATE_CHANGE, ConnectionState, PubSub, CONTROL_MSG, default */
15168
+ /*! exports provided: AbstractPubSubProvider, AWSAppSyncProvider, AWSAppSyncRealTimeProvider, AWSIoTProvider, mqttTopicMatch, MqttOverWSProvider, CONNECTION_STATE_CHANGE, ConnectionState, CONTROL_MSG, PubSub, default */
15169
15169
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
15170
15170
 
15171
15171
  "use strict";
15172
15172
  __webpack_require__.r(__webpack_exports__);
15173
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTROL_MSG", function() { return CONTROL_MSG; });
15174
15173
  /* harmony import */ var _PubSub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PubSub */ "../pubsub/lib-esm/PubSub.js");
15175
15174
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PubSub", function() { return _PubSub__WEBPACK_IMPORTED_MODULE_0__["PubSub"]; });
15176
15175
 
@@ -15193,6 +15192,8 @@ __webpack_require__.r(__webpack_exports__);
15193
15192
  /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types */ "../pubsub/lib-esm/types/index.js");
15194
15193
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectionState", function() { return _types__WEBPACK_IMPORTED_MODULE_3__["ConnectionState"]; });
15195
15194
 
15195
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONTROL_MSG", function() { return _types__WEBPACK_IMPORTED_MODULE_3__["CONTROL_MSG"]; });
15196
+
15196
15197
  /*
15197
15198
  * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
15198
15199
  *
@@ -15207,16 +15208,6 @@ __webpack_require__.r(__webpack_exports__);
15207
15208
  */
15208
15209
 
15209
15210
 
15210
- var CONTROL_MSG;
15211
-
15212
- (function (CONTROL_MSG) {
15213
- CONTROL_MSG["CONNECTION_CLOSED"] = "Connection closed";
15214
- CONTROL_MSG["CONNECTION_FAILED"] = "Connection failed";
15215
- CONTROL_MSG["REALTIME_SUBSCRIPTION_INIT_ERROR"] = "AppSync Realtime subscription init error";
15216
- CONTROL_MSG["SUBSCRIPTION_ACK"] = "Subscription ack";
15217
- CONTROL_MSG["TIMEOUT_DISCONNECT"] = "Timeout disconnect";
15218
- })(CONTROL_MSG || (CONTROL_MSG = {}));
15219
-
15220
15211
 
15221
15212
 
15222
15213
 
@@ -15228,17 +15219,41 @@ var CONTROL_MSG;
15228
15219
 
15229
15220
  /***/ }),
15230
15221
 
15231
- /***/ "../pubsub/lib-esm/types/index.js":
15232
- /*!****************************************!*\
15233
- !*** ../pubsub/lib-esm/types/index.js ***!
15234
- \****************************************/
15235
- /*! exports provided: ConnectionState */
15222
+ /***/ "../pubsub/lib-esm/types/PubSub.js":
15223
+ /*!*****************************************!*\
15224
+ !*** ../pubsub/lib-esm/types/PubSub.js ***!
15225
+ \*****************************************/
15226
+ /*! exports provided: CONTROL_MSG, ConnectionState */
15236
15227
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
15237
15228
 
15238
15229
  "use strict";
15239
15230
  __webpack_require__.r(__webpack_exports__);
15231
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTROL_MSG", function() { return CONTROL_MSG; });
15240
15232
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectionState", function() { return ConnectionState; });
15233
+ /*
15234
+ * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
15235
+ *
15236
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
15237
+ * the License. A copy of the License is located at
15238
+ *
15239
+ * http://aws.amazon.com/apache2.0/
15240
+ *
15241
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15242
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
15243
+ * and limitations under the License.
15244
+ */
15245
+ var CONTROL_MSG;
15246
+
15247
+ (function (CONTROL_MSG) {
15248
+ CONTROL_MSG["CONNECTION_CLOSED"] = "Connection closed";
15249
+ CONTROL_MSG["CONNECTION_FAILED"] = "Connection failed";
15250
+ CONTROL_MSG["REALTIME_SUBSCRIPTION_INIT_ERROR"] = "AppSync Realtime subscription init error";
15251
+ CONTROL_MSG["SUBSCRIPTION_ACK"] = "Subscription ack";
15252
+ CONTROL_MSG["TIMEOUT_DISCONNECT"] = "Timeout disconnect";
15253
+ })(CONTROL_MSG || (CONTROL_MSG = {}));
15241
15254
  /** @enum {string} */
15255
+
15256
+
15242
15257
  var ConnectionState;
15243
15258
 
15244
15259
  (function (ConnectionState) {
@@ -15283,6 +15298,24 @@ var ConnectionState;
15283
15298
  ConnectionState["ConnectedPendingKeepAlive"] = "ConnectedPendingKeepAlive";
15284
15299
  })(ConnectionState || (ConnectionState = {}));
15285
15300
 
15301
+ /***/ }),
15302
+
15303
+ /***/ "../pubsub/lib-esm/types/index.js":
15304
+ /*!****************************************!*\
15305
+ !*** ../pubsub/lib-esm/types/index.js ***!
15306
+ \****************************************/
15307
+ /*! exports provided: CONTROL_MSG, ConnectionState */
15308
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
15309
+
15310
+ "use strict";
15311
+ __webpack_require__.r(__webpack_exports__);
15312
+ /* harmony import */ var _PubSub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PubSub */ "../pubsub/lib-esm/types/PubSub.js");
15313
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONTROL_MSG", function() { return _PubSub__WEBPACK_IMPORTED_MODULE_0__["CONTROL_MSG"]; });
15314
+
15315
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectionState", function() { return _PubSub__WEBPACK_IMPORTED_MODULE_0__["ConnectionState"]; });
15316
+
15317
+
15318
+
15286
15319
  /***/ }),
15287
15320
 
15288
15321
  /***/ "../pubsub/lib-esm/utils/ConnectionStateMonitor.js":
@@ -15297,7 +15330,7 @@ __webpack_require__.r(__webpack_exports__);
15297
15330
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONNECTION_CHANGE", function() { return CONNECTION_CHANGE; });
15298
15331
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectionStateMonitor", function() { return ConnectionStateMonitor; });
15299
15332
  /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable-ts */ "../../node_modules/zen-observable-ts/lib/bundle.esm.js");
15300
- /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../index */ "../pubsub/lib-esm/index.js");
15333
+ /* harmony import */ var _types_PubSub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/PubSub */ "../pubsub/lib-esm/types/PubSub.js");
15301
15334
  /* harmony import */ var _ReachabilityMonitor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ReachabilityMonitor */ "../pubsub/lib-esm/utils/ReachabilityMonitor/index.js");
15302
15335
  /*
15303
15336
  * Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -15463,15 +15496,15 @@ function () {
15463
15496
  networkState = _a.networkState,
15464
15497
  intendedConnectionState = _a.intendedConnectionState,
15465
15498
  keepAliveState = _a.keepAliveState;
15466
- if (connectionState === 'connected' && networkState === 'disconnected') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingNetwork;
15467
- if (connectionState === 'connected' && intendedConnectionState === 'disconnected') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingDisconnect;
15468
- if (connectionState === 'disconnected' && intendedConnectionState === 'connected' && networkState === 'disconnected') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectionDisruptedPendingNetwork;
15469
- if (connectionState === 'disconnected' && intendedConnectionState === 'connected') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectionDisrupted;
15470
- if (connectionState === 'connected' && keepAliveState === 'unhealthy') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingKeepAlive; // All remaining states directly correspond to the connection state
15471
-
15472
- if (connectionState === 'connecting') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Connecting;
15473
- if (connectionState === 'disconnected') return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Disconnected;
15474
- return _index__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Connected;
15499
+ if (connectionState === 'connected' && networkState === 'disconnected') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingNetwork;
15500
+ if (connectionState === 'connected' && intendedConnectionState === 'disconnected') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingDisconnect;
15501
+ if (connectionState === 'disconnected' && intendedConnectionState === 'connected' && networkState === 'disconnected') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectionDisruptedPendingNetwork;
15502
+ if (connectionState === 'disconnected' && intendedConnectionState === 'connected') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectionDisrupted;
15503
+ if (connectionState === 'connected' && keepAliveState === 'unhealthy') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].ConnectedPendingKeepAlive; // All remaining states directly correspond to the connection state
15504
+
15505
+ if (connectionState === 'connecting') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Connecting;
15506
+ if (connectionState === 'disconnected') return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Disconnected;
15507
+ return _types_PubSub__WEBPACK_IMPORTED_MODULE_1__["ConnectionState"].Connected;
15475
15508
  };
15476
15509
 
15477
15510
  return ConnectionStateMonitor;