diff --git a/package-lock.json b/package-lock.json index 2c1e1ae..79c8645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "svelte-elemetary-template", "version": "0.1.0", "dependencies": { - "webnative": "^0.32.0" + "webnative": "0.33.0-alpha-1" }, "devDependencies": { "@sveltejs/adapter-static": "1.0.0-next.36", @@ -4758,9 +4758,9 @@ } }, "node_modules/webnative": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.32.0.tgz", - "integrity": "sha512-Oz7+WVakUFuMeIivfsCPGTOSaSHS34MM75EaXTL1G3AHIItHfJq67gwoEhSMgYcia7eM7zEx5HS8hmIhYgbTUg==", + "version": "0.33.0-alpha-1", + "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-1.tgz", + "integrity": "sha512-g5xg5gkDScTre5IrhcJgWhEgYlI/pri2OTxZxLq832cqgu42gJ9Jzs7B+hgSEDHWB+ROQWCe+RJ9H0dlhTKORw==", "dependencies": { "@ipld/dag-cbor": "^7.0.0", "@ipld/dag-pb": "^2.1.15", @@ -8227,9 +8227,9 @@ "peer": true }, "webnative": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.32.0.tgz", - "integrity": "sha512-Oz7+WVakUFuMeIivfsCPGTOSaSHS34MM75EaXTL1G3AHIItHfJq67gwoEhSMgYcia7eM7zEx5HS8hmIhYgbTUg==", + "version": "0.33.0-alpha-1", + "resolved": "https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-1.tgz", + "integrity": "sha512-g5xg5gkDScTre5IrhcJgWhEgYlI/pri2OTxZxLq832cqgu42gJ9Jzs7B+hgSEDHWB+ROQWCe+RJ9H0dlhTKORw==", "requires": { "@ipld/dag-cbor": "^7.0.0", "@ipld/dag-pb": "^2.1.15", diff --git a/package.json b/package.json index 5c3b804..78874fb 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,6 @@ ] }, "dependencies": { - "webnative": "^0.32.0" + "webnative": "0.33.0-alpha-1" } } diff --git a/src/lib/common/webnative.ts b/src/lib/common/webnative.ts index 4fab1f1..58dc81a 100644 --- a/src/lib/common/webnative.ts +++ b/src/lib/common/webnative.ts @@ -1,6 +1,12 @@ import * as webnative from 'webnative' import type FileSystem from 'webnative/fs/index' +import { USE_WNFS_IMPLEMENTATION } from 'webnative/auth/implementation/use-wnfs' +import { setup } from 'webnative' + +setup.endpoints({ api: 'https://runfission.net', user: 'fissionuser.net' }) + +setup.setImplementations({ auth: USE_WNFS_IMPLEMENTATION.auth }) let state: webnative.State @@ -17,7 +23,8 @@ const fissionInit = { }, } -webnative.setup.debug({ enabled: true }) +// TODO: Add a flag or script to turn debugging on/off +setup.debug({ enabled: true }) export const initialize = async (): Promise => { try { @@ -25,15 +32,16 @@ export const initialize = async (): Promise => { state = st switch (state.scenario) { - case webnative.Scenario.AuthCancelled: case webnative.Scenario.NotAuthorised: console.log('Not logged in') break - case webnative.Scenario.AuthSucceeded: case webnative.Scenario.Continuation: console.log('Logged in') break + + default: + break } } catch (error) { switch (error) {