Aditya Arora hai 2 meses
pai
achega
deb2f4e02b

+ 0 - 67
apps/developer-hub/content/docs/openapi/(generated)/index.mdx

@@ -1,67 +0,0 @@
----
-title: fortuna
-full: true
-_openapi:
-  toc:
-    - depth: 2
-      title: Get the list of supported chain ids
-      url: "#get-the-list-of-supported-chain-ids"
-    - depth: 2
-      title: Reveal the random value for a given sequence number and blockchain.
-      url: "#reveal-the-random-value-for-a-given-sequence-number-and-blockchain"
-    - depth: 2
-      title: Returns the logs of all requests captured by the keeper.
-      url: "#returns-the-logs-of-all-requests-captured-by-the-keeper"
-  structuredData:
-    headings:
-      - content: Get the list of supported chain ids
-        id: get-the-list-of-supported-chain-ids
-      - content: Reveal the random value for a given sequence number and blockchain.
-        id: reveal-the-random-value-for-a-given-sequence-number-and-blockchain
-      - content: Returns the logs of all requests captured by the keeper.
-        id: returns-the-logs-of-all-requests-captured-by-the-keeper
-    contents:
-      - content: Get the list of supported chain ids
-        heading: get-the-list-of-supported-chain-ids
-      - content: >-
-          Reveal the random value for a given sequence number and blockchain.
-
-
-          Given a sequence number, retrieve the corresponding random value that
-          this provider has committed to.
-
-          This endpoint will not return the random value unless someone has
-          requested the sequence number on-chain.
-
-
-          Every blockchain supported by this service has a distinct sequence of
-          random numbers and chain_id.
-
-          Callers must pass the appropriate chain_id to ensure they fetch the
-          correct random number.
-        heading: reveal-the-random-value-for-a-given-sequence-number-and-blockchain
-      - content: >-
-          Returns the logs of all requests captured by the keeper.
-
-
-          This endpoint allows you to filter the logs by a specific network ID,
-          a query string (which can be a transaction hash, sender address, or
-          sequence number), and a time range.
-
-          This is useful for debugging and monitoring the requests made to the
-          Entropy contracts on various chains.
-        heading: returns-the-logs-of-all-requests-captured-by-the-keeper
----
-
-{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
-
-<APIPage
-  document={"https://fortuna.dourolabs.app/docs/openapi.json"}
-  operations={[
-    { path: "/v1/chains", method: "get" },
-    { path: "/v1/chains/{chain_id}/revelations/{sequence}", method: "get" },
-    { path: "/v1/logs", method: "get" },
-  ]}
-  webhooks={[]}
-  hasHead={true}
-/>

+ 18 - 0
apps/developer-hub/content/docs/openapi/operation/route/chain_ids.mdx

@@ -0,0 +1,18 @@
+---
+title: Get the list of supported chain ids
+full: true
+_openapi:
+  method: GET
+  route: /v1/chains
+  toc: []
+  structuredData:
+    headings: []
+    contents:
+      - content: Get the list of supported chain ids
+---
+
+{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
+
+Get the list of supported chain ids
+
+<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/chains","method":"get"}]} webhooks={[]} hasHead={false} />

+ 30 - 0
apps/developer-hub/content/docs/openapi/operation/route/explorer.mdx

@@ -0,0 +1,30 @@
+---
+title: Returns the logs of all requests captured by the keeper.
+full: true
+_openapi:
+  method: GET
+  route: /v1/logs
+  toc: []
+  structuredData:
+    headings: []
+    contents:
+      - content: >-
+          Returns the logs of all requests captured by the keeper.
+
+
+          This endpoint allows you to filter the logs by a specific network ID,
+          a query string (which can be a transaction hash, sender address, or
+          sequence number), and a time range.
+
+          This is useful for debugging and monitoring the requests made to the
+          Entropy contracts on various chains.
+---
+
+{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
+
+Returns the logs of all requests captured by the keeper.
+
+This endpoint allows you to filter the logs by a specific network ID, a query string (which can be a transaction hash, sender address, or sequence number), and a time range.
+This is useful for debugging and monitoring the requests made to the Entropy contracts on various chains.
+
+<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/logs","method":"get"}]} webhooks={[]} hasHead={false} />

+ 39 - 0
apps/developer-hub/content/docs/openapi/operation/route/revelation.mdx

@@ -0,0 +1,39 @@
+---
+title: Reveal the random value for a given sequence number and blockchain.
+full: true
+_openapi:
+  method: GET
+  route: /v1/chains/{chain_id}/revelations/{sequence}
+  toc: []
+  structuredData:
+    headings: []
+    contents:
+      - content: >-
+          Reveal the random value for a given sequence number and blockchain.
+
+
+          Given a sequence number, retrieve the corresponding random value that
+          this provider has committed to.
+
+          This endpoint will not return the random value unless someone has
+          requested the sequence number on-chain.
+
+
+          Every blockchain supported by this service has a distinct sequence of
+          random numbers and chain_id.
+
+          Callers must pass the appropriate chain_id to ensure they fetch the
+          correct random number.
+---
+
+{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
+
+Reveal the random value for a given sequence number and blockchain.
+
+Given a sequence number, retrieve the corresponding random value that this provider has committed to.
+This endpoint will not return the random value unless someone has requested the sequence number on-chain.
+
+Every blockchain supported by this service has a distinct sequence of random numbers and chain_id.
+Callers must pass the appropriate chain_id to ensure they fetch the correct random number.
+
+<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/chains/{chain_id}/revelations/{sequence}","method":"get"}]} webhooks={[]} hasHead={false} />

+ 10 - 9
apps/developer-hub/scripts/generate-docs.ts

@@ -2,14 +2,15 @@ import { generateFiles } from "fumadocs-openapi";
 
 import { openapi } from "../src/lib/openapi";
 
-// const schemas = await openapi.getSchemas();
+const outDir = "./content/docs/openapi/operation/route";
 
-// const fortunaSchema = schemas[fortunaOpenApiUrl];
-// const fortunaStagingSchema = schemas[fortunaStagingOpenApiUrl];
+export async function generateDocs() {
+    await generateFiles({
+        input: openapi,
+        output: outDir,
+        per: 'operation',
+        includeDescription: true,
+    });
+}
 
-void generateFiles({
-  input: openapi,
-  output: "./content/docs/openapi/(generated)",
-  per: "file",
-  includeDescription: true,
-});
+await generateDocs();

+ 2 - 4
apps/developer-hub/src/lib/openapi.ts

@@ -1,10 +1,8 @@
 import { createOpenAPI } from "fumadocs-openapi/server";
 
-export const fortunaOpenApiUrl =
+export const fortunaOpenApiJson =
   "https://fortuna.dourolabs.app/docs/openapi.json";
-export const fortunaStagingOpenApiUrl =
-  "https://fortuna-staging.dourolabs.app/docs/openapi.json";
 
 export const openapi = createOpenAPI({
-  input: [fortunaOpenApiUrl, fortunaStagingOpenApiUrl],
+  input: [fortunaOpenApiJson],
 });