@subql/apollo-links
Advanced tools
Comparing version 1.0.4 to 1.0.5-0
@@ -94,3 +94,3 @@ "use strict"; | ||
async getPlanRequestParams() { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c; | ||
const nextPlan = await this.orderManager.getNextPlan(); | ||
@@ -109,9 +109,8 @@ if (!nextPlan) | ||
}); | ||
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.debug(`state signature: ${signedState}`); | ||
const authorization = JSON.stringify(signedState); | ||
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.debug(`request new state signature for indexer ${indexer} success`); | ||
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.debug(`request new state signature for indexer ${indexer} success`); | ||
const { authorization } = signedState; | ||
return { data: { authorization, url, type } }; | ||
} | ||
catch (error) { | ||
(_d = this.logger) === null || _d === void 0 ? void 0 : _d.debug(`request new state signature for indexer ${indexer} failed`); | ||
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.debug(`request new state signature for indexer ${indexer} failed`); | ||
return { error: { indexer: nextPlan.indexer, message: error.message } }; | ||
@@ -118,0 +117,0 @@ } |
@@ -28,1 +28,4 @@ export declare enum ProjectType { | ||
}; | ||
export declare type ChannelAuth = { | ||
authorization: string; | ||
}; |
{ | ||
"name": "@subql/apollo-links", | ||
"version": "1.0.4", | ||
"version": "1.0.5-0", | ||
"description": "SubQuery Network - graphql links", | ||
@@ -30,3 +30,3 @@ "main": "dist/index.js", | ||
}, | ||
"stableVersion": "1.0.2" | ||
"stableVersion": "1.0.4" | ||
} |
@@ -8,3 +8,3 @@ // Copyright 2020-2022 SubQuery Pte Ltd authors & contributors | ||
import { isTokenExpired } from '../auth/authHelper'; | ||
import { ChannelState, OrderType } from '../types'; | ||
import { ChannelAuth, OrderType } from '../types'; | ||
import { Logger } from '../utils/logger'; | ||
@@ -137,3 +137,3 @@ import OrderMananger from '../utils/orderManager'; | ||
const tokenUrl = new URL('/channel/sign', authUrl); | ||
const signedState = await POST<ChannelState>(tokenUrl.toString(), { | ||
const signedState = await POST<ChannelAuth>(tokenUrl.toString(), { | ||
deployment, | ||
@@ -143,6 +143,4 @@ channelId, | ||
this.logger?.debug(`state signature: ${signedState}`); | ||
const authorization = JSON.stringify(signedState); | ||
this.logger?.debug(`request new state signature for indexer ${indexer} success`); | ||
const { authorization } = signedState; | ||
return { data: { authorization, url, type } }; | ||
@@ -149,0 +147,0 @@ } catch (error) { |
@@ -36,1 +36,5 @@ // Copyright 2020-2022 SubQuery Pte Ltd authors & contributors | ||
}; | ||
export type ChannelAuth = { | ||
authorization: string; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1937
205149
2