@ramme-io/shared 4.1.0 → 4.2.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.
package/dist/index.cjs CHANGED
@@ -2402,11 +2402,12 @@ var ACCESS_REQUEST_TTL_SECONDS = 60 * 60 * 24 * 90;
2402
2402
 
2403
2403
  // src/auth/accessTokens.ts
2404
2404
  var import_zod18 = require("zod");
2405
- var ACCESS_TOKEN_SCOPES = ["boards:read", "boards:send"];
2405
+ var ACCESS_TOKEN_SCOPES = ["boards:read", "boards:send", "boards:configure"];
2406
2406
  var AccessTokenScopeSchema = import_zod18.z.enum(ACCESS_TOKEN_SCOPES);
2407
2407
  var ACCESS_TOKEN_SCOPE_LABELS = {
2408
2408
  "boards:read": "See my boards",
2409
- "boards:send": "Send apps to my boards"
2409
+ "boards:send": "Send apps to my boards",
2410
+ "boards:configure": "Change my boards\u2019 settings"
2410
2411
  };
2411
2412
  var ACCESS_TOKEN_PREFIX = "rmk_";
2412
2413
  var ACCESS_TOKEN_LIFETIMES_DAYS = [7, 30, 90, 365];
package/dist/index.d.cts CHANGED
@@ -54296,11 +54296,18 @@ declare const ACCESS_REQUEST_TTL_SECONDS: number;
54296
54296
  * What a token may do. Each route names the one it needs; a token without it
54297
54297
  * is refused, whatever else it can do.
54298
54298
  *
54299
- * boards:read list your boards and read each one's vitals and history
54300
- * boards:send send an app to one of your boards
54299
+ * boards:read list your boards and read each one's vitals and history
54300
+ * boards:send send an app to one of your boards
54301
+ * boards:configure rename a board, swap its light and dark, choose which of
54302
+ * its apps is on show and how often they rotate
54303
+ *
54304
+ * What no scope reaches, on purpose: claiming or releasing a board, and
54305
+ * installing firmware. Those stay with the owner on the board's page — new
54306
+ * firmware is new code on a device in somebody's house, and an agent may
54307
+ * suggest it but never press Install.
54301
54308
  */
54302
- declare const ACCESS_TOKEN_SCOPES: readonly ["boards:read", "boards:send"];
54303
- declare const AccessTokenScopeSchema: z.ZodEnum<["boards:read", "boards:send"]>;
54309
+ declare const ACCESS_TOKEN_SCOPES: readonly ["boards:read", "boards:send", "boards:configure"];
54310
+ declare const AccessTokenScopeSchema: z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>;
54304
54311
  /** What a scope is for, in the words the settings page uses. */
54305
54312
  declare const ACCESS_TOKEN_SCOPE_LABELS: Record<z.infer<typeof AccessTokenScopeSchema>, string>;
54306
54313
  /**
@@ -54321,7 +54328,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54321
54328
  accountId: z.ZodString;
54322
54329
  /** What the owner called it: "laptop", "Claude Code". */
54323
54330
  name: z.ZodString;
54324
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54331
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54325
54332
  createdAt: z.ZodNumber;
54326
54333
  expiresAt: z.ZodNumber;
54327
54334
  /** Moved forward at most once a day, so using a token is not a write per request. */
@@ -54332,7 +54339,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54332
54339
  accountId: string;
54333
54340
  expiresAt: number;
54334
54341
  tokenId: string;
54335
- scopes: ("boards:read" | "boards:send")[];
54342
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54336
54343
  lastUsedAt: number | null;
54337
54344
  }, {
54338
54345
  name: string;
@@ -54340,7 +54347,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54340
54347
  accountId: string;
54341
54348
  expiresAt: number;
54342
54349
  tokenId: string;
54343
- scopes: ("boards:read" | "boards:send")[];
54350
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54344
54351
  lastUsedAt?: number | null | undefined;
54345
54352
  }>;
54346
54353
  /** What the owner is shown about a token: never the token, never its hash. */
@@ -54350,7 +54357,7 @@ declare const PublicAccessTokenSchema: z.ZodObject<Omit<{
54350
54357
  accountId: z.ZodString;
54351
54358
  /** What the owner called it: "laptop", "Claude Code". */
54352
54359
  name: z.ZodString;
54353
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54360
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54354
54361
  createdAt: z.ZodNumber;
54355
54362
  expiresAt: z.ZodNumber;
54356
54363
  /** Moved forward at most once a day, so using a token is not a write per request. */
@@ -54360,28 +54367,28 @@ declare const PublicAccessTokenSchema: z.ZodObject<Omit<{
54360
54367
  createdAt: number;
54361
54368
  expiresAt: number;
54362
54369
  tokenId: string;
54363
- scopes: ("boards:read" | "boards:send")[];
54370
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54364
54371
  lastUsedAt: number | null;
54365
54372
  }, {
54366
54373
  name: string;
54367
54374
  createdAt: number;
54368
54375
  expiresAt: number;
54369
54376
  tokenId: string;
54370
- scopes: ("boards:read" | "boards:send")[];
54377
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54371
54378
  lastUsedAt?: number | null | undefined;
54372
54379
  }>;
54373
54380
  /** A request to make one. */
54374
54381
  declare const NewAccessTokenSchema: z.ZodObject<{
54375
54382
  name: z.ZodString;
54376
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54383
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54377
54384
  days: z.ZodUnion<[z.ZodLiteral<7>, z.ZodLiteral<30>, z.ZodLiteral<90>, z.ZodLiteral<365>]>;
54378
54385
  }, "strip", z.ZodTypeAny, {
54379
54386
  name: string;
54380
- scopes: ("boards:read" | "boards:send")[];
54387
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54381
54388
  days: 90 | 30 | 7 | 365;
54382
54389
  }, {
54383
54390
  name: string;
54384
- scopes: ("boards:read" | "boards:send")[];
54391
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54385
54392
  days: 90 | 30 | 7 | 365;
54386
54393
  }>;
54387
54394
  type AccessTokenScope = z.infer<typeof AccessTokenScopeSchema>;
package/dist/index.d.ts CHANGED
@@ -54296,11 +54296,18 @@ declare const ACCESS_REQUEST_TTL_SECONDS: number;
54296
54296
  * What a token may do. Each route names the one it needs; a token without it
54297
54297
  * is refused, whatever else it can do.
54298
54298
  *
54299
- * boards:read list your boards and read each one's vitals and history
54300
- * boards:send send an app to one of your boards
54299
+ * boards:read list your boards and read each one's vitals and history
54300
+ * boards:send send an app to one of your boards
54301
+ * boards:configure rename a board, swap its light and dark, choose which of
54302
+ * its apps is on show and how often they rotate
54303
+ *
54304
+ * What no scope reaches, on purpose: claiming or releasing a board, and
54305
+ * installing firmware. Those stay with the owner on the board's page — new
54306
+ * firmware is new code on a device in somebody's house, and an agent may
54307
+ * suggest it but never press Install.
54301
54308
  */
54302
- declare const ACCESS_TOKEN_SCOPES: readonly ["boards:read", "boards:send"];
54303
- declare const AccessTokenScopeSchema: z.ZodEnum<["boards:read", "boards:send"]>;
54309
+ declare const ACCESS_TOKEN_SCOPES: readonly ["boards:read", "boards:send", "boards:configure"];
54310
+ declare const AccessTokenScopeSchema: z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>;
54304
54311
  /** What a scope is for, in the words the settings page uses. */
54305
54312
  declare const ACCESS_TOKEN_SCOPE_LABELS: Record<z.infer<typeof AccessTokenScopeSchema>, string>;
54306
54313
  /**
@@ -54321,7 +54328,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54321
54328
  accountId: z.ZodString;
54322
54329
  /** What the owner called it: "laptop", "Claude Code". */
54323
54330
  name: z.ZodString;
54324
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54331
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54325
54332
  createdAt: z.ZodNumber;
54326
54333
  expiresAt: z.ZodNumber;
54327
54334
  /** Moved forward at most once a day, so using a token is not a write per request. */
@@ -54332,7 +54339,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54332
54339
  accountId: string;
54333
54340
  expiresAt: number;
54334
54341
  tokenId: string;
54335
- scopes: ("boards:read" | "boards:send")[];
54342
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54336
54343
  lastUsedAt: number | null;
54337
54344
  }, {
54338
54345
  name: string;
@@ -54340,7 +54347,7 @@ declare const AccessTokenRecordSchema: z.ZodObject<{
54340
54347
  accountId: string;
54341
54348
  expiresAt: number;
54342
54349
  tokenId: string;
54343
- scopes: ("boards:read" | "boards:send")[];
54350
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54344
54351
  lastUsedAt?: number | null | undefined;
54345
54352
  }>;
54346
54353
  /** What the owner is shown about a token: never the token, never its hash. */
@@ -54350,7 +54357,7 @@ declare const PublicAccessTokenSchema: z.ZodObject<Omit<{
54350
54357
  accountId: z.ZodString;
54351
54358
  /** What the owner called it: "laptop", "Claude Code". */
54352
54359
  name: z.ZodString;
54353
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54360
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54354
54361
  createdAt: z.ZodNumber;
54355
54362
  expiresAt: z.ZodNumber;
54356
54363
  /** Moved forward at most once a day, so using a token is not a write per request. */
@@ -54360,28 +54367,28 @@ declare const PublicAccessTokenSchema: z.ZodObject<Omit<{
54360
54367
  createdAt: number;
54361
54368
  expiresAt: number;
54362
54369
  tokenId: string;
54363
- scopes: ("boards:read" | "boards:send")[];
54370
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54364
54371
  lastUsedAt: number | null;
54365
54372
  }, {
54366
54373
  name: string;
54367
54374
  createdAt: number;
54368
54375
  expiresAt: number;
54369
54376
  tokenId: string;
54370
- scopes: ("boards:read" | "boards:send")[];
54377
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54371
54378
  lastUsedAt?: number | null | undefined;
54372
54379
  }>;
54373
54380
  /** A request to make one. */
54374
54381
  declare const NewAccessTokenSchema: z.ZodObject<{
54375
54382
  name: z.ZodString;
54376
- scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send"]>, "many">;
54383
+ scopes: z.ZodArray<z.ZodEnum<["boards:read", "boards:send", "boards:configure"]>, "many">;
54377
54384
  days: z.ZodUnion<[z.ZodLiteral<7>, z.ZodLiteral<30>, z.ZodLiteral<90>, z.ZodLiteral<365>]>;
54378
54385
  }, "strip", z.ZodTypeAny, {
54379
54386
  name: string;
54380
- scopes: ("boards:read" | "boards:send")[];
54387
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54381
54388
  days: 90 | 30 | 7 | 365;
54382
54389
  }, {
54383
54390
  name: string;
54384
- scopes: ("boards:read" | "boards:send")[];
54391
+ scopes: ("boards:read" | "boards:send" | "boards:configure")[];
54385
54392
  days: 90 | 30 | 7 | 365;
54386
54393
  }>;
54387
54394
  type AccessTokenScope = z.infer<typeof AccessTokenScopeSchema>;
package/dist/index.js CHANGED
@@ -2175,11 +2175,12 @@ var ACCESS_REQUEST_TTL_SECONDS = 60 * 60 * 24 * 90;
2175
2175
 
2176
2176
  // src/auth/accessTokens.ts
2177
2177
  import { z as z18 } from "zod";
2178
- var ACCESS_TOKEN_SCOPES = ["boards:read", "boards:send"];
2178
+ var ACCESS_TOKEN_SCOPES = ["boards:read", "boards:send", "boards:configure"];
2179
2179
  var AccessTokenScopeSchema = z18.enum(ACCESS_TOKEN_SCOPES);
2180
2180
  var ACCESS_TOKEN_SCOPE_LABELS = {
2181
2181
  "boards:read": "See my boards",
2182
- "boards:send": "Send apps to my boards"
2182
+ "boards:send": "Send apps to my boards",
2183
+ "boards:configure": "Change my boards\u2019 settings"
2183
2184
  };
2184
2185
  var ACCESS_TOKEN_PREFIX = "rmk_";
2185
2186
  var ACCESS_TOKEN_LIFETIMES_DAYS = [7, 30, 90, 365];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramme-io/shared",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",