Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,29 @@
|
||||
export function getApiKeyCrudPermissions(c: boolean, r: boolean, u: boolean, d: boolean) {
|
||||
let permissions = "";
|
||||
if (c) {
|
||||
permissions += "C";
|
||||
}
|
||||
if (r) {
|
||||
permissions += "R";
|
||||
}
|
||||
if (u) {
|
||||
permissions += "U";
|
||||
}
|
||||
if (d) {
|
||||
permissions += "D";
|
||||
}
|
||||
return permissions;
|
||||
}
|
||||
|
||||
export function checkApiKeyCallIsCreditable(statusCode: number | null) {
|
||||
if (!statusCode) {
|
||||
return false;
|
||||
}
|
||||
if (apiKeyCreditableStatusCodes.includes(statusCode)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export const apiKeyCreditableStatusCodes = [200, 201, 202, 203, 204, 205, 206, 207, 208, 226];
|
||||
export const apiKeyIgnoreEndpoints = ["/v1/usage"];
|
||||
Reference in new issue
Block a user