fix(codex): accept Codex 0.150 account plans (#8447)
This commit is contained in:
1 parent
e2d4d12a81
commit
94401d01b9
4 files changed
+102
No files matched your search
@@ -86,13 +86,18 @@ function codexAccountAuthLabel(account: CodexSchema.V2GetAccountResponse["accoun
|
||||
return "ChatGPT Pro 5x Subscription";
|
||||
case "team":
|
||||
return "ChatGPT Team Subscription";
|
||||
case "self_serve_business_prolite":
|
||||
case "self_serve_business_usage_based":
|
||||
case "business":
|
||||
return "ChatGPT Business Subscription";
|
||||
case "ent26":
|
||||
case "enterprise_cbp_automation":
|
||||
case "enterprise_cbp_usage_based":
|
||||
case "enterprise":
|
||||
return "ChatGPT Enterprise Subscription";
|
||||
case "edu":
|
||||
case "edu_plus":
|
||||
case "edu_pro":
|
||||
return "ChatGPT Edu Subscription";
|
||||
case "unknown":
|
||||
return "ChatGPT Subscription";
|
||||
|
||||
@@ -166,6 +166,28 @@ const Codex0150DefinitionSchemas: Record<string, Schema.Json> = {
|
||||
type: "string",
|
||||
enum: ["inProgress", "completed", "failed", "interrupted"],
|
||||
},
|
||||
PlanType: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"free",
|
||||
"go",
|
||||
"plus",
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
],
|
||||
},
|
||||
SubAgentActivityKind: {
|
||||
type: "string",
|
||||
enum: ["started", "interacted", "interrupted", "completed"],
|
||||
|
||||
@@ -2411,11 +2411,16 @@ export type ServerNotification__PlanType =
|
||||
| "pro"
|
||||
| "prolite"
|
||||
| "team"
|
||||
| "self_serve_business_prolite"
|
||||
| "self_serve_business_usage_based"
|
||||
| "business"
|
||||
| "ent26"
|
||||
| "enterprise_cbp_automation"
|
||||
| "enterprise_cbp_usage_based"
|
||||
| "enterprise"
|
||||
| "edu"
|
||||
| "edu_plus"
|
||||
| "edu_pro"
|
||||
| "unknown";
|
||||
export const ServerNotification__PlanType = Schema.Literals([
|
||||
"free",
|
||||
@@ -2424,11 +2429,16 @@ export const ServerNotification__PlanType = Schema.Literals([
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
]);
|
||||
|
||||
@@ -3248,11 +3258,16 @@ export type V2AccountRateLimitsUpdatedNotification__PlanType =
|
||||
| "pro"
|
||||
| "prolite"
|
||||
| "team"
|
||||
| "self_serve_business_prolite"
|
||||
| "self_serve_business_usage_based"
|
||||
| "business"
|
||||
| "ent26"
|
||||
| "enterprise_cbp_automation"
|
||||
| "enterprise_cbp_usage_based"
|
||||
| "enterprise"
|
||||
| "edu"
|
||||
| "edu_plus"
|
||||
| "edu_pro"
|
||||
| "unknown";
|
||||
export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals([
|
||||
"free",
|
||||
@@ -3261,11 +3276,16 @@ export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals(
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
]);
|
||||
|
||||
@@ -3336,11 +3356,16 @@ export type V2AccountUpdatedNotification__PlanType =
|
||||
| "pro"
|
||||
| "prolite"
|
||||
| "team"
|
||||
| "self_serve_business_prolite"
|
||||
| "self_serve_business_usage_based"
|
||||
| "business"
|
||||
| "ent26"
|
||||
| "enterprise_cbp_automation"
|
||||
| "enterprise_cbp_usage_based"
|
||||
| "enterprise"
|
||||
| "edu"
|
||||
| "edu_plus"
|
||||
| "edu_pro"
|
||||
| "unknown";
|
||||
export const V2AccountUpdatedNotification__PlanType = Schema.Literals([
|
||||
"free",
|
||||
@@ -3349,11 +3374,16 @@ export const V2AccountUpdatedNotification__PlanType = Schema.Literals([
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
]);
|
||||
|
||||
@@ -4140,11 +4170,16 @@ export type V2GetAccountRateLimitsResponse__PlanType =
|
||||
| "pro"
|
||||
| "prolite"
|
||||
| "team"
|
||||
| "self_serve_business_prolite"
|
||||
| "self_serve_business_usage_based"
|
||||
| "business"
|
||||
| "ent26"
|
||||
| "enterprise_cbp_automation"
|
||||
| "enterprise_cbp_usage_based"
|
||||
| "enterprise"
|
||||
| "edu"
|
||||
| "edu_plus"
|
||||
| "edu_pro"
|
||||
| "unknown";
|
||||
export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([
|
||||
"free",
|
||||
@@ -4153,11 +4188,16 @@ export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
]);
|
||||
|
||||
@@ -4228,11 +4268,16 @@ export type V2GetAccountResponse__PlanType =
|
||||
| "pro"
|
||||
| "prolite"
|
||||
| "team"
|
||||
| "self_serve_business_prolite"
|
||||
| "self_serve_business_usage_based"
|
||||
| "business"
|
||||
| "ent26"
|
||||
| "enterprise_cbp_automation"
|
||||
| "enterprise_cbp_usage_based"
|
||||
| "enterprise"
|
||||
| "edu"
|
||||
| "edu_plus"
|
||||
| "edu_pro"
|
||||
| "unknown";
|
||||
export const V2GetAccountResponse__PlanType = Schema.Literals([
|
||||
"free",
|
||||
@@ -4241,11 +4286,16 @@ export const V2GetAccountResponse__PlanType = Schema.Literals([
|
||||
"pro",
|
||||
"prolite",
|
||||
"team",
|
||||
"self_serve_business_prolite",
|
||||
"self_serve_business_usage_based",
|
||||
"business",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"enterprise_cbp_usage_based",
|
||||
"enterprise",
|
||||
"edu",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
"unknown",
|
||||
]);
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import * as Schema from "effect/Schema";
|
||||
|
||||
import * as CodexSchema from "./schema.ts";
|
||||
|
||||
const isGetAccountResponse = Schema.is(CodexSchema.V2GetAccountResponse);
|
||||
|
||||
it("accepts Codex 0.150 multi-agent values", () => {
|
||||
const schemas = [
|
||||
CodexSchema.ServerNotification__SubAgentActivityKind,
|
||||
@@ -71,3 +73,26 @@ it("accepts Codex 0.150 multi-agent values", () => {
|
||||
|
||||
assert.equal(Schema.is(CodexSchema.V2ThreadResumeResponse)(resumeResponse), true);
|
||||
});
|
||||
|
||||
it("accepts Codex 0.150 account plan values", () => {
|
||||
const planTypes = [
|
||||
"self_serve_business_prolite",
|
||||
"ent26",
|
||||
"enterprise_cbp_automation",
|
||||
"edu_plus",
|
||||
"edu_pro",
|
||||
];
|
||||
|
||||
for (const planType of planTypes) {
|
||||
const accountResponse = {
|
||||
account: {
|
||||
email: "[email protected]",
|
||||
planType,
|
||||
type: "chatgpt",
|
||||
},
|
||||
requiresOpenaiAuth: true,
|
||||
};
|
||||
|
||||
assert.equal(isGetAccountResponse(accountResponse), true);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user