@camstack/types 0.1.19 → 0.1.21

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.
@@ -7210,7 +7210,7 @@ const meshOrchestratorCapability = {
7210
7210
  )
7211
7211
  }
7212
7212
  };
7213
- const UserRoleSchema$1 = zod.z.enum(["super_admin", "admin", "viewer", "agent"]);
7213
+ const UserRoleSchema$1 = zod.z.enum(["super_admin", "admin", "viewer", "agent", "scoped"]);
7214
7214
  const UserSummarySchema = zod.z.object({
7215
7215
  id: zod.z.string(),
7216
7216
  username: zod.z.string(),
@@ -7263,11 +7263,17 @@ const ScopedTokenSummarySchema = zod.z.object({
7263
7263
  name: zod.z.string(),
7264
7264
  tokenPrefix: zod.z.string(),
7265
7265
  scopes: zod.z.array(TokenScopeSchema$1),
7266
- expiresAt: zod.z.number().optional(),
7267
- lastUsedAt: zod.z.number().optional(),
7266
+ // Mirror the storage schema: `.nullish()` accepts the SQLite-native
7267
+ // `null` for absent timestamps as well as in-memory `undefined`.
7268
+ expiresAt: zod.z.number().nullish(),
7269
+ lastUsedAt: zod.z.number().nullish(),
7268
7270
  createdAt: zod.z.number()
7269
7271
  });
7270
7272
  const CreateScopedTokenInputSchema = zod.z.object({
7273
+ // The owner the token is issued on behalf of. `adminProcedure` gates
7274
+ // this call so an admin can mint tokens for any user; the CLI passes
7275
+ // its own logged-in `user.id` here.
7276
+ userId: zod.z.string(),
7271
7277
  name: zod.z.string(),
7272
7278
  scopes: zod.z.array(TokenScopeSchema$1),
7273
7279
  expiresAt: zod.z.number().optional()
@@ -7772,14 +7778,16 @@ const addonsCapability = {
7772
7778
  // ── Listing ──────────────────────────────────────────────────────
7773
7779
  list: method(zod.z.void(), zod.z.array(AddonListItemSchema).readonly()),
7774
7780
  // ── Logs (query) ────────────────────────────────────────────────
7781
+ // Default auth (`protected`): authenticated users — including scoped
7782
+ // tokens with the right route-prefix scope. Reading logs isn't an
7783
+ // administrative action; install/restart/uninstall stay admin-only.
7775
7784
  getLogs: method(
7776
7785
  zod.z.object({
7777
7786
  addonId: zod.z.string(),
7778
7787
  limit: zod.z.number().min(1).max(500).default(100),
7779
7788
  level: LogLevelSchema.optional()
7780
7789
  }),
7781
- zod.z.array(LogQueryEntrySchema),
7782
- { auth: "admin" }
7790
+ zod.z.array(LogQueryEntrySchema)
7783
7791
  ),
7784
7792
  // ── Packages ────────────────────────────────────────────────────
7785
7793
  listPackages: method(zod.z.void(), zod.z.array(InstalledPackageSchema).readonly()),
@@ -7924,7 +7932,7 @@ const PIPELINE_OWNER_CAPABILITY_NAMES = [
7924
7932
  "pipeline-orchestrator",
7925
7933
  "pipeline-runner"
7926
7934
  ];
7927
- const UserRoleSchema = zod.z.enum(["super_admin", "admin", "viewer", "agent"]);
7935
+ const UserRoleSchema = zod.z.enum(["super_admin", "admin", "viewer", "agent", "scoped"]);
7928
7936
  const AllowedProviderSchema = zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]);
7929
7937
  const AllowedDevicesSchema = zod.z.record(zod.z.string(), zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]));
7930
7938
  const UserRecordSchema = zod.z.object({
@@ -8303,4 +8311,4 @@ exports.webrtcSessionCapability = webrtcSessionCapability;
8303
8311
  exports.zoneAnalyticsCapability = zoneAnalyticsCapability;
8304
8312
  exports.zoneRulesCapability = zoneRulesCapability;
8305
8313
  exports.zonesCapability = zonesCapability;
8306
- //# sourceMappingURL=auth-records-BsSRou-O.js.map
8314
+ //# sourceMappingURL=auth-records-BPN2YvK2.js.map