@camstack/types 0.1.30 → 0.1.32

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 (98) hide show
  1. package/dist/addon/build-addon-route-provider.d.ts +55 -0
  2. package/dist/addon/build-addon-route-provider.d.ts.map +1 -0
  3. package/dist/capabilities/addon-routes.cap.d.ts +64 -0
  4. package/dist/capabilities/addon-routes.cap.d.ts.map +1 -1
  5. package/dist/capabilities/admin-ui.cap.d.ts +6 -2
  6. package/dist/capabilities/admin-ui.cap.d.ts.map +1 -1
  7. package/dist/capabilities/advanced-notifier.cap.d.ts +202 -29
  8. package/dist/capabilities/advanced-notifier.cap.d.ts.map +1 -1
  9. package/dist/capabilities/audio-codec.cap.d.ts +2 -2
  10. package/dist/capabilities/auth-provider.cap.d.ts +4 -4
  11. package/dist/capabilities/auth-provider.cap.d.ts.map +1 -1
  12. package/dist/capabilities/authentication.cap.d.ts +4 -0
  13. package/dist/capabilities/authentication.cap.d.ts.map +1 -1
  14. package/dist/capabilities/capability-definition.d.ts +22 -0
  15. package/dist/capabilities/capability-definition.d.ts.map +1 -1
  16. package/dist/capabilities/device-export.cap.d.ts +77 -0
  17. package/dist/capabilities/device-export.cap.d.ts.map +1 -0
  18. package/dist/capabilities/embedding-encoder.cap.d.ts +14 -7
  19. package/dist/capabilities/embedding-encoder.cap.d.ts.map +1 -1
  20. package/dist/capabilities/index.d.ts +24 -5
  21. package/dist/capabilities/index.d.ts.map +1 -1
  22. package/dist/capabilities/intercom.cap.d.ts +34 -0
  23. package/dist/capabilities/intercom.cap.d.ts.map +1 -1
  24. package/dist/capabilities/mesh-network.cap.d.ts +32 -16
  25. package/dist/capabilities/mesh-network.cap.d.ts.map +1 -1
  26. package/dist/capabilities/mqtt-broker.cap.d.ts +153 -0
  27. package/dist/capabilities/mqtt-broker.cap.d.ts.map +1 -0
  28. package/dist/capabilities/network-access.cap.d.ts +41 -1
  29. package/dist/capabilities/network-access.cap.d.ts.map +1 -1
  30. package/dist/capabilities/platform-probe.cap.d.ts +234 -15
  31. package/dist/capabilities/platform-probe.cap.d.ts.map +1 -1
  32. package/dist/capabilities/settings-store.cap.d.ts +8 -2
  33. package/dist/capabilities/settings-store.cap.d.ts.map +1 -1
  34. package/dist/capabilities/smtp-provider.cap.d.ts +63 -0
  35. package/dist/capabilities/smtp-provider.cap.d.ts.map +1 -0
  36. package/dist/capabilities/sso-bridge.cap.d.ts +61 -0
  37. package/dist/capabilities/sso-bridge.cap.d.ts.map +1 -0
  38. package/dist/capabilities/stream-broker.cap.d.ts +90 -85
  39. package/dist/capabilities/stream-broker.cap.d.ts.map +1 -1
  40. package/dist/capabilities/user-management.cap.d.ts +513 -184
  41. package/dist/capabilities/user-management.cap.d.ts.map +1 -1
  42. package/dist/capabilities/user-passkeys.cap.d.ts +92 -0
  43. package/dist/capabilities/user-passkeys.cap.d.ts.map +1 -0
  44. package/dist/capabilities/webrtc-session.cap.d.ts +34 -0
  45. package/dist/capabilities/webrtc-session.cap.d.ts.map +1 -1
  46. package/dist/generated/addon-api.d.ts +11940 -9272
  47. package/dist/generated/addon-api.d.ts.map +1 -1
  48. package/dist/generated/cap-status-types.d.ts +5 -1
  49. package/dist/generated/cap-status-types.d.ts.map +1 -1
  50. package/dist/generated/capability-router-map.d.ts +19 -4
  51. package/dist/generated/capability-router-map.d.ts.map +1 -1
  52. package/dist/generated/device-proxy.d.ts +2 -0
  53. package/dist/generated/device-proxy.d.ts.map +1 -1
  54. package/dist/generated/method-access-map.d.ts +6 -1
  55. package/dist/generated/method-access-map.d.ts.map +1 -1
  56. package/dist/generated/provider-kind-map.d.ts +22 -0
  57. package/dist/generated/provider-kind-map.d.ts.map +1 -0
  58. package/dist/generated/scope-presets.d.ts +17 -0
  59. package/dist/generated/scope-presets.d.ts.map +1 -0
  60. package/dist/generated/system-proxy.d.ts +8 -4
  61. package/dist/generated/system-proxy.d.ts.map +1 -1
  62. package/dist/{index-DVKPWMwv.mjs → index-BBVUwOlZ.mjs} +1040 -500
  63. package/dist/index-BBVUwOlZ.mjs.map +1 -0
  64. package/dist/{index-s8uJNgNs.js → index-BUBhoPUu.js} +741 -201
  65. package/dist/index-BUBhoPUu.js.map +1 -0
  66. package/dist/index.d.ts +9 -3
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +852 -500
  69. package/dist/index.js.map +1 -1
  70. package/dist/index.mjs +1109 -757
  71. package/dist/index.mjs.map +1 -1
  72. package/dist/interfaces/addon-routes.d.ts +8 -2
  73. package/dist/interfaces/addon-routes.d.ts.map +1 -1
  74. package/dist/interfaces/addon.d.ts +14 -3
  75. package/dist/interfaces/addon.d.ts.map +1 -1
  76. package/dist/interfaces/advanced-notifier.d.ts +8 -7
  77. package/dist/interfaces/advanced-notifier.d.ts.map +1 -1
  78. package/dist/interfaces/api-responses.d.ts +2 -3
  79. package/dist/interfaces/api-responses.d.ts.map +1 -1
  80. package/dist/interfaces/auth.d.ts +14 -11
  81. package/dist/interfaces/auth.d.ts.map +1 -1
  82. package/dist/interfaces/capability.d.ts +6 -6
  83. package/dist/interfaces/capability.d.ts.map +1 -1
  84. package/dist/interfaces/embedding-encoder.d.ts +16 -7
  85. package/dist/interfaces/embedding-encoder.d.ts.map +1 -1
  86. package/dist/interfaces/rtp-egress.d.ts +45 -0
  87. package/dist/interfaces/rtp-egress.d.ts.map +1 -0
  88. package/dist/interfaces/storage.d.ts +15 -2
  89. package/dist/interfaces/storage.d.ts.map +1 -1
  90. package/dist/node.js +1 -1
  91. package/dist/node.mjs +1 -1
  92. package/dist/schemas/auth-records.d.ts +105 -50
  93. package/dist/schemas/auth-records.d.ts.map +1 -1
  94. package/package.json +1 -1
  95. package/dist/index-DVKPWMwv.mjs.map +0 -1
  96. package/dist/index-s8uJNgNs.js.map +0 -1
  97. package/dist/interfaces/auth-provider.d.ts +0 -39
  98. package/dist/interfaces/auth-provider.d.ts.map +0 -1
@@ -11,26 +11,20 @@
11
11
  */
12
12
  import { z } from 'zod';
13
13
  /**
14
- * Roles in the caps-only auth model.
14
+ * Auth model (v2 — 2026-05-12 caps-only):
15
15
  *
16
- * - `admin` — unrestricted; bypasses the scope check. The only escape
17
- * hatch. Replaces the retired `super_admin`.
18
- * - `viewer` — non-admin human; MUST have scopes (empty = no access).
19
- * - `agent` — agent-process credential; MUST have scopes for hub calls.
20
- * - `scoped` — synthetic role for `cst_*` token callers; no users-table
21
- * row; `userId` references the human who minted the token.
16
+ * Two principals:
17
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
18
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
22
19
  *
23
- * `super_admin` was removed when scope semantics collapsed into one
24
- * model (admin == owner of everything). The local-auth migration
25
- * silently rewrites `super_admin` rows to `admin` on first boot.
20
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
21
+ * `super_admin` collapsed onto the single boolean because every
22
+ * non-admin caller is governed by the same scope-check rules; the
23
+ * distinction was only ever used to route role-specific procedures
24
+ * which we no longer have. Agents are admin sessions issued via
25
+ * `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
26
+ * with `isAdmin: false` + an explicit scope list.
26
27
  */
27
- export declare const UserRoleSchema: z.ZodEnum<{
28
- admin: "admin";
29
- viewer: "viewer";
30
- agent: "agent";
31
- scoped: "scoped";
32
- }>;
33
- export type UserRole = z.infer<typeof UserRoleSchema>;
34
28
  /** Per-method access flavour. Materialised on every cap method via codegen. */
35
29
  export declare const MethodAccessSchema: z.ZodEnum<{
36
30
  view: "view";
@@ -38,49 +32,91 @@ export declare const MethodAccessSchema: z.ZodEnum<{
38
32
  delete: "delete";
39
33
  }>;
40
34
  export type MethodAccess = z.infer<typeof MethodAccessSchema>;
41
- /**
42
- * A single scope grant. `type` is `addon | capability` only — the
43
- * legacy `route-prefix` form is gone (every endpoint lives behind a cap,
44
- * by codegen contract). `access` is REQUIRED with min 1 element; "give
45
- * me everything" is expressed by the `admin` role, not a wildcard scope.
46
- */
47
- export declare const TokenScopeSchema: z.ZodObject<{
48
- type: z.ZodEnum<{
49
- addon: "addon";
50
- capability: "capability";
35
+ export declare const CapScopeSchema: z.ZodEnum<{
36
+ system: "system";
37
+ device: "device";
38
+ }>;
39
+ export type CapScope = z.infer<typeof CapScopeSchema>;
40
+ export declare const TokenScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
41
+ type: z.ZodLiteral<"category">;
42
+ target: z.ZodEnum<{
43
+ system: "system";
44
+ device: "device";
51
45
  }>;
46
+ access: z.ZodArray<z.ZodEnum<{
47
+ view: "view";
48
+ create: "create";
49
+ delete: "delete";
50
+ }>>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<"capability">;
52
53
  target: z.ZodString;
53
54
  access: z.ZodArray<z.ZodEnum<{
54
55
  view: "view";
55
56
  create: "create";
56
57
  delete: "delete";
57
58
  }>>;
58
- }, z.core.$strip>;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<"addon">;
61
+ target: z.ZodString;
62
+ access: z.ZodArray<z.ZodEnum<{
63
+ view: "view";
64
+ create: "create";
65
+ delete: "delete";
66
+ }>>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ type: z.ZodLiteral<"device">;
69
+ targets: z.ZodArray<z.ZodString>;
70
+ access: z.ZodArray<z.ZodEnum<{
71
+ view: "view";
72
+ create: "create";
73
+ delete: "delete";
74
+ }>>;
75
+ }, z.core.$strip>], "type">;
59
76
  export type TokenScope = z.infer<typeof TokenScopeSchema>;
60
77
  export declare const UserRecordSchema: z.ZodObject<{
61
78
  id: z.ZodString;
62
79
  username: z.ZodString;
63
80
  passwordHash: z.ZodString;
64
- role: z.ZodEnum<{
65
- admin: "admin";
66
- viewer: "viewer";
67
- agent: "agent";
68
- scoped: "scoped";
69
- }>;
81
+ isAdmin: z.ZodDefault<z.ZodBoolean>;
70
82
  allowedProviders: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
71
83
  allowedDevices: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
72
- scopes: z.ZodDefault<z.ZodArray<z.ZodObject<{
73
- type: z.ZodEnum<{
74
- addon: "addon";
75
- capability: "capability";
84
+ scopes: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
85
+ type: z.ZodLiteral<"category">;
86
+ target: z.ZodEnum<{
87
+ system: "system";
88
+ device: "device";
76
89
  }>;
90
+ access: z.ZodArray<z.ZodEnum<{
91
+ view: "view";
92
+ create: "create";
93
+ delete: "delete";
94
+ }>>;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ type: z.ZodLiteral<"capability">;
77
97
  target: z.ZodString;
78
98
  access: z.ZodArray<z.ZodEnum<{
79
99
  view: "view";
80
100
  create: "create";
81
101
  delete: "delete";
82
102
  }>>;
83
- }, z.core.$strip>>>;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ type: z.ZodLiteral<"addon">;
105
+ target: z.ZodString;
106
+ access: z.ZodArray<z.ZodEnum<{
107
+ view: "view";
108
+ create: "create";
109
+ delete: "delete";
110
+ }>>;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"device">;
113
+ targets: z.ZodArray<z.ZodString>;
114
+ access: z.ZodArray<z.ZodEnum<{
115
+ view: "view";
116
+ create: "create";
117
+ delete: "delete";
118
+ }>>;
119
+ }, z.core.$strip>], "type">>>;
84
120
  createdAt: z.ZodNumber;
85
121
  updatedAt: z.ZodNumber;
86
122
  }, z.core.$strip>;
@@ -88,12 +124,7 @@ export type UserRecord = z.infer<typeof UserRecordSchema>;
88
124
  export declare const ApiKeyRecordSchema: z.ZodObject<{
89
125
  id: z.ZodString;
90
126
  label: z.ZodString;
91
- role: z.ZodEnum<{
92
- admin: "admin";
93
- viewer: "viewer";
94
- agent: "agent";
95
- scoped: "scoped";
96
- }>;
127
+ isAdmin: z.ZodDefault<z.ZodBoolean>;
97
128
  allowedProviders: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
98
129
  allowedDevices: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
99
130
  tokenHash: z.ZodString;
@@ -108,18 +139,42 @@ export declare const ScopedTokenSchema: z.ZodObject<{
108
139
  name: z.ZodString;
109
140
  tokenHash: z.ZodString;
110
141
  tokenPrefix: z.ZodString;
111
- scopes: z.ZodArray<z.ZodObject<{
112
- type: z.ZodEnum<{
113
- addon: "addon";
114
- capability: "capability";
142
+ scopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
143
+ type: z.ZodLiteral<"category">;
144
+ target: z.ZodEnum<{
145
+ system: "system";
146
+ device: "device";
115
147
  }>;
148
+ access: z.ZodArray<z.ZodEnum<{
149
+ view: "view";
150
+ create: "create";
151
+ delete: "delete";
152
+ }>>;
153
+ }, z.core.$strip>, z.ZodObject<{
154
+ type: z.ZodLiteral<"capability">;
116
155
  target: z.ZodString;
117
156
  access: z.ZodArray<z.ZodEnum<{
118
157
  view: "view";
119
158
  create: "create";
120
159
  delete: "delete";
121
160
  }>>;
122
- }, z.core.$strip>>;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ type: z.ZodLiteral<"addon">;
163
+ target: z.ZodString;
164
+ access: z.ZodArray<z.ZodEnum<{
165
+ view: "view";
166
+ create: "create";
167
+ delete: "delete";
168
+ }>>;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ type: z.ZodLiteral<"device">;
171
+ targets: z.ZodArray<z.ZodString>;
172
+ access: z.ZodArray<z.ZodEnum<{
173
+ view: "view";
174
+ create: "create";
175
+ delete: "delete";
176
+ }>>;
177
+ }, z.core.$strip>], "type">>;
123
178
  expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
124
179
  lastUsedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
125
180
  createdAt: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-records.d.ts","sourceRoot":"","sources":["../../src/schemas/auth-records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;;;;;EAAiD,CAAA;AAC5E,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAKrD,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;EAAuC,CAAA;AACtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;iBAI3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAU7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAI7D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBAY5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"auth-records.d.ts","sourceRoot":"","sources":["../../src/schemas/auth-records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;;;;;;;;;;;;GAcG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;EAAuC,CAAA;AACtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AA0B7D,eAAO,MAAM,cAAc;;;EAA+B,CAAA;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2B3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoB3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAU7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAI7D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",