@aws-amplify/api-graphql 4.0.1-console-preview.8f82e46.0 → 4.0.1-console-preview.b278dcb.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.
@@ -3,16 +3,15 @@ import { __assign, __awaiter, __generator, __read } from "tslib";
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import { Observable } from 'rxjs';
5
5
  import { GraphQLError } from 'graphql';
6
- import * as url from 'url';
7
6
  import { Buffer } from 'buffer';
8
- import { Hub, fetchAuthSession } from '@aws-amplify/core';
7
+ import { Hub, fetchAuthSession, ConsoleLogger } from '@aws-amplify/core';
9
8
  import { signRequest } from '@aws-amplify/core/internals/aws-client-utils';
10
- import { Logger, NonRetryableError, USER_AGENT_HEADER, getAmplifyUserAgent, isNonRetryableError, jitteredExponentialRetry, amplifyUuid, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
9
+ import { NonRetryableError, USER_AGENT_HEADER, getAmplifyUserAgent, isNonRetryableError, jitteredExponentialRetry, amplifyUuid, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
11
10
  import { CONTROL_MSG, ConnectionState, } from '../../types/PubSub';
12
11
  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';
13
12
  import { ConnectionStateMonitor, CONNECTION_CHANGE, } from '../../utils/ConnectionStateMonitor';
14
13
  import { ReconnectEvent, ReconnectionMonitor, } from '../../utils/ReconnectionMonitor';
15
- var logger = new Logger('AWSAppSyncRealTimeProvider');
14
+ var logger = new ConsoleLogger('AWSAppSyncRealTimeProvider');
16
15
  var dispatchApiEvent = function (payload) {
17
16
  Hub.dispatch('api', payload, 'PubSub', AMPLIFY_SYMBOL);
18
17
  };
@@ -697,7 +696,9 @@ var AWSAppSyncRealTimeProvider = /** @class */ (function () {
697
696
  return [2 /*return*/, undefined];
698
697
  case 1:
699
698
  handler = headerHandler[authenticationType];
700
- host = url.parse(appSyncGraphqlEndpoint !== null && appSyncGraphqlEndpoint !== void 0 ? appSyncGraphqlEndpoint : '').host;
699
+ host = appSyncGraphqlEndpoint
700
+ ? new AmplifyUrl(appSyncGraphqlEndpoint).host
701
+ : undefined;
701
702
  logger.debug("Authenticating with " + JSON.stringify(authenticationType));
702
703
  resolvedApiKey = void 0;
703
704
  if (authenticationType === 'apiKey') {
@@ -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 as Logger, getAmplifyUserAgent, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
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 Logger('GraphQLAPI');
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 ({