@3id/common
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -56,6 +56,59 @@ 'use strict'; | ||
var VALID_NETWORKS = ['dev-unstable', 'testnet-clay', 'mainnet', 'local']; // PRIVATE NODES, could be moved to private package/const later | ||
var DEV_API_URL = 'https://ceramic-private-dev.3boxlabs.com'; | ||
var CLAY_API_URL = 'https://ceramic-private-clay.3boxlabs.com'; | ||
var MAIN_API_URL = 'https://ceramic-private.3boxlabs.com'; | ||
var LOCAL_API_URL = 'http://localhost:7007'; // Base iframe urls by network | ||
var BASE_IFRAME_DEV_URL = 'https://app-dev.3idconnect.org'; | ||
var BASE_IFRAME_CLAY_URL = 'https://app-clay.3idconnect.org'; | ||
var BASE_IFRAME_MAIN_URL = 'https://app.3idconnect.org'; | ||
var BASE_IFRAME_LOCAL_URL = "http://localhost:30001"; | ||
var DEFAULT_IFRAME_MANAGE_PATH = "/management/index.html"; | ||
var CERAMIC_NETWORK_API = { | ||
'dev-unstable': DEV_API_URL, | ||
'testnet-clay': CLAY_API_URL, | ||
'mainnet': MAIN_API_URL, | ||
'local': LOCAL_API_URL | ||
}; | ||
var CERAMIC_NETWORK_IFRAME = { | ||
'dev-unstable': BASE_IFRAME_DEV_URL, | ||
'testnet-clay': BASE_IFRAME_CLAY_URL, | ||
'mainnet': BASE_IFRAME_MAIN_URL, | ||
'local': BASE_IFRAME_LOCAL_URL | ||
}; | ||
var iframeManageUrl = function iframeManageUrl(base) { | ||
return "" + base + DEFAULT_IFRAME_MANAGE_PATH; | ||
}; | ||
var iframeByNetwork = function iframeByNetwork(network) { | ||
return CERAMIC_NETWORK_IFRAME[network]; | ||
}; | ||
var apiByNetwork = function apiByNetwork(network) { | ||
return CERAMIC_NETWORK_API[network]; | ||
}; | ||
var isValidNetwork = function isValidNetwork(network) { | ||
return VALID_NETWORKS.includes(network); | ||
}; | ||
exports.BASE_IFRAME_CLAY_URL = BASE_IFRAME_CLAY_URL; | ||
exports.BASE_IFRAME_DEV_URL = BASE_IFRAME_DEV_URL; | ||
exports.BASE_IFRAME_LOCAL_URL = BASE_IFRAME_LOCAL_URL; | ||
exports.BASE_IFRAME_MAIN_URL = BASE_IFRAME_MAIN_URL; | ||
exports.CERAMIC_NETWORK_API = CERAMIC_NETWORK_API; | ||
exports.CERAMIC_NETWORK_IFRAME = CERAMIC_NETWORK_IFRAME; | ||
exports.CLAY_API_URL = CLAY_API_URL; | ||
exports.DEFAULT_IFRAME_MANAGE_PATH = DEFAULT_IFRAME_MANAGE_PATH; | ||
exports.DEV_API_URL = DEV_API_URL; | ||
exports.LOCAL_API_URL = LOCAL_API_URL; | ||
exports.MAIN_API_URL = MAIN_API_URL; | ||
exports.ThreeIDError = ThreeIDError; | ||
exports.VALID_NETWORKS = VALID_NETWORKS; | ||
exports.apiByNetwork = apiByNetwork; | ||
exports.assert = assert; | ||
exports.fromHex = fromHex; | ||
exports.iframeByNetwork = iframeByNetwork; | ||
exports.iframeManageUrl = iframeManageUrl; | ||
exports.isValidNetwork = isValidNetwork; | ||
exports.toHex = toHex; | ||
//# sourceMappingURL=common.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("errors-utils"),t=require("uint8arrays");function e(r,t){return(e=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r})(r,t)}var n=function(r){var t,n;function o(){return r.apply(this,arguments)||this}return n=r,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,e(t,n),o}(r.createNamespaceError("3ID"));function o(t,e,o){return r.assertAs(t,n,e,o)}o.isDefined=function(r,t){return o(null!=r,2,t)},o.isString=function(r,t){return void 0===t&&(t="Input must be a string"),o("string"==typeof r,3,t)},exports.ThreeIDError=n,exports.assert=o,exports.fromHex=function(r){return t.fromString(r,"base16")},exports.toHex=function(r){return t.toString(r,"base16")}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("errors-utils"),e=require("uint8arrays");function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var o=function(t){var e,o;function n(){return t.apply(this,arguments)||this}return o=t,(e=n).prototype=Object.create(o.prototype),e.prototype.constructor=e,r(e,o),n}(t.createNamespaceError("3ID"));function n(e,r,n){return t.assertAs(e,o,r,n)}n.isDefined=function(t,e){return n(null!=t,2,e)},n.isString=function(t,e){return void 0===e&&(e="Input must be a string"),n("string"==typeof t,3,e)};var s=["dev-unstable","testnet-clay","mainnet","local"],p="https://ceramic-private-dev.3boxlabs.com",a="https://ceramic-private-clay.3boxlabs.com",c={"dev-unstable":p,"testnet-clay":a,mainnet:"https://ceramic-private.3boxlabs.com",local:"http://localhost:7007"},i={"dev-unstable":"https://app-dev.3idconnect.org","testnet-clay":"https://app-clay.3idconnect.org",mainnet:"https://app.3idconnect.org",local:"http://localhost:30001"};exports.BASE_IFRAME_CLAY_URL="https://app-clay.3idconnect.org",exports.BASE_IFRAME_DEV_URL="https://app-dev.3idconnect.org",exports.BASE_IFRAME_LOCAL_URL="http://localhost:30001",exports.BASE_IFRAME_MAIN_URL="https://app.3idconnect.org",exports.CERAMIC_NETWORK_API=c,exports.CERAMIC_NETWORK_IFRAME=i,exports.CLAY_API_URL=a,exports.DEFAULT_IFRAME_MANAGE_PATH="/management/index.html",exports.DEV_API_URL=p,exports.LOCAL_API_URL="http://localhost:7007",exports.MAIN_API_URL="https://ceramic-private.3boxlabs.com",exports.ThreeIDError=o,exports.VALID_NETWORKS=s,exports.apiByNetwork=function(t){return c[t]},exports.assert=n,exports.fromHex=function(t){return e.fromString(t,"base16")},exports.iframeByNetwork=function(t){return i[t]},exports.iframeManageUrl=function(t){return t+"/management/index.html"},exports.isValidNetwork=function(t){return s.includes(t)},exports.toHex=function(t){return e.toString(t,"base16")}; | ||
//# sourceMappingURL=common.cjs.production.min.js.map |
@@ -52,3 +52,40 @@ import { assertAs, createNamespaceError } from 'errors-utils'; | ||
export { ThreeIDError, assert, fromHex, toHex }; | ||
var VALID_NETWORKS = ['dev-unstable', 'testnet-clay', 'mainnet', 'local']; // PRIVATE NODES, could be moved to private package/const later | ||
var DEV_API_URL = 'https://ceramic-private-dev.3boxlabs.com'; | ||
var CLAY_API_URL = 'https://ceramic-private-clay.3boxlabs.com'; | ||
var MAIN_API_URL = 'https://ceramic-private.3boxlabs.com'; | ||
var LOCAL_API_URL = 'http://localhost:7007'; // Base iframe urls by network | ||
var BASE_IFRAME_DEV_URL = 'https://app-dev.3idconnect.org'; | ||
var BASE_IFRAME_CLAY_URL = 'https://app-clay.3idconnect.org'; | ||
var BASE_IFRAME_MAIN_URL = 'https://app.3idconnect.org'; | ||
var BASE_IFRAME_LOCAL_URL = "http://localhost:30001"; | ||
var DEFAULT_IFRAME_MANAGE_PATH = "/management/index.html"; | ||
var CERAMIC_NETWORK_API = { | ||
'dev-unstable': DEV_API_URL, | ||
'testnet-clay': CLAY_API_URL, | ||
'mainnet': MAIN_API_URL, | ||
'local': LOCAL_API_URL | ||
}; | ||
var CERAMIC_NETWORK_IFRAME = { | ||
'dev-unstable': BASE_IFRAME_DEV_URL, | ||
'testnet-clay': BASE_IFRAME_CLAY_URL, | ||
'mainnet': BASE_IFRAME_MAIN_URL, | ||
'local': BASE_IFRAME_LOCAL_URL | ||
}; | ||
var iframeManageUrl = function iframeManageUrl(base) { | ||
return "" + base + DEFAULT_IFRAME_MANAGE_PATH; | ||
}; | ||
var iframeByNetwork = function iframeByNetwork(network) { | ||
return CERAMIC_NETWORK_IFRAME[network]; | ||
}; | ||
var apiByNetwork = function apiByNetwork(network) { | ||
return CERAMIC_NETWORK_API[network]; | ||
}; | ||
var isValidNetwork = function isValidNetwork(network) { | ||
return VALID_NETWORKS.includes(network); | ||
}; | ||
export { BASE_IFRAME_CLAY_URL, BASE_IFRAME_DEV_URL, BASE_IFRAME_LOCAL_URL, BASE_IFRAME_MAIN_URL, CERAMIC_NETWORK_API, CERAMIC_NETWORK_IFRAME, CLAY_API_URL, DEFAULT_IFRAME_MANAGE_PATH, DEV_API_URL, LOCAL_API_URL, MAIN_API_URL, ThreeIDError, VALID_NETWORKS, apiByNetwork, assert, fromHex, iframeByNetwork, iframeManageUrl, isValidNetwork, toHex }; | ||
//# sourceMappingURL=common.esm.js.map |
export { ThreeIDError, assert } from './errors'; | ||
export * from './types'; | ||
export * from './utils'; | ||
export * from './network'; |
@@ -34,1 +34,2 @@ /// <reference types="node" /> | ||
export declare type DIDLinksList = Record<string, AccountsList>; | ||
export declare type Network = 'dev-unstable' | 'testnet-clay' | 'mainnet' | 'local'; |
{ | ||
"name": "@3id/common", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"author": "Ceramic Studio", | ||
@@ -5,0 +5,0 @@ "license": "(Apache-2.0 OR MIT)", |
Sorry, the diff of this file is not supported yet
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
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
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
27263
14
271
0