{"_id":"webnative","_rev":"228-035c7d39cbf119ed5a9a3013243bef54","name":"webnative","dist-tags":{"latest":"0.36.3","alpha":"0.36.1-alpha-1"},"versions":{"0.0.1":{"name":"webnative","version":"0.0.1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/ts-sdk.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged","travis-deploy-once":"travis-deploy-once"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","travis-deploy-once":"^5.0.11","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/ts-sdk/issues"},"homepage":"https://github.com/fission-suite/ts-sdk#readme","_id":"webnative@0.0.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-JIe/WxFu9+Hluj/Pte5GzLxYXLxXKmaTCO36iEb17EQHudyrajS9pV7mSBSf++rHZR5MeqDBdmMpwp3NxMyAEg==","shasum":"48e764ee2fdc50a14f468112beb646b9a9acf390","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.0.1.tgz","fileCount":183,"unpackedSize":16158488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNvkmCRA9TVsSAnZWagAA/dMP+wUPWkKIxIPPHry0C7oy\nlJMC8wSLAK3a4JHcy+bBwGEG/hb6bIf78DNLEr8YhqqYsIDRigYB64XNpbZO\n4E+P+A0RtI65SudQXvDYb2qOFSz2+s07AjR5rFTboz6LUBrqF8mBXIvSMZqv\nTw9SRHE8QdUvnJOk+0EVNN8qlTwTG4hCtlSWuCdvm+IwCh8QwXv+pSFWiwsb\ngafFzqP51YTzTIQTY7XIzpNyAIKyML1vZqdKzmJuQCGE2m5wIg56u+KszDcb\nifMqpNsXrIK9gJZu1+crIDRWP8sh9yBEzGdSKLhuQYuPkMgLtXVyE5a0QRvc\nqmGhLs9lRpEfRVXyYgblKL3zAgwmimXYqD/gzhFSK23SILaJKldliPsgVSHV\n9g3bPhgbH32I6PAOwQlPxusH71W0z4WSGfNvzNF5drZQcrLhMoBq3iInLS8R\nxzQEAfP3KowzyjhLyOuhR0y/nkgjvJyvqi85xHoPpsJdgGk+MC0m5mac1n15\navMkva0Dfp56FfrPDq0x3izDd31BpTs6FQXtsIigFnjk1tnVkb4Hx713X1hu\n0yRVx23rJNoyWfR0hEgyVc5IPChSBx+VjGWXGMn9GNswYmBuPGxOgjtd0DHI\ntqhENgpCX18ogziuGOzLuOWntji/Ki1nC/rwjRYJgbcbKcqJDdjIYVDQiN5D\nD4Sr\r\n=Mwd/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmWSK4tVxHqsZMTYvvdjGvMOw8fzWh4oB9AHh+Gb1RyAiAQNxnF32M32YVf80VrBBzXu8H5etMQiTv4xkdH4g2ptg=="}]},"maintainers":[{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.0.1_1597438245463_0.16577375223305735"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.0-alpha-7":{"name":"webnative","version":"0.16.0-alpha-7","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/ts-sdk.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged","travis-deploy-once":"travis-deploy-once"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","travis-deploy-once":"^5.0.11","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"![](https://github.com/fission-suite/ts-sdk/raw/master/assets/logo.png?sanitize=true)\n\n\n# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/fission-sdk)](https://www.npmjs.com/package/fission-sdk)\n[![Build Status](https://travis-ci.org/fission-suite/ts-sdk.svg?branch=master)](https://travis-ci.org/fission-suite/ts-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/ts-sdk/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n\n```ts\n// ES6\nimport * as sdk from 'fission-sdk'\n\n// Browser/UMD build\nself.fissionSdk\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { scenario, state } = await sdk.initialise()\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuum) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthenticated) {\n  sdk.redirectToLobby()\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes an optional parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Other functions\n\n- `await sdk.deauthenticate()`\n- `await sdk.authenticatedUsername()`\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After authenticating …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nconst appPath = fs.appPath.private(\"myApp\")\n\nif (fs.exists(appPath)) {\n  await fs.ls(appPath)\n} else {\n  await fs.mkdir(appPath)\n}\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `session.fs` will now be `null`\nsdk.initialise({ loadFileSystem: false })\n\n// Web Worker\nconst fs = await sdk.loadFileSystem()\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nsdk.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nsdk.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'fission-sdk/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'fission-sdk/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/ts-sdk/issues"},"homepage":"https://github.com/fission-suite/ts-sdk#readme","_id":"webnative@0.16.0-alpha-7","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-IY5QPFc8Ce6RMpglXI+4PSpjQjEUnOdSDoPXN3Z9BNVuRL4SKUwDzcU9ybjlmw6p7iCpONHps3ASlgaF0xqPww==","shasum":"46559b9feac19b2832b779aaa81bf993eaff1057","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.0-alpha-7.tgz","fileCount":186,"unpackedSize":16059984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPGA7CRA9TVsSAnZWagAAD10P/3fnfGuji25m4PvsxHIt\nH2q7k5ihjJdtcFz/P5ZvQ6oT8uAqBEOrK+RavEQBV21IXddcq4rV4CAlnhDa\n54IJulqywYDTm9kJx8iKC7oLvHK4gnWl6xs01QrQiCzO2xrNaplZPOJZCEkR\nZ9311KD1qVmKfqLrHwZ+ikMOlx1Yb3riTAjsYQtkmjCpcQ64HAMjVs/x2KAp\n4O7SRRom4MB5q6I97v3y7zg/ewoA0PA9cbR9DMvc7hbTSWomrtJQRR9hTq92\nukD48R2xhxNa/2lJQNuYMArEuQ72t44oYuBq++hvphJMnEroJg6e8jWAS1x1\n81WnhoWO2qZeum2Fk17iCPW73mdplcm6JzRgbuTYpWrmzkbXTQ6+Yg5tqa4V\nA0r3xokbSfvwm+4PrMjPCUnn8FRmlbvXhKnGPqkByzKZyM/948Fj2j1OqLIM\nKrWWBUf3mWxIE+N3wXet5By67q9x72IJTKSNfTpwdGMlB1ET6/QP/OC7RVCc\nXs2z+Yu6oWoAA8q8dKWfwJDcW+S9W/y+cR5umm2enarzMqSuWpurgbEyOThb\nIPKWeA6mxZdqw6Jyq8VHt8Zwr39G96+AmjsdRUEx2+azlcC87J4bpnoJtbPl\n1etnR5RzxA+nI9oFAXT84aa/aDAWmZYRHtPqc7RTBBc0uXG/htcY+1uluGyl\nio6r\r\n=TlgK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfsU1Bu56wF6LK0GbMtaqG6keeWAJTQum9+qnMvFjX4gIgPq6Z1iSBMc/JvnNr/ynK1wFxB2roCFW5mdNDx5pMA0Q="}]},"maintainers":[{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.0-alpha-7_1597792315124_0.0018543962963832872"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.14.3":{"name":"webnative","version":"0.14.3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/ts-sdk.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged","travis-deploy-once":"travis-deploy-once"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","travis-deploy-once":"^5.0.11","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/ts-sdk/issues"},"homepage":"https://github.com/fission-suite/ts-sdk#readme","_id":"webnative@0.14.3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-QA8tXpf9f7yRscpu4JH7fyFh9qIsL2yYNcN+gUyTxbUzA/BCApnRRBU9gAt5+tq+Q/8D2EKNmwCJfS11qz6oUA==","shasum":"6fbb8ae9062cc3fd2c63b05b8d5f9b5251ad0341","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.14.3.tgz","fileCount":165,"unpackedSize":9018636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP7mmCRA9TVsSAnZWagAA75MP/RN7YLFdn1i47gyRfpoE\nBem5Lt59IEbtuymsqshaM3EFYqkUv7CxqrE8ZgsiKxKppgklwWos7i+i0ID3\n/pnNpfArL0VNF0LmsXPrTNFczueE5VP3R+6TzEUNhV7wf4XYeslnpstciK7h\n1o3UKZn7IOCrG12Xk1IB5YXS85IZkQVwmEPzHzGEcryCCTY1e4uocuUGcCaI\npAhABXKDIsQzGc+646dULmuOAvGyhM+QYgo4ZOZZGUBAZ5e2BKrekkqypbT+\nH1YOWP8+FZYtYw9DKQqaH1MzENB15P8EKZfztl0eJKu/Qm4kag3Sfy1HyetO\n7VFawHSgCmf2pfu5GYjFOFEQrSxiWmw3KTNovIE83Apy8pr7u0Vcm+FEV8na\n5FM9HPqgrfDcB/ZXTOHLb43eU4bNevP6yXtUpNNmCoVSvOJdBC5RoX4TGayD\n9CN+2CzW2m68SrK9/Dw3tjdIa+PjfT2xz/Zw+2k5WsHy09NZQOnqtmGACgoI\nPSYe77x0KWfjvq0KIwglf0QlEDY8mTsgQQj0LLMzg6CNDANx1kU34TZP/xNX\n718Wd/wEIRIvJPR5dY1D8vOy9rJIStKQJvqoE+ml1KAt8ZrBqE9VfVx9wVmN\nAmx2qBsyWbGQkNZ9M4QwCvmFaUbYFl9Gnj3duapJFxw1cfLItczm6d4eMl2T\nfo1j\r\n=R7dP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBlhzVJ0i5CX1IgUVR5hYqK82lxh7UrQDue3oDAcSF6CAiEA6MWcQt87VYgV6Fm6zkkdVOXiSvSfM5LYywaBNL54Cmo="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.14.3_1598011813993_0.6006773707888036"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.0-alpha-8":{"name":"webnative","version":"0.16.0-alpha-8","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/ts-sdk.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged","travis-deploy-once":"travis-deploy-once"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","travis-deploy-once":"^5.0.11","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"![](https://github.com/fission-suite/ts-sdk/raw/master/assets/logo.png?sanitize=true)\n\n\n# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/fission-sdk)](https://www.npmjs.com/package/fission-sdk)\n[![Build Status](https://travis-ci.org/fission-suite/ts-sdk.svg?branch=master)](https://travis-ci.org/fission-suite/ts-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/ts-sdk/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n\n```ts\n// ES6\nimport * as sdk from 'fission-sdk'\n\n// Browser/UMD build\nself.fissionSdk\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { scenario, state } = await sdk.initialise()\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuum) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthenticated) {\n  sdk.redirectToLobby()\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes an optional parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Other functions\n\n- `await sdk.deauthenticate()`\n- `await sdk.authenticatedUsername()`\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After authenticating …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nconst appPath = fs.appPath.private(\"myApp\")\n\nif (fs.exists(appPath)) {\n  await fs.ls(appPath)\n} else {\n  await fs.mkdir(appPath)\n}\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `session.fs` will now be `null`\nsdk.initialise({ loadFileSystem: false })\n\n// Web Worker\nconst fs = await sdk.loadFileSystem()\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nsdk.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nsdk.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'fission-sdk/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'fission-sdk/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/ts-sdk/issues"},"homepage":"https://github.com/fission-suite/ts-sdk#readme","_id":"webnative@0.16.0-alpha-8","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ltiN0fI8RUdlnjWQChRlVXw49Q1gNlpSwEWNE1XC53ubJoLxDALqNyAHIFSXG4o0BD6Uz9BLQL3TkgvuYHrgSQ==","shasum":"c7ef97666b7b00cde33e063b6a36dd6503e90032","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.0-alpha-8.tgz","fileCount":186,"unpackedSize":16069413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQFfYCRA9TVsSAnZWagAAvi4P/RRDEELUmc369/jgPMTB\ncfxhCOm/34sol+Ep/+wBYQwXBCBP/B94NJsoAHArG+J/BjxjTx+lpgTnPWGY\n2DHTA6plb9HPm/XPxMRoR8xs5W9tUoK1yOuyuBiKlwGhd0zFJTARL+++xTQi\nGBqGSK4Wa8W5KBltPvccd1LbcSDIl7L24tvhUigK1IGKW73zfiWCPfgO+vym\n+iqWDwplw403T8sImYN9bn9e/rndzCIrwtl+ChwhQOpCM7f+vCpihfrZtK6j\n7Ba/bZVeg1i8MzSESaq8zribCEApiy707j7ds92WRvRNG2o+ONfCgdcsDP9o\ns4minpcWGPYAXCSvjTKTudwfWi92QIE74L1X+VZkjrKgCm3Po/aszH7RudSq\n0k10W6gsy6qzWNCrgXPJ8ICZLl/aCv9pxo6yhGv4l9Kg7vunDm8ZjR//4SUH\nJ7p+/qZBLc9OBS/204Cvcg3EGDs7v4qljb0ncmk+zy11F5hTCWb+VA4n4DLq\nEZYMKjc4JRHKjS2aUt2nSRvxzkqsQ4nNfhBTEqj/UXQMzQuHa/KT+RcoOK7T\n+DbeSNZngnj+sQhYujv5ormk7IKqFi1okde82GPytmoH4TACp3pN16Cwl+E/\nLl1cboDLwE3ABWLx9qseelcSGsRyH8JA5hst5hpAaxWNhnyFc7TJ6nYyF/kq\ni+7t\r\n=66vg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB818sgJjPZcgQBQpcsOvm54Yqj3p7XlCXhiddZCYTn/AiBUF0XRo6lQFsiMOGKjftwtQyEjsfJH9LnHs30SpHE0zw=="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.0-alpha-8_1598052312047_0.6669730142144563"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.0":{"name":"webnative","version":"0.16.0","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/ts-sdk.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged","travis-deploy-once":"travis-deploy-once"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","travis-deploy-once":"^5.0.11","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/ts-sdk/issues"},"homepage":"https://github.com/fission-suite/ts-sdk#readme","_id":"webnative@0.16.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-OXzoewltPOUhPk2ut0CVeo8+VonMthmjD4BhITPgEtaHn3h5hw8yiFT37PuEjVFUyJEK0o9yohQSCj4pBOSciA==","shasum":"902c269a8bbbbaad19f0b58232dca9f909eeeaf8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.0.tgz","fileCount":189,"unpackedSize":16114673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ/EzCRA9TVsSAnZWagAAsiYP/2bJKQc1fwmyWuE5Nn78\nPqwEFR4B1ARn7X3mdLZtwx4meJxRBHNNSqboCt7jT56sGSxxbQMEj5pf705b\nLF7csxdNwKR6QOLWB10ACWhtyPZDaJHaBSzSdA7QSho3vLkbt+O27YA2Dmg4\ngejEYY7raeMZxiOew3pFGl9lN7B2J4bC1yB8w0yj3knULYd8lj6oUGimVJWt\nItu7vf5w0seS5EIZsADpgUhWWLMXH4e3vWiKX2rJFzV7pw/PZPxnlB7wGAvX\no/pNTImIHv1aga+bILCLuTXuiK0MOWw2bx+glmrG9KT/JjUROqthEhhK/RfJ\nkqPKto2c/RrSxC0oYhwRrQ4jiZnb6dL8GtNcLNOd6n4Cr5yDIVjP86Q9FoF3\nTm4fTiMGL4yuxWFs39J8ZOL6iPKxiibEzagx7t8NQHWsc/owYRYRK3wGvpdx\n+pMjY8ZpyFdgkPvRWss14/Kz6RwY54nk1Zj93OHnnC7Z582yDCzrWM2BcM/i\nkmoPChQBVOjostKZMBrnjSO1cCu2xYBtsYQc8ozdn2g37wgIWTTVHgsFNzIU\n4oN0il6x4heyvNSEgUg3Dm+LKOfb7VlA8kO9Yr2rx2d7UF2ir1I1y4s+EoW8\nXyX4jOQOfVKRk18dra+kcSXz9yLueJthUGY5EWmsj7NzVxnE7chGWkmrWdzE\n4Z57\r\n=nsAs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXT2bYPNQ4Y7TaN7uWKniS4J8Dim6XyfwOsPMRK6SqHAIgc5zV/qaCrqdab+cLV7UkB/ed32e869kKH4GdZAZvy60="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.0_1598288178522_0.01707414183929834"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.1":{"name":"webnative","version":"0.16.1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.16.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-NvWkY99NTm3LV6agmC0MArx+rbi0cvrVMez6U0jIafGocVVkTJmQ38TD4SZ9w7oTSHqJ5dAEw8Z0v+MrqjxgFw==","shasum":"dd1c60f170e12af2acb001bc4209a4f69a146e88","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.1.tgz","fileCount":189,"unpackedSize":16114484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRA2tCRA9TVsSAnZWagAA+FkP/3IHS1ZBFoXJfx7qoDuk\n5FgJ73LkVXnbqfVOLGXLMw9I8MN7iZt/5Qn45c5cqm9+NXIbwMS81No+sEcn\n+yu0J18jNBnOeDDZyMlmAsp83JWxILgJNyZpxgYjMGOaj/SmQG0MDHAC3TpQ\n2fZunlb8D+TFEUbZgTGbcSvQI3FFPutqKy5dGhinvVGlTgEXdahXwosmyh8a\nXd7TXWCUgD0XLQ3BkRgpMbDCZGE1w5VnlLeAQI0VW99phEEuF6x9kGqQExJp\nog5CxK/dtUmfAR3rChzRfBtd6A56iPJJlBSR2FpBSCRoLykLQRzENhUVhLCJ\n993qn82xbqrpCz5bXo/sQvUzV7LWg1peMEtiAMBmxxNYd7Ye7ZRi+3yL8x7s\nVB45G9/Hh7acb8KN2psYQg7gpWznTqAizRKc6dy3B+WlsVhiYtcZoMSd7DtW\nOt7SG7RTup6U0vs0iolV3gYcLVVTYVuhRRo2ad88al9f+6WC/4jYj86/U9gH\nQe8zquS9l6sy+vcAolueblFFjiP+3ikM6nocDI1qm/fdXktAb12drJo1B2w/\noJXQ6a2pUCjYBzPnu7vyS1W9aYUNbygwHS2tILglcygBoK+IOBgI6NHr/4vu\nB47s54TrLYfX/qA+KCB2n/0szi4kwVhbeAGnWd5sId8xWx0lTzf8SumO7H35\nXzw5\r\n=Nn6c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSL6fhixW6mWYJq/AYjuIsll7CZao3f7rKFgF0W8RyGwIhAMEWFq7fZFDawG/RKMbLKK430v+7hLypoosVeWf00Zjv"}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.1_1598295468525_0.10677739034350009"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.2":{"name":"webnative","version":"0.16.2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.0","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.16.2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-cSbxH40V11N+XtiplcOJXWvSAw2L6qzNJ3romNw8mjK3YirQYLy7OFZ3jQPjpBTleiAVuVNOJ0xutkqtVyLJhQ==","shasum":"dbffd1cb08074733d8cb737f5a057e5d2f8238b8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.2.tgz","fileCount":189,"unpackedSize":16115685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRCodCRA9TVsSAnZWagAA7LIQAJm/9QPCrDDVVgq+V2qp\noJ3DkEzayyeaFrhqIdv953tb2OoieMNEg+VLTGcAqkB9EMrpMNIguHnqS2Gp\nUP0Drr2mAQ3y9jng6/Z3lJRMvbqzQgmpW+kStQkQd+4f9RQzmu5YsBdBwy0f\n+DG9pWEB2RLR7r9phm9tG2xtDZ/u0crAlMnggoyyN2LaMJzKy5lVIW/LgAuK\nPNtgX1G90jJoVW3EX/VCRvHQVDbXRJcREKYqhl9OFx5peHq1560UkhkR6s/E\nmORuu0kA4v+5AYwZy9OH7b0rfzwgxSZekTKKN/FgBwoUL7x0762As5HV5Orz\n5CH5uKTyblCdkJvhm7JJc0etOvniuUXkchKJ5BXfAYPAxKnScmyqob58fPoN\n7OghlJAu1bnAa1J1T8dyTbp+FLBuTCwues+j9/sYP2p+ofufKjpLznWmMU8D\nEOg8+sBsE/qMEkG2/g1ffLSaA3Lyu1xu4pd/4t4hgMtHgDAr+0K1XG5/ack7\n23ryZZKYzWOLPSOCDdcrGlPU38+6Ya9IdIbwa6udmheqhBzBMZhSrSJ62i1N\nntebzpv3MudZShK+VQsz8SlfHy0COknmQgbm5ltIffr0ox/xJQwC+eunmesE\nRlXfBobKusHkxu7+aiUwXTCk3vpPtWjEAUBN0ijN5Yv1CsthsJ8YLcHYlS6A\nYXjj\r\n=HFSS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvB5YlcLKd+D+BFxCAG6EUEcyObNGlHn2fvD3/WxuZFAiEAs+E0eJxYtGUI/2f42VOjHpr3aArnHFSGsP7+kf+c7Xk="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.2_1598302749449_0.825704368633025"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.3":{"name":"webnative","version":"0.16.3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.16.3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-nSEUcHsxDy6sIjh6WJ2++5AtMqClAZSqx6HRZurf5HhhF2CYT4R+cby/LZqK60Uz+B3nzU5Jl2uFfza8DwbESw==","shasum":"619e73e98562de5390b985d6e201ce960d1b7cd7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.3.tgz","fileCount":189,"unpackedSize":16116960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRqXcCRA9TVsSAnZWagAADvcP/jsqc6HaViLQ1yUl2EX+\n/MD2glJlzuN2d2Va8E72TsCadv7KxV8fZYWh1pZnankKOFpdHxo9Sr5O4jzk\nUzOrfCTXjGqSeyEvIsbHRCw/odFLAkK13/zXyq6Cev5j2fRiFIk4X/hDW9k6\nG2alGCbMbKKpHaQjiP17nK1NBj33m9arpURcsuh/ES5YJOy263DfWtjNV8Zr\nDZ3OG/5vFdYoknsr9mzsCKjvSxE0Cwe29JeqDILCPB74HqRIUu3JnV6vYhSv\nlQjhkjin0RfWKt7NZeQ3+1+BSlVKxdujfMgywoF9CKTt7ZsBgrM5XLaKK8Xf\nhgSe680PcnZgm+R/FG+MgoxaTf5RD4t0gIwn2FWbQscZjl3VOy3dtAtw2eeL\ne4JOh7UMJ76aFxQv+N46K2K+CQ6TiYrTGOaimRu1GkEQjX4fvn6WfjR+T3qr\ncOCvtoeT6zJi/L+HrdYe70n9dOh9paLM85GbAarwV8wDdUuGyKmHprIXj3CB\nBjY3R/bygwJj0EHV1SKocaaFb9eps3KZln1F2lzVCBt5EPwRkGetRfMz+Gwq\npip3XOuAr+B81U25LtzRM8kDt85SruQ+g2ubKFtNsmJJ2Lih+5Z//bjGXdMY\nVDWM1XDLT8AzAPv7zP1rW81BmSESgwit/+V6Gng1eGyKD3rq2sgsICiE13rP\nrVz8\r\n=2Q7A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7mfnRcGqcS0nNpNDS7uB4Kx+nqOAxxebdNqM1H0s5VQIgEPRVG+rBDe6DwhiIHiqXqzMIYetQxDqn5Djj23bx6/U="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.3_1598465500072_0.9011242771724854"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.16.4":{"name":"webnative","version":"0.16.4","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.16.4","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ufvv2O10go9L7xQ2sdip9BBuZxnG7Qg3h3ClNNgLqs8/xmvH2hqam25dcyy8j8b56yFtN0Kb1p/8uHMKZlNlnQ==","shasum":"649326ca997ebb986fc9eb3f06212afef7a634de","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.16.4.tgz","fileCount":189,"unpackedSize":16117698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRq8mCRA9TVsSAnZWagAAXFQP/RtQrgl1K8aYr1M9B3lF\n+23erhi0YqqW2jWVEsQLsKVmApXHEwto+mdGYF3I22FLogbk5aBg6s3xmf+W\nz74rx6HM63oxul9cDWc+8ZHnBU4siOQy+OrD/kHrAtx+8TzltCEIzscarXbb\nJEkCuVXbeVzP2GxQ8ZuKe45dUx7wDcifMWyP6UH+ESvpiYA44+KSpyngtHm8\nnLXK97+UxiWvhGk0+fuyhzSXYufgi2oNeV/3o7AMhZID26rlFoT1XkfYv5Ir\nkojHL6sC8iH+dK94qLPf6gYJwsL5WLdKm/r8wDCV6G3GKPIaf7li5G59q3va\nsWtEBdqc6un6NJxLmJs4Fqw6UhOdomo3uQj0oBD3LR96Hrf1yoktjzVCYitv\nWkHAOZUQCKkB5vs7b5Mni01TE/GvHgBMZbFRi9ks4IvOKm5nWpkjGwW1rUhI\nj2G/4rVn8JbiJokU0ytETlXDdzkPBRRfic/CLiRtdjycRiRgupATcjyhUSNz\nWS9Ebz7IdIe8AdvArU9qHTY4a7PjHO0ARgRzreeBT0p0hiYt3Si+vuU/tJ+t\ntEQawvAwaI/pIABh8Pmj4zMy+nYQCL6Z3t+pJZHjwqp4II0/KBAXr00bEhnM\nVG9abf88PrlMsDGmoIBwcobgzuFj4CqLv2mwgLZW0HAOYgDjnTBuvIu2dO3g\n8PAb\r\n=jBda\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv9mCpynmjOW2X//Di9RJGIVv5/g1Wma8rL+oSQGbG8QIgTiADQlDfOdg/lGg6PXI3Doyauo+vzadvW5uCDaJFgb4="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.16.4_1598467877591_0.07887262400059258"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-1":{"name":"webnative","version":"0.17.0-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^2.22.0","@typescript-eslint/parser":"^2.22.0","braces":"^3.0.2","eslint":"^6.8.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Authorisation\n\nThe auth lobby is responsible for authorisation as well, it'll give us multiple UCANs (or tokens if you will) based on the values we gave to `wn.initialise`. Important to note here is that if one of those tokens, that we got from a previous session, is expired, the scenario will be `notAuthorised`.\n\n\n## Shared devices\n\nOur vision for \"fission-enabled apps\" is that users don't really need to sign out, unless they are on a shared device (a device they normally don't use). You can read more about our vision on this on [our forum](https://talk.fission.codes/t/what-does-log-in-or-log-out-mean-for-the-fission-sdk-and-apps/919).\n\nSigning out on shared devices would be two-fold:\n1. Remove any authorisation tokens from the current domain (ie. for your app)\n2. Sign out of the auth lobby\n\nThis function will do that first part, and then redirect you to the auth lobby:\n```javascript\nwn.leave()\n```\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Permissions\n\nEvery file system action checks if you received the sufficient permissions from the user. Permissions are given to the app by the auth lobby. The permissions to ask the user are determined by the \"prerequisites\" you give to `wn.initialise`, such as `app`.\n\nThe initialise function will indicate the `notAuthorised` scenario if one of the necessary tokens will expire in one day, to minimise the likelihood of receiving this error message. But to be safe, you should account for this error:\n\n```ts\ntry {\n  await fs.mkdir(...)\n} catch (err) {\n  if (err instanceOf wn.errors.NoPermissionError) {\n    // Redirect the user back to the auth page to get the permissions\n    wn.redirectToLobby(prerequisites)\n  }\n}\n```\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `state.fs` will now be `null`\nconst { prerequisites } = wn.initialise({ loadFileSystem: false })\nworker.postMessage({ tag: \"LOAD_FS\", prerequisites })\n\n// Web Worker\nlet fs\n\nself.onMessage = async event => {\n  switch (event.data.tag) {\n    case \"LOAD_FS\":\n      fs = await wn.loadFileSystem(event.data.prerequisites)\n      break;\n  }\n}\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nwn.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nwn.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Apps API\n\nWebnative also exposes methods to interact with the apps associated with the user. This API must be prefixed with `apps`.\n\n- `apps.index`: A list of all of your apps and their associated domain names\n- `apps.create`: Creates a new app, assigns an initial subdomain, and sets an asset placeholder\n- `apps.deleteByURL`: Destroy app by any associated URL\n\n\n## API\n\n**apps.index**\n\nA list of all of your apps and their associated domain names\n\nParams:\n\nReturns: `{ RandomKey : [ subdomain ] }` a map of subdomains\n\nExample:\n```ts\nconst index = await wn.apps.index()\n// { `SqlBackendKey {unSqlBackendKey = 216} `: ['your-fission-deployment.fission.app'] }\n```\n\n---\n\n**apps.create**\n\nCreates a new app, assigns an initial subdomain, and sets an asset placeholder\n\nParams:\n- subdomain: `string` **optional**\n\nReturns: `subdomain` the newly created subdomain\n\nExample:\n```ts\nconst newApp = await wn.apps.create()\n// 'your-fission-deployment.fission.app'\n```\n\n---\n\n**apps.deleteByURL**\n\nDestroy app by any associated URL\n\nParams:\n- url: `string` **required**\n\nReturns:\n\nExample:\n```ts\nconst deletedApp = await wn.apps.deleteByURL('your-fission-deployment.fission.app')\n//\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'webnative/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'webnative/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-cWC9cEdSlH8p35ozar13Dcbmv8TY6OfM+8eXKlK6jnr3UngoykggxrWIRbXObqZgSTFNgq/n1Egj/58HOax1IA==","shasum":"bb92fb044321f1bfdfd6d8ad99767dc5d0700170","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-1.tgz","fileCount":239,"unpackedSize":16361785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSAWGCRA9TVsSAnZWagAAmU8P/10S2lBrIrb29k1Suw/l\na5S1qlljBDD0mtBglE3m7md2CW9MOl65hS76DXZkDXefluj/W60EBA3S0Qri\ngkcPBWQIe1yXUAiV8YwKSrNlfWvwdjlcFGAMVT9YZgiWdv5tn3FBy6DPeThW\nidzZfzVFUDZACdwxHLkjLhDGxppUnZ65wyS1PrcJkHKOgaVbeqyl85cIsAFt\nEBg6w9Maf2EaqDj2zPC1Jo9UCRD+x+X01C75tOsVNcl3/xmRzOKFrki7rf+L\nTwQ86tSYRsfQtpOSC2+In5cjMrmuOVMsca5aGe7L6WSNM1iJ4uJkYj+R4XAr\nPLJ65vHGCNeWW9Qnkx5vAP/iGP3it0nA+SzI6gtJ8qAx/kLFWMkCRZ4i44W1\nebeSzAu1eiKKZMCtDjNJhHT7H0AcULv7SVK9V5DJDOT3xV/YvF8n0TkaWvUy\nG9OXJWYJ+oXju2o0YNAOB+D4mEJKR/Vf5Bc5KV1YyQPm1ibZR3ubcj3V5b6+\numx0O0FmTYklU1hhOnOCq9BuVGxA4v4dMQ1nnO4s2rinFC3C6n/Gh9zUmayT\n6HOZPo71J+GPakZw9Vi76qAHw4Ddk3RleWi6IROUH9zhirLzSf+RNAPF7Xut\normqlMSOdZXhKt0GcrNajQvSM0pWZa0Xz2Ub404wUcawzW+ie6Rv1ymuhxXB\nJzO2\r\n=CLXX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW/vQ2kbUhKGMPsMYV2faCWcpOqtEJwqUtp+efHMzDuQIhAKP+2RuYA5yyqUlHMP8zswylgxO1i3KT8snTiM3oE9O/"}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-1_1598555525825_0.930796713124812"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-2":{"name":"webnative","version":"0.17.0-alpha-2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Authorisation\n\nThe auth lobby is responsible for authorisation as well, it'll give us multiple UCANs (or tokens if you will) based on the values we gave to `wn.initialise`. Important to note here is that if one of those tokens, that we got from a previous session, is expired, the scenario will be `notAuthorised`.\n\n\n## Shared devices\n\nOur vision for \"fission-enabled apps\" is that users don't really need to sign out, unless they are on a shared device (a device they normally don't use). You can read more about our vision on this on [our forum](https://talk.fission.codes/t/what-does-log-in-or-log-out-mean-for-the-fission-sdk-and-apps/919).\n\nSigning out on shared devices would be two-fold:\n1. Remove any authorisation tokens from the current domain (ie. for your app)\n2. Sign out of the auth lobby\n\nThis function will do that first part, and then redirect you to the auth lobby:\n```javascript\nwn.leave()\n```\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Permissions\n\nEvery file system action checks if you received the sufficient permissions from the user. Permissions are given to the app by the auth lobby. The permissions to ask the user are determined by the \"prerequisites\" you give to `wn.initialise`, such as `app`.\n\nThe initialise function will indicate the `notAuthorised` scenario if one of the necessary tokens will expire in one day, to minimise the likelihood of receiving this error message. But to be safe, you should account for this error:\n\n```ts\ntry {\n  await fs.mkdir(...)\n} catch (err) {\n  if (err instanceOf wn.errors.NoPermissionError) {\n    // Redirect the user back to the auth page to get the permissions\n    wn.redirectToLobby(prerequisites)\n  }\n}\n```\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `state.fs` will now be `null`\nconst { prerequisites } = wn.initialise({ loadFileSystem: false })\nworker.postMessage({ tag: \"LOAD_FS\", prerequisites })\n\n// Web Worker\nlet fs\n\nself.onMessage = async event => {\n  switch (event.data.tag) {\n    case \"LOAD_FS\":\n      fs = await wn.loadFileSystem(event.data.prerequisites)\n      break;\n  }\n}\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nwn.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nwn.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Apps API\n\nWebnative also exposes methods to interact with the apps associated with the user. This API must be prefixed with `apps`.\n\n- `apps.index`: A list of all of your apps and their associated domain names\n- `apps.create`: Creates a new app, assigns an initial subdomain, and sets an asset placeholder\n- `apps.deleteByURL`: Destroy app by any associated URL\n\n\n## API\n\n**apps.index**\n\nA list of all of your apps and their associated domain names\n\nParams:\n\nReturns: `{ RandomKey : [ subdomain ] }` a map of subdomains\n\nExample:\n```ts\nconst index = await wn.apps.index()\n// { `SqlBackendKey {unSqlBackendKey = 216} `: ['your-fission-deployment.fission.app'] }\n```\n\n---\n\n**apps.create**\n\nCreates a new app, assigns an initial subdomain, and sets an asset placeholder\n\nParams:\n- subdomain: `string` **optional**\n\nReturns: `subdomain` the newly created subdomain\n\nExample:\n```ts\nconst newApp = await wn.apps.create()\n// 'your-fission-deployment.fission.app'\n```\n\n---\n\n**apps.deleteByURL**\n\nDestroy app by any associated URL\n\nParams:\n- url: `string` **required**\n\nReturns:\n\nExample:\n```ts\nconst deletedApp = await wn.apps.deleteByURL('your-fission-deployment.fission.app')\n//\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'webnative/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'webnative/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-lhPLoNW3sjQWwlp/TeHqnuzEYUzPM0FdZTyqV6EG0GEkz8nzpY3R5N90rFRZtGjvCRDt03Rh5zFAbeM72/6gPg==","shasum":"d65b9294bd56256581d22f76ca230af475398ee6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-2.tgz","fileCount":239,"unpackedSize":16363839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSSPfCRA9TVsSAnZWagAAsnEQAIuec0O95CSoTIQNPRuL\nkK1AucDL+YOmL7wgCTliK89QUE4uZjOLTkOUk7vzyODVrYQG4YPP7vDjA6Rf\ngl+GyZ2tNL0rgWgnOLjRdb+c25NVwmCd4G5EeyjrYj80NtPUcP3qwbaCyeVH\nqJAR0V+6c1GbvE9dkCvAiVfaR3/guljbKzPYtPlHv06jlOSbUufHALRWEWk3\nsfbamOFH9Olb7yau5WFVAatXJtoOKaaQm9FLnhrz4P2W6gsm82bwhw+ukP2l\nKrEdZZ+NwA762KIe6y1EWirbx2uU5M59qFo8L+l3NDcSSCWu8D86xprzYC94\nX75zvkWYT4cneSj4ZC8hXoM5Atm+Xiki2y2vlogbFpiOZxWgOE0RJkBIs68y\n5RplpwIAnHkmq2vv4P4KZQ0Ufib+9gLI+pwNA2OYmusoBbjgfBViwCHfxQhv\nEokmltTxI8eSaKsfVXwn8yuBZ25WnxH1pEfFJG6PmDUglSQURF68wg358mdU\njqH96C4A3NT6Nd/bJ6esr+8PdYTsh/g2A09oxCQKqosR7t4aGTZ8WhvohQwa\n4yTt/Y3MDHEYm72RmYSRu+W49ywqy36prr/eLHu+93n0SQgMoMQJG95aPdYe\n87aXwBiN4jwTScxMwqIDNW6wqMHeqcqUVaOdXV5F1V/Hbi0WGN9bDlTToi2I\n5zUm\r\n=ZvD7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1oI8qLOsPsbJABfmhg5r7/s+bMJh8eCd+c9ftXRqXGAiAOXDBznntAlHLA0KyhUXak+Mytt5zCZiAUsnvE5ITe/w=="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-2_1598628831371_0.7445259723928024"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-3":{"name":"webnative","version":"0.17.0-alpha-3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Authorisation\n\nThe auth lobby is responsible for authorisation as well, it'll give us multiple UCANs (or tokens if you will) based on the values we gave to `wn.initialise`. Important to note here is that if one of those tokens, that we got from a previous session, is expired, the scenario will be `notAuthorised`.\n\n\n## Shared devices\n\nOur vision for \"fission-enabled apps\" is that users don't really need to sign out, unless they are on a shared device (a device they normally don't use). You can read more about our vision on this on [our forum](https://talk.fission.codes/t/what-does-log-in-or-log-out-mean-for-the-fission-sdk-and-apps/919).\n\nSigning out on shared devices would be two-fold:\n1. Remove any authorisation tokens from the current domain (ie. for your app)\n2. Sign out of the auth lobby\n\nThis function will do that first part, and then redirect you to the auth lobby:\n```javascript\nwn.leave()\n```\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Permissions\n\nEvery file system action checks if you received the sufficient permissions from the user. Permissions are given to the app by the auth lobby. The permissions to ask the user are determined by the \"prerequisites\" you give to `wn.initialise`, such as `app`.\n\nThe initialise function will indicate the `notAuthorised` scenario if one of the necessary tokens will expire in one day, to minimise the likelihood of receiving this error message. But to be safe, you should account for this error:\n\n```ts\ntry {\n  await fs.mkdir(...)\n} catch (err) {\n  if (err instanceOf wn.errors.NoPermissionError) {\n    // Redirect the user back to the auth page to get the permissions\n    wn.redirectToLobby(prerequisites)\n  }\n}\n```\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `state.fs` will now be `null`\nconst { prerequisites } = wn.initialise({ loadFileSystem: false })\nworker.postMessage({ tag: \"LOAD_FS\", prerequisites })\n\n// Web Worker\nlet fs\n\nself.onMessage = async event => {\n  switch (event.data.tag) {\n    case \"LOAD_FS\":\n      fs = await wn.loadFileSystem(event.data.prerequisites)\n      break;\n  }\n}\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nwn.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nwn.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Apps API\n\nWebnative also exposes methods to interact with the apps associated with the user. This API must be prefixed with `apps`.\n\n- `apps.index`: A list of all of your apps and their associated domain names\n- `apps.create`: Creates a new app, assigns an initial subdomain, and sets an asset placeholder\n- `apps.deleteByURL`: Destroy app by any associated URL\n\n\n## API\n\n**apps.index**\n\nA list of all of your apps and their associated domain names\n\nParams:\n\nReturns: `{ RandomKey : [ subdomain ] }` a map of subdomains\n\nExample:\n```ts\nconst index = await wn.apps.index()\n// { `SqlBackendKey {unSqlBackendKey = 216} `: ['your-fission-deployment.fission.app'] }\n```\n\n---\n\n**apps.create**\n\nCreates a new app, assigns an initial subdomain, and sets an asset placeholder\n\nParams:\n- subdomain: `string` **optional**\n\nReturns: `subdomain` the newly created subdomain\n\nExample:\n```ts\nconst newApp = await wn.apps.create()\n// 'your-fission-deployment.fission.app'\n```\n\n---\n\n**apps.deleteByURL**\n\nDestroy app by any associated URL\n\nParams:\n- url: `string` **required**\n\nReturns:\n\nExample:\n```ts\nconst deletedApp = await wn.apps.deleteByURL('your-fission-deployment.fission.app')\n//\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'webnative/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'webnative/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Kz9ZPCE1RCk4TmNSWF27Saq1AS8NCN/w8wBklO7pOYvXDM/4MbGqmXp4qiVM1Y2avDRZy/2TKwnu/JoUgl5AkQ==","shasum":"c3fb359c8c5e1fd2141a4affd7612b1638892e51","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-3.tgz","fileCount":239,"unpackedSize":16363910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSSy8CRA9TVsSAnZWagAAdwcP/RdrTtqoc5J8PrUTXCua\nujcyrnq3Oe+IcERxXpZYabUyCgIO8QXaShd2I6hcTliL762tO0CpQaV9Y0ZX\nMPDYOEk1G9rUpQmLx2H6DxsgmpCgNADueheeQLxtPad9qkX9+p5C8OQsogWE\nEBjyloQMPKDOtfQz5sU4LLopau0T4DUNYu2E42TRhCsbySpNwhNv/WUDUSMU\nWyDUX5Htrd0fYR7l4gWCCM15diTnsQ7T4F2SUADg3KYtakc0+ZRDsj3v6fYT\nkHM2eghZXcfwTqOBw7eULujqE5NVZxy8u20JdPGYV1dE05Z5f1qAv1yXxyvK\nX2zUrqakjklAbTFpHfvK0byH9f0VT5dsR1gjDgKW+6e3mg/7KIqCl+yXFFY1\nva9GrjtdMK70MyvPTAYJ4J0T/YtlavoGct17sHPYne/Hy63+4maCcRC7GJ6O\nxpzCs1v+ykZ4OeiI46N9p/xyvE3Ck0TXKSCR+i44Ek09mMqpjBFMJtobaXIX\nzecNWj/T8E3EhCll39fXf0JmPbjlmOd8eGbPFbFiCU6K/OYZ1KgmxLG5q7ZX\nC+Tgnl6MEFfpznCZYAs9woqbZN8ak1VTYwvyokha+sabOZWTCf7gVZ2T/X9W\nhbOxt6VF3E5UQPkw0LeE0AkmAvMJqc9Ml06TPNizcYEGCi6/TiXdfLLQySrR\nVhJP\r\n=CwPG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBdxH9nOrBmKofVZJVOEvS/ihAQwNqfSmFIkgKtMLuWgIhAMBaXD8o0fBtXJSSf67ko3tLVT69aaQfDDBcB9nj0/+/"}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-3_1598631100159_0.23573246422873306"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-4":{"name":"webnative","version":"0.17.0-alpha-4","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# Fission SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission provides app hosting with user controlled data. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\nGet started making fission-enabled apps with the Fission SDK!\n\n\n## What you'll find here\n\nThe Fission SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Getting Started\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n## Authorisation\n\nThe auth lobby is responsible for authorisation as well, it'll give us multiple UCANs (or tokens if you will) based on the values we gave to `wn.initialise`. Important to note here is that if one of those tokens, that we got from a previous session, is expired, the scenario will be `notAuthorised`.\n\n\n## Shared devices\n\nOur vision for \"fission-enabled apps\" is that users don't really need to sign out, unless they are on a shared device (a device they normally don't use). You can read more about our vision on this on [our forum](https://talk.fission.codes/t/what-does-log-in-or-log-out-mean-for-the-fission-sdk-and-apps/919).\n\nSigning out on shared devices would be two-fold:\n1. Remove any authorisation tokens from the current domain (ie. for your app)\n2. Sign out of the auth lobby\n\nThis function will do that first part, and then redirect you to the auth lobby:\n```javascript\nwn.leave()\n```\n\n\n\n# File System\n\nThe Web Native File System (WNFS) is built on top of IPFS. It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree. All information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Permissions\n\nEvery file system action checks if you received the sufficient permissions from the user. Permissions are given to the app by the auth lobby. The permissions to ask the user are determined by the \"prerequisites\" you give to `wn.initialise`, such as `app`.\n\nThe initialise function will indicate the `notAuthorised` scenario if one of the necessary tokens will expire in one day, to minimise the likelihood of receiving this error message. But to be safe, you should account for this error:\n\n```ts\ntry {\n  await fs.mkdir(...)\n} catch (err) {\n  if (err instanceOf wn.errors.NoPermissionError) {\n    // Redirect the user back to the auth page to get the permissions\n    wn.redirectToLobby(prerequisites)\n  }\n}\n```\n\n\n## API\n\n### Methods\n\nMethods for interacting with the filesystem all use **absolute** paths.\n\n**add**\n\nAdds some file content at a given path\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.add(\"public/some/path/to/a/file\", content)\n// creates a file called \"file\" at \"public/some/path/to/a\"\n```\n\n---\n\n**cat**\n\nRetrieves some file content at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `FileContent` (`object | string | Blob | Buffer`)\n\nExample:\n```ts\nconst content = await wnfs.cat(\"public/some/path/to/a/file\")\n```\n\n---\n\n**exists**\n\nChecks if there is anything located at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `boolean`\n\nExample:\n```ts\nconst bool = await wnfs.exists(\"private/path/to/file\")\n```\n\n---\n\n**get**\n\nRetrieves the node at the given path, either a `File` or `Tree` object\n\nParams:\n- path: `string` **required**\n\nReturns: `Tree | File | null`\n\nExample:\n```ts\nconst node = await wnfs.get(\"public/some/path\")\n```\n\n---\n\n**ls**\n\nReturns a list of links at a given directory path\n\nParams:\n- path: `string` **required**\n\nReturns: `{ [name: string]: Link }` Object with the file name as the key and its `Link` as the value.\n\nExample:\n```ts\nlinksObject = await wnfs.ls(\"public/some/directory/path\") // public\nlinksObject = await wnfs.ls(\"private/some/directory/path\") // private\n\n// convert to list\nlinks = Object.entries(linksObject)\n\n// working with links\ndata = await Promise.all(links.map(([name, _]) => {\n  return fs.cat(`private/some/directory/path/${name}`)\n}))\n```\n\n---\n\n**mkdir**\n\nCreates a directory at the given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mkdir(\"public/some/directory/path\")\n// creates a directory called \"path\" at \"public/some/directory\"\n```\n\n---\n\n**mv**\n\nMove a directory or file from one path to another\n\nParams:\n- pathA: `string` **required**\n- pathB: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.mv(\"public/doc.md\", \"private/Documents/notes.md\")\n```\n\n---\n\n**rm**\n\nRemoves a file or directory at a given path\n\nParams:\n- path: `string` **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst updatedCID = await wnfs.rm(\"private/some/path/to/a/file\")\n```\n\n---\n\n**write**\n\nAlias for `add`.\n\nParams:\n- path: `string` **required**\n- content: `FileContent` (`object | string | Blob | Buffer`) **required**\n\nReturns: `CID` the updated _root_ CID for the file system\n\nExample:\n```ts\nconst content = \"hello world\"\nconst updatedCID = await wnfs.write(\"public/some/path/to/a/file\", content)\n```\n\n\n## Web Worker\n\nCan I use my file system in a web worker?  \nYes, this only requires a slightly different setup.\n\n```ts\n// UI thread\n// `state.fs` will now be `null`\nconst { prerequisites } = wn.initialise({ loadFileSystem: false })\nworker.postMessage({ tag: \"LOAD_FS\", prerequisites })\n\n// Web Worker\nlet fs\n\nself.onMessage = async event => {\n  switch (event.data.tag) {\n    case \"LOAD_FS\":\n      fs = await wn.loadFileSystem(event.data.prerequisites)\n      break;\n  }\n}\n```\n\n\n## Versions\n\nSince the file system may evolve over time, a \"version\" is associated with each node in the file system (tracked with semver).\n\nCurrently two versions exist:\n- `1.0.0`: file tree with metadata. Nodes in the file tree are structured as 2 layers where one layer contains \"header\" information (metadata, cache, etc), and the second layer contains data or links. **This is the default version, use this unless you have a good reason not to**.\n- `0.0.0`: bare file tree. The public tree consists of [ipfs dag-pg](https://github.com/ipld/js-ipld-dag-pb) nodes. The private tree is encrypted links with no associated metadata. These should really only be used for vanity links to be rendered by a gateway.\n\n\n\n# Customisation\n\nCustomisation can be done using the `setup` module.  \nRun these before anything else you do with the SDK.\n\n```js\n// custom api, lobby, and/or user domain\n// (no need to specify each one)\nwn.setup.endpoints({\n  api: \"https://my.fission.api\",\n  lobby: \"https://my.fission.lobby\",\n  user: \"my.domain\"\n})\n\n// js-ipfs options\n// (see docs in src for more info)\nwn.setup.ipfs({ init: { repo: \"my-ipfs-repo\" } })\n```\n\n\n\n# Apps API\n\nWebnative also exposes methods to interact with the apps associated with the user. This API must be prefixed with `apps`.\n\n- `apps.index`: A list of all of your apps and their associated domain names\n- `apps.create`: Creates a new app, assigns an initial subdomain, and sets an asset placeholder\n- `apps.deleteByURL`: Destroy app by any associated URL\n\n\n## API\n\n**apps.index**\n\nA list of all of your apps and their associated domain names\n\nParams:\n\nReturns: `{ RandomKey : [ subdomain ] }` a map of subdomains\n\nExample:\n```ts\nconst index = await wn.apps.index()\n// { `SqlBackendKey {unSqlBackendKey = 216} `: ['your-fission-deployment.fission.app'] }\n```\n\n---\n\n**apps.create**\n\nCreates a new app, assigns an initial subdomain, and sets an asset placeholder\n\nParams:\n- subdomain: `string` **optional**\n\nReturns: `subdomain` the newly created subdomain\n\nExample:\n```ts\nconst newApp = await wn.apps.create()\n// 'your-fission-deployment.fission.app'\n```\n\n---\n\n**apps.deleteByURL**\n\nDestroy app by any associated URL\n\nParams:\n- url: `string` **required**\n\nReturns:\n\nExample:\n```ts\nconst deletedApp = await wn.apps.deleteByURL('your-fission-deployment.fission.app')\n//\n```\n\n\n\n# Building Blocks\n\n**Warning: Here be 🐉! Only use lower level utilities if you know what you're doing.**\n\nThis library is built on top of [js-ipfs](https://github.com/ipfs/js-ipfs) and [keystore-idb](https://github.com/fission-suite/keystore-idb). If you have already integrated an ipfs daemon or keystore-idb into your web application, you probably don't want to have two instances floating around.\n\nYou can use one instance for your whole application by doing the following:\n```ts\nimport ipfs from 'webnative/ipfs'\n\n// get the ipfs instance that the Fission SDK is using\nconst ipfsInstance = await ipfs.get()\n\n// OR set the ipfs to an instance that you already have\nawait ipfs.set(ipfsInstance)\n\n```\n\n```ts\nimport keystore from 'webnative/keystore'\n\n// get the keystore instance that the Fission SDK is using\nconst keystoreInstance = await keystore.get()\n\n// OR set the keystore to an instance that you already have\nawait keystore.set(keystoreInstance)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-4","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-pPVg04BN6UfxTfIEf55VO8lb0RIxYYoWsWWopR3e1CGv2oasnbNalFbnrIytlVQ1s1ZgYOeJ230p9LDPi35uig==","shasum":"8e0ffb531212e8bde9abaa5b8464801766f52489","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-4.tgz","fileCount":239,"unpackedSize":16364508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTQfFCRA9TVsSAnZWagAACBAP/jpjSbzUnW04d11L/FDw\nOhWQnCg8qYmtJyUOMrMGh7zTEAtkHEX63S58hHbRZe3tv6QLcCAEQ0+Sia6H\n97WZQmwF1G3fxHoMFxNY2MOSW6V/nrjcsAfSjAb87s1hd7y2/6MDvBXGCAja\nHDaKSBPNthXtdr+6psxUlB7ODDOuThUe0OjWR+9tIIcnhoSphngMtKMIRHdy\nh3TvNrKjCNh9SLurJqLtX4pcd0w3+Z6+CrbsogYNYQlmhPcL9To9ZjF9JEVv\n12PAHKYYRzOcK3+0uXtWJu0GN82ZCsqOPckz1GX9UO5lSO63LYb0El9LPiOt\nhedOioKNj1hXEbEjy6OpIOzOulqpX3ZCwWe1eNfZM2IzWhyHVU0GdL83FKTw\nY/shCVjctvMJ26KlTtZYxUnSCt6UP+KxYS4qh3UNobirc0DaGgDSv9PXiVfo\nUgv1RqnA3g9NDDtFDRMHZ/vOAvJ1kX6VVNkzV2j5MFC8BG4f9q4RZsjbhqgt\nNOofGdtJeonT7oL0gSiSgdjuz8dUDSd5Cq1HwfLcWSPugdUWJ+5Mmhkqv/eR\nrBoJIUFokRdq7c9/rCTn6n5+UcYwgPQtQnu9XwNfrc+2feVSNGQ/LpOau6No\n9Yc6niSl7S4XRlyqGNX8NTox3ntZ1H5Peme8wl1EVLY4h09DYyHjMkxypMxa\nGEPn\r\n=AY1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7Bho3N0NwoZ6D/MyNP8ZWemCfSYWqle6NE8pcWNcZlgIhAKsJ2U2L8yJpZPtaK1tyy5P3sMdtm2ZLJAP2L6rCxFzQ"}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-4_1598883781251_0.022902633021806507"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-5":{"name":"webnative","version":"0.17.0-alpha-5","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-5","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-IevTKb5vQ7k8QKkiKA8OQRQkrzGsfqQZv8TyODSXFauFa2jvpjOvENDKxR1YADjdkcSS30HpluSNgGr4oRtddA==","shasum":"45ff4cd60c8e74cdb8f8bcf450d30cf2189b3359","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-5.tgz","fileCount":239,"unpackedSize":16357759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTo5gCRA9TVsSAnZWagAAMgQQAKJA96r6AR3rVoZ/wKwD\nKsV6Hnss4DxQuVwaM6EJPIaiU+8BccXzZp4J/QaClVQr4YTpmIAcREzdzd/G\n4PDoXiK2Z62saS6NMY5sCi7lHmfcZ/OZVHwkNrHVIfZcywfeRdJrgujdLUM6\nL8+Ar0jTeEtWDdWD1qKYgdgVnnXaUwMPpdUWmAU5CR3k/Pta3X1wLptSQMrv\n/IHgl8MDbQDMtiS6xC0uJOTxAx3lakEAvO3Gi3JOTZu5VUCPI6GeK2L/RWqc\nUulXfIgPDkpl/aC42bou7htY7j4GHWdWmLxv0ecKhgOLMwtoQ8U1jkNm1DjW\n23nT2hdFlzfnZ3tAzBilpuvDe1wviFxy60ReXUIvSrQ6TUjfjjN2y0wHm972\ne5VO86MqH22kcbJ38CmUBU2sO0WpYlOxAOuIKV6nj0Sm957pC04dfmNSOrFE\nbkGSKRow39DIt62qAR97/tWG3qcNJK5R/J8v2IVK55fxuvwBLDLoJY+xAWea\nbmFcquz2MKRBuVynarwkoK0nR2bRld3U1CvCB/ZdXyI0SezleKBrTHpv5/YK\nsbW8e+QM3MKsh/yFwvAAK4HF2CiU+hmewf4UNq3vBmjuJXp+1tlMxoxjZrm8\nq0R4z9Yzlbo9LvyemQvsClJQcTKqluZUNZuFEzNARe6HhUM5ot6HIW1JKLjz\nyZxL\r\n=/j4D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEuF/nWyc4e2j19SKeZeq14VHIByXy070euePKvTVrtAiByOS1RSLf2bY/K8UCLwJgH2W8sE2ltbcYN5ION4UkAzw=="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-5_1598983775608_0.7240413305994695"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0-alpha-6":{"name":"webnative","version":"0.17.0-alpha-6","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst { prerequisites, scenario, state } = await wn.initialise({\n  // Will ask the user permission to store\n  // your apps data in `private/Apps/Nullsoft/Winamp`\n  app: {\n    name: \"Winamp\",\n    creator: \"Nullsoft\"\n  },\n\n  // Ask the user permission for additional filesystem paths\n  fs: {\n    privatePaths: [ \"Music\" ],\n    publicPaths: [ \"Mixtapes\" ]\n  }\n})\n\nif (scenario.authCancelled) {\n  // User was redirected to lobby,\n  // but cancelled the authorisation.\n\n} else if (scenario.authSucceeded || scenario.continuation) {\n  // State:\n  // state.authenticated    -  Will always be `true` in these scenarios\n  // state.newUser          -  If the user is new to Fission\n  // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n  // state.username         -  The user's username.\n  //\n  // ☞ We can now interact with our file system (more on that later)\n  state.fs\n\n} else if (scenario.notAuthorised) {\n  wn.redirectToLobby(prerequisites)\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publicise()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publicise()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publicise\n\nThe `publicise` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0-alpha-6","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-k4lpYJXBC3HSMIVF5+P5x1Ak3rpAikkIroyJlnpJ9y2Q3WiAw0UDPg4Y9dwZmeb2qo2ikFXZceQjNTueIvcA4A==","shasum":"ced96cdc8aa5e08a94a1c4935d6868f4c659e00b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0-alpha-6.tgz","fileCount":239,"unpackedSize":16358955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTpjUCRA9TVsSAnZWagAA5dEP/11ilHd0Gg8kV1daSgVC\npC8z2dwbkC6pM1/Drkk8fCvM5P6dHYWl3lapGqySI0JToGCvlRBvYKEPhte8\nLzaPGUqhZCilbn5JqXzXAoJE001dQY6DGEHERyJWKj8IcJQghIPe6qbjKQtp\nxTVJJ15xeNsGMEt/u+K3HOHdUfeNmSEzrvrQ9gkdzHlNxDPMX+mR0Lly/YuO\nJICOOA2E/tWHgx6w/9gpurR5K7nclkBCxj4iH1X3Pe3AQTtBUGxAgFPPt3t/\nt4ZsFVaV8QwWmmDVDk3lko6RmptS3vFjdl6XIB1kDr1/hEW3TjmqKUf9yEyJ\n6AKQepemvco5f97+0qQlQ0xAAHYVPFDWylyDdPxm/hlblXIXkglc6dzWunla\nzljcVbBWmFFcL7fbOEQxlm2QziD5QZMEVxq9eXNhHkM1KSHZY6XHcePsJB+t\n57C47kh4G+E+JH3URnWvhjqy8yUQ6HYNa8gZJBvia2ikDj8HflJjvlDg7ehU\nqpENslAYbtpodsoe6aSMrQ2DEamFR0sFwX0KEXRYc5Q03hdvjvf8b21x96jl\nl4y/x6jlwd7+OTaKYHSzKZDEmULgh/CnnCldSfI624MmDS6ukvsnC4yrP4uz\nsw+kTf/82J2acRSysK7sGPA7zYyCfQv23DMmcqPDn8wS2GzhGmAPo3fV4O3M\n0aeo\r\n=EJzP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHG7j8IGvYdQEe3VE2DUjR0Zx4QZsiw2Ojg/Qq0WNhiwIhAKZC0gOgjVe4uy8pcoMJnvjL+xixRDuhjw7Il/CCUtRH"}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0-alpha-6_1598986452099_0.7748637626033097"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.0":{"name":"webnative","version":"0.17.0","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+Sbld435bHnn7d/TeIYanO5x5Bpm++aaAyLotor+PVRGAROabui6CO7r4TWid0LE/tTzDrGAE+UQRyhvw6Wn2A==","shasum":"63a306a9efc9afd484bce7a10c9d3b374c0af138","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.0.tgz","fileCount":239,"unpackedSize":16358947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTq38CRA9TVsSAnZWagAASGAQAKHhlWGfe+/QcSBFqad3\npZ8rqpHDzw4bFRNgo6/+kcybXlpR3MQxXhC6De7WyPmQ4tYOYTaGe52TAp87\nxcGUOtMDdr60my8OqDBtX2aSMjDhTFkT6XJm701r5QK5/OOPqHYmzw5PrzUO\nheGbu/IvLZcf1qVcOesqDgYTm0+WjJ4/efD7pPqHM/bxGIcIcPhtCIOsyx1u\nYYb8vLDJ/VeRfwka4wD0NnSu06CdEabjtJRDroiUbcEaGipJQfjA9iGNLsG5\nnipH2eGErUk/2QLP3wUpvbJr37CVExnYGcEnNGG91gooK4ffSuO1bVJdGDMf\nlCa+1gMNz7XTKj9EuOXcW/KK0sOdf1tmAlTyayn6+QuuLYoqIaxnWJfkXsUY\ntA1q2KTr1SHwezD9p0hZ4O1tm5F0aax57e8jvoKyrdIbkXIWu8yvQRpoiw8U\nD+EYKydSdjcHls+cQ91Jqif/ramQ7+eDcZHA1CM20iZDzzhLJcuZGrs3ibnM\n9VqChu4yq8AF0HqaUlfZoWSkZaRDHCCRNWKS5cs7ZsIFtW0ETtKUtKvzh3YL\nl5l4hWVJw6TIHZY9Gxw7ARkhAB4VTvbgIqrFd5MAZ6GtzTbexE5vmR71oxlT\nLNv9cjrG6+kLr7U9mlTUxf8ultUDp8uSIxttpBMsrhzxPLW29xqC2tn9pA9N\nIdZc\r\n=8yU1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzj8p4Gz/+MqQ4vvwM1g9iacOn2QpzuyumGn3f2CK7dwIgHEbAEEQAYJ+8FPzc3tESFP+MeyCpQoCxHlvFQ4frFWQ="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.0_1598991867496_0.3659139020372002"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.1":{"name":"webnative","version":"0.17.1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-KTF+iU6rdewMlm9InwET31eMthCGj2g3MCT0gGYjpagpqIhPVZB2FgF8FmuT6FzlGf3oNdQz9pwrSd8EhgnRsA==","shasum":"221ec98d586c631ec0934acc35c3a1f6396946fa","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.1.tgz","fileCount":239,"unpackedSize":16360052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUAhCCRA9TVsSAnZWagAAMhwP/Akbh0vN4YfSsiCMCryw\n1KFp/NtCCAA5CT3+HntX9F74V8OBUHfYg33Vo+PWPJiQK19jQlD+rXdsasSS\nf5qFotk1GQOyQ97boHerGpB4n9A5S2Dou/b9X0/FLfqua7PY4fDntw6d+ntX\n3CDaP2CJnv1TzHXbEbsHxG5DHCQm7hHkOlO2BMeXxFwP56sODrTHX/xDwfV8\nWIOLf36C6kxd44n3ejzpyGwlDvqmeHTXqmllyzHvj9i/NHAAA5HtVN8H4+Ak\nF+aHfYqko2pNsVm8pXBTCrC7sRdKRXsOKVHOBpfJMJUn6a/z+tbHq1imw4Y6\nkbzc/g3eWqu2u5CGn2C8aMFAGQI4mkO/c9GwpWX38VXrI/hm/yEtPLeR1Zzf\nA0AjazV8XoECY+agnG85qQVOH7znIwp6yPX3XfmXTQlFAhXd6x5beOyg0MzL\nmHPBHZgy7xWeiFaMxkhCs0fCV34pvWAC3UtynJRAVQ8/C/OAF1jDLBfQid2s\n6qK8IqxN0wk2kWyoDFX4zoekkir+06VLVNCTsNaWMEzsdeeJkFyDv1GBCi6F\nwmp8P9xbMbpQhZnfXnfRn0fMRIS/7q5AGLN8CZ8OE6DtOYJJD2ie0gX/YGPO\nfRVQYudoyH3dP4MyDizXn7WQPi2YS0819bLpeZGjPsJw3b/dvrrREL7o2mm9\nOrBM\r\n=1w1d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ98RJii7xn2eYRnd9HpKguKVucDFe5aTI6UKVQRqWvgIgamc2G8Lis9wmjRwxn3CkNUGOS+xe5WU4/rT/XOMIQoE="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.1_1599080514386_0.33244979528843777"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.2":{"name":"webnative","version":"0.17.2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-lA/NPhimf2cnKqdp7Zsvt+J8IQrjn/2ls4bEaPhXBw09linYzCTttNhF6zJacpELjTdfRwgc8lTRKELg8ZG2rg==","shasum":"11fbc8d1c7e681b5f66192f0ef0b244d2265f8e8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.2.tgz","fileCount":239,"unpackedSize":16361905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUSnLCRA9TVsSAnZWagAAc1YP/058IuGo2dbqJ6UCWhnH\nEQoBVuviet/urU1vbwXNx60045jADOD4KPZTJzCurc9e3Rd92DnG5Izj3hVB\neYyInZPsoLdmCTG/V6JLWpV4d0G87xQOYLZiA5lZNe3Tmeb1SA8UkgShto0H\nBjIwrMv1xaLE6rXlPh3b29EVz29+jeNabMW7zL7klgnjt1Ic2hOZp66Wd6IU\nGVmBWemdHb29lBb7HfJZhjsxcy4BXNR0bTDyTvfgAOtHzvVX9/mg8vePWItm\nhYBagsssui5upFKpUSv7lCDmUK6qGJEMcw1gz0OJ9LSGCbSeKjK4x4cURtsS\nidfkrn20txu1SiESvbe3Xk/xF0xdA+BLQAGgNvpuu40fLrgnM6VbrAi4Ut3r\ndBoSzTsaBFCMLnGOu4C47pTc+DGfU7+hjxiZ1xMCuNlJDsiUc2r6RDiNhC8D\nqZ8y1YH4qz9L8o+CF9JHMRodvhViUjh8euNC5x4+3kY9yektDEwcvELbOVzc\nwoBEILdBXxskTRvJrjyZfIdJTemtPTt5zof2C5abBgFCIilmaQ+RUwJBTJ6q\n5j8KexXknamlFhqYi51kNDRq7X6mAbtmhFg+tCphgh31T3K8SXKevlcHelBg\naLXSfwd1WA15lr+8uhBjZCOx2UCvYz5/KuWN+gvmC7JBZdSwO05owbPSBo0M\nrZ+a\r\n=v81A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRUC4T5JBDsJKl79YuFdTs8ASJS0C9/pjeohCWmdcqiAiBmKpxaNopMrc9gYY7BSJZ3eHnAfcqXQOLr2XPxHNmLdg=="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.2_1599154634232_0.28021150899514513"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.17.3":{"name":"webnative","version":"0.17.3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.0.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.4","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.17.3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-aFNN7/JpHxGIJmiq3JR42EAELbjR6+iiqA8ljRciNrNgP6HI/EysPfucXPYneu/2vUcPQJ9MoSrjJa07n3MgLQ==","shasum":"e12d6ff5970db4772dc00c1cc6cc9f1b8fdf6c22","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.17.3.tgz","fileCount":239,"unpackedSize":16361905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUUuCCRA9TVsSAnZWagAAHYYP/2QvEJIcCuHqWqM1bQc/\nWW1JR1xpGzU4CJ0Ga0pXrd6HlGZqoGm2jykzgXW8Z+bFbAh7in75xHMiD2Gh\nTURMN0OgLYpVN07hYgjyM5tIZluGmfCPK2+j6V3xuUsg+GyD2gUrXRxZC9VS\nCGPZ4HmnYCQajcYG0wJM6zWDAokeaL02J5GdRhXrdblZo/NKiESPk0BJfPug\nKDBAAfVfl8wGSmv4R4LypyDjETA+G/Tvo1xbt9VlOeeomNjGGbbUNRiDALhB\nvcvkt8jeRfFDvvZtzyJW8PeKaSd01BL/c03Mk2o1sLsjtjXHEhbqzMjwp+BV\nGHmWwhmkqQqxGtU8DDGIRDGD9YyyMWxEbPruEVq641PUdPgStoWInrHQIQv/\nLWk9dyqJ5sQS9K1M4iW+OqjslEn3kJQKQOajpWQbtHJdxuZVf/W9hGJw8uHO\nIQBCkkSz7isGJtandixzreFK3ALdJTBxDlzUfWb6Kq03t/YPhPtNbEwKSF/C\nvMKX4juPRjjeqScORA7tT6Daaw+xYPJmKSR3aK4h+OvR20wyEi9wlbKy4SAe\nC1+Fj01N7rWN7OcMbt7yLSDp68IljW3iI4t3FMFjVM2N7+/hDu2XLj2UuN8c\nOCO08YoS/NOPnLutJ8hHcUo/LyG+EbyAPUjWN83gImlS3urUt4p1LyfKzwxq\nMbXb\r\n=hM0l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuY3kdFbndrUZaWEo8BjqQqAjQkc65nlONxENYQeO7OQIgO72+uSjL8sI0UEv01v9Jk6lNxvkgqMiQj4r9q9mcc7k="}]},"maintainers":[{"email":"boris@bmannconsulting.com","name":"borismann"},{"email":"dtholmgren@gmail.com","name":"dholms"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"icid.asset@gmail.com","name":"icidasset"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.17.3_1599163265471_0.7512475982597935"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.18.0":{"name":"webnative","version":"0.18.0","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.18.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-V+Mgzhk1FDdpMtqAL9clvIT1BDm9Z4X2p76l5C2TuroYIkyRg5XM1Hxwxb0HLFXcLr7EjlZkMRFPbtPYpC7bFg==","shasum":"8739e60dc0d0ab16966b6c75401c7d4ce63e2ce0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.18.0.tgz","fileCount":243,"unpackedSize":16371081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYP6WCRA9TVsSAnZWagAA2i4P/3NSfKoHu8IA4kooqtNv\n0Q2CKzeNrgMSZqwveTFVbo6AnmnAQveLJ/woJ/TAIHxGXtqqJtuOm2gjzGf9\nNojefJmpS7+skZ4lwOQ5QLjFejj2hhiKP1nkaJUEEa1gnMYWUYAbjBwLW0N/\n6j7K40+SsbhI/Mu5u8XWIrLWp0hfFTunstSBjwWJeOzU4CyeFHMb3ctGTKzI\nLNI9XS+6cnKgCcFiC7kuNjceyfp28ASdlvZktbStSwOvUcO2BccAol7zX1Q/\nAa6rWlEXI5Uh7E0ZZeb3gRTlUqzMqQ0BDunaDyUOLzd227XVxxLMbqUGNrpm\nr1dgHXJBJG1KwcVgxIcdSZ2wAON19mM8lp+2+9Kb26IzCY4wUTJTrkZLSPbq\n/WAwTCZxjAKbEFBdkr7rx/34yp0qptvEIou7EmODiVL6U3IwkZhVC9e/EAUI\no7DXUYtg8ycFxtXXL1QNUyrR6LzQPo3uPUNXKQGTw6Ry+GgYMwOYilo29RQp\nFG+jleWIm8pURmq3n8f0q4OVXKTU0GWAn0GtBz7uDs/VERDHTFsk0Pq5o19U\nDOyq1hX7W9Slx/xl1iEs04jSLaLgB4iNvtXDe8X435dRQJnu0U8+q0sDBrSA\nxZo3hK+s5aHG8YDDqgKrEUyLmMHPlsnsqs+75G3Ilk2cpYmOvFXqO7xN6pxq\nILDw\r\n=a0MG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPdzFAiPSNIEnI4Ybl3noBsLBAcTQeyQ59GM3aOjcVhAIhALY31a+znEOpK1a6RMjNwpEDE3bpj59C0R/XEOxbU6SH"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.18.0_1600192150245_0.26470838841736555"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.0-alpha":{"name":"webnative","version":"0.19.0-alpha","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.0-alpha","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-gyfO9t3Wtb/6TGXYm9o9D2YzCgalhupwmzRQW13B8esZYljX0Jw9FSyMtOEhvze+72yAW8z2XW15W8dTYphsmw==","shasum":"d918e8e9f9a8115538d18d4265f01abb0bac82a6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.0-alpha.tgz","fileCount":243,"unpackedSize":16409223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYTx1CRA9TVsSAnZWagAAtbIP/j3CWOfvDmpgeIBgREXW\nopF6o2miEhaGfMbKLPnlk7W0mjEr92+p9Yrvhggx1CP2i65pdAHSspmT0960\ntHofD9fVmbSjbqZ6C5aqHz+Lkka7R3ZU2y5h2e0SjjnYUY8r2IC7y1KqBrUJ\n02Wl3SM2rR5hMfY0cxDtIDIxX32dHfN6pgw1cSyLv6PInVSWrxAEFtJGqn5v\nPQObZ3mzA7VqxskP8FAOif6o3PTa1adaJyHX3uB+N8nrMttYVSiskLhAuy7A\ncvOMoL5kTnBv6w8wt2rO9KkW/23/+RiD3F9PMib4ZwhAZe0HNBQU+L/eybbM\ntkCmHGVxCUvmwAL1veNSyT1p8Ur+/4LQP1VoP31FamjvXUYYgQ72cNOZjOdH\nywmCV+w0ZaT+xwz9f91f7flhlIWzaMTQnvhbRTg/4IvvN0UysVhtP1zGat65\nrbCdGPHNoZQs604iV+m1odNUKU1A4yN0xBUW6ihSQwZBFbWQs9U9oniTczNr\niMrfwms40lGhbsOchP5Nz/KXRkydYlfhlLANxg3y8gnnTohutme6U0Q2MbDd\nXxUAwLqGyImj+x9Q8dfPFSR6bYwC3PtANOr0Ulfmp4MXECRzS3rqVkA6Dbyv\nlAT4DooOo5GToiZdvQD9uoAb2JH1JIaONuo/MQ2H5el8s1x6tRzU6Nr5/X8M\nbUUm\r\n=zh9v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFeJd/wl2fX2rQMhFWjS7TD4GUQmGOvZZTKgv1JznM6MAiBGvl700dFQDpKJqS1NU3sYAZyiLdWqGM31xKNgXHutJQ=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.0-alpha_1600207988793_0.4108921889473447"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.18.1":{"name":"webnative","version":"0.18.1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.18.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+Hn7tv9/Od2KOqlJw4NgE7gkkP0JIUAX+qlKQMHFPrq7Xg498ZdGJpkFjQ1FCkaZJfw8h2gR4kNEJmjIvrAk0g==","shasum":"3f969e4ccc956315dac61b3c4aa37ba1b9fa9098","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.18.1.tgz","fileCount":243,"unpackedSize":16377919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZLu0CRA9TVsSAnZWagAAuZUQAJeEWFOQR9K8Rty1Hu7a\nnIEKpj05IFJzm5kBXkHWIfYArRspt+8EdLlnDcjx2S2kwLqqZyMQuB/NYVio\ngrOi7rrWj16Z3f2zRWri8OrRxQIewKRbYwb6TvQ1C8FH7ec7b0Ikz5ATlGKj\nqxWQL8pTR2ug8qpHLYrQ2SzZZuWk4DZ8sTAIuUwbyzycm8TuXCvTwomszbmn\nuAJzF5TDq2rATX+z6FCHkAWai1QNkdL1fRZfkfbQTzWTHch7Oy+rn0TxjfBR\n5C3Iw6yB3EJwRRdwiU/ajfO7lIBHpaaON8uYaIeVgenkN3A3laVDpEk5T4gs\nvTlJIsd1CjTfGbkHERVCZBNAA2gEoPgd1lEhwlnWUGsgMht661EchAJTLF8Y\nyt7JgeyU1cf5+XIq2rNitrlTkPXIgridLwBnR5V+vYH3Bm+N2DAHQLzquR7s\nLIy3NJ3U/0TqO8Aiqx1hyNMhs1XqRIkitt+BMmVH+9YahJ3EebP8IlkdWLIV\nWME2rm6vlf/MAGhGuiomlF9RqLGOXz4NOByQvkI9nmiDvXF3Qa07ni4Fc/je\npQHAXoP9S2BZh3GM9Lm1hi7I4C+NhnJLbY7i/j+4CHcvp9Af+JV7nf+YuvT1\nhx1wQ7V/txz+o5I7cX7WB0S6LpFZex8Gftxds3Y2YpxGYOpOWQzp4u+rtHT0\nS9sN\r\n=19QO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO/VGQMAgBK4F5/biE89ETUC1V+GoV3ImXB3RQb4y3qQIgdT5yO5wgxe64qAJ8DG+nrW0PpbBY79/6vLkFPvSMdIU="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.18.1_1600437171732_0.8013705135919009"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.0-alpha2":{"name":"webnative","version":"0.19.0-alpha2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.0-alpha2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-0Gxz6XsbAFcgOTmXjNV0QnEt1r3JX7AuNLNAIBmROx4Vwy12svSTgXv/2B16BQfvKmMzQFgeQBu60KDT0tTYvQ==","shasum":"6487f0ae426a998560ee7f675427a65f29d2285f","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.0-alpha2.tgz","fileCount":243,"unpackedSize":16427935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZOZ+CRA9TVsSAnZWagAAjzIP/jzA3wgxlDtkoYFHTAdW\nzZA8vr7M3L4JEUT39rh16JbxQRUCeJrna+pTWFkdC/kFx3v7sMI58ouzjKYz\n3FT2NveVvsBQkfCHP0kGoANOCKCwLjuGVXhLCQStzc9TPz5DmbQI5+QtRZ7o\naYmmJWnC9DTAvk57CTyY03hL9RxzFQT2PbzvMtx8rDe5ir6VrE5gvcTu+YiQ\nOLEB+l6xZqrJ3q40iyD1TKWudhfRYVN8ZDiLos3gjHEnS9G5GAXqum4Df5Ll\noKyQTNriRVotpFXHcUIKXrk6P7xClwaB1Qose2Go6SmDjnS04CtIu0TtwwW2\nG2mavN3270kDPARV/ji8Q7A1Au4DbsYBeoPqcrqG10YhCZtJrBlQimCzfKQm\ndUCTvWJZtDfZmoLESiOojBSz8tGvPpbPnEvjSGIcrcuOKjsJ48WVaq1mn17R\nTpbjhz32VObCm7t4qPj7f42aSvsHi8mfhITUeKAKPQ8Bumr+OkJ8pBz+D0z5\nAaQJ7sZ+3mizzxEEwgImSdopzpe2zJ3StczTyF29HIrfiKfSWGwkD5pGmkeA\nfWkELWCYEPAgayFB+6FnXYlC4yUHb9AX0FQjW5nmRj+sn59HS/6rNtPY91q0\nheBmzzKpbBTrA0aWwsUpmq++PRdce7XwJan2Z9rMlEEdqRh8rsLLoRrUrmOP\nS4e7\r\n=BxIg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPqDjc0Y6q4Gva6v9LF85herm6gYOCcQ/7ju4owUqWxAiEA6CotU51QDqBdfvNkIheGMU7s3JZrSWlmhKwgFU9DMx0="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.0-alpha2_1600448125891_0.3920317414959218"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.0-alpha3":{"name":"webnative","version":"0.19.0-alpha3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.0-alpha3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-vpgupR9tIYlcFhRAMwkufDpP8yX5RdwTXqAUiMKkwj07xlt8CDOX6rCSkukSOgTt2ieleDJ9NDLZfazyMI3X9Q==","shasum":"6176a38ea549a583cd1f9f5489ee2c754e251d65","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.0-alpha3.tgz","fileCount":243,"unpackedSize":16428536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaRccCRA9TVsSAnZWagAA/PEQAJmX8IiI3U4DFjr9pMBL\n/c2idLas0+6kcbvWL92+gcB8dJNd63GCKkXLMoDeR9f0OfLjy0nSukAcEDZ8\n6OnnZd4YFU6FJe3Z2XUevnOr8GnmApqJvze0v8rRCeJ0HMMp6ipcXDCu+BsV\ngx1iLqN5Ml2iFVJqH57LYBVCRWNsO87LSW9cWxmx1Ys0YFlS1mr4A9EU/ybJ\nP6piANcHTpv9VGXTYSbI90zOALveE7E6JIsLf+OWtChOgjWZNM5E8KXlTSnU\nVesp+FPUShXs1hA5cCfLlZdSBCxKyWBnPIlMvxEugFkqw83yMtnxQ7oXWSVr\nRdtpp0OXGEyRwrrB6V3b4lTY7mp5kq1TCWs9HQHBmBotyh7iErBKp42hx+5N\nQk4wgH+Y9Xx7tpJ89tS9JNBHj16pYnjW3LR8XP7QlKUsqJF/7w78FjWmzDsm\nhjzNu1j2DOVUG2s25y55p/pf4HQ5zfn2eTKOrptQHyYLMI44rWvQtlNjf5qj\nKwdpTQnLMBxqkDSZ3dQtlIHNzO9DQ8FPEKJlb/Hi4TtycKLAzLzT18e+lssd\nQgOFHJTi5Uv0wyxNvfOyTbolaL4495sIa7+0hgmx6NIlkVm0gLiAIsUasEVm\nx8LvsFS0aGnSrEDwYSTUL2WYCuwRSfAYzBKrTY56FOiOwFREjRqqYjXNe5lU\nFcxo\r\n=op34\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3F/keONBGWa13643tMna12aFHoQkdRp1MnZTQQu5XiAiAk0fxDqnM2nwy59dedsdvUk+0FWZ1zxdWdwuP7q7rnWA=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.0-alpha3_1600722716022_0.7817031670083556"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.0-alpha4":{"name":"webnative","version":"0.19.0-alpha4","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.0-alpha4","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-BiFXTyklfv3BrxfLT/jIhmgsEzaf7aHpk/muP3Tk8LobS0YRdnNWhJaIaQ6H039Ox7BEpBRKeN/KtW9vKWuLBw==","shasum":"2aa20401980d0ef865794c128c223726010385e5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.0-alpha4.tgz","fileCount":243,"unpackedSize":16453639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa1/SCRA9TVsSAnZWagAA0IUP/1P+YgjrIIsRY3L0WnZW\nsyW6mCisVeSuHShfISsmZWVfmcsyWtoGCpRSiU/3ezDRZZivl6cfXTWYSgQe\n4n9pIyukvgbcmlgVW0jr4HFbSmiAidzmV3ZSUg8dWAvSGRlW4RTOjZgADe+d\nu8lcG/K7Mysx25h6U/SeqnaDI1xWlSUn6NRJW/nDn1903GOzIXFuHRbxDigZ\ne3a9cotNPq/h/X2N9Wti4h+70mNkMxkaR8VRMR/XQdm+0Xv9zzuijDPO3TDO\n+l/3tVV8727GV9yiiGiaye15Opyd3dKAvvm4m3/SCoZ6J0DafvkfxijZkDTc\nmcUWuVRgBvgyghJ9NRLBSscM5nEQT2kRr80OQbfcek9x/NpCMGiVGPqgt7JI\nWGMdf0smK84GgPhTuvA+lMvhHQ3923HRG/WhGbaG3YG5zi2/cXtd96/8hF/6\nBtUm/ZO9AHC7wl8j3i3ydRBMCfwEEdJdIM7fS4KOXUFE0JCXb3PGTRqCeqdR\nReZCZCliTYLRAtAZL2VcXzKtqQxq+F9nOoTLyBLPnFA9w+Ouix9XcEyIG5Rg\nroiSDIGcUoneXk9GdN64vsrB4U0mXfMCUkFnsI3tLe/ULPyhVkvYD6tZAENB\n9XlidvGOM18ECRf3HUp9PQQxYQMZKCsC8FpVUoUFJvZN54klq0xoO1zR1jWX\nSRnv\r\n=Wl+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT42paxkKHGdZlVo9detbmez3F4xCPhUg2SGRdLXnN9gIhAL0kpXEbKfhL3u9Q8xFg8PguTb0A+ikdFCvox+u08L0J"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.0-alpha4_1600872401812_0.20041626990724648"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.0":{"name":"webnative","version":"0.19.0","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-vCdlJL2ZMdmdhrU9K0AdVLhyIc1rVfH4jY6qpKLmB3a03REQ02yNg6+JRu/t2uJESrFZzLXc9sxXvi40c6wBLw==","shasum":"5539b2f1792ac241e8a391c4c40f4515296e35c7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.0.tgz","fileCount":243,"unpackedSize":16454772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa5PXCRA9TVsSAnZWagAAQDQP/0ndTNnfwwl5wzDXUpP1\nOn8U8QDz93A/ZN4eLOUV7vpZ8s2G8o01e0EWSpJrCmrx1vocICCInvQpv9Xo\nzCzKSC3VbGSPb0iK0NTrfN9wmcVTbN4WKIoxAlXxyCUmwYmdg5FV1mQ7d1dx\nhAHTUPbx6V6cxRL6bEsUqqBJlEqFoMvjdqwKMw48VTzZv7oQus2sB6QEymvG\n/T58Fea/HJQ568K8WBveOturir7lsYoNWs/zbfsacCtW4bus4W+WtVrBk/vZ\n5pBcXINaKAaTpiBIIR84w0JOhAa5xEj3XdVRGuKdO/tY97LMz1YVs23Nuri2\n+8NnKdQsKawl1DUT5eSUkpEnBLjFtVIhKVrgbVoniBaDmP+gWUzVVzI3N//a\nqoBZnHjJoQrsVQyY4Ns3+aFZoMRJyF+CvT7hECTK/TKeyWTBzFTY4WpzFsE0\nFDKsyZ/XXQZSHBWtSWEZmI7siPTYYGuqOOWXF1Re3sx8vVuHDU6FnwgEbyGC\nJ0P5vHXFjmiZUG7QaPWbJvdl7IufbYoo7pvBcMzbfqXv3LoPYGWE0BikrqyM\n+JoejuzF4xXZTEd8+c+iSyo2YVYeVIGDGdjcIV+4C+KD13b0Dh0d4d5WO75e\nP5ZjHnpCoYaI9wuFlmDPsfhYINbrF1BW5MCkl0Juo4O839gkgUQv4B+7PhiM\nxxtx\r\n=tqxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE29AjPXRi5zSpjsObziK4v2Jv3v/SX0yuWlgibpmWsoAiBeARdGf3PIRLpLX1D1NlSmIsOiw5il/9fE25+Fix1guw=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.0_1600885718264_0.6945214365427166"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.1-alpha-1":{"name":"webnative","version":"0.19.1-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.1-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-n53E68uon47ws+4R8NTtcUyde2FAYmdyz1VfygPNouamBgsYebegRX7Sr+EF1XIvMGFPYO5imbRiJIAICpaHag==","shasum":"c544324198c0dba6573901e2585990bae69610dd","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.1-alpha-1.tgz","fileCount":243,"unpackedSize":16457466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa64ACRA9TVsSAnZWagAAyBgP/2nnXLnAjCIQPgif/W3A\nMTsSsgb5Ud5OwrAdTsQsgkoMbFfvN2F9mfKOdv8u2L5nIjwI9NqXHBPGKUGv\n8z4Ouj6Z0dbwvVTR96VD4EJUa5tW4l94/snZNQb6TJaFot/40+dU0VJNNN39\nBeDqldqSbcwvy0oakXTOCMC1cPL6xGs4VqH4PuTK2d9QuUUaszG+wFULk0g7\nGIjOTRuaLfy2jqlusCEWieGZpBYqkw2rR7T80PkDO0vECh/5zNv8JbNRAYzg\nIFqGuMvPHiVis16W+Jgrs8CEvYAnIiHgZjRB1xk5uTNdz6db0VtNTV9uP5ee\nXuJ9uKww/d1JARal9vfmPbFwg1AFym0YkO8D8zBTyP8elmtSyl7TjFLa8vGn\nRu0uBzalQadxPdd3tOShCa5dfCC4s2358QqmzzQrFQH0qkWaD1/w/2O/H79+\nyxqt14J7NkbbWjrKsvJyW3wWJNL+1ru68LSaNfPyTP7CnBZbrzr2mJfqJyg2\nGHCIN7Lrk8bD0HsJKYYdgDzy85e5oR4nGC5Gfrq0+yYLoonSpY8Z3J1WX+pz\nvjC+mXJtOTy2SslJVX0VZRJnlVIINWkj24qgINB89ps7VZDzO2Z42ni4sNsw\nskYZDaEdYQiCn47ypN8wPnQYPBxXHk3ibCvOuA14tC0lYSBVX8NZLFZIuYby\nk80r\r\n=qmWp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICAEEzLcCTg8OZFVEGS/EzkROh2Rl8jmc/LarBWpDzVCAiAgov1gRXY+944A3pvZ32pwGkNNnpy73hLAis/mGBCcpA=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.1-alpha-1_1600892415862_0.17194973325788854"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.1":{"name":"webnative","version":"0.19.1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-oZzkc66Z//qGQXI5s7PzhdE5mq+UAUsyUYOEL9aiqTVc28jq6u/s46JG5TbqVdpuJsie1lUKzxZxbWOp5aVmdw==","shasum":"ebedbd2863ff40fe20ee4dd8f91a1dd73b736571","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.1.tgz","fileCount":243,"unpackedSize":16457458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa6/WCRA9TVsSAnZWagAAuDMP/2emDFe07DzT7oeqVjK6\nQ8CfciilsAOHfm/tGhP7PFghWPyQyZCcQ48GL8C4HFdtgcJYu9mgIKpH5SF7\niHFYnjAo6VdpMKh07cjnbfKRhZ0fnBuVRuSt46DNKoc6NEuzj6ub7E8r9l8h\n82QotparpPwuoKt7Rs6RaORKhACgLH9PnqxCFcNA3AIOKhMb9XcewTxvPOX0\nDsOMG9UemuUHnBe8gw9BnFNbKJYasNVvhW1gjuuiL9/C3PwbJK6n0LbN1oya\nBaWA5Jxr0SPvgtQ4pqF/lmk1e0aRitk3Soahx/P0ryoIVtdZgoFRn+lJ0M5O\nr3i4KToQvtkUI1x7E4TBP4DB27SrP3ronarHO9b8xukjIwOeoHZiJVk5qQvX\nKfXlOiUCkJ31jEcZLH2ykONrYmY3EQbLV7EQfncB9ff/j4WqbDtgR8E5Wzp0\nO23ysAvftht2PnqMqwlLoxwxV2ngCRXNMA3UkRbA/g1DPrJyS6t6TFsVaAWP\n6YtxLfTj39dvoRGOrN6opN3q1n+1HtUcxA03gb23wkw/DAo5gLOC3DzfnaOq\n4DkMRGqlgnCJ0y6XIa80dBOBFBDpeTNUZtbFglH2DE2I/bCoZQMGOpHIWgVH\nkD7aLLDGYuLY0gxqcBWFrK4igGXbILDBu2oRjTTxYhXAidPfAW5GCiuUOjEl\nybSh\r\n=Eqfy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/yT7jVVeJvwOId1AmxiC56B8oModZOcDohJSzwPOKTAiBEo7sgXn8x5649gc9MjPcFEI91j1V+0g4MNsqBB+uPUQ=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.1_1600892885579_0.7871144878640914"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.2":{"name":"webnative","version":"0.19.2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-qus4cpgauRPyKAfcdr5+ZS/NgR9nfXm2w8KRc4+EuKI98VVdVDNqkYF5QpJpCG37up0yldTkrBHQ1y+uSwFqIQ==","shasum":"c38418cae7e3843c1beb49ec28514da76d38fd62","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.2.tgz","fileCount":243,"unpackedSize":16458061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbfQ3CRA9TVsSAnZWagAAh3wP/3zBTqryWauxulxuFpZ9\nJV6vR4seinw/HbAP7icdfI0esgpAJARgnzTtZ/hdzS5dCc+8b4jezQxnRVFZ\nNKWIa+hdjXpGSThUGDDtc4dKCWxPa6e3WjK8Vnwe3K3rvhCNz59jTHH7kz7u\n7NsTUv6dzyUJdOOiDBrSolCvAXECrXa5uojiyqoZgZvFTahyJLwAYAZZkmMX\no3hH6tuA5q5Thu4tgSAiTJv20rogCG6V/tVSztm9W0qyxFa78fzM51KWLLee\n5YwXi8E1mowo33yN/Z+O5lSJotP7RUL3OmyfBQT6hos9qv0bdyeuGLri08kS\nOzjf7F+lkrbm+zb6aKc3AnMmCUtAE1eDqPpOaACP6+DkffL0cw8cqgN3FI4f\n694qDbRtgv2+EUOhrkuBkyOJvctzjly0nkY3N7ff2DDsvj4KmLbkWMCHoxkq\nYnGY9GN5qmIpJe+Y9FC1chi6+sJ4kCkERwMGX7DZ1Eqr/THrrKiXIMy7WDg4\nJo4AvTYHeIyDUIVLbDHCz4LQq4qKIiMUYPsMZYzqnCv4hLlj0pZqr28fs37m\nEFoS7zmdCCoIrSeG+A8+C18uyBJKMm4pVe+7iTPlR7UY1RGckw5+ndMoVUXz\nTrARCRzMD4g6emPllfFMKF99B8iCjmmZ3SdiOGcEoTYAIz2H9lJnFHJe97qb\nkSbf\r\n=UQQR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkOyZ7JPS1PC3VGI60sEW3Hqu1ZO+Wp/+ZMwTK8MN6ugIhAOKW8FQ1pFL0UgsTWxanmdtfcADW0eMcpS7OpMEMn4/k"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.2_1601041462424_0.742362662369112"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.3":{"name":"webnative","version":"0.19.3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-x24I3NXBTekKyIH5gzjGCY6h6UjBjUgrMYYKcilxXMCsY/w18TshZ88H4QW0xyGct2648yoK/kq65EAxE2dJLw==","shasum":"3b73fcaaa7a23dc5055bcd8b644a19cf985231de","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.3.tgz","fileCount":243,"unpackedSize":16460563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbgX6CRA9TVsSAnZWagAAmMkP/0b0Mnc3NL/PvNEF0vSl\nji9yICq9AGtqPhJcHio+yK2jHpmo7qiAd81H5NUE7Wy9XM4UW37+Aa2b44yR\n3Z2QPlxARvaS7BXqwpAnEt9dmIFCD34av5b4l0vKeWkQMqNX9iIlL6O2rQSR\nh6OJ/wB/v/e1rnbOl53d1buojsM91NyKuiBOsJn+QjKQlbETCF0iYZk2rgNw\nwtP0w+KbfUjfROOQxNHIOO0uTSKedHNjg7LAN7Z+bHFPgEYiEYCXDzIxAsGE\nQ1rWhTGs1mbfRXBdhGIR/Kty9Ua4iA2pWnhYa5bbBJ6A3X3BWGO+hPgrupeR\nC/jOMKUSBQCSXL18ALCHG5RntelIIOC/Ml9jmGBGR+D7l3MGE5R8+8l00QcU\nigpSVX/Ymn0/dfEkQhoAk4hYlmk/wlCPUi4AnYNL0KkIUX2M1RikFRaGnG/Z\nVQ3yZ0hw5AZDdogC72x3ObPomXybdTUHUfGktCHD06/COKPnhpxC3rCBahlZ\nS01grFlpoYxk+6f9bvlxtXNQUPlTv7RwVlgf0oFNys1yf1xrxBS2V60nVzco\nU1FndWYB9j4YOl/IBmMScXqDjEymCMHI0gZ1JnyvE7iAR3FGzKrsN/ocj8Ee\n3zZ+ay5mqn3w1jq95ZwUCR0ftNgFDzcQniK6y9oF6lHUwy4FtQZ8ibhV6p5k\nTLzw\r\n=BgyW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO/HsvsAD5p4EJKtE3pdBU63IlGMQzogmtlJj2gyQfHAIhAOGTuP5OX+RLes8UngI93h8JD4Q5rr6Wizh1Q1URIicB"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.3_1601046010312_0.4472103871136226"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.4":{"name":"webnative","version":"0.19.4","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.4","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-yEM+7XBgrR4IibSP1ms3L5W9ulHmJ4krriQNiaTOYr+gTz/Uoq5eLS5HJi9UphsQqExrBv/WZnNzb+q+39lrZA==","shasum":"7b0d32e71e021e80f0c00f5838e713e4f4632e2b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.4.tgz","fileCount":243,"unpackedSize":16461353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbghjCRA9TVsSAnZWagAAAukP/3eCAEH0lEEUGMFk+FYD\ncBuTEBTMptCfBoNz1fMbnCxvDIlisYlETPr9r8WhvdZydwisp3RAnHG3lBHK\nVqhUWt1wEt6uNz5sFapbiHBs3cnnqII4ygsvjmDgFTb5b0UMcGmkV7xI8DTC\nl3A+8NmCLz0txf8bYNc5XjjnXzN3RA/Tf/Jwv8IcUA3tp4WVZ/uejYK+HTNa\nw5GbDPShSPB4GqnWCoNMJYVj7x/hpLgr+a0gPKo1rdld+zQeqTZyUtanA/7L\nYy8F0O9+W6tjxI16ESeh2iQJJmo6JVmE0wrlcIPFIey1lwDvuKze4s33L42S\nBED1gBfB8aJwRM7PKUSz+ydI9CAEjsenL2agMgMnWyihpiQQbYD4wfOM2tTM\nYN3ZCeG5NCCMIpvPR62JNffDO38BPMghf29A3+VvlFQN3O+ynYSVUMTn1e+o\n2jM3bs6Ik6rFr3lnoHtBAbqUPXtjvW/2MAQM1ZIWixBkiJLWbVnzijMjRJfQ\nrH+r3gczHll6LAUbFwekpJhvr1gvnZC4VGBtztk1/eLCGxryu4WX81yk6/ED\nzplFDTqLJXYwLnyEDqcq0d/jmB2gxCCSId8ERWL2SPIBE4/JuzdBgzm/BTDG\nIn2RZULFA5PpiV6fDTX7+2LiOVyK1eWNJXFZQ6/hfoEdFtjMFHpGKv0R3Nw4\n63nN\r\n=8nA4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLw9jmCHMPAMPWK1kUYFtcO6G5NLw1rHNRGJVz99MHtQIgKabcHwnrqQfGb/oixRHIYHGtNESVXhdfJ2zbIc7KzgE="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.4_1601046626439_0.5843354639779359"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.5":{"name":"webnative","version":"0.19.5","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.5","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Ps4mZonHUK3QEqIXBAQ5xHEpPT1Z9iTa0pMimMpNM5XiKWYRzCkd+FeTcadVG+cZj85HzCHj2GFGNfJxaPuX2Q==","shasum":"f8e8a62f42a3c68fb5706d1a7325da42ffa137d3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.5.tgz","fileCount":243,"unpackedSize":16461998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbg+YCRA9TVsSAnZWagAAqHEQAJM23UB0/YlfSn/lzCcq\nOBvpJYPaHS5pXaoot+UMPLEqGxRu00gGBPc+D/R6gqtpaQ2XAo1DO2QRekUz\nxOQ0s3Cm8P25VsO2SnnfcCkvjZOFQIJl/lHtnkFvzmSUZ8rg4DYyl5VevMMM\n+sgmJC+gacncmzOhQR1B9RJp3zjvEWjnri9GKDaSFVSBAhzsvD06PtXmXWTd\n0ulR10m/GHVx1B9JVQyGvwtA5S84SW8lj4eGmq+1F6SbS49K40dEn/AoiNpd\nIAxDcUkhE1QUY0xYs2/xLWFmJ/iHMok60uShy4cKk58MGNh89ebmbNc54GPB\nqNvwYZq52pXOCiHkjPSu1oNNpFxxOwtiy8yJZsgeIaHAOiarjhkSmw8Dnb+J\nzp6qSqmmRr3y/O/c3JCelvorBsha4yY4OIpeTJhCl/X7Vgpe05OiMkOFAJpv\nZqx34Qb5y43ymAsX288IA0rz19IV2mPOvKnjpzn9lcsKLTW98SUP+6k3MSKL\n6xEGqmInxPH2DNToLG6RWZmvDhzTXg+avjGrAu3hCf//XsJAAzm7S1aV383O\n+EV2cwWMv9YiFdXRmbfmRgWtnje9ale8s2k+LTeQpzPTfizjAelIngE+r6Mw\nfeBk9bBPeQw7D09EvAc1fhGnsiNSJL5K/uX+iTe1JoyYODm10G17EOUzyf3j\nUNaX\r\n=N9/3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPFgyXIrox3Koo7u+41rE+VRgdRlbtHWloas1fO7KnFwIgEho4108h+1Uo3F3T8HrEuhcVjL/+chCxa3s0bS5f0ks="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.5_1601048471689_0.4838288223170055"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.6":{"name":"webnative","version":"0.19.6","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.6","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-uaGZD1vM6S0syaeCORNgFPMcxZucPAfiBvEdfRKotVuboskD/Z2GozSy+aR4xkgmQSHWiZu700QPIbKiK+3wFA==","shasum":"b8a28f0d6864d3851850fdb8669967b40b59777b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.6.tgz","fileCount":243,"unpackedSize":16465276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcht2CRA9TVsSAnZWagAAoOcQAIvTx0gVt6YoIavpf80m\nTOAm6m3l0Tyv4p9I4Y2jwDbxoAVFMLMfjdzF8QgQMSNa3dTngFqGtk+ikSXL\n0W6nHJlVooNixtyoEiCkVuXQ4vYfuFkCYfVLyk2J7rQYqqnCF1fuQCqUiwB7\n7yxiKEusByWIIxMj+EqkvAZgVQtP+c+reuVoEI1GIlOY+Ro9Uvu3zfkfHWAr\n6NFlkEMzV6uEZjQ9GUJnilFhjOs0Q22Uy7ECESF/zHj0Oet9uMUVuu9RkZOU\nEmmFxrcFCWaifIM1vRsx5z0KbYZeQmgH9jvJwC8KGWD3VUQVtNokHZtJfISm\nVlecY2ldee39Je7dng8TR6sqlsWemVzNH/U8S5flSxd34FyhLC94JeD7aT8O\ngKmeEptr0z/yitds7/GeEU0R6tk63ahYYowbDCgBHEVX98PXzyfdxCDVkBUp\nn75wOTvaC7GGwTjGofzWONzKD8Z9vv5Zl0CumxwCWHABKUGT8Z1y4lZb8nB1\nSSe00PvgcPF0mjDq62Z/MDIoEkTeBjpNdJQHcXayzzWYBcLqDdKTRZIp8j/s\n6hoHI43DF4ceCvUxRiMwFGJ+8E+vv+twAAFrrKSNIZlaFQgGq9l/B3wwG8OL\nuGF2OA38FqtW/tg550ysXiwn/tBdO3gjYbMRXK/ApT6+xnvHsROFkYbAUtUo\nKbVn\r\n=dxpi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENj/V/j9QDOMoEwNzSbEbS75j9vH/LNWkXRQ4hiWMSfAiEAuZjBmLBRZ5QBwFIx0d+0RZuOJ0sQPdWHpGWxk9R3b68="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.6_1601313653578_0.5669728951227522"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.7":{"name":"webnative","version":"0.19.7","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.7","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-tyoJpsZC/cAC/Tt9g/doyKdzY8vyxrvUHgD2ZhC8UD6FhaclDJZxpK0PbNan23lNTwVuSoTTHepJMYvZa6X8yg==","shasum":"65122a7ff7c50ae356cafa7e2fa28e57492e2787","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.7.tgz","fileCount":243,"unpackedSize":16465386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfciv5CRA9TVsSAnZWagAAIxUP/3QvU5ZtYxYKzdfdRtm7\nERkc1EYcNMOjpW9qB9OKozxgYsWBgiBWtXE/FxIgile83ZLTPhvbqAL59rnM\nZoURUOPrBUm2o/6w440XUS10piETrFabZ5udh6etEh+2t5aPwSOYzQIQqiZg\n/GGIxPsx31VQg82x+5EeEEgfqjAJTiOE0o+y7nMxckyGxs1s12Knn6kS1X0W\n+9QQbQLunjnhKcBnilUpFoy3e3b6Mnj6L3kqfSqHTuTPMPHLt5/9nk+cGgA0\nxGpkzQy98DPeWNLqoW57pN+17RKfak3ZHEWaFJZV0SGRRn/YRI7nokR2sqfU\nwYXF8C+G/mezFRTkfb+o5zXEDMAemi9Kdoy/48nR3mLSK9Mg2zIymUP3o6EL\nKaauGJkO2UkPx5/40aszKeI8cRiaBlx1C1JxubryJXBk8KdvkIdcgypA8E7g\npwAHQ0gJNB1Gjtr6ejPN1oAvafbgw+B3gFHZRqnPIYfdNlwRVqI8bElHvBTO\nT8NyrPCWbPECz6w4NatvKTVzM/FNJVhS/LSOofXLxwcOe4jiG6JRhGeTfmmP\nDUu2kLl7ZvbpP/vBW/KYAoziQDRs73ei+2BsDap7GkPb0/3lKH1nXPRkSjiC\nyH1ucgphWyg3lrYh2e2crBnR0Ho1n1egHZyRPVSdT9t17EVjktwLWo8Ol+bH\ndk1s\r\n=+V9h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhzfl1/5t+4p+nMKr0X3CslXvBebFUhxozGXCXyJ5R5AiEA23gF4rvgPdOGgpPYbzDyLLhDDn4mlvREBMcPT7v0NFQ="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.7_1601317881241_0.4962313856495426"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.8-alpha-1":{"name":"webnative","version":"0.19.8-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.8-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-emqvY/1LVmCPU8N1/R2CNuI3fBwae4hjRl394KzEgBTgts6fUqy3cCRsURdj2iyAVXTFg+yelHVEC4Kucye8wA==","shasum":"3d2caf25654d00a8945f1b21ccb0541236a801c2","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.8-alpha-1.tgz","fileCount":243,"unpackedSize":16469703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdN3YCRA9TVsSAnZWagAAu70P/3hheCBqka60XnuaTL5z\nKMtkTcg+/S8IhTDHSglv+iPQxKOFalsFzTQfMO7P1aNreO+Aw1muIy4WhBZo\n9EgP4pDt2/vWKVwYmx8BZInyQ4iTNrZTMu2Th3WSJ3UcFKehzmCZSmUZt9j5\nYva5A8uGpQO4Br8Me3Ou067fS7vP2gGUCbpKxrEb5gBufdLCYSLW6bMxXT5M\n0uGKbbXFnPsCYu4ClaGty990SGsDGwOXfhsz2n/W2mKq4eaBX81ZdiQWvWYg\nGN8l6w7AWVVc2gnyL9b17txgM4dLWCbAWEn7TerymJDYnueMSuNviYlBN6zL\nzwTr5DhspvO+/J1LXWoJeT3lutTAXB0dlN2P7QiJ0+R8owAKVNg3oJiAYJRU\nGke3GKlsK38B5J7DS9g0KfJQ5cAsufYqvWva3asRjuvlxhXk1zkl3rChAdPT\nSFipbBS/Id0UCbSZFGLrNkWEWqQndIsbEtsIp2oqTUstzJP2MIikA7noi9i/\nvgeC9VjY9nIRVn5frGrz4sDP9GHAtzrpvz+2aCYDc9hwzozCYzdztzq+TC4s\nYLAalFmJszk+dSbPSZDIa6VNv9w6x25uB/sBpF1ZSiO3xKDibLdT9UUwKluU\nwCU6VV6oe/7/9MHJrfbcYX8gMjwxDpVzlrm1pHvCf1a09gV8PCI6P79IF4yV\nUVYS\r\n=A0tD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASNSRLXnFtx8nCEU+t493wbIqKUnK1Lgmu/9gCGXmpkAiEAr+853KaN4T0VImBwcOC7OjUKN4iuwfBfDgG1m2ODQQc="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.8-alpha-1_1601494487717_0.12228355532521018"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.8":{"name":"webnative","version":"0.19.8","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.8","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-2KufTP+BbkBAz//DgIZS+NVePnD+hXfTXTuuVTMr5AJ0MOO5lktuxD5TD++lq6fwPsR+ytlMK+lQkLcAm0ejow==","shasum":"a4112cafc3a1b4ce1b7b211098e5775d34c8274a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.8.tgz","fileCount":243,"unpackedSize":16469695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdi/KCRA9TVsSAnZWagAAMk8P/3oGoxY4f/+zjuklOJGx\nf5ziGqP3rpqP77rDkdI6cSBPAXTorhq9LX56O+ql7GhXevrZkrJa/zCjhFnb\npN9xvI0IMBNrvtQe0+txwsVPA6LdciRqfm6gaabY+BIrqxeaTLhkLzHr3o7N\nPT6teqVveJeIybjcqapLATVdLuyfSgcrRW1Tr0hCuXcrNSB9bzDr361D7QA6\nn3uxLUTqK5HCN4KdBFkQk8mLGLG8Zd7RqZBzXjI+BdSg8a0LoBh8Y+xtceRn\ncRmPWWb658XKz1IJBFqvBArqxTw1L8Z12oIje5uNlcXQfItRkrBD6txxBMut\n1Oq58xL3bkVP2TUxTHYvpo3KW38vPQ1aVkAuhvxgI2yFpom/TI8YxAA27Fg5\naIpUZgO5eHw3E6xsWXF3V1H1M0F201eoukqFyppMZLLWCKmYP2yItLl/Leuk\nmcIOBqWnGhlJLVrKitLuPzWu6sL83xgbvXvngV869iPHjL2IhQqLcqerLHbd\nl3BKp1dGpv0i0+O56WmlBpEsJxwzKV7jWe0sIpoaifU+2PwEVUIIhmaa05fs\nRNCilg7fG7SXkjdh0IJ5NbwxiKk/4Eb6V+sEUi5u9qyTIaVxgo/AJhLQS9cN\nI7OtUvT4IsL4Z1jqNctu6iwPTq4vU8+HXe1FnQwH7LUH2tDdssQJh0zCOGLz\nsLc3\r\n=Rvn6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCz2cVFOJw4TWTxxE5kOSo+pLCXQrILRTBU+IswJPZUugIgdpuhaoBO11MhVcle3eoUmiFTSmIv1b6NluNoMxnETlY="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.8_1601581001783_0.5769095227324985"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.9-alpha-1":{"name":"webnative","version":"0.19.9-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.9-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-EiwhLomPrbVyBayKFuoiQgULJpDKOuctPw0J00raH63mICDjGzUg6p4uAP61HrgyCRYHAkfyIhYQwDeMXSyTFw==","shasum":"faa3f5b914eff5ef8e5d3d7d6a7a7c7dc3ac0f67","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.9-alpha-1.tgz","fileCount":243,"unpackedSize":16472618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd1RbCRA9TVsSAnZWagAA1lAP/iKBezxbp+Emg/zOH10Z\nKhKROFTKU8gwORgATl7PlATPyGVO8M4HrbwbzIqS9R1//D2dfwftXVchgTSI\nCE41wxQ1GEEB95ZOmUyAtTqUhkmmsap/ooNCuoDD767fFZc9K0x535/znw7B\nweA3a9ODeKMrW9BPSYmhJ8MPzDeQXb+ljJ35ScXQI+Tzd6bkyHZGjzAFcb2B\noIJQRdioTPq5r2Ka+AducjNC/ymixhbDcWN6BGBs/DT7AYiRDVfwqga6h8+I\ngNb5fPEc3JzJfdYREz/sTaefuKC4ja/RHXF7FS3ciU7P48TVCcS9h9SygJ/Y\n4ueDMnY46EewcEc5Cml/dUHRHTuisWW5vORMaJaNE82+S6TnuyMbEPPZ5+mZ\nuiut8xDmAZQPB/sUqx4W14l18I6mg9/TzewoGeOVH0SedKd286TQ32hnViBr\nU+LRCGDr0csi697LsM+9Z28TmWplcLrNSzco0BtZCrHl25vJa0LQ3gHBnShx\njMVWLgUEtywNhvoYgP7o4xtpJpNAXekazzGmYFmHGEbXEz6jdLXhb2TjQI2w\ngeLkWVyBfRDWN9NDbJBVmvVvcpIHJ9FGVia727k+j+tbRBOvlFIGHG22v+gK\nWJpxC8JhCrh/k//NIRrVHv/EPtXtnyl+BPfiWSTG5ZerQ7Tc23Im+O4ihfFO\nYrqV\r\n=j32N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSfMtO1ghur8/QyzlWIu8ZOZfC9ULHA+KllWDX9RHpigIgAWDfhJogxGmJafXRa/bXtLBUmb75EMqcTWXYYpv/lUM="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.9-alpha-1_1601655899381_0.25902419440256086"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.9":{"name":"webnative","version":"0.19.9","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.9","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-4Xx8WItKAXuiNxzKP2dWebNGyCClXeunuBkLxOYkmlTfWEdA+lfQfOq1IUcIa0k3g9u3eSjy9tIUBmz/RWhs6w==","shasum":"95b2a8c5ba53afb664af08547511aabe11f26308","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.9.tgz","fileCount":243,"unpackedSize":16472610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd1gKCRA9TVsSAnZWagAAEEkP/AgcsHWDnjIJTBrGODwt\nw145O4BHuGqDPtFcCDC6jKHtlEXpFf1zYcWh/4BCzpkW6LHOjhBV/vKuIjU0\nQIQIz2NUzhKN9B/rNrXOZbnnc7Uy4ZVI2nr0gl8rUbKL46vSa65BcCFUsQ2G\nXOn0J5PUpdu+/iH294f29JmilThnvAzo5OqNJEaNBH9Kd4z1RH3a6DCSiHpe\nsYRMuj26dbKEBl15xQo6xbyEUMYhtsTLplv9eaI6on1ogFMXyAMECVr69JUG\njM7x0sLu+Yg30MoXLOAhcF1bbQjOIObsDLacm5bF0sPzpLWSsVJXr0Mx/NGw\nANTlVNbGwgx+h/XWCwQgwHg4vVlRT+VEDRPaM6Bt6thWpUqiA4jtyjkqy6EE\nSFiH9ImutgSkkJAdWrTBUizgU5eBn7iE1gr+AabOdQ3CtrJeTjG2Jr81h9ha\ne3jZ2FvIbV1235ADHsvhkthahzfxfZXqP2Ce3iH/o+8abVMAVqjpnMTNeqwK\nSqrvQEP6eUie1wtPockCm6G4xJZwp1LkKJ+ZAFJciFb9ct3kiVh88tSN+S9b\nQn8qDAV2Qfk1STpzokAYOOJ6fqbn5R8x3VMu6D0zxx512krXPV2JfQtvLFKC\nMceGmM962gqga+pEArdnyLm0OJpMzAT298PhqIUMmSeV847JlPvj0dzhinKl\nI098\r\n=olLI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAmbs8V+EFHpANoUnOwQLRycNX/ZZoHnBco9e/fTb9UAiEAnoxXsxPInork871stRdpePkSH/QoLbLXSIxhXXEqooU="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.9_1601656842422_0.5779979086824825"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.10-alpha-1":{"name":"webnative","version":"0.19.10-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.10-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-C3gxn8tqZI7nsvY0L3G7T6NyGKyKnxZ/u97UMSmnDuOTJbJaa3720UbjSY5sZjeo46yGnt4YHAgH509PeWsh3g==","shasum":"33347efccd535232b57ef4626e74ede1e673a1c5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.10-alpha-1.tgz","fileCount":243,"unpackedSize":16474220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeysRCRA9TVsSAnZWagAABGMQAKOyWBDWz5ejP+hVZXRg\nd0v9skaFkmOR3rZR2RhOiFUp6MyZ60fQ23WMDRLEhKaWMv/U/ITOBR4fn9/L\njbmbNRsA+7z5/H7UU4DnEiPtOSxXoGPYN04kSc3/LcwECIdY3obSoMGnQT7F\n31wVZIpNT7Cwd9R8l4onJRrl6SmQ+hIIBG5MXhvH23KkrjEa224rsG5GV2So\niOk2p2aI0YuENWbY9iwVVtFZQajSH9PO27lv2BWHFPAxqIC4Qn3VOVfhk18V\nKrzzhuxzXs3n7jovgfcem87XqBclHLxU3BmDQU4HGw+Nopw7c2c8yLLjRafe\n4Wqpi5X+kXBRbB+qPPTDWhLCS0emAQJ6GDobIMpsRHS2bkOTCYKzd8xCbqj8\nMt6XGsFCeO1qBf2zm9e/uN6+tvPICXZWgBB6EdOlpflohuyg+H3yQOoAb8ZR\nr6PCxNnkrANNcL/qYk75Oy2Vmjcvl1GE0ZY4675VFT8XLyThUj2wDsYJU0CQ\nKVHysZ6RBOOOx9b/jP9yTQ5lPI9UOZXL5qUvtrSphqVH/coDccgUtkygonvh\nfPUB5tOQDDv1bzUgfe9HNwxq3Qn/7aHV4ulQOQrAMrI/D46hQ9EcjlpZTTYN\niQs5QLyZf+XpMfHmu68lJgIvAzF1nHERRnTv0dBach+7SBtp1mUgzwPrqldM\npoGR\r\n=1gxk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSOgrlb2WRn9NrumVe/b5VSQHWZ4UQu8ceZobSCgsOTAIhAPoBO82N4B5HKm3i9UaJR+BmaLXNzLDAhYhsN0Ek9fcs"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.10-alpha-1_1601907472577_0.638682094244756"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.10":{"name":"webnative","version":"0.19.10","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.10","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-X/4chYln4REvWc6ak42Xws4Z+vYYDCKOiP+OZPTVdUKohlThmxPWpwyDWMBRTwgqV1IQ9w7TS/GatvAI8+jLgA==","shasum":"6eb9fad91502a1fcd9520a8d2aba752bf72d08a1","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.10.tgz","fileCount":243,"unpackedSize":16474212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe2NrCRA9TVsSAnZWagAALT0P/3qpeD0wANcbI++P/deN\nBUWkWxBHSKFyoko0gP3MJlS6G4R6+lXZfeY2Uwizu5PlIvPxvwR1uXGKEdYi\nOF0LJPlfuGysnryYVBz1QPR+vx45Hy67IqBb6cAV8gc+cStn3p359G4OmKOT\naGEeJywfU2nqqZgiF+kwDZt1PnisS1QX2o9QxoySJaFrlEwuN7DIOz2JAXky\nWFErbM85HbuYQIow0sYhDA92WEadq5Kq9y402mjCFDbgu5LADknFqfwpsivZ\nBsWtysJZyRa/fLI8QQZdgBZZzB9prRmLWDU3B6I+/zBge8bOHmE+ck4wgAHt\n+9iCmBhjcxt3G6uHhTu4woc2zl+qgDt0ySllej2gvu5iN2Ep2xaY63r8P7Yx\nb2ddNL9ZHvVdg3dGDXutyvz4WWRcb/eeOXpWJ3ZYvxr0JEnaQJP2+KY/2W5g\nk0TPOIGAnUZCnYxoDvlvewgKipEJGBAKPonFv0V4rbTV9HMT0aIVXUhi2R8j\ndmEB5/HUS1VqC9w+ioQOKb81Qy9rshc0x+AuBvo5eydp7Bq1i3TIWc5wyzgt\n6vV+q36i8V28UK6dfUapBq6F0raqjczZtjQypEYq/G4jc2jjOr7GvqDn6BW6\n6AHgfME97nOOuA9tTcpRc1rGRM4Kl1D3beW6lSLRyBSLEX0L1/quKDYBya+Z\nEda5\r\n=xycS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvfXy1V2EXzbj/rEffHeb4F1khVa/xvOKFI4kTGRCLgAIhAPI/KBp93VlkoCRi9A+cwG+qRgf97jmbexCg/SivZsLD"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.10_1601921898780_0.7233183975913424"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha":{"name":"webnative","version":"0.20.0-alpha","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-cTrMxKel8CL0bh2TxLHuWujNQdHPLmBPYw7/afF4+GxLC8/jAgoeZdWeDVpiqXa90lUEB95oOF+aptGqodT4ig==","shasum":"6a15f8005d73da734bf2dfd0b97b1d3a9ff4116b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha.tgz","fileCount":243,"unpackedSize":16566957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfheyrCRA9TVsSAnZWagAAlg0P/isL8NzZyhQKmhSMZxZJ\nyU8AvFsjSYtvt8HWGNI2XKcKv1kcQP+z4Zqc29aezrp13d7Qoghocqsag7Ls\n5UOcwDLqYHz8JtUe5ZDKkqANZHum8wyC7NVqsenf7VJqyjNCpwz6uDxlm0+P\n6vjNdtwFwd/foZ9DLeFx3d11+jTex7u/d/0AMG4CfmXrqDBRpKIGe/iRhVJP\nZvhCaTDnWGVPnEGTjEHDK2o7CPqHLF7zPncxn+EOtFBysgEvRX25wUEMvxpP\nkmoCZWn1Tm+DFUvjtncZgDCyb7dPYeKcGzmbhk4a0w+o7FEj6w7/guGpdBIR\nn+HTq+T26GKaYAdJKvW0z6mleTissGNoZCd3s/s057QDf1HATBa2Pbd4bdin\n0g7B9kBzgQRc1tFybc0rV3xfzfJISLRxvtiPwURdVt1v+X4O+pjgrL0WlL2j\n2hN/4t6EwS3dcd8+KiFQvTvWILQwphPKBMz4C8burGzlHZunncfEuqRciQVz\n5XzXsIFAa8ugiw1Ss84/YGeMCUNC5loPWpDLK2OmtgAQ+Ps4mJvmM8DLVCWd\n9nqS0WbKyZJOtsIvUnN27xHDt+jjVqPy0qk57sDt5BtxUtk0X5qggHE3YlJW\nTinjxr9JjuJYkyPY2OQqnQCkP61fYwkmgy962AG0kNKG8P1SyGS97eTonv+Q\nQ5q+\r\n=CRkj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmcUyi8CYYSOs+n3K+JJZ9JetzUij5Joq0L1uN/lqmiAiEA8hIFXvDRXHtVLjyWMrdF+ZmcAa6GqxeEcAJdbkelqS4="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha_1602612395224_0.22137984152818602"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-2":{"name":"webnative","version":"0.20.0-alpha-2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-I6b1ix3vRc5daYVjRz77zHv/RMxes14MssUCmr8jzpr0qcNou0hWzZikq0v9gCGLyXNovYQCHJ+n1GF7VG8w7w==","shasum":"79a511e45d618310774630ce14eb29ec8fd4c337","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-2.tgz","fileCount":243,"unpackedSize":16575784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiLqVCRA9TVsSAnZWagAAAiMP/jwi98os/6fJeciDLyhc\nKiNwRikCpsV5TTNX8649LXk3FoBjO+eM9u1HCj97+BDmo5PUhf2lQC3SEM9T\nZUYzEF36oyMk8MEm6n0tonAxKy1w5cuP/jc+8eb4WeFku76zkjIr0CvRTSac\ndvltlZ+V+3fYKyTk0rf+Y4DJrqO53PVM3x4lammm5PYbTpqcSiXEvMqv6Nou\nCAgw994Um+jKOsmgBsJkHbggWQkAuF/0QpYe0i8U+dk/oaLuX/KspUMvSxlk\nwbdhMSWJOxdiwONUCeWQigxcfeq+z4rqOaXF14FCaXyAg/atucES+LGV3Hda\n5knS1K9ADcS1grQ8lHTcnwbWI7Pdogx3ry0/xb9Eb7c4jVJ5Ihw71CbXUFCZ\nGoSqGpcu9Ep7VH2G9rfdynMtjCy2a+EqWKc4ctrnmKODHrgeiF7TMn7gaYTL\nLoLWYz+asKQ+ojTm4BWUk7juydXLqw7ob5Jl8CPA9qunTjJp5VJCwKIUOWlF\nnmd/DwMih2FZQ9x0psZByc4x/pIGFbwrJ+hBof3CIrqqzwlPgt/aA6OOvjlB\n/17tKjEWzXYJ8qiXD6pZkOlcDt5CVs7WEZc1Gt4kRss/cs4eLUXIFKxesqnx\n9YxNt5IJYTCVun5gUltj3n3vErLWvCwXhFAd2gsYA4Pe8wBFWGXsSBiGhpCb\nmSn1\r\n=R0yT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7WQYuc0FBkrqipaMuz+a7rKNR4imIwfr7Gu5/v93beQIhAOtz9gRYMBITLeC19xYFbjtk1xpykmgYKd9Ds/AwGvOb"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-2_1602796180809_0.8625574179254891"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-3":{"name":"webnative","version":"0.20.0-alpha-3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-w/cdgKpoWs2ti0LbiY+QXApRIwEGFwwTeZmvkZZZU3jPm0+p4xjeIH+Vvoc1+8oicX4Imn0YE7e8d8FBoWSp2Q==","shasum":"b9e1cf947d7a8448bba9d7ab69df0f1336da15d9","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-3.tgz","fileCount":243,"unpackedSize":16584965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiPHvCRA9TVsSAnZWagAAgnkQAJTJtDAFCS2NzjcE6ELN\nWLdTZ7FvYD2Ps/o9OFYW61o+slF8dnidp3en3Jm7/RRtakoZO83XYfx0NLVc\nsbNDQdKwLV69rYS3AQ64jni6V+zka7ITtg3F2RsAZcG523E68ZO9t4Wn30pL\nUyyfOMZ2wH7LZtAEDxw2zBOYhIJLqk/NXdN7RMK0v09JWLwS70aq+ZFLW+Ee\n1cAgwQjjF7+HSyJkiV5wOcOu973rcvjraGOrkwfY6eJrNoIe9+imgAyZJ67V\nExZCjfp1sg4jxyqJeecC5JUV2RcnsAMljhbPjgmuXc8W1UumxcdCq4hEpE+p\nd/yDUk0kdXnmTujSbDy5D/7PfrPE78TjYch5q/jXd2GnKcCaVp9psjlB56fb\n1hfJjhd7PlqI3U58DMce2v01pt4a113BRYhsxmJjlu8pC5NulWUw9NRnG0WY\nMfgM5dpD/VpOwFfy4tSsC1TYJSqvntf1My7AcvJ9NOCQvaXpMVdz0+EhlqOh\nUUFX0mdsLC/yuiALSQF1M20g1GKs5QCGzbhLS7aZozoLNIE+jRLQ8QAkS47p\nzV3LSqDaVLGZgrTS9WaZ2m9ltZrG7aBV7kWt7TpBD+2/KpDuSnXmGGsReRSw\nF5iZgMaN70yyzpell4M74LJGq1/iAdwZ4kVlt48jm36yFxuxmbMo5pSOe+GC\nvBwa\r\n=3nrX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEzIHYcrveqL7xmCkYq4iCdBNm1SoajpObVqsr9en4kBAiBuGujj1OlbDFB+7loyugYk44iv/ctjrpbemWxdl8P52Q=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-3_1602810350914_0.09345779996027948"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-4":{"name":"webnative","version":"0.20.0-alpha-4","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-4","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-w7PiSjlogoOuygE+m/dhODpJc+SSxlNaf1Wwb1jvqrCVIycgyf6oot/YqU0+8pBwJ+sy8W6RG8W2CiDMsQ6z/A==","shasum":"46d1f267cb6a35d46e3e0085eeb80931c7fddac4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-4.tgz","fileCount":243,"unpackedSize":16589202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJficFuCRA9TVsSAnZWagAADvMP/R95xief4FkjviY0S3YL\ncqRGkWonZONOs8KwnkP5Va4U2TXA52nl4NgXAadkGNn8UxXTRqbwzdYfvbAw\neQS922PlwNB2/890bOAyi1LFuapYsYH5z2O04ZsJ58bjDFM6/Ijv+9ddsUxg\nUdpgUHB3t8K1Uu8wLK5jIbhp17NZNLbbyHPkPQMd0I4IwtZTQ0JCzYslVsKa\nBgkEWAtI9YcoevY8Fx9gg+ptI2Cr5GviAPLlv7Jh8qvE00YMxJ5eC7qgjtY3\n/c3SScaSzj2L714+C1tXWGCjYcgE7hnT2LVDfdddWtALV/ay0Mlw29F3MLEA\nQnH3O+M8Lh/u2kRHn6x+tanBDbtRFzzv4cgXKunKKCkHCt/8iEiYZW0FBGkx\n7Bcbr5gN+luYse60k5LquFjhFzyRPmVEz1OKY7rT2l7FQaDee4870luG3HMF\n7g0o0/O2JY8TTeDIgpuPbV7kKr9bSEi1Z0T78UYXGm0zSwQgqAJ+/Bh/um7o\nTh8Q9eleYnAaTpZKBvvtmnFiuYcT2MT4icquKLq0y+9j7q/7ugFoaOan5DEw\nyspbxdc0hFjf3fon240GxsVE2fFkIZrCrELhe13t1mqJZCmJgK81LEndrsvx\nLFY5+3WHZQSlszmJ7SLnhJT/KpwUfYs0irWUbY2kl+dVohsh525AN+CZwMlW\nxXCk\r\n=5iS/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICDDxSWP3q7RTITdfuIFd5e5bj/pS8FNLsH7sNCvl+LrAiEA4Thal+eh/wk8wphOFyMHpO28VN/L2yaIa5aK5UuZBuA="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-4_1602863469720_0.9776123900573916"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-5":{"name":"webnative","version":"0.20.0-alpha-5","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-5","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ur09BePBL0C1P6cpyhPjxTOBkCRPo7GHVXyaDUGfKUt+hYDARZdMN3FkpWHHX1QsBz7t5xKNHpF66ZQMK/fxMg==","shasum":"fc065c8ff9d5596ff2330666c86c94191bd36d12","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-5.tgz","fileCount":243,"unpackedSize":16589894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJficWsCRA9TVsSAnZWagAAhoMQAJPaQ9Cnd78ZLVKO6Sd+\na7goQgPzSTmixHU8wj0y9clReDxAApQRkNMAXN+p25tciAZnoAJq0hnz0fxX\nXFY0HofAeWnbfdW0bBLFiFBCCHWfssxQuuuSzt3d2FIMYPEJul8Pf8FmyOWK\n2cE2IE1hdeGTy0dKzwV2lV7YIVKzhdhgBMo3mE+Rvp5g4uczs4B68EL2Qwt+\n5K8qDFgQkScxafLZMVy4RgGXEZR6jT+yBOsnyoXigSUyrgxglPaYwoZAMTq4\ncxOGuo7kzo/L5nU4qsQrRHURBxGrxVXuPizFGKPaCojvw+L9XxGloLiAsmIo\nCTweb5sHovlNvSWuMcWf4///5usGj4MbZILhQG2tWLrug6gun2mOei3Kw67V\nC0YjTF7RGKOeTVlFc0LV+8u3JRJQW/4mLit8R+prcz8Z6sS8EHc2St0++SzQ\nZJnXRmbTnP9vGRiSnI0AHu57nEf5G1yWgr/0O/0UXjcd+tlTeC8bB1QaUSiy\nFpCe72rtL95Jk7fDxu4ypWLhQbgkg0d50FbL2WDamdLWAZr0zIZ0Z4wZL7Eg\nRSkfjE2LzdUwM6DdORyIv2JHrZavMx1DKh3ZXW5Ggy8eBXEi8hMcXtugJDvb\nffu4JJlB2mwV3uXEtY3FoMMCxQXaE48abiJ1/dUJZKHIMz1EA6zSOS+xZFb5\nd+1J\r\n=9T8N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENFGQLJSOwz11HF/mVYcCgr8j7bx5/0CrPpjsAykbBEAiAKlznSglndVwUZX4x8N4fz9jesl5aMwKt3QkdWW/MHkg=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-5_1602864556198_0.4469808028021587"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.11-alpha-1":{"name":"webnative","version":"0.19.11-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.11-alpha-1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-EerZV+3QBhpRO2lOwTbxn56FpnsrRvTUtjOkMYNcNHxffqmZWWsZTWVF9pvh1OAgH0L6dBKEMlWGac7+X2zXHA==","shasum":"b0ef77d9616918ab4d0ec1b4ac93456c4432d08c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.11-alpha-1.tgz","fileCount":243,"unpackedSize":16486635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjZW7CRA9TVsSAnZWagAAQrYP/Rkye5XoC2CzWTQ3gbHG\n8PjiuU5ZE12uESN5rfFWmSslKXIRm9SKl2czLP4rOhrqDMAu+bIxKv5kb0RB\n78cqlPZ5fYyC7AU6F7m+FNTEcRmynJdk86yxbQttArfk6K/dfokKY9u7h0m6\nc24QlhmjQmFrUzK2mBe6fWzKmMlHy0S1+Jl/bSgXAkWK0j7bK0si62b/tiMd\nvjFP5y412sV8Yg9CiVEAf617Y70oFKKwOH9VNBhzj9yDjx/EgqjNpVpCVZOM\ntLCuHfVRQSEZHWtpSSNjZe3fQDOvcNcK/RufbJnUXZ3MRfmIxD+M0ls8HZ3Y\nyPif2rj/1bZ094cAnbuAYAxliwMWoff27IEES1pj5GOveixiho+2D6/kN7CN\ni4xAoH7J8IHsFFoQmUarDt0bgAwt2eRZIEgwCR4CZd6UEsM8qaq8nimJVP2J\n2KrLb6AKpA7ofRpd1of/rmJfXwgeTCZu9K5UYyQf6gFYuiA5L8PSx93irGSk\nX2PZU+8wMyBZwSAcd7oZi4rLk3AuMP570d9VU2M+kR/1Dzg79j+ZOaElc9oo\n7yC/dnMq5ka4G0B69IVExAsPsYK7iqgW1O3hYDX9mH+vrZDK2peu2+xtHOB7\nROiXW8EHEALPRq1eg4Exba9YldNg2Y47Thz/YUjKD/G/cZ/gYn0YvXkQxdzC\nIYy+\r\n=UUGg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBhoNdDfKD452Fy0ipNAPhJeZiUqSLLHP+slm3hrslWwIhANRsUwsah0JjPX8R9HyyTnK/YVO2x+byxtn7TIppse2F"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.11-alpha-1_1603114427358_0.5145321571362531"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.11-alpha-2":{"name":"webnative","version":"0.19.11-alpha-2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.11-alpha-2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+4OYfscDYab+Tq0tbuoYKPJIFKnZ0VUBAMI/jgD6gpgZcBo+T5m0WI3UuCSONMJwxxAXIdEZPATXWVp+ACdI8g==","shasum":"509caa806002adf7fa8b7faa24d796e29789fdd3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.11-alpha-2.tgz","fileCount":243,"unpackedSize":16487584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjZkeCRA9TVsSAnZWagAAYhwQAJjn3sFN4DVW7t2j36jk\nz7kpLmZoMHvv/WwG5/ZInkVNpMn52skvA4vltCx+ip4Uk+x2GNOaynWF33Xn\nnu67TuaF6pExPiE3Mg1Eo8JLYrEOc1HQekSi20dvdq1o6pBsWVjEePmiDEJ4\nTiuUoqg0Ik7KRFrI3UsZXi1N/WSCDNvTb8HWNxd2fLewu1sAFJ98vc8IHu0U\n2A/aEIUPsL7VVbOpeTgSVNATWc68yrYoHwdLKnpGj099dSZ+/LI3Y1Tt7XWT\nxc9UtRWIszIpLJ7Axa1P0tlUluJsGqvhHwWfIpHKO/1iHCRD+ct3hoBAIUpg\nJ4ft2HKN3XXiTAyKrUssscPCQgb8loboqEpbzSlb4emem3J5UP9r2v+ZxuHY\nKz1dFbvfx6OP9/8vDRa0RwUn+6C+qjFrd83m0UMVIExJ3khCbj//59BDhQlk\nkHJi0gFLK0p8c7l6ecEaCfjmqQTRtKbfWQ359aYOp4FwnzGwfyT30oyB22KR\n950gjZCBZ32Qhqiy273wyjbfb9hjs6nJ3RTp+fdjnHvt7Lvh1kx5z/VnCFRt\nMWnoksOGxu/o30Rtdzuc9IvbWZOia9Bj4h6Nf0OozpqJmG2bUDZqGYUEZyh3\nf9DPcGLz0hCmjyQ/O1yMn9ivsZOHrXuyLgTI0azBh3cYLx91k5eX2ii6yv9V\nhir1\r\n=zEZ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpJHL4Fd1THuFnBucWkYD/jwzUEaCpES0XrDCoGhC/9AiBy+3s9gLzKvxWsCkI+NBju9+FlFSYpMVfQD2XT7D1E6w=="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.11-alpha-2_1603115293701_0.6783861794252595"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.11":{"name":"webnative","version":"0.19.11","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.11","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-vz08zbg7DSiC7xpdMmHS/Ny2gyDXEmcyR2yvXlz6aO81+Dyrt736PKRN0J86mP/lZNacxHjijDMkAo0MrwWFfw==","shasum":"b6f0b84a3256fabc8d743c63737a0f9334b52805","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.11.tgz","fileCount":243,"unpackedSize":16487540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjaIpCRA9TVsSAnZWagAAJoUP/2vBlYa+lttU2t2PVXa0\nKARWu1aoeI7wZ4JmvV6Yi+cuD0hyTzHkG7+KhQ/vARGQygkFAHn3LCuRvRCe\nuKejRah/Yfhz69EQH3p/tIMuVXYgs0yPGz8RWMJ5f6thN6VKNCKn6wQDmjfg\nt60C94tBppsBhIrITs4lgHAAoPenD/KfuOY4rMqn0+pwYj+MmSVHweqkGp2f\nDTb29CzP053yyxBVTPrRZ6Fck7UZpoWLBCV9oOcjhRMJyGsfEDZzSMBoccVD\nNPrqJG8PRKwvV58ZWYmwTDZsqQuicWKc+qN2YKqKonTWdTLslLnupfUS4lah\ngroNraTiTcswbiI43uf28M9geDjI9Va0KBOWE0snxsfrCIU1m9YBu0p5oxED\n/WwB+x+X977Pb12KES6H1K8zAgaoqvP9MCXFMqV2GEfUuJz0VpFUNifAM259\nZfvKo+fGQp3+yhrw7PSqA1891bv/BoFYdu/xYHMXANmSuRg7iDcr07HCqhdB\ntGB+BNrM14EqLd40pEVDFhkRnZBALr6eyldaaTiXiLxDBAOKJZcHOOh7WRUl\n6qVSCL1E64COVvGa0EbHYF4ZPgzhR7RRoh4/cwAbC7muZUXykGZOkauLF9W6\nVbexzhvMfmCxC8UThyesDBzO8wqzoULO7kcbKVBgt+TOghZ1ljKAesgYWP1q\nW/lE\r\n=TH6O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWm7k4dpAKPb1HYBmRw4hPtzy8dWNXKJOYiaKxeuxGGQIhAJaqXJy3WNt2LTX6Nyj4kdZI7UntxHfJt8JlKl61ueyF"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.11_1603117608998_0.739063343195784"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.12-alpha-1":{"name":"webnative","version":"0.19.12-alpha-1","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.12-alpha-1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FrcK3vYZCKsXO5K4r+hjRx+f2JMpYinOEIXHs1DT3mQtIFeOru0DIyva0VOouoETQ66sbjBJNAnaFCp5qDhftQ==","shasum":"95869f02d2919f19f58e4beb70613fa454909493","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.12-alpha-1.tgz","fileCount":243,"unpackedSize":16493423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmvrICRA9TVsSAnZWagAAwb4P/0wCx1oU8iJ578ggousT\nSNbfKF7dXeptPTU1OTqJTv8xMGA6stcVTbllmfjS8azwgtemgmdnIyuZpqK9\n0u1sf3TL5VmapzuNmuTMJQFqfJox8faPAd7TTaTE7URg7Z3SrKosSWZ6lhFO\nVDTmA6e35hmW/VgxXWRe66paSmr/pon58lPYvdGE5NEJcT7uTNSd0eQsMUS1\n+IWGyyfEFvRRE895g5dQwJF0/VlXiO8v6b+DdaHKbQyHDZrPcDXI+g9DeSrv\nNnVPZUGPzsMLsFB3heiIkDXk0rrgHiRhZvQlbJqY6IbXTrdpAk7wbreEM/TO\nlQ7jdHu077XkAGKNua2bOUAGfk0ziZwTUKOB2O1MhG62ARXamJKYl9bt16P1\nWazhutWiorjAickp3hRZ/8g4k9jEQLgEvPcxsV3x5gbZqBYWyaxbtnwKUyUo\nXw3G9lVlHRnLRqCUM+vapgRLN7yti9QYAXVF9daYBqOUnBTvclhU7PN6zVlk\nbWDzdTbXxOOo8OJDjh5HQKadTFY5zXPgBL77q24hix/Cv3vjsu9yxYPlzRC5\nRrS8/EMHdheooQZBxNm6e28obhMI7AM71vEHVDUBI44q3dJNg7Hc7lX1/NPT\nOQmQiiKJDjH7Wcb8COfg8Aj0nz6IwiRFTXR8vdP8J6wRXPTIKde5IGW/6Y3u\nWo+B\r\n=+RdW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAd5C5lsrz6X4aO8xetjxwbipsG8GJLcS+VPzTBOqlJ6AiEAl45MeHtXPhkQZV+VLmEng2E21WpQe9vs6U4XborRMi0="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.12-alpha-1_1603992264110_0.12353032623906768"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.12-alpha-2":{"name":"webnative","version":"0.19.12-alpha-2","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.12-alpha-2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FO5+1/Gt+rn/sLDX6FP6nYPvzehHgHlpEzwasD9mXsFwWKB2wKX8tUwXN0LHiaFnsE4OF/QTW0Zkl0CqV8ZY7Q==","shasum":"493d25e84edad62971254ad7af90574600716eeb","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.12-alpha-2.tgz","fileCount":243,"unpackedSize":16494204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnB/aCRA9TVsSAnZWagAAVzkQAIl4ksn3PUZCTAUxT3Zn\nRHEGfm3LsdM1AEF8peSrZ2L6B9U/WzOaO0Jjx2u4Kb9ah5qUmXQRAvI/m44q\ntgLtI5wVp07SaweCPYwW8Ux8UjUfLoZmjM8TUJQOflSNFvuhrvUr2xiXEXHA\n8M9xZNWp2gfP92firgakqXUmvnEichU2Tr0TGHtDgH/QTQku+WC33a82pUy6\nPylRMX2ekp41YckAzR45m7wGeaZKLRPWkOmgDMjs+AmYavpXHS72EJb3tOBO\npwwyygjmDrUY/ukB3pV5JrlaipCqAkuUmwWMEMwG2ED58uIGQCNvFp6mnek9\nWlqJdtSR10L1Scw8I5fKKvyDKx1wlN9BFBmW9F51EH2YXskGVtl0gBE3/43Q\nAcnoFr+iD2uJRtomMhCzpczJOuTjy8cjNGiQu5ioWyRPOnj6aAECA3CBCyst\n3HBVyRAnek8KwkI7QVK8QnYeS3LBTdTmgfDLIVPPu/FMaAJH5E0iyn3Ugm8r\nUKbS1tiRjvVjGWAagjgZJN7qTgJAiSGBByjeJlsStcHmn2O6BTVAofme4gie\nIx8q33XeT7hkLFFqEVNJ+9P08y9INqfPnJkWTzpVUKJW/r28T6x3+uOPqMwW\n3aNKqOf2ofniWB55vB0MqgyUv1Kq+5iY/3OFtcNI3o9mnl2ml2WxnMjlxt7+\n4fwB\r\n=d+oG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwIsAAaJRcP0QHX5q44i5EGdxrYpqawf52qDAk/eHRWwIhAMHiMRYL+9cYNWPeELRENMcZbQb8OuxAXuMzxnHlNTvX"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.12-alpha-2_1604067290099_0.5730197450909891"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.12-alpha-3":{"name":"webnative","version":"0.19.12-alpha-3","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.12-alpha-3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-apfBfVwaMrfDMmHVaqDbyI43E5FHT83fkjMM3AvfGWcAxJY0anbaByw5TbJZB6FvWneRhdOuRlt80PZTA8HSAQ==","shasum":"c45c245b845a7c3b10eab42d4c4834795eeda8fb","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.12-alpha-3.tgz","fileCount":243,"unpackedSize":16494546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnDitCRA9TVsSAnZWagAA9v8P/1M+3tUw1LrBlucrIyNb\nF8qHyLkhKbBn4wNw7ufFmRIWLvLCsrErFfXCbI2GaUsjbNaA3FYjqtFq8ZdY\nCnr+8YzjYCp3K+M2hnUmepr2YrmpTm/3LEdYFxUurnr1vb01KlumquwSujLs\n0TEcsuvfEcFr2vzNkMn8nTn9I3maU0SUcOLnLhMXG6Vx0+7We0IWwtFWzXMV\np3A0zJioKf8jVjstgszW+9L+TQ7SQCDHyTwV48Hc9AW3hEV/RzjcvbPKyWeF\nx/yShsmNDx1GnBonXvW6SVOVUQI3qsUJ97K2yylAkN9pDJP0FIOyIrZEMHkR\nQNTF6rKtO/u5efK+Y0M+xjWDjhJeZBsoK+Y+MlM436dJIN1wH4caifBjmBm+\nfMpkTRCf4ELssCrfckb0R5/6T59x4y1Eaq6egmB0BlKST2rddzqX7illqxJy\nfAEtt+AnoV3N5dgbD7WvFy82rDbZBkrJBjlNEtlsno2FFW9AAMfSyZXKjEPz\nKWmNUup/SOSlZ5Pyiva4dIvxsxRhuaKy6zuSe+gZtatnFgXrngV7hVA5F5hT\nbBuKV+TgYsrIbW0ivBw706iObT3IU/7PbtBRu9bihQky7AnQS+jexy/QlU65\nJjIzob3U0vS1ehvWa4Ocd/q+/uxGn3ZBViSyQl8XANK7UVyUbDBGly+VzKF8\ns2or\r\n=0G1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBwywRSaSO2grnNdap+Sru7WKFHygaLVW9Q9YHzcLVQQIhAN3LbOMY3PyXt99M9zj/Ungx6lZGKxbbbsWFhjufd6qz"}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.12-alpha-3_1604073645250_0.18905017113070377"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.19.12":{"name":"webnative","version":"0.19.12","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.19.12","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-2T/50/7mQXDIBAGEFz9lgbV19yRw3SUo2op55c0kXz3OIVUI97PM7PWLgTxWDjJRAQtLoj44QYsBsOD/G+XavA==","shasum":"4e0f6713266cb18a61cc9ea5735e434886942fe7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.19.12.tgz","fileCount":243,"unpackedSize":16494538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoFxCCRA9TVsSAnZWagAACwAP/3DaSJlzz++aD+PHBs8q\nztcp1Q6GMA14P2MavOCXXbQeT2Kze5NdnzDd8yRRRQkJvMj2rKUD7I0jWNNH\noC2D9vfGm31wn7V3ZEYr+54ZU2bm1PZMa2E+QvrC/Clgy5U1c/W26nTUN9SC\nwmCyOPOCfhSf3p2uhrDPWwES6A3jelXgV87VwLaULCkTCP8BJtcTp5ApS8cn\nqS7U4Iz0a8+TCHh2txOB4tyNkLTY8LzGnlUfKOID8GHwkQIVNEsBY/Wtm7yV\nNh4wXdNqZg9cVMFqzzeIV/4Ro7iEH9G1BZvSu7StS2ar1SxJzJeFfRTsEuYm\nhlYwwXHejI8zm3EtiAhIvuBcOLXCimnp4/na8jhGsRWtTXmDWmuRlNvrg62X\n3pje+V2LX5gRGnhs6PYMJmBQOaF7TapHxL9PNP9CuCdNGdApR/dVVnyVJbYN\neJrPfYa92/zh5i4/O9cmQZYMR1uSBOQJTXzwc67hy5bFo2ZlfG/yb9ultOcA\nz2wN888rD9tky4925UNP1075GnDyyKPnY3ObHtGKXSWSOn5F9p+wtkfC4CDj\ncld3defBHjcq2wAzQgCbJjWRxGeenyzaqESH7VTEFpPHpbnp+x9AxPW/uNso\n3Wcbm1Dct+rQMjTYdas9q3c3khaB78nS5IT3cIS08qwxSkB3xUGCJk5zj5Z5\n8fbS\r\n=y/u5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPlt5LI8QEtzLPIi19s9NfEicxYWtw+7W1/uDil7LLMAIgM2/JuIbjidp1I0qsBJfBGG8J5DTGq3XcWLGKEQqCjDM="}]},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.19.12_1604344897309_0.3551540363548833"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-6":{"name":"webnative","version":"0.20.0-alpha-6","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-6","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-NS9EYbxcJm1o94nf/Bmd9CSultE2yntoUhqTsEmLNuvXlL4jW6Mi/ZhhuQzsQTgjAVlFoIlnuDUTdSv36Iic7Q==","shasum":"217acae6310ad6f65746cb8fd4e4849570834309","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-6.tgz","fileCount":243,"unpackedSize":16592924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpBoGCRA9TVsSAnZWagAAhC4P/Rm6sPz03o730PFrLUzp\nDLeVEWKduglzHGYVV38QfSceMFm550BOCNEMR8dOXYW0LYmc9oFIT7MkEpTA\nG4dep5RWnjC/ZoawJltCG0q3K0v6b//Z870DbubxsB2ktbMlgclP/9B9urLZ\nf86RL4+OMOb8rRBOvJ02WPFLRX636LHWs5OSXpAO+ZqrXpY+YloRq3TQVxEQ\nA177AVrLtk4FHUrL6xps3peomwYJbeqmrXcp5+gC7NkpmE3HoyLVs8MgYB83\nhjhzMqMIX+O6/Wnd63lbNGKbPh/gL/uohRTfVRasKYYs25IgCmG0VICcWXxi\nFTBLkBxBZW6nSMKmZdLYoQl+UsAx3GGaoxKvbelsYsfJVrwN0NiDFr9Are/J\nrhiPC5SNSUVs/3/3TIDFIV6TV4afMhRNk0TKdBQANc/FpCC614P88tGYrS7i\njT4PK0W3jCWj3jfyJWLHPwo7BvpEaPXZyEiw9nsHikP0nh3UGhlfEwoFGL3n\n6wqIcKwU6X8sysY31joLJR/SqDa2U1qUS+YxstwHbEfsd5v5VOwfmBqwGHd9\nXk8xnLoBnWjFRjkqww9B55kjEioTKiI4Ydmwf4HaYYdS+0z1+i7DutdIN/kE\nfndSmq1Ro82XS38R6W2AgsoqKJucd9SHhMkZpyBn2SolXZQGZR2+Ubc4CHuU\n411p\r\n=RJXD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGI2MnbGPZFe9lMXZgrPpQ3UJ+EXOzK91ACRrfZxIY4WAiEAzLi2gC1yaQR5/tfukIa0aYpvc/OFjZBytQ2bpvpDjO0="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-6_1604590086231_0.44193829891785463"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-7":{"name":"webnative","version":"0.20.0-alpha-7","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1","yarn":"^1.22.4"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-7","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UsljdKcYdWiARSlPzVeUiqFArV8Z3jAcqoV+uCmLYlrD0zFrgwpcnhVtfMEuzHk84HpgaI627rXTZwZTIPXgAg==","shasum":"437fe5bdd933c9f29c1cf19771866520a66365e8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-7.tgz","fileCount":243,"unpackedSize":16592354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpB3QCRA9TVsSAnZWagAAAqcP/0xHgoZ7iWrVZHcaf9Lm\n1CpCSvvlvKvplcYgtE8QBS3JRp8n6wVct4QGq1tCOdbWqLQ7sDqYkg8mD0NV\nU4ZA4dksPNJwDydGD1J9vi0s9FczI0aMFXkpHnTbBj6P/xPEnNbOSHErVCN0\n6vIW9Da4/rtjl3cG47JFEPYUggQCwwaqvwC9cpLafGRpJZ5H41+rANbDQ7V6\nofALEXCq5m5Q7vu3CAL4F9ceHr05K6jfKsfN17Br34/SRyojPQ4/wOUw2SKi\n7JBpfqwFC8v5Et4irNhie0kkmgmZQ9J4U8+OYr/MqU3WP1x458/9UL6/5vPC\n0MXDM5arbJZcd/MNoxz/opAXWEuz+/rAIcDi165FPTMYq/xuwilatqgvPbvS\n/6S3/cVSzbmBwvRsb1d5JCN7GqvK+ZhGU41TDohlfxPkR2tt6vGJoZR0XSPp\ndt4ephaqK3k1QPeLnF7vsrEz6uNWyNwCZhN+uLw2yEwDZcO1Wu9is+gKZ6Y2\ni3ARIVLXXHgv7YersFci637YIQrncy7wjlOTE9mvYmkn037gr4H8XdGTl0me\nqPmXpotBCATeunLrQBjI0ytklj7IDNU5q+jZZh5BATgKQ2BF/hVthoBmrCGf\nl7fWExRDo/ynBE0kL5gZCkvncw+4tkIvtpIe1CZclMZPqUpEPuBKVybaW5iU\npvLY\r\n=Xmhw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu9djK3r8OsB+4A7SNT75WSlvb0wvX9173uwsUkvXaUgIhAIya4H4r4bbrpt/onzNaLrvLBhajrxRPn4hEeNRGOmt8"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-7_1604591055613_0.3192005347061815"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-8":{"name":"webnative","version":"0.20.0-alpha-8","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-8","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-l9ZhIDKLntw6EwsVkjEbK6cCRtfcCBDdQLJ4stWQffPvctWg56vEQl9CiWow7osdPZqW3OlRLM0E4O4YzIuK9g==","shasum":"5c23a25000a5539e85e16040ac12d9afebfd8da5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-8.tgz","fileCount":243,"unpackedSize":16613091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpCJgCRA9TVsSAnZWagAAMLkQAIXsa580eUt8jbEoE5vt\nc+bMOZB4PzSX+bO+D9efD8IiBh86QrA4/x4AoX6mMQuHAv50aOGRbO7t1klR\n163ASBmL8HWH0cTl6V4ruvjpsD6GYNkLXtsZNCPHgB972yosEj3ZZSkOkCB+\n+X4G9csk8ySJFIvRrGq4413ksOcBtvqtUHvdZZTWNc3F7loH3ma1BSiEzBin\npEIH1hheARJSqI3yBPy+7i6CiGdGEnVG4g7M/FWUxHwLNLemmynglWDnMN7E\nziuGCvX2lrc5c41r6jy5qs8KvIrR0iucAAGyo2wt4PTwd1AGo+lFvRMB1eNP\nkTRtHUJsgTjN0jPIOo0pKeNngVx2mu5J1cpCWTghI70jkLxz0WUap8+VyKaJ\niHRDi60W+kSyIQWi2EY3iEdAgRjxw+Le3EdGbOA4uoqNXSOKqYv0mTjZtr6f\nHWcLWOi6SgYcjy4RHh4B9KzAg9rEnYwDOOG2KU87irpm3gV/h5OJMZrZxUI6\nuOGIMPnU4zmvJgWv8Wfb7BbzJYoYIipIWkDnwiMqElhCSh+9l5z50cqPptXt\ntUgSx+RmIET7NKp5YyGrKs4FkL++tnxyQU/e3HFGu/nur/z4wBR9RqUGICPZ\nbKgDwRSF9njuajNOXOCYvMBLVyknVvB5c6X5VsTxJ95E7ZDHOhwJW/QtZUwB\nTBBx\r\n=LSeg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnzOvgPAG5ZuyYYb85y0vnnTgnTf9AL2rauo/tMGupXgIgXIRQtevfvCVPULeRpR1o+DssUa0Afe3fPgrdigwHE8A="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-8_1604592224282_0.2764705231836968"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-10":{"name":"webnative","version":"0.20.0-alpha-10","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-10","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lNacxj2g9Ru5l++7ANcWXybyhHfgT7zE2w6q1LT80CDs1ik6cLthrcO2LY0QRe5++s9r1zfVajFpvPx4X3yHfw==","shasum":"e9db93859ccdc4d9427127b3633642efc00cde79","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-10.tgz","fileCount":243,"unpackedSize":16719701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftAeuCRA9TVsSAnZWagAAtGgP/jooHv8P+dTl9D2YpGUq\n+sg4jwY9ScqYPBKBXBJChPHb603hjAa5n/X5eci1qNQFp7RRBBtneaS5aMiT\nMUUv4VTTN5n2Z5edamTJO1L3ve7TWfA4YtPSWAcSsQkC4oYAno8s7xtn6W+m\nP08rPFCUftLyQzeDS9ARiO8nnN2TqhBITh/hKR68IkHXPI17CxpIaNHvHou6\nEIM4RLl6GQcfLQk9rkg2A+2GkB7+w/Vd+su0jCyvhr6kFpSzIVvadxJUALHk\n9cACtBrb74bAKySzHtpRFh93Kg01pLs6G013dNRQB44sOaFSRNuO0WiFTtIp\nrmYqbi7utDmnj4Bo/EMpsueGaUgWywZe3TlVmAYUbRewZ9d8Km5T4F4GwYl3\nJCPVWwekm47U9gYALpdZ9fHlXoabHufAtq7wefdt0wilGgppBBx8V1Maczn9\nIKMASz6LguceIq3McTZKGjgxPEOn2biS0lUfWdJU3b1ISP8BFvl9moXVJ7Q1\nFkmVGAzyJ39Kjpl41Gmv/6yhn5ReB5HMI/6N+yuII1S0644DQFziCLb6nxGD\n/xZg5WX62005T05JxjNa1mhXNd7BIdQcRxfmLTh8tdUag7lYOWXB2MpSXqfo\nFeeI3+U10/ZNIj2/K/G3m0midzqiYw3JQwrHArbCv8DIbnOPZYEXaoBgHovA\n+NnY\r\n=iHyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9N2HoS5xw9wvxV2UsE/q7ZKYrXEFBwiaZLMwhtB7wswIgf/7uIOI0VeD4pBRePlUBbMDagxpoAnp9E+kE1+aNuwQ="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-10_1605633965668_0.3122081848306342"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-11":{"name":"webnative","version":"0.20.0-alpha-11","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-11","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-7QFtDyFQDI8XiA5jJMulNpHzq55mtS0wueEtKaC4E0XjsW5YjkqWDYuKp4ztfJykgwo6XeNcEan2Od73OdJdTA==","shasum":"18eb2545b05e2fef532ff8cd6ac242bbdc769d98","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-11.tgz","fileCount":258,"unpackedSize":16803764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvBHvCRA9TVsSAnZWagAASaIQAI3f7QseqHfr5SArKkU2\nzTalI1SAtNwwNi3qF62DA5QIPWCdiF+cRmwCyRuO0p0MiO1ulHZ9ePI8nb2I\nBsudy7F1KqBHUsUEn/ZFc5Ynq/NP+JH6vLX/vUBGfK8sdjNTMtLEuWP41unQ\nU2oREvrr/sQnFuTRsDLPDzNBE7WpLtuwyq2yWsemZlluWRKiI6AvqAHonWjD\nOsqf1TeWhh0uBq2NeLYZhHOsvbzsF2YbzbkQfKQsoqAu/JC1SDZ/J4WezSCt\nvEwxMGPWOWys9zfUZ2Yo9hyeuijBXuPOPaxH0P3OgpWlYO3U/aI+ditZ6Qyh\nCwTw6f4LeR41tiF06lkIRRtzTMitbSsVvu6UzMItzKypP58lBbQ5F/ijOnoZ\niy+ttGV8nW+kcdk6m5ACu60mvoidRuW69hTzWb+l0Snez8xVlAiT4uXhlZBh\nw75laPgYk8RlzJariVLicXiYgjmCfiMtBG9C1CHap86JakLuH3RUWGFrLuwx\nu1lWzJv4RtulSTgSxVSYiBM0L/WjJU/hsdJKzlfhH+hk0LSnflobsU1rc/KJ\nh0dgxirVvvhm+BFrSptLEIcSYc+XoutgpBNHus9Tka2C2irtIczEin3kCr0K\nl99gkDfVP+SJs19stbOuoilHr3ETpdgpeQ10DuqFBQpa3K3sWshMuK+gdmKb\nZJyL\r\n=Fyon\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBCP91l/Ospqmp7ua/A4UgszEsS6oq6PGufor4y11jSwIhALPFEMjp1h//DmULsOjrJuLE6qI1qflXSmB04mDy01eh"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-11_1606160879004_0.5077243315831892"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0-alpha-12":{"name":"webnative","version":"0.20.0-alpha-12","description":"Fission Typescript SDK","keywords":[],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"homepage":"https://github.com/fission-suite/webnative#readme","_id":"webnative@0.20.0-alpha-12","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1dfVx07+PlNQb3fwgRsptZXHi5zxWPWN9KiN6X/CsyKpuQlrXqdhSw5LoKBzaVgtiexFfDnCHNsF8HdZiukupQ==","shasum":"63508d242c981ab2757d1e5e87cad0fefcca394b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0-alpha-12.tgz","fileCount":258,"unpackedSize":16804418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvBRTCRA9TVsSAnZWagAACAUP/j31htZc33K2sVCzdUTk\nKe5Ctt3HgLs8D4GOe/hImIm3XKNz378iZca5CxWUvcIayR4udrQMPidUd1wp\n94yn1szMwMKWTo6qih5BZNmn1sY9kPRTf5RGKJPGEEL7S1Z9rAz+BFcPtgeg\nzBLA7VeYQADVrPNA3V27HwYIC86MFbpt+zoq67SQoFv7QNmpGFZLXcoJHKE7\nCOreCHdphudU2pEblybT1DDZ2EOSSO0pWofP0uLh6bXTzKBNNX5eN6tz01Kl\nVtnwlRwq0zBAITUD0mYk/xHKrl7qeVixOtKPbc1ZC/4oDa8nq9t2W6AkznKW\niosWCIYW53k9YHI16ItMICXMcMXaf6uycDu/Bx0TZcSTTKubwuF0jD8i/FkV\nLmoXFTcfCVBIx9B4w2/RI2H2h96puzkyaPZr+Dl0ehEG9Z9IjxAqEyjXQoNB\nP/KmzVTS9ACFCTRKfUOGI0huVMVJ//v3muGZYj8OzciF8r0L+rW1PXHrKEWV\nn7t30fZRT8/PuMZ6Ck1+Wc0tC8bxOMl/CQNq3GF6d1rXBCS/MV8LW1TxDKtA\nbg0aODcxIJskde0P3pPPw+xPl/IJI32l43v0yLBNEb74z9UeZEwyAdvxY7KK\nZBwcrkdceO3Q56EdhFz1zeDtzTF3cJfLXdePWr2j0FPWbM1nB7U3NcfgXo+I\nl4up\r\n=fbPc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/QSDSF6Vl2XEDRmhhCygXcs075kuWxpoExu05HRwn6AiBmbpjPHz9X/NPmhMp/3mxCw/zaxeJkMd48fRUT6LZP2Q=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0-alpha-12_1606161490826_0.4351458335135707"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.0":{"name":"webnative","version":"0.20.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-9bTUnifP/+AtsCztB9pppwA4iXwJ085jzey66Q46gLz8qTeY75ov89ZsUTvqQblVlnoqH4LZeUx9Mm7jRMgdnQ==","shasum":"165d062fda220446a1e966b2ae2a290be2149bc3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.0.tgz","fileCount":258,"unpackedSize":16802222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvThECRA9TVsSAnZWagAAUgkQAJcQw/tDgIC1qs+jn2jF\niM9DIFalYBRD5SFmOHUpgR3UWIDAfNJkneyMA/p1uGulOaQjLRmrKKtKnEW5\nVb5mUFlRGSMoH45UqsSucPWMOJOBsOJHFIBvbg/PbwR01VVJMBsknPoRD4j3\nK2FCQ/PFctLwy5/GE0ogQzq4AWjFDmkjWnYxbVlggnjpfGpGjHUn5+BF0S38\n3lPB/iufEwM6Xw5VKKT3AHVlUkj0/CtJxONTimTrxxkGIZW5LsPpn5mYkR//\nDlGS3oy9aHRcBzzMeeZVC82YCd0eo1cgH7qIo8ncnuTln7F9nffHReuNclpY\nOp+m9Q9cT1AhRb2OFO/1k+iNDiAk64KLzlg/YMKFGC0kyUwScu7eDD3URxGO\n+0UEHYrJV/1Ph4Ydtvu3i397msAX3KuYoBRunCaV1rIVbScm90h2tA+GFOiN\nHuMEk8WUy5iDKYMEzBhg01d/uj3dMetiX89MPTlvVv9LglH9YbqSOMO3dc6K\n9E4qaxyWE6qFdDsQtYPXbpWo1yF3xiy8Wwqu2fQcfmEObrbvGNAybJWKbTm1\nXkk+W0ifuteyZKSpUgBflk82wu8Rhm4MifMu42IIq5TUoNf+sEEIUv/em6ei\n/RwNDo77rzEFaUkz2CGqbXwyiTt8V5nIa2jjO3s9AQzjzsiCszIOF0tP7yhS\nXUqC\r\n=0gro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcDrKlr59JTpq4PpvqfXD2gN6kpM4Uehehr8ALSsnTXAiEAmEywA2oL7dny6G6+95zXXSlpjfYsk/txAZYhy2/MP4I="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.0_1606236227861_0.3376670368572292"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.1":{"name":"webnative","version":"0.20.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-d07n5Q/MgrjNJqEgTrr6vCse9T2+qQsi10MHgduGLfWCgcP/GJ8bWI/+kWDiMhFjqARh40XQOIY49H8vCfaNIg==","shasum":"c93176f19a0d281a713bafa55e9ed6b626280aa3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.1.tgz","fileCount":258,"unpackedSize":16802734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvTtOCRA9TVsSAnZWagAAOXgQAJvsDb+65yMQCtqQVcp8\nPH3MXniXTl+qqSpbP2pe0JaMuXTDewcfvcrG8tDdKpwycFRsDEkcHEGEIdtu\n3SXpVXDsh6/u9Nzro4cTEN8M5dP5hOGBMi5gfQc+G0nooTpoQKQ6f85xDkEh\nOvInIwz4fIAzwwg8Tl0v9+XQiji6fsIc6bBTGiNYOLwk9kj1szzmXJF+PY2K\nllon/pOkOQurpQeESt/+I6dhK68igJS9Zrttfqz2xqOkhtp+4RVPNDhpPaUL\n2PmOM8f12LC8Qo/j43FWm0bYFcKPC5xTwcaEy6e/CAB2G83pDXhPkQ6Xptn1\nfw1ngLSMctejSwVxT6VTwPaiCGbmeHFpvIuJcl2l5g22JRlJE8DYE01KMJYv\nlVrxGpKz9WhteghKFBrK3QzR/EuwxnIDe16AXXc8mRcgjLk5UOX19RhH+G1f\nC5YiVjobffdnSrA9OeqPOrQHmXwhYzs0C0e9sN5ywGkrtbCRtpQ5ni85CRc2\n50RHVGmA1cqf9WDgdLbzYFDxw0Rg3ecjj3khZHueEHCsql1wSV1i701Adi1T\n7VcCVjjwbhy4SLhtodtoe/jcsuZQAztdW/q0FjCYkYiFpCV2LKRBatCQCcip\nrxPcI2ME3PDr2812hXy2r1hJO/3vm+I4ZCT+hD2uyfZpJgd6QK6bsVRiDQ/8\nO5Tg\r\n=Zvmd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOeo7ft1l8ByGyEa7dyEJ64rt0lvkbTk0TpeO9KZ552AiEAwOMHhDOgDJ7niUD4KrxR2rJeGBlofMClUn3usacKSR0="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.1_1606237006016_0.8751004428712361"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.2":{"name":"webnative","version":"0.20.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-tDvSRb0EbKmu/CZL1NkbmGB1Bmsrzx8399tRsDn4Mo1a6eFVc4CKXoQL6VRW1EywPGmfU5kyr3kZLgwQRxDWVA==","shasum":"bbf9d2f92f594584f6b21e347ba356e4bb5e3212","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.2.tgz","fileCount":258,"unpackedSize":16805001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvUmkCRA9TVsSAnZWagAA9H0QAJDaDF6LmOQsXpzyMIZv\nd4nYABxkThq4Sgxogk6RpPDSGZm+8ANXwQ0OQFQMQ2+7qS7KSwQZS0dEzzH/\nqVieAkerk0FRFwOcQfnYA3HD89DGJ9ymBFdiIikc68uk/QWI4MrS80vTeDxg\nlEurwUYzo0qVhUWQ84/tPdxpgdsykwI0ZWwEtAiFwbF6BQlfwNrLmJfQZGbD\ngso1E/Ufdbb0Vc0JmE2K5hANwv+PgiGppWcGc4iXLAU5bL2spknYt2HGV0Z8\nudGAxPGlC+CmU81R09CKGAlVV3zhy3oMwbg3ocAZkVtdslHdl20RnZm7cuuo\nMB5Fi7wUHrap8eRdTswFOfk3eeNCAwkfSFTniSRv1XmtjKlzWfPuRvkzWrWp\ncRfGGh2kSSi+XI4HBGYbRrENHrVaCj81mCG7y2M3bqqDcMVozqXcE27+tRIc\nZO+UUex3dyH5Wpx7OS2juBzXzh1DXUr55pGbLpgJ1SiL4g65Oy2cGt+ATxLG\ncNPy6Z45CkOJ5uTrVwht34qIhIocq7cy/aYG5kT5z7OQfxvdtAVq690B4LN0\noM5Q3VN+u2K9zWAA4x3ROmwt1N8neSoeAridMS7+oo5tSf+6aHphP69Nn2cz\nrn6L6HaR/2bo5c/np5p/iSzkeUItOJhSWkk7YuflbYZEIz2rdeMbGs9BLcD0\nyQvO\r\n=Nf7u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/qTK3G8VTbDxUgT4lMWY3S43qm6Ah4MhCjaC1ZFzCawIgMv5paqFLcsTF8BAfmabQAFpGYyTFxM91umrTztjN+Hs="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.2_1606240676115_0.9462736750620095"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.3":{"name":"webnative","version":"0.20.3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-KNoXy46JTHUtQYMwch9hi1wa3WPBU7ds+hE2Xw44Id0jLUwXT71QJbkQx/UsWu6rmc3Sc+h6/otfgkZW4aazuQ==","shasum":"c02e6aee21a5c28a6954e06e039929aab65a76c6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.3.tgz","fileCount":258,"unpackedSize":16831638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfv8hFCRA9TVsSAnZWagAAuDkQAJZq7W8XcxV0aqzUJ7Dw\nRPhgziVivDhDHXtCDyfRIT+T/1HWmh/s/wtaT1UtF+TG+Nz8rVzczCbG4Axr\nMXnG0cBvJNVZPar6it+xdUpU2kuTwDn98I8DqwThoURT4WxcqfCVjwowG71d\nFGxs7VBg+YH2loKIV7sNLEnk2L/KNNRK6NIT+i3u4KKF1lyZ9xhmz2GEuzGE\nWuOraBJwqDkSQx1Zk2Quef0QzIu8hjwEitVZS0qYUhnmrs6wcB8/DY1apDkA\nxtOhKBQR68el3dmXwFolyyNCNvQV7Hq86W5lpZcKKimecdW8WMpd5L0vR1sC\nTaneQ7UXoRxgficzTgKZLj4H71WRatViLINY6RfjlfG0OQC2BJWX5K9PL+SA\n/5FBzjqaXN7FSpd9RMZGw3Tf/K9GgBkwwIZhqmVPXMzUgQQ0jhZ9TILORsqZ\nmeQIzbS7Az4GY0Yz3g5kfEYN9IaDiQ8WUMXVqCnsr0OfV70vh/ajsGbl5N1C\n282yiWFJuWu67tVqkQ7nPTtssXDeW0gArA99C1aFTR4D9+YURO20/5KERtqu\n8iRYGz22tqGa4x9ZiD13A03TudMGAHsaoSDUMvNlDcOkTBce0BaJOZJDbtFD\nZAuwSpxFzGlpel3OJS7z3Vtl6qDJhpK/qLKqN2a/Uw9KUT6KcXzKwGV2Hi+T\nIVAM\r\n=nVbk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0b/YEk5Tm0pEoBHifYwYDr6zlgD5FegHjY7QBPJ066AiBTa0NZFa/hylJXRke2wbbRXE556yxd8klZkjl0c+Ftww=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.3_1606404165147_0.4701821056216622"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.0-alpha-2":{"name":"webnative","version":"0.21.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"^0.4.1","ipld-dag-pb":"^0.20.0","keystore-idb":"^0.13.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = self.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.0-alpha-2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bYVDf+6Dtz0DgBagY8cZ2PEaMwLFp6GKDh0+lmURE/zqeeiUlFmZrWks942ya4+vySI7kjAFryVdGS89XagdlA==","shasum":"3c677fe444b55d53d1746d65d0851edb3db838f6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.0-alpha-2.tgz","fileCount":258,"unpackedSize":16453121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfv80MCRA9TVsSAnZWagAAbqcP/1tilnpLl1/5DfXdeOpo\nyHR1yk6NM0Rm258BaqRU/QjFigQTpB8/l540VQfOvxq1thfmn4UcrGUR6+xM\n8xLFw5opTO5WAjJTRBXvKdEsQLqqLBQHXREtHamqWH9+CY6GqaRJ2UcBPjzI\nn/EZCaQDwzBrD23QBjTxzI81g65m3KbHtgGskEcNUA4xBgDqrF99MR9K/T8g\nov1kTi5cANaHBZAuF1RoMcy2LOexbVRvn5Pbdq5WoX+zlKQT9uc3padC/bRW\nSry5U77Qhzinc9Fb3YZ5nhlsQSllOtHO1fnjb4OHzo8Tk/bSxlKDv0AFS8Sw\nYoLBvHcgJVaOTzZVGPio8Uklmtv61cfVafKA3MFvowzPiA/rfAWXwlhK1dhM\ns8a9CiRweiI4ujkMuUULCmybs55kxJqXFMqDdHRNAte3G2MzsaY33aDE/71N\nmJlRFGPgjX4opdReXK/LS1PEGWUd41jlmT0o+hNca1SSegwnh4xoK0+/PRhv\nTM5qDhr7J8TG67nxd4BGeNGUFoHJ9IiHAQFwFFssF7vrH1P6ec03rJLzXxUh\n73poWaO1dOqU89l7wBLHuktQfq5duILw67EY7brH5isf1q/A5c/lUJ3MPoAQ\nFg4K5MeH7TNI/+Wk/AZTwjS2DqGQKBu7OKugJizJHc/hhja/pr5e6/iBNgrC\nWGmw\r\n=FngX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEB++9FZtuxyfISei7sOHOYKRQEr5RF/UNNMM2u9/aO2AiBhZPX2IQqECdd5tI4kzVv5EWvY0uZ+Pp3ycuMJy22iwQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.0-alpha-2_1606405388391_0.13702620899773166"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.0-alpha-3":{"name":"webnative","version":"0.21.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"^0.4.1","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0-alpha-1","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.0-alpha-3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TMax/QG1yUCeTBQ0+yBHlYSa47vxDm+arMhe4abC3jtUbIpA8GHwQpqpp8wyFhntWOFPLMQY9DgVvDli1/JzCA==","shasum":"de26e05149d23fd4b5fb9a31ea5f1218ccf511c5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.0-alpha-3.tgz","fileCount":258,"unpackedSize":16454884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfv+yKCRA9TVsSAnZWagAA91sP/jE61WxnIviXdTT2U5hX\ngiHCALXg2IaRgJqT9jfdysQrzLpqgaO4hcMT6LPf3dDCumajLvtc+BouQfHg\npPs2mJ7mwnW11zqN75gRyXlwHSyAHquI3BEZolUGninRg1gP8EUwCvYslPyc\n+Vh6JrYPcyPqlbPWzSoekJ9kgyHhF/zGJZXG9Ubuf3+hL238IH8pdeC4xr7q\nzjaEDft8U4uDIKT701AGEnrVjk2SBA/hZcIABfpZsc544Cu1WcPG3+3xuysW\n0DqcfHw0snibrPybENd9Dc/0fy79EGHvqyc046mvwfynUWyVuLfZV8MvdK72\nMo+TlcZF294bzD+qmOM7xV48G6sJtmPVanjHIGrXjfLTGBxMEPTbmcJNEh6s\nSUnLtL4a8a1IPqxtQSJoOdV/N/uljPnQkxHFM0fACb6oDAwwrxcP8UO6+emn\nRyqs/fA2ZvJCG8By8uiJXhuntHPxlLvAUWpG5rShapom4+VclmKY3oZZRoDG\ndXf4vCkDsS9hzZ9waUQZk0Yhzk99RF/A3i3f5yUtheUa1/3pS1aJf+kKxiUI\nGtHZX/Ol/qbFR9YksJbNzb6MAS4zdbWf55VmD2nfmdI9K3gDXFQ6evhvUK5c\nKl9nbZk1SgKMVhQn9CS2BZRKRq/iUG1YZVztBFp3Bo+tvnNt00C+Kdn5Vkr6\n1jZH\r\n=xN9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY/DY+tXU+1mEPoEonJVAp5LY0VsxDIuB/l6V1kuke2QIgcA5QemlEmx3fOjC2AVYZf2mZQnqqIgC9//B+IwWm56o="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.0-alpha-3_1606413449783_0.6809684473586779"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.4":{"name":"webnative","version":"0.20.4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.4","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Pye/VUKGfDgLUhwXaNgwQPsXls33oEWVnhMymJlpfMzN4FJin/xJAiANv0UBuBspaYH90OzuNzKIrZkLIi2o/A==","shasum":"8a2e9ff39a7c3b9417cd78acf136daa9c9e527ac","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.4.tgz","fileCount":258,"unpackedSize":16831549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSERCRA9TVsSAnZWagAAyr8P/iSLo2Rmx19QaPgEqbFv\nHDbY6+tsOC6bNhmDhT9M+m/gpbKGX+HUFgVsUavua9hKRKQjWiww/nDBm58m\nk96ABFWAZGda0bJGQk28KdWIkzdzFCk8eGQ3qpAyXpbzzxOcd69Brg0lU8eg\n/ag6OvxACjDx/TrgIcZQKPXpFiDDywDt710ruvQMLaisFuVgf/n1TDY9+dPT\n2QJ7X/0TgniKVoHBKIOcI9oG4R/PJmbKj+02cHUyV3Xcfobs+mQRl6sKkZYX\nkQtvkpzcKRo7uySIMtBdp6k1GkAqu+duo9Wia42yMmLlYfdPkXDQsRCTQN4+\nZHvsELRrjUVuAtidXcNI9Luflh+yTwJCgx5UK1cEtxgVvwl8KYuM4F2sfBII\naHXH7QKZ3nTfLS+vubwjc+XYFSjnyncbZ0G9RfC9aWqKGgVZS+rGYt61Hrzc\nPq29sDsDtXM82sSUsacTLaIunZELoNx7OkSdhmGcVCENiw4uGYZSZl4Rc5Zc\nqCYSTIo5XMVXeVKAcIO8bxZFdRcce2DBI5minRpZ5ttR3VwsgFHqHQ8M8YPZ\n2GvdKWrdMRiCXHYNQxtLi6U2apwUsTDFBhzxcEjuYfW1TXApxyfg91F1aiQo\nQZ3kCdYZ7Nt5hjoHiA0jvpENxGiZGY9H0Q1Ah8CpV4ITviR1F3ril4gKBPBn\nO2Z6\r\n=024t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFmZyLpGBbLecyXp92tjwZPpcszEOByTlDwcpO2dqgEAiAml8SxlaCNmgiYkwcRKev7QWjBKagF41p1s2myygyTsw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.4_1606754577195_0.5991366862537304"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.0-alpha-4":{"name":"webnative","version":"0.21.0-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3-rc.8","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0-alpha-1","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.0-alpha-4","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3IFnQf9LnhG7/BVFkzHXbZN+TcMFwmzTPG3ECDsRPaaOSHQbsNXzDtjejnQ32Iik7faUdag5dcX/HZMUC6pwZw==","shasum":"3d1ce271c3d676c7ea783071bbb55cb91a979414","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.0-alpha-4.tgz","fileCount":258,"unpackedSize":16456698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyrLPCRA9TVsSAnZWagAAQ+QP+QHpxr0Y9fdOS3Qc7D/u\nk1Alg61Yl3die6IWfKRrCGXUm3lnIIg3/vS/V4YVrg9x9QZPLIFlzpji7Vzk\nms6NHZCHSxseYrv4PLP/ZLiIxSZMMp9FZojOudTR/fOjLCVjNpfkF4cOiXdy\nhvtaW3h144RUvn33VtM7YkpbQjK9tiMA3Dr+hipHWXJwj+UH0lYu3o/uZqgc\nhl/4BE9ZYp/I49jAz1WhoywBYBOqVLDJ3849NfwLC2Npe5BsPPDO/+xYE+O+\nuAfOngcfcjT1YXwy2gkQJbfU2GrGHg1y6YwMZjxp43r5WYhebG+uf8hcv3RM\nJ5HVnD3uCc2DOZhzS3uyu6P3rBI4kFxI992E+GleknU8SswgGGGfTgreNmeC\n0Lwdy8m9lSFhmp7MxbBV3oSM2VwubTDR6G9ilAe8T7CZrdZ97vWVbtLuOUNf\n1nxswr9Biza7B9m0EaPM2l1At20tW6tJW7+PythtxZrrDiFLRvm9d0KJFsjm\ndeG9ELCBFXzU4HQLCUKFxOJnuhjinZSU9OOq0NsWHmAYX7nAqQ/NJZ1PQBSh\nYI5lJp7fEg2rM4BZxYzEPVXdR5BY+zKyixFm7NExRencr4z+QQ6wUImiqVPg\nCiZdpJUwlSh8Q1oNZf3Obow2DLN1eB2s7WPmjNsU/dQpAujEwHC5XMSt+a4c\nWb8t\r\n=Tgyg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ3VCbzHI0xF0RaqNkSnaJUW3PZ/FujFe10eRXADAhtAIgZisRueskp3y2MQB+446FjwRPbffaX1RtQd2IPCXuNSU="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.0-alpha-4_1607119566717_0.19809136283407036"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.20.5":{"name":"webnative","version":"0.20.5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts test/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testEnvironment":"node","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":0,"functions":0,"lines":0,"statements":0}},"collectCoverageFrom":["src/*.{js,ts}"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@rollup/plugin-inject":"^4.0.1","@types/jest":"^25.2.1","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","ts-jest":"^25.2.1","ts-node":"^8.6.2","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^3.8.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","fission-bloom-filters":"^1.4.0","ipld-dag-pb":"^0.18.2","keystore-idb":"^0.13.5","load-script2":"^2.0.5","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.20.5","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-UKMkKARF2K9XpngMrU98LZ1hgueYp12vYBwmkhfKX3kw3j9WiGbiXEnQZFEOPtjdCjV0AM9TvDVbHCdqSIaivQ==","shasum":"403e48431c6227c49d4db222c2b7ebd47eab6ed8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.20.5.tgz","fileCount":258,"unpackedSize":16835734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz/0sCRA9TVsSAnZWagAAMNUP/AhbOKOnNEgQ86IvVw+9\nnD3lx04cEthnQJRtVrjT7H4e+COqqsPHVVCIleS1B7qHDGATpSgwozWng2/h\nrHBItZNQMuXMhOXkStHstXWVqjxGx+HpMn6b0FlO+DPgN2fRXyRkwQnM3tts\nZxUjhncfDfeN2EQzAQ2IUm/hAMA+pa72kgZckXrRxYtYuvS42xCNz92uydPH\nPjqLaWJdGQAeS7vlsCr8PA6LT2i+ah3QDcItPKkxn7qrNf2UKfz8aD4tSON9\n64rfvBqdvZ84FHssgAaCC3Enbv5wo2Gw4vYLufJOMm0JY0DvlC1w85+MzAP8\nlXEuj0SCalo9bvCC5/pnpRYNvV15Hl8cstVZKz8xXPuQkUyMVLqxkS2+L+s1\n6/P8zJ4f1FVit220IpTXLq9gr8aUUV5zuP3qIZQsefJUZtKb5KxoZe2TGgPx\nz+xi7Sf9EiEHoJTK2Km1TCvkLkVdVSiwqCb/fJ5GeulLbp61mZQSI2Q2PRov\nyU1No4CQRrqdB3L/hLkkT3ck6AGCLkWr4lozlCe81cd9cbBm4C/cOaBjLJwj\nVYZHpHn2odLd3xlesJmibvsoxpb8OiaCLxneVzmGCRtgOOFW1aIy2UAp9bTt\nJz9okPcSssHW9VbeleOdk0A+Vf9EFacL4W+IIa5VdF3TLA2YP5R3p4D24fC+\nt8p2\r\n=h4eC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU3RnV2QhyXslrpJRayhW5KWtXFSfr/6yAtZ1hEqcyUQIgK2NNdkr9lVou5rkPkkwVHt0TiwBl1Q+MT+evFADplbY="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"expede","email":"be.zelenka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.20.5_1607466283676_0.29838100812770585"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.0-alpha-5":{"name":"webnative","version":"0.21.0-alpha-5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-inject":"^4.0.1","@types/jest":"^26.0.16","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","jest-puppeteer":"^4.4.0","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0-alpha-2","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.0-alpha-5","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Jz0YvpSjaG9Rv9NQLC5wKWdw/j0NAY2kDov0o+piS6qvNsAC3I44p9gOdqgDgNYA7oe8ktIvKh59GEAm6LTVGg==","shasum":"4038704778299b5e43d440d718c52f39d25351dc","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.0-alpha-5.tgz","fileCount":258,"unpackedSize":16464043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lG7CRA9TVsSAnZWagAAwwIP/0MtZ1mNVFCY0FjyhvpD\nikpVSAbRuJHfbIkd4TGKWaYr5Y8j5T1l82JTt4Eo2M2ed9RwHE6J+jHZJSOw\nwK/JbUe3XsXW+iePCoSF1jeqejSU+aaf+xOOekl6MCHgDbFXMTTmzatsmJK1\nwKn8+ZPbxmEkxhQLwyxxJd+csIhId5qAnSH+9a0XyFGHfUtPCP84zOh86gTG\nMJDBV8kdmz0ngiKH3Mw0rAMCUUu5N4DDd+0MZgj4hFJpKW1V9nO/ppT2a8oo\nn4zvzBZpCHKxj3irCo7QalCQRJ2WXEI/VCeKon0tvhq1vHpzP+f7v+HT5ecr\nUcr6PUfb/+gpiljVRkQU9pRJZXBY7CErHZC5w/dCZm6YDbazhBqG8l/ppv0g\nRHcx3cizL915ehNQjmAFKuoI8AgNlHrUCYfJlstaongVdr2VOjBQ03GL5jId\n1od3SUgHUa+QzCJu/6l+wYx08Bq4sJ833YHp4vvxWenGVe49n58/xkk3v5v8\n8XY6lIZXumJ1RWYmAJ/wecAYXCu4bEZFPehkcjEGxsBwzs8oz+Iw1URtlxjd\nCaOoCN2DdeNgfiLzfEnkJ0shepkHm84pPi6cRdYap2O54wGfL8xqjhDInON5\nUifEXjiukpTV65QI9QxlQ8fVI4dEaKqCZGkQUU90kGzsBPR95X+NixIJttb1\nVggq\r\n=Z5js\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuf+ngi9JSt0rZJ1qKfIQNLr0l98+FTTIAGXh4gMpYBgIgacOCedLMJKbgGQGHBeApk9+A61lqo6NpQeLaAqarVfg="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.0-alpha-5_1608143291315_0.5285419841155692"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.0":{"name":"webnative","version":"0.21.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-inject":"^4.0.1","@types/jest":"^26.0.16","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","jest-puppeteer":"^4.4.0","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.0","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gijRRZYYIqzdLRHoYf88cSbtQsmuVLyA/zI+tFX3RnmyRW9JSDUgzUCoBk+rcYYW6ZJvH8DcVaBXZQZ0h7cv8w==","shasum":"6512624b3491bd219bfbe981b5cac03ca7c7d183","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.0.tgz","fileCount":258,"unpackedSize":16464027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2mv8CRA9TVsSAnZWagAA7HEP/ilF/Y2krq8fnZQkN6A3\nwuC896vzh64SprBwxJ3xzFnmwOUJvpJqP76yrTzlrE9GVwjawsgxycCnqomf\nAYVoeFqoCIC1n+z7PiwEZQZqln0VplrmPiYgN+YIFKG0rgTME3TZUsuP6CF6\nr1eiyRhXX6QAJEFWFMRaEQhAhvWdlVxdrTk8pwIwxaC5qha4shrQVdZR1w/G\nWO1B7O/8bq/7BYXc29iusZVdD/+9CBzFG5lRr9vgAUArpoWeK2IppHYg+Rnn\ntUCpenB+Mbs9yJtklhv45PcLDcexdvcjK0CHcqEB8jdEf2NxpsRL02UMZaar\nUqL8n0y8BvMp7h/SpVo0XhKE1gaHsmQi3c2JTLTwO2AF1mNNJW997OAkTiUK\nLb+nPqHsZjp/TKVZyx0+A6HRtKYL9sHD80WiMUAqRNpCsQktDqCITuHsUS94\nIAild5KsANnDXp/+sRRu7Ujf3S/DXgMhoui/e952r/sUbdfG/fXRjNggk2mz\nqK+T1zbC8u6pmdSaZ795K260z92VrXL37C3dOAvzMPbZ1SkaFPW3MPj1IrDz\nJTEgsS/a0hjVV1VBLY7lxfIIMj4mo8cNXyV0DaMZpApBiV2jOBum0GPhcgIB\nSIKYBTCxCgEsbKoY/JZN34OKf3EH+Kt+k2yr0XGGyp3biQ/hd2LjqrGd+sNj\nDj9/\r\n=9lkS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5NcajVlnThbw3tTCRhuEd8Xc5NH6sUK7pny/kDW0PHQIhAPfJRrusFZMub1B3rWGTARaxYoMGOFcSrN2DlXBy1ExV"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.0_1608150011746_0.3698449021780481"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.1":{"name":"webnative","version":"0.21.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-inject":"^4.0.1","@types/jest":"^26.0.16","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","jest-puppeteer":"^4.4.0","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-N4oawXhTa/2t+UnZmPtKTofaN2VRSZspdpcaPg6u5+u2IZNbtaRSlMO1uM6jlTk9fF/K7ELQv7S2q2MGc10nJg==","shasum":"08971f62a33532e494a4e221d45c65083dcf8e5f","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.1.tgz","fileCount":258,"unpackedSize":16464238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3RBuCRA9TVsSAnZWagAAmnQP/3HF95AW3MkWHs5j1Yp6\ntaIlwvX4KRkAzhZfls/h5Q2dM5Hkx/SCwhYbmiJwpn/GaPNrgwfRcROyZELu\nc8ha01Ec1I0sWa+g90X4SpzjGEBSaOUDDQXmWbiIrndf1/l2xDLIvh8PSwaG\nVFBq0T3KKEc1EwB67czXCKrjdPVFovsXY0jGTsmNTR6j72YeX6GuiX9h6ZpT\nN/JWfa3b2CYMWVIQkoQXV9P2sIEE8ZiBghJQJxyDCsJUgLbeW8jp4/HhKZOI\nhAfFEm0M5TJvZTETfiorUa4kF929Ao3Be1QB1a+2qpcHZIv+vozwCKBjil8/\ncnx/rD6WE4vtezGEEL48QD7f72/Z2WuX1Hr1/hADRWQSK5vQG86RetieTU4G\nhId3Uu3zgGU+vm5fMpoH6pO3xAse6cNMnN8BVlbrJOW0ftGgExm10MtjYda9\nKqIcKhPsBsfWSl+jgG9MSMqIP0zNf+FGijIedX0f7lsxmEf6YmI35L52tW16\n/O7RX9B4BF7UGu6fiJe6j8SKIYrKstXp8/E6f4/AlvW5/tmWUPrbj2XK6bJ/\nTBCRf0wLaGePOgZDKYzmswHHjf9eebHWQ77Wb8Ilqkn96eDX/RRVM82e3b51\naDv5WrlCjNAznOPtai9nKStbkg3eFll3XXFmOq+ssT4sbvCozjw1qDBXTvRN\neO7C\r\n=3dEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDXMKchvwA7mKcWNpnM8FoX7P5zJalz6opyo2byhOWZ3AiAPfAXGG3qhjp8XNiZ9qKGOz1U2Z4PXWNO/hK84t4A4mQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.1_1608323181782_0.8210112806684582"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.2-alpha-1":{"name":"webnative","version":"0.21.2-alpha-1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-inject":"^4.0.1","@types/jest":"^26.0.16","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","jest-puppeteer":"^4.4.0","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.2-alpha-1","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Nqykz4vHzmWQwkLhw4334CrylGTH5jZdGkqWw07RGeRFnC/OuFsfo/FephON96l6EDE7D/J2wn9m1ZS9fWkMvQ==","shasum":"484a5d318611d7d1a21daf2deef68297b3acbb02","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.2-alpha-1.tgz","fileCount":259,"unpackedSize":16480717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ekrCRA9TVsSAnZWagAAJa0P/0P+nyObzKWx4v4H18zU\nUYKqddyJxcPx3dx8aZ54fKfYGGZQPf9huM8ovVe9W3LO842BTAGIaD/b03/F\ne9HZPXfGk2Bwk/I/eVBY121P87luDB7LOpG4cJOfeBVsl/lwSiNnLemyiyik\n73m03Gk4Z6EfFpCy3JgIucOq+MitAw8IO7aWjwzFEFNJucVctc3GN/ZFLsyE\nHCigymph2krADObeyJva8ehVDI6VvwCCm75jZrj3jdM7PE8aZT7lm97o0yS8\nnnQm858BiVxQO9ceUSNA+tHmqQokvK6DoI+2peXhHcdwr3pepaJ1GNfNKEwg\nwEDAcFvzn9LQCVrGciTGgQffGZ/Vz5GFKILhZcwSNs2Rqg2D9dUasAxK4nvc\nfjeVePvpFEa76hnisuWCfaSI9+SM1kxX+1IBZWZPwFxGFEwZH8AipMwWGt1W\nrZm02UM74U07sGUQhHbZ8UUGJgl+sxUBv+uXfCiUCukHCgTLbX82hPN2l2pz\nnmTUT9hwj1KHAFHK4J/vlfpXKqQ0tkXCxYMRlTlBboPptblK30YKuhY9NW14\n7m5uV6+bjGKa/jYCpdzZ018J8HLebDuABe1yzfUbsuEUdy1QLOKTzeYBiJxy\nUxNKPrCCQl/GyuqpRJcPqsuZp0huKd2Cx8HYaZzrBY4IVHyFjggFlIz9sz8v\ny7Ej\r\n=AkrT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQNbk4NXK7vlwzjG3qzAtXIpFeGCyZN7JKXoZbEMwbZAiEAgDCEXT0e6KJycfFVgDT6wBGL+i5p+qvuoSXzK4bhh70="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.2-alpha-1_1610475819022_0.0822883116387223"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.2":{"name":"webnative","version":"0.21.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-inject":"^4.0.1","@types/jest":"^26.0.16","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.7.0","jest":"^25.2.7","jest-config":"^25.2.7","jest-puppeteer":"^4.4.0","lint-staged":"^10.0.7","prettier":"^1.19.1","prompt":"^1.0.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^1.31.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.5.0","rollup-plugin-typescript2":"^0.26.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.0.5","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.0.2","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"0.4.3","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.7.3","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.2","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-uDW1RF8auYQV70a3kWxbKoNoghClkAzDSXcag1uABqgSLMG9DO+tWrZGW05zQK+84rxOIxJhZAna79MFJs18iA==","shasum":"061eb251ccb891a2b99426a7be257c1ae261afb8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.2.tgz","fileCount":259,"unpackedSize":16480709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/er1CRA9TVsSAnZWagAAXBwP/R1ZLGVdHn32ScpoJJnM\nNKUTqRZVOU34l+QfQJki00+/5H5eNKNriPxgjx0r2/nDkRLqJpjfM+wycFaH\nezneoJeRk5J/Nu3oGOSynCNHO2QQ43epwrcuMaHmUhDTwroEQpU51NFUZwXH\nL3wsgwuOQVgQznOlF2r4Bg7/C9SVARhe9U0qPrJXyDj3c3dt7u1busjJ0JhG\n6adMf7hrldKwspHNbL9g3rwLKo67RrSoL0qZMqKFlJJPooaH1DMMiOjLgEET\nWJ7WhyaQ4L2yNwniCPkmZ/BL9Yqxk2oHjoGHB3M9GWnOmvFoa2extKldokxI\nc78x9+ccxn+o8qAsD4JyPO5I/alq/0pPo0/rW2uqq6c+TZtl2FecBhSFBNW/\n70rLg9pxkyBniNGMEa+uMnVmP+oPchkrb+gy5rmkSbAOl1TFhN7J4GT43o+k\nKTVEhH48TjRDW8kSCTZo7He8dE/SS+M9gt+WI4RNUKHglWetVQ9AKCfS+fWR\n+dYTpROXi7LSlVztHAOqN9h67kVtqvaZhOLJjKNADTILeTj8eImKeiuoZEJ0\nnh6xltzc9VzspbcXUVHUFiSj0+lbWbGaEf59qlpTWRxeWkjau9tGWGcWe1gM\n1WKiOIsd4SszCszPv2Sn6YpuctPwIY52wNOxqMwJEfQFptitOIWyj3T27b5A\n4Cow\r\n=q7NI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuC23BIYyefokAGhz14IchpZ2e/A0NH/Sc+/okYtCEhQIhAKoy6P/b36uFeX/gavehOx9DWbh69wg8XY0qU3SGVnez"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.2_1610476276796_0.5374432020219961"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.3-alpha":{"name":"webnative","version":"0.21.3-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"readme":"# webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information »](https://guide.fission.codes/webnative-sdk/getting-started-webnative-sdk)**\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\nSee [`docs/`](docs/) for more detailed documentation based on the source code.\n\n\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.3-alpha","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-zbbnzN/AZ4HkfK0tCCTo36yIGkMLxNeHWpz49XQJTABXHHo0dTojrDY72wjAmZEMFPG0iGc2iHjDzro1C3gZoQ==","shasum":"a080a10d3d4a4acb7c001371a272ed9e9643bcdc","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.3-alpha.tgz","fileCount":259,"unpackedSize":17095627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCwc1CRA9TVsSAnZWagAAobYQAJYWgWoH/B10ygdsRTLQ\nbNVhu6+sklCdmkFMjbOwiuoSzUAtoLfJg03s9qosOpO6FmRsUJ8hB0/WQx3q\nfUKIS9bkRHFSrjzPZuXJJxe0i0XEJvbjp2xWUyWISv7rnb7etjzv0uT0wwSM\nJpl2r1UeRshhID+q645DUGs0NMpQjHfIRdW/BcRBrZRwiMFppRwN9e2wlznX\n64+YflVjl9y76Mfyd3QByKOJGPsUqIXvw6Yf6FrCsdKl+JTIu0mjc9rCd+FQ\nexzpeA4r9jMys26DqLaamNjqJizviUbrCa/GlQyl3hJLwUnzlRz5WXu3R/W8\n/LhmL7OhkndXW1ustmi4AS8lBbWVwP2KTXj8QUGyKpDNuNBSAWHxcvQxcN2N\niDnC3J5P9nxRneVBh9qwoIFgibCe+5ydXdyhStT+whVuIajXGMUnOxkCrZmk\nw9R2MtcI9GSM/vI3XNKpE2sn51KrT6A/1tBMqrt4EaZoGlMY8THcmkjNnDBr\nPLa80Dp5bekJw2tElRkap7FhXEVMbcDZungcgVFfsxyV/zOVegbUt31HFzBI\nsOK5jMrJD70dCnBGnONrhyUbUt4Q8o/J+xfzKgm+BYCb76nPTIH+03ZoTwnu\nV4GSe7zYSwHe0I1U9e+NjH1WoFhyD9WXvkYazwzcEzQXSwBO2u8TXp5/DmUQ\nKUd5\r\n=/6qC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBgPRtX4hEVh08SMKu4+67Dsoz4GPn291ObWZ6NX71MQIgLR2rTo2e3TqwjsBpfjYg6fLBFRoqN+5iBsNOC8UTMiU="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.3-alpha_1611335476721_0.6863944250123792"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.3":{"name":"webnative","version":"0.21.3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.17.8","typedoc-plugin-markdown":"^2.3.1","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.3","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-kaVLPVoQEnB4/ERoBWkwgk7JGG/lFLNDizSDDxXMsZx/tYVa3xHFQBw61XU9BDgLyfpAanxH3ZCdncIiO8kvgA==","shasum":"477af19bf9cfb7d152f5d9676e0d0a1be52c6614","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.3.tgz","fileCount":259,"unpackedSize":17392779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCzOXCRA9TVsSAnZWagAA9msP/1mBk5kwhSOAY/2wUSQm\nl1NY4MKBfSlK5uhPT5bsSPBwkPnW6zqylDYfPnA12YrmZzY3E2UPrC66QcFj\nK73ICny5AT9WEwkxfGPrTt4ulDCCEkkjYA757JbCsufOwXLsn2pAP46G2cVH\nExOP+YKaiaYl9PEDpahwqltl3MHPUjj8Dl9BS2a2tbroDlaisbRXtyhCz9w+\n3gyPT32eUeFPjZEZYpJEv+a2Y29fvUFg2bng/vvjtpNTjeMIJqIphkFSoI7g\naHuiglpKbtHkw2vMavqk/bkf3rqj1uQgTfz1ufmobbDldYWrg9IAK70cEQiq\n7/uFvXpKH1cUx3kEXZ1WDEIEIZPhKuzUUc2or/qNvOfvGcnqLYQdeuVZA72b\npO5XDzNb60tWE7m3Sh22zJ3TXYzZJmp1xohuWLFWdjTSofLSYED6pIrEWexs\nOvTFlRCVhQHenQpPsTY66o+xdSO/Syr8JTj17qkZ4KI0nxEKOly+Geknn2D/\nSwswAgtl4FPNDsCmWyU3DJhdZl2AmimIIrpWfgib+oIXslcRbrOKxoAGZtPE\nKW8G3hi2X5n2/KS3yGmf2UYuL9EpLUd6KDwPNylYC+nN2JplrkNCw6Pa6L0V\nmjJ/1vXoutPgv2IMu//L0D4XigRhwDGDDdwHdfT5wFEo28j95ptZoPYW7eZ+\nWYlT\r\n=pxOr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGdCwi7FIz7Fsyk0RqKnJ5zt2bqa+lGbuqXKFD7YvFmvAiBUewYv4ohJYnIDQDEUOj++blt3An0a6EwvhEcwoc1lSw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.3_1611346839077_0.5934889171739333"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.4-alpha":{"name":"webnative","version":"0.21.4-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish (run this script instead of npm publish!)\njust publish\njust publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.4-alpha","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TbNns+eLcMWLNaV0MylWbBy4MvvT/KpmyH2ZkA+Rl7TLAURFVe/7XDTZEQIwLvpj5K6Sx3MmEMpPvFG6rSgKvQ==","shasum":"13a90d4555f89017f7bc24e369cb48c7380331c2","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.4-alpha.tgz","fileCount":236,"unpackedSize":17923084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJrKDCRA9TVsSAnZWagAA8BoP+wYIBIO9EjGUud9n155q\nDg8T6/m2E+YRAPxhZvJ3bPAoQP1XEADOmKgzpNXA5+uS/ek27uLXLMsmKpj3\nVNrocwkDeqfoIe7qpSKFVLXPpw683YPQ1i40kQGQYq2yX0tUNJKSkoT+xtIa\nxpgDrO7x7x2JxYFWPV9qc+0TunbRWpLpP5UK8h6kiJJbQ8xHnRdVAWbibTC+\nCVzB9MfY3IX6feU4hHQCNTeC+dAzj85212fhMHu3qTPaV/e9yfFYaAWGUYpL\nNFa20W8yXyGLtDAF1l6VTNpYBy4DsmOGJj3Qls3EFw8SZd5kBFIaWJZxNdAH\n9tWWKfihVNCd20LVFQu9Q+3INYh54rcBj0bkrfW3oZyNEZ3I0y+YFPWrrZeC\npd8grh1L0i99rBD6u3xOfFUSJIrf2CH0FriDNEdHM/Vlkcmrj4XLWyhD6Ooo\n9emfV7Ah3cUNS5t/9MH3UBpTSrZ1bha16OVyuuGxA1o3SNV9YlIWV+i/oJmH\nLSBYKhg7a5j/NfruDhDRmO6Mrq6mYREgnq5Jc613otXw7OEIty1f0ETw155u\nqte32MiTKttT3IiTbvOLLkJFo6P/MWOq5JHA+aNw1KWeLXWJQfCvWAt1DcVx\njI9qcbjguvB3fshvNrO/9BMrQdvtYxeizBZCCUtq7X+BfEqghDCymqKT9Qt4\nfiPW\r\n=s1A5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQE2Z+l673IBiZSzYQ5XNUT7JEz4SqhD7/Z97HjE+84gIhAPMvUwqXdt/PScr30upPjr3D8NP9IzqfJOkfvOhW69wN"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.4-alpha_1613148802999_0.34613196897168397"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.21.4":{"name":"webnative","version":"0.21.4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"index.cjs.js","module":"index.es5.js","browser":"index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"npm run build && npm run lint && npm run test -- --no-cache","precommit":"lint-staged"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.21.4","_nodeVersion":"10.22.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-4fozhQN5QboZRV+lzx5muLuQyeEsjeyrs3XH+cQhlon2wl2M2d5DgcZlyyaTUv9CBckoyNbVRtlUrMo2dw5OqA==","shasum":"7607abfcb9e56fffb9c34f2e815aa3beae1d052a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.21.4.tgz","fileCount":236,"unpackedSize":17922622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJrf3CRA9TVsSAnZWagAAoxAP/23HG4/7G/qGun17IxDG\nFoJ7CnJrrEbwBusiRuzlVEFz8Mv08X1AP63XDXe/9PnmRaZ2FWKL1DO73G1z\nWZIxEpeT2kMmo+5dn3lAXgvMMRrN/0ulocgBrdgr5tEAqCEvZrY/ryVw6uis\nOfgXDykXzSBNkDuYCb+RTw1kvG4PsXDLLggjH23RPlpjkOGgD0YZQNXEV2Zj\nD/wyGp+gALi17VnKTB7YPJKF6DC/UfTJ21s63b93ZHUcsUEv6beKUnKJvZwl\nTXNVa8phrsUAjPQY2CKfXW2vlOgdqBvjkWpfgTPEYWRTgXKotH4owZRB08Mh\nBGmpFjjVmaQKzJQG688beaK0nQW6+S5zCugdUnkY0TgZtBQ5ECPTifvnbbVt\nzYRWp41eB736oLvKsQ+diZM2tOZtrGnqOCPAXma+TFlI6EdySQO3bdAPNYz/\n/7tvm22AlqqRKdT4cFlRuhzdD/MGfmKhiTi2cl8pcBsHP82FN60sxBHCmYtd\nvbQUcoqXbUdKa+B5wcsFwLeIyj0o+bmHEhe/z6u6eNjvyn6CbuhiJ1z/Inby\nl1C/WOz5Q0FwUJD9IhDnovvxz/hEIkYbLwaCuZ9CVIa1svgpglzjCFAa42r4\nANPdKv6UegXObBmLEQ2d9VfqsGt3F9tLk6a0zXYyy9jCdPFnp8emMOkzAQci\nx8Oi\r\n=zjoo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrsK/+ucD1mtjZQb1tZmq5kkX3d7zzF9v2WY72BZlenAiEAqdfrJIeDlNzINGw9V6BmLWwjtOKrh5y+gACeQLMqHLQ="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.21.4_1613150198712_0.42969167514563367"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha":{"name":"webnative","version":"0.22.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"7ac2983a14a1fae9c2288f48b41651ad69e61aef","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-sDrbUaKmkivmflzzKJbkgu5PGpde2sWonEkivB7b3UjYGDdqWpJnE7nf4Pkqph7Z4hqjpIM2MJuL9TrEp7gQwA==","shasum":"ddd728eb953a03ef252f1644a4b8b37660153c89","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha.tgz","fileCount":298,"unpackedSize":22948693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSSz2CRA9TVsSAnZWagAAmyIP/3NDIXEkUDafngwKpB8X\nPTgObZcoziT9LM55HBre5Wzs7w07i5HftQXJkQYeO6YHC3UFZUtJGm4q0Q3f\n3xOBVL4H9u3j1JTce5B59tIK7vkwByMsnc9KvMwhx4kbR0fzSJvMOm2cOl2X\nwhlfHG3kyHUCNGrcOq50ESq/EButNEPKepBWWR09s8KigVeqIsz+PRlxNlAy\nVLx7BZtFPlhYugtt63AVhqCMkkQcrmkCe23dNODFp43JOVKpBKB2Dx7UHDp1\n3/tg61XIGHs4QRFg3/gssH/wrnZnBxeORqNnB3WSK+KIJpt6TJhG2M/H4ojU\n27iP7wXJUoBRAlCmTqs2hnDGAvle998Y3D2DV7UCBkn/Hz9KYYmQvcJpReqo\nJpuR3YwlsK/KPkKBaF/IPxl0DJsClxXX5A9DLLD9jfTz3QCNkXgxQp8ULum4\n6+doibQlnvGm4Jj1ylr6E4xKAPem8C2KlzwyGzGmkP8CsDXFyo7Rxi6YvTbF\nbSTQ55KC9O/TlYbM/xuciIMOY3BAu1qRNo94pRzzK/OOWvSRpBigtmPV15RP\nVvy1S9y1zyzhqKFbgjc8QnSGYQOyb52Xh9jZ+aoU/LSFEcpdBZyQGac8doWK\nEO0nCg6Y/4qjBUIcD60xZXBoawj2M4Yvh3xlWsp22ZDLvXWDSHefWmol18s7\nad6K\r\n=DQ36\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSTWfDmSdcZQaspNe0ywlENU2rAZHtTY/nuGnKRBumdAiBkbnlvzrtzCTttTyxbOeW44c/JAurq+aAQvWv4PVd2eA=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha_1615408374027_0.7292994353423092"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-2":{"name":"webnative","version":"0.22.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"9ab23330dec87750f1341ab90a558e2ca4f090de","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-2","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-i+yeEtMkF0XmkVazXDBmEa7sH2a27HSJwwKNWZ2ZUE8HWa6Au5MS/+Xo+edRsULsLcswso2ZoRUiLXW13kYCUw==","shasum":"4fe118bc9a838cef5ad561ec699de818bcff2fb2","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-2.tgz","fileCount":298,"unpackedSize":22972132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSlqZCRA9TVsSAnZWagAAonkP+wQ26sddqIvkCsdHW6HD\nerdRINMmf6SJzoXmOcoay1F2NVpRmj5FA81l6W6QR1sgUNMUSJRCe6gw8SLJ\nNVHDv+beZ3L2CR3O6wBzaAi20UEbgmkuFAVR3JwR8cZmCmnL5dAEa4vDcEBe\n3OaqCf1eD81W9QntT3miQW6ABMrMq3D+klI6liYerDf6WFWkknD3bXUwOptN\nmD5pyzZrGwRBOu3h6J9esM56jrNHHZgab4aJ08II0aE1HCaS/zyUENfryIt0\nF0C2i3TLj5ni6p9HugNq9NfpIFKn8D0PHJOKSSmtXE13v80c9CBPzN6xksG/\nnya2TjhbyFEd7YQXQD3cZjAjbZwURwBT9zCrl8ZORsvuvQ1tXb5u1HKH9p9G\nxrVWGZxGjAHVOc23PV5QwZQDlVNKH8XE02G5FLflssyaQ19WovGYEka04o/N\naffsMLLISBTOi3ziAWCJxrq1QkzM9KrMPnM2jkuyTFKj+HSmEYrixRm29AOS\nVcD/LFZ/hn2yvAiLkmZ48b48SAFHWD44j35qde0ae4daXTizl01VKG3XLd1r\n1UyNQGsD9j//fBPrhH+KEvP3cLHdOhho05ujNLt9XwDaqGgCSGlWCgsXfnGb\npQUtgYVukJHMghIFPMBx64iL9qhBBzIaaFx/LGpgjnTgOEmDTnB5SB8FKyE1\nOUAr\r\n=YIyB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAiOlTXW9UB772qpRL8pXUUV+88qwBBRArMY0/w5ZQJPAiEAlZziF/qRSxArdqHvOUVneL/0RfVVrqGADrkMa84D2RE="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-2_1615485592897_0.2074207756358586"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-3":{"name":"webnative","version":"0.22.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"69ec105dd7644acc3ed07de73294c45f13aed67d","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-3","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-tF326ZtCRGsN1q+iuXc8bA/J5QuJpIhbdH8GiLrKppv/gkBp3KfDGBu8cuifTwZAsD2BvCRd9NbH2pNnSFebag==","shasum":"0f47b58930107132c0f13ce5f4570d3b8d682576","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-3.tgz","fileCount":301,"unpackedSize":23025096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSotTCRA9TVsSAnZWagAAdNsP/3pMorP0kUSc1Ouas0aD\nPnVzuvVul/QWSyDUrFb3IoPd+tdsQG9uykzkxNvV4jjNYdVOhYczbR370iIq\nTvPuhYbizTWeTrzjMX2lueCdXFcmHZaQ7/7QjYwCBAnCksF93/fV8DjtVRtH\ntQO+2yAmZg6E/fQ9MxQ5wBYJIfLunN4TGgzMuCg5FhS1bXv5TGV/bK7CjR9Q\nQNBfAHxyJktPSPkmKFAaBymbJ9ooiyOGJhXWGsJC07lToSsyM2y1XivLod84\nGAWuGo17Pzd/iFt/Lm7pczlepZkIzHKBAshhVq0phuEhqzbNb7sXyyku0kN/\nGwZ3JZiwxi0FvUwSMuvkxbXN9ADsk8u7gU4Wo7cLhM+QbLAbZ2Dd12X2lDwp\natgHV272/rZ2ttgX9yrVoYZnjLacqZFODFFMddmQGcBrUKZ4J680oQb4c0SZ\nCeFsEZjiFF1JwDeBgz/Mt+zEH3G8FizaOQwgul4qo66KIERDADwSn/j2Ierv\nsbV4tIjSOmFUFUwJikLaqrbmrByHkpbsK79sF1Ppn9G856hRTRx4iNB2TpwL\nPtpfVk5k/5lsED5F4CN/QNYHQFGOP2nIw5sEsHWH8OkRx/at6gSYl+dAYVob\n8cG6wg9sUGCuIYofIMxXYXbGzvl8Ix575x3Yo05kxHYhd7zd8mLQ9zvDhuc3\n3zL+\r\n=8W7e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNgTeik9zcmlNndroX8+uWithM803tfH08kAzaXxvM1gIhAPG6OfSycaFYFguYMiwjj34tAx1W3ezy5vosdxWg+xiV"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-3_1615498067072_0.35508791708750276"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-4":{"name":"webnative","version":"0.22.0-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest --coverage","test:watch":"jest --coverage --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"6b32076c2ccf8ad996dd22209d59049cd09054cd","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-4","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-1pmIluvqUlEVr8DKKumts776HH72+ooXsI707/QANZ5bkat7uSYr+LuFWPvK+U1SBTl78znRIZY/uGRvPjVqvA==","shasum":"a9b087e82809b799e7ae1e1a2255e0b099a730e9","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-4.tgz","fileCount":301,"unpackedSize":23027051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSpJVCRA9TVsSAnZWagAASw0P/jwBQ2cNJyGDCk/wnohe\nUJSZtREoroEeau7W4WTNlVsWOSfPhuwHPB8Vl4MVcALrh4+fPjQYmuZynYQz\nIWOHZDCzpvMnXksq2wNltJ+V9agKpdxRm+rHqXS7vnOrcH2fmeSer4e23tTq\nFQ/zGDp/08Rthj55koGo2VBiLKIB/eDudZBr2Icw9ABa33HKbJLycUxEyp+p\ntCMBOeK8d1w4gk9S+fFlMXS1dimd6WCDBtevssYfFcxFTSsk1KjvaQaWflUo\niWQq1GO0uR7ypK6THxiZlQtgo7248aXqO82ErGaMsLbBEFcWMEYEKiSi5WRB\n3WhfUdZ1jEWEw5sABtSLT0WNLKfUAWfWPKIy/Y4E6fifLmCyZ4lqsQpjpTUA\n3ijXJgo13oh9oRIkZ9D7fv59HBly+esNyMbbyqzxhv7CwM6aOSRRMsWDaDge\nGEnzk4oqmhARFtSsqPc7+Y88iHLBqHUg5hKGm7rOYvhqI669Au13JnObZB22\nGk5TvJxkcPszhfBaFMOEote7ruO4yguM7PsybsVKuOfeV/yVdu/Kk30JKIbN\ntmAHir4lKSlmL8tEKRD2kWG1DP6HIpUOflXjdK7kAaF82MO2x/w+tj6icf9f\nK0o/cgHqkfQ2Fyi5ZNYNXK301ZcAwsoMdEl+GQKEY9X0ZhlswhBD7reScEw+\nro98\r\n=WFuO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEn3KPiPbl7zYkY2ooSXN91TYxBOeZPYnaiLIM6BclFAAiEArWzjCVgWkeFWDgwbefRLWoseULp5wapZwAUFAAvzDaU="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-4_1615499861204_0.6867372959192697"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-5":{"name":"webnative","version":"0.22.0-alpha-5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\nconst appPath = fs.appPath()\n\n// List the user's private files that belong to this app\nif (await fs.exists(appPath)) {\n  await fs.ls(appPath)\n\n// The user is new to the app, lets create the app-data directory.\n} else {\n  await fs.mkdir(appPath)\n  await fs.publish()\n\n}\n\n// Create a sub directory\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"fe3740cab2a227f1ae2b2b6e668ac3063c21b248","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-5","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-IgLb/413G4aueEaNa8/NI1UzlHGogq+wgA3cHywXb0Bmjjy+EblnNPq2d5O4QLtJdW507ih8TTEI9mhF4C8bLw==","shasum":"54b0f640784891d7ffc92cc21702c9a2f1f84005","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-5.tgz","fileCount":301,"unpackedSize":23029488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS5gHCRA9TVsSAnZWagAAH0EP+QEetMySi0nTGQtH0ppG\nv4kFmc/wtZmPp3NGDpJJnv/l4ixhoHBGhjnOsK+NsKJdLkL3XFX/7lZpCmc6\nQphavNm8V47T9Zowmp/xA4+rp8wfFb+xuWMYkKhweIwF0MUcleCqGpoMgGla\nzlsEw2+0hiX9ZlQSCJ6qSy4tEkXNI+wn4Od3TqxqNM6S0PSsuD820rMPspMc\np7NDKy4yCqkJQH4XPsFwFoefpHawI0QHbZ9nfhJZyxFAiaOAPRHtQcXbp5OY\naXn9sGnbJEqk0rH3uMf8d+KRNS1dfubf549stwmrfiZsqnimqcDzbpdqzi5Y\ntv8Wz330fP//OxBldeh1sqXpA7NKMRavMpknvks0ylpIPXuEkpsdp5K4g52h\nkn5WLUTUHZDE4RkQO4kfpGVW8H2E0TbLyjK41cIZfJPUJx6Tv9XrKBgQk5lY\nibUgj5j6iJ5MXfQLz33uMJt3D2owKcgxRwHgsJ7pL3xSaC9+LFezfz0d2IM3\nhrff3vq2UnwnRx+wgp0uYFhAQ1k5neDbOXYvehif4HSufpY3tPT+XVz6U5Jh\nEqdbyZ1xk0QUf9k809DkjCM2dv9tep/lX3MqtyOz9UbdUIIWqaHP3WIXp8IK\nNQy7En2HC/iglz4RWeKq4gON15rJlAnybCW1pRIhX4qvBLIckhqRmDyNuyf8\nW319\r\n=P4J0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWWG8eG/dNdI7WQ9GIWyp4GPZwPHxYXSPeIDUDYx1NUwIgUyHy9+NaT66JSIA7E7rws4mN3pT9n2u7mPusNOeWGAw="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-5_1615566854998_0.7038828697562072"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-6":{"name":"webnative","version":"0.22.0-alpha-6","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"507408cd131b39441d0287ba0a7476f55ce18e30","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-6","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-YRwSOdw6Vb+t+C2LAGymhCMislv929KZm7EYCLV7sEMlKMUnVrNS5SyEEGff6wHbGs0r+GATgF6IM283e+2bww==","shasum":"8c792169d209658dd52e39b4ebc698ce8ccdb9a5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-6.tgz","fileCount":301,"unpackedSize":23056610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT8XmCRA9TVsSAnZWagAAjkkP/0aoiRPJenI0IcJiSlCb\nWGq6f7/mxrjC8juC9uS8vUe2fYFxfTUhI7Yl8aqSZMYvpuxpY2XKm0mWqYLF\nJGJmjbXWSmz4XG6r3o5FN/Pfq7IyT5yvV0ibv8GRmza3ZNY4nASQra9GcaJh\noHrDqCq4SN2DkdO+u2EvjTxrpmRFADvYugHwR+lJIVkxlgwYuEzp5jaliFbl\nNL1i1SIDdalIfkpcMqRGpeujql4u/9vGlM1I6GLyr3FYgz6oI1FT6bffr+2G\nGlzIByd4jTfx3KjCo/X7cxULonWZ/iyQqyAmz9hJ2j4rP7cWv5P5s90MA9Ns\nG1ATfJHIgy/8EKXq/5vj9YD+rc69XpndPBx0wGrwOuzfxAWqY9VYZ/Dc6RrC\ngh7g6hXtxAKKQfJ0Ld7tKfyJjKdxQkbFzWUtXpzJvn4Bv34gLmhmFzyTULwe\nkWx21Hx5HgyluLIChQhRk+xqE37tbpIZ4DGpg8ihbPVIaf9E+NfmQeZ3+lCa\n6oeCjyGxPpfyMQvDGFJEojvQwaphKQcXeCDVGxAPgO82xsvD7IiOuAslYB9o\ngS+ZE2JZ4Ur8WPaS6Rt2tVY0A618Odl8O0c4wfOBnDczLrDfCoi8jaJo2f0n\niIOPbTT1SmfzS47XhVBk3F9isf3Utzdwy62l1W+ykRddh1MLZIdK+8QRPVFG\nS+bC\r\n=MnKj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb92+R7iJ7D7P9KJE3KWs3BNC42gX9jZmrIqsFDHhNxQIhAIDBJ1G7upZYYAd/bNCyKHiGQNaGIvKHAoTy5NY5nmQE"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-6_1615840741393_0.3179625744147936"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-7":{"name":"webnative","version":"0.22.0-alpha-7","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"a8f254fb842a7ed755eafa2e5247aa850377a1c4","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-7","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-V5epbMyG/GYF+PC4t0FgWraH4OoqOaGGfq4XntGmu5fKV7IsSx4X9pi2VakUWjmIVk1xQs2TBuDz9xtNTdyDxg==","shasum":"d218bdefb26567ceaa430d5b6d63601efff9875e","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-7.tgz","fileCount":301,"unpackedSize":23058944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUOvkCRA9TVsSAnZWagAA8bMP/igYVEz4/lchXM2wh0KR\noge+W/xSY8yXFtqYqfZBkJq28p9vcgwvDVlnfEHYyft4geOFJJGOZX3GZtv/\n0auGdWUsCoGqdiJrTK/TD0Svek2/Nomqglg2b8a1q+lBn9TYlNsoadfG8Qhu\nEAl5e0WLqwxokSWhq4RhYReXXZQIIjBYKJmGjhZkibQmd2oltipxPtt5uO9A\nrtqe/bt2dnPhAExVTuwt3hVN7Fn8A58G929MGeYt7VGDhjhqLVFtx2O0WCoV\nEjIxQFDQtTnLCdZiBHECqkFy2Cw7JE7T/wQSsub4JMIsagJZ6SREpSYbIsnn\nb6a6Op9TTnzPsSFWmmLzH/SekpmmXQd86377TfWbvdCIlUh2nzyFJs2doGF8\n+BYX8pp96cpjpSwFQuXUXKaPsvuVfVcFY0Q2Y0syHJDO1UDCY95OQOSbGdV0\nGcJqPvH/nO9fy7B1El1sJN6iL0L2lZB3oYNb3UUy/BsfLKN9f86ECgk+wc11\noP4oB1gVie9XKmAcH6brJr9BvCdejjzucx9gbI3924Ztrqm9rHZ2KKeJAgK7\n1aFJ1f1B5SE0Ii8B6eap0ESiFlJ2j4T27TTXJy8aXyEoQ6ch+6aunfvSv6lp\nL9AxGgeHj/jJyoDxSf4wlY50RdyL3PaLzK4VMyk/GQCFiQjVD3inZmQtLsJS\ntPE2\r\n=tR/M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFR4ajTquxQHGul6VxkEABOSCf4eT/haswbtZFyu8ggwIhALrKsFWEk2tPhCkRMIIBRdXJkuux3v4usbcqagPMxff5"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-7_1615916004195_0.11982502966997899"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-8":{"name":"webnative","version":"0.22.0-alpha-8","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"96ff4a3f0bf99aeca634e652279814df0f35c6d3","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-8","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-pGvkzWMzefl4rHuE83PXsc8TG/ST48/khjT/YyKHw0AbFye5ro4osuF9Q9/neZ0VR+claDl2RoFYizcQq/0gJg==","shasum":"b8eb3882d46ca07a1078657efc1b7724e1c10d21","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-8.tgz","fileCount":301,"unpackedSize":23069509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgURInCRA9TVsSAnZWagAA2BAP/0pyoam+zZS6eZEQs4w2\nZbmZsgFYmLz31DUDbJ7yZApIg9h6g6pYOhV4TATWV3vcoVglPdhRvIFIaCES\nJgrI5UoEA6BZC20dhBmHqvyPjMFXI2J3bYd34e8dRoXJXLKaLx3RbCUP7Nij\nrbcJ+HLBTspaRXd0Prnq0YQtc4vCsPbGfAmo3HTKDINKuOdebe3EBrbWNGBs\nWL0X+3Zxd75fjTBQSLybgi552PN8pj8WRZh1Ovyveqrpib4IkOThHkses0Fe\nvOWkzs6IHQscv5yqMhjJL2WnEWymMR7DaFLhW3B7+yNBBwQze4BZevvGi1TL\nuIPSB4F3RlwQyFQd4/QpQmNvaXlypBgGrDEKrmX3sY/LJX+92GCr+HeyCl+3\nM3bLNNrmlMbiNRUxFlSRraLMk4waF5Sxp/Z97p9zQLGPQXUSVEJ8PPlXYHRh\nI/2S2MF3TkCirv7IEhiyA3JzIEZi+n7AR3eYq12zyZPCSxXidSorbmB2Hh1C\nCHN+3pTVbkGgjjdk4qSyZl4r4oPY+W+jg5/vEqeQDIRWHryp3haoFuw3gxLF\npldryLLob7gV3iY6UGGLYX0fCVcjTfTiKLqNOWDWtKXlsmUUUPMstyCyakyD\n1i0hQ0iJKvTcinlOZTytS9cajJM5aH0ZVXu14fIJsj1+jypObgLUC8RLFqk/\neTJE\r\n=Xrjs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC37lbWofjuvzExW1UDl36QPxMN1oyLhTB7rdlYY35YzQIhAPcZ0rHCvc9dKpwkzfkSKHusDggEPJ2hqrQ59emtD5o+"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-8_1615925798367_0.3583087139641852"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-9":{"name":"webnative","version":"0.22.0-alpha-9","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"e12afacf16d207ed483e32e3a578d9c4cd9ad574","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-9","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-mytFgqfXRnnMC5dSrlFIVzFs4MMHEK7ScMuPbRrmoDtUgmXIFopneVVkeL+kr/LyozuqFl3u2cmqW7Qc/KbgSw==","shasum":"c372fecc74697685132ca5c6def96768eaded0a8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-9.tgz","fileCount":301,"unpackedSize":23071414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUgMBCRA9TVsSAnZWagAAto8QAJUyyAO2jEm9kg4VhSp8\nBkZhlgO0mk9ybfQh/H3bWsF2BoWUv7sMgl0afD+ai3aJqrdVjzeq/uQaR2mu\n12D/lBRSe5sS+BCFcZurcFtWqRoMZdnnU1+22Kg6TP7XGNNHmyxI3Sum9ZYc\ngCdBW8sWOL/vJ8gDID7WmkFxMvjZvbARiyiO7xwdM2W/1xV8USHQQHx2CDpx\nrrrQDaLJ1HvIAbPtycxgXn7NeXAoTfFKn/pGaUWgICd9t2gFanVjq0Kg6Qga\nyT1HqIlhPp6ex4+5nSbeVvc7yS6p1nxWNUNsTDoDPWkbNHgOsPZfLwf0LQmz\n1s+jxd4PDRp5+DFm07e/fLR2jIp5OSgm9QxZRmBhmcnGZXYSK9zYFHLwLCV6\n8qu/OqvyrPTwK+rD6yWXUJ34Ha5lxR2zk+i6GicVLzmf12ZWguJMtU6iEHUW\naaxS0mkO7iZdK0eUKHt79hsSFOrDgJKNG/Sc3DrKk6WgWVc8ZN+O5RUV5Hh3\nAAUS1G0Y5l3ScObIZQyjBYQmDdwqMy5IoCwwQjxOcJbjter9BeMgXN7+nn5k\nO7iHOCFUxzlLaghVAMuLwJyzsXInYv46Jy/+/wP9NKfYSCuxvvVvJ0jBXtGk\ndZ/Y222nbo4jNdNXxNvoqT6tmbJ/E3b1oIFf8QmFsPKZfRMLIsupzaPo3cfN\nDFan\r\n=T+2u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLVj5lBE1CIpZqatsUpIfqea+Rz7iYqshe7xmef6RP2AiB/SQdDum0dnkuyFsmzfguVUSVibCMAsUe3rshK5muUPw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-9_1615987456941_0.5616784766406928"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-10":{"name":"webnative","version":"0.22.0-alpha-10","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"3def410ecb943db89940ef5e553fe0f022545f97","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-10","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-9X91+cYSqFhHH/uWxJwfYvrycUq/JG4K3EsuzVru5V2E50yBR7x3ibxcBDKk1RoJY7JCBPOHy1YEUsXvQTacbg==","shasum":"7eb8dcaa8ac6532e7a3b7fecaa1a8641f179f4c4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-10.tgz","fileCount":301,"unpackedSize":23077184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUmQKCRA9TVsSAnZWagAAdc4P/iZXdwIMPNH3+Mk+VXHe\ncbjEpJ47O5h7mXSCmZ+D7xNPd+P31i/YmZIvAJctpnOYh9d4TtJahzjCFU2W\nJur3ha4DpZZf4P7CkqkDAiMDZ6A25Qv3Fxd39Iv14Gl6btXwt88tciV1BxZK\nIfGH1S0e/lI+PWcaOJ5qL+9qjioOjoAWeyiQKwJ40mhhTh07pGcaGVa8H0Qm\nYTRRcApC2EfI6MVIp+fawr6j/1hs4ahDnw0B6m7o1raWupeYvglNvGKTcrJl\n8HLzGg0YMsXR67dwYLuH/Nm+8g9jvQnSr+jn+49apgGxxr8UD6EQKN9BNVUy\nR4l+l43wyOyxMs5bUvO+P0ySqnTpfjRnO0QJAsJEP2Q8a5TGjOczKp3m8O1O\nFqt6k6ekeIpsc6oCkgmJCRXk/Y3iVtyKgtTfOkLjHb07CabYWJt5r0L53oLN\nxjH6BODFnQYrwPNLRSU1BhQ7IhBm4SpukcheRwfHe65Juui1z9it3AK5bB6H\nVwDTJGqxHpFJKKVZUnROXBE4WOn8EmAaLKLJYZOQ/5HatLvSQQaCPdhv7Dfi\nj6lUBofX9prbxtnmkewX9wrUkf7C01zi0iLW9x984FddAQFwwCuEyxUSXSNs\nB8MCVKnb3A6dzsOmV7lo/qFBdZha+8dAPnHS60i0Gb6ahrontIh1t7aq0UG3\no/ok\r\n=S+UL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDagLuF/5ZnfELbGv/J2NtZi+VIK9ClsFdRjb9sn38GuwIgT9bRozoO5YJAFz0pqw9bJYSKjiWMqitgCe2zO5Zkm/Q="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-10_1616012297534_0.8893259335246231"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-11":{"name":"webnative","version":"0.22.0-alpha-11","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"3def410ecb943db89940ef5e553fe0f022545f97","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-11","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-rzudsXMCBV9kKnCzESEt8IcF1YF+NK0GNnWHZBz189yP9fGG0UQd5qGqv6bNabuX05cF5zzjCNRLD/BpnssqbQ==","shasum":"0d8e6420686327dec8c3583b4a59036f09b9acc9","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-11.tgz","fileCount":301,"unpackedSize":23080508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU4fUCRA9TVsSAnZWagAAeGkQAIw+YXNmGKvnjFobjxRp\nUKgyqV8bmPyP3xqHBHtPsNgsjp3nX07Sfz+TbWlDFx5/e4AYYxmHN+Q//6w9\nWaHDXPvp/xmLqgur5hyyjzxG6153iGNjuSGdveAoKNZ+Aq4cMqrVsIQZ8Jy+\nt2rRY5yOObpDp2J5jpa4A0+58FADvgKBmJqZPJDsCDxcv6t9MuiRAmaljYLM\nxUXY3zcLjdX5BtDf5OD16ywtBOBL3OcRb4tHMk5gE+tyt6MUvD6grspSz+48\n1n9oVQyqMHizbQNAdHvM9C60hngsQeYxbEixOeJMh8Gp8FwCQl3NZRSXb7Vs\n2dyvXaVL4txyKRWVZBo48pC2dPXWbaIIEeiWnDberkyL5XgDe8uON9UrTpQs\nZaAV4P7mHQpidsg2ZbRdRteI6ARRG4hXI22DLlAu+EauETKJxwdRpG5675/U\nBDb6W7cw6yAaMYrhMeHJ6SXXe9DkDnOq4zxZEaHoRf4sS9voTP/o0lxkfZfY\nfrFN5oFkweFSEVEA1FSsRISZfaA1/b8xEeCUkJbj9oG4xSMMY/Xilzwj2BDb\n+PPvMAiZ/AxLtcirr4n/Gt+nPTvii75PfDZP0q6Qx32XjIfordIEkbvrdvjI\nID4QdZhe1DtZHN0U1z/R6FwmwbiCA3HHn1/62yklvm44yBqscNMwY0gEcGk9\nv3o6\r\n=2YTk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhlFJ4qODFcPjAOEEDC8/fbVnZQg+D8jt2omY/Obxh3AiASepfL0AJjmb01Q0RCWIElPO7F9SnydnVh/6LUek8vCg=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-11_1616086996012_0.994514806199946"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-12":{"name":"webnative","version":"0.22.0-alpha-12","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"738e627647c2155872e9ef6ee58096f1100d1b0c","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-12","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-1LrO+jGK/uGJKCktqOkZbeJfxxTEI7I4UxgoMV076ItbPgB1eAmZjQHkw3d4yrMOvoMP6WfJh78KyZUY9P0Fxw==","shasum":"dab33cb64f00c0105c0dd2fa8f447a670ee6a85e","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-12.tgz","fileCount":301,"unpackedSize":23080979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU7LdCRA9TVsSAnZWagAAO8sP/3phihlxJEZsgfmW80Tl\nwteXou+0tYv8Koxc5qVf0Pxsyq14E6Omqr0NlrPRd9HMsJctn1Jz1GNFrrz1\nMqJgT3e5QTsAYou2qTwPMhHMQnFJUElC+g/lvJJG96GyKec8/EW3G5j4aLuO\nHFm1qupMdsUHAAMfoSyuU8jCewYWw790EHzb4Tc7bYDRtLPI1Qt1kdRza/Cc\nDF7anW4Ms87lXeBfoZH6P3RN6YK9+vKGRuSpR5TKEQGHDfZffie7fCNPlc68\ngUtroe6qF8kS6fnbciC8Lfpk1jTIzdBDudO5q/ID0K68UMOHJvAraLDxnWX5\nMpfAeGmNbLnmPjoaetM5+6GYpL526Aw4oEwNIIdRVFHphvC+5TUQYJyDhXOB\n2qiuK4SNAGVBCrvIPoQEzNIsUtEGf1yomylm0TVyoC/YUfxu5iDDu5LQzU/r\nYLVPGJ12p+Mndo7aIejDBtvvGmbQSn44jGGNkeg6bJJbJ91isJ3S/kPvksAG\neg19eI2BwkW4lWk3p2vYC/YFTMYUY3DeVVTmzAwMDn41gPhcCHhpxgGBt+FV\nD/ImJafSRFCBRrZIxpGCX93rEs1o/5AiVYHAdB53ngQyjsStXCIwvE0lcbR3\nFxIinWHFIcP/VnQU2x9ubA38WP6UJA3znNZ5ESXCbCWFbeesaMCmFIDuMoLy\n0NmP\r\n=HeBy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMcodOKkRjucLT5z1/boB4jgQyXv3qtF6Oq0MwIdcPDwIgIJELJ72Wgrt/fYuic2YJTALHx2pnRVclCCJsajZqEwY="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-12_1616098012897_0.7821199405182631"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.22.0-alpha-13":{"name":"webnative","version":"0.22.0-alpha-13","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"12bafe51c30e8d59d79916da7f8615af08463b8d","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.22.0-alpha-13","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-vrjo98rSdvb2585XPXhsgsJs10zQ4ps9YCD9QeU3xryb8N/Nle1CmbZZUQc6t5kL+JIOKHQw+YxAc1dJ/4NOgA==","shasum":"fe14022f2fa9678a465fb4a70fbdf41ec509d1c6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.22.0-alpha-13.tgz","fileCount":301,"unpackedSize":23081615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWR6FCRA9TVsSAnZWagAAsJ8QAIQ1JRnic/utsDOg3AOb\nA+kG10nLR1sCAoe/V1MJZvO9s9bMNCx0V+Pc5gru1P7UNtlBwEFsGHsIzSV8\n8jktgxaxRA7IpW/mygsSrUmkNcFHZ9hgW8/qjksnLiril4nzTOhNsYgLUN4w\n3GSTjvrpXj4o2p9bGC3+gb6N4SnL3RNYOTfuIkUpfZAuzxq5X6pLJzhubGl/\nzuk7QxgKEnnY268WahNZQNzYXA1scHxBKWeNIHJ9rA/CFuzZg4mrhh5yIMum\nPh7/KfEf/sJwBzm3LGKBGdf+jcERjukHqqrUuW0M8LPWoEdduWgRKajx8Gv2\n9tEWbp5Ofc26D5ceb3xNT5OjVupo1LMeQ4EHEE5wi7JwiJdudZJvRD43sHh1\nv2AcACGdYIF73h1Z9lLQHneXfuoTjEnlSdW5iwbp/D77/hH/QvIyAdUZ4tH7\nBaOWXBbqQoRUaI1ysygArj26jpR/88CwTETsARWFkNIYXxTMUj/DUu71jZ9p\nk4lr5T81NC+gAJEFNfZKkvQQT7HiwXR2urMOQxbCFXXb5Lr9otVfACutqZ6b\ndvo+EBBwVfQMMqk++Udl3QbYv4vzaXmUd2s5KALJz9LI/JrRqSD2qb3acn03\nXk1VgO2RrKEbncaNx6Ot3uqd0j1eoAr8hIApsFed7seHU7yKjfZgjWhG1yvx\ndY0W\r\n=gLfz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVW2wwirKff5NDFxrhsbe8GhkB0yISc6fGg/kFrjzS7AiEA3rNnbLsyp4+EzPxSiemmLBZ8bP4KnkyK25U2HREw7Wo="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.22.0-alpha-13_1616453252924_0.6772818233530475"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.23.0-alpha-3":{"name":"webnative","version":"0.23.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"gitHead":"8bec07aae58aaf1b42e67ae0526e9d997a38737d","readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.23.0-alpha-3","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-l9aehZEO2E5PTw03FW19vE5Q7jPY9GrCPCVN7Ap5WuTpesWRAu7LcdjGpC2QgFayasaQ8Sk3CEVekVDHLafhEw==","shasum":"7379909d11e659032903ce98fff78a1ab520bb0c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.23.0-alpha-3.tgz","fileCount":304,"unpackedSize":23083584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWjVLCRA9TVsSAnZWagAAbRUP/0g/Ly9/F99vtIAPWJ9O\nXJqK8B6Go68gQ0SmvT5sWgIAWQV7/cYCFsbUWiuuKhN1pC4UeJwih5WjntmA\nJJpsZwHmdqkqiv8K7l5VJ0JQEpmu9IZ/5i2FuVcxM2iDsb39R+W6pQR6xVwS\nevuSk5Hw4vFj0CFQ/6Xce1AwbNxYDYO2jL0ov5FfzI/LZqqfYoIGpVQxBxKD\nX5pn6zOd6cXVnY/HLutgf8ebZnVVF2Fw59JI8jNkmXgU46cYNwftr44z4Cj0\n1Ty3MFaeIcCy1+osK29KAYwQ9sAc+M33UH1x2Knawjbt6C0Iich2HidahuCg\nvzhy/eRlOoBwmqtAbLDMuStRnT20wqQ2IW5D2cCNqFy0lE2QyWQbs6Z9HEKB\n4NujpcdLpyHR7ifl358G2a6GEX87Y7t5ct38OXGq8IG4RWv4HY+CBDnmTC3m\nQMkoOU+0f4rWlcFzoMpv3miaaZIbB22CwOfDaKD4QJwTYxcumGcr/DhUg9sU\nanE9EPaVxDqYQy/MY5ReYXSIIDVlkgFKoJ5DSB4Db2fl7nQ3kg3+EAkU6XCy\nI6z5IEqKgv2I5Xs7IYWtbQHEITt+CkChf+2gU1oS5Z+lkJo4UpIpWWPdSqYP\ndzczRVVo5T8vjOQB2JdkjorHvoGmLhLwtPalttarc1qHVoDRANtduiEJ/5uC\nNp1S\r\n=a0KY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2/vRMBI8a84yGg5jNZ+kVKKdsmiJ0suXPp8U7ofNwMAiEAm+N2T/oHwkSI2AMt3OdYy++aj2TdW4ZTnRkV09HDSq4="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.23.0-alpha-3_1616524618613_0.36418551234960295"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.23.0":{"name":"webnative","version":"0.23.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"gitHead":"47cfabfb402d27e7a20ce722571300e17e3e3d38","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.23.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-sQkqUcs4sEyWpypIpIt/5TXnarvK0ma9crwlto7Ln+e6DZtX16G5wlA6n5GVJQaLx2SHDeGvCWpgjVW6VT+EcQ==","shasum":"5a8049dd439f75376477dd8c9493512c21ce6ac0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.23.0.tgz","fileCount":304,"unpackedSize":23105907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXLenCRA9TVsSAnZWagAAaIEP/3wGwt5mMzqeoHc1mm/P\n2wPSGirx0cb4p7+T3o0ZiBNRT/5vnQsjCSjmtFe3tF/I28ojVzLYmoiOFnj0\nuFrxwGrukHVymrZKXBAt5IRVZ83cmZK9th0ewSvivic09tpJ2uqXPhHs3ycL\nsJVL6R66gDO+5uaFE2WsCFMJga8SFh5W1SnicjAJaKjuwUGu4puKJKll99Dn\ni8wHTAuFObU1CzL12a4ErbOOOrGpJREIvkksGsAhZvWYumr9onsLxx0CQGQ9\nzDOiSu/+NtkqT7Th5Axip5Qvc19nkeQwL71ZGsqy7Gw8dhk729ANeYE3cdQ/\nhhrj4WsM8dJLTPXGj3a1lsucYwuO+0CXYSiy9i/AkWruUMmRKobgLqs/tMot\ndu8DixL7mjjN2loUpq5f82xHaoHdmOuax4q1YEEkkfq6eel2c/YqCOVvOCgZ\nytIsmFwXES9vJr6NgWAV1vG8/uWPSpVkya3Prrl6sJMbgziaaK8L90UMWNoG\nFG8tXs6ah40RP7ntMeaUub48gRWEtbWVnoNp25pRuDErlHTXOBZ/DaTGBmdX\nYbX6WExZX0aFyTn1ik5aDYLp4uCkeZdE1HZCRs22JDLi8Qe3pOAzyH6Pp8NV\ntqww6VKuHi5YUupKz2wCr/aDxrIEbvk+ghlDqu7IQpfG+pByvWaB/pLCBNH5\n5dbi\r\n=SWmF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFT68kGHmSgTF8ZTrHb+9jkUpqr141xJVbDNirFb18u7AiBpsuxw3QZIhBZ/TRb2IRFvNH5L00SfE+ykR0kr8ASFcA=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.23.0_1616689062777_0.5056363886350028"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.23.1":{"name":"webnative","version":"0.23.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"gitHead":"b7944baece99a9996c7adc1ddcfc7f163febe850","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.23.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-ODl8J3i/szVr9JZne6TbzuEPZvlp4ufsw9PQ52J/l4Ouzf921MqQsD493QS6DL+XvSxMJ9do6ncUhZELjyBLgg==","shasum":"c0ff64c0ce37828380e24aa45a933e23a7e650fb","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.23.1.tgz","fileCount":304,"unpackedSize":23106127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXf6OCRA9TVsSAnZWagAArd4P/0QFVsorheRa787DpN5n\nFCPGgIFZ79SJVNCl1r3dCKOqmCW5bxdJ1uHHKlkxhIK3EYA9VAU49CVsfng6\nhRgQ7ynJCebkbk/aO9Q0orHdYmUaXiwziOofbaoa+4l43c5b9Si4LXEDjhME\nCHgab6tPzykmCcMckZPfcP6VvsEV3NIQet4GiPBbsdbYGiZj2yCVeZ0phgGT\nuqf/h9g6aEt7vFGIYoCpAVWMw2NeEpRKwHQQ8xTxcLi0QcA9Fa6xNTwAPI+n\n1qoPpdB3rLHoZla6WpLQ7Z193w1RQEQLVfa7pqNucIdUwzPzGjqjxjhOKGC/\nbJlikdvvmND38HnufXHik2Xh5eu3pnYPDTINszAAdETDtK5LdQQFJVT3YmwD\n7tkrJUBAOqC8hIwhrr3snO9HAlAJhjrN/0acR1HEf+tB0ugMGj9zH64gkOGg\nc6K8KgXuj8Tsm3FAuQJLJ/arNYdHyzVo22mkrLUDuspGQ5c2lUkJpeZtMhSQ\nncdRJ69z1WvjQ00mv4cEQ4Uxb6Oz55SijBwlZwVq6tj9S4Ot+w+ZxC7GO72b\nJ4ZTxzr3L+nu3XlHOcKqjn6B0IWYQMuHyskSJ/1vKeqUKBEz7pL+KWyF62rF\n3p2WkmnkMZmlpyaNCn32EowNocVIfzaVs577RaF5wucwGhQApmntQHn3ubjn\nNjeP\r\n=KfdI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMLpoT49lVi26A8ORzVIiV8F0A0hoEOlLEVbnP7+Bh3AiEAl9L2HwpQ9/Tlb8S6k2icH1JJLr1Pb7rzvgQ0UirKikE="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.23.1_1616772750129_0.6335459092163553"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.23.2":{"name":"webnative","version":"0.23.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"gitHead":"9d72b97a347332b81c5a283c6d784acab068da98","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.23.2","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-PHd0p41C7AWGpcf95oDLA41qG2nO4zythePT+C3ymQh2j0gsVN6HsQme0puPjK9g/PYAZaaoeC538T33yvDTWQ==","shasum":"305bc5d64d4257d4bcbe48525190324af76cc4b0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.23.2.tgz","fileCount":304,"unpackedSize":23108162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXgaYCRA9TVsSAnZWagAAT4kP+QBHpewEHoTEQtKexde4\nt8e2R6MNj1fSjQECbcMwBDBeXSeaIxwTrzDj1yrq2HRuvGTV4O9I0bAer565\nG9spsVjpQ68tlNrxCjFooCwpi76FVaVBohxpEaNaYx/RqNtqtnXnDpoS398z\nSq5ogla+0w/4E+AWd88/l58tM+wxKw84dljZeoMAS4o86YYYctLRqYTYLUdJ\nT7d7+8Gq+ST/1f4k4xuiAA12VMgyHso9jrQUslj6j5gwXSW694os566k/vZF\nEGVpRdWmmyO+aQw+tIU3K+ficIK+soYW4I2qRJ/qeLJtrNWrLeTSALfciezQ\n+rCPXNJt+HeYyaq+YQmd0h0wT0ugTicypOGcF23M5D1NUfEoA9SYSDu4Z4C1\nO5VmMdOrBqhmxMo92dQCPNXBraeiLnDszQs12Q2mURIzRGzQOSFQUCdYve8c\npza7GKQcXMbs8M0R7cPICVT7On3vXXGcHofzCJgMpLoQoOXP+Hmoz6eOfrTt\n3SUwwNCroslH+FUSF+WoB6WuAQMZKG6XpZ/gPvHD1F2yKp+cqdvspEwKVg0O\n7jeX6viF62fyQP80Uevn59s4TTkJCcOm3rpEWyH5OX0j1rrTxYesJOMzePhk\nzb5aeBZC1rpraLNZVAHvQw6NHGB3Q3rhQ+24KzrGYHDiLtwwQaSRBsHcDFPZ\nuAOK\r\n=FOQn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTAmEdcK2Fr0yLv3z8N/Qjq5bFrujWkal8Tf9mJXgZOAIgAQnbEOOugkAtmwq7nZnF5fI+9Rl/1ferpGS9CcSZIJc="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.23.2_1616774807534_0.9720358233167317"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha":{"name":"webnative","version":"0.24.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","typings":"types/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission for additional filesystem paths\n    fs: {\n      privatePaths: [ \"Music\" ],\n      publicPaths: [ \"Mixtapes\" ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"94d779b727d1d436b0d8622ae0dff86612c44e8a","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-bqdhztLnvGj6P2IGtgWoKxgeLIP9Tn/OFD4bzVb4WZhoeXBCn4XVLrClOfONzrsnTEgVX1jzfjZpHgfejclmpg==","shasum":"f83be25f7db431b2d882f72aca92c2ded6bea726","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha.tgz","fileCount":307,"unpackedSize":23387989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeFwwCRA9TVsSAnZWagAAMl4P/jsgKGFGv50wmrdkbODn\nr/U693OMibuGKt4APt0G4w2trEcYm9U6hec9N6hmA6FL5M212SJrhkoob824\n3he9pmhAFU66oXzVWvb1pFPj1UjlC7k+skBSWuT87luZaUSljTHtssqHIonQ\nhKETYWZFxWR/WA8sOg/1FuM40ABbCIQ1ScJpXfLIrG5PMtdciwYF9Ra7+/Zw\nLi+PGTRKV2a9VCKMdeR36IKGYIZ88PESBUOZik2izU2xcycp3YKSViwixk+W\nISbOWeyed0XYzZsxJD1v0vaj64Kb6HO1OCMskjA8JJHag02BzT7Da+XXFnYz\nd+8Weijy7Ddi2LG0LshmqPjFTUeoznlIg65rgXTTuszJw6KXqf5HpIGZiKjD\nr4BN6UY9iK2B+RttNtUWXogE1+AJv9Hkfv5VRdm6lVaoWF/Cz3grzdfW77gv\nnr63jYHEPEl4Wl6BfYY2p/IIrAAUPVlhNc1quOVJnhyOMWna+PHP3/NOdlwi\nzc24d9VBQOTMi6suTcBcLKRHy/mxh/H5H5i/OqOVlsFYki/Bs4+VRjLDcLte\n7cZRcyHa+xoaIH+6Vi7jq+UlsU809b4bB2oMS1spOZNjNEeDakGxODsVOGpQ\njG3Dqvpcx2z7zhfqY82j4Wyu/ONj3UvF2Ir8AMDWBFSzlSfyABTGzcD349FA\nQJPf\r\n=+1y9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf7/E5gdtPXkOESVgyK9YntttFPg5Ao61N8sQ3CRRAHwIhANBn9gaJH6+lXwa+WoYca7ADX+HvvF5+baIJ9WxNmLIq"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha_1618500655989_0.25887864316228293"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-2":{"name":"webnative","version":"0.24.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"9d7c2b1bf93d6030edae67fe62c0f917a911ab74","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-2","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-W84bzoHcTPNeLbcTZRERGd1R8bSmv+aElAh4V0FAN5uSO4PE6Nu3tReUe8hNZBtutqFRmkgHqH50sAz4AQKs9w==","shasum":"0e100d667fa8602dc615296ec63ad34b895babed","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-2.tgz","fileCount":307,"unpackedSize":23401822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfZ73CRA9TVsSAnZWagAA63UQAKQE5RpeS8jYytdE6dcR\ng3O/8dkICB9/XA07Fw/3k8XGZ9X5s8Nu+SBCWsELttabIAnOAs13y054X45H\nshsRtdhVYT8pk/ctvsTae9zUfH6y6iV9FtX30/iW4G/a5IHngEl8zJE/c3Kc\nBJrfrx5J7+mSrUkv8NGxllB4LWSIj/HbA4SAYdCsKVuJ1UK9y4MGsmhRW3lU\nlSmLZxqrCPCkLNhQL8QW23zhOGVhqMBtVHJ9uaxs9FiYkQG/X8DKCm1uGX/4\nQMZTlNPX7XJYCulEZ+t0teuIOsRUSohP025/nCqgXzFzKoxIIALjX9vNyUzv\n8maHthX8pL/d5gRwgLSKPd6ljMX27EMlsnxhXaBtBhV06hYD8RtCkFtZjVr6\nmeVO/SvLF6/3UVmxMcvNQzPBmKXtY0Xq6poilCCBh7vEgyFZszefDsspiuQr\nRb0hrFePIhgMr2KHxplldQgJwVDfS8Gz95votAtvdROBTTVdna6vgDfpYO8u\niDM3O2NqZjcuAxCUxCWQFLDddEQvmAJlmPykd9hDyhsmZ/pPImvi5OauM8LC\nAcWQ8lV2Z4GoWY8nhiIfGxR/0uAZgp+mP25oylgFkvaepM0BlRQOzqHf31Mj\nMJJW3R/X05YvgH7eRTUrZiPMEPcKEuPhrQzsYQpK5wFpKl4781aT656eVY/q\nZZBV\r\n=fe0+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJWeztOtAQL2BOeMXahTKK+CuOlaXLMXPjI3HmkidG+AiEAnXv3/wUEBj+o3HL1KbsbYvxdAMIZ6pA7XppPcAdoed8="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-2_1618845430555_0.1710978220398589"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-3":{"name":"webnative","version":"0.24.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f6256c59b0062f36fffe6c89003991f7dff53ec8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-3","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-jrj5kHY2/w/WMMm/HObogO87LMcHUoNlXSnUKZa5IvxKsXriR8DB5GNMTEhIU9BtnW0YoHZqKByEOMWDVUxBOQ==","shasum":"7a0313294de9b6b145ef8dc04f03b015a6930cb5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-3.tgz","fileCount":307,"unpackedSize":23401834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfaGgCRA9TVsSAnZWagAAXwYP/jlk689liI29v7/vCV7+\nAuHefamc749yJhVoLwbNFuGLv95nbRIfHW495zJ5WwLAdXRV/9j0IMxc367S\n1b8oie3hUUJ8RYtBvJ1D9rbqu3UGav4dsUt+YuiSiQqDHYKF5yczgmV/7fHd\nYjrDbbKvLmoaruML8e8SD/JqAfnXVEJT/kHGMM+YDSlhXSBDZkUrwialGISG\nXvO5IvbZHQ52zMHuJMS5INCOeq1uwHZrsDPudUiXuwH+3hmDnZMyySOfPxYy\npO4xz+laRD0nEuQyhEqxtZRKFr+e5nIVvgElLcuS3d8tXpY268ZfZ1bmLm4B\n7gc7ciDg0Mys1LhWRHvU7PmmsRQdZS7ud3dS15LW2q9vIHXlm8iSIfOyX8mm\n7Nk19UE+BARRXX0HOp6RnytDbJA0lQ709Dc3M/uyzPfbBkXCXFNq4JYy7+OG\nYetE8dl/aZcJxKxATKbfZgoRJElLvAjjBaiWKjjniS+sM4C89WCXTe0lNpRc\nhPZ3zSv4SC2fgc2sWQOhvIZ6MX5FELxhaV4SDLNJ7knzLeLsr7gCf6Py+yNF\ngjHswz4HM4dpmD9o0m5K9YFEB6OFmUtxsqfEDDFX1pIRDBW3Kx7m7S/EafIE\nvAzL7EZ4kiVcX1jNLGqflcDqvdq0kF8XH5EC9Rnrz/lCM4pcbU7kT9UN8QBr\n0XZ8\r\n=VCVU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvqxedpQzuk8GZakfCh5JFEBPGAivLeFEAgODEJIVIRwIgWw3ZvZSjwRQe87dPwebzMmzYu+eTfA/N1bgPtC0MTwI="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-3_1618846112382_0.9260602058911536"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-4":{"name":"webnative","version":"0.24.0-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"0fde6025f2f7f253643fa27b379edf70a1182e83","readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-4","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-NqfTJgOzc4LAZbKQ+nnRJBMihRhHERF4AuD6tYsBAhThK1WRk69suOpD9S6pwlGfZl5rH4atnB2QYZr5YQ1J0A==","shasum":"7d092a583e09163e9e1bb6dca48c1e20bbf7e6e7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-4.tgz","fileCount":307,"unpackedSize":23406540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfc8yCRA9TVsSAnZWagAAzqAP/39M+BQIAudhYABG98qJ\n/fi4xPwEwKvMHW2dr5Dhf8PH/046UiPwECTwUmNq8/kpzzy7UN/akNdJ40kc\n5pMloIX0+PvVmPwAdmFeC+fiGr+YeItKrcY3QZjD+sjNvXgpbGJfdMEpRNok\ndGA4ehTkAX0nBk5bwjzkQwX6a94MRuh5JeEIdqJisbY5W0IPyEKDupF8rIrz\nW2NEmVCBX0XCEdap3zjgsFL3c/zLgptx+yLq9zWvNMAjA6h0C5ux0q6x64s3\n4LyV5m2Q/fR0iBN4nGJBFCRHUiRRMZP4/LSVG0pLtZOscQgrqD9+o8MgZYOm\n6h3Mtszqxp9dPvvu1b6eOjyIADrzGUKTUPn1sIQ0liADE6AJmumWluS9B3cU\nw5/PjrdEZ4eDVPSteycesL5b+DfCCTwcIovQ7z/d/CBjlHeaSFdBDekMokYQ\nSoPCsStmL3Li5HytLpbiv3hCPitqoi9ltb8Rl9OrbozAgXJR22GJg75Z+JhD\nJf5GSUIAa2ZITU+CMVxov8NsKetDHv/Mz+z6HLcK5Y67K0+61LF1VYkaTFq3\n+o3IccnG2Ku8ZlAJCB5rQ7+laknI/jHT8cot2DMMtVpnwKfXSb197pRXNDAN\nRh1B4xv/VUcq4banCL/wewPfZ1ABxddqKLrIwXHIvnrh4bGXSpsv7kAZW/LR\nSE0M\r\n=zxdw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWgdk2CvDSGm79hpJt46s1HXKGF3ijByEtA7+6NEcfEAiBp6bSgtYejZevKh7hWc2l/BQLnFWXyglWa5axn8A8aBQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-4_1618857777478_0.7284698525792481"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-5":{"name":"webnative","version":"0.24.0-alpha-5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"0fde6025f2f7f253643fa27b379edf70a1182e83","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-5","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-6sKdowUEsjieXRZovDXpRza10Mq5bbIlP/PUiV2v+P1X0Tb2aBG47AtowPeh+zWN1lvLJO1svJoMgEBcE5vvHA==","shasum":"144d9f392c6e86f047a14653094934c57cf5648f","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-5.tgz","fileCount":307,"unpackedSize":23407927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfecnCRA9TVsSAnZWagAAlPIP/j4PT9pfKRBjeXvhjQDF\n3o6BQY5ZQ+XpfInlLtib1VeRqOSoDb1tXubgftsjKBig//aec4u6hO0en56b\nwlM4Ix+iIaQALnApEfXTBY3SGdcpgvtl7dHiLSpHwMySoZmKNxlCli0QkSTF\nZn8C/MkG5x/l3V/rZSKSScIu9D+Rp98WGJljqSx8AqbuWNqumPdpHV7az8j6\nnR5jW1SMUBo81AodvNiLB8AMDG1CQLsS7+zAOe4NKojiKeuuFl5jezNEJM2P\n64HwzQvw9WqYZPY7Pt8zbpKjL+AO4/zFd8v076g1/+R1PVJ4JYDpQsypMiMo\nEj/YfYV21u2pnpt7VkrCwWY+3UBkt1kbEZTTABM6U2K34yWd2x6qkdO8O/zr\n4sgWgC5uD+g5NpaXojIjEubstlmwsUah4BuFHwrfeyQPl2MwookOQNKFsF1u\ngPdcjC3eDCNRHrTe+b9AZ1eC2djoIUzNG9CdLv+1coiWEMv3nqkb9+V505tP\nIYqG6bj66fnaqBgkYeFn0K/7AbawU35Yj95ZFY8lfMyhPZGjnKxQAHRfHbB8\nxHFP7Dr10T+CZ9N9Df/uvQSN9SISiXYtFpAaS4lgNy7Sp9qhPCEyW+wHRtZJ\n7zdeE64hUHGKf4EM00lijzykDyCtEMPvuE6oru1YBfJc7L/tRhS/y16tPFhi\nmUWp\r\n=9MCE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmwmLx5sYAV3vNXpXl/plDtyUv7J/K2Cs8qMJ6kIwMXAiBhgpyGs1R9DzUVW8P1jXV4nlaeqkuuMOfDFsAQE0k9cg=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-5_1618863910709_0.2361443814919637"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-6":{"name":"webnative","version":"0.24.0-alpha-6","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"9cb7a5eb9b36bb9d58081fd80af7d8072d18d35c","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-6","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-+lQlIGm8l53RXAOdEEBopYSjXLBMgDBDeTvZDPaYbaPMOiY0IpcHu4/FKC4ZvRqyYPuDAWE0+OWqWRivkNMKTQ==","shasum":"dccb1d73fe30fd053e25dd8f6ad52fd368eaded0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-6.tgz","fileCount":307,"unpackedSize":23408014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfykHCRA9TVsSAnZWagAA08oP/0weAIXpfe7o5aP7GHEx\nVSO679apdXuMtv8CT7pxM+yO4Vy0J+JdQL0teV1EYNPc2P8ZGZffZFe3eIDQ\nmwh/JXKDlYYcdLdUu6NrvaQnaPikpnIt7UvsKoPv+5hg8Yr1F7oS8m36rouB\nnbDrTvLAt1upzwm3elJMo2r/CG/4DHCMEdGLTOB4aUIY6ujbfx5BLQfV9uGU\nORjjSumX+33IKyFhKtybCD0zVH/Ur2LGk/9ehfXN0PXSXRWfqZDifpWGAbxp\nIyjpJxYWcXrIbIhzt8VplcRPBUKSJmdePqNL8rxawSx2lcQWbS/QknkuS19A\nHfI0j2Im6oKac7AJIsEHav1LxZrcqVx/zNAWyDRt/lm5w04OWMUaxxaRm9Sx\nj9ZdPlWfxJzYcwTMJ5HlQ+B0Onq+Dfgzn7jl4QnQZQkLHQKmY/DJ0RytZ7Kr\nmbGx9jSRZcfskCqYFHN2H0j7vzddj8XYp8qeyC2qbFvGcbGwifCVF3ECuPRp\nl00HFyZZBp50ALRl+SgYbzCBf+vgPzihxvfG9b/nGugzvqPsvoHcaDtV7Zv9\nDv/W6+VgYuFFa2pShUe/VG6BAv//koqAPNxzC7Pm6CCwpXfesOv1IEbPTIG5\n5KvFIbW1l8yC+1purOBoQpYqVPygA12sfutgbC0oP2rN4MEYLJwK/xQW69nN\nwzO4\r\n=5wSa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN/t5ZTgdqbTCtODmDYuGrvuG0u/hPdwOvxgw53Zkx/wIgN6pAWcP+oKepifHnjJhl7RdLFUBYsvJw3yls35PPMR4="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-6_1618946310464_0.5343338004459257"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-7":{"name":"webnative","version":"0.24.0-alpha-7","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"716f591cc0e037c67ba58ddc8f35429a66cd4243","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-7","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-T1DazxbVOrxrckZEFrZflpAygvzdH/Xoj8saOltZM2m8/DzfFvtThcOzvJo1NeWbHp6h3fhmUiIwQ02Nc9kssg==","shasum":"0f45202f93f85e6ccbeac547ef0e6d7413b0bd54","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-7.tgz","fileCount":307,"unpackedSize":23407735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggDeECRA9TVsSAnZWagAAN2AP/3ujQxvPrKI4s37CJl97\n/9zEQD/xZ/CUrEwx5DqtCNZbctu+yp+nedzlHgU761mEKSzcG386EoFSc0yR\n4GfytHobK0cMk9k1YmxWWavjr8JK8OdZC5cO1ZRBCnvPx6a3dduTiH9qlv2r\n077mJ5k/3gurVH3FuDPH7lLXIaVXef2mYh1+Gv+XQUNxrfwmui+lk6ijCPXX\n9uiRjy9tUHYyItpefuFUgm899GjxgNnXAVcK8iwdcYYIi0k536GJ/hZEqniX\n5dbFAdfICFtcZbJZ6b58X/+kyqzR/lHEVMTGVOdUq91n/bqzgEYmBgGIhRSg\nq8t8GqAzdFdi/PwFoTlSThaYQCFc0DrEvXPittC11v8g0TusMH+Cn7ccqyWH\nTkbYjlZu4x/MNCXbCkW/9HcZB9PiJe9sko3DexymGTPo56ra/Co7b0UjBEQ5\ndIpn5KFCanUTSlR6BNWVFvtT5XjTpQld5YvNd5XZLmRcunZ5YbRTp8SCJFYT\ndjHLtqI37O0g8bXti3a44vFO6UeK/WmUec1DRqgv5d/iZ5Rscin33PteHVJd\novcJ4JYugmEy+lC98F8qmhzC3rGRrPp/8zCpiJzCsr7/z9PPQVBoAOokIxKl\n+6ABiqMNKBbK8qL2hlvyBpmqtDPTdjdnoX5a/bDzxQPEYXxqOOhNQsEjAe4D\n6S3h\r\n=GPLA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOqYEwJXhuWgABn57Hchzd3gMlg6XixGpzIXdjNMwPuQIgVpt+eN4DLJT9A4a+ePqw82c/bq38Knw7+6Kw/jlrisc="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-7_1619015556255_0.2284927623261379"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-8":{"name":"webnative","version":"0.24.0-alpha-8","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"a143edba2397a382033bb1d5cf749eb53b3c9e0e","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-8","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-b+mQfCBZCQGVeC/4U0VT5A5DJ3Num21L322icjlra5U0s6/csx0Wu4Z8yNs83JaZSCtS3nTI86InwGc0AcOERg==","shasum":"967d6b355b9ca08fa9b02b667f70c354299d5c16","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-8.tgz","fileCount":307,"unpackedSize":23407161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggFABCRA9TVsSAnZWagAAVBwP/1NO8kuDFtKpC7edOQAB\niVyjEs6f5cdTHVzSKjvlf4j+sIqDKMR2mNFO5b+jbBgcTaNwNdb25ReK51FB\nIEQXCZlbSIfpVMQHGOwBK5v7X+G483npmronF5wsZcltX/u0rRNwzEEkT/G0\nu0esjhpbeksGEvIqt4lRa4ZZGKMBfogCiF3xnBDvePW+aOf0Xvilf+M+2tRs\nU8iPQ14h3QGeRm7arByp77IWI9JnTTL2DrEOCHSCe6hiEFcmf90tiKSlzbpC\numm/F/VWJXQHsc13cra3viQDbgXyO/uxFQK3TJ+0lZG7RE8AqLbcrMntvnXP\nLfFZM9YaGqUoFPvaxf1Lpj5SfNYT/dezGEOod6SoLEiVhdvRHQiKd7Yx7i/s\no6RJ5Xe6DWEdiy1KgcaOCVUbuDLD9O+u+OK2XiHveAJTibybSHMW6fu8Z8V6\n92/3R7OVVQaUe68sxzAYxQ7kDmlRhF3+lmQnakwhgjp/282ND2bwh6PCScMA\n1hp6PveJPvVJP+Ia8hCVtFfoJ4QTQ4KC7VzzcMKfKNd05lgEaHUw+l3qjacb\nZHRNoDoL+xth6k/ZQ7dBwCQTA7QwhhP1tLv/fW0h6eRPcdVTEyok22S6HoPf\nrRipRfbsLgjqCF0uuKCK2tBP/u0CE4LFzZrwGI576tQCvrSXfe2AKccJhkf6\nuaYc\r\n=V8QP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlZh4fo7XzfuPRSfULxKrqF6/aIbVKbhwJfJsM5mTyiAIhAMB7+da45qfP9wi3GDVEsJJbCjYSxMxvX14j3tjkvJdo"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-8_1619021824608_0.4152181902933858"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.1-alpha":{"name":"webnative","version":"0.24.1-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: { directories: [ \"Audio/Music\" ], files: [] },\n      public: { directories: [ \"Audio/Mixtapes\" ], files: [] }\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.mkdir(fs.appPath([ \"Sub Directory\" ]))\nawait fs.write(fs.appPath([ \"Sub Directory\", \"hello.txt\" ]), \"👋\")\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"74aed0d1612e3cf22b463e685acf73d5b8627a60","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.1-alpha","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-hF+h57LboDAMuOTTc/ekew+CvTrSwIYXDFcdy+Show+Jat1215pqNU6HIx6u2Rymv4/1wio1bADWCRa8Q34xIw==","shasum":"4ac24946be262b2732ded3b46ed6753650697445","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.1-alpha.tgz","fileCount":320,"unpackedSize":24863354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgga3UCRA9TVsSAnZWagAAdNgP/jQKsas4+G/rLuDnza51\nM0O/WMMjBatCR4bbreQQkew1AWwCSWU1+yJMMRHugfuz6zMW7NtDSlNJCxeM\nY+OQrs2/rheDavOZXbxVt1hvJEyijr7gWRNyMJ2q9Co5fLITaGPs9lS1cXvt\nCiJAzgHc/lppD1aSu72lKwB114uCrjQtV6TlD1kZ5nB/oVkIm/hUUhG+MKvi\ndmGLqLeiTWMQhgMcEr7/Tl9mnFUEz2rTiIfjlu0B27iirpKTq4bTgjVPkdEE\n+5tjHOfxg7e/cviQiofiOIpWA7PGTzBUmuactDdUbAfonsP0X0qf/K+RWCN4\npsteJLIzZKuxpP+OseztSHRwcGKN09c/1qH7vntCjM5CY6YWjRrvop5ximoP\nv8zKnquFL5/a3gCheMVsXq+vYyeT5DHld5KZ463YsQzGTCTDrUqDXkptXiWT\noehKBfBknsQ6B+8C4kKuGUHfBA5NrU5pzMURX/n8Kg2Z2jupA7301Nqv4lIq\n/CFqxCoR90OP3cwowdD37ijWjw39rG7a0HjsCW62O/OFeVKcUU7OT4GxwuBJ\n4+l2iah8KCHVjJLNsTQkQ9jUnkZZdmpo7PWUt3y5BXifETUHOj5JSqfAkQDr\n2AyURhM5cb94VpdXHGEP0ulaMoj+r3gWyv+q0MHXMxLHcztfh7FNA9xMPRr6\namtc\r\n=hQUP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAy1XHUcZPU3g4+HTg4Hs54MJXhdHMeLw+ZFMnoUkdgyAiEAtHmn6o+oZH1dk5ScVE+QNCVBOpzsovlCCTs8lZIsS4g="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.1-alpha_1619111379604_0.9054904182266552"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-9":{"name":"webnative","version":"0.24.0-alpha-9","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f05bf77fc7a536cdadcd8ed163c70d3f1a5c085e","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-9","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-OG74dYx2MoXevf4CtfUtTG3Z5urHeZ4TjjZNB5NxhPdk9ihHktyDVrZZwftBNAS1U65kSPM/18xuxxBn0Wlsiw==","shasum":"7717be2b60073fbe307ec663cd62afd68d555bda","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-9.tgz","fileCount":309,"unpackedSize":23542250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiB6+CRA9TVsSAnZWagAAqGgP/i/rzK1MKiuHfu38pTv8\nZT8HN9NTo6vlmtDORni7sAXywmFdtzN1ZKt1mnMFaWVVcJ/UM3ZMHpV5x+ZS\ndI7zPtAvH2uujQrtReFd0ja89LVwyxE1xTK9nzTzMzLH9qASO6KlyQ/3oWLm\nicplHvs4sd61M+j0LxpuH3RkW6Cz/8lwNjKoLywDr1Pz8+oCZxLfi7VLjUoQ\n5fLQGjiFGoWpTn0oSyBWso4y4UITpQ2dzaQXubP0uH4oCbVv31m7UBP7QQp3\n2cNbTavUF1sdTj/m2zJ80dDTkgNGKgCl28YTdE0zANYT0QSM9k/RSQ9jHV3f\nLV8+thKSeee7Tx4srSug41vnRo0x6A38RvQElH5dAmROxmBYdKIa7JXWOALy\nm8INv9W7wf2xbUR8PvPzsCZe+sTSa7drgCSKnhfMwL4Ye4QDr4ekiu1pC22H\n0Xp9q21+eVbjjDt0BOnD4yE6X1FUT68bNwbYuwhDy2A+lyeNJlSbWJsXmgjj\nn0BSzEwmhnIb3hMwbf+QzvF1Ych3+ChyR2Uxj2aEkMx96sEOdNmES+wp4len\nZQrXb30nv6NvZkctoVY7iYA7Mxpswrak+TsMFRCCQ0Ruke030cMfiNVKmCbC\nXT4aVVeUBSNQuRwT1b5lCUvhd7zau8DS0vfKTtXQLMBZ6+EQSpMpQ9MImKXW\nVgBf\r\n=jYAC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDta0CjB6tOi2LzqkqihwquyQVpMFc9e+SjHYtFGl3MOgIgd73Gin77pkN6sYft+Oi0YU5GcQZVLnYc1+tQn50IuHU="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-9_1619533501906_0.7626791665683705"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-10":{"name":"webnative","version":"0.24.0-alpha-10","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f0f21c31eda927b0feee3785fca29dfd9a36cddc","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-10","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-QnJk7+b6f+tWKxXLMjAvSrwSSyPYHdit1CapChM9oOsd9nuEJo/73wpigLToV/1qfqn0WkmjdHgwo28Tz1E+Cw==","shasum":"d3e8fd2fa45dece38506a008995705effd55bc85","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-10.tgz","fileCount":309,"unpackedSize":23549825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiGEKCRA9TVsSAnZWagAAUE0P/3MHAjIEGYm+EHxw1fN5\nkBSBJmtaHx1oAUfpKZxlBbYeQQyo/k5hD4alMzQxbJ/8dKMMYaiQHuRs19BH\no1rtV0z19EmyEnc26P0XypALgyCLilRAxIPlhX0aZGYGExUphdQtThAbtCq8\njNGQ9RLMt4G1In+i7TyI08bjAKHXTnRHplXRP8f7Qf9iEJiY/ZoovfeGwZ62\nPsQe5zVyXY4G/xMJTi3RMnExJzUH63e0cduzfcfvxny27rc8w1k55jV7Xuai\nS6j5/8FOXOSpwpEV/1Kj/l1A/OfGcThdsSVrD8dMA8UBFEqv8Dysp/6fdJu3\nXZL3f8fsnA77q5y5AreYRXIPo3oRolkcb3IdXl0FfjnL7bCIHuVyMJNBw5lk\ndJh3epD/jXWt3V8a9YEjtBNgix8tbkI4beW9fPwoU4XhOOnrn/j6NUCPACEK\ntjKnd5+3YPqC5YtrkqH0JO5nWkwFgpAAtYFB+ldXk75D/Gi+8mLlOdnrM4HQ\neJa/7t6JqdmyG+vCwsJzkPTpYvcsBV9neTTeiRQe0XwY5umgXC3SAev+4MUG\nXCzWFoCroxdmme7gdk6ODXKATXNJ4EPJeTctZ75OTIWw95iHPEn55KxOFS+y\n7KZhunfQ7/xs4gDh9g8KOuSGV3VbRoAkMVqb7HkJWooF6hovoDciB1WWFFBx\nFNOi\r\n=XtYh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjajo8KkByFg3FgQtyvNTw4cN7ADi1DYsfskcV29ugMAiAl450PbLYmaJbb+XP+CGEc+N4XAPrLpr5rPDOFA+VVDw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-10_1619550473552_0.8225315027363103"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-11":{"name":"webnative","version":"0.24.0-alpha-11","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"9797e157563f8b89b3cfcbca619cbb7b1146373a","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-11","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-b9gxNGeiN3894kej8UIunHi0BLZgQ98UdxGvSeYsKDhObbvUoks8c+RgXl77Ivha2X+Cra/pRsSaQ1WFKPcmUA==","shasum":"4a4bafc37cc7c0fbea628d03f1a128cf869e8b39","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-11.tgz","fileCount":309,"unpackedSize":23558103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiY1FCRA9TVsSAnZWagAAa4sQAKA8zxJz9qTWBzNx6xMg\nsBpH2rIdTS2/VY1o9ykDyc4hEUPhaH1Zwmok7C32lyIfdWU7s45UQEqJUaGg\nPgq2cF2cBxFSUs4DzqCmxP9CCQYGH71mZC6HSqEExbTkfwniJze9Lg1ytLyn\nNbHbCc0pw2VhvlvR9F/dGfsW6HzWW15T1Q8wcKkEm7AqY2ypp/UrnV9H5L8I\n/krZa81f1lX8fxSp5BafDnk9sXC7D5TpvpctfEWy9xj0ykcxqNmxnKwyzeuD\nLd6dWn2MaNhCXgDIZBeNYhbZ4iTtL2d9pzxsCypILV26bogY5bi0/dytrJV7\npMAP1Kp7S6Xp/EaYFPexjbmhagvz9PWObLXBMQ7LJu254BTe1QZsMPXgagp4\nEL+fL+AYS4vbQBR5N3WpE2UYTT1D250h+DTm2GWMvF7xec2HctCxy++bhMM2\nLsoVV8p2TbqoKGVGfv/AohqUTLCEDqYZNok/JKqa/yREXEmrrRtDg4upqP9J\nMJzzc2vnYHFjggDHcAx6WUto1/9xdGCgWKSJ9oTIKnpxSM6XzksnfSv03XX3\nqhoHfE499GmXGTGDG4fAvegvDPQcG0xSIs1hiVThtlBpYZBoXfSwonC2PyZe\nqZZK3etuc1kL0ttOhV+t+Bb1jkh7w+1rKiKIp1VFOmvRGqZte32vjxCcPP58\nm713\r\n=+Wwd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4I4qJ0G5ZcfjVTJZzSjSfWx4bdr8zUzohP/7z1t+QwQIgL2dqliF10w5R/DXHSI6WI0mIq+cR+/FI9nBWV1HwNbI="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-11_1619627332509_0.7976478185054239"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-12":{"name":"webnative","version":"0.24.0-alpha-12","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"^1.4.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.0","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f1340a00fbae9c89c322d41dccd7506c2c9ceb9c","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-12","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-YAzIs17cR6KgDxekUYEPwj3W66QSdY5157YnWZwb6FRocgovvpRJ0nhVk+u82tTE4NpAzazAgN+CfjPXTe7nyg==","shasum":"673691f2c329e6cb18d9fb9c1e854fb6f4b999d3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-12.tgz","fileCount":310,"unpackedSize":23591026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkFAMCRA9TVsSAnZWagAA1yAQAKHkkpExfbOhVL4TXhRS\npyZ8DaRo90b3m6ecvs1bTGisMzMiEZs++hvaESewjpzQHYCw6OVWaMLcreIq\nybItq/iq4wGCR6ynsySGVL66wFPNi6EYfF2+YPQTW7iEVEqqh4plq6/oi72F\nKnsIuRPXzHjYYJ9tU24LJ7z2B0G501qN+ysi80ub+u9fUCkOxamU3jBIax9+\nKv0VoNzpiVo6aYlCBlXMtyE9WzUQ8k4EAzOzJByDnbgU+4jd65flczt3/xN/\n0eIZoOWl03y2yBDqIGVmA68VVlxIDnlqdJcmqa0stHcCv6W4wVCRQxDDr+ht\nKNFnWWM4RTY7W23p0cB20VH69sl0dMPNI4iAlmVHJ3h8C1jo4chLuuRbBw1r\nh6F5FoFo0NQxMmino8Ex/E+pSYJM1/rRAJPn4aSozbCAukInDl+4sE9UoaXE\nd+dv5/1DlBOEUQIX/0j2iAmy2p7qsh7RLrUZLVQ9v5guEJEXlWKegdyzFQIk\nrqARXpi0x6b20DIl5XbREeDXbJfEx6MxzxvK/7itLi7KTMjUZ2aL8qo4Jdbq\nOD8UIRcvVoXh4tNa+Vm6Yp3LOEs8nr6MU2TIGhDo9UAjMqQ018Znn8amYGto\n5JGGpq3+Ic/0frMZ4qz8O+Bdorzz6L9b8i6wFeFFGFGnH0IFzATAxwy/m92B\nOe4I\r\n=FAol\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZm54NMpSLsdJFdGAYrXEFhT0gtyhbK2k1wY47ywsBAQIhANAuG0Iq2KbsuLFUldRyPta0t36gZjMdm6iwTnR1xyuO"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-12_1620070412146_0.8826686650640065"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-13":{"name":"webnative","version":"0.24.0-alpha-13","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"21c0b13228179a57d6c260d402021aa89511cb79","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-13","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-1nWlevmlKg9IckGxYikIJUGyV4r7PZ9Pygnwqn0kgcjC/wr7zYRnDtqpWecjkOq477w/VRX1fZFgrw2ALO96Mw==","shasum":"8fca8e6fd5d40eebe299a074894b103e571fdbbe","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-13.tgz","fileCount":323,"unpackedSize":24746826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaK0CRA9TVsSAnZWagAApYwP/ihvtrce+OAVLvQgsKQr\nqql6vrLjP30seYhyLlNolVNauxWGhZZ0z5mE3Uyry66inXxriTQ0D1yI+388\nT7uASzsHlLFfw+8WuaXcy5F2IbgrWz4swCv/Dor4jFHpZnCrtCqXiO4OX5O+\n2WOt/dHcrMLBQj5w3NhZq3QIKVfn7qpSCi26SP52IyyWZIY4XUMI3ouqxXKX\n7zrGqPgpwo27Xar3HaPGbF9cpZXHyf3SklPF4wNrOiftJ4zZd4yUj8AHGcxA\nWP84tz9cAgp12F+OGahTcR/m5ClsU06tyFxzSKf280zTO18MN3d6ve0KZ6TH\nvQgyaZBCwHB+pj3BYrCNQ+dBGOMV/AAD7OZDfyW+HUVD45rXJmC29OK6aYTi\nkddQfM+XGQ3iSKlX/chAnCOGoF9Y/U5L4DZkcGCkf6/QylgPos9s8WffWmEk\nR5Ri1AFJbvRHmhLZdV/kDd+KCOqJ18xvAztwgnW6iEbT1oAauqUwRbOI7Lfj\n4bYArsQ4NJVgzano+dItoE4bkFEV4QvbEujMkixWjQysRW/v5hnc8tBp9gU7\nPmI41XHqwmDb0UHVb4kT7pJ00+ho7uKeCAdXbhpSXRH0TRtbrSoeWy/xNm6v\n+NJwf8OT3yi6kPraiT4WV6/SxcB56pwk1BXYNBO3kNdYf+h/IFcA1EIEibqV\nCNym\r\n=oeac\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuURqSxX+7ZbSnYckFjN+rR9zYvIqUBNM1aE+gO/zB+wIgECo1XHJjUfRIbAXmFBWis+/F414zaKjwn7lxN8f7eUc="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-13_1620157107987_0.28998339926296124"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-14":{"name":"webnative","version":"0.24.0-alpha-14","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"5465ac3c62b38e82cccd84f51831165a6cb9787a","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-14","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-gyYpZx/YLjWcs22E0pBP5VG7LTRpBOusPU+Q4dGZbQuEjoQ0nl0TxYojZFg7xqBSRUjLGL4ZGWj0PbuFnV7umA==","shasum":"e303bda1f27898a4abe1856c146ef967c167b77c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-14.tgz","fileCount":323,"unpackedSize":24747076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbwnCRA9TVsSAnZWagAAdRkQAIPdqHiSroJF0W+CZtob\ncrvSefqoyNKezQRV8+zP7bVFst426U0IL9eT/Y+I8WxIVliEeiQavYLnjOEL\nsG18XyKhVyQM60mjynADG6qFqm8Bnf5/ZQEIjGTH+/YLSGBuZag+3zLaW3mC\nx1w8ZsyvHrh0VG2AuX2ZZ2fFJU6oGX0QajSinMPcyb4HQ9J6hk2/4TwcH5qt\nMzuAkauOQQKbIjihBD/+WENJnn3tvF/m9lG/KnC3qV+QW6Ed7KhcxROC2fLc\n98qgslYWJt8jUZ8AT3ZzJ+N6me7NNwEhxWorA34XMee0fOeb38e9H81P5NTZ\n3Ei3YVUcShc389cVGGHc4FzrNcBKpBDSNMvbch4wS9dNftkxair36v0/pg7B\nB04CRKNdzZ/aApUJnOg8ajz2mL5W7eP84lRAIM+UJ6WgyM4+cb62yqAHuwoo\nmGRrie47Jww2uhJqhwsKPMNPPC05e8ONS9LEPnceMSp3dgOlirAh0BI5wIfh\nqUi9IQcatQna1kdNSzeuc23gt/YXX5HFaQeRjoBOgUXWha68tskGHl3XkykT\nmnskkZ2E6DTqN4BQQD1q5eE58EbXq7jZaSPjNxhyGlWZhEpJrePOxuvdrJgy\nJZyTltDcZmKMQBoPciPLwmLkKa8bFk8NYbIeO6S/WrW1ZA1rD6wLcKwuKarA\nuZ0H\r\n=eq5A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvBHouk05n95y4uhiBEqteJUdBRvw9Z3H76NmwCcpBNgIhAKFkAT2eDbqHYf4YJpb9TqPkl1NWJFSggRtj4UEO0Cag"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-14_1620163623291_0.8604602933804189"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-15":{"name":"webnative","version":"0.24.0-alpha-15","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"b146c74f733f68e11c07cc79b70fd795eaf825e0","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-15","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-iOTbqCtYC0QN7CgyeV2dik/emiRyQOgbidAxvebvtZGi28O7MLv7Qg3LxCFsszWAqIsQ1Taq7ok295Prh4ykSQ==","shasum":"124da9d8d3c05ba2883bc6cc7234de1fe4c3db01","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-15.tgz","fileCount":323,"unpackedSize":24773109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk/HHCRA9TVsSAnZWagAAe4IP/0MRhXVLGPncAQpI0DbW\nBsn+0JDiG4g1gEIyJAuAuPpQFwyUEGZPYOTAHz6QKNoCWd66uFQaawEOvlWl\n7pdUJvBJwCWSPNy5rqqji65VkDL8QpR0ggHziXjKXkz8m5Wopl9i+J8fUx+E\nVW2TNzman7vyw6upPaEAvy77k7vy9HAuRk0d7e1U6JYgFzyUIpd+uKZuHl0V\n1XK9M+JsCvVdM436rY8QEZl9RwE7Axy29FWRJhv+TCEPm4k6qcCUu3MoS4rV\nANHbvqg3XHsV+TqcdDManqYsFFzcU0mzx+H0pta37c0wJf1Z4Q+9vxER3hnu\nm7/KQbL/xnAa70TOpLwwBSdaLwXCEjKeBO9pqQudYq8j7i+/R0LyXLq0s6U0\nZUZ8Q+jYwWyiWQur2sGc5u1scuUwTCGSRHySPN9qKUtRuWaaLlakHRMbkM5I\n/00Gr33ungEFn04bWapp2vm/Fyp2vRfxNjMq3XC7YdGzPNxRGOOkzv/i++xS\nM+3WvORFeTtbo08slp+t9o6verLggbY9j3VKZcW3SJXDkodV03ItZ7fGNUtS\nJx0qKOJqyguqeh7csMEqFUOuU8g42JRsEGDM8gPENRsnEVnzIgNkpS4AzPtD\nL86UDv8ktEfMZq9upMw0p4ahdGG3xQp21IoChgu0nPSFqEevdYHNV9JkaVcE\nnX6Q\r\n=vrrA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTBdNfJAmb7qZCIIkFBgIhO67DrB6EGoGRWgNhicgwvQIhAIlXOy48+dTuWsjlK04DB6GFk6sgsHdfesfCIYJ4eXXy"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-15_1620308422624_0.1712008457678793"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-16":{"name":"webnative","version":"0.24.0-alpha-16","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"b146c74f733f68e11c07cc79b70fd795eaf825e0","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-16","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-8tAKGNnt/TJIJF6EsF44pJTebf8i8RGvL0oI7Jlz4loIfSYTQYp2HXwlUIpg1aPPVDiQIeyV1ilWpesgN8+ybA==","shasum":"5eed5e8e892bd1bbd9738a743897e29c1002cf0a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-16.tgz","fileCount":323,"unpackedSize":24773109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk/jACRA9TVsSAnZWagAA1JAP/Au5yRyoaCohKDmNa9u/\nDi2aLldX5FhEaFxSnh/pEHIypr4VqgnYmF2kZISYnbDh/fCU/i8mngfpCVUX\nBd3lsS0djgLuL8TZhYhf6YZ/s3JacrS9J6ASwVjIZ2h8t0Sepz0Ux/JFt2wv\nMfRmFKzHFO+zrr25eq+gY7/KnbQnzXRuOWabuyfxh79cq+7PEqCP4CBVCsO5\nbBsIjFwi3YsVgHpsRwCZgYxgT7zf8t1BEZ4HP1oikw33TB2+2Cs/5rEmonCg\nNjRXPbgrL+ifyzk8a5CyVqg1zJy0eowQ5+6+EjoIz9lTg9qv4xnVPhZXEO8l\nV3Kq96Aypnfcf6XRIRJMJYLNeBGN4WNOGWbGCLxQELM7i4c2zkuVcq62oLaT\nFCt8aMYAOSfg/I18YYL98OShXO+pLqvk7VmxR9NWcgIvdd1DcMSH0H0LlZlQ\nvT+c0Gb8xMtMfwds+CThBlYi/izzMXfj3+/Cv2DaWumeVqIei+SxMPbbZNqM\nIyRXCEUlsICQA+Ac6t+iM97VZtAdNNWEdpbp2CZR5CP5/KgvvUmuc6EUJICz\nxeU5YOqUArRb+VjZ2sIDTR9V9x7+IGfwZtLRVNgzt5m9UDPe1eoSIQdlGSEN\n11V2c8fn7QVmP78U6UVBT22l2tmX82w3lQHRzvH3NGw79Lz/RIRs6t8vzw2l\nsZdU\r\n=mvo7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6H7fVLVjoSNLgxx+sVXYNkUCJHQ51QJaWIeTLKbCPVAiBolrg/kIlz5e4Yi8RzwASs1AE7phW8dzcc7Xg1LsKfzQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-16_1620310207849_0.1549895729811417"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0-alpha-17":{"name":"webnative","version":"0.24.0-alpha-17","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"63055a5104e1e93f7dbf8ffb9c15ecb7cc698583","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0-alpha-17","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-a/v/0VtpuGJiq1xMGxbSRjQwrWsCy3UHQkvwzJ/mscibe66afFxwbZ/jQdrAjhUhQ9h7Uu3+laUwK9HhvbtNTQ==","shasum":"2cbc15f44c64764a5160aba5870cfca4c4bb08c8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0-alpha-17.tgz","fileCount":323,"unpackedSize":24809126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglF/fCRA9TVsSAnZWagAArmwQAI30we8MmJIQfPN956Xy\nm5RNYVhHgL85Cbxa8dd5T+mnhe7hgGdiTCo4z3LUeaPtOkWGdgO0j3Qasu4s\nH7ABKbtbIXnDRgtAAgOpyZRSXOYe/X80yWf5vNRkimj1yM5ngZpos0n9sq5K\nfIJXx8V8JSF7+KlTeed9BO0de1VtBUP4te7wfSwygaxn5kJ20UduxuJK3g+k\n3BHCHT9N/93TPsp1gJp4lblhC7ZhaPwxpJ8zlrwZjGW61GH9sCmk6JS7ldsE\nM2aZdmZ12YYFt8geNvlLn97W8Xt33gJrqKJ6nWNDdwxom5WvmsKbsWyLx1CV\nJnkOBDqvzXkQYaXosuqxbSC+vptT5RhzpcAGimnzTkMZHqGplgf/rkPT7aDU\nif2f5gDToFZ9bUeNjEC2xMOtE+eW4KPsaTgxOcWLaAqpFLsoqyouBKnRguXh\nED5sbHy86obt1AOJD3vogvXjtT08y5/N1jzc3dFLXX69T0u8pcx3QjZDrxuH\nnGuzZLDrWuS4EctYC2/qIc5sCw/bFqxLafuQuaeuWTbR5/TyoiLM2IC+muSH\nKyy4eBuBGXf7zvoCrBsBgDja7Sxt0ltB1/dfEQRYEZjoQMFL/2KIXlTPxpIK\n+jjiRkGlcI2vYh06F38DITiSBPYDzt9WtuibzuC/n8mSXnDA4NwhlUguRXQk\nCD/O\r\n=66jF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZlEKEN1gespArLWgxGoZmAaazEauwcSJC7tfOAzIrNwIgUMBYRNP+jNJpl2ObBoxe/Eq7aydH0WBVQm+gZePYCDc="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0-alpha-17_1620336606991_0.6663011008123825"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.0":{"name":"webnative","version":"0.24.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"4c2fcc5174579f3f37ab3d7d7350f133f64647c1","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-or4xZ+jTn20GTvJfDdZlqCFGCu9AXqbBTqQTSRXygFHer4BxsvOfRsGlNGwtlYgYIujlpdb3pWRSpd67XBXQrA==","shasum":"f2f693e1f538680114a28adb0238d42f98c18b56","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.0.tgz","fileCount":323,"unpackedSize":24806279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglUhZCRA9TVsSAnZWagAAQq0QAKSgIgeRaUx5CB9H56My\n6GMyPv5dz3QQjXy7i+lyIr5jjXIE5Bj8W26hf6/b6pbEOYq96Fwak7qvzUD2\nadhN1PZ9zoPUisUHVQ4TkTuxwJMDoZnNFriLXz8Pj/NvA/kzBA7gJvg6KSoU\n9rSkq1ihzDuJUvD//UaD3VpsGLGUq9q8Yn9Yy9MzToAy6HrcwVyQAumT2rJg\n22aGIZKyJqF58sG58XLh1HJ2nEWGY2E+xP/JlYz2e/iBQBioPjfD0uUen1NS\ncfTAq175stAGTR2tTXy6FOwzhBuI3Eo6bGfpmpFH5I2xEDi+tq98kUcdieLF\nui+cI7/PtGjZjTpI1IN/PhG6p8Re9tNH4G/yCRD/8uaQN2uIjWdv5R9Y43sZ\nbkT/E8/SmHkHcmCAH0esQ+hY+OOJDe5hl+349qOUUDTES4h18GVHNVM9Braj\n8zVmzKDFKALOoRUrhncKk/4QusqxHTWhDI6Z/TQCrATHVm5W24+TWP4VtvPD\nuVeaSrOuCKPnS5QfWfJeZUktwVbuqY5+to6PK5KTNsgTzc3mZ4W12Bzf51BH\n4l7PrGO4Xz4TqRaYo4pJiIUWNV51x2RVx8KENcj7vMz8SNqXt66+bYhED/ew\n+qNbLaNycMQH9IoDWReM2koC2H+id8icyQ81N08Cb/IvK0XQHlgRPqFaHFPt\ntuoK\r\n=vZRU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc2XBfOToeKfaiKhiECbr0Gsw9ZhF4xDUD1V7CXZj88QIgYVkydhsDV1WEut2sGfziOw2iD+s/QRb8klyaqIzwsoA="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.0_1620396120318_0.18345072172358745"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.1-alpha-2":{"name":"webnative","version":"0.24.1-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"4c2fcc5174579f3f37ab3d7d7350f133f64647c1","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.1-alpha-2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-+t7xylYlbMGpSlJ0UB2CxkEv7VoLYw/8VJZv3xzldSItmVD6WiuRVCWeHoFZkFdeulx5FceHEprT30d8pP/yrw==","shasum":"75b0a17a834894645b64763083de0dc5d1123db3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.1-alpha-2.tgz","fileCount":323,"unpackedSize":24808079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglaI2CRA9TVsSAnZWagAArcEP/3mVLstB6hbkuHxoTYcZ\nW4HAaqbgf0sc/KT44vsOJyHGmpabogLeoGnEHcgpIas+TfEZ7O8Vz7WOybFn\n507rFLaWhamgDQU7N68RUAn/nm/7y/QAX/ugRoOje1PNZ6WflUuH2ic6z5MN\n99K+XPovYAMMKeUqxp7WeW0SxdOz8I+zd78DTPKtAvUF4bcI7CsDe1bY1QwI\no0QlbmeofjD5rAWq4+cBc4NXHQM7T4TpbJhq+5JQA2i3negs3pqUVUS19ePZ\nhCz3U+NYiofMOHBY/pjG9iDfMf9IUuOtB/BWIc6RTFU3cyORBhm3rSaY5PJA\nirBec0dyMFh6VTc1BKEcC/vqkRusrElj5phE9kWMfqo3rtNKgNz6IgWzas9W\nLfyBPDnkjJP0ympuDAYITuTvzOp0mltjA5yrFoW9irjej6bOLkryUUBYC8e1\nmcNbvOQESv4iQuYIb3xwCPjndCYmpLRDeGGmlunb8tdd1dgXX4CXDT3nkzGz\nuGPtGOqYqnib9/ekzHClE1ODhZWzxaM+ddG1q3T7XePe/sQrN7GT9PjDNUUg\nQk6ZTHH+2/WwCTFUOO4mA2jFjAK6bsaUsYD858hk2yiV0S+/8v91wYIwDE7m\nVDAGH5bGnaPHLjaqfhHkTGwTW1ntH4LzXqK9r2w0/aT0FXE48pSrIDswalFv\n9OpU\r\n=o2SQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC12SmYb6yuq3ZjciwyqRSdB9gG1FZ4FBNNK8ZrBXVy9wIgAIubdxQ3Ci9j7eMTpdHp/l2ZyX3tLWzp88oBqrIkPrM="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.1-alpha-2_1620419125565_0.7920220870379935"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.1":{"name":"webnative","version":"0.24.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"7c27679963f17a0bc140610434af1d89b7ecb34e","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-ayonvG9l4a4+Y50utdrZ6PDocelywCpoUoNaB4ss/YH2u1wPknrFf9DXxvcySXybHqvhLyKZIO37jAsAfEfeCA==","shasum":"78bef50c83b7c5fd045f011ce7bb23616bdb49c8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.1.tgz","fileCount":323,"unpackedSize":24832721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglbgsCRA9TVsSAnZWagAA7FAP/3oDRK5FF8OcDRFNyQ/k\nGqihSfjeTy0KmscS3nfEO9we7v1BCam0tuj5MDtruvhL9LmMC1uWb7Z/vZYX\n3OcSkzH/P5z3b+wjNzBUod1hCwC5k+ZUlY2xoaD0POhevI36y3+MvWYC0XE9\nJzQrFlGdxx3IBFY+0B1yvp2YZ25sYHfKOU+5HOEJlkFunBdJx1ogLk6fzg+2\nuGtR6ovgexQRAjsp+Qx5KyjZzu6icqSvGj5wCGtRhF8iBDKSLO9aGGmRP6gH\nT3ujOe0OzSx+T9ek4UDtFxKI73esO9d5oGavsjMRdSe2xj5ZMvy4KaAryB7n\nbkOyI/2LaSTZE2VzBmdzW5QgeGCaOK3cn5y3q/eFh9kwmQPZUUSM4n5UjeUI\n6t8p52Bkfzx4DAGe4+f8iMacaLspVMp9fOHy/YVlYHOusju9DK+bxIg14/7d\ntO86t/jKnmYjkcT0j4KSu4ajoOoyphOAzze8UphCU03Z3XIjK1FpkjbJn6+f\nZeGXDJlnc2adwv+0Yzv/DPPSpRRTaOtMbxkVVWiQkTtrYmwIPe0rU85ovlQr\n63S8XtTNQiRvKJqaaabpYk145zw3DUQDSJUP38Cms+kuYpjSRn1sGnEolv2t\nrWAyPhZ52VKT5E8o2nQJ6+vY7NiDAr5+BvwFCqGUSH7A3LPLfJ4mV1NY7qp+\nl5XT\r\n=iqBZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICTh68soWaz08XtQeRGTD4GlbMaLVBhs0xirLNYcGXjtAiEA+qzNwzeoQgIO4ZnIqUdZrHNLRxSxmFyW3DqV38QTCD8="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.1_1620424747536_0.30484765872827446"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.2-alpha":{"name":"webnative","version":"0.24.2-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f89e1d54f33c44c34a2ecabcd108cfdecf307b81","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.2-alpha","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-4/Fc1UrNrD3VaTpcBu8AWYjyWYGKHTZ7UjleiCO5dHOLJ16N5os0KUB7If54RY2dVefumTy5YFIolL0M7K7XfA==","shasum":"52bdd1e32b8f229636ed0b626021298a609ce00c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.2-alpha.tgz","fileCount":324,"unpackedSize":24583455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmtVRCRA9TVsSAnZWagAA0qMP/RTc1XNNzBNh07KRsaXR\nL1p5AwYZfN5zxKx4yckSDN0ULLWBDKJCGNq7AcSZbr+Hy8gf7vGOJyT5cLJ+\n8zQdm1Fs0onvCESHlCPgmoKDyER36K38DA1vBaIXxXOOalc0c0BcV1i275NY\nUqOb25cTVqJGIDneYbiSMuVrcWATMKx/PBYVwMCiNQAEQ5D78Tq72evMVnTO\nVzcUWz31+PdiLrAEeTivnzP+35y1fgbxmonpfx2ZfgMNckxh4CWS1qSoROLK\nlQSvtSnLgfKeCC+AmfuJCXwTZuyrCpJUiuuCG9hru+XHqBPkA4iZUKOMw4fm\nzDtO+Ko0UVCA3lncA7UEo3yL5nFLLsowsFC9AwZqJ9XMjErfBstcMKqiQdVc\nuWIDMT0hUYhvkkMrmV3WRGzBVp9XntBSSVQvt8Lpsj1jkTbUkzp9mGTycUTZ\nSx4LIcZDQCVzk6qQV+TycFsYzZCP2IBrXo4HtGscwSnA+3HfAc2Q5wLiJZBT\n4kU/W8UQ4gmw0eVL18AW2Lcf5/UR6p/U4UIo3lkLe0QHTPvsFupKRyrEgH4l\no9dtyq0LbdoG+N5ojdgYS0oC0EsStO7P1eyQGXh+EK/5/rzTpEjipY6nKi9N\n5Ltk2jYRDKpqMqlAZoMj7jX3rOru2D/L5enmbITWEXDegc82n4FlYNm5kE/i\nGLV1\r\n=8p/J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyHvSOQZTVvtpqe65h/AtV6SqV2pTeY/TqmWOzUIkUNwIhALdgOF1F9Ck1a55Wtw4W6IS+upjlURf97hewr9gZ0dCJ"}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.2-alpha_1620759888468_0.5139050673427676"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.2-alpha-2":{"name":"webnative","version":"0.24.2-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"27f03cb61fdd67728f2f8b1482d040e88f21e9d6","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.2-alpha-2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-TY2603grSzUwSsRKBIofn5/A9Jh3xtBwhk2uxiio14SAtH4vwSa2K4xXVEjBM89MfuqAZCReKTWXpioMXaQeIg==","shasum":"d9da53cf9f8a23f3536c7a7113d21b62fa175ec3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.2-alpha-2.tgz","fileCount":337,"unpackedSize":24591561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmuDGCRA9TVsSAnZWagAA4o4P/2M2MT8m/oZI7jhh+tnA\nTn2KKej+I6ia0JQNUJtknHGCFiUyVj84WlKlQmzB8WPxxn0BJ32McRJbT4TS\nJCDo6vIyrbs36+ogr0XCvQ9WyKnNWXNGtELONejZBb/IZSNZ01F7nKaLxgeV\ngr0d8QrCWlpXWaY4z3XWOOZ7VlKk2fcfTsjAlBLRuI5Zx6uMuxRt1nECV0lA\nIQozUrg8c6fE2EhajdgcnNyhkifKPm2/+Lg+H495eqW+T43j4CxhNbQm783K\nKwIL6pHJWSlL+cjdSsFxci3PfN/YaKkZbGzakkS2AGB/r1sQM2Zqn9F1StD3\n/tjZ7rjoJudNvVdtGoqX8Ld2kErpUzUKxNZpNH90MqtxELiIsowS4OgqTYDx\nlxQq1V5a8ZaYfq2+SK7DSiheQ2MWpdLGf+E7671B0t9pkprBlIXpYUZLhJGD\nrI+VRxJZMToPMxpHVaZvUGCdasgnlrCGwjLas07AXOnd9PhtSVd2OvEkK8t3\n0xaCe/MfGuoByUUu89e0GKOBxUJ7AH423dwA/pFNl1QMKHqmjAFCsK5ZiYiZ\nbQvTzLZKH7zHHSyGUsW1+ADVnt6dr5nTWYx7FxnNidTi7r6ukdKFkljtZ+Tm\nJ/6VlXDfNbZ14kQ5nkfyS4OWWxjsVrMR5LMvxkaqHSWLJZU2hwgiKj91QCPr\nJq0t\r\n=Htem\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqpelm16+Z9U4MBr0jO88X17hO8X5w7d0PP7R5FLUYpAiBXujpqQRs3N7ezD5kN77Xmj0rUlO6j2PwQYAiZoti42g=="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.2-alpha-2_1620762822187_0.3327731816951076"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.24.2-alpha-3":{"name":"webnative","version":"0.24.2-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.min.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.18.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(\"private/Blog Posts/article.md\")\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"a6e7580f821a2407d44162878b02b14b1692eded","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.24.2-alpha-3","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-akbV4A4/51s0jaqRS/UjOOiTm0TNv5gk3G4P4e7cKOHQVwq7ZkryGiK2gbIutjm0R/9q8ZN8WWM08od7fyPJxA==","shasum":"fa1c28e3c9b89badb210c21fb53d64251c604e4b","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.24.2-alpha-3.tgz","fileCount":354,"unpackedSize":24592050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpDHlCRA9TVsSAnZWagAAAoEP/igi0DuH67r0CtLcQTAP\nvIKUCZ3CscqoZhuIAUfJtNIHOB/+C/xFI9zCG4jlei+TSglcFvbQnon7gwGY\nBXt42loM7FgTvHYaxktiKLlswX+A35bMbnBoTpU5LlmbG1vn/z1+F31YHH9Y\nlu8khozFLYt17u6fr5uNRpeMsPjNj4d6q3m+Dag9yIMHkdyJQGTquH3oVVQc\nWClmx+On+W0tzuGp10J1tJ03Iy5vNUC9o2Q7GfvFwjxR04kiDl6rYkgu//Gj\nmyrLDdnAv6lqSWeYHDyY7mLTjSbedhM/b1W4abMKqwYIl2senfYKM9U+gmx1\niN3aqaVB3nUF6RSXAjrUNdcUHINNhqLfOWOoDM7sgdvnwJhWyB4L3ewjmUUv\nBDgx57FZJrGEFwXABWtS6y5CapzSC3S2gikVkYIVm7Vgk0J2K4ei2K8GjX3F\n94tvwR/jL8o0dHIU7cYR6qiIRF55Cv7BK1ORZ9AN1zR0QhNgNGI7YIVQDJzc\n8QfI5IMYjPyHtBQiBBindKLk5TWkHR09NA75uwGnm5BIOh4fCpEUxj3Dp4Tr\nkinqBQqbnMFzeQI2eje0irpaRHB66kN6wy3rZZnrJcbH0DKi5K0pj16hQDER\nBgbkZmH3mcct3GNGQICMOIrA6DzkdLHu3FxRW/Wbzrxi0woC/NmwhdQuXTJQ\nCa8H\r\n=LtsI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1ZC163d2tm7774WL8qyN8MSIMItAHHjI2IC/mcF4GKAiBgtFc+H6Sl2I+xtFTQVXOJCDYYmhHuVyRl3n8FdBpGkQ=="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.24.2-alpha-3_1621373412294_0.7830722987337313"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.25.0":{"name":"webnative","version":"0.25.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.min.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.24.0","@typescript-eslint/parser":"^4.24.0","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.26.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","multihashing-async":"^2.1.2","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"2b290c2b072928635a3e2b62f92a50e154366fd5","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.25.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-c3mzo1zLuBq8NjsFa6bR9ZVZHg0ia0Tk0pyaTWyG7oH0DOjJpkUrOiyy57gfgTwE24pTmJSuxsozpYO/pYU9pQ==","shasum":"34f29d177bbe2c0ca4a17641015e8ae1ac97853f","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.25.0.tgz","fileCount":360,"unpackedSize":24601088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpUOeCRA9TVsSAnZWagAAZtkP/iK+YMB7tPJ9uA7IjyoC\n99S7j6MJCUCJBAPeWEMKs6SUBZ9CyzGIcGe/leznsTwyImfzM9kfhGggBYEM\ncCzOAyVRfxffUunzoJx0KC1oTqFoRaAS1WpGJWwpDaNcB1QChGA/x9V6IijK\nic2ZYQUDvYI4zfbmZDIr6xwz0TWlqmRXbpmFaQwzbWe2VmQQTFHB+9PmX58Z\nmywv9ohMWXUzfoe4mf0aJj1L5wkSJ7dtnK17BFwGWWDOJqAWtJBii9bMULS3\nEE1gepJPaM7cXU6zFysACefoMW5ZpuidSGT3hP2nMuvXrJWQSDe4xR8Bq4Mq\nbNVxs/DshwtqIFVUJU6yoNkWI1FLrx7v0GZKEB5n7nRcJm47qmS9T7PlLFe3\ndZ8djwpxNfXPeGNn3OkLmyYKFYucROYfjK9cUUM7sOXBEy7N+scKIIpk59lS\nfY9TCYPowe8c2ombHXVjO/XzITp3NSlXVwTkOhgUlWArh3da8EbQ96+1AXUO\nlNVP14O5IVPE5GwsXPDY20gPz9BGJ4Z9tYRgCKiQOFRg7S9vD3wiKb65Xrl9\noUZ9p/Kp/Gf79sDJIxN2rj+Ui3FL9WnwR/zpJ9hZZwd6UMVBJU+zfFUDbjYo\n9xmQPlEH4hl+VxRQhAXCsStCEbdOWr+DXBGBw/9ia33GfASYIPqS8dondBy3\n85YF\r\n=VWnV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr/poHWJ4knla5bTYgOelT4FMnAH8WDvod+DUS8UQguAiEA1qDqHsDnPvXSvcCuqhuPlSltuX/WnFWC3XaP+r9aE1c="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.25.0_1621443486276_0.10564633728005957"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.25.1":{"name":"webnative","version":"0.25.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.min.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.24.0","@typescript-eslint/parser":"^4.24.0","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.26.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","multihashing-async":"^2.1.2","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"2b290c2b072928635a3e2b62f92a50e154366fd5","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.25.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-rESavRygvARpa9QJV6Rsh+UW8H/3J9peI0K/JZE1K5jsOzW3IDZGPxaHDcnDRDPVa6J8U6XDB2wzmUVbAavYYQ==","shasum":"1415d4ca0ce038a029a2142f4fe54f5ec6acaeb4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.25.1.tgz","fileCount":360,"unpackedSize":24601120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpUZ6CRA9TVsSAnZWagAAyhEP/2Szph8gmm9AHFEHC5lS\n1leuF0jHRYUWeSOM2LRiDEgwGUPevsOyYnZZIk2Te/WCPuaC4oAaxOvCX3Rd\nh1otf5jDXxNxgNLUZIRkU6Kyr+5cMJa29XQwRcLJVKOvbvhdcYVZ9c7KPrZI\nAT3SWwWRpmyeQyKPjhk6HDUGKBSJ47WRBKYRwQrqnoxkS2Oqp7NAqn6ymFKd\nKYfyMEi85LxCnXK13D9VfJIYkIFCfJrX3joDe9+MOfF0og2sRPXFV3Usksqc\nAf/gVE5gLCxIKjiN/IkFK9aaWe9x27fow6sAQQdvRaLyqjjDPlcmrJX8Sr0u\ncAH82a6gqoVO/wrLFJuuaxR40hjoEDhCGOVhVMVFY89G7AQfPzZPSRMr6qve\nPUeE7p6LXQ2YfyZfSsLiVbv0hC2/1JdjDhgsh+O1iDa6hdmg0ixmCBT3GZr/\nFhx5EpkQS326bEdo7UE/xAfeYlrvOAyKR8XqDC51espDHDLMxfqWuYIRz/04\nLqrs+TtS7aswYE6qJhL8zZ7wgHnpT9iWrpxUQJY81AXhFBqRpVEEhYhdcO3m\nNNz8j98dwDojeNWghXIy+AM3UixD+e/BijAR2Kz8zPr+qWehR/YTc5F/w11V\nVV8ePArqTIows5LcrvYS+qrriu7LjUSqCFhrnU26oflrNDgdvPLidn4izBz3\n1lQi\r\n=5Xp0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAYhA9q/G1dpW4kZaf2xm+OFK5OZGcqE+1Cp+y129DHUAiBiXLLG922P/Kz209s2KheHopN8NuXOMVl/8JOOOyEUmQ=="}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.25.1_1621444217526_0.15603971593697818"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.25.2":{"name":"webnative","version":"0.25.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"dist/index.cjs.js","module":"dist/index.es5.js","browser":"dist/index.umd.min.js","types":"dist/index.d.ts","author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=10.21.0"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf dist && node scripts/gen-version.js","build":"tsc && rollup -c rollup.config.ts","start":"tsc -w","test":"jest","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test -- --no-cache","test:types":"cp -RT tests/types/ dist/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","precommit":"lint-staged","prepublishOnly":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"prettier":{"semi":false,"singleQuote":true},"devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-inject":"^4.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^13.7.4","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.24.0","@typescript-eslint/parser":"^4.24.0","babel-jest":"^26.6.3","braces":"^3.0.2","eslint":"^7.26.0","fast-check":"^2.14.0","ipfs":"^0.54.4","jest":"^26.6.3","jest-config":"^26.6.3","jest-puppeteer":"^4.4.0","lint-staged":"^10.5.3","multihashing-async":"^2.1.2","prettier":"^1.19.1","prompt":"^1.1.0","puppeteer":"^5.5.0","replace-in-file":"^5.0.2","rimraf":"^3.0.2","rollup":"^2.37.1","rollup-plugin-gzip":"^2.5.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","tslib":"^2.1.0","typedoc":"^0.20.23","typescript":"^4.1.3","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"^1.0.0","borc":"^2.1.1","buffer":"^6.0.3","cids":"^1.1.5","fission-bloom-filters":"1.6.0","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.20.0","keystore-idb":"0.14.1","localforage":"^1.9.0","make-error":"^1.3.6","noble-ed25519":"^1.0.4","throttle-debounce":"^2.2.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"dist"},"gitHead":"3450dcb490de02a687480cea49e76b2bf30b6c35","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.25.2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-KRyvtdtsWj6tlji8qbXa6fJKCq/jThUamIFbSbr/+/2E1kSxhlR+cxqLKnQR8drl/tcfeHunc8Aj27gTtHDp0g==","shasum":"470e44485bf3c702603bc8a83a2c1267b48c2ede","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.25.2.tgz","fileCount":354,"unpackedSize":24590558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpWT+CRA9TVsSAnZWagAA0C4P/2IMtl+Fgb9PkD5AePqU\n3DKfZfdwarzrU0D811SOuhxvoxmaLWPy0mp6cGh69A7Km7NyIXgNFfkipjXI\nwZjT42ruxdeX34Sfl5GnCeHZC0j3TfS9HKef/NkVVWoXAa8peHr6v7fjhVS+\nfoSPBm+gacSTrhA19JBENiDadt2VPz/Dmr8ln2s53tnXD+lB9yvr3DlEvaT9\nMydCp+xmZ+W6cxEbLZcoi6SVeZ5YG1uHhXnaFMt+Cst5OJSh0TgzOLawayuz\nzdt/HJ7hxMqLA5Sr51QLP3v7lvijjh7ItvNCbMZW6ZzM6PpQaCCfVzBGkxZ5\nySy9yoSPnH6OYcdwPPxC29xjIYyM4/hoRXzseECmSB1woRHjDJbvBaYa9XuS\nhUbbBxEz2tZYwVq5WkxZA8a604M3OT6DZjBJaJdZhoIb6aU2w1yy0QX6Ir6r\nfWUFhMuaU/Kd7IioHTAS2raqlPGLG0vK/7axEZTHyuLbfQZAIEvU+kHWx2O1\nCkRlDDQKgKbL6+AvMmcb05p8nn/2SaTzh34kJaEzon8e8EtyzjM4DUnpCi3a\nUfE+dehxeyLRvmMrn1jNK53XNTQjnMKeju6R2s+uS17qGDuVrzDQpsxXO/zy\nB96BECo5tP4uYmyxad26U7M0AJTMKqLf3Hd3BZELmuCqUik4uiWQi6mnPgrr\nnqfi\r\n=NI+j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeCadxexuIWPz4KZpD+ZihuD1k7y3PcxHBPIrTyedxkgIhAIYJuCuIsHmqjRpwAuNhVaOZOaMRBIowisTpsl6TFgBW"}]},"_npmUser":{"name":"dholms","email":"dtholmgren@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"borismann","email":"boris@bmannconsulting.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.25.2_1621452030037_0.10532256748621793"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.0":{"name":"webnative","version":"0.26.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"https://github.com/fission-suite/webnative"},"homepage":"https://guide.fission.codes/","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"esbuild src/index.ts --outfile=dist/index.min.js --bundle --minify --sourcemap --platform=browser --format=iife --global-name=globalThis.webnative --target=es2020 && gzip -k9 dist/index.min.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"https://github.com/matheus23/ipld-car-jest-fix#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.0-beta.2","typescript":"^4.3.2","typescript-documentation":"^2.0.0","yarn":"^1.22.4"},"dependencies":{"base58-universal":"https://github.com/digitalbazaar/base58-universal#de970560f005de0f7054723c35ef6e0ff4b328b7","buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"licenseText":"                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","_id":"webnative@0.26.0","dist":{"shasum":"36455b4407ffc53170e52ea397f50c13f98f5b0f","integrity":"sha512-/33ofpIbYJL0nKOkyCkizJogHwKRLk67XWWeX+3K/k0DtbFC2wHKhR+YS4mHnDDntxhDjITNwFH8CQCt7T1cRA==","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.0.tgz","fileCount":685,"unpackedSize":10514760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2z6eCRA9TVsSAnZWagAAuXAP/RkG9gO3VS/Z7SGPAZrC\nFv5mJmM6f5QWsUYOUmcWSm4rr6/02LycQrhk7mpEI4gwBBh0oH82kbNOZRht\nLksEFX8x3ZEZM/Y/jTgKYyeRQw8CzdLWlJznLGVanw7Vk/Gy6S8e2gttFhg+\n9HDAx7yMj7VwgYoeNlvnHVBTWBT+319uZ3Z6OqQnEwE/CuZxwOhpQ/REBE9o\npWroMeMoq10qJDqZtsrvGB0axEdKImTbPWWMJ8DgLmfGLGfU6K0pRe519iNF\nD+MG3xR0kQxCHYyBYYAdO9TfOnXoUHZZV1Q/ZBn532QtTFjq4Dzf144ANXZP\ncesQr5EusNqQ17zQpHyMJZrJJ4OMZZq5oNLu8sEj1YnBxkwDcKMom/qRO+/3\n4ohOoEzmKNSCfpzsbzohVegr4iqQ91XRPn5ksFxFwkd6k1ZRLIqMm1XLmhQm\n7Uy0mE1AN3xEtpWjs5bOYjpyW+3iUza+2x0aKxPw8LRzXw5B4Ms1Jy3pIIIF\n5rrQ+2ILNmDOs1P4hlqw29kvyzU04wV0MCXVWg0ZmVdi1Ajawe//Pe0LqWkh\nS5LGkLPOG666pFFO9x94uz8xcOOEQMVYidihd5v2cMJtrtJGNO7Ew/+lDQZ9\ncaYWHIyv7ooE+mx4cqhMg6GYeZ8OKz6XK68fQUBR+1TX3TwOT2LpWzV27W5A\nksuN\r\n=Y4xk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5sqEFKGQtocsaZQxV09MH62tLKkV2jt+nvv1ZXPOQ/QIhAP21CKJrCy++YYggxynyByHVDgadkJSLCIVwrasEdNOY"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.0_1624981150084_0.009397947081835278"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha":{"name":"webnative","version":"0.26.1-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"esbuild src/index.ts --outfile=dist/index.min.js --bundle --minify --sourcemap --platform=browser --format=iife --global-name=globalThis.webnative --target=es2020 && gzip -k9 dist/index.min.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"git+https://github.com/matheus23/ipld-car-jest-fix.git#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"base58-universal":"git+https://github.com/digitalbazaar/base58-universal.git#de970560f005de0f7054723c35ef6e0ff4b328b7","buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/IIFE build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"7ce78c3f80f98c1e0d59f342acd667ade82bc92d","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-7h9QFL6x/TfJlWxs9HXMM4+yus3amYJi98pTufAyl0/VExEgl5Hk+hn8Ev0nuP0LjInRR5dSe6RofTxJ9xAvvw==","shasum":"dba0f9a0e4350b70f6088ee8c79e6913b06b4c06","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha.tgz","fileCount":381,"unpackedSize":6056502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+HLICRA9TVsSAnZWagAAlI8P/jU0MegLU1G2zNv/meCY\n/fG8wX2DUaTQyp8ooMlMLUAW6YYxPQCnAL96v5hHr12ejtyFzV7k4VDGry3Q\nwgzRt01e4okU/4lak9e9UjbD8UlTG9x0Ocwhn4PWcTMD/O/gO3muW5GP2lhR\nCrST4z6UVAucH054j6mx8zjc641FpXMtd8ev+fyy2nJioptiKzbX1sKPyK7X\naCl7gqcR2I+48xDXQUG9xbqtYP95d+BGNsIcgdOoMkJTdqWlSpynIqOKGOzQ\n4aL1HY42VYCltZJ7rSuwvtWWVEsiTjsK74TDfd0mvsk599pibcvQ31XQnU22\n9EAFBl3t+EEFODijh33IwZUhSqXN9BjZm5nmNgRIL/Vrcn5p8cLmWquXDoXm\nDwA989BnCZaJZQrZ6tzkjnE3+kQCpgjX2a/hEzULiHTvF3lvWb128UuPjJCw\n4je79R6tDwWzS6vF3/zccdWBQ/0m0r/pKQMckAbh79KuwFz0Bt4P1eWFjm6U\nsObRaO2GXZoTD83f2jBDZryPtshjHTm8ESRNpjAmdrNHgyiH9C6xhBAOEK2H\nVbwdHe7tQ9afTWhh53GYClUasp5HaaYU9mfjOq6m0H7GAnMw6E6PtW7t35xg\nJIQw799w4zyYrEAeQ0o3f07X8+b0+c8MeiMv1LJAD5a/kr0QMdvEegenA2BD\n0rmb\r\n=wpRh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbcATMOe1e7cq1xCj3vpmM6qKYeUQI6ebjxkB/ke07/QIgPI7eT+46MjcQIc/WntPcJNYD4WT/z5KBlWaCqmmE7Nw="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha_1626895048727_0.32431763468638164"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha-2":{"name":"webnative","version":"0.26.1-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"node scripts/build-minified.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"git+https://github.com/matheus23/ipld-car-jest-fix.git#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.2","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/IIFE build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"01360d92ec4a182828d7086397dc938a8ed4e8e8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha-2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-a/xdU1gfF8HCHslx1KZkaFvGKkYaKdFICoPZMVRVclbhVKCLRuxIGlz0/T85y3G48NHjPmmNSqfEB8HJDb1GgA==","shasum":"dd8a4bcc41da5fa1937f1b91b5ebda10a01a89d3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha-2.tgz","fileCount":346,"unpackedSize":5894377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+HO8CRA9TVsSAnZWagAAQQMP/2YF0Lc1Ffug4TKvvbc9\nOUFPbV/wZVcTTbF1eZYeg73D+xiI8YeNZJfr0hkgTJqU0GoJcmeU7l/k1KsJ\nzuBSHQ2JAQKYw3D5zNKV94Q6gGhJsnfH90crMiUYthnpX6rzLMyufsSt80WP\n3kOS3K+MExWidojjDJfKWVppJf9EOdDybq+dHarkPSQXg8kALGwPEQPMW3DW\nFp1jrOCFbudWwlhnRxSo2t+tUlL5+Syggz15W9hoGmX7FuKnaZcCIDNGtpKb\n3IVms9VLdKAIEE14NCA3RxvtNOVxBdQ80NBoa//Ub56kOWzCDRXTG59dytbF\nZ+tZMqMypeeegxVX1/gFpUk5t+/m/kFloI/iemQkUEHkn2ZZyqSnFfXlYFGU\nE58MHUap28faEoHfFqAGpGTmYpRTJWdvd22fpanXsx4rh1R31ATH7eVDqF8P\n21TtuzjX8KY0npxTmDcj6dwMAVDlGg8gczJtILFZhhiFzKDM7mjNUUYWIpXr\nZevlz/TCW/7FKALG9zMx/+IxhG2Us5/1qB9WxBcTucI+yoEnG4eVWJiXs/+t\n7jJ72tko+S+e2EcAi/7f+VtfooDTEMsoX4s1uSHc0Ji6VxLIy7j7u14bdRVE\nW9+9WYkUD/TBfd+gpsSCwnm0SQ4OfAiB8T5usinIeG/H3KOJ7STvHpvsbAUh\nsndb\r\n=7YBU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8qt7aBJbjJqZVEXYhciPWVSelUawH98U9Y0QFsscKeAiBQrVv2rEgWW7YNXp/2+GtsG0ORBnLlw5p5zkHA2lBE2Q=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha-2_1626895292289_0.03069487992618103"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha-3":{"name":"webnative","version":"0.26.1-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"node scripts/build-minified.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"git+https://github.com/matheus23/ipld-car-jest-fix.git#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.2","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/IIFE build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:watch\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"01360d92ec4a182828d7086397dc938a8ed4e8e8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha-3","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-EUaEI4nckR92Kg0QPZpbfuewXUhe2aee9lxC3tj3M/CkzcHAvdyZFfrNvgKlX0vU24CheQQgljuKtoN7b4Fbsg==","shasum":"3acd7607c22702748fd64e6f2f4447419f670bd2","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha-3.tgz","fileCount":346,"unpackedSize":5894310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+HUKCRA9TVsSAnZWagAARuYP/0iPfVmTTO0znLY7MixM\nTzQIB+S/+BB+VOAEHwzg9iy+yU7tSUsexkIUydlvXnqI4Igv1RIqRihmu7dj\nOLyKDxC7nXcORmAUa5HDxt9RQMxBIXcXsJd6dqfiyLw+3eaYNiH1jYNMa9qO\nAkT0ymd0tp4pVJy8fT4Blz5OA/pxManQRnzNOAy7hXKVHdDb4jZ/3/NgckKr\ngQ+04Ampz2RfRbSokVcGnkaAhzswYgdtQmmTx+vV4stYjVRZiCYcpVhnWtRa\nV32tneS6loCPjec8w7lPHBWUXvuzD9JVVJ4S5Gx+kXPqSs3EOaQlScU7u3l8\n/dKxDC2kdanW/c3WZpsNISJkUS7HR1TRPbyLWFZVrRcuZKzGVl9sTqJOLOPt\nE04F5LkrDBjrM4GaNXZPlEng7xew7ssOM80CmHEJzp7mQsP0hNkEmMTpjyW7\na5e/58GPswSctw3QgxUKnQlI/EAzhmeH/BT5GKyFFL3GGV5152EAI9KgPZSw\nVnIz4winD/ZDVVQfSxyZVqzJEyp9fUkdmKWBQEwxMSHUZx2tK7HbJn6BezFs\nZJdG5HUQtpgoMQeqZX7Zu7+UGciP96k+LSelgVpql9TBwDxl3SR4bUXMrInB\nFxUnjGbY3K44DmCCzoXo7gmYBvh2c1YZdiWVN0EAY7aNscAk5K+23BcKoMDZ\npi+w\r\n=bfjv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbk1WLUftFQvw70yhja9qHTP4n0uFs+08lt72lgUY0AAiAK2JNZWbJqYVGPi3H8b051RUp9hddi9U94Cj/UZ47xaQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha-3_1626895626731_0.38490062682975923"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha1":{"name":"webnative","version":"0.26.1-alpha1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"node scripts/build-minified.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"git+https://github.com/matheus23/ipld-car-jest-fix.git#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.2","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"01360d92ec4a182828d7086397dc938a8ed4e8e8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-tuWvjolypG//aXZW+aE7aCZOECo1dLoGJgDLnpw+35duzbO/BujaHP2YfFto9jQpHNJkT3H7r8EzjbvX4XzExQ==","shasum":"3a71b37cd3cc27f81aeda1aa24dc3f80a5dc3e98","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha1.tgz","fileCount":346,"unpackedSize":6051030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+VvyCRA9TVsSAnZWagAALb4P/Rowu0ItbZHHekzSEHbW\nj+WA0rJhO5St+FkKKa3GroqAmwN5ccNMcTTatse2H8+HLz60/0RfqKazsfTt\naNWQksxEoO8r5XFPfUawjcQBqV6FvVCWiEBx6A4QfNfBPLmvpuSVDaLWu3Sz\n1i3tqEEWa05eaE0oAVgwSplTUK2dloaudRe1//LEbc8I620oswr/ZsEIbrat\n1RvUdkxW2F1IqUVnWALMGLYz76kmxRadlWusYfRZLs8MFpKEnKjmOQVzd1tX\nRvEMy1J+NTkRGNkjtzRYaV2JWlL9VkFkJGOX1L7IRrHDOeqkyRYODixhf0Xa\nYTaepQ5LEppfiLe2fNthmLB7NlKwviX80FdCqII0fu1LDAalCzrFW24BR6th\nHavAEfS2w4BDex+3RRPhkLqB6I7IJmnpCo7vloTGHrKApSSJi+9AiwRieNs/\n9qj8o7dfnvggEAl48SY94Ifkuf7FIliwdKRSg80Z/BGMREYTj/s4AuX7qOf9\nK5GmcxLTs5qSi8qzrFO4hvbiTsRj7lRELKCjbCHveFte1GONqjjitaILm3Ko\nyoRxdr/34imCVmbs/4wOa00xVxfr7AlV3taHadbYGa0+/zoxIfoli2/NzDX2\nukVQqkpULZiFSIAZv3+8ISkWZXem8zNi7+4lUbYaAFLDrO0XYcClmHoPNJXP\nSyXo\r\n=0vz9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc+EyFUPvDWSPh8nQlTyso8tMbURMOQtfPwhBvfTDfQgIhALjqm4401XLmsn7IXG3esX/mqxZl4XZGUi4MX9Lc9tpC"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha1_1626954737895_0.7696435600866061"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha2":{"name":"webnative","version":"0.26.1-alpha2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc && typedoc --entryPoints ./src/fs --out docs/fs","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"ttsc && yarn run build:minified && cp src/package.json lib/package.json","build:minified":"node scripts/build-minified.js","start":"ttsc -w","test":"jest --forceExit","test:watch":"jest --watch","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action --no-cache","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"jest --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action jest --forceExit","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@ipld/car":"git+https://github.com/matheus23/ipld-car-jest-fix.git#28fa48a8d0e701ddaf6e4785d0d9f08735b67bc8","@types/jest":"^26.0.23","@types/jest-environment-puppeteer":"^4.4.1","@types/node":"^15.6.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^27.0.1","esbuild":"^0.12.8","eslint":"^7.27.0","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"^0.7.0","ipfs-core-types":"^0.5.0","ipfs-repo":"^9.1.6","jest":"^27.0.1","jest-config":"^27.0.1","jest-puppeteer":"^5.0.4","multihashing-async":"^2.1.2","puppeteer":"^9.1.1","rimraf":"^3.0.2","tslib":"^2.2.0","ttypescript":"^1.5.12","typedoc":"^0.21.2","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"buffer":"^6.0.3","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"595ea43bfafaa8eb00a916a5da722a7e73fcddbc","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-MCuizNPxlnGlhIOJoJvQrZjEejrJ507V/OfKG2f/uiFGpw/XfpftPEGqc6tcWOFOszA0zyNG5aXXS+2vMiXn7w==","shasum":"5e18b54a66f2becffcb2c2e00ae93354ef557309","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha2.tgz","fileCount":346,"unpackedSize":6051237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+XQgCRA9TVsSAnZWagAA9YEP/RXU81d7/pLbpuzQkYJJ\nJXo3TtbNmGygCvsi717+dzvjEbwdFeIBL3HlGXMMWLt85kti99dg4KJM3Wku\ncqK8GHgqBapsbNOhsCgJazDRqZstOdagEB2Zjj+OwMLt8MMF209uebyuFDn9\nqMH8vN+tMDTDYHR7nbh4/ZTCAB9FpCqevjATP7iV/nLPMWnKV8Bw99vhYMRq\neWthwqxM276+dbsNpZOVNTXJabqyvUIkXZxCpbBBH3Efldx6bLtrUllHrBHi\nZQ8TvUQ52kH+9pisdnVe7P9ZSlEsiir5aimzZ6HxmE9FpfMHQtjUCAOBq4U3\n7DWPvPmM1avEikNu5eSnxDbEZCl6tkWYkBkL70lef+k3lP37mwan/X6Hh057\nMdeT4WWQOLxcrorJ1v+eBWCOlYzh9KB8he0F9zG0ig6rGw2lAkwI/JBbvxEm\nekpir77LGt5CVOeq67EsmY9Gn7D1JsxzafMTvazKEQBYzjnDDaED1OpOqpWw\nD+8fW7zFbH8yyWUDpi6uExRpaJY9xkubCLW33rd0888RMF7+KdvbD39K/wgw\nCZwP83uXUpOAVlrtCD0OmA4HH1uR+3qswxPgUYcdd4L4wcynT47Zvw/JnfIB\nhS5cqrDHvJBQsbROQO4Uv6nUWSN8N6wwn7Qwxx/JfVhoiu1XPSFlLctApQk4\n/1Dv\r\n=nI9X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFV4IvCM6k4utFXpnFesWncRHNNwZAYS8/i7SvMYWROAiEAkSKvVYLFrunEpat0Bw9zKhhVEl7VqqGOFhUnnR1FiUY="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha2_1626960927895_0.8413975239678575"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1-alpha-4":{"name":"webnative","version":"0.26.1-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha --timeout 120000 --require tests/mocha-hook.ts tests/**/*.test.ts src/**/*.test.ts","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","playwright":"^1.13.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1-alpha-4","_nodeVersion":"16.5.0","_npmVersion":"7.17.0","dist":{"integrity":"sha512-5K3omjOpJPRfyJeOQ7SMPBlNlUKpCnlHEFIC9HRVa1PKYQM6MAhta/7M4THBVC0Mn+loefv4qC8UomYCoUYPpA==","shasum":"1d75cb3d8ecbc890b31dc221ef738d4a99b963b7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1-alpha-4.tgz","fileCount":379,"unpackedSize":6142761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCCe4CRA9TVsSAnZWagAAUhMQAJ8rHh3UziWrYzDSjhDI\nqalaxr+7ZZL4gV+4JzVTLrnbAeVbs7gssXdFPAPbVPs5KlJv3Ar4jJdWa+L5\nwD07Lj7/GUM7gpd1yMhPHSVIqyLFdjeLtMauazBXx2b+n+gwh8qITaM1/H2G\nguANaIocW165gUU5xyoUncSnfLQwCHFtJxMJGsHkfIvSR2GAlaKVuR/gAT/q\nj/bW3G21TBfXTaa3hdIw0RvpwGio6hRvi77VG8LEZNttnUfRnuzwpVbANW3o\ndVv0ZYOgmNdg2Z+I/+SZ4zefN8idyx/JdkXXeAfa4ZL8Q/IzmlQLX92AF5xT\nvk0HfJuSHs2LJ04p0ydikPDo+9eNrTJkYfx6bMO0Ro3xBWTIM0DI9GM1ZutF\n3MqDgyZENsCEATuUcy1lyVmO7OsovLH2bQ6RbjAc9Cj3oG3/k0t/Sc4twv0N\nOpXrE4agnjTTdz2KQUlKUkNTxc2PaUpoAjryd8MTUp9ZTxj7yfs05nKSd8+Z\n/qRSB4si6prw73UWMAYC6E2WHOLxT/IZoKEaotdGVrk1KY+VToed19WLe8nM\nBSBkIUrVtV9QhwXdFTKEV55K5qD2QXmukjVo6KD/wgMEc6V4nbChdeQX4Rkx\nR0RQe9AdASE8B+tr3rNzxBD4zwxz3VI40DqjFPiGE2Zh2rjAURGkixET/VWJ\n/Iz7\r\n=K8fW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICCSgrT8OuWwbGrWt37bi/GzhDRO1Xs/XDwMFqCurBU8AiEA8eGgSLIVcLG+iIhvn+sEW8aOv74lnAF/N6+xY2MU/Gk="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1-alpha-4_1627924408478_0.7248716439643077"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.1":{"name":"webnative","version":"0.26.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"d54cd26096b9486fc33e9afbbf54450bcc239f07","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-z3vN76p6kuUu7xph5JG+TyryJsvI7WsAcqgtz08r8dfLu4jdQlRRzLCcrt9Qg1yhZDdxlz6sIRmyFZH7AfKQjw==","shasum":"271f2d3c7d22159ef5ce46bd5e105fe5d44ac1aa","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.1.tgz","fileCount":379,"unpackedSize":6142817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDAsXCRA9TVsSAnZWagAAH0YQAJFH4LHQruLmn90CLxoh\ncduJyWjcv8AxZBrVtAc3HjuLh3cMLEA4ZLBJ26yyyD+wAHN4Gta3oh7Nhylh\nIoRoUN/FG6oEpHBzGPqeqLT9TVLaCTI3UX87jlij/Ov7oWyz/NG4E3utp2rz\n1X4lCg3yO5d6Rfe+J8YQBzpu6Uujd4bv0tzhgzUlYZ4iq0Cw1OsjOXJ4CxYO\nUKjR/1t/Ff+75nI6GeHbn1saxRC+DwZ/qXXSmX4tRu4ZPuQMbvQ3lT4XLDvp\nxvaZ79DWX9C5CmS3yzARzJuPR2FYNL+4uLadqbonCTfSuFc3VzAhtnb15hfi\nvvtuejrOfKhDzCz64Z62qloRPHzZIiI0Cba2LQlQNYeNmEOUb2kON5nmpB6H\nMmOjifhuD+QGKM4xNiV+GWIyOWluTbpfvApAP8zff1Y7p93qapBtiUVPFq2h\nx1Yy8224RFCRFzDfxW34EwxKLdECwzl5uxXbBUfO4ne9Cx7R5T/U+QfCYAZW\nZbhdongOZvU38DEqom2sUCkm/PUsyau9NAFR8PBXiCKkhVbrK7LC0oNZxFOO\nZqoMnQHJ1m5r33M7dmiytKv2DGT9mJJ0LgRF12/Q8l9rpwyr0ErUxW3TBhbA\nftIOABBxPFFZH/pnw4B7oThcWfUcahMn3h/y4qIWAoqa3ZTSQOxScmz14yr8\nEJoq\r\n=hKoT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3bgssMkP+3qUE9QLqTSlU0kRvODfCzqs+W2ymplGpDAIgIAUV7aAyEwT6Ms3sAxF8ElwJbD7f7w8AIip22rZPnAQ="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.1_1628179223257_0.740528939779941"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.26.2":{"name":"webnative","version":"0.26.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"0b3b593b4675ae42ae4d7ed1f9e79919567b2d87","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.26.2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-/LY93H+gDH+Nn+l4j8x7ShItv2iK1N7dbqWcGoWwA/X8XQDCKWfXc96X4T4Rfge9oIsZfdlsReWrSkRFs7FMjA==","shasum":"cea67e4fe59e0f652103c036be1ec9db4edc5b66","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.26.2.tgz","fileCount":379,"unpackedSize":6144897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhErSzCRA9TVsSAnZWagAAdkwP/0WnNXJXmfAQsfli3gYn\nA1bvTUbWQ1x5NmqddzcGXgwUCcKGBgyyw173mycARE0JX2vdwap9vfMSwITa\n6rfEMu1qzCThzaNbJwQmqngOBSNo+GDmKF9dk99E8smfkEEVaGJVJCyUVAVA\nVqBgKdt28YF5pXSzyewadDn4ffRDlx8acGD9zmCNWO8WKYzaSs0nBUUKzCvS\nrzGJL48xnMCz/cUQBVqx3wZLaPgYCAfufW9VZkJeYm1TSUvGNzFXdvV9csBb\nhzrxNaAMoUSU6xfZ+8EEor6YDSXMDivA8W+tW42Vu2pVa9rgsXtwRC4CEPZ7\niCH6lEy3RFfvjNE9RGJTpVhr5e8DTJwVXi0lk1mqfbazcEHPcKuCBV7hVuHE\n3Z5Ajfnd7qYE/CrozpRuqrAyTxezbO/53/l9l3KMQgWcsKgcpmPe2m+wXWj6\nLn+khGlPWDdwtyzbObarNH+b9aTguKgmXmP1LSXQ8ALXkzHusPkFYG75oSpa\n3eK/yMN2Q+OLpQDojWJvi/xK4ut4rVCeimQ5bZ7iEkvGUasF/ctnBymEtsZW\n4X5Igkth3uInys5QS8ICkl9FFnAtzzuEKQRRwTOOQJdvZNuaEESH3QECVt93\nD0Fjtqt+IDWeOZBQaNxdFHQiBmg/u58HmlNU7uO577V7dplNTXZ/pgcjtzbv\nIk6M\r\n=J81f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZgzZ9zUcEXSfvwqDtu2rT0CCjLie6aSWJnOdcrfizVQIgC1TjAD0UYvELrBBFdAXe3/5P2hUvFLHX0B+0rlWwZCE="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.26.2_1628615859313_0.31486599115482305"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.27.0-alpha":{"name":"webnative","version":"0.27.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"e3ed1f9d6d8d8c56ca851febd533bfb8128a19c5","readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.27.0-alpha","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-YN5PiT/8qEqUWTlMRYRY6gRvJHTqiysPmPn6Gb5oL5m7qNj6bCLjSsRIa6562Z8JrpV3YIgYrdBkoOtVNRcjUA==","shasum":"41c481b1ec00d926b8b4605aafccd31c750a9638","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.27.0-alpha.tgz","fileCount":379,"unpackedSize":6059715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHTNJCRA9TVsSAnZWagAAunsP/AokOK5S8c3kuDWvWMV/\nbsdi5VgwCUZ2GIQ+su/JRhKlkMnraLsQKEskINuc9XTUa75lDKMhJk0Ew5rd\ndaPG0IUITGiruVIUBzVX6dbZpmTSMh02I4MTkoIH1fcUFgIX2G4W5dqSAtt0\nP60VoqW/K3Gp5IXboXMO4W9Xwzuxb9bZpSF9q7M+ndbiZeeVKtbSWY1IZpKB\nQMQyANl4FvkRhL6Famiiz58J/udFUMuA8NNMQ4AY8f2/wcMBmAWmHqtYzQ0g\n1Ac4XxaafcRUDOWJ1X1+GnOXf/zJ4rX2DO5YWApBXx7p9c/st+nM10CR7iC1\nJl+qk15nrSBi2Z5Rl3Re+WW3Tzdjus/9tGeaMLTBCBdQK6TZye9GlhWDdAY2\nDXH3YMVFlCjTSIbOYbVBbCy0x0z0vihvEB/rw/eKoF0Fu0IAYwZCbum5m0vs\nndoVJ/wgr3wH7g2fxZgHUm5TD1JRyjbmI9T+9q6t55vq9EKoA8RrJ2rTRikc\nk1ba/vrkS8FyBEHr1NNIAJIg9wlOLX8qJR+yUU5A8Sg20TuXD8nBinE5ALVr\nKuBBoMP3dUWwIWKt2y2+x8GJCHhxSfFcrbXWQR+Cx1ED7Oc5kDy2ucx26yBq\nuQL7mUHR9LUf8thXdyKjH/ydZ1E9WpZrfeL5KhwTbWmZ5JVeptCH5eCQPWXq\nyCsi\r\n=bBja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoKuSQXmMoVYmEaZpsfTtbsfZDy/I0jFzSG+O8kSBpjAiAQI87lDdJUYlIe3YlxKfL+h/bhueW/malTAasZtFqz9A=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.27.0-alpha_1629303624993_0.37012021047586496"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.27.0-alpha2":{"name":"webnative","version":"0.27.0-alpha2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"42e90d2514e51fe4a106c285416fd12fe70a5f76","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.27.0-alpha2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-DcmE3k9iw/ESXwZdUut6WL7FmItvkxV8R/MtbetP9dCg79oRyeMPia3ujsdVzCMPwXZcKr6rGEOk8bG0+KRtaQ==","shasum":"79861bbfa1615f45696ccd44130048cc1db311d8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.27.0-alpha2.tgz","fileCount":375,"unpackedSize":6138727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ6DCCRA9TVsSAnZWagAAgRUP/jyMypBe8WbdRt5+d6d3\nnc0Tv3sCoR7Ela9jseEMDIp1D4eTKtl28zNqF1dw3kh8DDxYKFC8tdv6DhNa\nGISFFr8mCIZNDV+eg9Y5OgwRBMczoqgCdOQk21P4RdTGPHi+P9xbDQVJcXsj\nyxDL7oXsGAKQotuLC2QuFWRsrcsDflTcIlqITaAWhypOQ4gCKvnwQiTaVoGK\nf74BNRlUWXunleO+aPav2UtRDFdcVWoBEciGFm7T/ec/JcQxnXNwU2wU/8oS\nVBHS4GhAWfHLq9i2B0LQidHTHOQCI2Eg63zpg+MN7F26rk+nrobWi2bofyC4\nE3i2NRdYazDGUWSbwowTpqiMlLCJ8zNNCQ4VtKk0Szf/pkPtxviky5VVDf5J\nbiA0Q7uikGEQyT+GujwKGKqd+GbQdgnG3nRbze/FjW7io4rLA/ULmJ/mCb/V\nfUCB8vs9lmPoMh70Xm/6pg2LT3IYt6BErV9PXVrkCwECdFcSFuZMPwJwaq4Z\nIXn2bEp6S7B51i5vPWLQicr2FN/HrS0vl55kvaHoE9+9j10Y43m4eVusMcRP\nicM1WYSQ82PRX+sqIu2v8C3d/LaSS3eLGuHR9XA3b4MMRYihIgS+KJ2vVad5\nHFhWCtpqQ5KfFILnZmahmaNrgQjhUpS2//Oih0vjwmY2jUEu/cYwxz/5u2FQ\nQCm5\r\n=fPiv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBAIzRIyCCLyiWLSw5rfHAG4yMUR3WjT1rJjr51CwKfvAiAnTKtHWtHG0i6Wr8NrowYS5y2mksj+cpCFVlOi62xBUw=="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.27.0-alpha2_1629987009946_0.15243156229233334"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.27.0":{"name":"webnative","version":"0.27.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"26fe276459703f3ddc5e6577334ef0bbf8f74ab1","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.27.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-w1m4a3IGQ5qnKHZwUpCWe+7RIrKd41TydrQDsH8HxkYwpshixtnZpUAV+yfUGIQYOtd30IvX0KT7Aukw97IWNw==","shasum":"57ce57ae295920b24bef045329905831f8f392ae","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.27.0.tgz","fileCount":375,"unpackedSize":6138671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ9uUCRA9TVsSAnZWagAAZTAP/0FbwyTmK17cLOUwzwTv\nffS009zmHH09ZFL6ssup/ILGkBwaV0TzHa+TuJ6wO6SPA5u3AbXDLI4ox/Dx\nhwCiUq5oa6JJ/mfQDfHCrCLg00drBhqS6rJmuJqSA7VKv++dQDKCBcgiUOdh\n4I3SQoJXzajm+y2dCQVYpMrwpX0YfeFVa1PvztmLVK7faPl96D2DuDb9Ayep\nmLQJ8RSjs3SNxSDbTbSO/yPEQsnPihhA+YT1WVSpoAbHh17+WBzV4xsjO6l7\n6kVJ1A5EH1JCNmN/F3lK6opmLDNy1CfU1TPBpCwKY/Cevx6+6C0gvtA5BXc+\nOER6264+YKw/msUxqynXAYouwG1Dt6IWdM3sXsFbaoLDHiTJ8Zun6KhUm7gy\nPqmBgdtSxkbUnkGo8lajuFBDLJjVU09/3mYiqui1dsSZG0vaTt7wtyjDPKyi\n/PrSBWMpYcfsNyi6UAop6AUEi9epWSN8i2a1zgKmjRkaNeO5ACtvrX8zzNny\nUYQRvBnfrV6ZNWNt6rFhjHiSpk5ZomkxmFT3T91pBLLy5dCIS7xcbfi6ed0L\nfyOh0So+jsdG+M5D/0ME1Tp9toAvMEkhXkx1v9FmTpTHrQ4g5ajArVCqRAJP\nLniN14G3f0/udGq5jjjxtjg2PDNhytQ8tuOVcMbI2Z26lwMMpmzcTSVV0TQc\nXhwa\r\n=v7Z3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlq2nZYm1N1jhRVFSy8wuGCmO+VHhxC7fpe7GEuixlDwIhAM5VlgrSQ/WTYALbxe65h0/unksbXZmk4dUVOMp8d2g5"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.27.0_1630002067758_0.7752653627509996"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.28.0-alpha":{"name":"webnative","version":"0.28.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.8","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.14.2","localforage":"^1.9.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"f01069a392b69fed64a87361ea88179a6a38f584","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.28.0-alpha","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-DP1LC339SlwKetg36kwNKAzXhwx/5aeXPilDDtVE6FHj9I/RnRmLkOvlqXRLCshbjnpvrPmEJVa7mUKdAxFkaA==","shasum":"2e6b878189ece1a87d952930414a1018468364b0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.28.0-alpha.tgz","fileCount":375,"unpackedSize":6156571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP2jpCRA9TVsSAnZWagAA6rAP/jvhAp038mPKQ1GWhg78\nf+fv9NOr3p7C7Jca3rFeWkZU0beSd9ryeszvjRjpAO7/3Kf/EZWXEKDx19lt\nJVowY94Qdx308oGVgjUf++dmJXTt9R+q2B92hg1QKWQk5QoYk1Y0mwK3Fa3D\nHQSZHqKamVsfJGVRdWcZtCSGP8kNTZpSs+7Is5unfUasz+x9JDWxUTKiTRBb\nCzow2nmJTH6IvybMcMFeLQfEQMQrzC+DEQh56KWalCC1AKfPHXM+kkV5gcmk\nLZ7e4dLBqM7Jz6Kpk1xBT0TJUaJQfmHjQdEuhmf3ATZL5NYaXDyYFBN8mihh\nAYZg0UJZL2gq6K3YlOhYkIiu5Q2GMlHbs4gDuIO932gV4hrybFJxfRaLlsEO\nEiZrWRQ4bKCeOV2c37P9jVGnHDJamzoQTh0xb1SOv3jcWSevw11abLGHscyT\n19udgdHXMP2VxIWT8s2z7GZ3RxdIu++35FcF/20LVZzR3gsREmab4u7yfIFw\npWp85Gq6z2ZbMPGRvtgawhU9atx2OLZ9g3ZNgGZKRukIUnTpSHswkbHIA9WC\nNNl8NhFdN4JYibGZFbi6kQkQsUHZp/iQFqkOy2qMUHeH9yHL/tQc18anIE+Z\nEvu7dT7mADF+3BETEA4ZTPCi3UH5svdy3GRkb8DYbn4R3qwhmKB9z4Gkj0EW\n8fZx\r\n=nu/1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRlvY2XuMAhcZxlaH7Lp/XFRaMGDlvKBQRGDexLy6GsgIhANN0+DRthzIGOeN6g5dP/qGhqGCifiKeDAbhkphxTaNL"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.28.0-alpha_1631545577424_0.6866185346947569"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.28.0":{"name":"webnative","version":"0.28.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*.js","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.15.0","localforage":"^1.9.0","multiformats":"^9.0.0","noble-ed25519":"^1.2.4","throttle-debounce":"^3.0.1","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"6b15627d34bf45e7be3571ffc6ed5ce8a26029c9","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.28.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-IHahuroHEjmbQqZlNeXw4qr5X/uBEQ3tDZEtyb5fSloUx30S1AQ1FH8IkloAMtkbniNSMcPzfEX/Lu5GF1pi7A==","shasum":"285c5f53b783d19eda52ca4c4befe7f1f2486fa3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.28.0.tgz","fileCount":375,"unpackedSize":5997883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQMDLCRA9TVsSAnZWagAAKjkP+wW6eDCHSBPGJcHx3+pS\nwU3YNAZmV9MvqKVLIBVK1vRazDtPje0sl1STDonkzkWld6rVksdsAKvVMt6i\nOAtfrw7GjLI+mQUNDkDdvpfiGGVIBdWfyYYMqoBv2LoacBAuQXpAp9/XdcaN\nC1qBJu9QkoPnSv5tC0L5ieCNbEclacfMFDUO/OxC4oLlT/C15jjjZ5J0Rpc7\nTrH2mjvNnGYP4JCL90DeJFTnsvyiPCbOXYIUTQ9zOz2/R7r/Fu3IkkD7OD6C\nwRxXlryn/3Tzk0D86JaOD41pzNCsVi7vPbmefCpGcVuViC+DWsxhRScXeOy7\nri4pcds4jiR+q5tmOgw7v9OPzD9FutawjD2cFvxBBcgmCvu1kY+fCulGQLrx\nhOEQuRKJrYi/dugv+qzdAkiLMzAyIc3+6wevINvj9sx4hUEXe6twnTlEZopt\nKchCQKsUiVsSHy1r5ayc1MSih+G/YHw5GVdtwffOtjvcKOOib5E8boUMsVEG\nIMBRa9KcL17lW2SV41VGqFDARxlV/aKDDNAL5kMgfQmS9CvMbr/6JdH515fg\nLt0fNuSZtMSid8xNsuZd8MG3vCo4h25/GY35l+93zh53uw6ejCmz6exywJU7\nWPOYqwe48NKwgcSjIjSiwji4e9g4SzxK41fdwfR+Xh1cyGYsJJQvI9hraXv+\neIRi\r\n=BBva\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlU8L6nU2t7abQbbah+mZJ1ciX4Ow0nt6OJqqgcsHyXAIhAMgqLnws7MWaSl2roDX9LVeAYGV2IDHZJKxc5pRtKLei"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"walkah","email":"walkah@walkah.net"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.28.0_1631633611213_0.021991163846079242"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.28.1-alpha":{"name":"webnative","version":"0.28.1-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"0.15.1-alpha","localforage":"^1.9.0","multiformats":"^9.0.0","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"16af87446f68bf8d3c367a04abeb3f67e57e40a5","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.28.1-alpha","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-wQvGMF7COO6TCX2nYjtcyw0uBPu5WW/7aOHVRnk1S3BT1/K0rJ0Jk7RgLXaaqCZCrpQRNqbBXT28iVa9BmUb0Q==","shasum":"3604f64b49c93a4258d039b1454a743aad5d9084","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.28.1-alpha.tgz","fileCount":375,"unpackedSize":6111738,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcqWwpieqNEiI2R/A9nLLv7Our8001blaxVziaEib2cQIgEUBzCBrlTsR0boyI29VZLyeOqZmLyCCnOoDj7RVgv10="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.28.1-alpha_1632768134255_0.8928688796190403"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.28.1":{"name":"webnative","version":"0.28.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","interface-datastore":"^4.0.1","ipfs-core":"0.8.0","ipfs-core-types":"0.5.2","ipfs-repo":"^9.1.6","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-client.tar.gz","ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.1","localforage":"^1.9.0","multiformats":"^9.0.0","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"resolutions":{"**/ipfs-message-port-protocol":"https://ipfs.runfission.com/ipfs/bafybeigx6q4aezve7my76s5vvfuiinbxtepapqvmjf2jbgrozrut6cjape/p/ipfs-message-port-protocol.tar.gz"},"tsd":{"directory":"lib"},"gitHead":"03f96a3bd4ab5664de47cc136e12a7d0a712acc7","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.28.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-Wshz0U9giP5qdYShk4V8MPNjyDqwIkpOeO9rhQA+v1qzndpHV5QxgLtiK+Sb+QLH33srxKaKePmdHYmIeF7p6w==","shasum":"5589a02945a36e010ba14cfa646be837afa3ec01","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.28.1.tgz","fileCount":375,"unpackedSize":6052125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyGTmth1AzqIE7gWMkp2jOOMdXbei9A+cjKhH+F2i8ywIhAKtwx+6bk+eRGJ8gYccWcDHzzPyhghDfYlRQ7HzVNzcd"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.28.1_1632927179281_0.8518070888179725"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha1":{"name":"webnative","version":"0.30.0-alpha1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.0.2","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.1.0","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.3-alpha1","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.0","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha1","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-KSgINVrNgLvZEiTATN1a0Q+ThcyxIPf/nF5c7Tgkv3M5Odtz1POoHKyLcY+mHg1pA2Nsc1sLnrzUbD3B3DMTLA==","shasum":"459f47fe67d597e9bb74eb2aec087ed62fd0ddd8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha1.tgz","fileCount":375,"unpackedSize":6096570,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6FTYRISqQjXagDB0n8suFI46cn4mO677czV9CSrbg1wIgF+gQRZVBVR7aTuxL5c536cqe/jQO16X6FCQsnXEf9C8="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha1_1634736518256_0.9815233643508852"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha2":{"name":"webnative","version":"0.30.0-alpha2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.3","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.1","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha2","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-gN4Y7dHhtocT4eJZElHz+m7LUF7G4YNwjm0wDNT4ZR28uu4WsDk4QZLpO5OBBDJaiUrkadY6WKFUW/xKHeioyg==","shasum":"f561961cdca08eac0da76380dd63c116c5ce3d6f","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha2.tgz","fileCount":375,"unpackedSize":6064266,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD54OLwXfp33T7WaAzuf9MkWTfdHnEuPm2Ym6kCCjnz2gIhAOcGtojD9HE/y2wmpc4b76UWGdUKVK7XVO3NUeufc1rD"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha2_1635243715985_0.57575447556568"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha3":{"name":"webnative","version":"0.30.0-alpha3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.3","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.1","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha3","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-UxVEPBZggt/5gPdV+Q22I+MFzodJabNoP6SQBIYETPTnabdGP0XDP+APxk6WjQuIfOzZnym359D93L+b+oS3tQ==","shasum":"7b7a5a8e59ebef56e5744ea8de0134270d3b2127","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha3.tgz","fileCount":375,"unpackedSize":6064267,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3kI3E0HaeGkVLtz4cfr+LN0HVu+57WdJQgeVHbPkPFgIhANPg4TssLLXXtgwUEnWQmWi5Z2II5JRG2T1BvZ4e6aUw"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha3_1635261806516_0.9560075206168164"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.29.1":{"name":"webnative","version":"0.29.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.3","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.1","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"gitHead":"924db533a842ab80c8f4e59bf1af4c6296d0ee7c","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.29.1","_nodeVersion":"16.11.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-eugpD6r3RWlbjx0gqs8BWiaACK4q0U+7ni6In3E/wQ3jl81bm8LYuWQIivBfAIh3Ufll6zSQ9W44J7XLaGcgdQ==","shasum":"d42253b97a47d17cd8c277a6f8f13d0ad18b58d7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.29.1.tgz","fileCount":375,"unpackedSize":6073380,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNe+i+izPx//HzNCurU+0uoablFiArDcMcmEYLBIIF7gIhAJmgExHSIsXqyg+wSLP9Cr9B7hX6lKHy1ig1bBxqX5i9"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.29.1_1635497425325_0.5493395679670592"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.29.2":{"name":"webnative","version":"0.29.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"gitHead":"2f8f8d566cb1de01f2d09c173eb23ca6cde89e72","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.29.2","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-9OFWGk1eJw7PU9iF04ZpsFi/IVcLWp1rtUkpDOXZstug98JS3UFNejSSU2I8FBZ/g/q/ARzudZOPwcPLkGN3Fg==","shasum":"674558bafa3915e2af1cb468d3621052354bc975","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.29.2.tgz","fileCount":375,"unpackedSize":6135136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR5hbaD9mVY2IKK+4Tz9OFIV09X0FTjAjzgY339Jt5awIhAMkotcNQdixYghPsUoQ6SAe/MFGzVYh66owy+5A5IR7v"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.29.2_1636538114224_0.09107950845370971"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha4":{"name":"webnative","version":"0.30.0-alpha4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"gitHead":"77d4ac61c8da0a547ab8038a50670b1f666f8f27","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha4","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-tZ2k7B75PxMMVYWcR9Yh7we9QRLl0oDObJaYqsaj8n4akJi+gIlElot/o2lpdSqG2mtRdWbYSeYe76Sm0Xj8Yw==","shasum":"0c49d4d1e1af6580ec9416e1ed02b250acc771c0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha4.tgz","fileCount":377,"unpackedSize":6201526,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPn7yr6n9PKkzvN6QhOkJWAR3CkRrWro91vfWfI9dXaQIhAKttYOiKnZMCdLcJPnsKlDh+j/ffjtvataP8I6x7vuOL"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha4_1636745371827_0.9226159029329677"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha5":{"name":"webnative","version":"0.30.0-alpha5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"6322c840f20e4f3cd6370d2ca5d999cb20b2e837","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha5","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-1s3lvGwjvB3XYaJnsLu5Cpwt6mjFRfpy3wf0NydzTElZOWpj3FJ3rdOxQQpJqV2yAD2IH43ZYTFI/d1TLaN1dw==","shasum":"2a9e5fd8326476282de1fbbc8e07e90aca068ee6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha5.tgz","fileCount":377,"unpackedSize":6201526,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8arajBl9DbF8Ltr4P1OMew+56zyEezvrmNXtIuYliIAiEA8KXQ69V1oXrg7RlyCn0HIWKUTYed091k3/p+08Filmw="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha5_1636745661815_0.08944617601076743"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.29.3":{"name":"webnative","version":"0.29.3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@ipld/car":"^3.1.16","@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"gitHead":"2f8f8d566cb1de01f2d09c173eb23ca6cde89e72","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.29.3","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-x59GbYH3v5YGAJ0iuVr7Esq+hA5jQ3PuCUxBxlZXYyUNBzUpQ24EghsEazHZ6fbznIWr1mmN6RAWu7cQ9pY6Ag==","shasum":"678f572ccc872a14db5b2848c14981ad3eda164a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.29.3.tgz","fileCount":375,"unpackedSize":6075479,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/XiyzyG/xmKtznlbLhruPIp4uUHGRW36PIGfQXL+nDAiEAk8OcQtYYMgZghHq+RgrtMt7q5AHm10gldE/g6OtPA00="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.29.3_1636746114412_0.4196021478555507"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha6":{"name":"webnative","version":"0.30.0-alpha6","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"e6ddc7dbb31aed4a3780b26f2d955348711c4091","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha6","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-qjlKYsWgNINpOQuERXxElsy0WnRKat4dN5eLLFsPvVk8NiWrw1mFcEGUbgCf2ulKT5qLpeXCjG8meh4eIWoaMQ==","shasum":"45682d1fda6397d2b5ddabb1a5be6b8788e83379","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha6.tgz","fileCount":377,"unpackedSize":6202260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnKegCRA9TVsSAnZWagAA4okP/35e/e9vVZnv+XWdePJy\npcVQz4oRtjzMCSVMh8woMs323Np91iTAgzEYXDuU14JSxHdTzgsatQsgAMlS\ncg9JMy+PQZh2cPG0TGelif1lnvQOFrybt4nSH/48Wbi3AB5xzRn0jnTsdbik\nS5d3sAdLxCa/d1DNdiSNy63gL6aQ+MSVPrrJDvOZG4dbV4WFymlxXzwhykZh\nErqTGNf1aY6TGg0tIZDOFVsjy5oY3DdC2AZ1/c6ioZ0jWk/IuA/KhhDisPfM\nuZ/qCjcMKqKBCb6R4IiM5rUoifZ34WniOc3qxnl+8ryQqHI+ZRHDqmcdBl7D\nI3PUSIwWHbLpE83illJs0OQXmgw09OC4kfEe6U4IEm7dFWb4LfL7gp8GH81o\nneohZaapEX/8vgVjnkxN+2MGhmQ55KDks8IUVzixZPYB8Dix/RXIgavj01hY\nOH0ncM7bV24yiW5vSPVnnqRLjRdD0WKSfHf1t5oJHeAfI4rsVaTILSvExJpm\nArzgFPK+bAmEfj7SIkKg9OqF0Dg5bgT7ZkftQLUlh+Jp6l+OV9zu+dQAyRCk\nCBN8/RuCQbICmrhFtqvfWCIji/s8s1sj1jCBUaBXhrDFAHy+6nHW4KuIxRLX\npJlbM6BUDdtBl3zarXYMXkav2SHdEbMHEJyKcP5btzbCW3kAQ3LEm0Kb4kvF\n242g\r\n=z/Hs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtPZ0+a8aX9UzroSBOXv3m/V1Iasz52wKL4Vt+t8dsgAIhANCBdCyKxvmxNy8MNHBnmAEbMEyB0Z3v9sVgdFgc85KA"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha6_1637656480287_0.1831546282807628"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha7":{"name":"webnative","version":"0.30.0-alpha7","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"79bd80ef22b24b2db83e689250256c542523897c","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha7","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-At4mZYV6qco8ZPXuVFGy9/ed1aFyPj+U6owR8Lmy4cAZQo/LaXMZPH6lSBNDsSpA+FvJ5ej91agkIrjdZA8DAQ==","shasum":"6731e29ac8af23d8bab5b682ad196c675cde6ac5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha7.tgz","fileCount":389,"unpackedSize":6383235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsLyKCRA9TVsSAnZWagAADngQAKG2O2QVabj9047v7MxG\nOSB8UD4rX/JHrOR9EoamTO2+dx+2RaGiEwRcSHXBWJYEPvApKJmIncbvcDwC\nU253k83pc2ZdNWi+OIfagxD2BDR9wVVfmviZN/6zUIQp7yXYzldWdMbe8gK4\nT+hnvf7IIV2mODOS8shiptRmyU8tVNFXNr3OaMzbptNQ0MVrergPdM0oa2xh\nwmFMpf+A2Xm8FapwuqHFCQoKsrMOJgkYd8R7KRRGeIqYqp29uJHIjj8m+TJI\nT6cnGoVVJgUWQ2QqByim0UPv9Y/+koz1Pj2GhCitnjYr0t0T3JUTpA3EyR9X\nEih/tGmRcqxiS+KYD8PhpTlxzT17HuIq22GtdhMraHZuBHU4/WZ/fb1NfUsw\n9Yl9d1Jb5bfaUiM6Bbt1etOCBk9gKJilHxVh6+zHQl9kL7Q81pdpWmRr9GdH\nHqgCfYGfUemjaKQr+QuwdblecbBL3eohovL8971P/oo1yuZMYqYafSiX523k\nKcMEe/3CqGe3Kw+19n5abTZvQ93amYObswH/3JFzOFtezm6MdHlX9gjY48as\n4q8fDucPc0yEnQI12CFkZ21qJ2K/wxxbH8rIrprnZkeB5dYWAWQkW5ad4pNZ\n6+Fcx8erl/Q8oKsu4NIp5PeYuxlGnxY/ogOqjEOzCf2Y6IX3OmEDuPNtCt5g\ntKm8\r\n=SX6D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCq0M/W9wvIx2o9lPX8yWF+6z4EqT3jAoQ161lAXrWjXwIgOIg2fwWb0FJpWVAMCSjbUwFje8tCBTKpecknOMOjuPU="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha7_1638972553868_0.48117873978960946"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha8":{"name":"webnative","version":"0.30.0-alpha8","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"b3e33e2bd11a3a10e8af5ccf0bf6b5d36e614787","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha8","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-mFiUEfb+uEEKZgHIc+FSQMVPWEIlUMma/THp9gh8H1Yy43tFOW+16doM+yLlbjbYNqCMUfam9lJ5PYsIjGGyOQ==","shasum":"b8105d9f9ef5b6bbc7fb3f21c1b4a77ca37e2091","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha8.tgz","fileCount":400,"unpackedSize":6480226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsoJbCRA9TVsSAnZWagAAEC4P+QA5f9DJ+y2EpTMqlNOF\n8X4H9hG4HrViMfYgOsapD7uPgcDR151QetuBb0Fi5kWi3YZXDz1XeT+a9iuM\ng7wvHod9u2fxcjGRjDlZ3cWwWzSM+Ymi8Jr0/WY5OGnT9MA6sVNyXN+H+RpM\nXkEQG7719knUYvEYblvyv1lK6Y3SCHk5Ua0k49FKI2IM1kG27lYGXETxN6jf\nIkGznvpqhSHC7hPPTw3kdv4fZdT333+HqeuZNHdyCRR2XOxW9BVEC+UOi1d3\nSV5u0FRm+w2qZaWnx2F4v/4p1aR9MzHIBxBZMiq1491gfuhIvUYemdiVyiey\nT+9lipKckWYb2Sg8zQC3AjuAAg4VQKCY2KINghu1HRQdu9aANbaDmxUFfCzP\nQcrlQ5v5vkSB7+i/QytaM4cG8JF+XeJuPEwDS49IV7oniYHgWINKMnuleRo/\nRNNjHI29cgDWJVPOF7qEnRv9/l0WnSNQQXi7uREYkGsCiK7SwaYwqCnlwYmP\nv8pZ/tpUDCgjo0IMGsURMcE/YMZCuwMo4Rn76X6yNVHwopB6x7gP48CBajlT\nOVcfbjzTZ7LVmkP8r8n5R/RlKBRfzxITgnnLo2nXBQ3HsHl1OOsl+x9Tq+Xe\nEWYJhsFzsCEg0O4mPXWE6T1F0BskzrCRxS258eww8RQpNtKerdE3zeEvq1Ik\nlwiG\r\n=sEK0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZZsWFgJoEbC53p1Qbc/wVxHyCphaOrUQvnkcsny/XNAiAEFjjwi0QQCl1GyXRRNdYiAmLkCqWhIXzEYXux8Uf9cA=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha8_1639088731602_0.09146746426237184"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha9":{"name":"webnative","version":"0.30.0-alpha9","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"b3e33e2bd11a3a10e8af5ccf0bf6b5d36e614787","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha9","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-qp1K+p0FfUmJERcUiTZE+7uMQF76sU5bZ38Isga+LDmr/A63DOeNIzWA/YFlT/A48NG7CWGQWRMaH1jbgtrsDA==","shasum":"99614cf632b857e4fd02f87b800465d4cf6193ec","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha9.tgz","fileCount":400,"unpackedSize":6480084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsokRCRA9TVsSAnZWagAATs8P/3gecT09GZzvtdTWszbd\n7EenuiYqV/sNtBN6Lodk97Y8SJeunPhTALpbUTm94bouksNuJryuWtJc+aoT\nBjz0mJbVkLq64AKKGipS/LIIShcDpOfH0cvHZ9qILff6DyuIQXRlzli2dSOD\nkxHSzy5DbQdN2bChfpOKbPDAEeJpMwsGdpEC61lE1e/YLFRWDKH2fCjKzYaZ\nnK0Yd92OzhwhZpMGlga7TnNxRioyf+1ajgkyIN1RMQFm8Hx9PniZwUD21CQD\n6XXWXQo+UVB3sTmwMXUTodYhDuJWQGNeLn0F/2RzpTnKglDA3B4Ctnn7AHR3\nBGq1ZcSMSmZ80hNmnVlGBwfrgD8FN/7HlbYwtB0r0N1CmSL2TPn+dryat9Lu\nbSR2OSHKXzk8z37WnRiEiOYX/hRryOKbEgEKm1GKoImpCgBHQB8usk9TVdoX\nqWeZcl0CbZrd1XRHHrsju8RqEhyWg127VSjSFLvF2nhtSXkvIrzTrbwQoghw\n8dsDmzgV9HeuYoh1n/NEYCvJ90dSLqtxupDtW9wIwAC8WMmaNgBrJ47C1kmB\nUJi4Twfp6aIGMAKc/sMcG12aT+vWb/GFtb/tt1ekdMf3RQQtUcdDH9pj7w/Y\nunRu+wpudCrC15hk86yKTumAoLOYAIzn5OXec3fFWaYW5wf9OSWLPFFyvSpO\nvMhr\r\n=rUUu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFXKPS/5HWty0wyc9nungAw/OVu3rpCvnMWLyo5UMbTQIhAKa70zsLzx/Rij9bgzGW1BxFJkQQ39uj3IaM5D/fgjdd"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha9_1639090448847_0.7897235931539206"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha10":{"name":"webnative","version":"0.30.0-alpha10","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"01b924f93d2989f629525e8d7b7d99b948a51cc1","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha10","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-Tae6mlo/3ZHHDk1XfYrAuABY+n+E1TjWhh9YO/KJz2VIVHh66fmM4dC5va7gRuetHxdxePOmEzwciR77s/CbZQ==","shasum":"db8816e84c78b6fc9e43cec9155c80ba8f3d9fb3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha10.tgz","fileCount":400,"unpackedSize":6495116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3vWiCRA9TVsSAnZWagAAj6MP/2oB5CPQBQkWFUhC6YPz\nTmly5O+hmzqGohXsIwXsabn9fbAEl2eUzwlhSCN6X3FjEa3bLiPKNcw+W0Xq\n+i4WVOnqS95a3R9h8s36e3xgubPAOKcYWO8GYQbniieV4xSEY645bMvS47Jb\nkia1XvQEYkxKH3FNKPurI92rZqDh3U7YKtYHDUGfT97uWeTtCGpaF0hbAopy\n4CDjIHfdS6L9zoURxwUV8oErINAJsptvEFFJm53HXH8aJfecm0takTyeQNd8\ngUGrbCSlYVZDi2xqXVNgu5qHrHiwlZddAYJdhFgH+VnRWLQfpsEKCeJmovtr\nSEdJInXKQULQ+RPCJCXXjEhUcOhw/A0vO9SKI0imbSjJp+TRysvoCFS1xPKH\nwoQsVYBliQ5arKrLW4VFlsDuzDiLhUfbdJ3P2uJS2/zT4griyedha5jypkTc\n5wmmEsTu3qwwR75xYdrw8ytdp70TvuT7zpNQGVD02okO5VsqtKhAT0OPl3Xc\niY5uiLpMd7+yWL4PesvnwqIgt7aO/J4iPXEG3+wvjl7Xbg+pSfiGmi58pRRA\npqznYNaW2kdOPWEkXsnsVAjW037igwtrgC/p2WGI4d29+nXsEIeOr8Xqh/3T\nCHxxhmbHsOQjEnS2CFualBGnR3TFk3gjIkKt8JUP1pTJXW4p7NCiKHHONEG+\n+ZHo\r\n=G19V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1qAM8tw63tWSdotZOYUeM+aDY5FFf9K3Owy/2kTjgPAiEA8vpl1wcjISmAAGJJJ3dBzRL5EYewqCe/da/NffJ4hK0="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha10_1642001826385_0.41486328117467397"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha11":{"name":"webnative","version":"0.30.0-alpha11","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"0.11.2-rc.2","ipfs-core-types":"0.8.2-rc.2","ipfs-repo":"^13.0.5","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.9.2-rc.2","ipfs-message-port-protocol":"^0.10.2-rc.2","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"3ed9c3f252216e4dde3a2c8155b2e399063d4938","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha11","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-rFNTpZr34b7PZCJkRqhtPyD88BCNht3NoQZbOAxQJjcm/Ebl5lRxbeReVxkAR6PMhzg56eCDgY2XxYhqO1N5mw==","shasum":"2ea6a2253a6938872455faada805fb063d74d7a2","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha11.tgz","fileCount":400,"unpackedSize":6497361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4FWqCRA9TVsSAnZWagAA910QAJksoG29s06Y/sQIrzCj\nQ5tym0G9EGi4ZLC094hUMoyq1UzkC2Rj5ylN1ler4gxwwAoJFb9LL6l6X55B\nSqFaNoO1fVPB2wTk980zbJXBWL+gpDhC/zdqcjFoZdyipGgUO2It0mlXA0ms\nXL3xjhiGkZu4nEwc0DM3qlLw/PaVLZghulWo7bG+A8587f2c4+9TIrBRRyLo\n/fDFPrJn2frhJLWO03syU7f0UXVeaAFUWHS4IOyZhS09Kp02CG8Xi3gjgznn\nGVa6xpUyapT/UPke9/T2zox0NG80bKB86XSoYhaKMogTueQKTXPcGn5AIfZU\n0csZyocd+7Y76W+MwhL+Ctx9qX1PUwUg9A5hwcJWkLbQPEr/H9TZMu/MPG6W\nZt4HhVb8e8WnBLcOeO0jfhxGUOpybvv6LQtkWVGHJo3p/Nv9wKbvlrsDqEeX\nvDhiGgPbHBkA9TXfDCCQ0TJyqmN6wQn7BUKKLl9CPKO+kXzS1eGAXozvu05k\n3a3vyfpJSTtEwu0qfeEOfswpz9d15DO6lYCoTOB2DlOp5sNWCobuzNdxeu+y\nmAUzgTYry5ef2nl+3do+fozeqG9EgMV4xMKtkzvVCLei7Z08hpk4bWsdFfDP\n7RZW1VAdlvH0b2qioVEvryOnXcVwcntoNeOZZ/usuVu1U/mE1gPq9cei5kzI\nWeAw\r\n=IWBW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRUYPlnpuXYVXN34KzgG4uEqBLXncM0PHAiIY171SJBAiAUgFcjnHdrHkGGwk5OKcZEdUJsqdrmA+1OtoZNsAGkfA=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha11_1642091946655_0.4228880691804948"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha12":{"name":"webnative","version":"0.30.0-alpha12","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.0.0","@types/node":"^16.4.1","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","blockstore-core":"^1.0.2","datastore-core":"^6.0.7","esbuild":"^0.12.8","eslint":"^7.27.0","expect":"^27.0.6","fast-check":"^2.14.0","ipfs-core":"^0.12.2","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.0","mocha":"^9.1.3","multihashing-async":"^2.1.2","puppeteer":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.3.1","tslib":"^2.2.0","typedoc":"^0.21.4","typescript":"^4.3.2","yarn":"^1.22.4"},"dependencies":{"@ipld/dag-cbor":"^6.0.10","@ipld/dag-pb":"^2.1.11","cborg":"^1.3.4","cids":"^1.1.6","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.2","keystore-idb":"^0.15.4","localforage":"^1.9.0","multiformats":"^9.4.8","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^0.14.5","uint8arrays":"^2.1.7"},"tsd":{"directory":"lib"},"resolutions":{"multiformats":"^9.4.8"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"ddc6a61d4808b67239700a2504baeb699a150234","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha12","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-toSFIz7fX72XWa8QVQmrR3zQ6PNVER2RHhZni6koTQbp70Q+Y4Wapn3zdEhop7/mhWcfQ9xrQMiaTYV1wyAHQg==","shasum":"46621449473829a239a7ef5cbb1df09dc018a868","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha12.tgz","fileCount":400,"unpackedSize":6497344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5x3qCRA9TVsSAnZWagAAd1cP/3CCmlzpigDRGsBtOwXr\nkY663jrQUmfQCY+ivoc5fb/GpJG3CKdlkXpgk7ZtOhG1yIgAd2j8EDTgB5g9\nF6cbOXpoEtTeaimodInOVKFIKmDfkCpMxSP5eyikCufeypxd4qEr8I4BGe3A\n1ep9TdD/q8BWdC5xVmv7rl0MdWOmzG1U0DdPwWkGXGhx/tJGhsTGPUA4XzKw\nw8kzKQBWzdcw0sBmOVi51egJ1tvEG58tVnJHZ0FoMfe6zvnHAklEbN8TgNd7\nX/8IOKZaOz9k2X+tmMKcazTy49mrGmQy33QWiOoC67HzH0OhgxH+gQw70SG2\n0TvcZYk9rwvfvkjPDU1mrDRo6p7Y2WGe3uScyncNiOW0FURHiwDV0truFY/X\n+Ghaph5hLf4Lv3y/Wrof3sTVwoc2eeqrlQdBnDYCdntPRVaVXRSpyPBzTLYw\n7sG5EG4J3KNKT5yGGcLTyZxEOO1GPccY2+hnsMzOGfFt9TA4+QbWY2HD/Vhy\niDhtk3rNlSrmhlbhL/r0isJYI/7FaKYCS5WJdP8U8k9+mUr0QnDZSwV58UKn\nltZgfYtz0GDHtKtEyIcR1ZJ44ztXhCJGIBqYaEg2liK/ovCNfY+UYwwRyOVr\nJmPuPirnZnl0xQOwvwrKH7ZP8cePyw8DgOx4hBpmaPhM4EKJN5ud2wcFG4xn\n6hwF\r\n=PCe/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKlSn//52Byy35Y2zhDcg8fnBZkEK4W9JvHGNAX984BAiB72gopKWelCY+wENo5FM8qiNJjVQp6GorRonUPswmnnw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha12_1642536425868_0.6164499889126742"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha13":{"name":"webnative","version":"0.30.0-alpha13","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","multihashing-async":"^2.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","cborg":"^1.6.1","cids":"^1.1.9","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"7e9471e2a93c2fcba8bfbe3ff50509cb1a7db91a","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha13","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-1oOQ+WaTbyYl6ldbV6pxHiQbYciqpW4/kkA/cumsJp5uc3QKV7IiNkh/X7KnumqVnK+yKv77JByHXVHIiX9INw==","shasum":"f9234204d4509f1c3539540df13fd341fd539d6a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha13.tgz","fileCount":311,"unpackedSize":4014166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6sTVCRA9TVsSAnZWagAAigsP/0uTb3xCF+TccqpJCp/7\ngePHzapgsdt8lHZAqJLCeDyY4FBo9GjKiH5a4v2ydkwTopU59/tOYLjWTjZc\nYD5E4vpI5nemNd9qqxp/1K7aAGpSFPQ4aXIC/ItLVrN6VN76Oz5gxCsVmldV\nVRLySQ+DBgTGZSCpOcNCJMERKqEdCdzeDb5OWkq9LXixZf97NOq57uDTdboA\nLebPinC/1evTtL3N/VRJvJdZ6T9yELT7aepH4LKj3jF31k/v9CcVSmC17pWL\n9Y0lBFVhs947aJTOKw4jANVMXmSnxNYQeu9Hv7q+LUOhKTjwg6y34nFdw1K2\nqw8WVOVx1OYZ6nbnNAjcXrDZqwRZHD6NGesko1VuwVxCFguqPIdSWxHdOJUU\n7zm2r8MOhDXQ2keJs2ZjnKwsUuAhN9+raF28CHve6QHXjSQvbpK548c1CM9X\nJEGdYd8Y3AUFbvGf8KIAKm6GXdqOyLkmhbVpkan7905I2lnvcfilRZZDB3H2\nOu5wbxKeO9zqMeCMJS4NEa2CsEFrkj5tR2QGR5pZ0J13cHefgVBi8inYlhac\nDFJdUsWnXVJtarR9oUrUmQ0rWNUjsrQUQQ5gOYSPmg4eIBtm5MoAEW1wQlQo\nQjcpP6ghVNKaJC9cMhaVQFuzg38iI/vJbWPsvysl2NgjSf2bA1+E5YRUrFDP\nRZRM\r\n=/nTR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDON3cZkGskQfbhlg6tY5IqHMxYxoVp5+sGHOuaCojMjwIgRMtMCZ5a+lpi0DgDHk9Z6xWJwtGI2klPSQdaNrHVIkY="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha13_1642775765315_0.6259910414439325"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha14":{"name":"webnative","version":"0.30.0-alpha14","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"48e778415bdd4089d3440e80f93688078677d2a3","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha14","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-iLpOWiJYdVP+TK1K4I6Leb9AQ4GvsDKwD5B/D7CRreWahq+uPIDRUSkV+BJc2FECzpsiKh+JPWuHj6pHBXxx8g==","shasum":"ffbcc7e5757dd2419fd1708f2e38b5c2660dd3ee","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha14.tgz","fileCount":311,"unpackedSize":4014054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6tB1CRA9TVsSAnZWagAAKm8P/3PiJJpsDiOGYDOo6WuX\nWuGZl9yilmck988+PE26k3cqFwmHGLy2qV28VmF1g8nrp6bVvmHidiEnF0VA\nPz030UtIa1kW7e8STMuonvSnhDGUd/o/JVYDEsNkBi4ySx3kquZYHdbIvzd/\nAJhyiLncoW56FMR6qH+4IvQI1DR4mV3jdlSvoXBVLzzjbdIAWulG5u43ujNT\nYNt1STSTWA8VOYhH7N/p/zez7wezYousF8m+JSffh+47peTYRTeJkuIX5Yhg\n8DVmG7ncv98jNWRKBKt48h2xS7L7fSWEi5MQXl6lLIHT67ywNBlh1oPECaMt\ntpyk5AMHPImiGlD4s3MjtDBTmziPlFgfwfNV4qkZ5kN7v6OYQWHCY5Mbd9MX\nxz/V8z+F4ureIK1kbChfLdCFCbE1eUmtHmcYmGYOZ3zndhUSG+p6A4XS02rB\nxITJBfXDl6oMnS1zHjmAqUubcPjHgUsmlXkFypU+XNEczYh++h4efJEezDI1\npbALeAhZlqWPe1y4JRCyzHDgwwq9QZh6Cgx8UBFXPUoQZ0IYc9r920Rss35K\nX2T+22UAnBQCPE3pdyzqDh7wAQeEEQDlj+SorAvH9ukbhe88ZqK1Rq5svDv5\nLXEZ3oEjLx2NL7pm+VflJfSxF8UStx3h0Ocuiev+ZoINSZj1+b04E1NQNajk\n05v1\r\n=Kwkb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKlAX7RNwk9tY9+lMKj1Qo8JSeoN+SVhHVqOe7zoZe/AiAC8EYADmuIci/izk7VlMVU0M6L2X+ytMnuCCQQcpQ7/Q=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha14_1642778740884_0.2385473920851262"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0-alpha15":{"name":"webnative","version":"0.30.0-alpha15","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"0f8e419d20fdd0516cb82afc822eed3bce8e4472","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0-alpha15","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-JgTHB7fWsTBVUy5oiUh1CN0akjp39km5GMu93MGyIHM0xaJmU9giomz8uZbeHWFC2+0JB44k2dzU5uDwsDFKeA==","shasum":"7fb5901d1ef226e15e5ced4c0261bf502b3bf9b4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0-alpha15.tgz","fileCount":311,"unpackedSize":3966830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7+DyCRA9TVsSAnZWagAAHKkQAJ3EmQkjAG5GISMsGx/1\nzNLcvyrz7CLThEQlBqfm7FI4wOc6vEldn4O4TgSWmqClgw8tZ6pxBfwUxTsA\nHDn5eSh8qCQ9Ks63jR4uDIR1/fXeqv0V2MQ9pHlCt4hBYXrMmhRmpkLVNJ0k\nzw2uN2Z8HFiplirZZuQxsVtccmmu02tXv5PMDmCPXld69b4QwmUZfZFKjxE0\nD6QlFRiunqm45+7S2YCz412h0isEnxOgv6HE9Q55VVjNJS1zYjL73GLmHsNM\nMg4+/1TNfBQKWXHzpKhedk0aV0CreAimHLcRabF3VYtwOFrCeX/rubyeLzL3\nUVqxkpHL1jVE0mV4pdhuwmMJq45xhwcQXAzOh1j/+k7Lg8wz3zTGCnE+GZuN\n+EJGfYZQ7HvVRNbN9nNln+eEJ/GCGJNT4qLKx/DRFDXfsgQzZBfNWh9O0K42\nb7DjPY6lfG0EHp1em3xNDBxiZ1TDhGn/UdkLHF5biUDjI/AxJCDbXDAgXv+4\nMrqS5Sm4kBoWnj634QPGqhW5+cNAG6cwyhSIdzo/IYJ7LnbyDzdUSMJ4nDeZ\nN3pA03DT7mcZjf6QtmiKp3qP3Cpkdhk3ojpaMXorVbP5/pJUuqhuEJhDXHkA\n3qim6nUcOQu/naP04dn+h40BzWwEsGxDCKyhMcMqFCMxdR+mtCnV+jtJOe97\nj4Nl\r\n=9xml\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElG0UM0DqEbRIsYnFJOhJ/+tdsBpNWizUxX4eXRzlLmAiBGYreb2oLxHz7rh1cELrwZwY8GltnQV+NDJcSnrSk2gw=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0-alpha15_1643110642625_0.3031037501607352"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.0":{"name":"webnative","version":"0.30.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:prod":"yarn run build && yarn run lint && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"gitHead":"4da6c1c549889bb87e605eec5a821c3f2dc0a176","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.0","_nodeVersion":"17.3.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-a7Axo90SJUw5b7h7ViN+Q5Le8JTQZCwYBohFYr6FXE1c3LcWCMb+UJNxiONW5Wba0eOF7YPiUqNRdTGvD8/L0w==","shasum":"6843f8044f9c34cce108771e2f2d8eb74cc28880","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.0.tgz","fileCount":311,"unpackedSize":3966749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8ScsCRA9TVsSAnZWagAAcVAP/AvMQtLv1z+5140HrjXI\nw1pwNTaojNnbVDMRIeJmCUhor1aQg2zALCD3BS4oZ8zAhrc/QQjg1pcoxxiQ\nkrfu1vt9uDPWcn7EbLqRUOlSW5MU+uyQAiCVN3VgPoC3PEFOQ9byxexq/6Nj\nrFVzl8VX4gtGJsDJKWu+GDrW85W0cyIblkyAOG2z9fYMaAs34/TvjQR8S6Nv\nB+4EUaXT3grUkpcXMd1k+b/v3vFFHGNbi4FgSHLL6JymcD0Z23/VOOoKpF/r\nYCCTWZ+QsxXBZ8u1PVScm+DtP31d+8Ssc556moJ7Ry0khlWMKFlQZwOghDXU\n+ULAT8mgnbjJ6q63+PNEEiqp3ZrE3nqYZuMCg9bg6ScgfRl6aptGIIG9J0tZ\n1eEbSPlJ9qw9+wV3moa/KDbSRn0ZzlL2F2N+xtMF+G09TU+iPhb6lL6LGFsy\nfBsbwMh1y/YsPYzVzXNWaJzRIwKE6P+BVNKPciucJXvM3snTWp+b0ohWT3rv\numcNtsPTGN9OzPT0r9CA8Ak/SaLzqF1VWtkFfNgFPQdCRcggFJTcM9Aaxg8e\nP3O+OsHvP/DGSvmgzsiyTYttVLB7zHXgzM7nKeWxvHg493FWfcM5jCX2vTSP\ndeYEj84omXlfVQ6wZV3WucTrLZ0GxggP78QWJJfxWKZfDM2bADMJlltrVRQa\n7Lu2\r\n=/1eh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpkVeVS6W4iBNWSWG8IB3Z1fd4dLa7VhYAhgBCgnNusQIgHM5l3AjCKv1KqOpESJRKKAAVBIh3WEvdRlaqruCiAb0="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.0_1643194156135_0.8748140066422396"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.1-alpha":{"name":"webnative","version":"0.30.1-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","madge":"^5.0.1","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","typedoc-plugin-missing-exports":"^0.22.6","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"d6e8f49797c99f18718e23bb5f2dc9a7b1b00ecf","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.1-alpha","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-gUqBBUCiuVizb4XaDtbo3FDsue4aVes0EZ1q3lZBslIzh6jSc1v+64Yn0k1JGnqdXvg6Wexe+Tq7shAn6idfEA==","shasum":"a02a47bb344d1d5aaf6d169acf22ae60264710c4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.1-alpha.tgz","fileCount":357,"unpackedSize":5211396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9AuNCRA9TVsSAnZWagAAvcIP/2+71A1rzm+6a4vRCrHY\nbG0wazQcJe6BTWwmZLpPA9FpegxacT+l7kHnbfBUcU5zArnJRb4f5MVrgD20\nb/VsMT82gQC/WvpvQS+PEdEbxCTc6HoyQq827KHgvevIPiSVGQ9ZFUhzdhT5\n1m6Q6Z3l+u/z3u7itAfwurcerP9xqdrKQuUPabpzL+3ZOBRz6FQ5We+jI84M\nqypxJetVhjXyXVMbnDilyTS+8xlYaf9j0snqE3sTADzlpOE8SLHhRMISoRc9\nsBsGeOqaAnncKWhlW5debklC20zNT/hE4YAxWtg0e1fvG87Ag6bxyNNrpIsc\ni2VBDi1GduRDvA7mZ2sShBsrDNLTnHME1cyPezK4R37LSuherJTLLk5I18M7\nF5IHDKBlhDTY6+C2hul/xaZhyKxcomteCgQc3a/n8Acw81vh5E2iP0WCTHsw\n4v9q6KM3/17ggZZtiQxA8V/EL1daOCJ+mrmb+cwMUYrSAEw8gSBOxZ1N8I69\nmZed3SkLo8I0dT3qQI+297OefbUdahfRWBFAaBooIwD1vH8kkgL1K5U3t/nE\nKgsUbY5yqUGfx4XSUe0E5bUoU1BOCliS0cevCGt6hYmgtZcAkgVLhhsCTWmZ\nS5x443SusaBa+FuMy0eI+8QxC8bV4f9y/GKTdSJQI/9pd13OQWTpY4RLiXwr\nTWEN\r\n=mLuo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCblgI/SF2xQikzAp46kPMSyYd6J7Kt7Kk9jJiYXTIlKwIhAJquJ2brdsvoGF9xd89OqoIw+zY/YqcRfYDqQh7FvoVS"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.1-alpha_1643383693483_0.2192767555673858"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.1-alpha-2":{"name":"webnative","version":"0.30.1-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","madge":"^5.0.1","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","typedoc-plugin-missing-exports":"^0.22.6","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"d6e8f49797c99f18718e23bb5f2dc9a7b1b00ecf","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.1-alpha-2","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-CRUwwMhKikmqtiUx4JI9ql2EtA3bhc4beRf2spxsDir0sWPCVEnf7Ufe5rPRDyXKWQmrzwZ+coRQ3Qg0FtXAlw==","shasum":"6522f1d24c2f3a08314a27d37ccbc5d11b336729","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.1-alpha-2.tgz","fileCount":358,"unpackedSize":5215906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9A1iCRA9TVsSAnZWagAAjh0P/3QiztfkFk7aZUIeQCQb\nUXgsqUugTVIDXbO1qiQTD54Mau3x4HLfoXhKQsOOjchvqnzAtGBnZaZb/0lE\nR/XkA2aRNYDc++8fdRYXDUZMc+AEtxWCGDc3bXrzMZcqUATuMO9Ws7z5vm+Y\nuNsdA8Xnn8lQMg5IJRPRDCpWcFQh04BBfvFksYVJB2CxXVyllje80u2UflV/\nXU05OjorXPYsOpS49l2KMdjJPPxUPNw3C+w4sMpGNaS5SofrKet/rKRPcIv2\nEcqgb2GTtNklv4R5WOW2oaGt4DyhhIR1rhZN1bR9kk2g9jFXVu4R8U1XthWt\nAYAITD5iMfI39ar4AT7uABNuBMuDs/pnfX7KgOx/1kvb/6WaBtQpAgT2L1T0\nz60txW+VTdaNJ8bFfOpBj3APUv0HFMpc2VQHYZbXU7vVpUWsd45VcTxI6r7E\nURF1Q1gH2TrBr6OUG5+kMavQK9+mDbHMH4qwMfwRl9ItKsRkwK57b0qonRXM\nV+CQWbLGEBpNix0eEgzZB8uhzOSSANAgOjhMVMWGqRyXJq/VBr2UZW2cdF42\nD749A591bJfqA4qZnQRPxKdDo5cY3GkSpmrK0m+jEiuFMOm+u61T5eZk6+S/\nSSSbv4Fcw1e2n2mfkiD1GQVVaRRbeTKsCnKtzvRhOQzCxCCXU1SPM2crGrWh\nf49G\r\n=CwM/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRUc5P7eVXboeeX27VGORl1h8Cv4xXnz1xDeKEZ6C3WwIhAKNdtKT7bd4JBjlZbZdDj57ylAIQsMvVRtzE/l7/L1fO"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.1-alpha-2_1643384162423_0.03318845244591473"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.30.1-alpha-3":{"name":"webnative","version":"0.30.1-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","madge":"^5.0.1","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","typedoc-plugin-missing-exports":"^0.22.6","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"d6e8f49797c99f18718e23bb5f2dc9a7b1b00ecf","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.30.1-alpha-3","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-xUNRrh9pBdDiHypOZ2WiiVi9FRmNYAipgsF9rWHeSIW+iIJ5tPxkhK5+vp42JCj3BYmMpjuegP6UcsIkVrdlbQ==","shasum":"cc718a4ae1e325bf6b2b4cdd766e248cd922e4b5","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.30.1-alpha-3.tgz","fileCount":359,"unpackedSize":5224852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9A3tCRA9TVsSAnZWagAAB9gP/32OJ1RXFQO9tOIhli63\nlOOPGHP1jHSGVPCuJB2LQafsaCAoA/X76aiPOSYYmiAOaBEBgWwPbRxQQf2R\nvYZx/Ir3C6wJqKgw+OmUL8NzPPIk4sj4LnUD7XxLsh5R5Jy9+7t7o16/m4m4\n7WqDE2v7akqRWs6GS+/gsy7NiKAWhQHi3+CWzwbH5ZELqgQqTDCmfGrPLLAu\nOtjgiE71U8l+DXW4eIHsktMgB73iqQlps/sVzDKw2zVEbzbxmWJk6u0MpeDZ\nOQnN7ehoCgLftAFdinVnvwcRu2x6GArBXPHkAekor/BWrY12OSWFtrM4HxbP\nPSXwjnIiC6vNdvC891EKuLyV5X6L2KN2eBXXdfT66AuhoVdD2w0orgwwqUZm\n5NSzbs/KR3jrdVCtuTnfRiMSbePjyH2NoYdD/2jYvEJL+VNocD1PWVEYIBjT\n8AEnBJIjJ5iXG3nvJ/7rLcwNWYE0xOg6BXVuHO/72+ASMJgE1fxu5uuoWNrq\nXJg2m/PYHNtZarw6GIhUQ5GhOMr82cGhJs/tzJYWGx/Hm4wpxBzL4jIaSzBM\nyOc636c9LihCaRAewBSYx3IWRCaOqLmnVEjmnuSqXoeQVseiFm5mOxHdeffP\njWjn+0X5IAV1EwB4MH0AnUQSf6lhTFGG/jYFIkRNPidAV026oESFyEo2Z/uN\nD6oS\r\n=64Ku\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHV04W/5OfXQJ63NlY/0waInX5pnu3LEP5SQczNa6xedAiBWnIc0bJJxB8+Ostuvl2MycQ05sSeRrEf9LJ1JFWAHHQ=="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.30.1-alpha-3_1643384301762_0.09774188793941385"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.31.0-alpha":{"name":"webnative","version":"0.31.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","madge":"^5.0.1","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","typedoc-plugin-missing-exports":"^0.22.6","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"1d8273c350af17f27baf9fe61bb3361202de6755","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.31.0-alpha","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-ig3iu6IJjigvOhBqdH/A3zpfNurKWNYzqE4tRd3Z/874wCa4vEl6gWA2/bxHq1ZFwmvSlDZU4nNBCV86nBUdwQ==","shasum":"21cb12a3461e5b1ec2fa4215f12568bdb3594394","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.31.0-alpha.tgz","fileCount":359,"unpackedSize":5224828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9BHsCRA9TVsSAnZWagAASRAP/RcHjGfvfbWLYlWU9CMj\nMopM8/TAIY5uD5MRHr+OdZeWgA904XMjtkyz3N0FUax0fVkpBWAQxnSD1gfh\nPWrz3LunyqP9QXz/HUusDDY5CbtwQ2df1hJBZkQJuTwiH/tk+rNHrxYPjy+Y\ng2lMlYfOvOgTnQlcrKi3hB/5ioFge7voIQs/usZssjPFzjJqOVor63a3MtrK\nOUZ0it6+5+N62y8Fp8OZDPJcpCig70O3lQFoFwjlixa5UK11pzSX2r02blV/\n6m4+n0PtZ0YvEmJVB4AaqitIdzTSvqqb0vBdEoxHv46QYfqkUdwY2HfOqa2l\nx/TkxxM/Hkac+Wd2qkKaJbQkpc94NhQQDMBbHjvMAlNuvEHRXLz5qugOPa5G\nlq/J22THIMnR5Tyi0KjERjD9Lqt6R16jB/v09x8f3di9kGMVmaR9BFg+F88W\nHrRruzADLafZMixUwu+k4O1ZCcvLNWnInH1w7d6CMkW69+0dCg1xczHN+BPt\nCwPvbQrjmZmiBbENXCLklQMksCRRCVgnxLJJJJLfWPqBXhNszFl1DkIV6m2c\nZPnIbChgRSt3aeHqUHiG52RxHM6mg8kH7t6blaBtjpK3aGnc9sWBF8ZU4JbW\nEuHtgysgvUwcO+DQJeGZ/S0c/XRPPfCcqSA4MBRbTAczufnwjhPVP/fBTyO3\nWeij\r\n=jaLV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwPlnTsEw+OqxIddLH2bSI4MGZ7Oozi8Ujg4uS06j0bQIhAOuA7xWn3oglnSqyV7kBrZUL21v4g3ZTLDTY3sT7eCk3"}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.31.0-alpha_1643385323864_0.23374284143822877"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.31.0":{"name":"webnative","version":"0.31.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","madge":"^5.0.1","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","typedoc-plugin-missing-exports":"^0.22.6","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"gitHead":"48798ee526ef77c45fdb495077a49e5b5d62daa8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.31.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-8XcCkivsGTsAzyI/uQaO4GOdGldIWoRMPTlcGvGU4KKQ+6s3NH5v8PXPBjipU7UBbVZl+plBxGwaJpXInuef3Q==","shasum":"6d97c8b31bfda038382444389248ef398caa8e51","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.31.0.tgz","fileCount":359,"unpackedSize":5226410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9D9lCRA9TVsSAnZWagAA+sEQAJJxo2Pr6c7EP23GKPZX\n/Qf1TXxccEPZJcAMb78Iue6PqlUGONTcibLyhoc7L+a4GGt/rV6Uf5nR6MxD\n0FX4u+HN0UnSbuJNNtWulqhrhZCBAfaIAmY8piwh87mzTeqOuhqRUaI4ExBq\nk3sjit2U5BuZyYLuX43yoT+afvDRhpxlbVJopNPvWjEXfohOfK+MJv4lF6pG\nnvacbZwAujZ73JRkbXH09Rq2WSzrFrFXcz2ssl4wFhSnhLwXKzM7pzYvXCRd\nYLh7nYgWon1inwCezI2ZzcpzK9Sj8O75Lloot8OvGIXmZP7NQd/nVnWOQTE6\nM0qu5hJJWwYVfBYgikgSa22KksvRaDtJuqIO2x36K/yKeihu7dleHt+QKG72\nMiw0p8OeBfatvXfcII7t0R6630/vLkDbHj0bWS7Fq+LgYuln+l2tyr3dJTaq\ng4GiLde5QHxCQeFZng69R6BDba2Rz4RnM5wMa2yTpGYAreh+4Nlb1cVvNAa+\niaUC2bPtrcrpBZZTAfC+AZIvuo3ZOOJNROL/pS2xgg/r+tUhsUBleF3sQVsM\nuCuz9BUTduwrKAOgi3ysUowfONwam7RyLbHOeCvdyj+E77dCPY362SoPqfg+\n2yYLoGMA5CRgGX49nWs3UmuppobDRyH8jaSoLkmkHQGR3f4IrNk1xuy/BnXJ\n+bZD\r\n=rbzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBv9vxlSlaRvWsJoKP6CUlEK9mwj83NdEwUtK3fvcHdSAiEApZtxebb3U3INhQXJXVX4cJReiOTL7Q0O8WafTSSPX+w="}]},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.31.0_1643396964864_0.12094049212016555"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.31.1":{"name":"webnative","version":"0.31.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.13.0","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.4","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"gitHead":"b418573a35bb7cbb7ccfd2d772d3d1f32dc18341","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.31.1","_nodeVersion":"17.3.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-lkvAyy7MTMp3Yg+WgkjG508iCtwrVPmCSjQxxegLh0C15x4qO//28QYX7sFVPm8uFLST8B7EP8XLbThofKfnAg==","shasum":"4fecef1df6fb1e00ef766936e856c772f4cfa7ed","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.31.1.tgz","fileCount":359,"unpackedSize":5226519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh99LGCRA9TVsSAnZWagAAw/wQAI0Sq2Lbn3XzMzEIpJ88\nGcB+R2WXB2IMtFQAIpqEwqyfxUrqR5aqK1XlHzDxacSwzkUChhEP8cnKgeMS\ncxWdGa6QfCvSLy52f8J4mVd1uqPTD+hFQ2eONVQ/oXgAGFRGQUXpZ0uh2akB\nPdOrvbqyI9DK/Da/IPzBJRLAlraEkkE518NxdXt4okS9rpsvcrrXzb5fV76j\nz02JvHm9NO/NgWVKWBRrmPHOO8cF7BqysDLm7wewDPXLbsOKARaCwmVGKsAP\nOkp0gUdbPC+drUlt4vPg/w0i7ZxYNTuwB3QyJUHJGhKwINSCWtiLwuzz6HdZ\nJ8r/jxxNAYTz92VpDGqOKWNSxz6z3lRxbU2YLY0O7Qk0x3cWu9B3RrmyfPUT\nHqdUckeP8dTap5JtPhdSFTvaSqWKkrBNfwoT9JFOpnUbTIw70N0XBwlIepEM\nC1OTARrM/CR6DHP7+CWR4P5OvuSBNM0HEsLCmJCjXyiE5CuOb234ZgIDe/W2\naJbjbHtwQ42QokXtAicIjnWqC/HeDmjx1Kw7QOAmXTYG7ToGxhvn8Q/tC/q5\nAdnJ3JE2u4t8oQstGzuI22/T75gUfObU9Mp7qWtKFp/5mvtnmYjpqoVa2GWj\n7sRG7avkx1SlkDbW/E00C5ujji+nzFAXx2QDp1yCJ8EMYtId56WHu5s+Wm4s\nAdoe\r\n=hHAl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLeqoSsBHLfcI9R1IIObLokrrK781TgfnfmJhSdu9EfAIge0KHLRDtl+qlbBcfPdZoxtR3aRsWo0rjnQLw6821t8I="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.31.1_1643631301900_0.5075590770708709"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.32.0-alpha":{"name":"webnative","version":"0.32.0-alpha","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.2","ipfs-core-types":"^0.9.0","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.10.3","ipfs-message-port-protocol":"^0.10.5","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"308362aab0bca65168938df19974fad86c848b5e","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.32.0-alpha","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Y8vke2oa+3elJ8+ClFcIYh+IxfAr/2ziqeKllxRagr8jpOx9OAh2UFfD8dZWobPGh+I/A5SKQP93kaHTYOtXkQ==","shasum":"97cb68cec7edbeb9d5a961bbc52f4f601d8ce336","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.32.0-alpha.tgz","fileCount":380,"unpackedSize":5508205,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwIHzbij0Tx5EEaLzlRhaEP5MkWnZDoysVPkpS9KQKCQIgUi0VwyS4VpD05re+3JGq3cVVByETKbWvNAhzXrclC70="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicTuSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppHA/5AWb/eMWvqHX1kHq7CTdguqk4az/Sp3KhdzPT60ZD7v+cJTMG\r\nDMFKuhAGJKJo2PCYvdHjPWRSlvc4viUecM1QYhNWgQ0JF7cBtoQwXj7Qh1R3\r\ndd0sOGsfihtt1N896mvymUho8+oGeWQ/7zbtG3jby9GfMADz0+1xIWFoY3tt\r\nqec4bEFqQ1svHe8u4E2bYZ1Nd7vxPMCSyvjkHao+XvDy/mpocsZe6XheeiKY\r\n6bW5oIQDEq9W9qyMg44gkcc87c5jAkMkXMs7jWvXkidXmAccv68SXn7oHqgR\r\n3ymgyQGqoZaKG9BAh8PKtJwRuA5iSFWDAFOCooa1hqNRnjoEsoTTe+abt728\r\nhG7q4oGMHvpMSo3h2VwFhouCMAo3w03yqiv+k1WV7Iu/+FHhE2kDkZ3MAAQY\r\nD3FF990ipRas5bKRfurWrIqPr2+5q/KVJUiEoT+UY4sceljG1XTGFUPTkBb1\r\n8CGYp9OWQbStZxZ5coCrvAovPcRQ55YNzpOwhuyYmxBTF9sxVXBIGpeEUUyG\r\nDE8HikCGpZ5hS4dpAOWLfgkr8k4kCgkZ049BMvqbD1GBQGnnjrSC6QlUbHW1\r\n1zqziflnu9fUIUTtnK1/J0Hh8EKjByv1PeAxon1HGxpUXfnGvJAHt+TCagyV\r\nsbxVpMYkvPE6q3hcNa4vNB+Yy8dTALzUyUY=\r\n=kYdk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.32.0-alpha_1651587986103_0.5255785061641691"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.32.0-alpha-2":{"name":"webnative","version":"0.32.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"773f25fe298685ccb6a603fb56f4bc8bf3f3e775","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.32.0-alpha-2","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-TF2pvhyiF8T2LpFHD3GsF0iSh4E3dwIE2eseUpbgt+2tYD6/D6ni689e8PHyMvbfy0nk7n74MtF5RqgrPqwVlQ==","shasum":"906d59922e55c0154b31298df5eca0595d3c3ff3","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.32.0-alpha-2.tgz","fileCount":380,"unpackedSize":5508277,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzL0LcLAZtg499HyHm5erWPeaXvmyrMKUp3VPZSnbkEAiACYT8mLsFhwHUUyWloITrPa75Gusj2BC1wjsIGW0CUQw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicV2MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmob3BAAlsXOxZBCtFlGyuKkGbXalwoeKqWH0P2nvAAh2XqCV4F+VB6R\r\nNBeTR+I6UPfWZmsd1Ke7ViTmdpf8MLN/TWACn+8ocNgUqym7z0O5F2R4PF62\r\nGhWg7DrWBmhXDoi8I1mZ1MFHV+ltWdz2UAEzq+jVp94KxHzAnSQ3RMwa1Ku+\r\nee2UFVtKdWpsdH53WqFT0Umg3YhgMZSW6P3p9MKDGZ+8sz/ON2zbHaypUC+X\r\nb5sufPm+UliHvIWYZssqD/CwTieR1/poPJadeOJjmD+RH+AZYmmRQtSil8YC\r\nzFjEwLBTujPl9ZxGkLmdLS2jI6UHyu2MUrKcFFJH1L0rwVMn7HAvBbMKm7EW\r\nXjtUaFVAAIiirfN9bZCFVDGQJ07yHwV4FaH+l4GDgg7zYoTaVfg+Z2gSXJlV\r\nlzzPtqPJLyJTY2cD2cOCBQcTyYxyXszRJiTq+eWF9OtZ3ltBCpwVEBhS7Fgl\r\nrBj3nhA/+WULOV1bxNGq1gFWaYDymFGvGlzdkRH3BRi0eN3GUxN9FfH93/aK\r\n8lzYGSqBVRAaAideDvsuLreoaywLLvcMv8zd9mmjzUTDpdt6YJLjpKnXq80s\r\nW+L3YfamfYaMUubAOnmh7YGRJdRe5dTfyrkzPBokvxT8Zj5mfUn20LAMeORi\r\n5ixSIN16tCbZC6gOsZKMUafN2RpXoRY208o=\r\n=pp79\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.32.0-alpha-2_1651596684660_0.09021777893498828"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.32.0":{"name":"webnative","version":"0.32.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"gitHead":"773f25fe298685ccb6a603fb56f4bc8bf3f3e775","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.32.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Oz7+WVakUFuMeIivfsCPGTOSaSHS34MM75EaXTL1G3AHIItHfJq67gwoEhSMgYcia7eM7zEx5HS8hmIhYgbTUg==","shasum":"f7c364adbb1123395d9b832c3084843b73efba95","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.32.0.tgz","fileCount":380,"unpackedSize":5508197,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHe9Tiqwi5crG6KqTwAaomPgSvQvg98Ilm32lB7knEneAiEAx/HsSwe0Tw/3c7zSJZ75/RMZNY7V83PebVj5K2vf6lc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicnmVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoARw//SUrJYusi3tNiaqUq0J3rbLm+U0KHoYzFKYFKckaSyiJ/38Ip\r\nMRWGy8n7L6/5WHLl073hhmkK9LDm723KgcbMHRxNhmmI1XkIKpIcCQVT8E5h\r\nysaji513a4mhEXqnZHk6Saxm0GZnR7FGU9opJJDCa8ruy9mko+iuGzheVsBO\r\n1HWv5DgpInC6Ze7wcS18GLFBOJJtooldRrQfaw60BPoVbZYW0LZKODWPHP+k\r\nc6xrKRgOxoQoON0YsPknvP002ZmzhUBvQ4lMfiC9waq8AV3RA6tdgZcpb1Qr\r\nBPDN2jFIQ0EsrhqpBepS+AvNuNzolQp2yh/8Nlf1tnum7jBMiDqqg2EgE8l0\r\nEySHDE8A0AyPgOhlGmjQY5JB+IhOfE44a8Oi0sV4AyKamSUsPb8eaoab6IoT\r\nmq7ypVPKC9n2hyFkWrJ2NL5DD4R9Ns7oaT7QRwDz0vJrzums8cUa7X30fUsR\r\nKP3tALPF9CN7FpkkpFz0Zrzdf34najbK2SdK7ASpjRbYXyEuODc2hJ0dvV3R\r\nivZoRDdEJHaeyhUgoCEfCD26BnhVm4RET2R2LLWRmJ9TU7anxMqEkcgxVPgB\r\nCbsUCeZbRKby4aOh8Yx+VYPKBncvoCS/8uBZUH6Pjp6HMbYqpDNSUp8Hbh48\r\nbwT5G0PXzXc3qPmiiiJFAenymReiCLLuGv8=\r\n=jnGG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.32.0_1651669397457_0.6454359745710463"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-1":{"name":"webnative","version":"0.33.0-alpha-1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"4a7311bea1b42aa52da0979d892554cbc788ae44","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-1","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-g5xg5gkDScTre5IrhcJgWhEgYlI/pri2OTxZxLq832cqgu42gJ9Jzs7B+hgSEDHWB+ROQWCe+RJ9H0dlhTKORw==","shasum":"90ce95147791860cf603eb15c9f1cb95fd138048","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-1.tgz","fileCount":383,"unpackedSize":5539738,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsemJnEtgizHRiXYmCzyZD10KYAy/82nm9Gz+aNDKX1AiEA7dVuPtl4Nz4y4LD6UsJMdSm3qIYZKLO6knBmU0QoJ9w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii6PXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmom0g/+OlpQSPOhprsq/zJuhyy6Iwt9ejgVGc8oKc230Ukn1bR0M1T5\r\n0+7IJVgqGlrBWbEoitREhuhhrGrxVDLcYTU3BS1XR+RWqR9MK97TFMJ/uBIF\r\n+rSS6I54OudAXxdgz/JlqS/9eY61OvOvIRmcMbBVa5m49lvTfC94uPY8MWJP\r\nd3si2uM5VJs2oQiX2YEi1xgDZ4ku1VySyNBFKxCRqaf2KiNQZe3xxw8dqYjC\r\nhnlqGmAebcyuR/ACiwrqG7wI3V2A8Bdz4NRTcnLda0xsJEHR5Rmg5aDsmABs\r\ngkSHcSQvSzl2sCGBdPFvLUXgI3u1pI1DTV1JogDKf7XUDdxMJZYuKVge1lHO\r\nslyUUbPDaN+dIRuUg8ijgebqDjk0gI1xSTc7RQc1tSLus7Ez15/e443wvsMf\r\n39InLj45GOjkVKmNFQiISB43RbVpwyYeSv7J1XRIL4teuwJ0TJGDhVGEkLcO\r\niQ8l4fz2HykiXZj+kjFyrMvKBxn/3EiC1wPz5/Zw7EmsZui6XxyH6JFZGz4a\r\nq4boieXrv9WniGA7QsSvuoPREOzKerMkR5oVAJQ9Irq5oZLrbwnzVU8NOIcN\r\nTGi61V//bvgYcbsxniB6cLqMP/HZQL41ny46uYFLzRb0aFlNxTCYi8AiV2ns\r\nDZKPvWkM1kFnXa4eg0Tjg4XAwIe7DoDqsf4=\r\n=tbZC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bgins-fission","email":"brian@fission.codes"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-1_1653318615144_0.5124691875218541"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-2":{"name":"webnative","version":"0.33.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"38d3818102dca88d7ddb963ee89e0b4ff93481aa","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-2","_nodeVersion":"16.9.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-S9UzS9PKTdgaoplBrlgsk5T7IYcpKMbTxXzg1jxkrVPiHJpuBLC5l+t4GkLTMyalaRMBO6JzlL5qaE51j3j2dw==","shasum":"421ff1fc16a8d2829371119fdd0614eebd89ffc1","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-2.tgz","fileCount":390,"unpackedSize":5583565,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD02yDaw74Ll+3cRhJMu2xNafbUAzAuYazln9DeztKYZAIgMJ3N+JqGLYI9bMM3cefiDF1QGd+xK/mibJCaBbMROhY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4AEAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEkQ/+Jbh3lkjekgy0Igv11QEWdYBQNWO/R1KNdgD8uCzd9LyD2fKz\r\ngDf0A8ArAyB0pELu8WfuHN3IiHgbvFnrSgCy2t+FtH2GM2FwyhJ+8+z5poK5\r\nW/epP2X0kRdtuBtbrcjjf9E6miRLKEcy0VNrEMxlMrNNz2pDA9XoYHp9SRpp\r\nkYMXsoILyCiPBw28WSonDa1s88hnJ53Szl1Kogb3O++A7oDrdFCE1P4LnKif\r\nO/rgLsKOTpU0BI4WVqFtuYTxTBUN+p1elEmAVn6uUJNvHEGDLso9OgRJu7lT\r\n5HbVn0bpS1924b7j7DqqtEWJcLfiqUYI7lbf37AK1H/9/MsAl3BUpSkBs/MK\r\nwEKCs4l9+YBmJMdOHcX9e4h3xptWNYhyaUJ5GTnhsutbzfffJH1c0uulYNwH\r\nL2KxyNeq7u2bqRHSFEfsRqDWeJfrA2NBCIVIZvO3/pT4fsoY2vm7HK9B/oNk\r\n4+1geqQo53oBfnLVVXyt/zVHQlX1/QTT7Pv1qJgRY+wTntz5iaPuP3omDmSg\r\nZSA8sbmfwR5pyA0KXHs8nJ44wd2KX8T9prQAE5bq+tc7faiLlUBTbdRYLTm2\r\nGqq8HZX4++dzvxFf5SSQbhTJq8kJKkgwuLt8OQcw5prZk1Z05EsqJz9phMjc\r\n2cgA/CwMWv/lPZpO+El8Eg3WwdRqae9X8zI=\r\n=qTYa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bgins-fission","email":"brian@fission.codes"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-2_1658847487800_0.30683642726815785"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-3":{"name":"webnative","version":"0.33.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"4f5861de60d096d453ea84ab7cdade37d38683e1","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-3","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-fx7ZNk1eKdt88RHG90fKg99xhBKsPIizOEgggr0HYrbM9G9O4vXGabt48QQF6K9pTuZmrrSW/RyqR/bxCHRc6A==","shasum":"0feb18d6424d52ef3ac890ebd137ea5a3c88bcbb","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-3.tgz","fileCount":390,"unpackedSize":5583803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI1sCJa49HfSnMYuC97Cpllch5PsiGZCjmiuDQOJI8/AIgULHQDM+lOKZFdcnP71CxvM8LG7mLgtyXQcd+Ihc7hNQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4V2KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpV/w//T4Y4aPkvQ7eGTLMF2uCJDcyq/uauo1qp7sN9EbNgQJyUmsxO\r\n7ZRvX7NGkzROk2VnwTIP5Ip0XjX36CyBk3FrxKgyUCVWbhCTHpDQWhMnxyqy\r\nGAnueJZz8vVmCCz0WCyqNmy3Xf6MlMnOC65i8Nj04GS/6oKTEriQ4rMAbyxp\r\n7iXfxBA6P5k0p6gY+RqF+P21hLGqNWCYQbMMC1oD7vimEQElGFMK8XtEeFq1\r\nkEzSyvFgRqd0gk5dvsxkyShGmUyyiFbaK09vzyscMxc1PEthxIEXPJXjuDw9\r\nptIm4c0uPI+UcmAEQx9UCvVerdWB+fF6XqJj3Ac2mgRMFUFONrRboeGwQA+T\r\nfFJ3VBwBK+W8ntUVLjdUYJRvvMng7FvTwnRcjzOKeoCxAcmbUlx4I/Jc5b17\r\n7VogGhEkMNrSR4+IjWdDCNraLRUglPTdPjR5RfsyvA61C33+UGioDIebRRuv\r\nDacdj04lxPVtTwsyJkCX6GCTkhkNfmPhLWankpYliuqbGruoitRyLTbKgkBO\r\nmqA0TxrK0Snsv8yzuN4MzxVHwvMgAFh6evX1ZdeSEpMIDNYwRrIgtKHBedSP\r\np1gvfF8o0UXwWRdF2wDlc9OIP3F/yhs66Yg0df8Iq0rzARJ50bk1XUeGCG2n\r\nkqmI8VJLFICy+IvdXt4dpo+GTGP2iTNL5lc=\r\n=rdj0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bgins-fission","email":"brian@fission.codes"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-3_1658936714230_0.7754491785934967"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-4":{"name":"webnative","version":"0.33.0-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && yarn run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","blockstore-core":"^1.0.5","datastore-core":"^7.0.0","esbuild":"^0.14.11","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^2.21.0","ipfs-core":"^0.14.3","ipfs-core-types":"^0.10.3","ipfs-repo":"^14.0.1","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","yarn":"^1.22.17"},"dependencies":{"@ipld/dag-cbor":"^7.0.0","@ipld/dag-pb":"^2.1.15","fission-bloom-filters":"1.7.1","ipfs-message-port-client":"^0.11.3","ipfs-message-port-protocol":"^0.11.3","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"e55d8a8e5a1b326ccb3bd09ab8f8d50e94e994f8","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-4","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-P7TH9uwh31IS8PjHaRD74wQRjmVu1qiHnMwkjr2x0FiUixUwbrkvumL4qergeCIKQj//ZrrnkCZhebJ1efaylQ==","shasum":"6ad964fe01f53a87767fa57af19249853c42df26","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-4.tgz","fileCount":390,"unpackedSize":5589049,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFoClQKn6QAeq7YgNnkNuA8jJA6ZyNqzJboeu9CWI5tfAiEAo0ZYmJfyChuvttZmHD8rl1XcPaB19nOtOBU9uZt0jn0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6TnKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeZA//eyHVg/J/4hWtyoyfqdh5yOPdqYhd+JvqJt8ETNW2jIQVDwPT\r\nOOLoVHR/nwNKDI2kchP8jVi3zdkz/bjBHvh70+NKU0E9GkfVwU+f/ofaZVa9\r\nuMrGYGwOnuJqKYDkocpo4kwuM/dw45yqVbIyvo495cexTe6ebJfloHT/ODos\r\nN23cQEpl4PJf7gYKJUIY5/0LINZXuYf1Bk70IRd7PZ6nnjfwconqbULoyTnN\r\nmFQd4/mNBQvamhJvOh/d2r6xt6pNjgq5fJi9ge/YEqHKziQlM9r+o9IlgLZa\r\n4Uj/KifsLLcYFvBBnMEGjAoi1lAXahAc2cNwltBytQVPbAmqxQf0IUeW+D3u\r\nJc3CrkeOQ9RxxXPCjPRL6kJtT4im/D1GJs9ezOxIC9J1/wAWZOgsUmr+EtQ7\r\ndqK9z++kc/2dbVxA+4WLoqVlanmyaPvoxbBGgRB+pF5rxbCnGyC2A6E7pic0\r\n26yfa8NtP7BvumT9pp7txBSu8iPczdNFmDkP+uDE0wyFpHs9RA7iMC+8k7bL\r\nIJTzMgRn+LNq8enc/7+bPki5/niCdt9g+P74cQ5m/D0WdEoXfYCAwY1Ubg/u\r\njuDd2bOlP6YPZI0gQkSrK494Z3xhj4eFxqLjka+T3U9pxIBvaBw7idxwhdlU\r\npf4nVscAkUbsBYABjz8M/bEjiPRJTabsx3M=\r\n=jKn+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bgins-fission","email":"brian@fission.codes"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-4_1659451850494_0.6493607528189611"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-5":{"name":"webnative","version":"0.33.0-alpha-5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","load-script":"^2.0.0","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"8f50d7894630b4afa5a1d1af801c3b37a1826a9f","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-5","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-IyjC4XC6pcxkEoTPp2fh9JGzzGeSOMtwtct0cPTxFfrmc3r2iF1XDd/noo7RkHqboqFThQcfgOlOFZSLhDcRiQ==","shasum":"a61dfdaf20b49d8747717b3feee4d5a1b3fc1170","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-5.tgz","fileCount":417,"unpackedSize":39954318,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIxLvR7+P77Z8IC8pRQy+z3ATYmC68A4n7CfijXE2fNAiEAsGRCNKn3U+Y8QykeV8p0X4sJ4OwQE9jXJyT8vXJRODc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/0ztACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6dw//bXFdMa+gYDPMWUV0k2JY18LPFZ/VtcPz/yWoBq7wOs2l19sQ\r\nUj0bJglFnOkVZ15y4sMKAVP8irX3b3aVsvpJCfmtfgSbZ8rgZW8fKdrQDbT2\r\n+wW6uIy3dmr2x//V7aff7Ltge7+tvihvwoIptU2GEl5EefFhi7sSyxUXRjDm\r\nUME1lilbuTECCs1J9YCADOAixZk/ZcxR1+w8hXKi2Rwl3zP7tkuA6wJp/3oh\r\nKhUQ3fwIt/wNW7N+p4SUp6jPBXVOP6ricQ9Qv1VZdEtYkIWuDJ9nXQwWfRIW\r\nr5cllqlcxZJWS7chieKbLBkSnLpJPiknZ8sp+dd4r2zfhayNKekagzdBBRvQ\r\nZt6UFpZTo7xsQwYVJszkOAzsTifbpkHqUmTrJ52z9YMuR0WtwNhLJ4xkrQUQ\r\nI8hPAiqfxOkSlojocWU4XsGKEu9DRcKE+ogP2UA2HnvBU7lppgUNqF6ULhS4\r\nXxJnfSfoN4ZzudiTXoeuiHE0SqmEZed3/RtAjX6x4rQZqJjp3Dc1l0go3CKi\r\nz2HSMYjG/LFuAXarnov4agYhH/tu67i4NJNONIJd2NLAP7SNxoizi3xRdGMQ\r\nonJVZg+yoyQvwsEeS6s6qYlearTdyeWYOUsdg/1Bdxn2xUcINO7K02IPBg9n\r\nqOKc4lARD7cojzB6jYbBp/BYBlE/1hYdVNg=\r\n=9jK+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-5_1660898541342_0.4991891588394963"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-6":{"name":"webnative","version":"0.33.0-alpha-6","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","load-script":"^2.0.0","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"8f50d7894630b4afa5a1d1af801c3b37a1826a9f","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-6","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-w6+bjT3SYRW7aWnesULWLA9ozmCaF6NZMdbAWBfjKPHb484z8V15Z68Mz7IlHD9x6EpZKgw8R0q8iqP3RHUhlA==","shasum":"0ecc4effab58ea565074bf6010bd4bbd2893ec47","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-6.tgz","fileCount":417,"unpackedSize":39954661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDby420bPJ6aIPcLR765mhLm20sUJI2J6Mrxnn91HK3owIhAOP3rm8iF4dgFy+9wGa4mvfRnVzloC1k7siaxKrlLHKv"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/1mMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLdQ/+NB5RJ0zoDNmOlgFssnTxEGxCENGtJ2jKnaPw4jLpxiuSgPWO\r\n7zpWoTzuCASmv65c3VNwHSSLxDUThbovaZsRKGvv3lxBtrbgmkazR10tpksZ\r\n2NDSQroJ8lNh3TnLSv0zr+Hji3UNFAACKj3K2cDFvvtN3+C3WkSVl+xoTVR/\r\n375DTQS0nq1zEDqpHmYbKTUh5gWFuvy+Ya0qlsUPdvSQwZNxtuN1YiTRoOCc\r\ne5sOA+p+nQf/CpUcNF+ccXs219FRMPM9PT1xzP1H7IPCtXempUo6nBM8PAQA\r\nPDfoM4T5EhoI97D8vmR6EWhOjG/j9/5ElWFe4Qc8stDrLrSGcLzWQZ5kpI2a\r\nUbFuvdhOuDuRyjd/qtCTNX5JlFD5bvu9ohyHNSO6CuvIX5+7OT3Y0lKJuVEA\r\nJznf8ZcgmE9JMPGKosgnX3tLSxKSyoUQIpWA+1BQJUW6OeYAfAfZ3cSu120B\r\nJecq5DgMEqoQAAn21EhWsgLDqHOIEOiHYt/wUn9ggyLTNzbT+RJzN7sgOHO6\r\nPSboTqD0EvtIn2zxMrYUQJE1eBjd/EbuZ+QI9pBbI7KzzK1LiIf1Nwj/sT5E\r\n475zxnyCOj41k05mYfrkkCx5MAUllOwqHBySKP4S8cTZgcdto3NBY4xQ+hlO\r\nJFwKYmPbr4OrGbpxwjG+MKIZ/nz+O80hJ5Y=\r\n=8onh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-6_1660901771561_0.13845149492081843"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0-alpha1":{"name":"webnative","version":"0.34.0-alpha1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","load-script":"^2.0.0","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0-alpha1","_nodeVersion":"18.7.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-/Lw9h5LfwbuVPVB2BZlzfOeogquDJp8FswJqAdovogJ4kjoT//CoJ6fuThp7dB93LZafCzaRX2q66xv7nb5VoQ==","shasum":"3dc7b0d2906cdec7677046bbab201a9226c522ab","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0-alpha1.tgz","fileCount":420,"unpackedSize":40062145,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRuvzAgiTGitoBbJMdmFohHDlq/v82uqMjAafEqCr4xgIgX/O7aQuhb5MaXTNVashF2+IYLc3HbotSIO1RRBS/jVA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/4aNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoevQ//R6z1xD7YfWbLskEyF34HziLUh5x8Me4wMkE3zi3JtrEH67V9\r\naZLcWAafuCScuJ60uMZo7HupIA6YVwWQ1wus8irAO0t0EoRLqZTF3QT2KlCI\r\nfgf8FBiBEOC8CB/gqiws9dIA4WsE2Vqzd5+Vg/SDv+EkRr3oCquHAR7EHh5D\r\nRnonGhXokt3j45cSLHNyWUfWy7+szxCiC8wEUztUcIgOpAjsQMiN3oNo2U0u\r\n6M7n55AhIU+fC0ihELETvZyVyrv0ebp1WtoCruvTKMghibMNnWqDmJJi1MjV\r\nEYZhAIZaenlAecg5QU8/ltLK3QwOS7UeG58qXlsc2j/0M6lBYJvzM/oz8IBC\r\nK524I2deXiizHbuSM9uyeIDl1mc98Kt59tUt18Ap1RmxQydxNTwZ3SQ+Orey\r\nLK3my682PHmUrZRW0OhbekF/9s97F2VMF6RNBgDEq7+WSqHUnTNzbvVU3y9j\r\nsvKHT2Qlhskp079BfGBRd3Pbc1NqvuhQsZoZAwODJsVe95lna+rLUjCBwHkv\r\nc28xCzGyjzLd2kmhyRyEKL6PBSOZfT0sCRTfTIDGFkz54D3t5pMVBCiZJabS\r\nrfm/pmjcq7Zx/U6jocrne1rcRAZHEbn9e+CQJ4Per/R8VFfLZaiCtfLcMvDq\r\nAeMyLu5YmhOxCM7VmPNs56JHFnlqY6mGhxQ=\r\n=KbfS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0-alpha1_1660913292629_0.7926051657735069"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-7":{"name":"webnative","version":"0.33.0-alpha-7","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","load-script":"^2.0.0","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"0a599a7ebe15e725bff97f4fad0cb48ac5abc798","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-7","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-NY1qLowh75Jn/VJeyj919V0UYTGSNVcbhY63nODbwk3cd79sZuX4GWjJzzGN1A2chZG4RdzsOXrJC2VUPEZyoA==","shasum":"45b86782863d741db0a5f879ceadb224c46945ad","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-7.tgz","fileCount":417,"unpackedSize":39956759,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFzN0kuquQPcEVeKoy30dmMxE6yOqs4Hh/TfENZL64hAiEA5B+SgqAw6qUhgW++zyPksC03Hlk6m8tyvsx/BzTj2eY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/4k9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAoQ/+K+9u3pwz7N5D0QumEvSLwgB4x46KoBnFoOFRi48MAYpTMSjh\r\n80398YfNQq5gms0Iw4HQY1rsgK2SQuovdV1cHcE8g7ckyR/XYl6JVJrH4reo\r\n0veJa8zC2y7yDAqx2UNMUgNUF67n54h9LAFB7v3uG/zieONPY10BcOjQ14vX\r\nDDpeVoAaw/yxyFa4UZ6xQ4CASwyGffsuqfb9GnHBH2opSUbHJZx9NHiqHLF4\r\nb3RODBwZnSCoSgDWkiZQRQe09Ed6BowmXrs3OgZHOKMJy42tsERvcR6lddaX\r\nn6+v6bU4IIK1ZWGT/D+POhti339tR7r4hHm+u3rrj0XvPjmjgluf7TCKTfSJ\r\nhBTLw+hpXgIDbJB3sPmjRWpPmW7t3XYVG+10Gcli8fC4uBVk8uOBEpFhiLqb\r\ne3qonnNYtjujUt8lnqI3J0GTZgg3KDKftjVfo5ZTT33nNM8g4rV0/Pv1yDrh\r\niDbCU81blJ29r5aDRrgZwVPd3AV/67cG78KjIWg2otNU1fui+C0cXc4+E4rk\r\n6ltC0LZoYHYG7N+6RjYDjIdmVEqfFvJZGlTcstmQyOmjt+gShorASzFjIUXU\r\nVptkkDSNqD7Zdc6a73aOfVA7rMT0PYoMlnGBKn+Ftot0V0OtSXnZXSKrsZCI\r\n8F8brymyoBBvxvHh4zuk1ObKw5uQQq5CbNg=\r\n=47Xb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-7_1660913981333_0.8079279386207823"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.33.0-alpha-8":{"name":"webnative","version":"0.33.0-alpha-8","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","puppeteer":"^13.1.1","rimraf":"^3.0.2","ts-node":"^10.4.0","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","load-script":"^2.0.0","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"e6d3db70800fedb3d2ba69f4b5da6cae168ff8da","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.33.0-alpha-8","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-nCN9b2XOZ/MUGgtxuTSB0m3/MlsmUuH9qbaWWxjoHiRwUftthzdtwp7+s+Gsc1OcrpcohYxbbqE8FGTrcngKtg==","shasum":"f39521895f8aa161b19f112b74a82d86135bb126","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.33.0-alpha-8.tgz","fileCount":411,"unpackedSize":21594508,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUjXrl+3q9IcLPAO1Gc9E9e4w/HVz9NTYLBSPqUerQVQIhAOX0yUvKHEYORCFjvzoopEFnhApjOweC/7uzWuXUYJZp"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/7i5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmou1g//eXXap3wmKRZFn0h2kNUSQhx+hWp6oFwYypxpMMUITezUyccv\r\nzRQRHxKLnRNNpwgWMW7iQIsp/opyI0hlQxHKDu/3te7bOfrPPnigSC4hq5X/\r\nc1A6ExaPaR2AdRa0qfxkorwOg1Tw6hsj+2ksO7Z1edeXy0KtEufMXH+BvfTS\r\npE8I1Fr7n6D1nbXL1f3zoJiz6H/AiFPunc+3BdsNNu9FZpjGi2aMtRrxNyRb\r\nEhaR+oeJB1X5gKAwSFTzE2U/XzViZghMPVsxqM+PurTI/itZv1ICV/BYTRxw\r\nI26/Q85OBuz/94XWRV6v7NGElmCXREi/cyjk0QfXH3P0Zjq0EpuYR6XD05O/\r\n+X4/eMZXB/XinMw5Um9e+BjEzbl8qdbLESBifaq/WnY1Z41QUbWVDKSlQQDW\r\n5ahQuBPEThyC1FPK9fS5G+j5z1VFXg3g3XShJqA1uzIszRt3PpXVpGpXeJdI\r\nxqV2ln14ifryHNLTx4YsnzXJ9D80dAW+hwLG4R5X0Gptow3qIFIXZZhJiKdz\r\ny7kd8bSn7v+xgtWc07Lpgw51uR5VQo51ohov5+ifuuARl35mobu+c+wz4IsA\r\nC0wiLD6ei2OST6WIbYz5QtU9ROmCkNAodXVSJzQC6FGhuGLrhhRArL7rmH/e\r\nVzjlNmHMZejHpvnJow3hvetI5HsWkVay2+0=\r\n=J97D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.33.0-alpha-8_1660926137554_0.7997739364612082"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0-alpha-2":{"name":"webnative","version":"0.34.0-alpha-2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"0489948156c4ad50791ae76feb68304263629ba0","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0-alpha-2","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-Hjqrx0rwBCFYJO5900Kan97jK1YBfuYAE+l9Zbal3MZMmkxYt4R7lq7sPG0ORackDIeOLx6y4XtTFdojjLRYXg==","shasum":"2e6fd37a0ec5d00822d575be9c2c967733e9cca0","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0-alpha-2.tgz","fileCount":423,"unpackedSize":40056018,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMHcEu0jijZOtYn5LNKn91MkzqDQYLC7nLrh3bwxxfFAiBWjvH+ric6FOa6kUaNTAi++0VndGlHFSWVXX7LX7tYYg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBf54ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqADA/+Iw5mm6uAifKbOiKnxuljvNJeoMEXyGn7/vtn6YrNuXbv0cAQ\r\nYfsRe3xf9u7pLxgSOOmoOKf4eqKCvQdD4C44XDfs2kns5L/M/v1WrogLdPtx\r\nJI9O4ZnF6chUWNiUlmrzyav7sMA7uDHeoWqQu5yT7stfi3Ung8caiAHDuriz\r\nmYa58mhQF0HtgOd6eJORrdDMVjq1FalNdZSyv0/bL7pLLC+Mk/Ng2aGs6wuC\r\nMqP13HwvH7hNiqOqnWAJdRI59/VLXVoVCnluAF5BCA4neVZxP3D0WBZ15wMI\r\nPALRlMQ+8ye0YYjcbSuKYx3U+sCPN5bWvGxZ1edbXjn0Fp4tI+TmA1+mQh7h\r\n0Oi/1MG7oCLBUgqHL4W34OWR++ORCvE0yBwi01ybxIIbbK9VZ3y753NLx2tw\r\nT9MxlGRo6YGR/Xmn6BbsXF2P1fOY7i2ZsKoYoSI8C09KQ6yNA4CceFBBhO+J\r\nxMOxnqUJQjWSzqJDfaLmSUJYAPnJ0QlJ//Q4i+dfZu9NQfBEtr7YDDi47V6b\r\np425zsBp/K45TQTt+yPK4/b8kPWMBk5bg+TU3Lq9Fjlu3yG0ECtBeaQ7k8yl\r\nl4kEAb8oY0IU4QBmDFEKu0Q8jNC82hC1M/r6zFNTSiVZ97V8ZGbxcytREzQy\r\nt3mqCKBxbJmyLk2/zjB70ThO1oYhKxAE5gk=\r\n=gq+5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0-alpha-2_1661337208040_0.07926484829093128"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0-alpha-3":{"name":"webnative","version":"0.34.0-alpha-3","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"0489948156c4ad50791ae76feb68304263629ba0","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0-alpha-3","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-oxWGa8F7aRsO4bAl6TBZgDVgz1yAmjqtnE/Qu5TvGoN1eYlqTpbdRog2Hgq40gd2bdcCp2I8htY+FJHC1A9rhA==","shasum":"9d8487961adcf6f7cc8aa50b54156d46baece62a","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0-alpha-3.tgz","fileCount":423,"unpackedSize":40056108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICb2FeDszZ1NxX3nFc4KFJk/uclaPpF1QNgPhvQ7a9RcAiBSMB5nQCHP4dI70kw1AsuGOxA43923mVdCHpI3e7osBQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBgU4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqrbw//SuW4dgNmDmw1fdDZJXCJiBnrGyV1jOkbnA3bU8P4ZnT7J58E\r\nydpQqjQqLiFTc1ZGxCiKPPJ/R/rVqOpTPsnGcyX48I3qsjeQxzClxXkUzmK8\r\n1zHp9Ue8ecpiTVb6bV5sUfM1AcLQpyhOLYEDf+wtWoeAZqdgGrgRNWSWSRcS\r\nyk1eKz/LfFJsA4/4IcOb6hgjcqgBzL3yDgp/+lUFZcTgFSWXB0sgwrFqkQnJ\r\n0974hPB9BNFDtU9Vi2I6sR83Be68vePEXnMMC/fb7TKziGRP8mPNChFlIrHU\r\nULdkVyMAOoFPqXUJqgeIHvEhX9DFA4M3WIxUB8VdZicl1baMkoWaYlDC4CZd\r\n3rcQy1n0698UMcL7xpPKw15RTTy4KfIcDpyMf8PyI0iirLD/mxhlhDWYx/WD\r\nBz3wS8+2XbzPo4zmd8LxScwEZqbBPLB9nfBQsS5CaJujOtzcmU110PTT8qLL\r\nvVhS4x4jo/SHk15J5586ix/3S4a7zfHWbkqdvUx285JVYnFKpJYvU7Ikvzue\r\ncY/VgOz2igheaOU9YHFm/4gljz5sSszDaPiswmZzbwRSvENrKar0I1sC3761\r\nRk3ZW+NjPWzIAh0fU3l1Sc43KcANkTqoiUrLyI1tB2vG0T+6RfjYgW+OLKvI\r\n51y77AyjDG/FgmOGj/Jh+mMH3PUznbG7C5w=\r\n=rka1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0-alpha-3_1661338934982_0.31759744818763425"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0-alpha-4":{"name":"webnative","version":"0.34.0-alpha-4","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"50065a27ecd893edeafecc3d55cce5d62721a4c3","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0-alpha-4","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-VwsA9qXT8168Kv7E+3OTJo7ZNkyzyVdH2i0TzTRaraoQ3Fi2dWmd24avi6ZfbknZ91tR80R6mBA/7XI+s0CfbQ==","shasum":"51145c540e1ddda91f019f6be45596dad8a75c58","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0-alpha-4.tgz","fileCount":420,"unpackedSize":40042889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ8gK5QN7qu5goJIVKUrTDbpSus+VkdoY/kcWUkj3Y8gIgIof9o4t7uB0P920xakVZ/rp1Os2brWT6TWyOgxoeTqM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBgilACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpxfg/+KBJIHhmc2uHxfM84u9nQHrVMDIKljNyMUEZr8Jfjo60UU3YB\r\nWQgikjlttUwn2bhBZ9W0ZosYZmjWUgR7ZI5gfJ/M6CZhrCZI7FpB9BmWH7PW\r\nbIFrVl2JbR5XyCBSvvThzPXBG6p/1iqYi6ORpwnz4SnIVpxKDqORg5TqUscz\r\niKDtVKg9AGV+YxKahRwtqH8omKDCQqi6oY8k5fY3K4aMYfoSIyaxXYVbgaKR\r\nL0jl4Sf53BhktbUG/TFqageaXELwA+0E80lD2USJoxIq+dtV3wIyxFm1Zole\r\nE+3XpJGPnrha4+ZIthnbokjwKVK0x9nBrVZJW1QPokkOugetizfY9uy50TTu\r\nDO5Uo5qmb+IdRH3VGayuC7QLURrPKo6cnJqLNbXuzctG2YlyYfn8OVNJj+u6\r\nJb94/5JxlMXsAHLvIt6MGgwuuFTDRma1axXrCxO/JXgNWilOKDNu7n9R+MDV\r\nCwbs1bwJdgIX194H4ObuF3Tusrl/D8AR1T2aSMaV04Um4BO+8HPO79ybHEiq\r\nCp1dPf+8yJwUsfoACwn965XMEqc5FgZt0yKUY3F7lqvnjPHIPx872ZqCk/x9\r\nys3nyBmRGaAqsC5y5C6NBSIb3kSmhbMT1XTZlJjoMZOlvvt8RNCVkfp32mHm\r\nxPIvceWK6OcluzZlQccf2WsjW/25nuLbsHo=\r\n=IpUk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0-alpha-4_1661339812824_0.4568069123601275"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0-alpha-5":{"name":"webnative","version":"0.34.0-alpha-5","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![Build Status](https://travis-ci.org/fission-suite/webnative.svg?branch=master)](https://travis-ci.org/fission-suite/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/524fbe384bb6c312fa11/maintainability)](https://codeclimate.com/github/fission-suite/webnative/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nFission helps developers build and scale their apps. We’re building a web native file system that combines files, encryption, and identity, like an open source iCloud.\n\n---\n\n**[Read the Guide for extended documentation and getting started information](https://guide.fission.codes/developers/webnative)**.  \nThe API reference can be found at [webnative.fission.app](https://webnative.fission.app)\n\n---\n\n## What you'll find here\n\nThe Fission webnative SDK offers tools for:\n- authenticating through a Fission **authentication lobby**  \n  (a lobby is where you can make a Fission account or link an account)\n- managing your web native **file system**  \n  (this is where a user's data lives)\n- tools for building DIDs and UCANs.\n- interacting with the users apps via the **platform APIs**\n\n```ts\n// ES6\nimport * as wn from 'webnative'\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n# Authentication\n\n```ts\nconst state = await wn.initialise({\n  permissions: {\n    // Will ask the user permission to store\n    // your apps data in `private/Apps/Nullsoft/Winamp`\n    app: {\n      name: \"Winamp\",\n      creator: \"Nullsoft\"\n    },\n\n    // Ask the user permission to additional filesystem paths\n    fs: {\n      private: [ wn.path.directory(\"Audio\", \"Music\") ],\n      public: [ wn.path.directory(\"Audio\", \"Mixtapes\") ]\n    }\n  }\n\n}).catch(err => {\n  switch (err) {\n    case wn.InitialisationError.InsecureContext:\n      // We need a secure context to do cryptography\n      // Usually this means we need HTTPS or localhost\n\n    case wn.InitialisationError.UnsupportedBrowser:\n      // Browser not supported.\n      // Example: Firefox private mode can't use indexedDB.\n  }\n\n})\n\n\nswitch (state.scenario) {\n\n  case wn.Scenario.AuthCancelled:\n    // User was redirected to lobby,\n    // but cancelled the authorisation\n    break;\n\n  case wn.Scenario.AuthSucceeded:\n  case wn.Scenario.Continuation:\n    // State:\n    // state.authenticated    -  Will always be `true` in these scenarios\n    // state.newUser          -  If the user is new to Fission\n    // state.throughLobby     -  If the user authenticated through the lobby, or just came back.\n    // state.username         -  The user's username.\n    //\n    // ☞ We can now interact with our file system (more on that later)\n    state.fs\n    break;\n\n  case wn.Scenario.NotAuthorised:\n    wn.redirectToLobby(state.permissions)\n    break;\n\n}\n```\n\n`redirectToLobby` will redirect you to [auth.fission.codes](https://auth.fission.codes) our authentication lobby, where you'll be able to make a Fission an account and link with another account that's on another device or browser. The function takes a second, optional, parameter, the url that the lobby should redirect back to (the default is `location.href`).\n\n`initialise` will return a rejected Promise if the browser, or context, is not supported.\n\n\n\n# Web Native File System\n\nThe Web Native File System (WNFS) is built on top of the InterPlanetary File System (IPFS). It's structured and functions similarly to a Unix-style file system, with one notable exception: it's a Directed Acyclic Graph (DAG), meaning that a given child can have more than one parent (think symlinks but without the \"sym\").\n\nEach file system has a public tree and a private tree, much like your MacOS, Windows, or Linux desktop file system. The public tree is \"live\" and publically accessible on the Internet. The private tree is encrypted so that only the owner can see the contents.\n\nAll information (links, data, metadata, etc) in the private tree is encrypted. Decryption keys are stored in such a manner that access to a given folder grants access to all of its subfolders.\n\n```ts\n// After initialising …\nconst fs = state.fs\n\n// List the user's private files that belong to this app\nawait fs.ls(fs.appPath())\n\n// Create a sub directory and add some content\nawait fs.write(\n  fs.appPath(wn.path.file(\"Sub Directory\", \"hello.txt\")),\n  \"👋\"\n)\n\n// Announce the changes to the server\nawait fs.publish()\n```\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Publish\n\nThe `publish` function synchronises your file system with the Fission API and IPFS. We don't do this automatically because if you add a large set of data, you only want to do this after everything is added. Otherwise it would be too slow and we would have too many network requests to the API.\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n\n# Development\n\n```\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test:prod\nyarn test:unit\n\n# generate docs\nyarn docs\n\n# publish\nyarn publish-latest\nyarn publish-alpha\n```\n","readmeFilename":"README.md","gitHead":"fc7202cc9c3e15d77a2fc9bc4468545452c65883","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0-alpha-5","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-vyMl9AKrJ+YjH8JMWrNijEGW2AiGljle2Za11i+n6Woh6DGx5ycYORJcvWEYeYz8IKDG5jpGlF45mdx1uZuBIQ==","shasum":"73e6cd22d6f9b167207191fac112cca2df6789ba","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0-alpha-5.tgz","fileCount":414,"unpackedSize":21680414,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5cNCAoIeBCylrXoRWL2lpDjvGbiR+EyRjWUg900N2BAiEA8sf5Mn1n5MxTdE9vFvKLEfyVTnFHr+iP9Fe0hWZojc4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB4xrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosGRAAlXSQpOg6z6loLQaNM4rZD5AlcaBxaE6PRgWN5vy6UTbahnB8\r\nexEfeVESMpJvdoQuhWaoNjkH3ww72Z+QJunTKtiqSzyAcIdff28dj1Um5t+S\r\nXb6OJyEaBLoAdXsHRIMdwPfHYvA0eY5qmXcRkjnmL1R9S8IVe7mWfCjQc/I3\r\ni/Z8UJImO3Z8X2+vE5wVm946+KStEqaRDhhGcYItM30Jiyb1LebcUeXpCwvg\r\nnBzKHQlLl4CgSo4tUd1BW6F74wp273bK3SaBKqQ9u4OOdtVMCy5PSDUiMp4f\r\nqxCjcbPcRX3OZ6ZtxHrBCn+M/BPvv+QVrjVI0GXINBMKaliFBuQSHeAKl2pY\r\ncrHG+Z8DyWcGuvbwcLch8Eu1UB4a1a77jCr32Ey8x5C98TNPFFT/PJI41kSu\r\nuerRiQgJW1qiSyQ0Y+S5ewGMfYFyWsytZ5YAq0wY6JbCTamzS7P9b1mIsBwn\r\ntgD6Oh02fYY0jAisoX/hoSqmnYGPf0Oj2hkjNCiSq2dH1CGqOOI4KO2gdCwF\r\nZETf1ooEChsEXUU8+N22hKRCy12fWs02lu/+z+rYz6boIB4UDgCzKlUpYXs7\r\nDg0M/M6wgaNtHi1x2gkFtqX3phGrl7R8Opsd+lCzr0h3/ocLjBPJSIGL2rMz\r\nM2rwAgDoi65tri/xV/AtWpn6uCM/IgoJdR4=\r\n=vc5O\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0-alpha-5_1661439083233_0.5488548315439881"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.0":{"name":"webnative","version":"0.34.0","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"gitHead":"0870790443f0cec2bab862bb989170d1f8fd1737","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-BS5pgHx9+sIzZ3NYA9Q76QQOctHFuyZ9p/LC4U4+gWTjycj0efWl0Z2jlsaUyGfqBkFLReyDeTb3ldHkD2PgbA==","shasum":"d781ef83d5f22ad8e1de2f804d9c9b2bc91c67d4","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.0.tgz","fileCount":414,"unpackedSize":21680314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIChYSTeexHBW4kCIO40uKKPbPKKYE3bSWhzNeXhZblWwAiEAtk5aU5LECOYCDp1RkhSpIsUeZeYd0OWp+wMihr9gI8Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB6SpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqeyw//R8ms26vOty502SFc+0jJcvkpxq9ySecmMkBl/GxBoCUWsdWS\r\njCvxenLbgP9F0i1irC88v8QldfxzzjYePsS0gvR0hrhidtJO/Xa1ZZ1WSMHB\r\n+W4zSM//cERgsKbaarADfwubxRlKlhhN/izYyQf1zb/XbwgdjLULbbYAPIGd\r\njuRa8J16EBGsB4eVhLRNZ8kz4cTDvv2aeN7/vu7zVuNmX7Wo8AxD3HrY7MDW\r\n0bLnWSjZlLQ0NXOSzHck57Y6RxSRJzUOMhSP13oAqxxRWomy4cWLrMVfTU18\r\naUPbv8UD1jwY31x2yttcAcfLqkLG8taZRGGLykozIz8bhSH2vi4yzU5/XCEr\r\nzWLhnKpsWtEwDXtKJXxlIh2FF1+ZklWGO2v5tUGa+aXja4gbp+lIl2L+79F2\r\nrnEmoOj2rYuDgjVGnKD0y1yu6F6lz89Wv4+QKKVEl+gXjcN54ptZIH9wlcUJ\r\nE5r6lxCGPR9YmpvteruYmGrXRtkfqwi/2e4xM6uyBmNN4xFcdgkjutXPW5jf\r\nvN7gG7lNifmTAUIegqMZ1n/L6vOiZB5/1IlVxxfleqTVkah7GSwenkhVg0dT\r\ntCBhT4QVb/ejOmASkOLA3OZBQvCqBoS3oSrj1qh7VJZ+zaAnPJWWqbAq0xja\r\nnAWxQjNmbESjQnq1J+8nuv6hzh9NtNhRADQ=\r\n=453b\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.0_1661445289366_0.7833868688569876"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.1":{"name":"webnative","version":"0.34.1","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7-alpha5"},"tsd":{"directory":"lib"},"gitHead":"01b57e2d6616631b2b4a484a46fd14e385aa8a0b","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-FCY00dBUUHWEdabkLV3INTxnkNVlRQfmiNfe4M+Pg85rppLTHP0WU/MAbPHan5NMdH2j09KPeFmxLD2qbqszHQ==","shasum":"433662ec756fed492d2c8eece5e7a856b8064940","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.1.tgz","fileCount":414,"unpackedSize":21680718,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB67ZquBMvyI2pU049NDEJ9jf6qvK4HtUkDTuFYS00PlAiAckMCIZUTn3l5YxkwjA+Tf9W72E2rnCBMOOSaNhnP86Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDNLkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIlQ/9EGaZDQVGOdepEw0F0lykVbQFU+t+GWqcb2M2+2oZsXx9VW+P\r\nxb5yBOt+hmQpe0aTohKvaeCtIPBo//GYGhJ29x24fAas+cis8doSKEOnsbUe\r\nIfEUtk2NOZPB0thnJ/ogtoVtMz/AUpT1123QZHvD1aunJOHWylzgp+6rbKME\r\n+MhT970Gsy7q2ikkBa369OHW0KZiRCHAWIOdx9PaVfNlJbirdoAjH8xtjwFT\r\nW385DM2DNWElZDs5RpDj/wEg5rdJPhnZvzyHLfqPGysKncoq2DAuoHWynnOn\r\nJdTGBXZtHARuQ2YjzeMIvQ03oZwL2fsAgnqtywGexgcV/QFXserORWVAzzqO\r\nCebht7Pqkc7s9jLVkqg66hpUmvY6VpqbuzfDvCqwvA9UTvfxcqlzC+a+Sl46\r\n/YKK8mgOOqSHd+5FTOhs0X4RdEmSvCseRvG9Z/I6xKsc571J67Rq/b4lnTwv\r\nDl0Q6paMwfR2hUu6t0awkdDmRWeCp9tzQR8OXVFYsckOE1W9ROmCM2W+U6DY\r\nWsSte+NXR4bNLcuMtQGcsfjm+M+UGiQqj4MG3PlohPHc9brKSHkM5XsccIvN\r\n1jggwfdqsVBsbkw3sx6vc/jdT6Fvgz0T78gXozPNMIFgzILIVRh9P0pImQw+\r\nMVgqnqaqR7ycAZ8HLTlYdStgfFqfxFy4Ra8=\r\n=QWLY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.1_1661784804354_0.8289171018810773"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.34.2":{"name":"webnative","version":"0.34.2","description":"Fission Webnative SDK","keywords":["WebCrypto","auth","IPFS","files"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"author":{"name":"Daniel Holmgren","email":"daniel@fission.codes"},"repository":{"type":"git","url":"git+https://github.com/fission-suite/webnative.git"},"homepage":"https://guide.fission.codes","license":"Apache-2.0","engines":{"node":">=15"},"scripts":{"docs":"rimraf docs && typedoc","lint":"yarn run eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"yarn run build:ipfs && tsc && yarn run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:wasm":"WNFS_WASM=true mocha","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"yarn run build && yarn run lint && yarn run test:imports && yarn run test:gh-action","test:types":"cp -RT tests/types/ lib/ && yarn run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:gh-action":"TEST_ENV=gh-action yarn test","prepare":"yarn build && yarn docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@types/expect":"^24.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.10","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","@yarnpkg/lockfile":"^1.1.0","copyfiles":"^2.4.1","esbuild":"^0.15.5","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^2.21.0","globby":"^13.1.2","ipfs-core":"0.15.5-8f351a89.0","madge":"^5.0.1","mocha":"^9.1.4","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.3.1","typedoc":"^0.22.11","typedoc-plugin-missing-exports":"^0.22.6","typescript":"^4.5.5","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.1.17","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.15","@multiformats/multiaddr":"^10.3.3","blockstore-core":"^2.0.1","blockstore-datastore-adapter":"^3.0.1","datastore-core":"^8.0.1","datastore-level":"^9.0.1","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.11.2-8f351a89.0","ipfs-repo":"^15.0.1","ipfs-unixfs":"^6.0.9","ipld-dag-pb":"^0.22.3","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^9.5.4","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7"},"tsd":{"directory":"lib"},"gitHead":"e9e71a4fe3e80ab0c049f757ae40f51ab138b129","bugs":{"url":"https://github.com/fission-suite/webnative/issues"},"_id":"webnative@0.34.2","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-IK6CpMqP6ccmlk2NCpciQsgYe5A7QvyW3MudQNJD3oqGFf/SaxyrAQwmNdmU4SNcBuwZti4qP37zW5k21ri0Xg==","shasum":"f570e31a6af652e817146779123503ec6d1fae52","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.34.2.tgz","fileCount":414,"unpackedSize":21688500,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJDXn5WnzuBQyTTSq+KdTr3W3p3za4vsxKCqGLp/TkCAiEAlmYYaEwAysplhpmtmUOS0E44L/OzRuoqlw/k7Ny8bac="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKFD+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmTg/8C3Enb7iDCKpYoj6zKmCSzUuMoS6TVkd1xo6cUIM+H9RPmPVW\r\nOd9k7clJRxp+eFXlmWWeZIjFZqmWn1YzGaAolUqMTwsBYesw8ha2+Bnsv0nl\r\n7sOjZscgvaseU/QoBCcmY7eP8ulkSfnvFln9UkYvnKCGB4iURmk7jHOg8lI+\r\n0bNOfD588j2TnTkVAUnit8FSruvo6frbjSBzae5d8OLRHpH6FirUEiEuUgeH\r\ntAnSm3OQdMxkPHihXC8lMKneWtLLeFSfVoUSccMsRNUuJ5u6+EH2WG2XEPKv\r\nYzkyPlFkjopOF3IovaVJFgWk0llnBWAMXtAlBuHzpuJySkMs1Fbf1nnokygj\r\nCh/KXbRmQgWRKXe4sPRkrK9jdCAk6+INN/4cOhG32bGl/hm4wKXNMpyIFW0K\r\nBfiLKz77nuAkOFy7TwAoy7j2W+QJbWQPZj1LrS0fE1YYS0VjBOeq4CtoN2Qr\r\nqLcK8T1VHt153v6wKXEV6qwapR3TFjQ2a7DCKnDK7cs+BXVCxC400tJFg5Gp\r\nAKTyOy/5rbubKSamMQMhejjHZ5VLr2UngNTETCXcCJOw5zuaV4hLWCZSBnJd\r\nW8Y1NSpv1ghDT5fQVVDpZnd7GmuRAqQxidRXkilKwYANU2Shrd5GqzPfAIZy\r\n7xwLBYxjAwwmG2sp0REmxWd+n9aF4oYoxWQ=\r\n=6aG/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.34.2_1663586558407_0.06680063463863806"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-1":{"name":"webnative","version":"0.35.0-alpha-1","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=18"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"34adc891221b927d9ac8d7aeb3d9e9142a0b406a","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-tFbNEL9Tw7+tVJO7J54ZhHEN9e2gjNpyusEzS1ZHgUWoNHzydJgpUidwCsXObFpVBqf2Qf3lTAtDs2iy5V3Vqg==","shasum":"9309e6ed7ea109c6ac0f1826c67f141e2623b436","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-1.tgz","fileCount":565,"unpackedSize":14864640,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhz6blonQVwWawkZhIy0OtlhYQCaXwKTelQIyjreooHAiBtzHXh4vRD/M4KLYpzgByMBw8Y5pF6v0W1T62WobQCTA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf7TRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2bA//RJD87pSaSOCVUSqrnILUJVf3PIx7j8sNkAoWNGO+EdAIVw27\r\n4sppZFrniqJO5V09yVvsIMmoDZd+d+uTI3Rtb9OleWf70gnm+y9qXoYbFv9Z\r\nn+B4Zkzd5U/HyYluwirGbZOlxgRHQZ1nEIBbWP8gzx4q50qFkSPXLeEESmsY\r\nrGFms7j5ZWY8Usmh4GAylpaqNjJp3cbJOKGU6llGQjQNtaj+XlPD1Vp3RdDn\r\nUnNqCGtpS72/oSagOyKiaoZfA6g2SQ+y8OIjLSLQ7B4m0rBfWhUG66oynuBf\r\npZ4zRp4bIaGfD4pDFv7krZP8tB+jO07vZUnod98IAkC8tCUoEkBUR3XsmdB7\r\nTM+YBk9vtBEMhERXlk8guQ15m/rpZaoogCdEp/fe+22NLSxja9gYb/KMB0Wm\r\n00utXpDlb1Lb99ze5cXzPpfoSlXQ0J0A9l3YobB43uuSBNpBVpE+CDWtq/qN\r\nladwWoUUZgnnU1uuDD907Pw5BkEPplJDfWnscVMpZmOCnQINlfN7IZ6WeGsJ\r\nYZcVfstmkluFGRxmMlfIz43b3eZB5sV54PXcrSxS9J/9LlsY3PAtr0fhbAKe\r\nFpq+cVC3xYeJjT5v864Gin6GQGHGXc9JbF6UFym6p92HY87RCKcRCMITzQsX\r\nqnXe90x3f2sfB3kRqLVA1VL69Nj1oQrbMNw=\r\n=jEDJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-1_1669313745031_0.055856844740163725"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-2":{"name":"webnative","version":"0.35.0-alpha-2","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"27a23b8ba26b356c2d7ab68c1f27bb1dd7e29d23","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-2","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-iF+XwkIIzI5qIBKoy97iXZOvA0f3LG+Nqrv0WCieSmDR8BPmbn9T76skMOApUnfyq/xk4+XpU68UyLfeV0IzXg==","shasum":"9a831c95517a08687822b80147787f1ed0573ba6","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-2.tgz","fileCount":565,"unpackedSize":14864641,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa9HqJhe8cRR2gBJ86FULnxqtpmzocF61saV+zIj5PjQIhAP7ApA/wQH8o2UxkuxpFJytBffI8LHIkk8nNvCTkyJWO"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf7lzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHBg/+ONHZ9ErWNX9JK9MOh1wdPP140ZwObjf0tjl94pHBTDWpZ0Un\r\nNFRFPOUOhFNix2t3awFGeTO8SbHCX+ORora53ETClUbeTZpOle4KLt+hAZpV\r\nit3nUM/XFdFU3zR10z6RYSlYEf5dUoFXr14Bxvf8wpDKhBDDd8BIy9fj8rnM\r\npv6CJfe5YtNmniG07udEKuxl8GptXADl4gqmSKisz3Xf5lMc4PT7SRItZBE3\r\nWNoBDsdRSRb1GA1dhWuOgn4iHBjbamhMRedt/odW6471d1rELojYpoZPrVGL\r\nnurUillPLT1lsUmgw6DCnc8/OTaHLHqDS/jjGzC5kgZoGwONM2ItYiTx8dX+\r\nk9KwqzR6sB9uprRa42O+H0AYhLprJHP+5gwROxwu6Ar2GllS5fgeL2SWMMBp\r\nKpwvEKXcdR4OX0lYBQDgZB2Lso7bdfHSH5QWwx8SNByYcMOz7QhD0S4QCsT6\r\nMJENdjK9Tt4RE1hVqmLBewNSejk/4tukvTJ3JvyiQ/9Wevr+lC2ae35r258a\r\noPiA9UdTca8H10QROHtSClB0pEYnBrQEY/XYNBrKy0Uj5IIBaRnbO0vDx3+f\r\nWkmWygBPhzvuqzynalU1wa1RUfpT6j8Ahe5X541Jy67xNrbXuemtu9yQyI/n\r\nBWcdosu3PfXxoekAotW3N6sDxptqkXFam2c=\r\n=G17l\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-2_1669314931264_0.8079576680233673"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-3":{"name":"webnative","version":"0.35.0-alpha-3","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./lib/*":"./lib/*","./*":"./lib/*","./package.json":"./package.json"},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"^0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"89ed52f69fd7fc86e1387c270ba6f8685d002989","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-3","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-Z4mEmeGuKnZnn3LBoqSDO6M5y9DbQXxNVLHedcB0ATuAcLtPAaqRGT5pakQhs7kuWdkyE+jd8ZAeFrA6hQLb3w==","shasum":"f739f105911a0b05b9ebbb209df7dcdb2f5b9aeb","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-3.tgz","fileCount":565,"unpackedSize":14865905,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHwiMwZn4pwR7BIRcRosAFbytJ16MvY7KfFcMyTIxwRkCIQDyDOZr49BwTRWkRKn+RRkY69CfoVhqQ5b20cJAdD8IDQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhpAwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRSw/+KZ59+yTGbyPtBREV6XL+Adq7I9+5CVWrIQnXgLlQEDJ7YqGr\r\nG8BqaPduz+CGoo5+6oPMtibHWjyO+u3IMGxziRgWZqJwASOWUHlCkDkRstj2\r\nVNyTEEX95tSYh2KCt1BF8OCSQsZNdInBdIDg15a9s8CqbStmY7y1Dn9ncku8\r\npg4LWD3TR/tAihhEk25uXX2/mWfwIeil9ty4w/F8hwg5ijUcKkNljteLzcoJ\r\nxpagIGAwewVlw+7CkjGah0x9eXYa7NbAGYIlA5rNoShruZ81Chgp2m41jMK2\r\nyNg+OsTEBvjfFKQWusALf9xt4SmtEa2scy2ykN+HZMt0jxl1dTtK4oQsaNI2\r\nlmj9QZC2s4rFrxUpl4PA3YtPTpQ2G4wwWy/gemoN/udg58pjdmt8IFDOF+Nt\r\nilxgW9o98mRIJswEh4/caYlo8gszvM9+m1PZBRPAxyuIZyb7TSPvv7AcgOGz\r\nO3q6ChMZXEttXXFZUkjF7vCHKP07uhojvy7nfE9WUEG6A8g/VIsV+SaaLTL2\r\nMcU8UNKkMyiesrvUzTqqHoaBD3wzM44tqkuQ9G7rgSswNH67mTQRKm0f/beG\r\n8rY781GFbYi5M+j6grNwnllusoEeyM4xcM/8q9fRJ1BkGRUM3JVgTvi//Lq1\r\nOyP4H7MsKMzjDmZ9V7Jm6RYMFFXB9T2V3bY=\r\n=Vfv8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bgins-fission","email":"brian@fission.codes"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-3_1669763120281_0.5054363066980687"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-4":{"name":"webnative","version":"0.35.0-alpha-4","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n- If you're using the capabilities system and workers, you may need to disable automatic capability collection if the collection method of the used capabilities component depends on the `window` object. You can disable this using `configuration.capabilities.collect.manually = true`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"9fbb3c3c6e94950f8a3670e7b82d0e3cf57b00bb","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-4","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-oAwehlkF9DMDEp/bnnf6CMG68oIe8ckWGJ3YjrlM/QBLt+jygB28h7mfZ1VSLJsVOi5O4hoogTFVmxb53E77qg==","shasum":"8f8a6a2fd7fb8eadb86e0cdd5d6fb8146e1593ad","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-4.tgz","fileCount":707,"unpackedSize":15452755,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+UD1FlYHNRgcwhNstv67+13N1hYei6RVbqJtKV5HcEAiEAiNYCvYn85/pmNDNDoJDIU4F2YMPOObSXSoOKLYG8jew="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlxiZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTFA//b2NnSQDO1y6RRVIZGfGvFpI2aHlOHo5Hldr8Ijq5KU23mpo5\r\ncPY93nWeDjgVW/C5LsNsKiXqPzipDjqWUxjH+p9bkWG51/4Ts3aERCpSTXRD\r\nWNdi5wMXWxfABxjT0NbGoHxUNwh3rFXCVqJbgy+5xF06pyf9Re/4mw8wEoF7\r\nuN4zldYHA57vAPko5vTdjlxEjTaifxNLz7M8UERMvosx1n56KnGAomIoWIYJ\r\n8mT1kYzNEeZ5lsGegF69Wdot+5Pk9Y/IbrefDqvmEI7FQc2jjXgqkEnp9xdJ\r\neSGNUS80/I69MTiGyZATKNg2pudozrVUSueQCCE4LFQ1yaAfLazdHKcN+hfD\r\nTWKUwlaL8sy3KkwIZczlBVMjRcC07vX4bT9yZd3e3fjzF6MnqcJFLVrAOVwK\r\nYTV0eWbQNVflTS7TbxOrYENlABcfcNbgXRFloinMTyoq3+QkywJ13aJaDAWb\r\ntwqUGgcjO47pXRQXkHfA3uxBaz+aU7U4Ygs74dT9IG8XSK6kcortQYNYbyHt\r\nzd3N+QBGlWewFHBUtFYWeeoPeNnIup6wut1eAX0VyDwHzBVVajaP1tUNjcy/\r\n1cokKYAJCI8PQ/Xq6QEuopMothPAskwG0GX8GlVY6F47He7B5RJNp7e2Abzm\r\n01ByEenj35ge/Dp0lVzAGTBIsYunt1klo38=\r\n=KIxG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-4_1670846617362_0.06164377153025424"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-5":{"name":"webnative","version":"0.35.0-alpha-5","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n- If you're using the capabilities system and workers, you may need to disable automatic capability collection if the collection method of the used capabilities component depends on the `window` object. You can disable this using `configuration.capabilities.collect.manually = true`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"9cad49d75ac7a3d162ad55ec20594b51bcd0d424","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-5","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-RXFEeWlFA1hwbGrVhGl2Z9bxe6r0zogBPRMaFl+bZ6La6C1JLfp7KpKMA2l8n3kOLyKMAHw2Njo2SYDg3jHorg==","shasum":"0f829721d5ed81fb873783ce498f42e3a859f3a7","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-5.tgz","fileCount":707,"unpackedSize":15452149,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFC0/26YjdT/IxhdoNwFFgxC54KwmS1xKt+aOZ0194ZUAiEA7DJADBjir5af8v0sNSFvVxf71lQlaF84bDM73TPpY6g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl2tPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQOw/+PJzNYKF9OstORDFm/20+GcGZFs1mmizA6DyxD2Pm212UNpze\r\nsM69D0pWj6OqT1bpw0V3F22lJK5Gw083TB8dR0N+GwdiRuhqHigMfYmnQG25\r\nCNLXp1GgIQsvV5WxFta7xKUdHujnAu9/Yxf457u/YPdLzPXu47Qf316kQuK3\r\nAE6NKnbq/52mPJSfCQ1fvSBChiYh+8ld78/Wz0TJp3mX7nmzPiA0QQm/HJlz\r\nHbTwSLtLdMffh6/phLrKSb5guqHmkyznh4byjwEU+bxPPUb9FXb5dr93dgXi\r\nSkciOSo/RMUN9GmXfvGUbi9xaJq8CmCwVz2ck9VcdsioBcZlo1X0JJpSniFI\r\nOB1Gn6ZbZV62FKJO/PL90bJEBJ/KS8uX3ssPcf+6SADJsN4ZZHBb+83TFd7L\r\n0US24bu+zbn5ij6xIUFx0WbjxS8V/LHdfo5UBH/YTqyX+Ds4NcDGAoXMS7EQ\r\n+v/xCUeRnszlLMDqgIuivbymGAYCywtoPIeeK+EoppTP0MJVFwP0y9J5/D5M\r\nkCGh+1Ter7tVYda5hMPhFRPdgDf96L54qoYn6mZAjywfES+B/RFpG8T83Kw1\r\nt5iQzVbyT8H5dd3bM5tEPXG126ACnucCngAlE/YwUxEZ/U13oLK+wnj8BAzz\r\nsvBjKs8Zo2u+kgpq1psLiWn6RT4xq7/19gg=\r\n=Nkff\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-5_1670867790801_0.8100989748616894"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-6":{"name":"webnative","version":"0.35.0-alpha-6","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:ipfs":"node scripts/build-ipfs.js && copyfiles --flat src/vendor/*.* lib/vendor/","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.0","@libp2p/interface-keys":"^1.0.3","@libp2p/peer-id":"^1.1.16","@multiformats/multiaddr":"^11.0.7","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"c8c9f9879c24a5d19d300326b40aef3b760883bd","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-6","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-uLO61pg/HSeqg85IwWlDSM53QNk2QoWE90FaDK1Is5SUVVkOP2cmcoep3/AUgtpaGfENPISD62QVWbWQESqBLA==","shasum":"24620efff50e2c3ff8e92ae04c9475ae88cb8776","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-6.tgz","fileCount":707,"unpackedSize":15445579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyLNwe5VknXRuHrDTB2hnXEFjn2LDk8GCh7/j/L0/JhAIhAK1lLh275ptHkJS4lvF1fdTdDqe0SPkBmwHRKPksVOp1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl25jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyJxAAoUCsAKAPX3oeEAMVv5vbd8gJmH6FxoNGsNtAQanGPA8HtJTS\r\n/oGkKtV06ymT72wpLXEcllPnTkemUOIj9ISG+gV7UDCk5h15KuCtOXN8M0dJ\r\no3pGBj/lRi01l9+jQ8iwMR6EHu70c11Eol9X42IwKo0YJUKk/8HTF1N8pAxX\r\nxeROzmJP1/r3eNpzvA61Sfa7++N+42G9JZB0AorlE40bbELkyLG/2Key9Kmx\r\nOdZprBFc93QHW0C8xlT3PjvUYgbnlOG0s+q5C9xgd7GqqD3TfX02KBkUXYOC\r\nQE5yw4cT1LBNYLdcO42cjWTZC60UPZQSuszdJCJkzKd6sytx+xSxaSpYM+JZ\r\nO53weKJMhtsbh6wVMLfNBrCbHUl5ItIAbprQ2wncIhaMPUkFETCP1fQCk5We\r\nhABuvEYJ/k7fzLlkXQ6Sz7mKaEE/Sb2zcGrYNJF/ED0yIqK+1H1JQxKMR8xW\r\nj0rTNn6i5r8bm4NccAt2ZunK2J6k4ofrA4iZLkG/Vc4g26aIqSzw/Qcx2jpD\r\nAOwa6Hm1TYQ6b198QsMUAFXbCzSh3k/S9akbJ5pF0l/qrOhjrjHLVqKmxB1a\r\nOSuLYOpCd0catUPxTnrHRtxIuNINO2lrr5mRSwDxVIel88SOSr85OW2JhM9m\r\n2VXlnzJve/bjfanTSVUEusWMWI/MYXVcQV4=\r\n=K/g2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-6_1670868579629_0.22801353305359306"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-7":{"name":"webnative","version":"0.35.0-alpha-7","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","events":"^3.3.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"98b81e742864a22a2563f812e48f14a74c4067c9","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-7","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-mRSfsG0ZwQJXZu+uXkBt/sPga5btpihMrdnJA/oObCvIQK6ooKSD3Y4Lv7LND7hKcQXM4KPLaE5W1aG6XBiUXw==","shasum":"54b2d4be78c83a07f7aab675c75a39833b8fee30","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-7.tgz","fileCount":707,"unpackedSize":15446691,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIvYAQt8oX6PgLuIODO4jnnyJAuYAI9XB9PADJQcRdTQIgRFbYvA0P66E0uS089kvRCsDbYehusLYcY0Hw7twbGSo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmFIrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/ihAAow0tKH0I4fQQY0I8rySealfhF4ht8nhJdzfmuHH4IA0aA01V\r\nuvYKp4RE85HY9MR/9jKd15xMYWeXF9kvheG/FynRRnlFILmTrOb8zXso7GgQ\r\n+7YXKG3pYf+7eZEv8DT9/y5fG34bvXkQgIuAFzijCUWA68yvDcFu68CHfvS6\r\ng7xFOtlD2FcM6tctt4SdQUWgaJ3xRc9pnvbriGOxtXLWBKcSb9Z5xJeZCVo4\r\nydd/6gSKHPKZVJ2TSbzi9nR29hX5wz2U/XQj4BtziIJib5TpS8GrpbyBq2e9\r\ntdZrnYMqd7X95j4gCFzzNSmJBcScxZ0iC3xd0slBKkczoQ0VdyH0S/bPNHzv\r\nmeB3SVhZNRltcMHWy5rMZE8Ru+JND1JCSvhuJ+OyTam/Mf6Oaok0EUIwEbE3\r\nh+iUDRhTRlp/aNKd0JV39Po8wuuymI00gun/DIWHPoC5QjZxQcA+gV25fJzU\r\nxfBV1mFYpn2MjyzBn8gDUM98VS8WPO7xXhxohUYcqKZdqZ1sUrPvZkCVRcqZ\r\nDa9lzqJaqexV/DN37HyyBYmID8PQYOSvRpc621eoWI5e4WhXws9niwaLpvHG\r\n0SEqR0k2oB0E7GffY550FkYSbSq00ubROsgqLSK7ZWMAkJ7bovbevMpK/TiU\r\n92/43fsEOJrXa3fecG8qEj7uThJ7wYNmttI=\r\n=1hxA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-7_1670926891082_0.9290900573131284"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0-alpha-8":{"name":"webnative","version":"0.35.0-alpha-8","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"98b81e742864a22a2563f812e48f14a74c4067c9","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0-alpha-8","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-9nl5FWXd+i/jlvoQY6xHUfaYAM9qD9GWktQloIlmcfO6iOv1AzY7CRFBYp6E9siaas81zqVsCiMgj2pRQfrWdA==","shasum":"59638c43dfe5ea130957e3c1c47c4110b80a8183","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0-alpha-8.tgz","fileCount":707,"unpackedSize":15446739,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrx7YsituC1R6Fhmm4bcHrjT5DZVWLgwISuqqm/SY6nwIgeZ0ANS+6JxM32HTlXeYfb4QJmTxmSQCkvH2s0jPm+Uo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmGjnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZWQ//QDpgOGhTBgIXZIf5SR3yYOZaBVWIYma9jPNwylsIvPEp8V+n\r\n6HBjg/PyW9j+LgtriqGPSrmZemRqzesPvhXqD9W2p551c+FPKKBZQcwGctC+\r\nzOLNLqxwOsUJo6GW3CSr0dF/iXxeWa0lBXBqM0S2YimIqgDPbcik1FUdgSR+\r\nyc6yxA5uIjzMpKSrbSVDtul4nurEKankTpDij7lt885qlmK5KjZo82yVxQjP\r\nRD6qbFcfPf1QL6jjPeQzQ1sioG15wdCq/+fLHLKSFrQfVxCD6MROpWa8sxU0\r\nYCGhRehRQFIyD99pMzquO04Sy5vnGSf/nAeD+0OeH8FUyaZRAy9pk4jACOzD\r\nDckN/p5brBTIqzFnoX4Rt4JXH0AvfEPZwpWbQ2QuJpp3/B55xlK9F+DWJQrB\r\n4lNzwszfnb2ulqoCphk3yN0lZxwLZ+y8MXbdTW0h00a2+rSV6iXY7phAiGA0\r\nFYAe/6EWjdHgDrxslPl8GtJzAy2iNqOqjwTY/AYrH0bp+WbB/95k6ZIaTkT0\r\nLoXcq4NyTv9icKCegk9ZMSxrmppdvb854NGnj2T0WRHSNu0bnXdfMF+BjYGt\r\nXrCwduJms0lCYkxYQoRmt36TVumeOM8m76AozA7Q7gHpNIDay4LJBAnCqYpB\r\n2IpvQ2kOx1hgg63MOWK3Vy+q3XqbBv4Q16g=\r\n=UIwW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0-alpha-8_1670932710686_0.6276869089702926"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.0":{"name":"webnative","version":"0.35.0","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request(permissions)\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.loadFileSystem()`\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## Basics\n\nWNFS exposes a familiar POSIX-style interface:\n- `add`: add a file\n- `cat`: retrieve a file\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: alias for `cat`\n- `rm`: remove a file or directory\n- `write`: alias for `add`\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)","readmeFilename":"README.md","gitHead":"6d1acf6aa15e4442ca1c1238f62f9faca8183d67","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.0","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-Simk76/VMLmet+KvFXe3msTw69zQt0n7kx+dE9yauITkyrRlAyPOO88yaPb8gBXCRmcQkFMAffJIPL21vZ/u5Q==","shasum":"3dbd5e8889155a594d1655cc3b8cbf986ec0714c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.0.tgz","fileCount":707,"unpackedSize":15447927,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsqq7eAotBb0pmWhT71qFQYU5apbtqECadamirpr8fsAiEA94Q58QtBJVwStWelSD1s/RNzc++EMVkdurYo+vgdqEo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmZK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjig/+N7LEXgjV4AWYBxVXnrN14TcknG9G34FnkYntX0g69hseegaV\r\nvkCoHirynBUGjurssbYKE2Qdz1mCDqtfmF0IQ37RFUShSl6w9JWPJ7Q5br7G\r\nWHYNEy7gTlcr6YeRbCv5rGW1OuagHwwHad74gJtrJKGyxAzW0EenNJ2G8CKd\r\nIQSs7YFMtyg4ilPC131ypombKtr8D5uIpn8/9MjhpP4jfeWs2SqUrb9+H9lc\r\nUbmrU52t2odLVf8Z0EVEkHbW61FFzJHLPHh5BW6RhoRrHYsDjwbRrcpGEv2M\r\nx4zGgOZB7MCNMo3IEQOGOm4zrsMMRq50O43bv8Ng29OZYbMwwX3zDZMtTxZm\r\njPPJnIitwCSvazxhcoXVjuoQgzUBEiOwqeTD4XdMqnZSedWhU00HsMuEm0C0\r\nf+P1ONHefkwbKzoNUTgvhuvFU1OSCTFSuSaiHxfiGVx+2JJ1h7c8TTPXad0B\r\nSIVBScRUA0+s5Yr3cGqToxWsSfNWQ4nPfRBcZOEe+LeRc1Vri093QbirNZsO\r\nPjFsurdCx6AWRLe5y1ohVjxyY0+rswpEZF7+Bduy2U16hv4wRrInSHrn5Cer\r\nKcdMOuOhJ9wymxUzujCocGzDX4ky2wgZ4qsBP7Dtd6g+xoZ5Yl/ZwGyoYBu0\r\nkmgVhv9fB/fywFqB7/qNxbWi8K3jFTMSrk0=\r\n=SAgH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.0_1671008950170_0.13593017271361774"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.1":{"name":"webnative","version":"0.35.1","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"182a8157d1c0d3c30df7c349fe3c87a348057853","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-ddd4FK0H1rr5rn4bOgtPiYDniM5kR28PdGawLkowzsZDOX2cZhJNxk98fPPuHO9K9+QbEVfR21Mh/RJmF+74Ug==","shasum":"df2d555d5bd0a728881b07aa31278da4a6879d59","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.1.tgz","fileCount":724,"unpackedSize":15771645,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAm0Zumzk0H3SGMANs+xEw+4/1Ww+34x671IoHvzikvkAiAt/4cI3CordXIFs+NLeCDows0M2Om8KhAHIKglnVJ42g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtw0cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWvw//d6G6XEla//KjlSUkpLQSkxD72VcqqU/BHSeUAlljX1KyiViq\r\nP61yMfRjS5+winHBUUMBwjgVjzZ0T4v2nO5Afa4+TMhtH2SQJmWIPbYn5AI1\r\n6TvQI+wp3Uf1FV8g6A+p5c4GwOQU9vIFUqh5cueZOGu/F9HZbvLTSovWhm4Y\r\nsKWVi2W2L2M3H85Jyy5cuBlwPZdWBRURv20jOeRTrz5VzOKyYFUnJESsXjRe\r\n7lJ0FPtBZTBvaycZVedvsvS7iP6VkHKXyYqZAUg2XMqC12v26UUHKWzJgfJt\r\n+E0mkDWdUEBcfeK+M0j8p8KS+wgD/+dFXrigEUHEyVDEMNTFlsnNxgbyVrva\r\nU92QL4sdT3CjXi98zIKGvl7yTdL8AHSBZw2Bt+2Cn98FJlCMirHtJgdaTBe/\r\nlBzNIwLWF4k7/RY2msvlWLvQ42JtyW2KSDOw5hNmt5pfJu5p/egffiSgtM8S\r\nCym3vcToNXyCH+0bZml+pOxZwQx2lYEloZEOgRO4JAwsjiyfj9Qn2n6jPWgO\r\nC+cMDsZarvGuyheusCnaGtiAvj+R1dYrN+nrt7+t7wqn9/Se4Wu1EavyNP46\r\n+jP43YbxYvHc122zv1z0DOCz9Kb7+BZp2VhXq365YhedKKsOp5zcNhDruT0J\r\nQURXIgpvhP/ybwQxwLm1MinoCIRKYvguubM=\r\n=MlfV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.1_1672940828033_0.8543856213090897"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.35.2":{"name":"webnative","version":"0.35.2","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.21","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"730d8e1ae489bc1ed2a148ba8f756712b08c2b66","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.35.2","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-2TIK8Amt2M0STz3DFpxSgbujzhHjrwqaDgyTvIghzg6qGW9eHS73KwAC4ErjshFNlOPT7w6z1mVoIB9x3AUSJA==","shasum":"569c6045b5701bfcac2aaa757d56753cabe12b11","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.35.2.tgz","fileCount":724,"unpackedSize":15778169,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRQBQPwDEAKxDjQ4GxlrjYmvL3PZZzWaAwchomrZXr4AiEAnpb67An6lmEikULcqgnNVv+pUWU03WuzSGv32AZWGbg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuFUGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1MA//SwAycvw9MDRC+EyM8MAZNkgBiYWofmhgdtnmByHFUPHQfloz\r\nUuJx6Rpfbai9CYkoaJXQHXzatayNYm/Nqd9liO4rR6bfZwk+/Goad3c/fkuS\r\ndNvCGhfP7eZoJdAfDu+4Ko5CsM867cFG+BxOK2e2dBnNrgXzVC1x7TOepmbU\r\nFxNywN78+q7AaaqlRdmjm8R58uvFmD99ku7wTdaMo+WmxIncvblmhEkGXDEw\r\nyjB07fYb5tD3GH+/zr31oKeZNs+DFDT8lJ5u7UKH/fwB6nS3EghCLziUQxRg\r\nmh+ufm1UwNF5yffsRq/ykZdLn2Ke/TtcVnornQ6MKUPN1HhREPeRNrrVI+Hg\r\n1MicpZdU1zcXi7JuwECdWOaiHJpyrzjvTrw8xX316BMXIDLFVN/bXZaO65ag\r\nHP7oUEwHjeUO+tAwb1HTDG4ereGoXWIp/8JPpJALxW+9pnBSlOUdtoHcnGst\r\npgSEC5UYkBhtBK+eELKJX0z+xXOylpL+Ebx6VDal/yjxXRu/a/TXoCclssgG\r\nDrLJGlx9xQqHfYxcqjU2ovN5irhtlDAm7JZBsSGqYheeWs3PzkQfQHmMN4TA\r\nDUuoyQLUxnrF92l+q68shVRdYtIecas10ULLWBPMNPbAyF2N2CnvcZeUiqxY\r\nqey56UDaFQ+bTSkxdnslbsWhagWMC1c/VcM=\r\n=/GxZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.35.2_1673024774240_0.8300375197931584"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.0-alpha-1":{"name":"webnative","version":"0.36.0-alpha-1","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","gitHead":"8c4465b15e901c986bce1d92866d87f4c34931cf","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.0-alpha-1","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-AWrTv2tudGu1N/najLNb7uXHkdCmxdJPqJwGMmJ3xQxv8PdcWaV/6DjbnC/2iOIVE1WzUpxV3sK5nz963xiNVg==","shasum":"cbb198257662d1b4d8754aaa48fd503d7b995046","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.0-alpha-1.tgz","fileCount":751,"unpackedSize":16653488,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsZE5Esu1EyUCa7o7Jxkc16C61IeS9IDbJw+T0QXOiYAiEAmuyjDQNAc3lQLDjY12Fn7aoaf9EZ03upa/qNdo4pIfg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2VzXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr//g/+KCsC33XmJHJ7A6WlhnUN6h3dhdFmA0ORO/9UbXt8/fl4WX+F\r\n1I4ZgEt33nMtoWom2c9l6Ov9wmnuN7e6dWbXehf//Gcok06pCrYQQOsad6Kz\r\nGsf0F+9ucEz7cSy3JzoLjXzhyXuG7ezql2IwJJTbIcLcBX/IF2qNPgC0sx3r\r\nwNNTlqwK72RhhG1vL9+Vh5kKgqG4L9MvRH3R0Kp6Lt/oSalyJ2fDkHoSwZyl\r\nAuzYN0fKNJkQZwYfDojLYQR47OdcH8+Gl/fV0rNSYeiHmXIGuEdbKeopGhAH\r\naz6Q+QuRBdonqeTW87TTtKcw5bW2bw+p/VNAfWKjH2ilNP7jFXUojSCh20mt\r\niwDcso3lB2UHTWhgmcur1NmRJZ8t0OpcH90xKcSLm0+zhYY7xfop1VN2x0WJ\r\n3jUMUtODAu6EglLfrt9f/okMHYcW5raNW9pXe1PckGCNcuB3JdW89NgmE71Z\r\n6I3xPt1qvdXrCfOrbppHwdpHmhFp5GNyFu1PF0hcX4Iyq/C3mrTSay0CdpsO\r\nd8Y3g8r3N3W8HVSmbj9IGR6S4e19wCDvW0c/4zQw+b7t3Fab4iVB6gXT/d9v\r\n3PpHUGpq9lKC2MNfW6uidbPUmA6kAvzwZTzsj3Apig0fyW8nPK/yO5f2d5YV\r\n67Q36dD1i3mXicPEw4TcPJRsqUudAeXp9JE=\r\n=AhG4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.0-alpha-1_1675189463499_0.556340563732231"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.0-alpha-2":{"name":"webnative","version":"0.36.0-alpha-2","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","gitHead":"ca333a67ae6ca6241f7a508e5463440e074d8b35","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.0-alpha-2","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-wTAfgKWPhHr4qxjvkpYW2MqSMoslLjVBYSXzlrgWjGBERqOEMa5kG890Y514FYMtxYeHo9/Ivo7yPLdw5xSBYA==","shasum":"ac2705dc7709681c0ec8ff0bf5a956b716bb4ab8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.0-alpha-2.tgz","fileCount":751,"unpackedSize":16680051,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWVHGoNT0yzHcH7sGKKVaKdVKpX5J0MkmqH9MJFJrm8QIgd6QGA8/x4Uj7R83J2+0eR4wFYxYRETWfCkb7VrtKjuI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2oXLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqc/w/+K/e3qL1ywWejnDF6Q5ub19KLfmyCIDFnwn+4SO3N/LcEapa8\r\nEdf9Teg/HR5Q0W0RYvPBInV99Hc5Ifwmr21+lSvQFMkN2XLKCnvsS4TkWbL5\r\nI9mYstUut1FCduuThTz2PkPA7wEhesx3f3eU8K5CybLYgi04GHYfHj+dMRme\r\n6XW9P70Yu8rDtIUDgsgP1IWicz0hLapHuNh2YDmB+Wf8LnxD9nPQWGU4uvMF\r\nkyThOxUpVQSec3Hyug2U6W7jiNDT84s/BaPgy9zpngknirIlqsEf2b1D4zlf\r\n2Yb94b5JMSz2t70p+0yxCotQr8MEtiK5C0Uj/mrOc+LCS/Eh6Ewje6+7show\r\nkDtMGDeWAD3JddyLYepvEC+R0K13ogzlJyFcJnNFT40no0OJy72hiHCQgK2F\r\nzSYjokn0OLiBt16ZP7QIzzgPnt0vOVnaWXf8c1fhp7yIB5PJ1vcYBsdef7ea\r\nPJ8OgUy6Wtn5St0TajalE2waxTqxxEMuh4h99Np5w2shpamrmykfd7yDUAtp\r\naJosIPl/my6SJcu1CEFbjg8MRQnrrhd4ngUe/Ge6UGMnwMk637+Kc5Q2vs3h\r\nzlUCibmBaPnDTC3y5PC2E6FmS33GsS/0tS3jkYY1QZs3tutbi3sO60gTv9kq\r\n7qs6powsrBLY+SLHXBlaabwMexgjQejiGuE=\r\n=S2hs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.0-alpha-2_1675265482661_0.2596315887535787"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.0-alpha-3":{"name":"webnative","version":"0.36.0-alpha-3","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","gitHead":"65cc08f067bb51948b74fa6430d2ba23da480ab5","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.0-alpha-3","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-fgbPD2ueNt6GVj+O608mOl9l6XB80WPkdpzOYAAqQIZJHYvikrAL7V4wGxixrjMFU/M5NY6ZDnwAtvCRaTj8XA==","shasum":"1f480914df2568de93db8bbded47afa9a8dbedc8","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.0-alpha-3.tgz","fileCount":752,"unpackedSize":16728815,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/AXfgL0B3uEqS0De0TN/z5dRIPxQbFoycRgYog35NOgIgDO+iPBHR42WgEJrtfzbLKqbKiMykCsg8/WCUeGFWiwA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2qnmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLtw/7BVdtP8Yw3UOaWLLTNkPNTDtGQteLNZZm5M4gPMkMfLQ+FFqM\r\nA/plw+3mBJ9bUCiTPxDhZWSTtdISet1e+pf3xBOMG3t3XcHe6JoqZNI1oHTj\r\nzzhE7YkhdVlDFSl+JoQCzFcTzp8q+rdW96MRDEHKTeM89WmkdbVOi15dIOaC\r\nCW0lbpnMftez5sFCtQGgTUQ1CTUXf4tZKjv6jmoAykVGcfyetm6ArJ9p4qVn\r\nDRfggNtB2TsO1VMpsOoQb/ZE+hm5kUiFP3uheqmp6lOkYHIgK7LAyU10sPuR\r\nPs0TTxdR8XvqhklzE1WGOiDVr5vP9b+sYzMeCOYnK3GAA6LOToxKOBkMKtfT\r\ndd+VqVXJGgAdlnBIaViJQTg22LKQUfTGv2xTfscFxF3L/3iYz1ngOgjoTe7h\r\n/2ZrFEiOnbF8JIOX64Bza+0urxZcfIGmyKXZgSBsb6Q/VdwXnqSz+0DV0BjT\r\nfQ12RHg9d9tI1XrFq1GJ1MDzj9UPwjMUaNCkZsHu8imwqdLE9x8wBk50LAvB\r\ngm7TBXxp8mFCr+hno0mrFX+ss2UL8LMOH3wgZYnI69C5HQs/R3WW1Ugtf9Qq\r\n2SMc4eQ9C8peQ9EooHxPiXOgjkmZzl53Ug7rcCWT+jRpBkdc1YkznYv4w86C\r\n1o6Nth7QajLFqghiGD4s8I8M3OOkY8A0XKE=\r\n=lC/0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.0-alpha-3_1675274726374_0.39864581427480994"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.0-alpha-4":{"name":"webnative","version":"0.36.0-alpha-4","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","gitHead":"037d0197c2a534ca753996bc6c3303dda46d2840","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.0-alpha-4","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-UIlyI4n6Z83dxCfGBCdwTA0PimNV0qk6AC6Rh8vzjqxDNqyYAgNKMM7s7kCdp4GuN+hF0x4vhJ1nrej9bbD9sQ==","shasum":"4be0c3a8b41cd71507c80f0502b4ed7c36605b9e","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.0-alpha-4.tgz","fileCount":752,"unpackedSize":16728909,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUmOGcZkmfEus/3+RBfHEhEPkwQimlDxa/qlA2Z29iDAIgKpgTmd11JyiaLcpm26NcNAseXiQG4/7LdqUGzj0kXVw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2+NjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjiA//dkBbvxq9Sn7MTfcJM/qB5EMwA33QSeq/ltNv9ggKGOydYsdF\r\nzbFTat6+/mqi9I5F2fCI3XOmxIa5IXhNGsC8Expe2b+CgVhYezueWBe1lHF6\r\nX4CVcrK96e3tIHvUqmNopWjWH09lQacB0oXNFkNKnVIjR544AXJAvfw1iNhB\r\nS6CDpdd9aGz/XBNUL/WDrLXe1/aYibBHAabRALyhUsnwAh7R3eF7ZT6PLpFp\r\nizMZarlmvlVhJL0rL7y7a1Rqu0Ka0+LeBOv7cX0uinmBrE/rQsCLUcuf84k3\r\ng3RVLv6pf+A4XNWZFdrnEMguo/jvyUm5FECsMnainuMAjuNUvm/BjR3wXRwZ\r\nJjbQm2po/+c4q67pCgF8VJQKbFrn9K/UIGk0XrgEFJb/DkPpCBc9jk+l12Et\r\nyYq2v0Fof7xTp0ffx0fl78V8JP5oYr6aNDTzb/XL9ac96/4jx2uHjCd1swFF\r\nWwZ6CRLousR5gtqpbfegnovyT69i5gNUmEQboWsGrc7yxeVWuY0Z7o5oEDjI\r\nOw76QRLWDCU4eu+nO7Gx7MjPV/sBP1VWKI00gNwNNM/JUVcI5ZHcWTJ1E7cn\r\ni1Ia8luAuiV0bOvOP+6hfejAuOctgporJXE7mEAA/bCxanHqiMaSGbtfhmVX\r\nj1fPLVo9WBzJfM9E1ZCVlCNPwEXJLWHLLjk=\r\n=Q6Jm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.0-alpha-4_1675354979410_0.27727163674152555"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.0":{"name":"webnative","version":"0.36.0","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"0e3224706f6565b29e327d7392b88b0e804e5f99","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.0","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-gU+a3EvyqcG8yifZW+5ioQcuq/fRX4K3PXDqr2cSYnQhWc3C6DW5r/g+N5uFFL16huCJbn1lg0iSPJAu9El5Ww==","shasum":"6979da11b60c9590cd955de8b17a9902e0930a6c","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.0.tgz","fileCount":752,"unpackedSize":16728711,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDADdNs9rS3iJGy55oFF+ThMXaRvAtKEllz2rNNmE/8ewIhAM5xzHQZIi6k2mpmCNu7UOnhraN1xVckT6j6q2tcKazY"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2+9yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6mw//ZPFAEY2czv1gqWy4hnpC9C6O8ddl09qZpF44thnIhf+JIguC\r\nNwQfNXh6Rv+V+pJEphuaNd61BDK5xwpFw7SzGXeF3i5NVqizsEjwiuf9c4Fq\r\nv2mtTvwKFZ6ekelhemNCFQr2skrKsKYcFDPltvJMjuABktJZwaEcw0E8k+0u\r\nw/a6EQR6JyC5cCz6wH/bB0gFvd/pQKJ7sNjrFIjrs4738+4F7dicyW9UqBSk\r\nPiyiEmohRP+4etBqAig6rfcwZSqx5vWN5cv21SlCptH/eGlzgYuj6LulEXiP\r\n9jdbG9RsW64NFSupACkHOCm8ipbrq5MX6+q7PZ+dO5+zFb3ke2jvJPjGYGUu\r\nysAUKApnt9K8g6qhQXEkaKVgfl85IDJwgnrOu5Tdbs4XywdYHlsrhJFumDMV\r\nE0IB828AaB44p7qEN1HWt3BKP6ZX5pP65Jpvz2vFH9heJBY7fAEBRwoq0oPx\r\n7foRyrGUt1KkBlGLANJ2idW3EDplstwwHcC3e5wrFoGwxtFAv1wdbzEmA4Z+\r\nmXCx8rEd37TLbmVTc2G95QB1fFWcYLsetA9RFd9fcLxtsrmbCLtfu0kn+XNg\r\ne/xVqgTdYi4LcRkSsCCTBg3LnhX5uKs+8X7m5u6qOlUfrduVSAbQ0Gj67Jiq\r\nWXiO1OFm7V4Og+WGSSqxNK56SCvQ6oJ3+4g=\r\n=+9mw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.0_1675358066405_0.7732818473621572"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.1-alpha-1":{"name":"webnative","version":"0.36.1-alpha-1","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","gitHead":"82acae3049d25c4cb36ba37e075c089b7298ce2c","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.1-alpha-1","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-tnymR5TLzTOVYPIuB0vhDnNwsC8b/i94AxpiPh+eWaF1tiLij2bTBrtKz6d14KykGTjOioHvlBy04t5V2Uds9Q==","shasum":"a8115d8561827346edfd68947c03a4282d9d2200","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.1-alpha-1.tgz","fileCount":752,"unpackedSize":16729340,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEupLSYaJ85MtWOtmGTAfy3e95uHCHP2K1vD1acs/XdwIhANdpyJzuvpSEee4+EQeSUZ2pnM3Yosizxlu2mCKEjdmc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3N8GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGgBAAhqTenrgCuniT6XKIQIirk7F+IVQkf7b8e87rwAhwVsmbX2TT\r\nOaklP1/rAX1lDvdomUDKhJsGxUdYsc7aH89PrlaN1GtmUpGyIU3+d9jqqWBH\r\nY1gQcl+DcbJVkz0nH8uzcpcENmTm60wgyAJP3fW+90S/lRalNTfZyic5th+I\r\n0UprfGHK4zz0L7JkjO8aXANr69nQqMQjBYsVMbOX2L5OSftp7gO7t1uR5JkH\r\nbkobB2n86foCXtENnCa3Y6IZAlRhGkltFDUqFfhf9MnO+0EGNDUDJj9RJ7nw\r\n9+IjwYBFJRcTezwJpO0GfsrSNuw0tFhy2hv0pCO0QCK7b05GccT6uO4Ls5Yi\r\n17MExmX4bgY3F6rMpi/3NuHtCa6cXf+IMN/qX6kBj33edh4cS4+ynYyTpswX\r\nFMZmBZDgFS8poO0mGRwuouWrzv8R3AL1IaU2qS6buy1i7cx8SaVm7E93pigf\r\nvvs6Md3a6t/cPDFtQxQwG/PTz7NnTOMAHWYn5it2mEoT2Th0/q8ddxP1i3bv\r\nrtM3p7qMt3bu+4ghUfhs5/ThMKHai9VA8D9jkpbZoFFu69lAoYE2AI/tCtgv\r\nJuAsIzAels6ay5DC/8iMPjtkmYUZfqUcw9KI97qERs40U9E6htqaMBGPo4Ad\r\n60elR4OrUbquFUYB74+zek0u+NKWm2q1grY=\r\n=hgEU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.1-alpha-1_1675419397801_0.4255504988197667"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.1":{"name":"webnative","version":"0.36.1","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"d0ecd0a963aff4c4fcab6017f70e91cdf45c2d7e","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.1","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ynBggqaQq3NFNkpyXMO+tpGHVZbE3clHTAQz6F2Zo8P8cTBacy6g5LDJHB1uKwUUvxQ43BkI/1oAyFl7w/1knQ==","shasum":"a7ac17b025fe56c0780bd66e80eedc54012ea462","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.1.tgz","fileCount":752,"unpackedSize":16729251,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwP7fZ9SPq889j7LXBGpk5PIQG79RIyWK3UQJ0XY3dLQIhAM8tHIFnkk3lcUue2aYbAlkauNoZE1qvkU7ZN1qW1FSv"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3VuNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp52Q/9FkuhWp3NZAiiHbBegeZUhCO8wlVurLMvNYOVYtFhFSbauIXR\r\nBvmupk8oqIa6puuH3RlfmopCwPsm+7Bh/NUJUepmKqVoWvMhRwI5kW0cHWzF\r\nJLSi0E+DWSgoQ3NC9Pf7IFAJWJHXptopYdtLHMBSkS9azOHEqy7aa9obDoDA\r\nzmjxjCNg8YyjXUHJa/K2A72r74TDmvviA1lprRQYvRCn8SA3rDLv71/yIO6T\r\n4Xf0vYOMjWVcE93hP9xRzTo+KE+Sj0qNIrcJyXkazWATDne1I4tGoX9x6UI4\r\nV3WG8jtToEdVZ4i4v4peO9EGDjCnW93SZ5mr4WXgoJ8HjYEEJfm9bjGWpYmW\r\n3/RW7B18NOq7v9A0+/3EP7US/S8FT+OFastM8xggi/OMmN71hBLkT+JRl94P\r\nYMRzkBW3mm/zrBrmTV/VnDIlIqyoe/fc/tn7AyLonS3uqcf0ps2QBlXHUpXZ\r\nOLN3VhqI4tljiM7kk1y97Ns2nPhd20SXkYfFZjOuB/mVN53vaRtPEtK7y6ce\r\nDAvbxskEh/iPn7WJHD67XPSp2Dl8R2VG5WUOan40q7qSh9xX10KrtJSUNQlE\r\nWamrCjGe+78oBs+3p4ptv9hO3FfFlCmKoZFvEKnTJAVgo5pjfSNJjFC9+PW9\r\nNn3+ZDiMpzJRAT+mha8YEIJmp9f3F4UizN8=\r\n=O+Fb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.1_1675451276816_0.3442729158658888"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.2":{"name":"webnative","version":"0.36.2","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"cbbdb5de1328fb3237ac64e3c36aadd2c674d003","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.2","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-WrFT/BEEro+QC21gZuegBI3bOR1x0j4AxZTWHa8fC7nhMi1rdc/KuAuPV0yKB7T4xlB8j00N44B+pdfa/h4Rww==","shasum":"b22320fe82438f69a15156e21c7b201c8e15ed48","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.2.tgz","fileCount":752,"unpackedSize":16733928,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAqn9kn5S6TZdmTPcj2PFjRFmSex6FsMcMJa7k/J7ZyJAiEA96aWHgWKtUG0pyX7EPcgw4Knm2Ma2awT2I2lJtFi54I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4mjZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVbw//fCSuyltwboejB7562Mc37f112RaDRWZduK195MJIHhnC/LX1\r\nJbF/TdU9a2fJhfs3+RZxQvakobSsrhP16irMUEo7gU3YujGNqh1JWjOh8Iq8\r\nzzry//YSfzOyQInLKQXvyjZJoaY36u9MQXb4bzQW1cEe2qHDPhOFUKbYV9qk\r\nApcMbsJxqS2j+gEloyVXCwCG7Gfz3QbznPa4/22eLzN5lD0OHsLsrvlBOMMn\r\nFzx6Nhg2pEp231IbCchTvWBSzMIIBwnjefvUvcFr5n4CrI6ju6219ZYJFPGZ\r\njbGIZXg/W9AyJX9dqP3+kGoQmbrg7REryT2NdlCnsYemnQR6nAlQoqP/gY9x\r\n/cyHDfm0T2tNmRUxr9dryUK79iovLgPRNewGLsQTBlJSnurPQi6BKRb+Xb1P\r\npvAZqfhAqY2jS2glDzT9gT2jytz4G3DK7Ga7AeDal7ZNKQaUO4FG4Na3s8pI\r\nA6kNU1rciKsRdhJrYIXWuJtwAV+fZ2dNP1UdTgE71iX77+yBhTw0xY3RuhHd\r\nKT+7GJJIOpyoyOkEi7D6J++pT3Ox1nQ/4obdsUMb8w0aPhXjKgh0pCaeYROF\r\nhTp7p/87vLvmpR1YCYYiUbR12wyGRX/J59v5AOxrAEqd4i12Ekz69bZnTSox\r\nDX5Cr5khG4vlkn/SxWf3Y8DPuCKXoH5cB+Y=\r\n=v+ty\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.2_1675782361171_0.054892920722102057"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."},"0.36.3":{"name":"webnative","version":"0.36.3","description":"Webnative SDK","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./lib/*":["./lib/*.js","./lib/*","./lib/*/index.js"],"./*":["./lib/*.js","./lib/*","./lib/*/index.js","./*"]},"types":"lib/index.d.ts","typesVersions":{"*":{"lib/index.d.ts":["lib/index.d.ts"],"*":["lib/*"]}},"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"homepage":"https://webnative.dev","license":"Apache-2.0","engines":{"node":">=16"},"scripts":{"docs":"rimraf docs && typedoc","lint":"eslint src/**/*.ts src/*.ts tests/**/*.ts tests/*.ts","prebuild":"rimraf lib dist && node scripts/gen-version.js","build":"tsc && npm run build:minified","build:minified":"node scripts/build-minified.js","start":"tsc -w","test":"mocha","test:gh-action":"TEST_ENV=gh-action npm run test","test:imports":"madge src --ts-config tsconfig.json --extensions ts --circular --warning","test:prod":"npm run build && npm run lint && npm run test:imports && npm run test:gh-action","test:types":"cp -RT tests/types/ lib/ && npm run tsd","test:unit":"mocha --watch --testPathPattern=src/","test:wasm":"WNFS_WASM=true mocha","prepare":"npm run build && npm run docs","publish-dry":"npm publish --dry-run","publish-alpha":"npm publish --tag alpha","publish-latest":"npm publish --tag latest"},"dependencies":{"@ipld/dag-cbor":"^8.0.0","@ipld/dag-pb":"^3.0.1","@libp2p/interface-keys":"^1.0.4","@libp2p/peer-id":"^1.1.17","@multiformats/multiaddr":"^11.1.0","blockstore-core":"^2.0.2","blockstore-datastore-adapter":"^4.0.0","datastore-core":"^8.0.2","datastore-level":"^9.0.4","events":"^3.3.0","fission-bloom-filters":"1.7.1","ipfs-core-types":"0.13.0","ipfs-repo":"^16.0.0","keystore-idb":"^0.15.5","localforage":"^1.10.0","multiformats":"^10.0.2","one-webcrypto":"^1.0.3","throttle-debounce":"^3.0.1","tweetnacl":"^1.0.3","uint8arrays":"^3.0.0","wnfs":"0.1.7"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@ipld/car":"^5.0.0","@types/expect":"^24.3.0","@types/mocha":"^10.0.0","@types/node":"^18.11.9","@types/throttle-debounce":"^2.1.0","@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","copyfiles":"^2.4.1","esbuild":"^0.15.13","eslint":"^8.7.0","expect":"^27.4.6","fast-check":"^3.3.0","globby":"^13.1.2","ipfs-core":"0.17.0","localforage-driver-memory":"^1.0.5","madge":"^5.0.1","mocha":"^10.1.0","rimraf":"^3.0.2","ts-node":"^10.9.1","tslib":"^2.4.1","typedoc":"^0.23.24","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.8.4","util":"^0.12.4"},"gitHead":"6cb082e2c3af8dc0ba06b4265886dc5b823974ac","bugs":{"url":"https://github.com/fission-codes/webnative/issues"},"_id":"webnative@0.36.3","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-MucN6ydnyY5E8GczuARAWXSOn3+yjXKSLNTIPeJhcFmZpxPBDRfpZ0SpKJjKWtVLNiEaUQibeiKsIYDfij/wIQ==","shasum":"2c25773813fda4147da86348f70616253afc46d9","tarball":"https://registry.npmjs.org/webnative/-/webnative-0.36.3.tgz","fileCount":753,"unpackedSize":16738592,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg+Mf1YcT0d4RGLILSKD+GDVKoh/NEHC7LWo61xEc4tgIgOTDmOZVw1fSmNeDh/zolJ5VyHtRqqXX4pa9VLnZ51J0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7kyvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOfw/+NComIN7o5j2n0WblleBNQnda/SatavJHJ++3wVuYShgAzZ6A\r\nUiJKNU6dGmYyXY1qn9hd+OKq3jmlOou/EZ3EYv224RD/pHbyHo+WS21OhDLK\r\nUfo9fA9YMWfI1Clo4cceyH1a4tddQF1C/t29Y/AN2To3rKr+o6TzAngSlbsc\r\n0iwXCLFQ2w/YSpp1NME6vEzHyqsmGL1R/0ymnSduxrmNrUHUGcFf9rpUOhgs\r\n94Zrvf0uXVlbRhOzhwZ+/PfZPxKbI/GFoftjjeLbxVQv33PqJx5YEMCFTOto\r\nOWxrTNgHN5x5bcApjT6MKGJY2F7+HZFa5xAWLRrwJuazcYrxy3q7CQmxlWFh\r\n37+Pv34/sRKObhtMgbWq67hZsJoXCmy3VKp8jHhH9Ba4E1xfa/RyyI/69Hjd\r\nh2lCq/5e1kPSsbuCDnEA+Wx4y3DtbtaF0PKI2pThaZUlwn1IoZinNEpJEOWn\r\nVNTsgdaxbBsfqeAGMKwIt8SzoVMExM2tFW3kfd2jMAYmzs6K3l/ymtsdV2sR\r\n8HOle+qKHi9V8OodzXqVZ6uF1U+W5lzp3DmCeMtGW7GRGAIcMC8FJLA7+Enc\r\nSEkJ+Ijvt0qPA9gZcSultjWXx0iNrHSSweBT4YUci+fovN3l4nBm6/4Ue1tE\r\nnP8fwTiNtxycnMH1hgumMMyzOjCPoOVX5Y8=\r\n=dCIt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"icidasset","email":"icid.asset@gmail.com"},"directories":{},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"walkah","email":"walkah@walkah.net"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"dholms","email":"dtholmgren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webnative_0.36.3_1676561582839_0.016033612613070236"},"_hasShrinkwrap":false,"deprecated":"webnative has been renamed to @oddjs/odd. Upgrade to @oddjs/odd."}},"time":{"created":"2020-08-14T20:50:45.462Z","0.0.1":"2020-08-14T20:50:45.769Z","modified":"2023-04-13T17:05:23.088Z","0.16.0-alpha-7":"2020-08-18T23:11:55.389Z","0.14.3":"2020-08-21T12:10:14.184Z","0.16.0-alpha-8":"2020-08-21T23:25:12.294Z","0.16.0":"2020-08-24T16:56:18.750Z","0.16.1":"2020-08-24T18:57:48.715Z","0.16.2":"2020-08-24T20:59:09.659Z","0.16.3":"2020-08-26T18:11:40.348Z","0.16.4":"2020-08-26T18:51:17.868Z","0.17.0-alpha-1":"2020-08-27T19:12:06.081Z","0.17.0-alpha-2":"2020-08-28T15:33:51.580Z","0.17.0-alpha-3":"2020-08-28T16:11:40.425Z","0.17.0-alpha-4":"2020-08-31T14:23:01.508Z","0.17.0-alpha-5":"2020-09-01T18:09:35.895Z","0.17.0-alpha-6":"2020-09-01T18:54:12.268Z","0.17.0":"2020-09-01T20:24:27.779Z","0.17.1":"2020-09-02T21:01:54.588Z","0.17.2":"2020-09-03T17:37:14.417Z","0.17.3":"2020-09-03T20:01:05.682Z","0.18.0":"2020-09-15T17:49:10.460Z","0.18.0-alpha":"2020-09-15T20:06:36.385Z","0.19.0-alpha":"2020-09-15T22:13:09.083Z","0.18.1":"2020-09-18T13:52:51.925Z","0.19.0-alpha2":"2020-09-18T16:55:26.145Z","0.19.0-alpha3":"2020-09-21T21:11:56.257Z","0.19.0-alpha4":"2020-09-23T14:46:42.030Z","0.19.0":"2020-09-23T18:28:38.655Z","0.19.1-alpha-1":"2020-09-23T20:20:16.140Z","0.19.1":"2020-09-23T20:28:05.847Z","0.19.2":"2020-09-25T13:44:22.705Z","0.19.3":"2020-09-25T15:00:10.497Z","0.19.4":"2020-09-25T15:10:26.723Z","0.19.5":"2020-09-25T15:41:11.960Z","0.19.6":"2020-09-28T17:20:53.819Z","0.19.7":"2020-09-28T18:31:21.498Z","0.19.8-alpha-1":"2020-09-30T19:34:47.953Z","0.19.8":"2020-10-01T19:36:42.067Z","0.19.9-alpha-1":"2020-10-02T16:24:59.586Z","0.19.9":"2020-10-02T16:40:42.656Z","0.19.10-alpha-1":"2020-10-05T14:17:52.803Z","0.19.10":"2020-10-05T18:18:19.124Z","0.20.0-alpha":"2020-10-13T18:06:35.418Z","0.20.0-alpha-2":"2020-10-15T21:09:41.000Z","0.20.0-alpha-3":"2020-10-16T01:05:51.155Z","0.20.0-alpha-4":"2020-10-16T15:51:10.003Z","0.20.0-alpha-5":"2020-10-16T16:09:16.531Z","0.19.11-alpha-1":"2020-10-19T13:33:47.654Z","0.19.11-alpha-2":"2020-10-19T13:48:13.972Z","0.19.11":"2020-10-19T14:26:49.421Z","0.21.0-alpha-1":"2020-10-28T16:58:02.614Z","0.19.12-alpha-1":"2020-10-29T17:24:24.304Z","0.19.12-alpha-2":"2020-10-30T14:14:50.435Z","0.19.12-alpha-3":"2020-10-30T16:00:45.424Z","0.19.12":"2020-11-02T19:21:37.724Z","0.20.0-alpha-6":"2020-11-05T15:28:06.537Z","0.20.0-alpha-7":"2020-11-05T15:44:15.898Z","0.20.0-alpha-8":"2020-11-05T16:03:44.492Z","0.20.0-alpha-9":"2020-11-05T22:48:06.380Z","0.20.0-alpha-10":"2020-11-17T17:26:05.889Z","0.20.0-alpha-11":"2020-11-23T19:47:59.276Z","0.20.0-alpha-12":"2020-11-23T19:58:11.146Z","0.20.0":"2020-11-24T16:43:48.162Z","0.20.1":"2020-11-24T16:56:46.276Z","0.20.2":"2020-11-24T17:57:56.424Z","0.20.3":"2020-11-26T15:22:45.356Z","0.21.0-alpha-2":"2020-11-26T15:43:08.654Z","0.21.0-alpha-3":"2020-11-26T17:57:30.037Z","0.20.4":"2020-11-30T16:42:57.504Z","0.21.0-alpha-4":"2020-12-04T22:06:07.060Z","0.20.5":"2020-12-08T22:24:43.975Z","0.21.0-alpha-5":"2020-12-16T18:28:11.622Z","0.21.0":"2020-12-16T20:20:12.360Z","0.21.1":"2020-12-18T20:26:22.025Z","0.21.2-alpha-1":"2021-01-12T18:23:39.340Z","0.21.2":"2021-01-12T18:31:17.027Z","0.21.3-alpha":"2021-01-22T17:11:17.034Z","0.21.3":"2021-01-22T20:20:39.330Z","0.21.4-alpha":"2021-02-12T16:53:23.302Z","0.21.4":"2021-02-12T17:16:39.141Z","0.22.0-alpha":"2021-03-10T20:32:54.333Z","0.22.0-alpha-2":"2021-03-11T17:59:53.263Z","0.22.0-alpha-3":"2021-03-11T21:27:47.352Z","0.22.0-alpha-4":"2021-03-11T21:57:41.493Z","0.22.0-alpha-5":"2021-03-12T16:34:15.240Z","0.22.0-alpha-6":"2021-03-15T20:39:01.727Z","0.22.0-alpha-7":"2021-03-16T17:33:24.583Z","0.22.0-alpha-8":"2021-03-16T20:16:38.698Z","0.22.0-alpha-9":"2021-03-17T13:24:17.356Z","0.22.0-alpha-10":"2021-03-17T20:18:17.915Z","0.22.0-alpha-11":"2021-03-18T17:03:16.325Z","0.22.0-alpha-12":"2021-03-18T20:06:53.332Z","0.22.0":"2021-03-22T16:13:18.909Z","0.22.0-alpha-13":"2021-03-22T22:47:33.194Z","0.23.0-alpha-1":"2021-03-23T17:29:39.564Z","0.23.0-alpha-2":"2021-03-23T17:41:40.040Z","0.23.0-alpha-3":"2021-03-23T18:36:58.917Z","0.23.0":"2021-03-25T16:17:43.039Z","0.23.1":"2021-03-26T15:32:30.453Z","0.23.2":"2021-03-26T16:06:47.748Z","0.24.0-alpha":"2021-04-15T15:30:56.471Z","0.24.0-alpha-2":"2021-04-19T15:17:10.719Z","0.24.0-alpha-3":"2021-04-19T15:28:32.704Z","0.24.0-alpha-4":"2021-04-19T18:42:57.737Z","0.24.0-alpha-5":"2021-04-19T20:25:10.946Z","0.24.0-alpha-6":"2021-04-20T19:18:30.765Z","0.24.0-alpha-7":"2021-04-21T14:32:36.513Z","0.24.0-alpha-8":"2021-04-21T16:17:04.852Z","0.24.1-alpha":"2021-04-22T17:09:39.854Z","0.24.0-alpha-9":"2021-04-27T14:25:02.223Z","0.24.0-alpha-10":"2021-04-27T19:07:53.826Z","0.24.0-alpha-11":"2021-04-28T16:28:52.758Z","0.24.0-alpha-12":"2021-05-03T19:33:32.406Z","0.24.0-alpha-13":"2021-05-04T19:38:28.257Z","0.24.0-alpha-14":"2021-05-04T21:27:03.561Z","0.24.0-alpha-15":"2021-05-06T13:40:22.834Z","0.24.0-alpha-16":"2021-05-06T14:10:08.036Z","0.24.0-alpha-17":"2021-05-06T21:30:07.345Z","0.24.0":"2021-05-07T14:02:00.641Z","0.24.1-alpha-2":"2021-05-07T20:25:25.799Z","0.24.1":"2021-05-07T21:59:07.767Z","0.24.2-alpha":"2021-05-11T19:04:48.751Z","0.24.2-alpha-2":"2021-05-11T19:53:42.499Z","0.24.2-alpha-3":"2021-05-18T21:30:12.597Z","0.25.0":"2021-05-19T16:58:06.607Z","0.25.1":"2021-05-19T17:10:17.772Z","0.25.2":"2021-05-19T19:20:30.490Z","0.26.0":"2021-06-29T15:39:10.276Z","0.26.1-alpha":"2021-07-21T19:17:28.984Z","0.26.1-alpha-2":"2021-07-21T19:21:32.861Z","0.26.1-alpha-3":"2021-07-21T19:27:06.995Z","0.26.1-alpha1":"2021-07-22T11:52:18.162Z","0.26.1-alpha2":"2021-07-22T13:35:28.224Z","0.26.1-alpha-4":"2021-08-02T17:13:28.755Z","0.26.1":"2021-08-05T16:00:23.497Z","0.26.2":"2021-08-10T17:17:39.524Z","0.27.0-alpha":"2021-08-18T16:20:25.248Z","0.27.0-alpha2":"2021-08-26T14:10:10.219Z","0.27.0":"2021-08-26T18:21:08.030Z","0.28.0-alpha":"2021-09-13T15:06:17.737Z","0.28.0":"2021-09-14T15:33:31.451Z","0.28.1-alpha":"2021-09-27T18:42:14.511Z","0.28.1":"2021-09-29T14:52:59.500Z","0.30.0-alpha1":"2021-10-20T13:28:38.468Z","0.30.0-alpha2":"2021-10-26T10:21:56.280Z","0.30.0-alpha3":"2021-10-26T15:23:26.774Z","0.29.1":"2021-10-29T08:50:25.558Z","0.29.2":"2021-11-10T09:55:14.447Z","0.30.0-alpha4":"2021-11-12T19:29:32.057Z","0.30.0-alpha5":"2021-11-12T19:34:22.029Z","0.29.3":"2021-11-12T19:41:54.638Z","0.30.0-alpha6":"2021-11-23T08:34:40.441Z","0.30.0-alpha7":"2021-12-08T14:09:14.076Z","0.30.0-alpha8":"2021-12-09T22:25:31.755Z","0.30.0-alpha9":"2021-12-09T22:54:09.058Z","0.30.0-alpha10":"2022-01-12T15:37:06.646Z","0.30.0-alpha11":"2022-01-13T16:39:06.972Z","0.30.0-alpha12":"2022-01-18T20:07:06.107Z","0.30.0-alpha13":"2022-01-21T14:36:05.561Z","0.30.0-alpha14":"2022-01-21T15:25:41.172Z","0.30.0-alpha15":"2022-01-25T11:37:22.983Z","0.30.0":"2022-01-26T10:49:16.317Z","0.30.1-alpha":"2022-01-28T15:28:13.764Z","0.30.1-alpha-2":"2022-01-28T15:36:02.954Z","0.30.1-alpha-3":"2022-01-28T15:38:21.973Z","0.31.0-alpha":"2022-01-28T15:55:24.172Z","0.31.0":"2022-01-28T19:09:25.172Z","0.31.1":"2022-01-31T12:15:02.190Z","0.32.0-alpha":"2022-05-03T14:26:26.339Z","0.32.0-alpha-2":"2022-05-03T16:51:24.936Z","0.32.0":"2022-05-04T13:03:17.736Z","0.33.0-alpha-1":"2022-05-23T15:10:15.417Z","0.33.0-alpha-2":"2022-07-26T14:58:08.043Z","0.33.0-alpha-3":"2022-07-27T15:45:14.553Z","0.33.0-alpha-4":"2022-08-02T14:50:50.870Z","0.33.0-alpha-5":"2022-08-19T08:42:21.736Z","0.33.0-alpha-6":"2022-08-19T09:36:12.088Z","0.34.0-alpha1":"2022-08-19T12:48:13.032Z","0.33.0-alpha-7":"2022-08-19T12:59:41.789Z","0.33.0-alpha-8":"2022-08-19T16:22:17.882Z","0.34.0-alpha-2":"2022-08-24T10:33:28.473Z","0.34.0-alpha-3":"2022-08-24T11:02:16.174Z","0.34.0-alpha-4":"2022-08-24T11:16:53.207Z","0.34.0-alpha-5":"2022-08-25T14:51:23.546Z","0.34.0":"2022-08-25T16:34:49.844Z","0.34.1":"2022-08-29T14:53:24.661Z","0.34.2":"2022-09-19T11:22:38.793Z","0.35.0-alpha-1":"2022-11-24T18:15:45.292Z","0.35.0-alpha-2":"2022-11-24T18:35:31.587Z","0.35.0-alpha-3":"2022-11-29T23:05:20.588Z","0.35.0-alpha-4":"2022-12-12T12:03:37.670Z","0.35.0-alpha-5":"2022-12-12T17:56:31.140Z","0.35.0-alpha-6":"2022-12-12T18:09:39.889Z","0.35.0-alpha-7":"2022-12-13T10:21:31.442Z","0.35.0-alpha-8":"2022-12-13T11:58:30.961Z","0.35.0":"2022-12-14T09:09:10.539Z","0.35.1":"2023-01-05T17:47:08.350Z","0.35.2":"2023-01-06T17:06:14.516Z","0.36.0-alpha-1":"2023-01-31T18:24:23.799Z","0.36.0-alpha-2":"2023-02-01T15:31:23.014Z","0.36.0-alpha-3":"2023-02-01T18:05:26.598Z","0.36.0-alpha-4":"2023-02-02T16:22:59.681Z","0.36.0":"2023-02-02T17:14:26.701Z","0.36.1-alpha-1":"2023-02-03T10:16:38.097Z","0.36.1":"2023-02-03T19:07:57.076Z","0.36.2":"2023-02-07T15:06:01.482Z","0.36.3":"2023-02-16T15:33:03.200Z"},"maintainers":[{"name":"andrewvivash","email":"av@andrewvivash.com"},{"name":"appcypher","email":"appcypher@outlook.com"},{"name":"bgins-fission","email":"brian@fission.codes"},{"name":"dholms","email":"dtholmgren@gmail.com"},{"name":"expede","email":"be.zelenka@gmail.com"},{"name":"icidasset","email":"icid.asset@gmail.com"},{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},{"name":"quinnwilton","email":"quinn@quinnwilton.com"},{"name":"walkah","email":"walkah@walkah.net"}],"description":"Webnative SDK","homepage":"https://webnative.dev","keywords":["WebCrypto","auth","files","distributed","DAG","DID","IPFS","IPLD","UCAN","WNFS"],"repository":{"type":"git","url":"git+https://github.com/fission-codes/webnative.git"},"license":"Apache-2.0","readme":"# Webnative SDK\n\n[![NPM](https://img.shields.io/npm/v/webnative)](https://www.npmjs.com/package/webnative)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nThe Webnative SDK empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:\n\n- **User accounts** via the browser's [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or by using a blockchain wallet as a [webnative plugin](https://github.com/fission-codes/webnative-walletauth).\n- **Authorization** using [UCAN](https://ucan.xyz/).\n- **Encrypted file storage** via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs) backed by [IPLD](https://ipld.io/).\n- **Key management** via websockets and a two-factor auth-like flow.\n\nWebnative applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about Webnative in Fission's [Webnative Guide](https://guide.fission.codes/developers/webnative). There's also an API reference which can be found at [webnative.fission.app](https://webnative.fission.app)\n\n\n\n# Getting started\n\n```ts\n// ESM\nimport * as wn from \"webnative\"\n\n// Browser/UMD build\nconst wn = globalThis.webnative\n```\n\n## Creating a Program\n\nA Webnative program is an assembly of components that make up a distributed web application. Several of the components can be customized. _Let's stick with the default components for now, which means we'll be using the Web Crypto API._\n\n```ts\nconst program = await wn.program({\n  // Can also be a string, used as an identifier for caches.\n  // If you're developing multiple apps on the same localhost port,\n  // make sure these differ.\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" }\n\n}).catch(error => {\n  switch (error) {\n    case webnative.ProgramError.InsecureContext:\n      // Webnative requires HTTPS\n      break;\n    case webnative.ProgramError.UnsupportedBrowser:\n      break;\n  }\n\n})\n```\n\n`wn.program` returns a `Program` object, which can create a new user session or reuse an existing session. There are two ways to create a user session, either by using an authentication strategy or by requesting access from another app through the \"capabilities\" system. Let's start with the default authentication strategy.\n\n```ts\nlet session\n\n// Do we have an existing session?\nif (program.session) {\n  session = program.session\n\n// If not, let's authenticate.\n// (a) new user, register a new Fission account\n} else if (userChoseToRegister) {\n  const { success } = await program.auth.register({ username: \"llama\" })\n  session = success ? program.auth.session() : null\n\n// (b) existing user, link a new device\n} else {\n  // On device with existing session:\n  const producer = await program.auth.accountProducer(program.session.username)\n\n  producer.on(\"challenge\", challenge => {\n    // Either show `challenge.pin` or have the user input a PIN and see if they're equal.\n    if (userInput === challenge.pin) challenge.confirmPin()\n    else challenge.rejectPin()\n  })\n\n  producer.on(\"link\", ({ approved }) => {\n    if (approved) console.log(\"Link device successfully\")\n  })\n\n  // On device without session:\n  //     Somehow you'll need to get ahold of the username.\n  //     Few ideas: URL query param, QR code, manual input.\n  const consumer = await program.auth.accountConsumer(username)\n\n  consumer.on(\"challenge\", ({ pin }) => {\n    showPinOnUI(pin)\n  })\n\n  consumer.on(\"link\", async ({ approved, username }) => {\n    if (approved) {\n      console.log(`Successfully authenticated as ${username}`)\n      session = await program.auth.session()\n    }\n  })\n}\n```\n\nAlternatively you can use the \"capabilities\" system when you want partial access to a file system. At the moment of writing, capabilities are only supported through the \"Fission auth lobby\", which is a Webnative app that uses the auth strategy shown above.\n\nThis Fission auth lobby flow works as follows:\n1. You get redirected to the Fission lobby from your app.\n2. Here you create an account like in the normal auth strategy flow shown above.\n3. The lobby shows what your app wants to access in your file system.\n4. You approve or deny these permissions and get redirected back to your app.\n5. Your app collects the encrypted information (UCANs & file system secrets).\n6. Your app can create a user session.\n\n```ts\n// We define a `Permissions` object,\n// this represents what permissions to ask the user.\nconst permissions = {\n  // Ask permission to write to and read from the directory:\n  // private/Apps/Nullsoft/Winamp\n  app: { creator: \"Nullsoft\", name: \"Winamp\" }\n}\n\n// We need to pass this object to our program\nconst program = await webnative.program({\n  namespace: { creator: \"Nullsoft\", name: \"Winamp\" },\n  permissions\n})\n\n// (a) Whenever you are ready to redirect to the lobby, call this:\nprogram.capabilities.request()\n\n// (b) When you get redirected back and your program is ready,\n// you will have access to your user session.\nsession = program.session\n```\n\nOnce you have your `Session`, you have access to your file system 🎉\n\n```ts\nconst fs = session.fs\n```\n\n__Notes:__\n\n- You can use alternative authentication strategies, such as [webnative-walletauth](https://github.com/fission-codes/webnative-walletauth).\n- You can remove all traces of the user using `await session.destroy()`\n- You can load the file system separately if you're using a web worker. This is done using the combination of `configuration.fileSystem.loadImmediately = false` and `program.fileSystem.load()`\n- You can recover a file system if you've downloaded a Recovery Kit by calling `program.fileSystem.recover({ newUsername, oldUsername, readKey })`. The `oldUsername` and `readKey` can be parsed from the uploaded Recovery Kit and the `newUsername` can be generated before calling the function. Please refer to [this example](https://github.com/webnative-examples/webnative-app-template/blob/5498e7062a4578028b8b55d2ac4c611bd5daab85/src/components/auth/recover/HasRecoveryKit.svelte#L49) from Fission's Webnative App Template. Additionally, if you would like to see how to generate a Recovery Kit, you can reference [this example](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/account-settings.ts#L186)\n\n\n## Working with the file system\n\nThe Web Native File System (WNFS) is a file system built on top of [IPLD](https://ipld.io/). It supports operations similar to your macOS, Windows, or Linux desktop file system. It consists of a public and private branch: The public branch is \"live\" and publicly accessible on the Internet. The private branch is encrypted so that only the owner can see the contents. Read more about it [here](https://github.com/wnfs-wg).\n\n```ts\nconst { Branch } = wn.path\n\n// List the user's private files\nawait fs.ls(\n  wn.path.directory(Branch.Private)\n)\n\n// Create a sub directory and add some content\nconst contentPath = wn.file(\n  Branch.Private, \"Sub Directory\", \"hello.txt\"\n)\n\nawait fs.write(\n  contentPath,\n  new TextEncoder().encode(\"👋\") // Uint8Array\n)\n\n// Persist changes and announce them to your other devices\nawait fs.publish()\n\n// Read the file\nconst content = new TextDecoder().decode(\n  await fs.read(contentPath)\n)\n```\n\nThat's it, you have successfully created a Webnative app! 🚀\n\n\n## POSIX Interface\n\nWNFS exposes a familiar POSIX-style interface:\n- `exists`: check if a file or directory exists\n- `ls`: list a directory\n- `mkdir`: create a directory\n- `mv`: move a file or directory\n- `read`: read from a file\n- `rm`: remove a file or directory\n- `write`: write to a file\n\n\n## Versioning\n\nEach file and directory has a `history` property, which you can use to get an earlier version of that item. We use the `delta` variable as the order index. Primarily because the timestamps can be slightly out of sequence, due to device inconsistencies.\n\n```ts\nconst file = await fs.get(wn.path.file(\"private\", \"Blog Posts\", \"article.md\"))\n\nfile.history.list()\n// { delta: -1, timestamp: 1606236743 }\n// { delta: -2, timestamp: 1606236532 }\n\n// Get the previous version\nfile.history.back()\n\n// Go back two versions\nconst delta = -2\nfile.history.back(delta)\n\n// Get the first version (ie. delta -2)\n// by providing a timestamp\nfile.history.prior(1606236743)\n```\n\n\n## Sharing Private Data\n\n\n[https://guide.fission.codes/developers/webnative/sharing-private-data](https://guide.fission.codes/developers/webnative/sharing-private-data)\n\n\n## Migration\n\nSome versions of Webnative require apps to migrate their codebase to address breaking changes. Please see our [migration guide](https://guide.fission.codes/developers/webnative/migration) for help migrating your apps to the latest Webnative version.\n\n\n## Debugging\n\nDebugging mode can be enable by setting `debug` to `true` in your configuration object that you pass to your `Program`. By default this will add your programs to the global context object (eg. `window`) under `globalThis.__webnative.programs` (can be disabled, see API docs).\n\n```ts\nconst appInfo = { creator: \"Nullsoft\", name: \"Winamp\" }\n\nawait wn.program({\n  namespace: appInfo,\n  debug: true\n})\n\n// Automatically exposed Program in debug mode\nconst program = globalThis.__webnative[ wn.namespace(appInfo) ] // namespace: \"Nullsoft/Winamp\"\n```","readmeFilename":"README.md","bugs":{"url":"https://github.com/fission-codes/webnative/issues"}}