Skip to content

Commit

Permalink
Add new examples to examples.json in API metadata documentation (#420)
Browse files Browse the repository at this point in the history
* merge metadata openapi documents

* merge into metadata.gen.yaml

* update metadata with examples

* [AUTOMATED] Update: docs/pages/api/**/*.gen.yaml

* generate *.gen.yaml before build and dev

* remove extra merge examples in github workflows

* generate analytics docs while building

* delete docs build workflow

* fix analytics example structure

* Add new examples to examples.json in API metadata documentation

Improved example_merger.js to detect additional body types: application/octet-stream and multipart/form-data. Now also detects POST and PUT endpoint examples.

---------

Co-authored-by: Lukas Jenicek <[email protected]>
Co-authored-by: LukasJenicek <[email protected]>
Co-authored-by: James Lawton <[email protected]>
  • Loading branch information
4 people authored Nov 1, 2024
1 parent 3d1911d commit 0eeef04
Show file tree
Hide file tree
Showing 4 changed files with 383 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
BRANCH: build
FOLDER: ./docs/dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "Build: ({sha}) {msg}"
MESSAGE: "Build: ({sha}) {msg}"
326 changes: 326 additions & 0 deletions docs/pages/api/metadata/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2058,5 +2058,331 @@
},
"tag": ["secret"]
}
],
"/projects/{projectId}/collections/{collectionId}/assets/{assetId}/upload": [
{
"request": {
"file": "YOUR_FILE_FORM_DATA_FILE"
},
"response": {
"id": 4658,
"collectionId": 909,
"tokenId": "200",
"url": "https://metadata.sequence.app/projects/30957/collections/909/tokens/200/image.png",
"metadataField": "image",
"filename": "image.png",
"filesize": 27972,
"mimeType": "image/png",
"width": 1024,
"height": 683,
"updatedAt": "2024-11-01T04:13:34.729008063Z"
},
"tag": ["secret"]
}
],
"/projects/{projectId}/collections/{collectionId}/tokens/{tokenId}/upload/{assetIdOrAssetType}": [
{
"request": {
"file": "YOUR_FILE_FORM_DATA_FILE"
},
"response": {
"id": 4658,
"collectionId": 909,
"tokenId": "200",
"url": "https://metadata.sequence.app/projects/30957/collections/909/tokens/200/image.png",
"metadataField": "image",
"filename": "image.png",
"filesize": 27972,
"mimeType": "image/png",
"width": 1024,
"height": 683,
"updatedAt": "2024-11-01T04:13:34.729008063Z"
},
"tag": ["secret"]
}
],
"/rpc/Collections/CreateContractCollection": [
{
"request": {
"projectId": 30957,
"contractCollection": {
"chainId": 80002,
"contractAddress": "0x477566e9ade2dfa69f066f909e36ad617a2adef7",
"collectionId": 819
}
},
"response": {
"contractCollection": {
"id": 460,
"chainId": 80002,
"contractAddress": "0x477566e9ade2dfa69f066f909e36ad617a2adef7",
"collectionId": 819
}
},
"tag": ["secret"]
}
],
"/rpc/Collections/GetContractCollection": [
{
"request": {
"projectId": 30957,
"chainId": 80002,
"contractAddress": "0x6325e304e6eea3c818f1eaf8924570d491e1f6d4"
},
"response": {
"contractCollection": {
"id": 442,
"chainId": 80002,
"contractAddress": "0x6325e304e6eea3c818f1eaf8924570d491e1f6d4",
"collectionId": 908
}
},
"tag": ["secret"]
}
],
"/rpc/Metadata/GetTokenMetadataBatch": [
{
"request": {
"chainID": "80002",
"contractTokenMap": {
"0x8070c5b48b1ce7b3219660c79b23e8679bfd5041": ["0", "1"],
"0x70a2177079877e4aae639d1abb29ffa537b94970": [
"0",
"1",
"2",
"3",
"4",
"5"
]
}
},
"response": {
"contractTokenMetadata": {
"0x70a2177079877e4aae639d1abb29ffa537b94970": [
{
"tokenId": "0",
"name": "Divine Axe #160",
"description": "This legendary axe, blessed by ancient gods, capable of shattering mountains.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/0/image.png",
"properties": null,
"attributes": [
{
"sharpness": 1120
},
{
"attackPower": 463
},
{
"weight": 700
},
{
"criticalHitChance": 1218
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
},
{
"tokenId": "1",
"name": "Divine Axe #724",
"description": "This powerful axe, blessed by ancient gods, with the power to summon storms.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/1/image.png",
"properties": null,
"attributes": [
{
"speed": 1491
},
{
"edgeRetention": 1198
},
{
"criticalHitChance": 370
},
{
"attackPower": 396
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
},
{
"tokenId": "2",
"name": "Divine Axe #819",
"description": "This ancient axe, blessed by ancient gods, capable of shattering mountains.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/2/image.png",
"properties": null,
"attributes": [
{
"balance": 81
},
{
"edgeRetention": 283
},
{
"sharpness": 105
},
{
"durability": 338
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
},
{
"tokenId": "3",
"name": "Divine Axe #948",
"description": "This enchanted axe, crafted by the hands of giants, which never dulls.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/3/image.png",
"properties": null,
"attributes": [
{
"speed": 1314
},
{
"balance": 1235
},
{
"weight": 48
},
{
"magic": 826
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
},
{
"tokenId": "4",
"name": "Divine Axe #031",
"description": "This powerful axe, forged in the fires of a dying star, which never dulls.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/4/image.png",
"properties": null,
"attributes": [
{
"speed": 1144
},
{
"elementalAffinity": 1315
},
{
"edgeRetention": 1128
},
{
"sharpness": 1232
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
},
{
"tokenId": "5",
"name": "Divine Axe #452",
"description": "This enchanted axe, crafted by the hands of giants, with the power to summon storms.",
"image": "https://metadata.sequence.app/projects/30957/collections/819/tokens/5/image.png",
"properties": null,
"attributes": [
{
"elementalAffinity": 803
},
{
"durability": 83
},
{
"criticalHitChance": 268
},
{
"balance": 1039
}
],
"updatedAt": "2024-11-01T08:29:29.848063928Z"
}
],
"0x8070c5b48b1ce7b3219660c79b23e8679bfd5041": [
{
"tokenId": "0",
"name": "Test nft erc721",
"description": "Description",
"image": "https://metadata.sequence.app/projects/30957/collections/273/tokens/0/image.jpg",
"properties": {
"armor": "100"
},
"attributes": null,
"updatedAt": "2024-11-01T08:18:33.514523974Z"
},
{
"tokenId": "1",
"name": "NFT 2 Amoy",
"description": "Description",
"image": "https://metadata.sequence.app/projects/30957/collections/273/tokens/1/image.jpg",
"properties": null,
"attributes": null,
"updatedAt": "2024-11-01T08:18:33.514523974Z"
}
]
}
},
"tag": ["public"]
}
],
"/rpc/Collections/ListContractCollections": [
{
"request": {
"collectionId": 819,
"projectId": 30957
},
"response": {
"contractCollections": [
{
"id": 370,
"chainId": 80002,
"contractAddress": "0x70a2177079877e4aae639d1abb29ffa537b94970",
"collectionId": 819
}
],
"collections": [
{
"id": 819,
"projectId": 30957,
"metadata": {
"name": "Placeholders",
"description": "Placeholders collection",
"image": "https://metadata.sequence.app/projects/30957/collections/819/image.png"
},
"private": false,
"createdAt": "2024-10-03T18:46:15.987375Z",
"updatedAt": "2024-10-03T18:46:18.25727Z"
}
],
"page": {
"pageSize": 30,
"more": false
}
},
"tag": ["secret"]
}
],
"/rpc/Collections/UpdateContractCollection": [
{
"request": {
"projectId": 30957,
"contractCollection": {
"chainId": 80002,
"contractAddress": "0x70a2177079877e4aae639d1abb29ffa537b94970",
"collectionId": 819
}
},
"response": {
"ok": true
},
"tag": ["secret"]
}
],
"/rpc/Collections/DeleteContractCollection": [
{
"request": {
"projectId": 30957,
"chainId": 80002,
"contractAddress": "0x477566e9ade2dfa69f066f909e36ad617a2adef7"
},
"response": {
"ok": true
},
"tag": ["secret"]
}
]
}
Loading

0 comments on commit 0eeef04

Please sign in to comment.