@oxy.so/contracts 6.23.0 → 6.24.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.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;
17
+ exports.hostTokenValidationSchema = exports.hostTokenClaimSchema = exports.deviceAppTokenResponseSchema = exports.deviceAppTokenRequestSchema = exports.deviceAppTokenAttestationSchema = exports.devicePlatformWindowsSchema = exports.redemptionWindowSchema = 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");
@@ -91,6 +91,32 @@ exports.devicePlatformRequestSchema = zod_1.z.strictObject({
91
91
  platformClient: exports.platformClientSchema,
92
92
  redemptionKey: exports.redemptionKeySchema.optional(),
93
93
  });
94
+ /**
95
+ * A window of the QR's redemption (R9), as the server counts it when it
96
+ * answers: `expiresInSeconds` (whole seconds, never negative) is what a
97
+ * platform measures against its own monotonic clock from the moment the
98
+ * answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
99
+ * is for logs and people.
100
+ */
101
+ exports.redemptionWindowSchema = zod_1.z.strictObject({
102
+ expiresAt: zod_1.z.string().datetime(),
103
+ expiresInSeconds: zod_1.z.number().int().nonnegative(),
104
+ });
105
+ /**
106
+ * What `POST /session/device/platform` adds to an answer that concerns a
107
+ * known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
108
+ * proof may be redeemed, and redeemed again with its key, until then); and,
109
+ * on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
110
+ * credential it issued must be confirmed by. The 200 carries both beside the
111
+ * sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
112
+ * account in (the account's budget) carries `redemptionWindow` beside its
113
+ * `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
114
+ * neither: it stays the one identical 401.
115
+ */
116
+ exports.devicePlatformWindowsSchema = zod_1.z.object({
117
+ redemptionWindow: exports.redemptionWindowSchema,
118
+ confirmWindow: exports.redemptionWindowSchema.optional(),
119
+ });
94
120
  /**
95
121
  * Which application the token is for, as the platform vouches for it:
96
122
  *
@@ -84,6 +84,32 @@ export const devicePlatformRequestSchema = z.strictObject({
84
84
  platformClient: platformClientSchema,
85
85
  redemptionKey: redemptionKeySchema.optional(),
86
86
  });
87
+ /**
88
+ * A window of the QR's redemption (R9), as the server counts it when it
89
+ * answers: `expiresInSeconds` (whole seconds, never negative) is what a
90
+ * platform measures against its own monotonic clock from the moment the
91
+ * answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
92
+ * is for logs and people.
93
+ */
94
+ export const redemptionWindowSchema = z.strictObject({
95
+ expiresAt: z.string().datetime(),
96
+ expiresInSeconds: z.number().int().nonnegative(),
97
+ });
98
+ /**
99
+ * What `POST /session/device/platform` adds to an answer that concerns a
100
+ * known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
101
+ * proof may be redeemed, and redeemed again with its key, until then); and,
102
+ * on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
103
+ * credential it issued must be confirmed by. The 200 carries both beside the
104
+ * sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
105
+ * account in (the account's budget) carries `redemptionWindow` beside its
106
+ * `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
107
+ * neither: it stays the one identical 401.
108
+ */
109
+ export const devicePlatformWindowsSchema = z.object({
110
+ redemptionWindow: redemptionWindowSchema,
111
+ confirmWindow: redemptionWindowSchema.optional(),
112
+ });
87
113
  /**
88
114
  * Which application the token is for, as the platform vouches for it:
89
115
  *
@@ -88,6 +88,38 @@ export declare const devicePlatformRequestSchema: z.ZodObject<{
88
88
  }, z.core.$strict>;
89
89
  redemptionKey: z.ZodOptional<z.ZodString>;
90
90
  }, z.core.$strict>;
91
+ /**
92
+ * A window of the QR's redemption (R9), as the server counts it when it
93
+ * answers: `expiresInSeconds` (whole seconds, never negative) is what a
94
+ * platform measures against its own monotonic clock from the moment the
95
+ * answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
96
+ * is for logs and people.
97
+ */
98
+ export declare const redemptionWindowSchema: z.ZodObject<{
99
+ expiresAt: z.ZodString;
100
+ expiresInSeconds: z.ZodNumber;
101
+ }, z.core.$strict>;
102
+ /**
103
+ * What `POST /session/device/platform` adds to an answer that concerns a
104
+ * known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
105
+ * proof may be redeemed, and redeemed again with its key, until then); and,
106
+ * on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
107
+ * credential it issued must be confirmed by. The 200 carries both beside the
108
+ * sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
109
+ * account in (the account's budget) carries `redemptionWindow` beside its
110
+ * `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
111
+ * neither: it stays the one identical 401.
112
+ */
113
+ export declare const devicePlatformWindowsSchema: z.ZodObject<{
114
+ redemptionWindow: z.ZodObject<{
115
+ expiresAt: z.ZodString;
116
+ expiresInSeconds: z.ZodNumber;
117
+ }, z.core.$strict>;
118
+ confirmWindow: z.ZodOptional<z.ZodObject<{
119
+ expiresAt: z.ZodString;
120
+ expiresInSeconds: z.ZodNumber;
121
+ }, z.core.$strict>>;
122
+ }, z.core.$strip>;
91
123
  /**
92
124
  * Which application the token is for, as the platform vouches for it:
93
125
  *
@@ -179,6 +211,8 @@ export type PlatformHost = (typeof PLATFORM_HOSTS)[number];
179
211
  export type DeviceAppTokenErrorCode = (typeof DEVICE_APP_TOKEN_ERROR_CODES)[number];
180
212
  export type PlatformClient = z.infer<typeof platformClientSchema>;
181
213
  export type DevicePlatformRequest = z.infer<typeof devicePlatformRequestSchema>;
214
+ export type RedemptionWindow = z.infer<typeof redemptionWindowSchema>;
215
+ export type DevicePlatformWindows = z.infer<typeof devicePlatformWindowsSchema>;
182
216
  export type DevicePlatformConfirmRequest = z.infer<typeof devicePlatformConfirmRequestSchema>;
183
217
  export type DevicePlatformConfirmResponse = z.infer<typeof devicePlatformConfirmResponseSchema>;
184
218
  export type DeviceAppTokenAttestation = z.infer<typeof deviceAppTokenAttestationSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.23.0",
3
+ "version": "6.24.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",