added api docs page

This commit is contained in:
csawatzky 2025-04-10 10:18:09 -06:00
parent 0bf12c7d40
commit 538da5c4bb
21 changed files with 7562 additions and 1 deletions

View file

@ -0,0 +1,500 @@
import { Box, List, ListItem, Typography } from "@mui/material";
import EndpointDisplay, { EndPointData } from "apiDocs/endpoints/endpointDisplay";
import React from "react";
/**
* endpoint template
{
requestType: "",
url: "https://api.brandxtech.ca/v1/",
description: "",
urlOptions: [],
urlParams: [],
requestBody: "",
responseParams: []
},
*/
export default function AgricultureEndpoints() {
//note any requests that are not a get are commented out as our backend only allows get requests through the API for the moment
//if you are here to put the other requests types into the api docs make sure to finish the documentation for each endpoint
const fieldEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/fields",
description: "get a list of fields",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated Field fields", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/field/:field",
description: "get a specified field",
urlParams: [":field - the key of the field"],
responseParams: [
"FieldSettings settings",
"FieldStatus status",
"repeated Permission field_permissions"
]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/fields/:field",
// description: "add a new field",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/fields/:field",
// description: "update an existing field",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/fields/:field",
// description: "remove an existing field",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const binEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/bins",
description: "get a list of bins",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated Bin bins", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/binsAndData",
description: "list bins and their metrics",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: [
"repeated Bin bins",
"repeated BinYard bin_yards",
"BinMetrics metrics",
"uint32 next_offset",
"uint32 total",
"repeated GrainBag bags"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/bins/:bin",
description: "gets a specified bin",
urlParams: [":bin - the key of the bin"],
responseParams: [
"BinSettings settings",
"BinStatus status",
"repeated Permission bin_permissions"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/bins/:bin/components",
description: "list the components linked to a bin",
urlParams: [":bin - the key of the bin"],
responseParams: ["repeated Component components", "map<string, uint64> component_devices"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/bins/:bin/components/measurements",
description: "get the measurements for components attached to a bin over a set interval",
urlOptions: ["start - RFC3339 formatted timestamp", "end - RFC3339 formatted timestamp"],
urlParams: [":bin - the key of the bin"],
responseParams: ["repeated UnitMeasurementsForComponent measurements"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/bins/:bin/history",
description: "get the history of changes to a bin",
urlOptions: [
"limit - the number of records to retrieve",
"offset - the number of records to skip over before startgin retrieval"
],
urlParams: [":bin - the key of the bin"],
responseParams: ["repeated BinHistory history", "uint32 next_offset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bins",
// description: "add a new bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bins/:bin/addComponent/:device/:component",
// description: "attach an existing component on a device to a bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bins/:bin/removeComponent/:device/:component",
// description: "",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bins/:bin/removeAllComponents",
// description: "removes all attached components from a bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bins/:bin/updateTopNodes",
// description: "updates the top nodes of cable components ttached to a bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/bins/:bin",
// description: "update a bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/bins/:bin",
// description: "removes an existing bin",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const binYardEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/binYards",
description: "get a list of bin yards",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated BinYard yard", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/binYards/:binYard",
description: "get a specific bin yard",
urlParams: [":binYard - the key for the yard"],
responseParams: ["BinYard yard"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/binYards",
// description: "add a new bin yard",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/binyards/:binyard",
// description: "update an existing binyard",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/binyards/:binyard",
// description: "delete an existing bin yard",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const harvestPlanEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/harvestplans",
description: "get a list of harvest plans",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated HarvestPlan harvest_plan", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/harvestplans/:harvestplan",
description: "get a specified harvest plan",
urlParams: [":harvestplan - the key of the harvest plan"],
responseParams: [
"HarvestPlanSettings settings",
"HarvestPlanStatus status",
"repeated Permission plan_permissions"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/harvestplans/:harvestplan/history",
description: "get a history of changes to the harvest plan",
urlOptions: [
"limit - the number to load",
"offset - the number to pass over before starting to load"
],
urlParams: [":harvestplan - the key of the harvest plan"],
responseParams: ["repeated HarvestPlanHistory history", "uint32 next_offset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/harvestplans",
// description: "create a new harvest plan",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const contractEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/contracts",
description: "get a list of contracts",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated Contract contracts", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/contracts/:contract",
description: "get a specified contract",
urlParams: [":contract - the key of the contract"],
responseParams: ["Contract contract"]
},
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/contracts",
// description: "add a new contract",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/contracts/:contract",
// description: "update an existing contract",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/contracts/:contract",
// description: "remove an existing contract",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/contractsbyyear",
description: "get a list of contracts for a specified year",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data",
"year - the year for the contracts"
],
responseParams: [
"repeated Contract contracts",
"uint32 next_offset",
"uint32 total",
"map<string, EvaluatePermissionsResponse> contract_permissions"
]
}
];
const grainBagEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/grainbags",
description: "get a list of grainbags",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated GrainBag grain_bags", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/grainbags/:grainbag",
description: "get a specified grainbag",
urlParams: [":grainbag - the key of the grain bag"],
responseParams: ["GrainBag grain_bag"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/grainbags/:grainbag/history",
description: "get the history of changes to a grain bag",
urlOptions: [
"limit - the number of records to load",
"offset - the number of records to skip over before starting to load",
"start - RFC3339 formatted timestamp",
"end - RFC3339 formatted timestamp"
],
urlParams: [":grainbag - the key of the grainbag"],
responseParams: ["repeated ObjectHistory history", "uint32 next_offset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/grainbags",
// description: "add a new grain bag",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/grainbags/:grainbag",
// description: "update an existing grain bag",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/grainbags/:grainbag",
// description: "delete an existing grain bag",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
return (
<Box>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving field data
</Typography>
<List>
{fieldEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving bin data
</Typography>
<List>
{binEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving bin yard data
</Typography>
<List>
{binYardEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving harvest plan data
</Typography>
<List>
{harvestPlanEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving contract data
</Typography>
<List>
{contractEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving grain bag data
</Typography>
<List>
{grainBagEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
</Box>
);
}

View file

@ -0,0 +1,179 @@
import { Box, List, ListItem, Typography } from "@mui/material";
import EndpointDisplay, { EndPointData } from "apiDocs/endpoints/endpointDisplay";
import React from "react";
/**
{
requestType: "",
url: "https://api.brandxtech.ca/v1/",
description: "",
urlOptions: [],
urlParams: [],
requestBody: "",
responseParams: []
},
*/
export default function AviationEndpoints() {
//note any requests that are not a get are commented out as our backend only allows get requests through the API for the moment
//if you are here to put the other requests types into the api docs make sure to finish the documentation for each endpoint
const terminalEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/terminals",
description: "gets a list of terminals",
urlOptions: [
"limit - the number of terminals to load",
"offset - the number of terminals to skip over before loading",
"order - the sort order",
"by - what to sort by in the terminals settings",
"search - a string to search the terminals settings and return matches"
],
requestBody: "",
responseParams: ["repeated Terminal terminals", "uint32 next_offset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/terminals",
// description: "add a new terminal",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/terminals/:terminal",
// description: "update an existing terminal",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/terminals/:terminal",
// description: "remove an existing terminal",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const gateEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/gates",
description: "gets list of gates",
urlOptions: [
"limit - the number of gates to load",
"offset - the number of gates to skip before starting to load",
"order - the sort order",
"by - what to sort by in the gate settings",
"search - a string to search the gate settings for and "
],
responseParams: ["repeated Gate gates", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/gates/:gate/measurements",
description: "get the measurements for the components linked to the gate",
urlOptions: ["start - RFC3339 formatted timestamp", "end - RFC3339 formatted timestamp"],
urlParams: [":gate - the key of the gate"],
responseParams: ["repeated UnitMeasurementsForComponent measurements"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/gates/:gate",
description: "get a specified gate",
urlParams: [":gate - the key of the gate"],
responseParams: ["Gate gate"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/gates/:gate/airflow",
description: "get the estimated mass airflow of the gate",
urlOptions: [
"device - the id of the device",
"ambient - the key of the component assigned to ambient temp",
"pressure - the key of the component assigned to pressure",
"start - RFC3339 formatted timestamp for the start of the measurement window",
"start - RFC3339 formatted timestamp for the end of the measurement window"
],
urlParams: [":gate - the key of the gate"],
responseParams: ["repeated FlowAt values"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/gates",
// description: "add a new gate",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// may restrict this one as it effectively changes permissions a gate has to a device
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/gates/:gate/link",
// description: "update the devices linked to the gate",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/gates/:gate",
// description: "update an existing gates settings",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/gatePrefs/:gate",
// description: "update the preferences of an existing gate",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/gates/:gate",
// description: "delete an existing gate",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
return (
<Box>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving terminal data
</Typography>
<List>
{terminalEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving gate data
</Typography>
<List>
{gateEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
</Box>
);
}

View file

@ -0,0 +1,161 @@
import { Box, List, ListItem, Typography } from "@mui/material";
import EndpointDisplay, { EndPointData } from "apiDocs/endpoints/endpointDisplay";
import React from "react";
/**
* endpoint template
{
requestType: "",
url: "https://api.brandxtech.ca/v1/",
description: "",
urlOptions: [],
urlParams: [],
requestBody: "",
responseParams: []
},
*/
export default function ConstructionEndpoints() {
const jobsiteEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/sites",
description: "get a list of jobsites",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated Site sites", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/sites/:site",
description: "get a specific site",
urlParams: [":site - the key of the site"],
responseParams: ["SiteSettings settings", "SiteStatus status"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/sites",
// description: "add a new jobsite",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/sites/:site/link",
// description: "update the devices linked to a site",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/sites/:site",
// description: "update an existing jobsite",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/sites/:site",
// description: "",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const heaterEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/objectHeaters",
description:
"get a list of heater objects, note these are different than the heater components on a device",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated ObjectHeater heaters", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/objectHeaters/:objectHeater",
description:
"get a specific object heater, not this is different than a heater component on a device",
urlParams: [":objectHeater - the key of the heater object"],
responseParams: ["ObjectHeater heater"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/objectHeaters",
// description: "add a new heater object",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/objectHeaters/:objectHeater/link",
// description: "update the device connected to the heater",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/objectHeaters/:objectHeater",
// description: "update an existing heater",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/objectHeaters/:objectHeater",
// description: "delete an existing heater",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
return (
<Box>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving jobsite data
</Typography>
<List>
{jobsiteEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving heater data
</Typography>
<List>
{heaterEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
</Box>
);
}

View file

@ -0,0 +1,83 @@
import { Box, Grid2 as Grid, List, ListItem, Typography } from "@mui/material";
import React from "react";
export interface EndPointData {
requestType: "GET" | "POST" | "PUT" | "DEL";
url: string;
description: string;
urlParams?: string[];
urlOptions?: string[];
requestBody?: string;
responseParams?: string[];
}
interface Props {
endpoint: EndPointData;
}
export default function EndpointDisplay(props: Props) {
const { endpoint } = props;
return (
<Box style={{ border: "2px solid white", padding: 10, borderRadius: 10 }}>
<Grid container spacing={2} >
<Grid size={12}>
<Typography variant="h6">
{endpoint.requestType} {endpoint.url}
</Typography>
<Typography>{endpoint.description}</Typography>
</Grid>
<Grid size={6}>
<Typography variant="h6" style={{ fontWeight: 650 }}>
Request
</Typography>
</Grid>
<Grid size={6}>
<Typography variant="h6" style={{ fontWeight: 650 }}>
Response
</Typography>
</Grid>
<Grid size={6}>
{endpoint.urlParams && (
<React.Fragment>
<Typography>URL Parameters</Typography>
<List>
{endpoint.urlParams.map((param, i) => (
<ListItem key={i}>{param}</ListItem>
))}
</List>
</React.Fragment>
)}
{endpoint.urlOptions && (
<React.Fragment>
<Typography>URL Options</Typography>
<List>
{endpoint.urlOptions.map((op, i) => (
<ListItem key={i}>{op}</ListItem>
))}
</List>
</React.Fragment>
)}
{endpoint.requestBody && (
<React.Fragment>
<Typography>Request Body</Typography>
<List>
<ListItem key={"body"}>{endpoint.requestBody}</ListItem>
</List>
</React.Fragment>
)}
</Grid>
<Grid size={6}>
{"{"}
{endpoint.responseParams && (
<List>
{endpoint.responseParams.map((op, i) => (
<ListItem key={i}>{op}</ListItem>
))}
</List>
)}
{"}"}
</Grid>
</Grid>
</Box>
);
}

View file

@ -0,0 +1,839 @@
import { Box, List, ListItem, Typography } from "@mui/material";
import EndpointDisplay, { EndPointData } from "apiDocs/endpoints/endpointDisplay";
const genericListOptions = [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search the data for a match"
];
export default function GeneralEndpoints() {
//all of the endpoint that are not a get are commented out for now as users with the api keys can only hit get endpoints
const apiKeys: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/teams/:team/apiKeys",
description: "gets all of the api keys associated with a team",
urlParams: [":team - the unique id for a team"],
responseParams: ["repeated string keys"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/teams/:team/apiKeys",
// description: "add a new api key for the team",
// urlParams: [":team - the unique id for a team"],
// responseParams: ["string key"]
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/teams/:team/apiKeys",
// description: "add a new api key for the team",
// urlParams: [":team - the unique id for a team"],
// urlOptions: ["key - the api key to remove"]
// }
];
const notifications: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/notifications",
description: "gets a list of notifications",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search the data for a match"
],
responseParams: ["repeated Notification notifications", "uint32 nextOffset", "uint32 total"]
}
];
const notes: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/notes",
description: "gets a list of notes",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search the data for a match"
],
responseParams: ["repeated Note notes", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/note/:note",
description: "gets a list of notes",
urlParams: [":note - the key of the note"],
responseParams: ["NoteSettings settings", "NoteStatus status"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/notes",
// description: "adds a new note",
// requestBody: "NoteSettings",
// responseParams: ["string note"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/notes",
// description: "updates an existing note",
// requestBody: "NoteSettings"
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/notes/:note",
// description: "deletes a note",
// urlParams: [":note - the key of the note"]
// }
];
const mapMarkers: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/homeMarkers",
description: "get the home markers set for a team",
urlOptions: genericListOptions,
urlParams: [],
requestBody: "",
responseParams: ["repeated HomeMarker homeMarker", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/homeMarkers/:homeMarker",
description: "Get a specific Home Marker based on the key",
urlParams: [":homeMarker - the key of the home marker"],
responseParams: ["HomeMarkerSettings settings", "HomeMarkerStatus status"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/fieldMarkers",
description: "list all field markers",
urlOptions: genericListOptions,
responseParams: ["repeated FieldMarker fieldMarker", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/fieldMarkers/:fieldMarker",
description: "get a specified field marker",
urlParams: [":fieldMarker - the key of the field marker"],
responseParams: ["FieldMarkerSettings settings", "FieldMarkerStatus status"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/homeMarkers",
// description: "add a new home marker",
// requestBody: "HomeMarkerSettings",
// responseParams: ["string homeMarker"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/fieldMarkers",
// description: "add a new field marker",
// requestBody: "FieldMarkerSettings",
// responseParams: ["string fieldMarker"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/homeMarkers/:homeMarker",
// description: "update an existing home marker",
// urlOptions: [":homeMarker - the key for the marker"],
// urlParams: ["HomeMarkerSettings"]
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/homeMarkers/:homeMarker",
// description: "Delete an existing home marker",
// urlParams: [":homeMarker - the key of the home marker"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/fieldMarkers/:fieldMarker",
// description: "update an existing field marker",
// urlParams: [":fieldMarker - the key for the field marker"],
// requestBody: "FieldMarkerSettings"
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/fieldMarkers/:fieldMarker",
// description: "delete an existing field marker",
// urlParams: [":fieldMarker - the key for the marker"]
// }
];
const tasks: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/tasks",
description: "get a list of tasks",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search the data for a match",
"from - RFC3339 formatted timestamp to get all tasks with start after (to be used in conjunction with to)",
"to - RFC3339 formatted timestamp to get all tasks with start before (to be used in conjunction with from)"
],
responseParams: ["repeated Task tasks", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/tasks/:task",
description: "get an existing task",
urlParams: [":task - the key for the task"],
responseParams: ["TaskSettings settigns", "string key"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/tasks",
// description: "add a new task",
// requestBody: "TaskSettings",
// responseParams: ["string task"]
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/tasks/:task",
// description: "delete an existing task",
// urlParams: [":task - the key of the task"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/tasks/:task",
// description: "update an existing task",
// urlParams: [":task - the key of the task"],
// requestBody: "TaskSettings"
// }
];
const devices: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices",
description: "get a list of devices",
urlOptions: [
"limit - the number of devices to load",
"offset - the number of devices to skip over before starting to load",
"order - what to sort the devices by",
"by - how to order them (ASC/DESC)",
"search - what to search in the devices for",
"ids - comma seperated string of device ids to get",
"comprehensive - boolean value of whether to get the components for the loaded devices",
"measurements - boolean value of wether to get the measurements when loading comprehensive devices",
"hologram - boolean value of whehter to get the hologram data for cellular devices"
],
responseParams: [
"repeated Device devices",
"uint32 next_offset",
"uint32 total",
"repeated ComprehensiveDevice comprehensive_devices",
"repeated HologramDevice hologram_devices"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/multidevices",
description: "get a list of devices based on given ids",
urlOptions: ["devices - comma seperated string of device ids"],
responseParams: ["repeated Device devices", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device",
description: "get a specified device",
urlParams: [":device - the id of the device"],
responseParams: ["DeviceSettings settings", "DeviceStatus status"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/geojson",
description: "get the geojson data of a device such as longitude and latitude",
urlParams: [":device - the id of the device"],
responseParams: ["DeviceGeoJson"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/geojson/devices",
description: "list the geojson data for devices",
urlOptions: ["devices - comma seperated string of device ids"],
responseParams: ["repeated DeviceGeoJSON geojsonDevices"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/history",
description: "get the history of changes to the device",
urlParams: [":device - the device id"],
responseParams: ["repeated DeviceHistory history", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/completeHistory",
description: "get the history of a device and all its attached components and interactions",
urlParams: [":device - the device id"],
responseParams: ["repeated ObjectHistory history", "uint32 nextOffset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/usage",
description: "get data the usage of a device from a starting point to now",
urlOptions: ["start - the date to start from"],
urlParams: [":device - the id of the device"],
responseParams: [
"string status",
"repeated Session sessions",
"float latitude",
"float longitude"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/paused",
description: "get the pause state of the device",
urlParams: [":device - the id of the device"],
responseParams: ["bool paused"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/datacap",
description: "get the monthly data cap for a device",
urlParams: [":device - the id of the device"],
responseParams: ["int64 overlimit"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/overlimit",
description: "Get whether the datacap has been hit for a device",
urlParams: [":device - the id of the device"],
responseParams: ["bool isover"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/clearPending",
// description: "clears pending device requests",
// urlParams: [":device - the id of the device"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/pause",
// description: "Pause a cellular device",
// urlParams: [":device - the id of the device"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bulkPauseDevices",
// description: "pause or resume a list of devices",
// urlOptions: [
// "ids - comma seperated list of device ids",
// "paused - boolean to pause or unpause"
// ],
// responseParams: ["repeated DeviceSuccess devicesPaused"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/bulkChangeDataCap",
// description: "change the data cap for multiple devices",
// urlOptions: [
// "ids - comma seperated list of device ids",
// "datacap - the value for the new datacap"
// ],
// responseParams: ["repeated uint64", "uint64 bytes"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/resume",
// description: "resume a cellular device",
// urlParams: [":device - the id of the device"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/sync",
// description:
// "syncronizes the configuration on the device with the configuration saved in the database",
// urlParams: [":device - the id of the device"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/upgrade",
// description: "tell a device to upgrade to the latest firmware on its channel",
// urlParams: [":device - the id of the device"],
// responseParams: ["string key"]
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/datacap",
// description: "set the monthly datacap for a device",
// urlOptions: ["limit - the new datacap for the device"],
// urlParams: [":device - the id of the device"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/tags/:tag",
// description: "sets a tag on the device",
// urlParams: [":device - the id if the device", ":tag - the tag to set on the device"]
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/update",
// description: "update a device",
// urlParams: [":device - the id of the device"],
// requestBody: "DeviceSettings"
// },
//I think users should be able to use this one but im not sure
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/wifi",
// description: "update the wifi connection of a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
//thi one i dont think users should be able to do
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/devices/:device",
// description: "remove an existing device",
// urlParams: [
// ":device - the id of the device"
// ],
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/devices/:device/tags/:tag",
// description: "remove a tag from a device",
// urlParams: [":device - the id of the device", ":tag - the tag to remove from the device"]
// }
];
const components: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/components/forObject",
description: "gets all the components linked to an object such as a bin",
urlOptions: [
"keys - comma seperated list of keys, the final key in the list is the object that will be used to load the components, all keys before are for the permissions chain",
"types - the corresponding object type for the key in the same position in the keys option"
],
responseParams: ["repeated Component components", "map<string, uint64> component_devices"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/components",
description: "Gets all components for a device",
urlOptions: [
"comprehensive - boolean whether to get the other related information for a component such as measurements"
],
urlParams: [":device - the device id"],
responseParams: ["repeated Component components", "map<string, uint64> component_devices"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/components/:component",
description: "get a specified component on a device",
urlParams: [":device - the device id", ":component - the key of the component"],
responseParams: [
"ComponentSettings settings",
"ComponentStatus status",
"repeated UnitMeasurementsForComponent last_measurement",
"repeated Permission permissions"
]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/components/:component/history",
description: "get the history of changes to a devices component",
urlOptions: [
"limit - the number of records to retrieve",
"offset - the number of records to pass over before starting retrieval"
],
urlParams: [":device - the device id", ":components - the key of the component"],
responseParams: ["repeated ComponentHistory history", "uint32 nextOffset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/components",
// description: "add a new component to a device",
// urlParams: [
// ":device - the device id"
// ],
// requestBody: "ComponentSettings"
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/multiComponents",
// description: "add multiple components to a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/components/:component/preferences",
// description: "update a components preferences",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/components/:component/update",
// description: "update the settings of a component",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/devices/:device/components/:component",
// description: "removes an existing component",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const interactions: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/interactions",
description: "list the interactions for a device",
urlParams: [":device - the device id"],
responseParams: ["repeated Interaction interactions"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/components/:component/interactions",
description: "list the interactions for a specified component on a device",
urlParams: [":device - the id of the device", ":component - the key of the component"],
responseParams: ["repeated Interaction interactions"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/interactions",
// description: "add a new interaction to a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/devices/:device/interactions/multi",
// description: "add multiple interactions to a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/interactions",
// description: "update an existing interaction on a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/devices/:device/interactions/:interaction/interactionPondSettings",
// description: `update the settings of an interaction in the pond without touching the interaction on the device,
// use this only for pond specific settings that the device does not need`,
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/devices/:device/interactions/:interaction",
// description: "remove an existing interaction from a device",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const measurements: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/devices/:device/components/:component/unitMeasurements",
description: "list the unit measurements for a component",
urlOptions: [
"limit - the maximum number of measurements to get",
"offset - the number of records to skip over before starting retrieval",
"order - what to order the measurements by",
"type - enum value of measurement type to include if you only want a specific type ie. only get temperature and not humidity for a grain cable you would include type=1",
"start - RFC3339 formatted timestamp for the start of the window",
"end - RFC3339 formatted timestamp for the end of the window"
],
urlParams: [":device - the id of the device", ":component - the key of the component"],
responseParams: [
"repeated UnitMeasurementsForComponent measurements",
"uint32 next_offset",
"uint32 total"
]
},
{
requestType: "GET",
url:
"https://api.brandxtech.ca/v1/devices/:device/components/:component/measurements/sampleUnit",
description: "get a list of sample unit measurements",
urlOptions: [
"start - RFC3339 formatted timestamp for the start of the window",
"end - RFC3339 formatted timestamp for the end of the window",
"size - the number of records to get for the sample"
],
urlParams: [":device - the id of the device", ":component - the key of the component"],
responseParams: ["repeated UnitMeasurementsForComponent measurements"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/objects/:object/:type/unitMeasurements",
description:
"gets the measurements on object can estimate of itself using components that are attached to it",
urlOptions: [
"limit - the maximum number of measurements to get",
"offset - the number of records to skip over before starting retrieval",
"order - what to order the measurements by",
"start - RFC3339 formatted timestamp for the start of the window",
"end - RFC3339 formatted timestamp for the end of the window"
],
urlParams: [":object - the key of the object", ":type - enum value of the type of the object"]
}
];
const groups: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/groups",
description: "lis device groups",
urlOptions: genericListOptions,
responseParams: ["repeated Group groups", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/groups/:group",
description: "get a specific device group",
urlParams: [":group - the id of the group"],
responseParams: ["GroupSettings settings", "GroupStatus status"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/groups/:group/devices",
description: "list the devices from a specific group",
urlOptions: [
"limit - the number of records to load from the group",
"offset - the number of records to pass before starting retrieval",
"order - a key in the device settings to order them by",
"search - a string to search the data for and only return matching devices",
"comprehensive - boolean value on whether to load the device with their components as well"
],
urlParams: [":group - the id of the group"],
responseParams: [
"repeated Device devices",
"uint32 next_offset",
"uint32 total",
"repeated ComprehensiveDevice comprehensive_devices",
"repeated HologramDevice hologram_devices"
]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/groups",
// description: "add a new group",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/groups/:group/devices/:device/add",
// description: "add a device to an existing group",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/groups/:group/devices/:device/remove",
// description: "remove a device from an existing group",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/groups/:group",
// description: "update an existing group",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/groups/:group",
// description: "removes an exisitng group",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
const transactions: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/transactions",
description: "list all transactions between two dates",
urlOptions: ["start - RFC3339 formatted timestamp", "end - RFC3339 formatted timestamp"],
responseParams: ["repeated Transaction transactions", "uint32 next_offset", "uint32 total"]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/transactions",
// description: "create a new transaction",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/transactions/:transaction/revoke",
// description: "revoke an existing transaction",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/transactions/:transaction/update",
// description: "update an existing transaction",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
return (
<Box>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing API keys
</Typography>
<List>
{apiKeys.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing notifications
</Typography>
<List>
{notifications.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing notes
</Typography>
<List>
{notes.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing map markers
</Typography>
<List>
{mapMarkers.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing tasks
</Typography>
<List>
{tasks.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing devices
</Typography>
<List>
{devices.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing components
</Typography>
<List>
{components.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing interactions
</Typography>
<List>
{interactions.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing measurements
</Typography>
<List>
{measurements.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing groups
</Typography>
<List>
{groups.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for managing transactions
</Typography>
<List>
{transactions.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
</Box>
);
}

View file

@ -0,0 +1,121 @@
import { Box, List, ListItem, Typography } from "@mui/material";
import EndpointDisplay, { EndPointData } from "apiDocs/endpoints/endpointDisplay";
import React from "react";
/**
* endpoint template
{
requestType: "",
url: "https://api.brandxtech.ca/v1/",
description: "",
urlOptions: [],
urlParams: [],
requestBody: "",
responseParams: []
},
*/
export default function MiningEndpoints() {
const mineEndpoints: EndPointData[] = [
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/mines",
description: "get a list of mines",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated Mine mines", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/mineSimple",
description: "get a list of just the key and name of your mines",
urlOptions: [
"limit - the number to load",
"offset - how many to skip over before starting to load",
"order - the sort order",
"by - what to sort by in the data",
"search - a string to search for a match in the data"
],
responseParams: ["repeated MineSimple mines", "uint32 next_offset", "uint32 total"]
},
{
requestType: "GET",
url: "https://api.brandxtech.ca/v1/mines/:mine",
description: "get a specified mine",
urlParams: [":mine - the key of the mine"],
responseParams: [
"Mine mine",
"repeated Device devices",
"repeated Component components",
"repeated Permission permissions",
"map<string, MineComponentPreferences> component_preferences",
"map<string, uint64> component_devices"
]
}
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/mines",
// description: "add a new mine",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/mines/:mine/addDevice/:device",
// description: "attach a device to a mine",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "POST",
// url: "https://api.brandxtech.ca/v1/mines/:mine/addComponent/:device/:component",
// description: "attach a component to a mine",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "PUT",
// url: "https://api.brandxtech.ca/v1/mines",
// description: "update a mine",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
// {
// requestType: "DEL",
// url: "https://api.brandxtech.ca/v1/mines/:mine",
// description: "remove an existing mine",
// urlOptions: [],
// urlParams: [],
// requestBody: "",
// responseParams: []
// },
];
return (
<Box>
<Typography variant="h5" style={{ fontWeight: 650 }}>
Endpoints for retrieving mine data
</Typography>
<List>
{mineEndpoints.map((e, i) => (
<ListItem key={i} style={{ marginBottom: 10 }}>
<EndpointDisplay endpoint={e} />
</ListItem>
))}
</List>
</Box>
);
}