@aws-amplify/api-graphql 4.0.1-api-v6-models.ce6e561.0 → 4.0.1-api-v6-models.572a7b5.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.js +3 -4
- package/lib/internals/InternalGraphQLAPI.js +3 -2
- package/lib/internals/generateModelsProperty.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +5 -6
- package/lib-esm/internals/InternalGraphQLAPI.js +4 -3
- package/lib-esm/internals/generateModelsProperty.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +6 -6
- package/src/internals/InternalGraphQLAPI.ts +4 -4
- package/src/internals/generateModelsProperty.ts +1 -1
|
@@ -4,16 +4,15 @@ import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { GraphQLError } from 'graphql';
|
|
6
6
|
import * as url from 'url';
|
|
7
|
-
import { v4 as uuid } from 'uuid';
|
|
8
7
|
import { Buffer } from 'buffer';
|
|
9
|
-
import { Hub, fetchAuthSession } from '@aws-amplify/core';
|
|
8
|
+
import { Hub, fetchAuthSession, ConsoleLogger } from '@aws-amplify/core';
|
|
10
9
|
import { signRequest } from '@aws-amplify/core/internals/aws-client-utils';
|
|
11
|
-
import {
|
|
10
|
+
import { NonRetryableError, USER_AGENT_HEADER, getAmplifyUserAgent, isNonRetryableError, jitteredExponentialRetry, amplifyUuid, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
|
|
12
11
|
import { CONTROL_MSG, ConnectionState, } from '../../types/PubSub';
|
|
13
12
|
import { AMPLIFY_SYMBOL, AWS_APPSYNC_REALTIME_HEADERS, CONNECTION_INIT_TIMEOUT, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT, MAX_DELAY_MS, MESSAGE_TYPES, NON_RETRYABLE_CODES, SOCKET_STATUS, START_ACK_TIMEOUT, SUBSCRIPTION_STATUS, CONNECTION_STATE_CHANGE, } from '../constants';
|
|
14
13
|
import { ConnectionStateMonitor, CONNECTION_CHANGE, } from '../../utils/ConnectionStateMonitor';
|
|
15
14
|
import { ReconnectEvent, ReconnectionMonitor, } from '../../utils/ReconnectionMonitor';
|
|
16
|
-
var logger = new
|
|
15
|
+
var logger = new ConsoleLogger('AWSAppSyncRealTimeProvider');
|
|
17
16
|
var dispatchApiEvent = function (payload) {
|
|
18
17
|
Hub.dispatch('api', payload, 'PubSub', AMPLIFY_SYMBOL);
|
|
19
18
|
};
|
|
@@ -95,7 +94,7 @@ var AWSAppSyncRealTimeProvider = /** @class */ (function () {
|
|
|
95
94
|
}
|
|
96
95
|
else {
|
|
97
96
|
var subscriptionStartActive_1 = false;
|
|
98
|
-
var subscriptionId_1 =
|
|
97
|
+
var subscriptionId_1 = amplifyUuid();
|
|
99
98
|
var startSubscription_1 = function () {
|
|
100
99
|
if (!subscriptionStartActive_1) {
|
|
101
100
|
subscriptionStartActive_1 = true;
|
|
@@ -776,7 +775,7 @@ var AWSAppSyncRealTimeProvider = /** @class */ (function () {
|
|
|
776
775
|
signed_params = signRequest({
|
|
777
776
|
headers: request.headers,
|
|
778
777
|
method: request.method,
|
|
779
|
-
url: new
|
|
778
|
+
url: new AmplifyUrl(request.url),
|
|
780
779
|
body: request.data,
|
|
781
780
|
}, {
|
|
782
781
|
// TODO: What do we need to do to remove these !'s?
|
|
@@ -2,14 +2,15 @@ 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
4
|
import { print, parse, GraphQLError, } from 'graphql';
|
|
5
|
-
import { ConsoleLogger
|
|
5
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
6
|
+
import { getAmplifyUserAgent, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
|
|
6
7
|
import { GraphQLAuthError, } from '../types';
|
|
7
8
|
import { isCancelError as isCancelErrorREST } from '@aws-amplify/api-rest';
|
|
8
9
|
import { post, cancel as cancelREST, updateRequestToBeCancellable, } from '@aws-amplify/api-rest/internals';
|
|
9
10
|
import { AWSAppSyncRealTimeProvider } from '../Providers/AWSAppSyncRealTimeProvider';
|
|
10
11
|
import { resolveConfig, resolveLibraryOptions } from '../utils';
|
|
11
12
|
var USER_AGENT_HEADER = 'x-amz-user-agent';
|
|
12
|
-
var logger = new
|
|
13
|
+
var logger = new ConsoleLogger('GraphQLAPI');
|
|
13
14
|
export var graphqlOperation = function (query, variables, authToken) {
|
|
14
15
|
if (variables === void 0) { variables = {}; }
|
|
15
16
|
return ({
|
|
@@ -235,7 +236,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
235
236
|
case 9:
|
|
236
237
|
_m.trys.push([9, 12, , 13]);
|
|
237
238
|
return [4 /*yield*/, this._api.post({
|
|
238
|
-
url: new
|
|
239
|
+
url: new AmplifyUrl(endpoint),
|
|
239
240
|
options: {
|
|
240
241
|
headers: headers,
|
|
241
242
|
body: body,
|
|
@@ -100,7 +100,7 @@ export function generateModelsProperty(client, params) {
|
|
|
100
100
|
_b = __read(Object.keys(data), 1), key_2 = _b[0];
|
|
101
101
|
flattenedResult = flattenItems(data)[key_2];
|
|
102
102
|
if (options === null || options === void 0 ? void 0 : options.selectionSet) {
|
|
103
|
-
return [2 /*return*/, flattenedResult];
|
|
103
|
+
return [2 /*return*/, { data: flattenedResult, extensions: extensions }];
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
_c = __read(initializeModel(client, name_1, [flattenedResult], modelIntrospection), 1), initialized = _c[0];
|