Feature/rebrand webnative to odd (#123)
* Chore: rename instances of webnative to odd, except imports from webnative * Fix: WAT -> OAT * Chore: rename webnative and wn imports to odd * Feat: switch to @oddjs/odd
This commit is contained in:
parent
76bdfdeeca
commit
65ea9bd832
|
|
@ -22,5 +22,5 @@ jobs:
|
|||
uses: fission-suite/publish-action@v1
|
||||
with:
|
||||
machine_key: ${{ secrets.FISSION_MACHINE_KEY }}
|
||||
app_url: webnative-template.fission.app
|
||||
app_url: odd-template.fission.app
|
||||
build_dir: ./build
|
||||
|
|
|
|||
58
README.md
58
README.md
|
|
@ -1,32 +1,32 @@
|
|||
# Webnative App Template
|
||||
# ODD App Template
|
||||
|
||||
[](https://fission.codes) [](https://github.com/fission-suite/webnative) [](https://discord.gg/zAQBDEq) [](https://talk.fission.codes)
|
||||
[](https://fission.codes) [](https://github.com/oddsdk/ts-odd) [](https://discord.gg/zAQBDEq) [](https://talk.fission.codes)
|
||||
|
||||

|
||||

|
||||
|
||||
The Webnative App Template is a clone-and-go template for building a web application using Webnative, fast. Clone, customize, and deploy to have a running distributed app in mere minutes.
|
||||
The ODD App Template is a clone-and-go template for building a web application using the ODD SDK, fast. Clone, customize, and deploy to have a running distributed app in mere minutes.
|
||||
|
||||
<div style="background-color: #FEEB80; padding: 1px 20px; border-radius: 10px;">
|
||||
<p class="text-align: center;"><strong>❗️Webnative is alpha software.</strong></p>
|
||||
<p>We recommend you <u>do not develop production applications using the Webnative App Template</u> at this time. We're working on making it reliable, fast, and awesome, but we're not there yet!</p>
|
||||
<p class="text-align: center;"><strong>The ODD SDK is alpha software.</strong></p>
|
||||
<p>We recommend you <u>do not develop production applications using the ODD App Template</u> at this time. We're working on making it reliable, fast, and awesome, but we're not there yet!</p>
|
||||
</div>
|
||||
|
||||
## 🤔 What's Webnative?
|
||||
## 🤔 What's The ODD SDK?
|
||||
|
||||
[The Webnative SDK](https://github.com/fission-codes/webnative) empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:
|
||||
[The ODD SDK](https://github.com/oddsdk/ts-odd) empowers developers to build fully distributed web applications without needing a complex back-end. The SDK provides:
|
||||
|
||||
- user accounts (via [the browser's Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)),
|
||||
- authorization (using [UCAN](https://ucan.xyz))
|
||||
- encrypted file storage (via the [Webnative File System](https://guide.fission.codes/developers/webnative/file-system-wnfs), backed by the [InterPlanetary File System](https://ipfs.io/), or IPFS)
|
||||
- encrypted file storage (via the [ODD File System](https://guide.fission.codes/developers/odd/file-system-wnfs), backed by the [InterPlanetary File System](https://ipfs.io/), or IPFS)
|
||||
- and key management (via websockets and a two-factor auth-like flow).
|
||||
|
||||
Webnative 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).
|
||||
ODD applications work offline and store data encrypted for the user by leveraging the power of the web platform. You can read more about the ODD SDK in Fission's [ODD SDK Guide](https://guide.fission.codes/developers/odd).
|
||||
|
||||
## 📦 What does this template give me?
|
||||
|
||||
### 🥰 Silky-smooth end-user flows
|
||||
|
||||
The Webnative App Template provides a _silky-smooth user experience_ out of the box. Creating an account and linking a second device feels familiar, comfortable, and obvious. Webnative authentication is key-based rather than password-based, so we've focused heavily on the authentication flows, borrowing language and screens from two-factor auth flows.
|
||||
The ODD App Template provides a _silky-smooth user experience_ out of the box. Creating an account and linking a second device feels familiar, comfortable, and obvious. ODD SDK authentication is key-based rather than password-based, so we've focused heavily on the authentication flows, borrowing language and screens from two-factor auth flows.
|
||||
|
||||
### 🧱 Built with a modern web stack
|
||||
|
||||
|
|
@ -37,15 +37,15 @@ The app template is built with modern web technologies:
|
|||
- [Tailwind](https://tailwindcss.com/)
|
||||
- [DaisyUI](https://daisyui.com/)
|
||||
|
||||
### 👩🏫 A simple Webnative demo to learn from
|
||||
### 👩🏫 A simple ODD demo to learn from
|
||||
|
||||

|
||||
|
||||
The app template includes a functioning application: an image gallery. Check out the image gallery code to learn how a Webnative application handles things like file uploads, directories, etc.
|
||||
The app template includes a functioning application: an image gallery. Check out the image gallery code to learn how an ODD application handles things like file uploads, directories, etc.
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
You can try out the template yourself [here](https://webnative-template.fission.app/).
|
||||
You can try out the template yourself [here](https://odd-template.fission.app/).
|
||||
|
||||
Ready? Let's go.
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ Prerequiste: ensure you are running Node 16.14 or greater, but _not_ Node 17 (18
|
|||
1. Clone the repository:
|
||||
|
||||
```shell
|
||||
git clone git@github.com:webnative-examples/webnative-app-template.git
|
||||
git clone git@github.com:oddsdk/odd-app-template.git
|
||||
```
|
||||
|
||||
2. Install the dependencies.
|
||||
|
|
@ -81,7 +81,7 @@ The app template is designed to be easy for you to _make it your own._ Here's ho
|
|||
|
||||
- Change `appName` to the name of your app.
|
||||
- Change `appDescription` to a simple, 1-sentence description of your app.
|
||||
- Update `webnativeNamespace` with your project details.
|
||||
- Update `oddNamespace` with your project details.
|
||||
- Once you [deploy](#deploy) your app, change `appURL` to the production URL.
|
||||
|
||||
In `package.json`, change `name` to your application's name.
|
||||
|
|
@ -111,19 +111,19 @@ The app template is designed to be easy for you to _make it your own._ Here's ho
|
|||
|
||||
👏 You're ready to start adding custom functionality! 🚀
|
||||
|
||||
Check out the [Webnative Guide](https://guide.fission.codes/developers/webnative) for Webnative questions or [UCAN.xyz](https://ucan.xyz) for UCAN questions.
|
||||
Check out the [ODD SDK Guide](https://guide.fission.codes/developers/odd) for ODD SDK questions or [UCAN.xyz](https://ucan.xyz) for UCAN questions.
|
||||
|
||||
## 📛 Usernames
|
||||
|
||||
When you go through the registration flow in WAT, the username you type in the form field has a `#{DID}` appended to it in the background. We did this to enable discord style usernames where users can share the same usernames, but have unique identifiers attached to the end to distinguish them from one another. We then create a hash of the `fullUsername`(the one with the `#{DID}` appended to the end) that is passed to Webnative. So Webnative only has a notion of the `hashed` username currently. This should also allow users to create usernames using emojis or non-English characters. Also, this is the only username schema that currently supports our File System recovery flow.
|
||||
When you go through the registration flow in WAT, the username you type in the form field has a `#{DID}` appended to it in the background. We did this to enable discord style usernames where users can share the same usernames, but have unique identifiers attached to the end to distinguish them from one another. We then create a hash of the `fullUsername`(the one with the `#{DID}` appended to the end) that is passed to the ODD SDK. So the ODD SDK only has a notion of the `hashed` username currently. This should also allow users to create usernames using emojis or non-English characters. Also, this is the only username schema that currently supports our File System recovery flow.
|
||||
|
||||
You don’t necessarily need to follow that same pattern though. If you were to register two of the same usernames in the app without hashing them, you would be able to call `session.authStrategy.isUsernameAvailable(username)` to ensure duplicate usernames aren't present in the app. We will be working on porting some of this functionality over to the Webnative library over the next while and we will be updating the docs to reflect that.
|
||||
You don’t necessarily need to follow that same pattern though. If you were to register two of the same usernames in the app without hashing them, you would be able to call `session.authStrategy.isUsernameAvailable(username)` to ensure duplicate usernames aren't present in the app. We will be working on porting some of this functionality over to the `ts-ODD` library over the next while and we will be updating the docs to reflect that.
|
||||
|
||||
[Please take a look at our init function](https://github.com/webnative-examples/webnative-app-template/blob/main/src/lib/init.ts#L34-L38) to see how we are currently constructing the username schema.
|
||||
[Please take a look at our init function](https://github.com/oddsdk/odd-app-template/blob/main/src/lib/init.ts#L34-L38) to see how we are currently constructing the username schema.
|
||||
|
||||
## 🧨 Deploy
|
||||
|
||||
Any static hosting platform should be supported. The Webnative App Template is currently deployed on:
|
||||
Any static hosting platform should be supported. The ODD App Template is currently deployed on:
|
||||
|
||||
- [Fission](#fission-app-hosting)
|
||||
- [Netlify](#netlify)
|
||||
|
|
@ -132,9 +132,9 @@ Any static hosting platform should be supported. The Webnative App Template is c
|
|||
|
||||
### Fission App Hosting
|
||||
|
||||
Try out [Webnative App Template on Fission](https://webnative-template.fission.app)
|
||||
Try out [ODD App Template on Fission](https://odd-template.fission.app)
|
||||
|
||||
A Webnative application can be published to IPFS with the [Fission CLI](https://guide.fission.codes/developers/cli) or the [Fission GitHub publish action](https://github.com/fission-suite/publish-action).
|
||||
An ODD application can be published to IPFS with the [Fission CLI](https://guide.fission.codes/developers/cli) or the [Fission GitHub publish action](https://github.com/fission-suite/publish-action).
|
||||
|
||||
**To publish with the Fission CLI:**
|
||||
|
||||
|
|
@ -158,9 +158,9 @@ See the [Fission Guide](https://guide.fission.codes/developers/installation) and
|
|||
|
||||
### Netlify
|
||||
|
||||
[](https://app.netlify.com/sites/webnative/deploys)
|
||||
[](https://app.netlify.com/sites/odd/deploys)
|
||||
|
||||
In order to deploy your Webnative application on Netlify:
|
||||
In order to deploy your ODD application on Netlify:
|
||||
|
||||
1. Create a new Netlify site and connect your app's git repository. (If you don't have your application stored in a git repository, you can upload the output of a [static build](#static-build).)
|
||||
2. Just click Deploy. Netlify takes care of the rest. No Netlify-specific configuration is needed.
|
||||
|
|
@ -168,9 +168,9 @@ In order to deploy your Webnative application on Netlify:
|
|||
|
||||
### Vercel
|
||||
|
||||
Try out the [Webnative App Template on Vercel](https://webnative-app-template.vercel.app/).
|
||||
Try out the [ODD App Template on Vercel](https://odd-app-template.vercel.app/).
|
||||
|
||||
In order to deploy your Webnative application on Vercel:
|
||||
In order to deploy your ODD application on Vercel:
|
||||
|
||||
1. Create a new Vercel project and connect your app's git repository. (If you don't have your application stored in a git repository, you can upload the output of a [static build](#static-build).)
|
||||
2. Override the default output directory and set it to `build`.
|
||||
|
|
@ -178,9 +178,9 @@ In order to deploy your Webnative application on Vercel:
|
|||
|
||||
### Cloudflare Pages
|
||||
|
||||
Try out the [Webnative App Template on Cloudflare Pages](https://webnative-template.pages.dev/).
|
||||
Try out the [ODD App Template on Cloudflare Pages](https://odd-template.pages.dev/).
|
||||
|
||||
In order to deploy your Webnative application on Cloudflare Pages:
|
||||
In order to deploy your ODD application on Cloudflare Pages:
|
||||
|
||||
1. Create a new Pages project and connect your app's git repository. (If you don't have your application stored in a git repository, you can upload the output of a [static build](#static-build).)
|
||||
2. Select `SvelteKit` from the "Framework preset".
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
ignore: []
|
||||
url: webnative-template.fission.app
|
||||
build: ./build
|
||||
url: odd-template.fission.app
|
||||
build: ./build
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"name": "webnative-app-template",
|
||||
"name": "odd-app-template",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "webnative-app-template",
|
||||
"name": "odd-app-template",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@oddjs/odd": "0.37.0",
|
||||
"clipboard-copy": "^4.0.1",
|
||||
"qrcode-svg": "^1.1.0",
|
||||
"uint8arrays": "^4.0.2",
|
||||
"webnative": "^0.36.3"
|
||||
"uint8arrays": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.29.2",
|
||||
|
|
@ -850,6 +850,59 @@
|
|||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@oddjs/odd": {
|
||||
"version": "0.37.0",
|
||||
"resolved": "https://registry.npmjs.org/@oddjs/odd/-/odd-0.37.0.tgz",
|
||||
"integrity": "sha512-QvDIRGjm8UXjv6/GD/xw39rHmouaYefl8ipJ4En++SoCXHcfInq4ZbgE0APmlxjBSAksJX7JGipkkkpe9gCc8A==",
|
||||
"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"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@oddjs/odd/node_modules/multiformats": {
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
|
||||
"integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw==",
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@oddjs/odd/node_modules/uint8arrays": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz",
|
||||
"integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==",
|
||||
"dependencies": {
|
||||
"multiformats": "^9.4.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@oddjs/odd/node_modules/uint8arrays/node_modules/multiformats": {
|
||||
"version": "9.9.0",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz",
|
||||
"integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg=="
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz",
|
||||
|
|
@ -6321,59 +6374,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/webnative": {
|
||||
"version": "0.36.3",
|
||||
"resolved": "https://registry.npmjs.org/webnative/-/webnative-0.36.3.tgz",
|
||||
"integrity": "sha512-MucN6ydnyY5E8GczuARAWXSOn3+yjXKSLNTIPeJhcFmZpxPBDRfpZ0SpKJjKWtVLNiEaUQibeiKsIYDfij/wIQ==",
|
||||
"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"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/webnative/node_modules/multiformats": {
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
|
||||
"integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw==",
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webnative/node_modules/uint8arrays": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz",
|
||||
"integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==",
|
||||
"dependencies": {
|
||||
"multiformats": "^9.4.2"
|
||||
}
|
||||
},
|
||||
"node_modules/webnative/node_modules/uint8arrays/node_modules/multiformats": {
|
||||
"version": "9.9.0",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz",
|
||||
"integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg=="
|
||||
},
|
||||
"node_modules/well-known-symbols": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
|
||||
|
|
@ -7165,6 +7165,56 @@
|
|||
"fastq": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"@oddjs/odd": {
|
||||
"version": "0.37.0",
|
||||
"resolved": "https://registry.npmjs.org/@oddjs/odd/-/odd-0.37.0.tgz",
|
||||
"integrity": "sha512-QvDIRGjm8UXjv6/GD/xw39rHmouaYefl8ipJ4En++SoCXHcfInq4ZbgE0APmlxjBSAksJX7JGipkkkpe9gCc8A==",
|
||||
"requires": {
|
||||
"@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"
|
||||
},
|
||||
"dependencies": {
|
||||
"multiformats": {
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
|
||||
"integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw=="
|
||||
},
|
||||
"uint8arrays": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz",
|
||||
"integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==",
|
||||
"requires": {
|
||||
"multiformats": "^9.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"multiformats": {
|
||||
"version": "9.9.0",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz",
|
||||
"integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@playwright/test": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz",
|
||||
|
|
@ -10970,56 +11020,6 @@
|
|||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"webnative": {
|
||||
"version": "0.36.3",
|
||||
"resolved": "https://registry.npmjs.org/webnative/-/webnative-0.36.3.tgz",
|
||||
"integrity": "sha512-MucN6ydnyY5E8GczuARAWXSOn3+yjXKSLNTIPeJhcFmZpxPBDRfpZ0SpKJjKWtVLNiEaUQibeiKsIYDfij/wIQ==",
|
||||
"requires": {
|
||||
"@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"
|
||||
},
|
||||
"dependencies": {
|
||||
"multiformats": {
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
|
||||
"integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw=="
|
||||
},
|
||||
"uint8arrays": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz",
|
||||
"integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==",
|
||||
"requires": {
|
||||
"multiformats": "^9.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"multiformats": {
|
||||
"version": "9.9.0",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz",
|
||||
"integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"well-known-symbols": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "webnative-app-template",
|
||||
"name": "odd-app-template",
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
"clipboard-copy": "^4.0.1",
|
||||
"qrcode-svg": "^1.1.0",
|
||||
"uint8arrays": "^4.0.2",
|
||||
"webnative": "^0.36.3"
|
||||
"@oddjs/odd": "0.37.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="robots" content="index,follow" />
|
||||
<meta name="googlebot" content="index,follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image:alt" content="WebNative Template" />
|
||||
<meta property="og:image:alt" content="ODD Template" />
|
||||
<meta property="og:image:width" content="1250" />
|
||||
<meta property="og:image:height" content="358" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
|
|
|||
|
|
@ -16,15 +16,13 @@
|
|||
? 'text-orange-500'
|
||||
: 'text-transparent bg-clip-text bg-gradient-to-r from-orange-300 to-orange-600'}"
|
||||
>
|
||||
*** Experimental *** - You are currently previewing Webnative SDK Alpha
|
||||
0.2
|
||||
*** Experimental *** - You are currently previewing ODD SDK Alpha 0.2
|
||||
</p>
|
||||
{:else}
|
||||
<p
|
||||
class="motion-safe:animate-marquee motion-safe:left-full whitespace-nowrap font-bold text-xxs text-[#DD1F13]"
|
||||
>
|
||||
*** Experimental *** - You are currently previewing Webnative SDK Alpha
|
||||
0.2
|
||||
*** Experimental *** - You are currently previewing ODD SDK Alpha 0.2
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
<p class="mb-5">
|
||||
<a
|
||||
class="link text-blue-600 whitespace-nowrap"
|
||||
href="https://github.com/fission-codes/webnative"
|
||||
href="https://github.com/oddsdk/ts-odd"
|
||||
target="_blank"
|
||||
>
|
||||
Webnative SDK
|
||||
ODD SDK
|
||||
<span class="-scale-x-100 scale-y-100 inline-block">⎋</span>
|
||||
</a>
|
||||
is a true local-first edge computing stack.
|
||||
|
|
@ -19,19 +19,19 @@
|
|||
You can fork this
|
||||
<a
|
||||
class="link text-blue-600 whitespace-nowrap"
|
||||
href="https://github.com/webnative-examples/webnative-app-template"
|
||||
href="https://github.com/oddsdk/odd-app-template"
|
||||
target="_blank"
|
||||
>
|
||||
template
|
||||
<span class="-scale-x-100 scale-y-100 inline-block">⎋</span>
|
||||
</a>
|
||||
to start writing your own Webnative app. Learn more in the
|
||||
to start writing your own ODD app. Learn more in the
|
||||
<a
|
||||
class="link text-blue-600 whitespace-nowrap"
|
||||
href="https://guide.fission.codes/"
|
||||
target="_blank"
|
||||
>
|
||||
Webnative Guide
|
||||
ODD SDK Guide
|
||||
<span class="-scale-x-100 scale-y-100 inline-block">⎋</span>
|
||||
</a>
|
||||
.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
/**
|
||||
* Parse the user's `username` and `readKey` from the uploaded recovery kit and pass them into
|
||||
* webnative to recover the user's account and populate the `session` and `filesystem` stores
|
||||
* ODD to recover the user's account and populate the `session` and `filesystem` stores
|
||||
* @param files
|
||||
*/
|
||||
export const handleFileInput: (
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
{#if state !== RECOVERY_STATES.Done}
|
||||
<p class="text-xxs">
|
||||
{`It should be a file named Webnative-RecoveryKit-{yourUsername}.txt`}
|
||||
{`It should be a file named ODD-RecoveryKit-{yourUsername}.txt`}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -130,8 +130,9 @@
|
|||
class="label mt-4 !p-0 hidden peer-checked:block"
|
||||
>
|
||||
<span class="text-red-400 text-left">
|
||||
In order to ensure the security of your private data, Webnative does
|
||||
not recommend creating an account from a public or shared computer.
|
||||
In order to ensure the security of your private data, the ODD SDK
|
||||
does not recommend creating an account from a public or shared
|
||||
computer.
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="flex flex-col items-start justify-center gap-5">
|
||||
<h2 class="text-lg">Photo Gallery Demo</h2>
|
||||
<p>
|
||||
Webnative makes it easy to implement private, encrypted, user-owned
|
||||
The ODD SDK makes it easy to implement private, encrypted, user-owned
|
||||
storage in your app. See it in action with our photo gallery demo.
|
||||
</p>
|
||||
<a class="btn btn-primary" href="/gallery">Try the Photo Gallery Demo</a>
|
||||
|
|
@ -19,8 +19,8 @@
|
|||
<div class="flex flex-col items-start justify-center gap-5">
|
||||
<h2 class="text-lg">Device Connection Demo</h2>
|
||||
<p>
|
||||
With Webnative SDK, a user’s account lives only on their connected devices
|
||||
— entirely under their control. It’s easy for them to connect as many
|
||||
With the ODD SDK, a user’s account lives only on their connected devices —
|
||||
entirely under their control. It’s easy for them to connect as many
|
||||
devices as they’d like. For recoverability, we recommend they always
|
||||
connect at least two.
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
<div class="max-w-[590px]">
|
||||
<p class="mb-5">
|
||||
Webnative SDK is a true local-first edge computing stack. Effortlessly
|
||||
give your users:
|
||||
The ODD SDK is a true local-first edge computing stack. Effortlessly give
|
||||
your users:
|
||||
</p>
|
||||
|
||||
<ul class="mb-6 pl-6 list-disc">
|
||||
|
|
@ -38,9 +38,9 @@
|
|||
Unsupported device
|
||||
</h3>
|
||||
<p>
|
||||
It appears this device isn’t supported. Webnative requires IndexedDB
|
||||
in order to function. This browser doesn’t appear to implement this
|
||||
API. Are you in a Firefox private window?
|
||||
It appears this device isn’t supported. ODD requires IndexedDB in
|
||||
order to function. This browser doesn’t appear to implement this API.
|
||||
Are you in a Firefox private window?
|
||||
</p>
|
||||
</div>
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
$: if (downloadLinkRef && fileURL) {
|
||||
downloadLinkRef.setAttribute(
|
||||
'download',
|
||||
`Webnative-RecoveryKit-${$sessionStore.username.trimmed}.txt`
|
||||
`ODD-RecoveryKit-${$sessionStore.username.trimmed}.txt`
|
||||
)
|
||||
|
||||
downloadLinkRef.href = fileURL
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { get as getStore } from 'svelte/store'
|
||||
import * as wn from 'webnative'
|
||||
import { retrieve } from 'webnative/common/root-key'
|
||||
import * as odd from '@oddjs/odd'
|
||||
import { retrieve } from '@oddjs/odd/common/root-key'
|
||||
import * as uint8arrays from 'uint8arrays'
|
||||
import type { CID } from 'multiformats/cid'
|
||||
import type { PuttableUnixTree, File as WNFile } from 'webnative/fs/types'
|
||||
import type { Metadata } from 'webnative/fs/metadata'
|
||||
import type { PuttableUnixTree, File as WNFile } from '@oddjs/odd/fs/types'
|
||||
import type { Metadata } from '@oddjs/odd/fs/metadata'
|
||||
|
||||
import { accountSettingsStore, filesystemStore, sessionStore } from '$src/stores'
|
||||
import { addNotification } from '$lib/notifications'
|
||||
|
|
@ -31,9 +31,9 @@ interface AvatarFile extends PuttableUnixTree, WNFile {
|
|||
}
|
||||
}
|
||||
|
||||
export const ACCOUNT_SETTINGS_DIR = wn.path.directory('private', 'settings')
|
||||
const AVATAR_DIR = wn.path.combine(ACCOUNT_SETTINGS_DIR, wn.path.directory('avatars'))
|
||||
const AVATAR_ARCHIVE_DIR = wn.path.combine(AVATAR_DIR, wn.path.directory('archive'))
|
||||
export const ACCOUNT_SETTINGS_DIR = odd.path.directory('private', 'settings')
|
||||
const AVATAR_DIR = odd.path.combine(ACCOUNT_SETTINGS_DIR, odd.path.directory('avatars'))
|
||||
const AVATAR_ARCHIVE_DIR = odd.path.combine(AVATAR_DIR, odd.path.directory('archive'))
|
||||
const AVATAR_FILE_NAME = 'avatar'
|
||||
const FILE_SIZE_LIMIT = 20
|
||||
|
||||
|
|
@ -59,8 +59,8 @@ const archiveOldAvatar = async (): Promise<void> => {
|
|||
}`
|
||||
|
||||
// Move old avatar to archive dir
|
||||
const fromPath = wn.path.combine(AVATAR_DIR, wn.path.file(oldAvatarFileName))
|
||||
const toPath = wn.path.combine(AVATAR_ARCHIVE_DIR, wn.path.file(archiveFileName))
|
||||
const fromPath = odd.path.combine(AVATAR_DIR, odd.path.file(oldAvatarFileName))
|
||||
const toPath = odd.path.combine(AVATAR_ARCHIVE_DIR, odd.path.file(archiveFileName))
|
||||
await fs.mv(fromPath, toPath)
|
||||
|
||||
// Announce the changes to the server
|
||||
|
|
@ -102,7 +102,7 @@ export const getAvatarFromWNFS = async (): Promise<void> => {
|
|||
return
|
||||
}
|
||||
|
||||
const file = await fs.get(wn.path.combine(AVATAR_DIR, wn.path.file(`${avatarName}`)))
|
||||
const file = await fs.get(odd.path.combine(AVATAR_DIR, odd.path.file(`${avatarName}`)))
|
||||
|
||||
// The CID for private files is currently located in `file.header.content`
|
||||
const cid = (file as AvatarFile).header.content.toString()
|
||||
|
|
@ -167,7 +167,7 @@ export const uploadAvatarToWNFS = async (image: File): Promise<void> => {
|
|||
|
||||
// Create a sub directory and add the avatar
|
||||
await fs.write(
|
||||
wn.path.combine(AVATAR_DIR, wn.path.file(updatedImage.name)),
|
||||
odd.path.combine(AVATAR_DIR, odd.path.file(updatedImage.name)),
|
||||
await fileToUint8Array(updatedImage)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export const appName = 'Webnative SDK Demo'
|
||||
export const appDescription = 'This is another awesome Webnative app.'
|
||||
export const appURL = 'https://webnative.netlify.app'
|
||||
export const appName = 'ODD SDK Demo'
|
||||
export const appDescription = 'This is another awesome ODD app.'
|
||||
export const appURL = 'https://odd.netlify.app'
|
||||
export const appImageURL = `${appURL}/preview.png`
|
||||
export const ipfsGatewayUrl = 'runfission.com'
|
||||
export const webnativeNamespace = { creator: 'Fission', name: 'WAT' }
|
||||
export const oddNamespace = { creator: 'Fission', name: 'OAT' }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import * as uint8arrays from 'uint8arrays'
|
||||
import { sha256 } from 'webnative/components/crypto/implementation/browser'
|
||||
import { publicKeyToDid } from 'webnative/did/transformers'
|
||||
import type { Crypto } from 'webnative'
|
||||
import type FileSystem from 'webnative/fs/index'
|
||||
import { sha256 } from '@oddjs/odd/components/crypto/implementation/browser'
|
||||
import { publicKeyToDid } from '@oddjs/odd/did/transformers'
|
||||
import type { Crypto } from '@oddjs/odd'
|
||||
import type FileSystem from '@oddjs/odd/fs/index'
|
||||
import { get as getStore } from 'svelte/store'
|
||||
|
||||
import { asyncDebounce } from '$lib/utils'
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import * as webnative from 'webnative'
|
||||
import type FileSystem from 'webnative/fs/index'
|
||||
import * as odd from '@oddjs/odd'
|
||||
import type FileSystem from '@oddjs/odd/fs/index'
|
||||
|
||||
export type BackupStatus = { created: boolean } | null
|
||||
|
||||
export const setBackupStatus = async (fs: FileSystem, status: BackupStatus): Promise<void> => {
|
||||
const backupStatusPath = webnative.path.file('private', 'backup-status.json')
|
||||
const backupStatusPath = odd.path.file('private', 'backup-status.json')
|
||||
await fs.write(backupStatusPath, new TextEncoder().encode(JSON.stringify(status)))
|
||||
await fs.publish()
|
||||
}
|
||||
|
||||
export const getBackupStatus = async (fs: FileSystem): Promise<BackupStatus> => {
|
||||
const backupStatusPath = webnative.path.file('private', 'backup-status.json')
|
||||
const backupStatusPath = odd.path.file('private', 'backup-status.json')
|
||||
|
||||
if (await fs.exists(backupStatusPath)) {
|
||||
const fileContent = await fs.read(backupStatusPath)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type * as webnative from 'webnative'
|
||||
import type * as odd from '@oddjs/odd'
|
||||
import { get as getStore } from 'svelte/store'
|
||||
|
||||
import { sessionStore } from '$src/stores'
|
||||
|
|
@ -6,7 +6,7 @@ import { sessionStore } from '$src/stores'
|
|||
|
||||
export const createAccountLinkingConsumer = async (
|
||||
username: string
|
||||
): Promise<webnative.AccountLinkingConsumer> => {
|
||||
): Promise<odd.AccountLinkingConsumer> => {
|
||||
const session = getStore(sessionStore)
|
||||
if (session.authStrategy) return session.authStrategy.accountConsumer(username)
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ export const createAccountLinkingConsumer = async (
|
|||
|
||||
export const createAccountLinkingProducer = async (
|
||||
username: string
|
||||
): Promise<webnative.AccountLinkingProducer> => {
|
||||
): Promise<odd.AccountLinkingProducer> => {
|
||||
const session = getStore(sessionStore)
|
||||
return session.authStrategy.accountProducer(username)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import * as webnative from 'webnative'
|
||||
import * as odd from '@oddjs/odd'
|
||||
|
||||
import { dev } from '$app/environment'
|
||||
import { filesystemStore, sessionStore } from '../stores'
|
||||
import { getBackupStatus, type BackupStatus } from '$lib/auth/backup'
|
||||
import { USERNAME_STORAGE_KEY, createDID } from '$lib/auth/account'
|
||||
import { webnativeNamespace } from '$lib/app-info'
|
||||
import { oddNamespace } from '$lib/app-info'
|
||||
|
||||
export const initialize = async (): Promise<void> => {
|
||||
try {
|
||||
let backupStatus: BackupStatus = null
|
||||
|
||||
const program: webnative.Program = await webnative.program({
|
||||
namespace: webnativeNamespace,
|
||||
const program: odd.Program = await odd.program({
|
||||
namespace: oddNamespace,
|
||||
debug: dev
|
||||
})
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export const initialize = async (): Promise<void> => {
|
|||
|
||||
let fullUsername = await program.components.storage.getItem(USERNAME_STORAGE_KEY) as string
|
||||
|
||||
// If the user is migrating from a version webnative-app-template before https://github.com/webnative-examples/webnative-app-template/pull/97/files#diff-a180510e798b8f833ebfdbe691c5ec4a1095076980d3e2388de29c849b2b8361R44,
|
||||
// If the user is migrating from a version odd-app-template before https://github.com/oddsdk/odd-app-template/pull/97/files#diff-a180510e798b8f833ebfdbe691c5ec4a1095076980d3e2388de29c849b2b8361R44,
|
||||
// their username won't contain a did, so we will need to manually append a DID and add it storage here
|
||||
if (!fullUsername) {
|
||||
const did = await createDID(program.components.crypto)
|
||||
|
|
@ -62,7 +62,7 @@ export const initialize = async (): Promise<void> => {
|
|||
console.error(error)
|
||||
|
||||
switch (error) {
|
||||
case webnative.ProgramError.InsecureContext:
|
||||
case odd.ProgramError.InsecureContext:
|
||||
sessionStore.update(session => ({
|
||||
...session,
|
||||
loading: false,
|
||||
|
|
@ -70,7 +70,7 @@ export const initialize = async (): Promise<void> => {
|
|||
}))
|
||||
break
|
||||
|
||||
case webnative.ProgramError.UnsupportedBrowser:
|
||||
case odd.ProgramError.UnsupportedBrowser:
|
||||
sessionStore.update(session => ({
|
||||
...session,
|
||||
loading: false,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type * as webnative from 'webnative'
|
||||
import type * as odd from '@oddjs/odd'
|
||||
|
||||
import { appName } from '$lib/app-info'
|
||||
|
||||
|
|
@ -10,9 +10,9 @@ type Username = {
|
|||
|
||||
export type Session = {
|
||||
username: Username
|
||||
session: webnative.Session | null
|
||||
authStrategy: webnative.AuthenticationStrategy | null
|
||||
program: webnative.Program
|
||||
session: odd.Session | null
|
||||
authStrategy: odd.AuthenticationStrategy | null
|
||||
program: odd.Program
|
||||
loading: boolean
|
||||
backupCreated: boolean
|
||||
error?: SessionError
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</a>
|
||||
<a
|
||||
class="flex items-center justify-center gap-2 font-bold text-sm text-base-content"
|
||||
href="https://github.com/webnative-examples/"
|
||||
href="https://github.com/oddsdk/"
|
||||
target="_blank"
|
||||
>
|
||||
Github <Github />
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@
|
|||
<p class="mb-2 text-neutral-700 dark:text-neutral-500">
|
||||
Interested in private file sharing as a feature? Follow the <a
|
||||
class="underline"
|
||||
href="https://github.com/webnative-examples/webnative-app-template/issues/4"
|
||||
href="https://github.com/oddsdk/odd-app-template/issues/4"
|
||||
target="_blank"
|
||||
>
|
||||
github issue.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { get as getStore } from 'svelte/store'
|
||||
import * as wn from 'webnative'
|
||||
import type PublicFile from 'webnative/fs/v1/PublicFile'
|
||||
import type PrivateFile from 'webnative/fs/v1/PrivateFile'
|
||||
import { isFile } from 'webnative/fs/types/check'
|
||||
import * as odd from '@oddjs/odd'
|
||||
import type PublicFile from '@oddjs/odd/fs/v1/PublicFile'
|
||||
import type PrivateFile from '@oddjs/odd/fs/v1/PrivateFile'
|
||||
import { isFile } from '@oddjs/odd/fs/types/check'
|
||||
|
||||
import { filesystemStore } from '$src/stores'
|
||||
import { AREAS, galleryStore } from '$routes/gallery/stores'
|
||||
|
|
@ -30,8 +30,8 @@ type Link = {
|
|||
}
|
||||
|
||||
export const GALLERY_DIRS = {
|
||||
[ AREAS.PUBLIC ]: wn.path.directory('public', 'gallery'),
|
||||
[ AREAS.PRIVATE ]: wn.path.directory('private', 'gallery')
|
||||
[ AREAS.PUBLIC ]: odd.path.directory('public', 'gallery'),
|
||||
[ AREAS.PRIVATE ]: odd.path.directory('private', 'gallery')
|
||||
}
|
||||
const FILE_SIZE_LIMIT = 20
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ export const getImagesFromWNFS: () => Promise<void> = async () => {
|
|||
let images = await Promise.all(
|
||||
Object.entries(links).map(async ([ name ]) => {
|
||||
const file = await fs.get(
|
||||
wn.path.combine(GALLERY_DIRS[ selectedArea ], wn.path.file(`${name}`))
|
||||
odd.path.combine(GALLERY_DIRS[ selectedArea ], odd.path.file(`${name}`))
|
||||
)
|
||||
|
||||
if (!isFile(file)) return null
|
||||
|
|
@ -131,7 +131,7 @@ export const uploadImageToWNFS: (
|
|||
|
||||
// Reject the upload if the image already exists in the directory
|
||||
const imageExists = await fs.exists(
|
||||
wn.path.combine(GALLERY_DIRS[ selectedArea ], wn.path.file(image.name))
|
||||
odd.path.combine(GALLERY_DIRS[ selectedArea ], odd.path.file(image.name))
|
||||
)
|
||||
if (imageExists) {
|
||||
throw new Error(`${image.name} image already exists`)
|
||||
|
|
@ -139,7 +139,7 @@ export const uploadImageToWNFS: (
|
|||
|
||||
// Create a sub directory and add some content
|
||||
await fs.write(
|
||||
wn.path.combine(GALLERY_DIRS[ selectedArea ], wn.path.file(image.name)),
|
||||
odd.path.combine(GALLERY_DIRS[ selectedArea ], odd.path.file(image.name)),
|
||||
await fileToUint8Array(image)
|
||||
)
|
||||
|
||||
|
|
@ -165,12 +165,12 @@ export const deleteImageFromWNFS: (
|
|||
const fs = getStore(filesystemStore)
|
||||
|
||||
const imageExists = await fs.exists(
|
||||
wn.path.combine(GALLERY_DIRS[ selectedArea ], wn.path.file(name))
|
||||
odd.path.combine(GALLERY_DIRS[ selectedArea ], odd.path.file(name))
|
||||
)
|
||||
|
||||
if (imageExists) {
|
||||
// Remove images from server
|
||||
await fs.rm(wn.path.combine(GALLERY_DIRS[ selectedArea ], wn.path.file(name)))
|
||||
await fs.rm(odd.path.combine(GALLERY_DIRS[ selectedArea ], odd.path.file(name)))
|
||||
|
||||
// Announce the changes to the server
|
||||
await fs.publish()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type * as webnative from 'webnative'
|
||||
import type * as odd from '@oddjs/odd'
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
let view: LinkDeviceView = 'link-device'
|
||||
|
||||
let accountLinkingConsumer: webnative.AccountLinkingConsumer
|
||||
let accountLinkingConsumer: odd.AccountLinkingConsumer
|
||||
let displayPin: string = ''
|
||||
|
||||
const hashedUsername = extractSearchParam($page.url, 'hashedUsername')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { writable } from 'svelte/store'
|
||||
import type { Writable } from 'svelte/store'
|
||||
import type FileSystem from 'webnative/fs/index'
|
||||
import type FileSystem from '@oddjs/odd/fs/index'
|
||||
|
||||
import { loadTheme } from '$lib/theme'
|
||||
import type { AccountSettings } from '$lib/account-settings'
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
</svg>
|
||||
</a>
|
||||
<a class="flex items-center justify-center gap-2 font-bold text-sm text-base-content"
|
||||
href="https://github.com/webnative-examples/" target="_blank">
|
||||
href="https://github.com/oddsdk/" target="_blank">
|
||||
Github
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="23" height="24" fill="none">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5"
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<div
|
||||
class="fixed z-0 lg:z-20 right-0 bottom-0 left-0 h-8 flex items-center justify-center bg-base-content overflow-x-hidden">
|
||||
<p class="whitespace-nowrap font-bold text-[10px] sm:text-[12px] text-orange-500">***
|
||||
Experimental *** - You are currently previewing Webnative SDK Alpha
|
||||
Experimental *** - You are currently previewing ODD SDK Alpha
|
||||
0.2</p>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 397 KiB |
Loading…
Reference in New Issue