@perspect3vism/ad4m-connect
Advanced tools
Comparing version 0.2.16 to 0.3.0
@@ -1,2 +0,2 @@ | ||
export default function CapNotMatchedFirst({ capabilities, appname, appiconpath, changeState, requestCapability, }: { | ||
export default function CapNotMatchedFirst({ capabilities, appname, appiconpath, changeState, setOpen, requestCapability, }: { | ||
capabilities: any; | ||
@@ -6,3 +6,4 @@ appname: any; | ||
changeState: any; | ||
setOpen: any; | ||
requestCapability: any; | ||
}): import("lit-html").TemplateResult<1>; |
import { ApolloClient, NormalizedCacheObject } from "@apollo/client/core"; | ||
import { Client as WSClient } from "graphql-ws"; | ||
import { Ad4mClient } from "@perspect3vism/ad4m"; | ||
import { Ad4mClient, CapabilityInput } from "@perspect3vism/ad4m"; | ||
export type Ad4mConnectOptions = { | ||
@@ -8,6 +8,5 @@ appName: string; | ||
appDomain: string; | ||
appUrl?: string; | ||
appIconPath?: string; | ||
capabilities: { | ||
[x: string]: any; | ||
}[]; | ||
capabilities: CapabilityInput[]; | ||
dataPath?: string; | ||
@@ -23,2 +22,4 @@ port?: number; | ||
export default class Ad4mConnect { | ||
activeSocket: WebSocket; | ||
requestedRestart: boolean; | ||
authState: AuthStates; | ||
@@ -32,12 +33,11 @@ connectionState: ConnectionStates; | ||
token: string; | ||
isFullyInitialized: boolean; | ||
port: number; | ||
capabilities: { | ||
[x: string]: any; | ||
}[]; | ||
capabilities: CapabilityInput[]; | ||
appName: string; | ||
appDesc: string; | ||
appDomain: string; | ||
appIconPath: string; | ||
appUrl?: string; | ||
listeners: Record<Event, Function[]>; | ||
constructor({ appName, appDesc, appDomain, capabilities, port, token, url, }: Ad4mConnectOptions); | ||
constructor({ appName, appDesc, appIconPath, appUrl, appDomain, capabilities, port, token, url, }: Ad4mConnectOptions); | ||
private notifyConfigChange; | ||
@@ -50,10 +50,10 @@ private notifyConnectionChange; | ||
on(event: Event, cb: Function): void; | ||
connect(url?: string): Promise<void>; | ||
checkConnection(): Promise<void>; | ||
connectToPort(): Promise<void>; | ||
connect(url?: string): Promise<Ad4mClient>; | ||
connectToPort(port?: number): Promise<Ad4mClient>; | ||
ensureConnection(): Promise<Ad4mClient>; | ||
findPort(): Promise<number>; | ||
buildClient(): Promise<void>; | ||
checkAuth(): Promise<void>; | ||
requestCapability(invalidateToken?: boolean): Promise<void>; | ||
verifyCode(code: string): Promise<void>; | ||
buildClient(): Ad4mClient; | ||
checkAuth(): Promise<boolean>; | ||
requestCapability(invalidateToken?: boolean): Promise<string>; | ||
verifyCode(code: string): Promise<string>; | ||
} |
@@ -6,3 +6,2 @@ import { Ad4mClient } from "@perspect3vism/ad4m"; | ||
export declare function onAuthStateChanged(callback: any): void; | ||
export declare function isConnected(): any; | ||
export declare function detectOS(): string; |
@@ -1,1 +0,1 @@ | ||
var a=(e,t,n)=>new Promise((o,c)=>{var s=r=>{try{i(n.next(r))}catch(u){c(u)}},l=r=>{try{i(n.throw(r))}catch(u){c(u)}},i=r=>r.done?o(r.value):Promise.resolve(r.value).then(s,l);i((n=n.apply(e,t)).next())});function m(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function f(e,t=5e3){return a(this,null,function*(){return Promise.race([new Promise((n,o)=>{let c=new WebSocket(e);c.onopen=()=>{n(c)},c.onerror=s=>{o(s)}}),new Promise((n,o)=>{setTimeout(()=>{o(new Error("WebSocket connection timed out"))},t)})])})}function h(e){return a(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:m().signal,mode:"no-cors"});return t.status===400||t.status===0?e:null}catch(t){return null}})}function S(){return new Promise((e,t)=>{let n=document.querySelector("ad4m-connect"),o=n==null?void 0:n.getAd4mClient();o?e(o):t("No Ad4mClient found")})}function g(e){let t=document.querySelector("ad4m-connect");t==null||t.addEventListener("authstatechange",n=>{e(n.detail)})}function p(){return document.querySelector("ad4m-connect").connected()}function w(){let e=navigator.userAgent,t="";return e.search("Windows")!==-1?t="Windows":e.search("Mac")!==-1?t="MacOS":e.search("X11")!==-1&&e.search("Linux")===-1?t="UNIX":e.search("Linux")!==-1&&e.search("X11")!==-1&&(t="Linux"),t}export{h as checkPort,f as connectWebSocket,w as detectOS,S as getAd4mClient,p as isConnected,g as onAuthStateChanged}; | ||
var u=(e,t,n)=>new Promise((o,c)=>{var s=r=>{try{i(n.next(r))}catch(a){c(a)}},l=r=>{try{i(n.throw(r))}catch(a){c(a)}},i=r=>r.done?o(r.value):Promise.resolve(r.value).then(s,l);i((n=n.apply(e,t)).next())});function m(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function h(e,t=5e3){return u(this,null,function*(){return Promise.race([new Promise((n,o)=>{let c=new WebSocket(e);c.onopen=()=>{n(c)},c.onerror=s=>{o(s)}}),new Promise((n,o)=>{setTimeout(()=>{o(new Error("WebSocket connection timed out"))},t)})])})}function f(e){return u(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:m().signal,mode:"no-cors"});if(t.status===400||t.status===0)return e;throw new Error(`Could not connect to port ${e}`)}catch(t){throw new Error(`Could not connect to port ${e}`)}})}function w(){return new Promise((e,t)=>{let n=document.querySelector("ad4m-connect"),o=n==null?void 0:n.getAd4mClient();o?e(o):t("No Ad4mClient found")})}function g(e){let t=document.querySelector("ad4m-connect");t==null||t.addEventListener("authstatechange",n=>{e(n.detail)})}function A(){let e=navigator.userAgent,t="";return e.search("Windows")!==-1?t="Windows":e.search("Mac")!==-1?t="MacOS":e.search("X11")!==-1&&e.search("Linux")===-1?t="UNIX":e.search("Linux")!==-1&&e.search("X11")!==-1&&(t="Linux"),t}export{f as checkPort,h as connectWebSocket,A as detectOS,w as getAd4mClient,g as onAuthStateChanged}; |
@@ -9,2 +9,3 @@ import { LitElement } from "lit"; | ||
private _hasClickedDownload; | ||
private _isRemote; | ||
private _client; | ||
@@ -24,16 +25,21 @@ private _isOpen; | ||
connectedCallback(): void; | ||
connect(): void; | ||
private unlockAgent; | ||
private verifyCode; | ||
private changeUrl; | ||
private changePort; | ||
private changeUIState; | ||
private changeIsRemote; | ||
private changeCode; | ||
private onDownloaded; | ||
private handleAuthChange; | ||
private handleConfigChange; | ||
private handleConnectionChange; | ||
private loadFont; | ||
private startCamera; | ||
connect(): Promise<import("@perspect3vism/ad4m").Ad4mClient>; | ||
getAd4mClient(): import("@perspect3vism/ad4m").Ad4mClient; | ||
loadFont(): void; | ||
constructQR(): void; | ||
scanQrcode(): void; | ||
changeUrl(url: any): void; | ||
connectRemote(url: any): void; | ||
connectRemote(url: any): Promise<import("@perspect3vism/ad4m").Ad4mClient>; | ||
requestCapability(bool: any): Promise<void>; | ||
connectToPort(): void; | ||
unlockAgent(passcode: any): Promise<void>; | ||
changeUIState(state: any): void; | ||
changeCode(code: any): void; | ||
onDownloaded(): void; | ||
verifyCode(code: any): void; | ||
isAuthenticated(): Promise<boolean>; | ||
setOpen(val: boolean): void; | ||
renderViews(): import("lit-html").TemplateResult<1>; | ||
@@ -40,0 +46,0 @@ render(): import("lit-html").TemplateResult<1>; |
{ | ||
"name": "@perspect3vism/ad4m-connect", | ||
"version": "0.2.16", | ||
"version": "0.3.0", | ||
"description": "Lib for handling everything needed to setup a connection to a local or remote ad4m-executor", | ||
@@ -53,34 +53,16 @@ "license": "CAL-1.0", | ||
"@perspect3vism/ad4m": "*", | ||
"@rollup/plugin-commonjs": "^14.0.0", | ||
"@rollup/plugin-node-resolve": "^8.0.0", | ||
"@rollup/plugin-typescript": "^4.0.0", | ||
"@tsconfig/svelte": "^1.0.0", | ||
"esbuild": "^0.15.5", | ||
"esbuild-plugin-lit": "^0.0.10", | ||
"graphql-ws": "^5.10.1", | ||
"ipfs-core-types": "^0.10.1", | ||
"node-sass": "^7.0.0", | ||
"np": "^7.6.2", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.3.4", | ||
"rollup-plugin-postcss": "^3.1.8", | ||
"rollup-plugin-string": "^3.0.0", | ||
"rollup-plugin-svelte": "^6.0.0", | ||
"rollup-plugin-terser": "^7.0.0", | ||
"subscriptions-transport-ws": "^0.9.19", | ||
"svelte": "^3.0.0", | ||
"svelte-check": "^1.0.0", | ||
"svelte-preprocess": "^4.0.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^4.6.2", | ||
"uint8arrays": "^3.0.0" | ||
"vite": "^4.1.1" | ||
}, | ||
"dependencies": { | ||
"@undecaf/barcode-detector-polyfill": "^0.9.15", | ||
"auto-bind": "^5.0.1", | ||
"electron": "^20.0.3", | ||
"esbuild-plugin-inline-image": "^0.0.8", | ||
"html5-qrcode": "^2.2.1", | ||
"lit": "^2.3.1", | ||
"vite": "^4.1.1" | ||
"lit": "^2.3.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
4
9
26
3095162
4829
18
+ Added@undecaf/barcode-detector-polyfill@0.9.21(transitive)
+ Added@undecaf/zbar-wasm@0.9.16(transitive)
+ Addedjschardet@3.1.4(transitive)
- Removedesbuild-plugin-inline-image@^0.0.8
- Removedhtml5-qrcode@^2.2.1
- Removedvite@^4.1.1
- Removed@esbuild/android-arm@0.18.20(transitive)
- Removed@esbuild/android-arm64@0.18.20(transitive)
- Removed@esbuild/android-x64@0.18.20(transitive)
- Removed@esbuild/darwin-arm64@0.18.20(transitive)
- Removed@esbuild/darwin-x64@0.18.20(transitive)
- Removed@esbuild/freebsd-arm64@0.18.20(transitive)
- Removed@esbuild/freebsd-x64@0.18.20(transitive)
- Removed@esbuild/linux-arm@0.18.20(transitive)
- Removed@esbuild/linux-arm64@0.18.20(transitive)
- Removed@esbuild/linux-ia32@0.18.20(transitive)
- Removed@esbuild/linux-loong64@0.18.20(transitive)
- Removed@esbuild/linux-mips64el@0.18.20(transitive)
- Removed@esbuild/linux-ppc64@0.18.20(transitive)
- Removed@esbuild/linux-riscv64@0.18.20(transitive)
- Removed@esbuild/linux-s390x@0.18.20(transitive)
- Removed@esbuild/linux-x64@0.18.20(transitive)
- Removed@esbuild/netbsd-x64@0.18.20(transitive)
- Removed@esbuild/openbsd-x64@0.18.20(transitive)
- Removed@esbuild/sunos-x64@0.18.20(transitive)
- Removed@esbuild/win32-arm64@0.18.20(transitive)
- Removed@esbuild/win32-ia32@0.18.20(transitive)
- Removed@esbuild/win32-x64@0.18.20(transitive)
- Removedesbuild@0.18.20(transitive)
- Removedesbuild-plugin-inline-image@0.0.8(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedhtml5-qrcode@2.3.8(transitive)
- Removednanoid@3.3.8(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpostcss@8.5.3(transitive)
- Removedrollup@3.29.5(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedvite@4.5.9(transitive)