@aws-amplify/api-graphql 4.0.1-console-preview.431c340.0 → 4.0.1-console-preview.4b7d177.0
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/lib/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +3 -3
- package/lib/tsconfig.tsbuildinfo +469 -241
- package/lib/types/PubSub.d.ts +2 -2
- package/lib/utils/ConnectionStateMonitor.d.ts +1 -1
- package/lib/utils/ConnectionStateMonitor.js +8 -7
- package/lib/utils/ReachabilityMonitor/index.d.ts +1 -3
- package/lib/utils/ReachabilityMonitor/index.native.d.ts +1 -3
- package/lib/utils/ReconnectionMonitor.d.ts +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +469 -241
- package/lib-esm/types/PubSub.d.ts +2 -2
- package/lib-esm/utils/ConnectionStateMonitor.d.ts +1 -1
- package/lib-esm/utils/ConnectionStateMonitor.js +7 -6
- package/lib-esm/utils/ReachabilityMonitor/index.d.ts +1 -3
- package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +1 -3
- package/lib-esm/utils/ReconnectionMonitor.d.ts +1 -1
- package/package.json +6 -10
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +3 -3
- package/src/types/PubSub.ts +2 -4
- package/src/utils/ConnectionStateMonitor.ts +17 -13
- package/src/utils/ReconnectionMonitor.ts +1 -1
package/lib/types/PubSub.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Observer } from 'rxjs';
|
|
2
2
|
export interface SubscriptionObserver<T> {
|
|
3
3
|
closed: boolean;
|
|
4
4
|
next(value: T): void;
|
|
@@ -24,4 +24,4 @@ export declare enum ConnectionState {
|
|
|
24
24
|
ConnectedPendingKeepAlive = "ConnectedPendingKeepAlive"
|
|
25
25
|
}
|
|
26
26
|
export declare type PubSubContent = Record<string, unknown> | string;
|
|
27
|
-
export declare type PubSubContentObserver =
|
|
27
|
+
export declare type PubSubContentObserver = Observer<PubSubContent>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
|
-
var
|
|
6
|
+
var rxjs_1 = require("rxjs");
|
|
7
7
|
var PubSub_1 = require("../types/PubSub");
|
|
8
8
|
var ReachabilityMonitor_1 = require("./ReachabilityMonitor");
|
|
9
9
|
exports.CONNECTION_CHANGE = {
|
|
@@ -41,7 +41,7 @@ var ConnectionStateMonitor = /** @class */ (function () {
|
|
|
41
41
|
(_b = _this._initialNetworkStateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
42
42
|
});
|
|
43
43
|
this._linkedConnectionStateObservable =
|
|
44
|
-
new
|
|
44
|
+
new rxjs_1.Observable(function (connectionStateObserver) {
|
|
45
45
|
connectionStateObserver.next(_this._linkedConnectionState);
|
|
46
46
|
_this._linkedConnectionStateObserver = connectionStateObserver;
|
|
47
47
|
});
|
|
@@ -84,14 +84,14 @@ var ConnectionStateMonitor = /** @class */ (function () {
|
|
|
84
84
|
// states without changing the overall connection state.
|
|
85
85
|
// After translating from linked states to ConnectionState, then remove any duplicates
|
|
86
86
|
return this._linkedConnectionStateObservable
|
|
87
|
-
.map(function (value) {
|
|
87
|
+
.pipe(rxjs_1.map(function (value) {
|
|
88
88
|
return _this.connectionStatesTranslator(value);
|
|
89
|
-
})
|
|
90
|
-
.filter(function (current) {
|
|
89
|
+
}))
|
|
90
|
+
.pipe(rxjs_1.filter(function (current) {
|
|
91
91
|
var toInclude = current !== previous;
|
|
92
92
|
previous = current;
|
|
93
93
|
return toInclude;
|
|
94
|
-
});
|
|
94
|
+
}));
|
|
95
95
|
},
|
|
96
96
|
enumerable: true,
|
|
97
97
|
configurable: true
|
|
@@ -100,6 +100,7 @@ var ConnectionStateMonitor = /** @class */ (function () {
|
|
|
100
100
|
* Updates local connection state and emits the full state to the observer.
|
|
101
101
|
*/
|
|
102
102
|
ConnectionStateMonitor.prototype.record = function (statusUpdates) {
|
|
103
|
+
var _a;
|
|
103
104
|
// Maintain the network monitor
|
|
104
105
|
if (statusUpdates.intendedConnectionState === 'connected') {
|
|
105
106
|
this.enableNetworkMonitoring();
|
|
@@ -110,7 +111,7 @@ var ConnectionStateMonitor = /** @class */ (function () {
|
|
|
110
111
|
// Maintain the socket state
|
|
111
112
|
var newSocketStatus = tslib_1.__assign(tslib_1.__assign({}, this._linkedConnectionState), statusUpdates);
|
|
112
113
|
this._linkedConnectionState = tslib_1.__assign({}, newSocketStatus);
|
|
113
|
-
this._linkedConnectionStateObserver.next(this._linkedConnectionState);
|
|
114
|
+
(_a = this._linkedConnectionStateObserver) === null || _a === void 0 ? void 0 : _a.next(this._linkedConnectionState);
|
|
114
115
|
};
|
|
115
116
|
/*
|
|
116
117
|
* Translate the ConnectionState structure into a specific ConnectionState string literal union
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Observable from '
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
2
|
import { PubSubContentObserver } from '../../types/PubSub';
|
|
3
3
|
import { SUBSCRIPTION_STATUS } from '../constants';
|
|
4
4
|
import { GraphQLAuthMode } from '@aws-amplify/core/lib-esm/singleton/API/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import Observable from '
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
5
|
import { GraphQLError } from 'graphql';
|
|
6
6
|
import * as url from 'url';
|
|
7
7
|
import { v4 as uuid } from 'uuid';
|