@oxy.so/contracts 6.20.0 → 6.21.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.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.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");
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "DEVICE_APP_TOKEN_ERROR_CODES", { enumerable: tru
23
23
  Object.defineProperty(exports, "DEVICE_APP_TOKEN_TTL_SECONDS", { enumerable: true, get: function () { return platformSession_1.DEVICE_APP_TOKEN_TTL_SECONDS; } });
24
24
  Object.defineProperty(exports, "OXYOS_DESKTOP_ENTRY_ID_PATTERN", { enumerable: true, get: function () { return platformSession_1.OXYOS_DESKTOP_ENTRY_ID_PATTERN; } });
25
25
  Object.defineProperty(exports, "PLATFORM_HOSTS", { enumerable: true, get: function () { return platformSession_1.PLATFORM_HOSTS; } });
26
+ const deviceSession_1 = require("./deviceSession");
26
27
  const stringChecks_1 = require("./stringChecks");
27
28
  const publicClientIdSchema = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256));
28
29
  /**
@@ -39,6 +40,21 @@ exports.platformClientSchema = zod_1.z.strictObject({
39
40
  platform: appAssertions_1.platformHostSchema,
40
41
  clientId: publicClientIdSchema,
41
42
  });
43
+ /**
44
+ * `POST /session/device/platform`: a platform's credential from the QR
45
+ * approval (ADR 0058 2.1, amended 2026-11-08). `device` is the holder
46
+ * credential a device-sign-in claim (`POST /auth/session/claim`) issued to the
47
+ * platform's setup client a few minutes ago, the request having been started by
48
+ * the application `platformClient` names. Honoured as `platformClient` is on
49
+ * the password sign-in (no web `Origin`, the registry's `platformHost`). The
50
+ * proof is spent once; the answer is the password sign-in's (`LoginResult`),
51
+ * its `deviceSecret` the platform credential. Every proof that is not
52
+ * redeemable gets the same 401 (`invalid_grant`).
53
+ */
54
+ exports.devicePlatformRequestSchema = zod_1.z.strictObject({
55
+ device: zod_1.z.strictObject(deviceSession_1.deviceProofSchema.shape),
56
+ platformClient: exports.platformClientSchema,
57
+ });
42
58
  /**
43
59
  * Which application the token is for, as the platform vouches for it:
44
60
  *
@@ -15,6 +15,7 @@
15
15
  import { z } from 'zod';
16
16
  import { applicationWebOriginSchema, oxyosDesktopEntryIdSchema, platformHostSchema, } from './appAssertions.js';
17
17
  import { APP_TOKEN_DEVICE_ACCESS_DENIED, DEVICE_APP_TOKEN_ERROR_CODES, DEVICE_APP_TOKEN_TTL_SECONDS, OXYOS_DESKTOP_ENTRY_ID_PATTERN, PLATFORM_HOSTS, } from './client/platformSession.js';
18
+ import { deviceProofSchema } from './deviceSession.js';
18
19
  import { isoDateTime, utf16MaxLength, utf16MinLength } from './stringChecks.js';
19
20
  export { APP_TOKEN_DEVICE_ACCESS_DENIED, DEVICE_APP_TOKEN_ERROR_CODES, DEVICE_APP_TOKEN_TTL_SECONDS, OXYOS_DESKTOP_ENTRY_ID_PATTERN, PLATFORM_HOSTS, };
20
21
  const publicClientIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(256));
@@ -32,6 +33,21 @@ export const platformClientSchema = z.strictObject({
32
33
  platform: platformHostSchema,
33
34
  clientId: publicClientIdSchema,
34
35
  });
36
+ /**
37
+ * `POST /session/device/platform`: a platform's credential from the QR
38
+ * approval (ADR 0058 2.1, amended 2026-11-08). `device` is the holder
39
+ * credential a device-sign-in claim (`POST /auth/session/claim`) issued to the
40
+ * platform's setup client a few minutes ago, the request having been started by
41
+ * the application `platformClient` names. Honoured as `platformClient` is on
42
+ * the password sign-in (no web `Origin`, the registry's `platformHost`). The
43
+ * proof is spent once; the answer is the password sign-in's (`LoginResult`),
44
+ * its `deviceSecret` the platform credential. Every proof that is not
45
+ * redeemable gets the same 401 (`invalid_grant`).
46
+ */
47
+ export const devicePlatformRequestSchema = z.strictObject({
48
+ device: z.strictObject(deviceProofSchema.shape),
49
+ platformClient: platformClientSchema,
50
+ });
35
51
  /**
36
52
  * Which application the token is for, as the platform vouches for it:
37
53
  *
@@ -32,6 +32,30 @@ export declare const platformClientSchema: z.ZodObject<{
32
32
  }>;
33
33
  clientId: z.ZodString;
34
34
  }, z.core.$strict>;
35
+ /**
36
+ * `POST /session/device/platform`: a platform's credential from the QR
37
+ * approval (ADR 0058 2.1, amended 2026-11-08). `device` is the holder
38
+ * credential a device-sign-in claim (`POST /auth/session/claim`) issued to the
39
+ * platform's setup client a few minutes ago, the request having been started by
40
+ * the application `platformClient` names. Honoured as `platformClient` is on
41
+ * the password sign-in (no web `Origin`, the registry's `platformHost`). The
42
+ * proof is spent once; the answer is the password sign-in's (`LoginResult`),
43
+ * its `deviceSecret` the platform credential. Every proof that is not
44
+ * redeemable gets the same 401 (`invalid_grant`).
45
+ */
46
+ export declare const devicePlatformRequestSchema: z.ZodObject<{
47
+ device: z.ZodObject<{
48
+ deviceId: z.ZodString;
49
+ deviceSecret: z.ZodString;
50
+ }, z.core.$strict>;
51
+ platformClient: z.ZodObject<{
52
+ platform: z.ZodEnum<{
53
+ oxyos: "oxyos";
54
+ astro: "astro";
55
+ }>;
56
+ clientId: z.ZodString;
57
+ }, z.core.$strict>;
58
+ }, z.core.$strict>;
35
59
  /**
36
60
  * Which application the token is for, as the platform vouches for it:
37
61
  *
@@ -122,6 +146,7 @@ export declare const hostTokenValidationSchema: z.ZodObject<{
122
146
  export type PlatformHost = (typeof PLATFORM_HOSTS)[number];
123
147
  export type DeviceAppTokenErrorCode = (typeof DEVICE_APP_TOKEN_ERROR_CODES)[number];
124
148
  export type PlatformClient = z.infer<typeof platformClientSchema>;
149
+ export type DevicePlatformRequest = z.infer<typeof devicePlatformRequestSchema>;
125
150
  export type DeviceAppTokenAttestation = z.infer<typeof deviceAppTokenAttestationSchema>;
126
151
  export type DeviceAppTokenRequest = z.infer<typeof deviceAppTokenRequestSchema>;
127
152
  export type DeviceAppTokenResponse = z.infer<typeof deviceAppTokenResponseSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.20.0",
3
+ "version": "6.21.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",