Skip to content

Commit

Permalink
Merge pull request #162 from Chia-Network/import-subscribe-delete-rew…
Browse files Browse the repository at this point in the history
…ork-dec-2024

feat: added datamodel version storeid and hash to organization table
  • Loading branch information
wwills2 authored Jan 31, 2025
2 parents 020bfc9 + 860317e commit c1d5597
Show file tree
Hide file tree
Showing 31 changed files with 1,340 additions and 528 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ testMirror.sqlite3
/dist
/venv

# python
/venv

# misc
.DS_Store
.env
Expand Down
31 changes: 15 additions & 16 deletions docs/cadt_rpc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If using a `CADT_API_KEY` append `--header 'x-api-key: <your-api-key-here>'` to
- [POST Examples](#post-examples)
- [Create an organization](#create-an-organization)
- [PUT Examples](#put-examples)
- [Import a home organization](#import-a-home-organization-that-datalayer-is-subscribed-to)
- [Import a home organization](#import-an-organization-and-subscribe-to-its-stores-on-datalayer)
- [DELETE Examples](#delete-examples)
- [Delete a home organization](#reset-home-organization)
- [Additional organizations resources](#additional-organizations-resources)
Expand Down Expand Up @@ -220,13 +220,14 @@ Response

PUT Options:

| Key | Type | Description |
|:------:|:------:|:----------------------------------------------------:|
| orgUid | String | (Required) OrgUid of the home organization to import |
| Key | Type | Description |
|:------:|:-------:|:----------------------------------------------------------------------------------:|
| orgUid | String | (Required) OrgUid of the home organization to import |
| isHome | Boolean | (Optional) Specify true if the specified orgUid should be imported as the home org |

### PUT Examples

#### Import a home organization that datalayer is subscribed to
#### Import an organization and subscribe to its stores on datalayer

- This is typically used when an organization currently using CADT is installing a new instance and wants to use the
same
Expand All @@ -246,20 +247,22 @@ Response

```json
{
"message": "Importing home organization."
"success": true,
"message": "Successfully imported organization. CADT will begin syncing data from datalayer shortly"
}
```

DELETE Options: None

### DELETE Examples

#### Delete home organization
#### Delete organization

Request

```sh
curl --location --request DELETE 'http://localhost:31310/v1/organizations/'
curl --location --request DELETE \
'http://localhost:31310/v1/organizations/c9661d1ce77194c9e82311418aa4d370e25e10961d74d586636354746bc9ad65'
```

Response
Expand All @@ -277,14 +280,10 @@ Response
- POST `/organizations/sync` - runs the process to sync all subscribed organization metadata with datalayer
- POST `/organizations/create` - create an organization without an icon
- POST `/organizations/edit` - update an organization name and/or icon
- PUT `/organizations/import` - subscribe and import an organization via OrgUid
- DELETE `organizations/import` - delete an organization's record from the CADT instance DB
- PUT `organizations/subscribe` - subscribe to an organization datalayer singleton
- DELETE `organizations/unsubscribe` - unsubscribe from an organization datalayer singleton and keep CADT data
- PUT `organizations/resync` - resync an organization from datalayer
- POST `organizations/mirror` - add a mirror for a datalayer store via the store ID
- GET `organizations/metadata` - get an organizations metadata using the OrgUid
- GET `organizations/status` - the sync status of an organization via the OrgUid
- PUT `/organizations/resync` - resync an organization from datalayer
- POST `/organizations/mirror` - add a mirror for a datalayer store via the store ID
- GET `/organizations/metadata` - get an organizations metadata using the OrgUid
- GET `/organizations/status` - the sync status of an organization via the OrgUid

---

Expand Down
Loading

0 comments on commit c1d5597

Please sign in to comment.