Skip to content

Commit

Permalink
remove all references to legacy repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Sep 14, 2024
1 parent 7b30a24 commit 2063835
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions documentation/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ marketplace = new libstore.Store(anura.net, {

## Adding a repo

To fetch a repo and its contents use the `getRepo` method. This method will return a `StoreRepo` or a `StoreRepoLegacy` Object. The repo url must end with a trailing slash.
To fetch a repo and its contents use the `getRepo` method. This method will return a `StoreRepo` Object. The repo url must end with a trailing slash.

**Usage:**

Expand All @@ -192,15 +192,11 @@ const marketplaceRepo = await marketplace.getRepo(

After initializing your repo, there is somethings to keep in mind before using it.

### Repo Version

First, check if your repo is a legacy repo. you can do this by checking the `version` property of the StoreRepo that you get returned to you. If your repo returns `"legacy"`, this means that the repo does not have a manifest, which means that this repo is pre 2.0, which means that apps and libraries are identified by their names and not their package idenfitifers.

### Properties

#### repo.manifest: `Object | undefined`
#### repo.manifest: `Object`

This contains the manifest for the repo, this will only work on 2.0 repos and will be undefined for legacy repos.
This contains the manifest for the repo.

### Functions

Expand Down Expand Up @@ -234,12 +230,12 @@ button.addEventListener("click", () => {

#### repo.getRepoManifest

This method fetches the repo manifest, and returns the repo version. The manifest is then set as repo.manifest. If the repo is legacy, this does method does not exist as legacy repos do not have a manifest. The repo manifest is already fetched at the start of a repo, which means this does not need to be rerun unless you need to fetch it again.
This method fetches the repo manifest, and returns the repo version. The manifest is then set at repo.manifest.

**Usage:**

```js
let version = await repo.getRepoManifest();
const version = await repo.getRepoManifest();
console.log(`Repo Version: ${version}`);
console.log("Repo Manifest: ", repo.manifest);
```
Expand All @@ -257,7 +253,7 @@ apps.forEach((app) => {

#### repo.getApp: `Object`

This method grabs an app based on its package identifier if it is >=2.0 or takes in a package name if its legacy and then returns its app details in an object.
This method grabs an app based on its package identifier.

```js
let app = await repo.getApp("anura.ide");
Expand All @@ -266,15 +262,15 @@ console.log("App Data: ", app);

#### repo.installApp: `void`

This method installs an app based on its package identifier if it is >=2.0 or takes in a package name if its legacy.
This method installs an app based on its package identifier.

```js
await repo.installApp("anura.ide");
```

#### repo.getAppThumb: `string | undefined`

This method grabs a app icon based on its package identifier if it is >=2.0 or takes in a package name if its legacy and then returns a blob url of the icon.
This method grabs a app icon based on its package identifier.

```js
let icon = await repo.getAppThumb("anura.ide");
Expand All @@ -296,7 +292,7 @@ libs.forEach((lib) => {

#### repo.getLib: `Object`

This method grabs an library based on its package identifier if it is >=2.0 or takes in a package name if its legacy and then returns its library details in an object.
This method grabs an library based on its package identifier.

```js
let lib = await repo.getlib("anura.flash.handler");
Expand All @@ -305,15 +301,15 @@ console.log("Library Data: ", lib);

#### repo.installLib: `void`

This method installs an library based on its package identifier if it is >=2.0 or takes in a package name if its legacy.
This method installs an library based on its package identifier.

```js
await repo.installLib("anura.flash.handler");
```

#### repo.getLibThumb: `string | undefined`

This method grabs a library icon based on its package identifier if it is >=2.0 or takes in a package name if its legacy and then returns a blob url of the icon.
This method grabs a library icon based on its package identifier.

```js
let icon = await repo.getLibThumb("anura.flash.handler");
Expand Down

0 comments on commit 2063835

Please sign in to comment.