@agconnect/instance
Advanced tools
Comparing version 1.2.0 to 1.2.1-beta
import { AGCInstance } from '@agconnect/instance-types'; | ||
import '@agconnect/log'; | ||
import { AGCApi } from '@agconnect/api-types'; | ||
@@ -3,0 +4,0 @@ declare module '@agconnect/api-types' { |
@@ -1,1 +0,1 @@ | ||
import t from"@agconnect/api";import{DEFAULT_CATEGORY as e,Singleton as o}from"@agconnect/core";var n=function(){function t(t,o){this._config=null,this._customCredentialsProvider=null,this._customAuthProvider=null,this.cryptImpl=void 0,this.repo_=t,this.name_=o||e}return t.prototype.name=function(){return this.name_},t.prototype.configInstance=function(t){return this._config=t,this},t.prototype.config=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");return this._config},t.prototype.setApiKey=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.api_key=t)},t.prototype.setClientSecret=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_secret=t)},t.prototype.setClientId=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_id=t)},t.prototype.getService=function(t){return this.repo_.getService(t,this,this.name_)},t.prototype.setCustomCredentialsProvider=function(t){return t?t.getToken?1!=t.getToken.length?(console.error("the customCredentialsProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customCredentialsProvider=t,!0):(console.error("the customCredentialsProvider must contain getToken method."),!1):(this._customCredentialsProvider=t,!0)},t.prototype.setCustomAuthProvider=function(t){return t?t.getToken?1!=t.getToken.length?(console.error("the customAuthProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customAuthProvider=t,!0):(console.error("the customAuthProvider must contain getToken method."),!1):(this._customAuthProvider=t,!0)},t.prototype.getCustomCredentialsProvider=function(){return this._customCredentialsProvider},t.prototype.getCustomAuthProvider=function(){return this._customAuthProvider},t.prototype.setCryptImp=function(t){return t?t.decrypt&&t.encrypt?(this.cryptImpl=t,!0):(console.error("the crypt is not exist necessary methods."),!1):(console.error("the crypt is not available."),!1)},t.prototype.getCryptImp=function(){return this.cryptImpl},t.prototype.checkBeforeSetKey=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");if(!this._config.hasOwnProperty("client"))throw new Error("AGCInstance config value should contain key: client.")},t}(),r=new o((function(){return new n(t)}));t.registerApiProvider("instance",(function(){return r.get()})); | ||
import t from"@agconnect/api";import{DEFAULT_CATEGORY as e,Singleton as n}from"@agconnect/core";import{Logger as o}from"@agconnect/log";var r=o.createLogger("agconnectInstance"),i=function(){function t(t,n){this.appVersion="",this._config=null,this._customCredentialsProvider=null,this._customAuthProvider=null,this.cryptImpl=void 0,this.repo_=t,this.name_=n||e}return t.prototype.name=function(){return this.name_},t.prototype.configInstance=function(t){return this._config=t,this},t.prototype.config=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");return this._config},t.prototype.setApiKey=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.api_key=t)},t.prototype.setClientSecret=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_secret=t)},t.prototype.setClientId=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_id=t)},t.prototype.getService=function(t){return this.repo_.getService(t,this,this.name_)},t.prototype.setCustomCredentialsProvider=function(t){return t?t.getToken?1!=t.getToken.length?(r.error("the customCredentialsProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customCredentialsProvider=t,!0):(r.error("the customCredentialsProvider must contain getToken method."),!1):(this._customCredentialsProvider=t,!0)},t.prototype.setCustomAuthProvider=function(t){return t?t.getToken?1!=t.getToken.length?(r.error("the customAuthProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customAuthProvider=t,!0):(r.error("the customAuthProvider must contain getToken method."),!1):(this._customAuthProvider=t,!0)},t.prototype.getCustomCredentialsProvider=function(){return this._customCredentialsProvider},t.prototype.getCustomAuthProvider=function(){return this._customAuthProvider},t.prototype.setCryptImp=function(t){return t?t.decrypt&&t.encrypt?(this.cryptImpl=t,!0):(r.error("the crypt is not exist necessary methods."),!1):(r.error("the crypt is not available."),!1)},t.prototype.setAppVersion=function(t){this.appVersion=t},t.prototype.getAppVersion=function(){return this.appVersion},t.prototype.getCryptImp=function(){return this.cryptImpl},t.prototype.checkBeforeSetKey=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");if(!this._config.hasOwnProperty("client"))throw new Error("AGCInstance config value should contain key: client.")},t}(),c=new n((function(){return new i(t)}));t.registerApiProvider("instance",(function(){return c.get()})); |
@@ -1,1 +0,1 @@ | ||
"use strict";var t=require("@agconnect/api"),e=require("@agconnect/core");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(t),r=function(){function t(t,n){this._config=null,this._customCredentialsProvider=null,this._customAuthProvider=null,this.cryptImpl=void 0,this.repo_=t,this.name_=n||e.DEFAULT_CATEGORY}return t.prototype.name=function(){return this.name_},t.prototype.configInstance=function(t){return this._config=t,this},t.prototype.config=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");return this._config},t.prototype.setApiKey=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.api_key=t)},t.prototype.setClientSecret=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_secret=t)},t.prototype.setClientId=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_id=t)},t.prototype.getService=function(t){return this.repo_.getService(t,this,this.name_)},t.prototype.setCustomCredentialsProvider=function(t){return t?t.getToken?1!=t.getToken.length?(console.error("the customCredentialsProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customCredentialsProvider=t,!0):(console.error("the customCredentialsProvider must contain getToken method."),!1):(this._customCredentialsProvider=t,!0)},t.prototype.setCustomAuthProvider=function(t){return t?t.getToken?1!=t.getToken.length?(console.error("the customAuthProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customAuthProvider=t,!0):(console.error("the customAuthProvider must contain getToken method."),!1):(this._customAuthProvider=t,!0)},t.prototype.getCustomCredentialsProvider=function(){return this._customCredentialsProvider},t.prototype.getCustomAuthProvider=function(){return this._customAuthProvider},t.prototype.setCryptImp=function(t){return t?t.decrypt&&t.encrypt?(this.cryptImpl=t,!0):(console.error("the crypt is not exist necessary methods."),!1):(console.error("the crypt is not available."),!1)},t.prototype.getCryptImp=function(){return this.cryptImpl},t.prototype.checkBeforeSetKey=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");if(!this._config.hasOwnProperty("client"))throw new Error("AGCInstance config value should contain key: client.")},t}(),i=new e.Singleton((function(){return new r(o.default)}));o.default.registerApiProvider("instance",(function(){return i.get()})); | ||
"use strict";var t=require("@agconnect/api"),e=require("@agconnect/core"),n=require("@agconnect/log");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=o(t),i=n.Logger.createLogger("agconnectInstance"),c=function(){function t(t,n){this.appVersion="",this._config=null,this._customCredentialsProvider=null,this._customAuthProvider=null,this.cryptImpl=void 0,this.repo_=t,this.name_=n||e.DEFAULT_CATEGORY}return t.prototype.name=function(){return this.name_},t.prototype.configInstance=function(t){return this._config=t,this},t.prototype.config=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");return this._config},t.prototype.setApiKey=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.api_key=t)},t.prototype.setClientSecret=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_secret=t)},t.prototype.setClientId=function(t){this.checkBeforeSetKey(),null!=this._config&&(this._config.client.client_id=t)},t.prototype.getService=function(t){return this.repo_.getService(t,this,this.name_)},t.prototype.setCustomCredentialsProvider=function(t){return t?t.getToken?1!=t.getToken.length?(i.error("the customCredentialsProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customCredentialsProvider=t,!0):(i.error("the customCredentialsProvider must contain getToken method."),!1):(this._customCredentialsProvider=t,!0)},t.prototype.setCustomAuthProvider=function(t){return t?t.getToken?1!=t.getToken.length?(i.error("the customAuthProvider getToken method must contain single parameter:forceRefresh."),!1):(this._customAuthProvider=t,!0):(i.error("the customAuthProvider must contain getToken method."),!1):(this._customAuthProvider=t,!0)},t.prototype.getCustomCredentialsProvider=function(){return this._customCredentialsProvider},t.prototype.getCustomAuthProvider=function(){return this._customAuthProvider},t.prototype.setCryptImp=function(t){return t?t.decrypt&&t.encrypt?(this.cryptImpl=t,!0):(i.error("the crypt is not exist necessary methods."),!1):(i.error("the crypt is not available."),!1)},t.prototype.setAppVersion=function(t){this.appVersion=t},t.prototype.getAppVersion=function(){return this.appVersion},t.prototype.getCryptImp=function(){return this.cryptImpl},t.prototype.checkBeforeSetKey=function(){if(null==this._config)throw new Error("AGCInstance not configurated. call agconnect.instance().configInstance() to configure the agconnect.");if(!this._config.hasOwnProperty("client"))throw new Error("AGCInstance config value should contain key: client.")},t}(),s=new e.Singleton((function(){return new c(r.default)}));r.default.registerApiProvider("instance",(function(){return s.get()})); |
import { AGCInstance, AGConnectServicesConfig, crypt } from '@agconnect/instance-types'; | ||
import { ServiceRepository } from '@agconnect/api-types'; | ||
export declare class AGCInstanceImpl implements AGCInstance { | ||
import { Logger } from "@agconnect/log"; | ||
declare let instanceLogger: Logger; | ||
declare class AGCInstanceImpl implements AGCInstance { | ||
repo_: ServiceRepository; | ||
name_: string; | ||
private appVersion; | ||
private _config; | ||
@@ -23,4 +26,7 @@ private _customCredentialsProvider; | ||
setCryptImp(cryptImpl: crypt): boolean; | ||
setAppVersion(version: string): void; | ||
getAppVersion(): string; | ||
getCryptImp(): any; | ||
private checkBeforeSetKey; | ||
} | ||
export { instanceLogger, AGCInstanceImpl }; |
{ | ||
"name": "@agconnect/instance", | ||
"version": "1.2.0", | ||
"version": "1.2.1-beta", | ||
"main": "./dist/index.node.cjs.js", | ||
"module": "./dist/index.esm.js", | ||
"description": "@agconnect/instance", | ||
"author": " ", | ||
"author": "https://developer.huawei.com/", | ||
"license": "ISC", | ||
@@ -28,9 +28,8 @@ "scripts": { | ||
"dependencies": { | ||
"@agconnect/api": "1.2.0", | ||
"@agconnect/api-types": "1.2.0", | ||
"@agconnect/core": "1.2.0", | ||
"@agconnect/instance-types": "1.2.0", | ||
"@agconnect/storage": "1.2.0", | ||
"@agconnect/storage-types": "1.2.0" | ||
"@agconnect/api": "1.2.1-beta", | ||
"@agconnect/api-types": "1.2.1-beta", | ||
"@agconnect/core": "1.2.1-beta", | ||
"@agconnect/instance-types": "1.2.1-beta", | ||
"@agconnect/log": "1.2.1-beta" | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8303
5
65
3
+ Added@agconnect/log@1.2.1-beta
+ Added@agconnect/api@1.2.1-beta(transitive)
+ Added@agconnect/api-types@1.2.1-beta(transitive)
+ Added@agconnect/core@1.2.1-beta(transitive)
+ Added@agconnect/instance-types@1.2.1-beta(transitive)
+ Added@agconnect/log@1.2.1-beta(transitive)
- Removed@agconnect/storage@1.2.0
- Removed@agconnect/storage-types@1.2.0
- Removed@agconnect/api@1.2.0(transitive)
- Removed@agconnect/api-types@1.2.0(transitive)
- Removed@agconnect/core@1.2.0(transitive)
- Removed@agconnect/instance-types@1.2.0(transitive)
- Removed@agconnect/storage@1.2.0(transitive)
- Removed@agconnect/storage-types@1.2.0(transitive)
Updated@agconnect/api@1.2.1-beta
Updated@agconnect/core@1.2.1-beta