Skip to content

Commit

Permalink
added the ability for governane orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
chitalian committed Jan 9, 2025
1 parent 1e1e26e commit f223517
Show file tree
Hide file tree
Showing 23 changed files with 2,617 additions and 52 deletions.
231 changes: 231 additions & 0 deletions bifrost/lib/clients/jawnTypes/private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ export interface paths {
"/v1/log/request": {
post: operations["GetRequests"];
};
"/v1/gov-organization/limits/member/{memberId}": {
get: operations["GetMemberLimits"];
post: operations["SetMemberLimits"];
};
"/v1/gov-organization/my-limits": {
get: operations["GetMyLimits"];
};
"/v1/gov-organization/is-governance-org": {
get: operations["IsGovernanceOrg"];
};
"/v1/key/generateHash": {
post: operations["GenerateHash"];
};
Expand All @@ -264,6 +274,13 @@ export interface paths {
"/v1/alert/{alertId}": {
delete: operations["DeleteAlert"];
};
"/v1/admin/governance-orgs/{orgId}": {
post: operations["GovernanceOrgs"];
delete: operations["DeleteGovernanceOrg"];
};
"/v1/admin/governance-orgs": {
get: operations["GetGovernanceOrgs"];
};
"/v1/admin/feature-flags": {
post: operations["UpdateFeatureFlags"];
delete: operations["DeleteFeatureFlag"];
Expand Down Expand Up @@ -1137,6 +1154,7 @@ Json: JsonObject;
id?: string;
icon?: string;
has_onboarded?: boolean;
governance_settings?: components["schemas"]["Json"] | null;
domain?: string | null;
created_at?: string | null;
color?: string;
Expand Down Expand Up @@ -1303,6 +1321,69 @@ Json: JsonObject;
heliconeMeta: components["schemas"]["HeliconeMeta"];
authorization: string;
};
ResultSuccess_unknown_: {
data: unknown;
/** @enum {number|null} */
error: null;
};
ResultError_unknown_: {
/** @enum {number|null} */
data: null;
error: unknown;
};
"PostgrestResponseSuccess__created_at-string--governance_limits-Json--member-string--org_role-string--organization-string__": {
/** Format: double */
status: number;
statusText: string;
/** @enum {number|null} */
error: null;
data: {
organization: string;
org_role: string;
member: string;
governance_limits: components["schemas"]["Json"];
created_at: string;
};
/** Format: double */
count: number | null;
};
/**
* @description Error format
*
* {@link https://postgrest.org/en/stable/api.html?highlight=options#errors-and-http-status-codes}
*/
PostgrestError: {
name: string;
message: string;
stack?: string;
details: string;
hint: string;
code: string;
};
PostgrestResponseFailure: {
/** Format: double */
status: number;
statusText: string;
error: components["schemas"]["PostgrestError"];
/** @enum {number|null} */
data: null;
/** @enum {number|null} */
count: null;
};
"PostgrestSingleResponse__created_at-string--governance_limits-Json--member-string--org_role-string--organization-string__": components["schemas"]["PostgrestResponseSuccess__created_at-string--governance_limits-Json--member-string--org_role-string--organization-string__"] | components["schemas"]["PostgrestResponseFailure"];
"PostgrestResponseSuccess__governance_settings-Json__": {
/** Format: double */
status: number;
statusText: string;
/** @enum {number|null} */
error: null;
data: {
governance_settings: components["schemas"]["Json"];
};
/** Format: double */
count: number | null;
};
"PostgrestSingleResponse__governance_settings-Json__": components["schemas"]["PostgrestResponseSuccess__governance_settings-Json__"] | components["schemas"]["PostgrestResponseFailure"];
/** @enum {string} */
KeyPermissions: "w" | "rw";
GenerateHashQueryParams: {
Expand Down Expand Up @@ -1866,6 +1947,46 @@ Json: JsonObject;
/** Format: double */
minimum_request_count?: number;
};
"PostgrestResponseSuccess__color-string--created_at-string--domain-string--governance_settings-Json--has_onboarded-boolean--icon-string--id-string--is_personal-boolean--limits-Json--logo_path-string--name-string--org_provider_key-string--organization_type-string--owner-string--percent_to_log-number--referral-string--request_limit-number--reseller_id-string--size-string--soft_delete-boolean--stripe_customer_id-string--stripe_metadata-Json--stripe_subscription_id-string--stripe_subscription_item_id-string--subscription_status-string--tier-string_-Array_": {
/** Format: double */
status: number;
statusText: string;
/** @enum {number|null} */
error: null;
data: {
tier: string;
subscription_status: string;
stripe_subscription_item_id: string;
stripe_subscription_id: string;
stripe_metadata: components["schemas"]["Json"];
stripe_customer_id: string;
soft_delete: boolean;
size: string;
reseller_id: string;
/** Format: double */
request_limit: number;
referral: string;
/** Format: double */
percent_to_log: number;
owner: string;
organization_type: string;
org_provider_key: string;
name: string;
logo_path: string;
limits: components["schemas"]["Json"];
is_personal: boolean;
id: string;
icon: string;
has_onboarded: boolean;
governance_settings: components["schemas"]["Json"];
domain: string;
created_at: string;
color: string;
}[];
/** Format: double */
count: number | null;
};
"PostgrestSingleResponse__color-string--created_at-string--domain-string--governance_settings-Json--has_onboarded-boolean--icon-string--id-string--is_personal-boolean--limits-Json--logo_path-string--name-string--org_provider_key-string--organization_type-string--owner-string--percent_to_log-number--referral-string--request_limit-number--reseller_id-string--size-string--soft_delete-boolean--stripe_customer_id-string--stripe_metadata-Json--stripe_subscription_id-string--stripe_subscription_item_id-string--subscription_status-string--tier-string_-Array_": components["schemas"]["PostgrestResponseSuccess__color-string--created_at-string--domain-string--governance_settings-Json--has_onboarded-boolean--icon-string--id-string--is_personal-boolean--limits-Json--logo_path-string--name-string--org_provider_key-string--organization_type-string--owner-string--percent_to_log-number--referral-string--request_limit-number--reseller_id-string--size-string--soft_delete-boolean--stripe_customer_id-string--stripe_metadata-Json--stripe_subscription_id-string--stripe_subscription_item_id-string--subscription_status-string--tier-string_-Array_"] | components["schemas"]["PostgrestResponseFailure"];
"ResultSuccess__organization_id-string--name-string--flags-string-Array_-Array_": {
data: {
flags: string[];
Expand Down Expand Up @@ -3306,6 +3427,66 @@ export interface operations {
};
};
};
GetMemberLimits: {
parameters: {
path: {
memberId: string;
};
};
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["PostgrestSingleResponse__created_at-string--governance_limits-Json--member-string--org_role-string--organization-string__"];
};
};
};
};
SetMemberLimits: {
parameters: {
path: {
memberId: string;
};
};
requestBody: {
content: {
"application/json": {
/** Format: double */
days: number;
/** Format: double */
limitUSD: number;
};
};
};
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["ResultSuccess_unknown_"] | components["schemas"]["ResultError_unknown_"];
};
};
};
};
GetMyLimits: {
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["PostgrestSingleResponse__created_at-string--governance_limits-Json--member-string--org_role-string--organization-string__"];
};
};
};
};
IsGovernanceOrg: {
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["PostgrestSingleResponse__governance_settings-Json__"];
};
};
};
};
GenerateHash: {
requestBody: {
content: {
Expand Down Expand Up @@ -3457,6 +3638,56 @@ export interface operations {
};
};
};
GovernanceOrgs: {
parameters: {
path: {
orgId: string;
};
};
requestBody: {
content: {
"application/json": {
/** Format: double */
days: number | null;
/** Format: double */
limitUSD: number | null;
};
};
};
responses: {
/** @description Ok */
200: {
content: {
"application/json": null;
};
};
};
};
DeleteGovernanceOrg: {
parameters: {
path: {
orgId: string;
};
};
responses: {
/** @description Ok */
200: {
content: {
"application/json": null;
};
};
};
};
GetGovernanceOrgs: {
responses: {
/** @description Ok */
200: {
content: {
"application/json": components["schemas"]["PostgrestSingleResponse__color-string--created_at-string--domain-string--governance_settings-Json--has_onboarded-boolean--icon-string--id-string--is_personal-boolean--limits-Json--logo_path-string--name-string--org_provider_key-string--organization_type-string--owner-string--percent_to_log-number--referral-string--request_limit-number--reseller_id-string--size-string--soft_delete-boolean--stripe_customer_id-string--stripe_metadata-Json--stripe_subscription_id-string--stripe_subscription_item_id-string--subscription_status-string--tier-string_-Array_"];
};
};
};
};
UpdateFeatureFlags: {
requestBody: {
content: {
Expand Down
6 changes: 6 additions & 0 deletions helicone-cron/src/db/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,7 @@ export type Database = {
color: string
created_at: string | null
domain: string | null
governance_settings: Json | null
has_onboarded: boolean
icon: string
id: string
Expand Down Expand Up @@ -1627,6 +1628,7 @@ export type Database = {
color?: string
created_at?: string | null
domain?: string | null
governance_settings?: Json | null
has_onboarded?: boolean
icon?: string
id?: string
Expand Down Expand Up @@ -1654,6 +1656,7 @@ export type Database = {
color?: string
created_at?: string | null
domain?: string | null
governance_settings?: Json | null
has_onboarded?: boolean
icon?: string
id?: string
Expand Down Expand Up @@ -1750,18 +1753,21 @@ export type Database = {
organization_member: {
Row: {
created_at: string | null
governance_limits: Json | null
member: string
org_role: string
organization: string
}
Insert: {
created_at?: string | null
governance_limits?: Json | null
member: string
org_role?: string
organization: string
}
Update: {
created_at?: string | null
governance_limits?: Json | null
member?: string
org_role?: string
organization?: string
Expand Down
Loading

0 comments on commit f223517

Please sign in to comment.