@camstack/types 1.2.331 → 1.2.333

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 (51) hide show
  1. package/dist/addon/base-addon.d.ts +32 -0
  2. package/dist/addon/secret-aware-context.d.ts +49 -6
  3. package/dist/addon/secret-settings-view.d.ts +23 -1
  4. package/dist/addon/secret-write-back.d.ts +40 -0
  5. package/dist/addon.js +5 -7
  6. package/dist/addon.mjs +5 -7
  7. package/dist/auth/app-callback.d.ts +28 -0
  8. package/dist/auth/sso-state.d.ts +16 -0
  9. package/dist/capabilities/addon-routes.cap.d.ts +3 -0
  10. package/dist/capabilities/addons.cap.d.ts +4 -4
  11. package/dist/capabilities/backup.cap.d.ts +101 -1
  12. package/dist/capabilities/broker.cap.d.ts +4 -4
  13. package/dist/capabilities/custom-model-registry.cap.d.ts +520 -0
  14. package/dist/capabilities/device-manager.cap.d.ts +4 -4
  15. package/dist/capabilities/hub-address.d.ts +2 -2
  16. package/dist/capabilities/index.d.ts +12 -6
  17. package/dist/capabilities/keychain-admin.cap.d.ts +83 -0
  18. package/dist/capabilities/login-method.cap.d.ts +5 -6
  19. package/dist/capabilities/notification-output.cap.d.ts +4 -4
  20. package/dist/capabilities/notification-rules.cap.d.ts +6 -6
  21. package/dist/capabilities/osd-manager.cap.d.ts +5 -5
  22. package/dist/capabilities/pipeline-analytics.cap.d.ts +39 -8
  23. package/dist/capabilities/recording.cap.d.ts +3 -3
  24. package/dist/capabilities/server-management.cap.d.ts +5 -5
  25. package/dist/capabilities/snapshot.cap.d.ts +2 -2
  26. package/dist/capabilities/sso-bridge.cap.d.ts +5 -2
  27. package/dist/capabilities/training-provider.cap.d.ts +373 -0
  28. package/dist/capabilities/training.cap.d.ts +1896 -0
  29. package/dist/capabilities/user-management.cap.d.ts +1 -64
  30. package/dist/capabilities/videoclips.cap.d.ts +3 -3
  31. package/dist/client.js +26 -4
  32. package/dist/client.mjs +26 -4
  33. package/dist/generated/addon-api.d.ts +842 -173
  34. package/dist/generated/cap-input-defaults.d.ts +1 -1
  35. package/dist/generated/capability-router-map.d.ts +10 -4
  36. package/dist/generated/collection-array-methods.d.ts +1 -1
  37. package/dist/generated/method-access-map.d.ts +1 -1
  38. package/dist/generated/method-device-selectors.d.ts +2 -2
  39. package/dist/generated/system-proxy.d.ts +5 -3
  40. package/dist/index.d.ts +3 -0
  41. package/dist/index.js +1462 -93
  42. package/dist/index.mjs +1413 -92
  43. package/dist/interfaces/addon-routes.d.ts +7 -0
  44. package/dist/interfaces/addon.d.ts +8 -0
  45. package/dist/interfaces/auth.d.ts +6 -3
  46. package/dist/schemas/auth-records.d.ts +1 -2
  47. package/dist/{sleep-ClNXPpWR.js → sleep-DiQYrfm9.js} +425 -75
  48. package/dist/{sleep-DujUvOcb.mjs → sleep-r3RWkGVx.mjs} +425 -75
  49. package/dist/training/index.d.ts +1 -0
  50. package/dist/training/trainer-contract.d.ts +468 -0
  51. package/package.json +1 -1
@@ -39,11 +39,18 @@ export interface AddonHttpReply {
39
39
  /**
40
40
  * A single HTTP route registered by an addon.
41
41
  */
42
+ /**
43
+ * Per-client-IP limiting the HUB applies before a route's handler runs.
44
+ * `'auth'` — a public sign-in leg (an IdP start or callback): 30 per minute
45
+ * per client address. The address is the real client behind a trusted proxy.
46
+ */
47
+ export type RouteRateLimit = 'auth';
42
48
  export interface IAddonHttpRoute {
43
49
  readonly method: 'GET' | 'POST' | 'PUT' | 'DELETE';
44
50
  readonly path: string;
45
51
  readonly access: RouteAccess;
46
52
  readonly description?: string;
53
+ readonly rateLimit?: RouteRateLimit;
47
54
  readonly handler: (request: AddonHttpRequest, reply: AddonHttpReply) => Promise<void>;
48
55
  }
49
56
  /**
@@ -475,6 +475,14 @@ export interface AddonContext<TConfig = Record<string, unknown>> {
475
475
  * getDeviceSettings` on `ICamstackAddon`. There is no defaults
476
476
  * injection or cross-level merge at this layer.
477
477
  *
478
+ * KEYCHAIN (D798): the view a `BaseAddon` reaches as `this.ctx.settings`
479
+ * answers keychain VALUES on every read — `readAddonStore`,
480
+ * `readAddonStoreResult`, `readAddonStoreKeyResult`, `readDeviceStore`,
481
+ * `readDeviceStoreBatch` — never `{ $secret }` markers. A value the keychain
482
+ * cannot serve right now stays a marker ("stored, unavailable"), never `''`.
483
+ * Writing a resolved read back is a no-op for every unchanged secret.
484
+ * The marker-bearing blob is private to `BaseAddon`.
485
+ *
478
486
  * Cleanup note: the earlier `getGlobal / getDevice / updateGlobal /
479
487
  * updateDevice` trio (with a polymorphic `getGlobal({ section })`
480
488
  * overload) was removed after every caller migrated. The only
@@ -6,8 +6,12 @@ export interface UserPermissions {
6
6
  allowedDevices: Record<string, string[] | '*'>;
7
7
  }
8
8
  export interface TokenPayload {
9
- type?: 'api_key' | 'service';
10
- keyId?: string;
9
+ /**
10
+ * The server-side login session this token belongs to. Every session token
11
+ * minted since sessions exist carries one; the hub refuses the token once
12
+ * the session is revoked or expired. A token without it predates sessions.
13
+ */
14
+ sid?: string;
11
15
  userId?: string;
12
16
  username?: string;
13
17
  /**
@@ -16,7 +20,6 @@ export interface TokenPayload {
16
20
  * in v2.
17
21
  */
18
22
  isAdmin: boolean;
19
- agentId?: string;
20
23
  allowedProviders: string[] | '*';
21
24
  allowedDevices: Record<string, string[] | '*'>;
22
25
  /**
@@ -22,8 +22,7 @@ import { DeviceType } from '../device/device-type.js';
22
22
  * `super_admin` — collapsed onto the single boolean because every
23
23
  * non-admin caller is governed by the same scope-check rules; the
24
24
  * distinction was only ever used to route role-specific procedures
25
- * which we no longer have. Agents are admin sessions issued via
26
- * `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
25
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
27
26
  * with `isAdmin: false` + an explicit scope list.
28
27
  */
29
28
  /** Per-method access flavour. Materialised on every cap method via codegen. */