mirror of
https://github.com/openai/codex.git
synced 2026-12-01 00:20:48 +00:00
Checkpoint before e2e test
This commit is contained in:
@@ -204,6 +204,44 @@
|
||||
"CodexAvatarAdminCapabilitiesReadParams": {
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarAdminProofDropGrantParams": {
|
||||
"properties": {
|
||||
"accountUserId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"awardId",
|
||||
"sourceType"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarEquipParams": {
|
||||
"properties": {
|
||||
"avatarId": {
|
||||
@@ -4681,6 +4719,30 @@
|
||||
"title": "Avatar/admin/awardRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"avatar/admin/proof-drop"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/CodexAvatarAdminProofDropGrantParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
@@ -1391,6 +1391,30 @@
|
||||
"title": "Avatar/admin/awardRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"avatar/admin/proof-drop"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarAdminProofDropGrantParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -5769,25 +5793,131 @@
|
||||
"properties": {
|
||||
"canGrantAwards": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"canGrantProofDropBoxes": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"canGrantAwards"
|
||||
"canGrantAwards",
|
||||
"canGrantProofDropBoxes"
|
||||
],
|
||||
"title": "CodexAvatarAdminCapabilitiesReadResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarAdminProofDropGrantParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"accountUserId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"awardId",
|
||||
"sourceType"
|
||||
],
|
||||
"title": "CodexAvatarAdminProofDropGrantParams",
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarBoxOddsBucket": {
|
||||
"properties": {
|
||||
"bucketId": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"probabilityPercent": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"bucketId",
|
||||
"label",
|
||||
"probabilityPercent"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarBoxRules": {
|
||||
"properties": {
|
||||
"guaranteedNewThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"legendaryPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"odds": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarBoxOddsBucket"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"oddsTableVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"rareOrBetterPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rulesetVersion": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewThreshold",
|
||||
"legendaryPityThreshold",
|
||||
"odds",
|
||||
"oddsTableVersion",
|
||||
"rareOrBetterPityThreshold",
|
||||
"rulesetVersion"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarDefinition": {
|
||||
"properties": {
|
||||
"accentClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"assetRef": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"collectionDescription": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
@@ -5795,10 +5925,16 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"isProgressVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lore": {
|
||||
"type": "string"
|
||||
},
|
||||
"rarity": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarRarity"
|
||||
},
|
||||
"slug": {
|
||||
"silhouetteGlowClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"sortOrder": {
|
||||
@@ -5807,23 +5943,22 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarStatus"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accentClassName",
|
||||
"assetRef",
|
||||
"avatarId",
|
||||
"createdAt",
|
||||
"collectionDescription",
|
||||
"collectionName",
|
||||
"description",
|
||||
"displayName",
|
||||
"isProgressVisible",
|
||||
"lore",
|
||||
"rarity",
|
||||
"slug",
|
||||
"silhouetteGlowClassName",
|
||||
"sortOrder",
|
||||
"status",
|
||||
"updatedAt"
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -5857,16 +5992,8 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"catalogVersion": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"equippedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"boxRules": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarBoxRules"
|
||||
},
|
||||
"equippedAvatarId": {
|
||||
"type": "string"
|
||||
@@ -5877,9 +6004,14 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"syncedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"pendingRevealAwards": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarRevealAward"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"pityState": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarPityState"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
@@ -5889,10 +6021,11 @@
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarDefinitions",
|
||||
"equippedAt",
|
||||
"boxRules",
|
||||
"equippedAvatarId",
|
||||
"ownedAvatars",
|
||||
"syncedAt",
|
||||
"pendingRevealAwards",
|
||||
"pityState",
|
||||
"updatedAt"
|
||||
],
|
||||
"title": "CodexAvatarInventoryReadResponse",
|
||||
@@ -5906,14 +6039,6 @@
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"firstUnlockedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"lastAwardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -5923,9 +6048,33 @@
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarId",
|
||||
"firstUnlockedAt",
|
||||
"lastAwardedAt"
|
||||
"avatarId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarPityState": {
|
||||
"properties": {
|
||||
"guaranteedNewAvailable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"nonNewOutcomeStreak": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceLegendary": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceRareOrBetter": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewAvailable",
|
||||
"nonNewOutcomeStreak",
|
||||
"rollsSinceLegendary",
|
||||
"rollsSinceRareOrBetter"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -5938,6 +6087,58 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"CodexAvatarRevealAward": {
|
||||
"properties": {
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"metadataJson": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeAvatarId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"pityStateAfter": {
|
||||
"$ref": "#/definitions/v2/CodexAvatarPityState"
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"awardId",
|
||||
"awardedAt",
|
||||
"outcomeKind",
|
||||
"pityStateAfter",
|
||||
"sourceType"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
|
||||
+240
-39
@@ -1966,6 +1966,30 @@
|
||||
"title": "Avatar/admin/awardRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"avatar/admin/proof-drop"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/CodexAvatarAdminProofDropGrantParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Avatar/admin/proofDropRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -2374,25 +2398,131 @@
|
||||
"properties": {
|
||||
"canGrantAwards": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"canGrantProofDropBoxes": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"canGrantAwards"
|
||||
"canGrantAwards",
|
||||
"canGrantProofDropBoxes"
|
||||
],
|
||||
"title": "CodexAvatarAdminCapabilitiesReadResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarAdminProofDropGrantParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"accountUserId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"awardId",
|
||||
"sourceType"
|
||||
],
|
||||
"title": "CodexAvatarAdminProofDropGrantParams",
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarBoxOddsBucket": {
|
||||
"properties": {
|
||||
"bucketId": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"probabilityPercent": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"bucketId",
|
||||
"label",
|
||||
"probabilityPercent"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarBoxRules": {
|
||||
"properties": {
|
||||
"guaranteedNewThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"legendaryPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"odds": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/CodexAvatarBoxOddsBucket"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"oddsTableVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"rareOrBetterPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rulesetVersion": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewThreshold",
|
||||
"legendaryPityThreshold",
|
||||
"odds",
|
||||
"oddsTableVersion",
|
||||
"rareOrBetterPityThreshold",
|
||||
"rulesetVersion"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarDefinition": {
|
||||
"properties": {
|
||||
"accentClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"assetRef": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"collectionDescription": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
@@ -2400,10 +2530,16 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"isProgressVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lore": {
|
||||
"type": "string"
|
||||
},
|
||||
"rarity": {
|
||||
"$ref": "#/definitions/CodexAvatarRarity"
|
||||
},
|
||||
"slug": {
|
||||
"silhouetteGlowClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"sortOrder": {
|
||||
@@ -2412,23 +2548,22 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/CodexAvatarStatus"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accentClassName",
|
||||
"assetRef",
|
||||
"avatarId",
|
||||
"createdAt",
|
||||
"collectionDescription",
|
||||
"collectionName",
|
||||
"description",
|
||||
"displayName",
|
||||
"isProgressVisible",
|
||||
"lore",
|
||||
"rarity",
|
||||
"slug",
|
||||
"silhouetteGlowClassName",
|
||||
"sortOrder",
|
||||
"status",
|
||||
"updatedAt"
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -2462,16 +2597,8 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"catalogVersion": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"equippedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"boxRules": {
|
||||
"$ref": "#/definitions/CodexAvatarBoxRules"
|
||||
},
|
||||
"equippedAvatarId": {
|
||||
"type": "string"
|
||||
@@ -2482,9 +2609,14 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"syncedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"pendingRevealAwards": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/CodexAvatarRevealAward"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"pityState": {
|
||||
"$ref": "#/definitions/CodexAvatarPityState"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
@@ -2494,10 +2626,11 @@
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarDefinitions",
|
||||
"equippedAt",
|
||||
"boxRules",
|
||||
"equippedAvatarId",
|
||||
"ownedAvatars",
|
||||
"syncedAt",
|
||||
"pendingRevealAwards",
|
||||
"pityState",
|
||||
"updatedAt"
|
||||
],
|
||||
"title": "CodexAvatarInventoryReadResponse",
|
||||
@@ -2511,14 +2644,6 @@
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"firstUnlockedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"lastAwardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -2528,9 +2653,33 @@
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarId",
|
||||
"firstUnlockedAt",
|
||||
"lastAwardedAt"
|
||||
"avatarId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarPityState": {
|
||||
"properties": {
|
||||
"guaranteedNewAvailable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"nonNewOutcomeStreak": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceLegendary": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceRareOrBetter": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewAvailable",
|
||||
"nonNewOutcomeStreak",
|
||||
"rollsSinceLegendary",
|
||||
"rollsSinceRareOrBetter"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -2543,6 +2692,58 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"CodexAvatarRevealAward": {
|
||||
"properties": {
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"metadataJson": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeAvatarId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"pityStateAfter": {
|
||||
"$ref": "#/definitions/CodexAvatarPityState"
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"awardId",
|
||||
"awardedAt",
|
||||
"outcomeKind",
|
||||
"pityStateAfter",
|
||||
"sourceType"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
|
||||
+5
-1
@@ -3,10 +3,14 @@
|
||||
"properties": {
|
||||
"canGrantAwards": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"canGrantProofDropBoxes": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"canGrantAwards"
|
||||
"canGrantAwards",
|
||||
"canGrantProofDropBoxes"
|
||||
],
|
||||
"title": "CodexAvatarAdminCapabilitiesReadResponse",
|
||||
"type": "object"
|
||||
|
||||
+171
-38
@@ -1,17 +1,79 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"CodexAvatarBoxOddsBucket": {
|
||||
"properties": {
|
||||
"bucketId": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"probabilityPercent": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"bucketId",
|
||||
"label",
|
||||
"probabilityPercent"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarBoxRules": {
|
||||
"properties": {
|
||||
"guaranteedNewThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"legendaryPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"odds": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/CodexAvatarBoxOddsBucket"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"oddsTableVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"rareOrBetterPityThreshold": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rulesetVersion": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewThreshold",
|
||||
"legendaryPityThreshold",
|
||||
"odds",
|
||||
"oddsTableVersion",
|
||||
"rareOrBetterPityThreshold",
|
||||
"rulesetVersion"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarDefinition": {
|
||||
"properties": {
|
||||
"accentClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"assetRef": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"collectionDescription": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionName": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
@@ -19,10 +81,16 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"isProgressVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lore": {
|
||||
"type": "string"
|
||||
},
|
||||
"rarity": {
|
||||
"$ref": "#/definitions/CodexAvatarRarity"
|
||||
},
|
||||
"slug": {
|
||||
"silhouetteGlowClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"sortOrder": {
|
||||
@@ -31,23 +99,22 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/CodexAvatarStatus"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accentClassName",
|
||||
"assetRef",
|
||||
"avatarId",
|
||||
"createdAt",
|
||||
"collectionDescription",
|
||||
"collectionName",
|
||||
"description",
|
||||
"displayName",
|
||||
"isProgressVisible",
|
||||
"lore",
|
||||
"rarity",
|
||||
"slug",
|
||||
"silhouetteGlowClassName",
|
||||
"sortOrder",
|
||||
"status",
|
||||
"updatedAt"
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -59,14 +126,6 @@
|
||||
"avatarId": {
|
||||
"type": "string"
|
||||
},
|
||||
"firstUnlockedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"lastAwardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -76,9 +135,33 @@
|
||||
},
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarId",
|
||||
"firstUnlockedAt",
|
||||
"lastAwardedAt"
|
||||
"avatarId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarPityState": {
|
||||
"properties": {
|
||||
"guaranteedNewAvailable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"nonNewOutcomeStreak": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceLegendary": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"rollsSinceRareOrBetter": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"guaranteedNewAvailable",
|
||||
"nonNewOutcomeStreak",
|
||||
"rollsSinceLegendary",
|
||||
"rollsSinceRareOrBetter"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
@@ -91,6 +174,58 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"CodexAvatarRevealAward": {
|
||||
"properties": {
|
||||
"awardId": {
|
||||
"type": "string"
|
||||
},
|
||||
"awardedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"metadataJson": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeAvatarId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"outcomeKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"pityStateAfter": {
|
||||
"$ref": "#/definitions/CodexAvatarPityState"
|
||||
},
|
||||
"sourceRef": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceSummary": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"awardId",
|
||||
"awardedAt",
|
||||
"outcomeKind",
|
||||
"pityStateAfter",
|
||||
"sourceType"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CodexAvatarStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
@@ -110,16 +245,8 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"catalogVersion": {
|
||||
"format": "int64",
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"equippedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"boxRules": {
|
||||
"$ref": "#/definitions/CodexAvatarBoxRules"
|
||||
},
|
||||
"equippedAvatarId": {
|
||||
"type": "string"
|
||||
@@ -130,9 +257,14 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"syncedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
"pendingRevealAwards": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/CodexAvatarRevealAward"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"pityState": {
|
||||
"$ref": "#/definitions/CodexAvatarPityState"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
@@ -142,10 +274,11 @@
|
||||
"required": [
|
||||
"accountUserId",
|
||||
"avatarDefinitions",
|
||||
"equippedAt",
|
||||
"boxRules",
|
||||
"equippedAvatarId",
|
||||
"ownedAvatars",
|
||||
"syncedAt",
|
||||
"pendingRevealAwards",
|
||||
"pityState",
|
||||
"updatedAt"
|
||||
],
|
||||
"title": "CodexAvatarInventoryReadResponse",
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -2,4 +2,4 @@
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type CodexAvatarAdminCapabilitiesReadResponse = { canGrantAwards: boolean, };
|
||||
export type CodexAvatarAdminCapabilitiesReadResponse = { canGrantAwards: boolean, canGrantProofDropBoxes: boolean, };
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
import type { CodexAvatarRarity } from "./CodexAvatarRarity";
|
||||
import type { CodexAvatarStatus } from "./CodexAvatarStatus";
|
||||
|
||||
export type CodexAvatarDefinition = { avatarId: string, slug: string, displayName: string, description: string, rarity: CodexAvatarRarity, assetRef: string, status: CodexAvatarStatus, sortOrder: bigint, createdAt: bigint, updatedAt: bigint, };
|
||||
export type CodexAvatarDefinition = { avatarId: string, displayName: string, description: string, rarity: CodexAvatarRarity, assetRef: string, status: CodexAvatarStatus, sortOrder: bigint, collectionName: string, collectionDescription: string, lore: string, accentClassName: string, silhouetteGlowClassName: string, isProgressVisible: boolean, };
|
||||
|
||||
+4
-1
@@ -1,7 +1,10 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CodexAvatarBoxRules } from "./CodexAvatarBoxRules";
|
||||
import type { CodexAvatarDefinition } from "./CodexAvatarDefinition";
|
||||
import type { CodexAvatarOwnership } from "./CodexAvatarOwnership";
|
||||
import type { CodexAvatarPityState } from "./CodexAvatarPityState";
|
||||
import type { CodexAvatarRevealAward } from "./CodexAvatarRevealAward";
|
||||
|
||||
export type CodexAvatarInventoryReadResponse = { accountUserId: string, avatarDefinitions: Array<CodexAvatarDefinition>, ownedAvatars: Array<CodexAvatarOwnership>, equippedAvatarId: string, equippedAt: bigint, updatedAt: bigint, syncedAt: bigint, catalogVersion: bigint | null, };
|
||||
export type CodexAvatarInventoryReadResponse = { accountUserId: string, avatarDefinitions: Array<CodexAvatarDefinition>, ownedAvatars: Array<CodexAvatarOwnership>, equippedAvatarId: string, boxRules: CodexAvatarBoxRules, pityState: CodexAvatarPityState, pendingRevealAwards: Array<CodexAvatarRevealAward>, updatedAt: bigint, };
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type CodexAvatarOwnership = { accountUserId: string, avatarId: string, firstUnlockedAt: bigint, lastAwardedAt: bigint, sourceSummary: string | null, };
|
||||
export type CodexAvatarOwnership = { accountUserId: string, avatarId: string, sourceSummary: string | null, };
|
||||
|
||||
@@ -34,13 +34,18 @@ export type { ChatgptAuthTokensRefreshResponse } from "./ChatgptAuthTokensRefres
|
||||
export type { CodexAvatarAdminAwardGrantParams } from "./CodexAvatarAdminAwardGrantParams";
|
||||
export type { CodexAvatarAdminCapabilitiesReadParams } from "./CodexAvatarAdminCapabilitiesReadParams";
|
||||
export type { CodexAvatarAdminCapabilitiesReadResponse } from "./CodexAvatarAdminCapabilitiesReadResponse";
|
||||
export type { CodexAvatarAdminProofDropGrantParams } from "./CodexAvatarAdminProofDropGrantParams";
|
||||
export type { CodexAvatarAward } from "./CodexAvatarAward";
|
||||
export type { CodexAvatarBoxOddsBucket } from "./CodexAvatarBoxOddsBucket";
|
||||
export type { CodexAvatarBoxRules } from "./CodexAvatarBoxRules";
|
||||
export type { CodexAvatarDefinition } from "./CodexAvatarDefinition";
|
||||
export type { CodexAvatarEquipParams } from "./CodexAvatarEquipParams";
|
||||
export type { CodexAvatarInventoryReadParams } from "./CodexAvatarInventoryReadParams";
|
||||
export type { CodexAvatarInventoryReadResponse } from "./CodexAvatarInventoryReadResponse";
|
||||
export type { CodexAvatarOwnership } from "./CodexAvatarOwnership";
|
||||
export type { CodexAvatarPityState } from "./CodexAvatarPityState";
|
||||
export type { CodexAvatarRarity } from "./CodexAvatarRarity";
|
||||
export type { CodexAvatarRevealAward } from "./CodexAvatarRevealAward";
|
||||
export type { CodexAvatarStatus } from "./CodexAvatarStatus";
|
||||
export type { CodexErrorInfo } from "./CodexErrorInfo";
|
||||
export type { CollabAgentState } from "./CollabAgentState";
|
||||
|
||||
@@ -500,6 +500,11 @@ client_request_definitions! {
|
||||
response: v2::CodexAvatarInventoryReadResponse,
|
||||
},
|
||||
|
||||
AvatarAdminProofDrop => "avatar/admin/proof-drop" {
|
||||
params: v2::CodexAvatarAdminProofDropGrantParams,
|
||||
response: v2::CodexAvatarInventoryReadResponse,
|
||||
},
|
||||
|
||||
AvatarAdminCapabilitiesRead => "avatar/admin/capabilities/read" {
|
||||
params: v2::CodexAvatarAdminCapabilitiesReadParams,
|
||||
response: v2::CodexAvatarAdminCapabilitiesReadResponse,
|
||||
@@ -1612,16 +1617,47 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_avatar_admin_proof_drop() -> Result<()> {
|
||||
let request = ClientRequest::AvatarAdminProofDrop {
|
||||
request_id: RequestId::Integer(10),
|
||||
params: v2::CodexAvatarAdminProofDropGrantParams {
|
||||
account_user_id: "target-user-123".to_string(),
|
||||
award_id: "proof-drop-1".to_string(),
|
||||
source_type: "proof-drop-box".to_string(),
|
||||
source_ref: Some("support-ticket-1".to_string()),
|
||||
awarded_at: Some(123),
|
||||
source_summary: Some("Manual proof-drop box".to_string()),
|
||||
},
|
||||
};
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "avatar/admin/proof-drop",
|
||||
"id": 10,
|
||||
"params": {
|
||||
"accountUserId": "target-user-123",
|
||||
"awardId": "proof-drop-1",
|
||||
"sourceType": "proof-drop-box",
|
||||
"sourceRef": "support-ticket-1",
|
||||
"awardedAt": 123,
|
||||
"sourceSummary": "Manual proof-drop box"
|
||||
}
|
||||
}),
|
||||
serde_json::to_value(&request)?,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_avatar_admin_capabilities_read() -> Result<()> {
|
||||
let request = ClientRequest::AvatarAdminCapabilitiesRead {
|
||||
request_id: RequestId::Integer(10),
|
||||
request_id: RequestId::Integer(11),
|
||||
params: v2::CodexAvatarAdminCapabilitiesReadParams::default(),
|
||||
};
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "avatar/admin/capabilities/read",
|
||||
"id": 10,
|
||||
"id": 11,
|
||||
"params": {}
|
||||
}),
|
||||
serde_json::to_value(&request)?,
|
||||
|
||||
@@ -1761,15 +1761,18 @@ pub enum CodexAvatarRarity {
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarDefinition {
|
||||
pub avatar_id: String,
|
||||
pub slug: String,
|
||||
pub display_name: String,
|
||||
pub description: String,
|
||||
pub rarity: CodexAvatarRarity,
|
||||
pub asset_ref: String,
|
||||
pub status: CodexAvatarStatus,
|
||||
pub sort_order: i64,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub collection_name: String,
|
||||
pub collection_description: String,
|
||||
pub lore: String,
|
||||
pub accent_class_name: String,
|
||||
pub silhouette_glow_class_name: String,
|
||||
pub is_progress_visible: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
@@ -1778,8 +1781,6 @@ pub struct CodexAvatarDefinition {
|
||||
pub struct CodexAvatarOwnership {
|
||||
pub account_user_id: String,
|
||||
pub avatar_id: String,
|
||||
pub first_unlocked_at: i64,
|
||||
pub last_awarded_at: i64,
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
@@ -1830,6 +1831,21 @@ pub struct CodexAvatarAdminAwardGrantParams {
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarAdminProofDropGrantParams {
|
||||
pub account_user_id: String,
|
||||
pub award_id: String,
|
||||
pub source_type: String,
|
||||
#[ts(optional = nullable)]
|
||||
pub source_ref: Option<String>,
|
||||
#[ts(optional = nullable)]
|
||||
pub awarded_at: Option<i64>,
|
||||
#[ts(optional = nullable)]
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
@@ -1840,6 +1856,53 @@ pub struct CodexAvatarAdminCapabilitiesReadParams {}
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarAdminCapabilitiesReadResponse {
|
||||
pub can_grant_awards: bool,
|
||||
pub can_grant_proof_drop_boxes: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarBoxOddsBucket {
|
||||
pub bucket_id: String,
|
||||
pub label: String,
|
||||
pub probability_percent: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarPityState {
|
||||
pub rolls_since_rare_or_better: i64,
|
||||
pub rolls_since_legendary: i64,
|
||||
pub non_new_outcome_streak: i64,
|
||||
pub guaranteed_new_available: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarBoxRules {
|
||||
pub ruleset_version: String,
|
||||
pub odds_table_version: String,
|
||||
pub rare_or_better_pity_threshold: i64,
|
||||
pub legendary_pity_threshold: i64,
|
||||
pub guaranteed_new_threshold: i64,
|
||||
pub odds: Vec<CodexAvatarBoxOddsBucket>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct CodexAvatarRevealAward {
|
||||
pub award_id: String,
|
||||
pub awarded_at: i64,
|
||||
pub source_type: String,
|
||||
pub source_ref: Option<String>,
|
||||
pub source_summary: Option<String>,
|
||||
pub outcome_kind: String,
|
||||
pub outcome_avatar_id: Option<String>,
|
||||
pub metadata_json: Option<String>,
|
||||
pub pity_state_after: CodexAvatarPityState,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
@@ -1850,10 +1913,10 @@ pub struct CodexAvatarInventoryReadResponse {
|
||||
pub avatar_definitions: Vec<CodexAvatarDefinition>,
|
||||
pub owned_avatars: Vec<CodexAvatarOwnership>,
|
||||
pub equipped_avatar_id: String,
|
||||
pub equipped_at: i64,
|
||||
pub box_rules: CodexAvatarBoxRules,
|
||||
pub pity_state: CodexAvatarPityState,
|
||||
pub pending_reveal_awards: Vec<CodexAvatarRevealAward>,
|
||||
pub updated_at: i64,
|
||||
pub synced_at: i64,
|
||||
pub catalog_version: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema, TS)]
|
||||
|
||||
@@ -2,20 +2,30 @@ use crate::error_code::INTERNAL_ERROR_CODE;
|
||||
use crate::error_code::INVALID_REQUEST_ERROR_CODE;
|
||||
use codex_app_server_protocol::CodexAvatarAdminAwardGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarAdminCapabilitiesReadResponse;
|
||||
use codex_app_server_protocol::CodexAvatarAdminProofDropGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarBoxOddsBucket;
|
||||
use codex_app_server_protocol::CodexAvatarBoxRules;
|
||||
use codex_app_server_protocol::CodexAvatarDefinition;
|
||||
use codex_app_server_protocol::CodexAvatarEquipParams;
|
||||
use codex_app_server_protocol::CodexAvatarInventoryReadResponse;
|
||||
use codex_app_server_protocol::CodexAvatarOwnership;
|
||||
use codex_app_server_protocol::CodexAvatarPityState;
|
||||
use codex_app_server_protocol::CodexAvatarRarity;
|
||||
use codex_app_server_protocol::CodexAvatarRevealAward;
|
||||
use codex_app_server_protocol::CodexAvatarStatus;
|
||||
use codex_app_server_protocol::JSONRPCErrorError;
|
||||
use codex_backend_client::Client as BackendClient;
|
||||
use codex_backend_client::CodexAvatarAdminAwardGrantRequest as BackendAvatarAdminAwardGrantRequest;
|
||||
use codex_backend_client::CodexAvatarAdminCapabilitiesResponse as BackendAvatarAdminCapabilitiesResponse;
|
||||
use codex_backend_client::CodexAvatarAdminProofDropGrantRequest as BackendAvatarAdminProofDropGrantRequest;
|
||||
use codex_backend_client::CodexAvatarBoxOddsBucket as BackendAvatarBoxOddsBucket;
|
||||
use codex_backend_client::CodexAvatarBoxRules as BackendAvatarBoxRules;
|
||||
use codex_backend_client::CodexAvatarDefinition as BackendAvatarDefinition;
|
||||
use codex_backend_client::CodexAvatarInventoryResponse as BackendAvatarInventoryResponse;
|
||||
use codex_backend_client::CodexAvatarOwnership as BackendAvatarOwnership;
|
||||
use codex_backend_client::CodexAvatarPityState as BackendAvatarPityState;
|
||||
use codex_backend_client::CodexAvatarRarity as BackendAvatarRarity;
|
||||
use codex_backend_client::CodexAvatarRevealAward as BackendAvatarRevealAward;
|
||||
use codex_backend_client::CodexAvatarStatus as BackendAvatarStatus;
|
||||
use codex_backend_client::RequestError;
|
||||
use codex_core::AuthManager;
|
||||
@@ -69,6 +79,26 @@ pub(crate) async fn grant_admin_avatar_award(
|
||||
Ok(map_avatar_inventory_response(response))
|
||||
}
|
||||
|
||||
pub(crate) async fn grant_admin_avatar_proof_drop(
|
||||
auth_manager: &AuthManager,
|
||||
chatgpt_base_url: &str,
|
||||
params: CodexAvatarAdminProofDropGrantParams,
|
||||
) -> Result<CodexAvatarInventoryReadResponse, JSONRPCErrorError> {
|
||||
let client = avatar_backend_client(auth_manager, chatgpt_base_url).await?;
|
||||
let response = client
|
||||
.grant_admin_avatar_proof_drop(BackendAvatarAdminProofDropGrantRequest {
|
||||
account_user_id: params.account_user_id,
|
||||
award_id: params.award_id,
|
||||
source_type: params.source_type,
|
||||
source_ref: params.source_ref,
|
||||
awarded_at: params.awarded_at,
|
||||
source_summary: params.source_summary,
|
||||
})
|
||||
.await
|
||||
.map_err(|err| backend_avatar_error("grant proof-drop box", err))?;
|
||||
Ok(map_avatar_inventory_response(response))
|
||||
}
|
||||
|
||||
pub(crate) async fn read_avatar_admin_capabilities(
|
||||
auth_manager: &AuthManager,
|
||||
chatgpt_base_url: &str,
|
||||
@@ -152,10 +182,14 @@ fn map_avatar_inventory_response(
|
||||
.map(map_avatar_ownership)
|
||||
.collect(),
|
||||
equipped_avatar_id: response.equipped_avatar_id,
|
||||
equipped_at: response.equipped_at,
|
||||
box_rules: map_avatar_box_rules(response.box_rules),
|
||||
pity_state: map_avatar_pity_state(response.pity_state),
|
||||
pending_reveal_awards: response
|
||||
.pending_reveal_awards
|
||||
.into_iter()
|
||||
.map(map_avatar_reveal_award)
|
||||
.collect(),
|
||||
updated_at: response.updated_at,
|
||||
synced_at: response.synced_at,
|
||||
catalog_version: response.catalog_version,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,13 +198,59 @@ fn map_avatar_admin_capabilities_response(
|
||||
) -> CodexAvatarAdminCapabilitiesReadResponse {
|
||||
CodexAvatarAdminCapabilitiesReadResponse {
|
||||
can_grant_awards: response.can_grant_awards,
|
||||
can_grant_proof_drop_boxes: response.can_grant_proof_drop_boxes,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_avatar_box_rules(rules: BackendAvatarBoxRules) -> CodexAvatarBoxRules {
|
||||
CodexAvatarBoxRules {
|
||||
ruleset_version: rules.ruleset_version,
|
||||
odds_table_version: rules.odds_table_version,
|
||||
rare_or_better_pity_threshold: rules.rare_or_better_pity_threshold,
|
||||
legendary_pity_threshold: rules.legendary_pity_threshold,
|
||||
guaranteed_new_threshold: rules.guaranteed_new_threshold,
|
||||
odds: rules
|
||||
.odds
|
||||
.into_iter()
|
||||
.map(map_avatar_box_odds_bucket)
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
fn map_avatar_box_odds_bucket(bucket: BackendAvatarBoxOddsBucket) -> CodexAvatarBoxOddsBucket {
|
||||
CodexAvatarBoxOddsBucket {
|
||||
bucket_id: bucket.bucket_id,
|
||||
label: bucket.label,
|
||||
probability_percent: bucket.probability_percent,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_avatar_pity_state(pity_state: BackendAvatarPityState) -> CodexAvatarPityState {
|
||||
CodexAvatarPityState {
|
||||
rolls_since_rare_or_better: pity_state.rolls_since_rare_or_better,
|
||||
rolls_since_legendary: pity_state.rolls_since_legendary,
|
||||
non_new_outcome_streak: pity_state.non_new_outcome_streak,
|
||||
guaranteed_new_available: pity_state.guaranteed_new_available,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_avatar_reveal_award(award: BackendAvatarRevealAward) -> CodexAvatarRevealAward {
|
||||
CodexAvatarRevealAward {
|
||||
award_id: award.award_id,
|
||||
awarded_at: award.awarded_at,
|
||||
source_type: award.source_type,
|
||||
source_ref: award.source_ref,
|
||||
source_summary: award.source_summary,
|
||||
outcome_kind: award.outcome_kind,
|
||||
outcome_avatar_id: award.outcome_avatar_id,
|
||||
metadata_json: award.metadata_json,
|
||||
pity_state_after: map_avatar_pity_state(award.pity_state_after),
|
||||
}
|
||||
}
|
||||
|
||||
fn map_avatar_definition(definition: BackendAvatarDefinition) -> CodexAvatarDefinition {
|
||||
CodexAvatarDefinition {
|
||||
avatar_id: definition.avatar_id,
|
||||
slug: definition.slug,
|
||||
display_name: definition.display_name,
|
||||
description: definition.description,
|
||||
rarity: match definition.rarity {
|
||||
@@ -186,8 +266,12 @@ fn map_avatar_definition(definition: BackendAvatarDefinition) -> CodexAvatarDefi
|
||||
BackendAvatarStatus::Retired => CodexAvatarStatus::Retired,
|
||||
},
|
||||
sort_order: definition.sort_order,
|
||||
created_at: definition.created_at,
|
||||
updated_at: definition.updated_at,
|
||||
collection_name: definition.collection_name,
|
||||
collection_description: definition.collection_description,
|
||||
lore: definition.lore,
|
||||
accent_class_name: definition.accent_class_name,
|
||||
silhouette_glow_class_name: definition.silhouette_glow_class_name,
|
||||
is_progress_visible: definition.is_progress_visible,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,8 +279,6 @@ fn map_avatar_ownership(ownership: BackendAvatarOwnership) -> CodexAvatarOwnersh
|
||||
CodexAvatarOwnership {
|
||||
account_user_id: ownership.account_user_id,
|
||||
avatar_id: ownership.avatar_id,
|
||||
first_unlocked_at: ownership.first_unlocked_at,
|
||||
last_awarded_at: ownership.last_awarded_at,
|
||||
source_summary: ownership.source_summary,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ use codex_app_server_protocol::CancelLoginAccountStatus;
|
||||
use codex_app_server_protocol::ClientRequest;
|
||||
use codex_app_server_protocol::ClientResponse;
|
||||
use codex_app_server_protocol::CodexAvatarAdminAwardGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarAdminProofDropGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarEquipParams;
|
||||
use codex_app_server_protocol::CodexErrorInfo as AppServerCodexErrorInfo;
|
||||
use codex_app_server_protocol::CollaborationModeListParams;
|
||||
@@ -922,6 +923,10 @@ impl CodexMessageProcessor {
|
||||
self.avatar_admin_award(to_connection_request_id(request_id), params)
|
||||
.await;
|
||||
}
|
||||
ClientRequest::AvatarAdminProofDrop { request_id, params } => {
|
||||
self.avatar_admin_proof_drop(to_connection_request_id(request_id), params)
|
||||
.await;
|
||||
}
|
||||
ClientRequest::AvatarAdminCapabilitiesRead {
|
||||
request_id,
|
||||
params: _,
|
||||
@@ -1758,6 +1763,27 @@ impl CodexMessageProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
async fn avatar_admin_proof_drop(
|
||||
&self,
|
||||
request_id: ConnectionRequestId,
|
||||
params: CodexAvatarAdminProofDropGrantParams,
|
||||
) {
|
||||
match avatar_rpc::grant_admin_avatar_proof_drop(
|
||||
&self.auth_manager,
|
||||
&self.config.chatgpt_base_url,
|
||||
params,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(response) => {
|
||||
self.outgoing.send_response(request_id, response).await;
|
||||
}
|
||||
Err(error) => {
|
||||
self.outgoing.send_error(request_id, error).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn avatar_admin_capabilities_read(&self, request_id: ConnectionRequestId) {
|
||||
match avatar_rpc::read_avatar_admin_capabilities(
|
||||
&self.auth_manager,
|
||||
|
||||
@@ -16,6 +16,7 @@ use codex_app_server_protocol::CancelLoginAccountParams;
|
||||
use codex_app_server_protocol::ClientInfo;
|
||||
use codex_app_server_protocol::ClientNotification;
|
||||
use codex_app_server_protocol::CodexAvatarAdminAwardGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarAdminProofDropGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarEquipParams;
|
||||
use codex_app_server_protocol::CollaborationModeListParams;
|
||||
use codex_app_server_protocol::CommandExecParams;
|
||||
@@ -322,6 +323,15 @@ impl McpProcess {
|
||||
self.send_request("avatar/admin/award", params).await
|
||||
}
|
||||
|
||||
/// Send an `avatar/admin/proof-drop` JSON-RPC request.
|
||||
pub async fn send_avatar_admin_proof_drop_request(
|
||||
&mut self,
|
||||
params: CodexAvatarAdminProofDropGrantParams,
|
||||
) -> anyhow::Result<i64> {
|
||||
let params = Some(serde_json::to_value(params)?);
|
||||
self.send_request("avatar/admin/proof-drop", params).await
|
||||
}
|
||||
|
||||
/// Send an `avatar/admin/capabilities/read` JSON-RPC request.
|
||||
pub async fn send_avatar_admin_capabilities_read_request(&mut self) -> anyhow::Result<i64> {
|
||||
let params = Some(serde_json::json!({}));
|
||||
|
||||
@@ -5,11 +5,16 @@ use app_test_support::to_response;
|
||||
use app_test_support::write_chatgpt_auth;
|
||||
use codex_app_server_protocol::CodexAvatarAdminAwardGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarAdminCapabilitiesReadResponse;
|
||||
use codex_app_server_protocol::CodexAvatarAdminProofDropGrantParams;
|
||||
use codex_app_server_protocol::CodexAvatarBoxOddsBucket;
|
||||
use codex_app_server_protocol::CodexAvatarBoxRules;
|
||||
use codex_app_server_protocol::CodexAvatarDefinition;
|
||||
use codex_app_server_protocol::CodexAvatarEquipParams;
|
||||
use codex_app_server_protocol::CodexAvatarInventoryReadResponse;
|
||||
use codex_app_server_protocol::CodexAvatarOwnership;
|
||||
use codex_app_server_protocol::CodexAvatarPityState;
|
||||
use codex_app_server_protocol::CodexAvatarRarity;
|
||||
use codex_app_server_protocol::CodexAvatarRevealAward;
|
||||
use codex_app_server_protocol::CodexAvatarStatus;
|
||||
use codex_app_server_protocol::JSONRPCError;
|
||||
use codex_app_server_protocol::JSONRPCResponse;
|
||||
@@ -274,6 +279,65 @@ async fn avatar_admin_award_forwards_request_and_returns_target_user_snapshot()
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn avatar_admin_proof_drop_forwards_request_and_returns_reveal_snapshot() -> Result<()> {
|
||||
let codex_home = TempDir::new()?;
|
||||
write_chatgpt_auth(
|
||||
codex_home.path(),
|
||||
ChatGptAuthFixture::new("chatgpt-token")
|
||||
.account_id("account-123")
|
||||
.plan_type("pro"),
|
||||
AuthCredentialsStoreMode::File,
|
||||
)?;
|
||||
|
||||
let server = MockServer::start().await;
|
||||
write_chatgpt_base_url(codex_home.path(), &server.uri())?;
|
||||
Mock::given(method("POST"))
|
||||
.and(path("/api/codex/avatars/admin/proof-drop"))
|
||||
.and(header("authorization", "Bearer chatgpt-token"))
|
||||
.and(header("chatgpt-account-id", "account-123"))
|
||||
.and(body_json(json!({
|
||||
"accountUserId": "target-user-456",
|
||||
"awardId": "proof-drop-1",
|
||||
"sourceType": "proof-drop-box",
|
||||
"sourceRef": "support-ticket-1",
|
||||
"awardedAt": 123,
|
||||
"sourceSummary": "Manual proof-drop box"
|
||||
})))
|
||||
.respond_with(
|
||||
ResponseTemplate::new(200)
|
||||
.set_body_json(snapshot_json_with_reveal("prism", "target-user-456")),
|
||||
)
|
||||
.mount(&server)
|
||||
.await;
|
||||
|
||||
let mut mcp = McpProcess::new_with_env(codex_home.path(), &[("OPENAI_API_KEY", None)]).await?;
|
||||
timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??;
|
||||
|
||||
let request_id = mcp
|
||||
.send_avatar_admin_proof_drop_request(CodexAvatarAdminProofDropGrantParams {
|
||||
account_user_id: "target-user-456".to_string(),
|
||||
award_id: "proof-drop-1".to_string(),
|
||||
source_type: "proof-drop-box".to_string(),
|
||||
source_ref: Some("support-ticket-1".to_string()),
|
||||
awarded_at: Some(123),
|
||||
source_summary: Some("Manual proof-drop box".to_string()),
|
||||
})
|
||||
.await?;
|
||||
let response: JSONRPCResponse = timeout(
|
||||
DEFAULT_READ_TIMEOUT,
|
||||
mcp.read_stream_until_response_message(RequestId::Integer(request_id)),
|
||||
)
|
||||
.await??;
|
||||
let received: CodexAvatarInventoryReadResponse = to_response(response)?;
|
||||
|
||||
assert_eq!(
|
||||
received,
|
||||
expected_snapshot_with_reveal("prism", "target-user-456")
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn avatar_admin_award_forwards_backend_permission_error() -> Result<()> {
|
||||
let codex_home = TempDir::new()?;
|
||||
@@ -342,6 +406,7 @@ async fn avatar_admin_capabilities_read_returns_backend_capability_flags() -> Re
|
||||
.and(header("chatgpt-account-id", "account-123"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(json!({
|
||||
"canGrantAwards": true,
|
||||
"canGrantProofDropBoxes": true,
|
||||
})))
|
||||
.mount(&server)
|
||||
.await;
|
||||
@@ -361,6 +426,7 @@ async fn avatar_admin_capabilities_read_returns_backend_capability_flags() -> Re
|
||||
received,
|
||||
CodexAvatarAdminCapabilitiesReadResponse {
|
||||
can_grant_awards: true,
|
||||
can_grant_proof_drop_boxes: true,
|
||||
}
|
||||
);
|
||||
Ok(())
|
||||
@@ -383,50 +449,113 @@ fn snapshot_json_for_user(equipped_avatar_id: &str, account_user_id: &str) -> Va
|
||||
"avatarDefinitions": [
|
||||
{
|
||||
"avatarId": "clippy",
|
||||
"slug": "clippy",
|
||||
"displayName": "Clippy",
|
||||
"description": "The default Codex paperclip avatar",
|
||||
"rarity": "common",
|
||||
"assetRef": "builtin:clippy",
|
||||
"status": "active",
|
||||
"sortOrder": 0,
|
||||
"createdAt": 0,
|
||||
"updatedAt": 0,
|
||||
"collectionName": "Desktop Set",
|
||||
"collectionDescription": "Classic office companions.",
|
||||
"lore": "Helpful and persistent.",
|
||||
"accentClassName": "bg-slate-100 text-slate-950",
|
||||
"silhouetteGlowClassName": "bg-slate-300/45",
|
||||
"isProgressVisible": true,
|
||||
},
|
||||
{
|
||||
"avatarId": "prism",
|
||||
"slug": "prism",
|
||||
"displayName": "Prism",
|
||||
"description": "A shiny earnable avatar",
|
||||
"rarity": "rare",
|
||||
"assetRef": "builtin:prism",
|
||||
"status": "hidden",
|
||||
"sortOrder": 10,
|
||||
"createdAt": 1000,
|
||||
"updatedAt": 2000,
|
||||
"collectionName": "Prism Set",
|
||||
"collectionDescription": "Light-bent mascots.",
|
||||
"lore": "Glows softly.",
|
||||
"accentClassName": "bg-violet-100 text-violet-950",
|
||||
"silhouetteGlowClassName": "bg-violet-300/45",
|
||||
"isProgressVisible": true,
|
||||
}
|
||||
],
|
||||
"ownedAvatars": [
|
||||
{
|
||||
"accountUserId": account_user_id,
|
||||
"avatarId": "clippy",
|
||||
"firstUnlockedAt": 100,
|
||||
"lastAwardedAt": 100,
|
||||
"sourceSummary": "Default avatar",
|
||||
},
|
||||
{
|
||||
"accountUserId": account_user_id,
|
||||
"avatarId": "prism",
|
||||
"firstUnlockedAt": 200,
|
||||
"lastAwardedAt": 300,
|
||||
"sourceSummary": "Quest reward",
|
||||
}
|
||||
],
|
||||
"equippedAvatarId": equipped_avatar_id,
|
||||
"equippedAt": 400,
|
||||
"boxRules": box_rules_json(),
|
||||
"pityState": pity_state_json(),
|
||||
"pendingRevealAwards": [],
|
||||
"updatedAt": 500,
|
||||
"syncedAt": 600,
|
||||
"catalogVersion": 700,
|
||||
})
|
||||
}
|
||||
|
||||
fn snapshot_json_with_reveal(equipped_avatar_id: &str, account_user_id: &str) -> Value {
|
||||
let mut snapshot = snapshot_json_for_user(equipped_avatar_id, account_user_id);
|
||||
snapshot["pendingRevealAwards"] = json!([reveal_award_json()]);
|
||||
snapshot
|
||||
}
|
||||
|
||||
fn box_rules_json() -> Value {
|
||||
json!({
|
||||
"rulesetVersion": "signal-seasons-v1",
|
||||
"oddsTableVersion": "signal-seasons-v1",
|
||||
"rareOrBetterPityThreshold": 10,
|
||||
"legendaryPityThreshold": 40,
|
||||
"guaranteedNewThreshold": 6,
|
||||
"odds": [
|
||||
{
|
||||
"bucketId": "common",
|
||||
"label": "Common",
|
||||
"probabilityPercent": 63,
|
||||
},
|
||||
{
|
||||
"bucketId": "rare",
|
||||
"label": "Rare",
|
||||
"probabilityPercent": 26,
|
||||
},
|
||||
{
|
||||
"bucketId": "legendary",
|
||||
"label": "Legendary",
|
||||
"probabilityPercent": 1,
|
||||
},
|
||||
{
|
||||
"bucketId": "no_drop",
|
||||
"label": "No drop",
|
||||
"probabilityPercent": 10,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
fn pity_state_json() -> Value {
|
||||
json!({
|
||||
"rollsSinceRareOrBetter": 1,
|
||||
"rollsSinceLegendary": 8,
|
||||
"nonNewOutcomeStreak": 0,
|
||||
"guaranteedNewAvailable": true,
|
||||
})
|
||||
}
|
||||
|
||||
fn reveal_award_json() -> Value {
|
||||
json!({
|
||||
"awardId": "proof-drop-1",
|
||||
"awardedAt": 123,
|
||||
"sourceType": "proof-drop-box",
|
||||
"sourceRef": "support-ticket-1",
|
||||
"sourceSummary": "Manual proof-drop box",
|
||||
"outcomeKind": "unlock",
|
||||
"outcomeAvatarId": "prism",
|
||||
"metadataJson": "{\"revealable\":true}",
|
||||
"pityStateAfter": pity_state_json(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -434,6 +563,15 @@ fn expected_snapshot(equipped_avatar_id: &str) -> CodexAvatarInventoryReadRespon
|
||||
expected_snapshot_for_user(equipped_avatar_id, "account-123")
|
||||
}
|
||||
|
||||
fn expected_snapshot_with_reveal(
|
||||
equipped_avatar_id: &str,
|
||||
account_user_id: &str,
|
||||
) -> CodexAvatarInventoryReadResponse {
|
||||
let mut snapshot = expected_snapshot_for_user(equipped_avatar_id, account_user_id);
|
||||
snapshot.pending_reveal_awards = vec![expected_reveal_award()];
|
||||
snapshot
|
||||
}
|
||||
|
||||
fn expected_snapshot_for_user(
|
||||
equipped_avatar_id: &str,
|
||||
account_user_id: &str,
|
||||
@@ -443,49 +581,106 @@ fn expected_snapshot_for_user(
|
||||
avatar_definitions: vec![
|
||||
CodexAvatarDefinition {
|
||||
avatar_id: "clippy".to_string(),
|
||||
slug: "clippy".to_string(),
|
||||
display_name: "Clippy".to_string(),
|
||||
description: "The default Codex paperclip avatar".to_string(),
|
||||
rarity: CodexAvatarRarity::Common,
|
||||
asset_ref: "builtin:clippy".to_string(),
|
||||
status: CodexAvatarStatus::Active,
|
||||
sort_order: 0,
|
||||
created_at: 0,
|
||||
updated_at: 0,
|
||||
collection_name: "Desktop Set".to_string(),
|
||||
collection_description: "Classic office companions.".to_string(),
|
||||
lore: "Helpful and persistent.".to_string(),
|
||||
accent_class_name: "bg-slate-100 text-slate-950".to_string(),
|
||||
silhouette_glow_class_name: "bg-slate-300/45".to_string(),
|
||||
is_progress_visible: true,
|
||||
},
|
||||
CodexAvatarDefinition {
|
||||
avatar_id: "prism".to_string(),
|
||||
slug: "prism".to_string(),
|
||||
display_name: "Prism".to_string(),
|
||||
description: "A shiny earnable avatar".to_string(),
|
||||
rarity: CodexAvatarRarity::Rare,
|
||||
asset_ref: "builtin:prism".to_string(),
|
||||
status: CodexAvatarStatus::Hidden,
|
||||
sort_order: 10,
|
||||
created_at: 1000,
|
||||
updated_at: 2000,
|
||||
collection_name: "Prism Set".to_string(),
|
||||
collection_description: "Light-bent mascots.".to_string(),
|
||||
lore: "Glows softly.".to_string(),
|
||||
accent_class_name: "bg-violet-100 text-violet-950".to_string(),
|
||||
silhouette_glow_class_name: "bg-violet-300/45".to_string(),
|
||||
is_progress_visible: true,
|
||||
},
|
||||
],
|
||||
owned_avatars: vec![
|
||||
CodexAvatarOwnership {
|
||||
account_user_id: account_user_id.to_string(),
|
||||
avatar_id: "clippy".to_string(),
|
||||
first_unlocked_at: 100,
|
||||
last_awarded_at: 100,
|
||||
source_summary: Some("Default avatar".to_string()),
|
||||
},
|
||||
CodexAvatarOwnership {
|
||||
account_user_id: account_user_id.to_string(),
|
||||
avatar_id: "prism".to_string(),
|
||||
first_unlocked_at: 200,
|
||||
last_awarded_at: 300,
|
||||
source_summary: Some("Quest reward".to_string()),
|
||||
},
|
||||
],
|
||||
equipped_avatar_id: equipped_avatar_id.to_string(),
|
||||
equipped_at: 400,
|
||||
box_rules: expected_box_rules(),
|
||||
pity_state: expected_pity_state(),
|
||||
pending_reveal_awards: Vec::new(),
|
||||
updated_at: 500,
|
||||
synced_at: 600,
|
||||
catalog_version: Some(700),
|
||||
}
|
||||
}
|
||||
|
||||
fn expected_box_rules() -> CodexAvatarBoxRules {
|
||||
CodexAvatarBoxRules {
|
||||
ruleset_version: "signal-seasons-v1".to_string(),
|
||||
odds_table_version: "signal-seasons-v1".to_string(),
|
||||
rare_or_better_pity_threshold: 10,
|
||||
legendary_pity_threshold: 40,
|
||||
guaranteed_new_threshold: 6,
|
||||
odds: vec![
|
||||
CodexAvatarBoxOddsBucket {
|
||||
bucket_id: "common".to_string(),
|
||||
label: "Common".to_string(),
|
||||
probability_percent: 63,
|
||||
},
|
||||
CodexAvatarBoxOddsBucket {
|
||||
bucket_id: "rare".to_string(),
|
||||
label: "Rare".to_string(),
|
||||
probability_percent: 26,
|
||||
},
|
||||
CodexAvatarBoxOddsBucket {
|
||||
bucket_id: "legendary".to_string(),
|
||||
label: "Legendary".to_string(),
|
||||
probability_percent: 1,
|
||||
},
|
||||
CodexAvatarBoxOddsBucket {
|
||||
bucket_id: "no_drop".to_string(),
|
||||
label: "No drop".to_string(),
|
||||
probability_percent: 10,
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
fn expected_pity_state() -> CodexAvatarPityState {
|
||||
CodexAvatarPityState {
|
||||
rolls_since_rare_or_better: 1,
|
||||
rolls_since_legendary: 8,
|
||||
non_new_outcome_streak: 0,
|
||||
guaranteed_new_available: true,
|
||||
}
|
||||
}
|
||||
|
||||
fn expected_reveal_award() -> CodexAvatarRevealAward {
|
||||
CodexAvatarRevealAward {
|
||||
award_id: "proof-drop-1".to_string(),
|
||||
awarded_at: 123,
|
||||
source_type: "proof-drop-box".to_string(),
|
||||
source_ref: Some("support-ticket-1".to_string()),
|
||||
source_summary: Some("Manual proof-drop box".to_string()),
|
||||
outcome_kind: "unlock".to_string(),
|
||||
outcome_avatar_id: Some("prism".to_string()),
|
||||
metadata_json: Some("{\"revealable\":true}".to_string()),
|
||||
pity_state_after: expected_pity_state(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::types::CodeTaskDetailsResponse;
|
||||
use crate::types::CodexAvatarAdminAwardGrantRequest;
|
||||
use crate::types::CodexAvatarAdminCapabilitiesResponse;
|
||||
use crate::types::CodexAvatarAdminProofDropGrantRequest;
|
||||
use crate::types::CodexAvatarEquipRequest;
|
||||
use crate::types::CodexAvatarInventoryResponse;
|
||||
use crate::types::ConfigFileResponse;
|
||||
@@ -321,6 +322,29 @@ impl Client {
|
||||
.map_err(RequestError::from)
|
||||
}
|
||||
|
||||
pub async fn grant_admin_avatar_proof_drop(
|
||||
&self,
|
||||
request_body: CodexAvatarAdminProofDropGrantRequest,
|
||||
) -> std::result::Result<CodexAvatarInventoryResponse, RequestError> {
|
||||
let url = match self.path_style {
|
||||
PathStyle::CodexApi => {
|
||||
format!("{}/api/codex/avatars/admin/proof-drop", self.base_url)
|
||||
}
|
||||
PathStyle::ChatGptApi => {
|
||||
format!("{}/wham/avatars/admin/proof-drop", self.base_url)
|
||||
}
|
||||
};
|
||||
let req = self
|
||||
.http
|
||||
.post(&url)
|
||||
.headers(self.headers())
|
||||
.header(CONTENT_TYPE, HeaderValue::from_static("application/json"))
|
||||
.json(&request_body);
|
||||
let (body, ct) = self.exec_request_detailed(req, "POST", &url).await?;
|
||||
self.decode_json::<CodexAvatarInventoryResponse>(&url, &ct, &body)
|
||||
.map_err(RequestError::from)
|
||||
}
|
||||
|
||||
pub async fn get_avatar_admin_capabilities(
|
||||
&self,
|
||||
) -> std::result::Result<CodexAvatarAdminCapabilitiesResponse, RequestError> {
|
||||
|
||||
@@ -7,11 +7,16 @@ pub use types::CodeTaskDetailsResponse;
|
||||
pub use types::CodeTaskDetailsResponseExt;
|
||||
pub use types::CodexAvatarAdminAwardGrantRequest;
|
||||
pub use types::CodexAvatarAdminCapabilitiesResponse;
|
||||
pub use types::CodexAvatarAdminProofDropGrantRequest;
|
||||
pub use types::CodexAvatarBoxOddsBucket;
|
||||
pub use types::CodexAvatarBoxRules;
|
||||
pub use types::CodexAvatarDefinition;
|
||||
pub use types::CodexAvatarEquipRequest;
|
||||
pub use types::CodexAvatarInventoryResponse;
|
||||
pub use types::CodexAvatarOwnership;
|
||||
pub use types::CodexAvatarPityState;
|
||||
pub use types::CodexAvatarRarity;
|
||||
pub use types::CodexAvatarRevealAward;
|
||||
pub use types::CodexAvatarStatus;
|
||||
pub use types::ConfigFileResponse;
|
||||
pub use types::PaginatedListTaskListItem;
|
||||
|
||||
@@ -47,15 +47,18 @@ pub enum CodexAvatarRarity {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarDefinition {
|
||||
pub avatar_id: String,
|
||||
pub slug: String,
|
||||
pub display_name: String,
|
||||
pub description: String,
|
||||
pub rarity: CodexAvatarRarity,
|
||||
pub asset_ref: String,
|
||||
pub status: CodexAvatarStatus,
|
||||
pub sort_order: i64,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub collection_name: String,
|
||||
pub collection_description: String,
|
||||
pub lore: String,
|
||||
pub accent_class_name: String,
|
||||
pub silhouette_glow_class_name: String,
|
||||
pub is_progress_visible: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
@@ -63,8 +66,6 @@ pub struct CodexAvatarDefinition {
|
||||
pub struct CodexAvatarOwnership {
|
||||
pub account_user_id: String,
|
||||
pub avatar_id: String,
|
||||
pub first_unlocked_at: i64,
|
||||
pub last_awarded_at: i64,
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
@@ -88,6 +89,59 @@ pub struct CodexAvatarAdminAwardGrantRequest {
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarAdminProofDropGrantRequest {
|
||||
pub account_user_id: String,
|
||||
pub award_id: String,
|
||||
pub source_type: String,
|
||||
pub source_ref: Option<String>,
|
||||
pub awarded_at: Option<i64>,
|
||||
pub source_summary: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarBoxOddsBucket {
|
||||
pub bucket_id: String,
|
||||
pub label: String,
|
||||
pub probability_percent: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarPityState {
|
||||
pub rolls_since_rare_or_better: i64,
|
||||
pub rolls_since_legendary: i64,
|
||||
pub non_new_outcome_streak: i64,
|
||||
pub guaranteed_new_available: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarBoxRules {
|
||||
pub ruleset_version: String,
|
||||
pub odds_table_version: String,
|
||||
pub rare_or_better_pity_threshold: i64,
|
||||
pub legendary_pity_threshold: i64,
|
||||
pub guaranteed_new_threshold: i64,
|
||||
pub odds: Vec<CodexAvatarBoxOddsBucket>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarRevealAward {
|
||||
pub award_id: String,
|
||||
pub awarded_at: i64,
|
||||
pub source_type: String,
|
||||
pub source_ref: Option<String>,
|
||||
pub source_summary: Option<String>,
|
||||
pub outcome_kind: String,
|
||||
pub outcome_avatar_id: Option<String>,
|
||||
pub metadata_json: Option<String>,
|
||||
pub pity_state_after: CodexAvatarPityState,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarInventoryResponse {
|
||||
@@ -95,16 +149,17 @@ pub struct CodexAvatarInventoryResponse {
|
||||
pub avatar_definitions: Vec<CodexAvatarDefinition>,
|
||||
pub owned_avatars: Vec<CodexAvatarOwnership>,
|
||||
pub equipped_avatar_id: String,
|
||||
pub equipped_at: i64,
|
||||
pub box_rules: CodexAvatarBoxRules,
|
||||
pub pity_state: CodexAvatarPityState,
|
||||
pub pending_reveal_awards: Vec<CodexAvatarRevealAward>,
|
||||
pub updated_at: i64,
|
||||
pub synced_at: i64,
|
||||
pub catalog_version: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CodexAvatarAdminCapabilitiesResponse {
|
||||
pub can_grant_awards: bool,
|
||||
pub can_grant_proof_drop_boxes: bool,
|
||||
}
|
||||
|
||||
/// Hand-rolled models for the Cloud Tasks task-details response.
|
||||
|
||||
Reference in New Issue
Block a user