aws-appsync-subscription-link
Advanced tools
Comparing version 2.2.1 to 3.0.1
import { AUTH_TYPE } from "aws-appsync-auth-link"; | ||
import { execute } from "apollo-link"; | ||
import { execute } from "@apollo/client"; | ||
import gql from 'graphql-tag'; | ||
@@ -78,3 +78,3 @@ import { AppSyncRealTimeSubscriptionHandshakeLink } from '../../src/realtime-subscription-handshake-link'; | ||
}); | ||
execute(link, { query }).subscribe({ | ||
@@ -116,3 +116,3 @@ error: (err) => { | ||
}); | ||
execute(link, { query }).subscribe({ | ||
@@ -154,3 +154,3 @@ error: (err) => { | ||
}); | ||
execute(link, { query }).subscribe({ | ||
@@ -157,0 +157,0 @@ error: (err) => { |
import { CONTROL_EVENTS_KEY } from "./subscription-handshake-link"; | ||
import { ApolloLink } from "apollo-link"; | ||
import { ApolloLink } from "@apollo/client"; | ||
import { UrlInfo } from "./types"; | ||
@@ -4,0 +4,0 @@ declare function createSubscriptionHandshakeLink(args: UrlInfo, resultsFetcherLink?: ApolloLink): ApolloLink; |
@@ -16,4 +16,3 @@ "use strict"; | ||
exports.CONTROL_EVENTS_KEY = subscription_handshake_link_1.CONTROL_EVENTS_KEY; | ||
var apollo_link_1 = require("apollo-link"); | ||
var apollo_link_http_1 = require("apollo-link-http"); | ||
var client_1 = require("@apollo/client"); | ||
var apollo_utilities_1 = require("apollo-utilities"); | ||
@@ -26,7 +25,7 @@ var non_terminating_link_1 = require("./non-terminating-link"); | ||
resultsFetcherLink = | ||
theResultsFetcherLink || apollo_link_http_1.createHttpLink({ uri: infoOrUrl }); | ||
subscriptionLinks = apollo_link_1.ApolloLink.from([ | ||
theResultsFetcherLink || client_1.createHttpLink({ uri: infoOrUrl }); | ||
subscriptionLinks = client_1.ApolloLink.from([ | ||
new non_terminating_link_1.NonTerminatingLink("controlMessages", { | ||
link: new apollo_link_1.ApolloLink(function (operation, _forward) { | ||
return new apollo_link_1.Observable(function (observer) { | ||
link: new client_1.ApolloLink(function (operation, _forward) { | ||
return new client_1.Observable(function (observer) { | ||
var _a; | ||
@@ -48,6 +47,6 @@ var _b = operation.variables, _c = subscription_handshake_link_1.CONTROL_EVENTS_KEY, controlEvents = _b[_c], variables = __rest(_b, [typeof _c === "symbol" ? _c : _c + ""]); | ||
var url = infoOrUrl.url; | ||
resultsFetcherLink = theResultsFetcherLink || apollo_link_http_1.createHttpLink({ uri: url }); | ||
resultsFetcherLink = theResultsFetcherLink || client_1.createHttpLink({ uri: url }); | ||
subscriptionLinks = new realtime_subscription_handshake_link_1.AppSyncRealTimeSubscriptionHandshakeLink(infoOrUrl); | ||
} | ||
return apollo_link_1.ApolloLink.split(function (operation) { | ||
return client_1.ApolloLink.split(function (operation) { | ||
var query = operation.query; | ||
@@ -54,0 +53,0 @@ var _a = apollo_utilities_1.getMainDefinition(query), kind = _a.kind, graphqlOperation = _a.operation; |
@@ -5,6 +5,6 @@ /*! | ||
*/ | ||
import { FetchOptions } from 'apollo-link-http'; | ||
import { HttpOptions } from '@apollo/client'; | ||
import { NonTerminatingLink } from './non-terminating-link'; | ||
export declare class NonTerminatingHttpLink extends NonTerminatingLink { | ||
constructor(contextKey: string, options: FetchOptions); | ||
constructor(contextKey: string, options: HttpOptions); | ||
} |
@@ -20,3 +20,3 @@ "use strict"; | ||
*/ | ||
var apollo_link_http_1 = require("apollo-link-http"); | ||
var client_1 = require("@apollo/client"); | ||
var non_terminating_link_1 = require("./non-terminating-link"); | ||
@@ -27,3 +27,3 @@ var NonTerminatingHttpLink = /** @class */ (function (_super) { | ||
var _this = this; | ||
var link = apollo_link_http_1.createHttpLink(options); | ||
var link = client_1.createHttpLink(options); | ||
_this = _super.call(this, contextKey, { link: link }) || this; | ||
@@ -30,0 +30,0 @@ return _this; |
@@ -5,3 +5,3 @@ /*! | ||
*/ | ||
import { ApolloLink, NextLink } from 'apollo-link'; | ||
import { ApolloLink, NextLink } from '@apollo/client'; | ||
export declare class NonTerminatingLink extends ApolloLink { | ||
@@ -13,5 +13,3 @@ private contextKey; | ||
}); | ||
request(operation: any, forward?: NextLink): import("apollo-link").Observable<import("apollo-link").FetchResult<{ | ||
[key: string]: any; | ||
}, Record<string, any>, Record<string, any>>>; | ||
request(operation: any, forward?: NextLink): any; | ||
} |
@@ -67,4 +67,4 @@ "use strict"; | ||
*/ | ||
var apollo_link_1 = require("apollo-link"); | ||
var apollo_link_context_1 = require("apollo-link-context"); | ||
var client_1 = require("@apollo/client"); | ||
var context_1 = require("@apollo/client/link/context"); | ||
var NonTerminatingLink = /** @class */ (function (_super) { | ||
@@ -81,3 +81,3 @@ __extends(NonTerminatingLink, _super); | ||
var _this = this; | ||
return apollo_link_context_1.setContext(function (_request, prevContext) { return __awaiter(_this, void 0, void 0, function () { | ||
return context_1.setContext(function (_request, prevContext) { return __awaiter(_this, void 0, void 0, function () { | ||
var result; | ||
@@ -102,3 +102,3 @@ var _a; | ||
return NonTerminatingLink; | ||
}(apollo_link_1.ApolloLink)); | ||
}(client_1.ApolloLink)); | ||
exports.NonTerminatingLink = NonTerminatingLink; |
@@ -5,3 +5,3 @@ /*! | ||
*/ | ||
import { ApolloLink, Observable, Operation } from "apollo-link"; | ||
import { ApolloLink, Operation } from "@apollo/client"; | ||
import { UrlInfo } from "./types"; | ||
@@ -20,3 +20,3 @@ export declare const CONTROL_EVENTS_KEY = "@@controlEvents"; | ||
constructor({ url: theUrl, region: theRegion, auth: theAuth }: UrlInfo); | ||
request(operation: Operation): Observable<any>; | ||
request(operation: Operation): any; | ||
private _verifySubscriptionAlreadyStarted; | ||
@@ -23,0 +23,0 @@ private _sendUnsubscriptionMessage; |
@@ -67,3 +67,3 @@ "use strict"; | ||
*/ | ||
var apollo_link_1 = require("apollo-link"); | ||
var client_1 = require("@apollo/client"); | ||
var utils_1 = require("./utils"); | ||
@@ -118,3 +118,3 @@ var aws_appsync_auth_link_1 = require("aws-appsync-auth-link"); | ||
_a) : _c)[_d], headers = _b.headers; | ||
return new apollo_link_1.Observable(function (observer) { | ||
return new client_1.Observable(function (observer) { | ||
var subscriptionId = uuid_1.v4(); | ||
@@ -734,3 +734,3 @@ var options = { | ||
return AppSyncRealTimeSubscriptionHandshakeLink; | ||
}(apollo_link_1.ApolloLink)); | ||
}(client_1.ApolloLink)); | ||
exports.AppSyncRealTimeSubscriptionHandshakeLink = AppSyncRealTimeSubscriptionHandshakeLink; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="zen-observable" /> | ||
/*! | ||
@@ -6,3 +5,3 @@ * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
*/ | ||
import { ApolloLink, Observable, Operation, FetchResult } from "apollo-link"; | ||
import { ApolloLink, Operation, FetchResult } from "@apollo/client"; | ||
declare type MqttConnectionInfo = { | ||
@@ -19,3 +18,3 @@ client: string; | ||
constructor(subsInfoContextKey: any); | ||
request(operation: Operation): Observable<any>; | ||
request(operation: Operation): any; | ||
connectNewClients(connectionInfo: MqttConnectionInfo[], observer: ZenObservable.Observer<FetchResult>, operation: Operation): Promise<any[]>; | ||
@@ -22,0 +21,0 @@ connectNewClient(connectionInfo: MqttConnectionInfo, observer: ZenObservable.Observer<FetchResult>, selectionNames: string[]): Promise<any>; |
@@ -78,6 +78,5 @@ "use strict"; | ||
*/ | ||
var apollo_link_1 = require("apollo-link"); | ||
var client_1 = require("@apollo/client"); | ||
var utils_1 = require("./utils"); | ||
var Paho = require("./vendor/paho-mqtt"); | ||
var apollo_client_1 = require("apollo-client"); | ||
var apollo_utilities_1 = require("apollo-utilities"); | ||
@@ -116,4 +115,4 @@ var logger = utils_1.rootLogger.extend('subscriptions'); | ||
if (errors && errors.length) { | ||
return new apollo_link_1.Observable(function (observer) { | ||
observer.error(new apollo_client_1.ApolloError({ | ||
return new client_1.Observable(function (observer) { | ||
observer.error(new client_1.ApolloError({ | ||
errorMessage: 'Error during subscription handshake', | ||
@@ -129,3 +128,3 @@ extraInfo: { errors: errors }, | ||
var newTopics = new Set(newSubscriptionTopics.filter(function (t) { return !existingTopicsWithObserver.has(t); })); | ||
return new apollo_link_1.Observable(function (observer) { | ||
return new client_1.Observable(function (observer) { | ||
existingTopicsWithObserver.forEach(function (t) { | ||
@@ -275,3 +274,3 @@ _this.topicObservers.get(t).add(observer); | ||
return SubscriptionHandshakeLink; | ||
}(apollo_link_1.ApolloLink)); | ||
}(client_1.ApolloLink)); | ||
exports.SubscriptionHandshakeLink = SubscriptionHandshakeLink; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="zen-observable" /> | ||
import { AuthOptions } from "aws-appsync-auth-link"; | ||
@@ -3,0 +2,0 @@ export declare enum SUBSCRIPTION_STATUS { |
{ | ||
"name": "aws-appsync-subscription-link", | ||
"version": "2.2.1", | ||
"version": "3.0.1", | ||
"main": "lib/index.js", | ||
@@ -22,6 +22,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"apollo-link": "1.2.5", | ||
"apollo-link-context": "1.0.11", | ||
"apollo-link-http": "1.5.8", | ||
"apollo-link-retry": "2.2.7", | ||
"@apollo/client": "^3.2.0", | ||
"aws-appsync-auth-link": "^2.0.3", | ||
@@ -35,4 +32,4 @@ "debug": "2.6.9", | ||
"peerDependencies": { | ||
"apollo-client": "2.x" | ||
"@apollo/client": "3.x" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
5
271784
6075
1
+ Added@apollo/client@^3.2.0
+ Added@apollo/client@3.12.6(transitive)
+ Added@graphql-typed-document-node/core@3.2.0(transitive)
+ Added@wry/caches@1.0.1(transitive)
+ Added@wry/context@0.7.4(transitive)
+ Added@wry/equality@0.5.7(transitive)
+ Added@wry/trie@0.5.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedgraphql@16.10.0(transitive)
+ Addedgraphql-tag@2.12.6(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedoptimism@0.18.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrehackt@0.1.0(transitive)
+ Addedresponse-iterator@0.2.16(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsymbol-observable@4.0.0(transitive)
+ Addedts-invariant@0.10.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedzen-observable-ts@1.2.5(transitive)
- Removedapollo-link@1.2.5
- Removedapollo-link-context@1.0.11
- Removedapollo-link-http@1.5.8
- Removedapollo-link-retry@2.2.7
- Removed@types/zen-observable@0.8.00.8.7(transitive)
- Removedapollo-cache@1.3.5(transitive)
- Removedapollo-client@2.6.10(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-link-context@1.0.11(transitive)
- Removedapollo-link-http@1.5.8(transitive)
- Removedapollo-link-http-common@0.2.16(transitive)
- Removedapollo-link-retry@2.2.7(transitive)
- Removedsymbol-observable@1.2.0(transitive)