@oxy.so/contracts 6.22.0 → 6.23.0

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.
@@ -14,7 +14,7 @@
14
14
  * `./client/platformSession.ts`.
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.hostTokenValidationSchema = exports.hostTokenClaimSchema = exports.deviceAppTokenResponseSchema = exports.deviceAppTokenRequestSchema = exports.deviceAppTokenAttestationSchema = exports.devicePlatformRequestSchema = exports.redemptionKeySchema = exports.platformClientSchema = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = void 0;
17
+ exports.hostTokenValidationSchema = exports.hostTokenClaimSchema = exports.deviceAppTokenResponseSchema = exports.deviceAppTokenRequestSchema = exports.deviceAppTokenAttestationSchema = exports.devicePlatformRequestSchema = exports.redemptionKeySchema = exports.devicePlatformConfirmResponseSchema = exports.devicePlatformConfirmRequestSchema = exports.PLATFORM_CREDENTIAL_PENDING_MS = exports.platformClientSchema = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = void 0;
18
18
  const zod_1 = require("zod");
19
19
  const appAssertions_1 = require("./appAssertions");
20
20
  const platformSession_1 = require("./client/platformSession");
@@ -39,6 +39,28 @@ const publicClientIdSchema = zod_1.z.string().check((0, stringChecks_1.utf16MinL
39
39
  exports.platformClientSchema = zod_1.z.strictObject({
40
40
  platform: appAssertions_1.platformHostSchema,
41
41
  clientId: publicClientIdSchema,
42
+ /**
43
+ * R8: the platform confirms every credential it receives
44
+ * (`POST /session/device/platform/confirm`). The credential is then PENDING
45
+ * until confirmed: it proves nothing, and is gone ten minutes after the QR's
46
+ * claim (the device-proof route) or the sign-in (the password and second
47
+ * factor routes); the credential the sign-in's device proof presented is
48
+ * retired only by the confirmation. Without it, as before R8.
49
+ */
50
+ confirms: zod_1.z.literal(true).optional(),
51
+ });
52
+ /** How long a pending platform credential waits for its confirmation (R8). */
53
+ exports.PLATFORM_CREDENTIAL_PENDING_MS = 10 * 60 * 1000;
54
+ /**
55
+ * `POST /session/device/platform/confirm` (R8): the pending platform credential
56
+ * confirmed by its own holder proof, nothing else. Idempotent: a credential
57
+ * already confirmed is the same answer. Every other proof (unknown, expired,
58
+ * not a platform's) is one 401 `invalid_grant`.
59
+ */
60
+ exports.devicePlatformConfirmRequestSchema = zod_1.z.strictObject(deviceSession_1.deviceProofSchema.shape);
61
+ /** The confirmation's answer. */
62
+ exports.devicePlatformConfirmResponseSchema = zod_1.z.strictObject({
63
+ confirmed: zod_1.z.literal(true),
42
64
  });
43
65
  /**
44
66
  * The key that makes a QR redemption repeatable (ADR 0058 R7): at least 256
@@ -32,6 +32,28 @@ const publicClientIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxL
32
32
  export const platformClientSchema = z.strictObject({
33
33
  platform: platformHostSchema,
34
34
  clientId: publicClientIdSchema,
35
+ /**
36
+ * R8: the platform confirms every credential it receives
37
+ * (`POST /session/device/platform/confirm`). The credential is then PENDING
38
+ * until confirmed: it proves nothing, and is gone ten minutes after the QR's
39
+ * claim (the device-proof route) or the sign-in (the password and second
40
+ * factor routes); the credential the sign-in's device proof presented is
41
+ * retired only by the confirmation. Without it, as before R8.
42
+ */
43
+ confirms: z.literal(true).optional(),
44
+ });
45
+ /** How long a pending platform credential waits for its confirmation (R8). */
46
+ export const PLATFORM_CREDENTIAL_PENDING_MS = 10 * 60 * 1000;
47
+ /**
48
+ * `POST /session/device/platform/confirm` (R8): the pending platform credential
49
+ * confirmed by its own holder proof, nothing else. Idempotent: a credential
50
+ * already confirmed is the same answer. Every other proof (unknown, expired,
51
+ * not a platform's) is one 401 `invalid_grant`.
52
+ */
53
+ export const devicePlatformConfirmRequestSchema = z.strictObject(deviceProofSchema.shape);
54
+ /** The confirmation's answer. */
55
+ export const devicePlatformConfirmResponseSchema = z.strictObject({
56
+ confirmed: z.literal(true),
35
57
  });
36
58
  /**
37
59
  * The key that makes a QR redemption repeatable (ADR 0058 R7): at least 256
@@ -180,7 +180,7 @@ export declare const purchaseApprovalCheck: Check<{
180
180
  id: string;
181
181
  childAccountId: string;
182
182
  applicationId: string;
183
- status: "pending" | "approved" | "rejected" | "cancelled" | "confirmed" | "reserved";
183
+ status: "pending" | "approved" | "rejected" | "confirmed" | "cancelled" | "reserved";
184
184
  createdAt: string;
185
185
  receiptReference: string | null;
186
186
  }>;
@@ -202,7 +202,7 @@ export declare const purchaseApprovalListCheck: Check<{
202
202
  id: string;
203
203
  childAccountId: string;
204
204
  applicationId: string;
205
- status: "pending" | "approved" | "rejected" | "cancelled" | "confirmed" | "reserved";
205
+ status: "pending" | "approved" | "rejected" | "confirmed" | "cancelled" | "reserved";
206
206
  createdAt: string;
207
207
  receiptReference: string | null;
208
208
  }[];
@@ -31,6 +31,23 @@ export declare const platformClientSchema: z.ZodObject<{
31
31
  astro: "astro";
32
32
  }>;
33
33
  clientId: z.ZodString;
34
+ confirms: z.ZodOptional<z.ZodLiteral<true>>;
35
+ }, z.core.$strict>;
36
+ /** How long a pending platform credential waits for its confirmation (R8). */
37
+ export declare const PLATFORM_CREDENTIAL_PENDING_MS: number;
38
+ /**
39
+ * `POST /session/device/platform/confirm` (R8): the pending platform credential
40
+ * confirmed by its own holder proof, nothing else. Idempotent: a credential
41
+ * already confirmed is the same answer. Every other proof (unknown, expired,
42
+ * not a platform's) is one 401 `invalid_grant`.
43
+ */
44
+ export declare const devicePlatformConfirmRequestSchema: z.ZodObject<{
45
+ deviceId: z.ZodString;
46
+ deviceSecret: z.ZodString;
47
+ }, z.core.$strict>;
48
+ /** The confirmation's answer. */
49
+ export declare const devicePlatformConfirmResponseSchema: z.ZodObject<{
50
+ confirmed: z.ZodLiteral<true>;
34
51
  }, z.core.$strict>;
35
52
  /**
36
53
  * The key that makes a QR redemption repeatable (ADR 0058 R7): at least 256
@@ -67,6 +84,7 @@ export declare const devicePlatformRequestSchema: z.ZodObject<{
67
84
  astro: "astro";
68
85
  }>;
69
86
  clientId: z.ZodString;
87
+ confirms: z.ZodOptional<z.ZodLiteral<true>>;
70
88
  }, z.core.$strict>;
71
89
  redemptionKey: z.ZodOptional<z.ZodString>;
72
90
  }, z.core.$strict>;
@@ -161,6 +179,8 @@ export type PlatformHost = (typeof PLATFORM_HOSTS)[number];
161
179
  export type DeviceAppTokenErrorCode = (typeof DEVICE_APP_TOKEN_ERROR_CODES)[number];
162
180
  export type PlatformClient = z.infer<typeof platformClientSchema>;
163
181
  export type DevicePlatformRequest = z.infer<typeof devicePlatformRequestSchema>;
182
+ export type DevicePlatformConfirmRequest = z.infer<typeof devicePlatformConfirmRequestSchema>;
183
+ export type DevicePlatformConfirmResponse = z.infer<typeof devicePlatformConfirmResponseSchema>;
164
184
  export type DeviceAppTokenAttestation = z.infer<typeof deviceAppTokenAttestationSchema>;
165
185
  export type DeviceAppTokenRequest = z.infer<typeof deviceAppTokenRequestSchema>;
166
186
  export type DeviceAppTokenResponse = z.infer<typeof deviceAppTokenResponseSchema>;
@@ -451,8 +451,8 @@ export declare const purchaseApprovalSchema: z.ZodObject<{
451
451
  pending: "pending";
452
452
  approved: "approved";
453
453
  rejected: "rejected";
454
- cancelled: "cancelled";
455
454
  confirmed: "confirmed";
455
+ cancelled: "cancelled";
456
456
  reserved: "reserved";
457
457
  }>;
458
458
  createdAt: z.ZodString;
@@ -479,8 +479,8 @@ export declare const purchaseApprovalSummarySchema: z.ZodObject<{
479
479
  pending: "pending";
480
480
  approved: "approved";
481
481
  rejected: "rejected";
482
- cancelled: "cancelled";
483
482
  confirmed: "confirmed";
483
+ cancelled: "cancelled";
484
484
  reserved: "reserved";
485
485
  }>;
486
486
  createdAt: z.ZodString;
@@ -508,8 +508,8 @@ export declare const purchaseApprovalListSchema: z.ZodObject<{
508
508
  pending: "pending";
509
509
  approved: "approved";
510
510
  rejected: "rejected";
511
- cancelled: "cancelled";
512
511
  confirmed: "confirmed";
512
+ cancelled: "cancelled";
513
513
  reserved: "reserved";
514
514
  }>;
515
515
  createdAt: z.ZodString;
@@ -130,6 +130,7 @@ export declare const passwordSignInRequestSchema: z.ZodObject<{
130
130
  astro: "astro";
131
131
  }>;
132
132
  clientId: z.ZodString;
133
+ confirms: z.ZodOptional<z.ZodLiteral<true>>;
133
134
  }, z.core.$strict>>;
134
135
  deviceName: z.ZodOptional<z.ZodString>;
135
136
  deviceFingerprint: z.ZodOptional<z.ZodString>;
@@ -153,6 +154,7 @@ export declare const secondFactorSignInRequestSchema: z.ZodObject<{
153
154
  astro: "astro";
154
155
  }>;
155
156
  clientId: z.ZodString;
157
+ confirms: z.ZodOptional<z.ZodLiteral<true>>;
156
158
  }, z.core.$strict>>;
157
159
  deviceName: z.ZodOptional<z.ZodString>;
158
160
  deviceFingerprint: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.22.0",
3
+ "version": "6.23.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",