@pfdev/api-types 3.0.10 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/v3.ts +57 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pfdev/api-types",
3
- "version": "3.0.10",
3
+ "version": "3.0.12",
4
4
  "description": "TypeScript types for PF API V3",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
package/v3.ts CHANGED
@@ -239,6 +239,19 @@ export const CardSalesResponseSchema = Type.Object(
239
239
 
240
240
  export type CardSalesResponse = Static<typeof CardSalesResponseSchema>;
241
241
 
242
+ // ============= CURRENCY =============
243
+
244
+
245
+ export const CurrencyResponseSchema = Type.Object({
246
+ success: Type.Boolean(),
247
+ timestamp: Type.Number(),
248
+ date: Type.String(),
249
+ base: Type.String(),
250
+ rates: Type.Record(Type.String(), Type.Number())
251
+ });
252
+
253
+ export type CurrencyResponse = Static<typeof CurrencyResponseSchema>;
254
+
242
255
  // ============= SEALED =============
243
256
 
244
257
 
@@ -433,6 +446,50 @@ export const SetDetailParamSchema = Type.Object({
433
446
 
434
447
  export type SetDetailParam = Static<typeof SetDetailParamSchema>;
435
448
 
449
+ // ============= USERS =============
450
+
451
+
452
+ export const UserRoleSchema = Type.Object(
453
+ {
454
+ id: Type.Number({ description: 'Role ID' }),
455
+ name: Type.String({ description: 'Role name' }),
456
+ display_name: Type.String({ description: 'Human-friendly role name' }),
457
+ auto_assigned: Type.Boolean({ description: 'Whether the role was auto-assigned' })
458
+ },
459
+ { title: 'UserRole' }
460
+ );
461
+
462
+ export type UserRole = Static<typeof UserRoleSchema>;
463
+
464
+ export const MeResponseSchema = Type.Object(
465
+ {
466
+ userid: Type.String({ description: 'Internal user ID (Clerk userId)' }),
467
+ username: Type.Union([Type.String(), Type.Null()]),
468
+ avatar: Type.Union([Type.String(), Type.Null()]),
469
+ discord_username: Type.Union([Type.String(), Type.Null()]),
470
+ active: Type.Union([Type.Boolean(), Type.Null()], {
471
+ description: 'Whether the linked Discord account is active'
472
+ }),
473
+ roles: Type.Array(UserRoleSchema, { description: 'All roles assigned to the user' }),
474
+ display_role: Type.Union([UserRoleSchema, Type.Null()], {
475
+ description: 'Highest-tier subscription role, if any'
476
+ })
477
+ },
478
+ {
479
+ title: 'MeResponse',
480
+ description: 'The authenticated user\'s profile, roles, and Discord link'
481
+ }
482
+ );
483
+
484
+ export type MeResponse = Static<typeof MeResponseSchema>;
485
+
486
+ export const ErrorResponseSchema = Type.Object({
487
+ error: Type.String(),
488
+ message: Type.String()
489
+ });
490
+
491
+ export type ErrorResponse = Static<typeof ErrorResponseSchema>;
492
+
436
493
  // ============= VISION =============
437
494
 
438
495