fireproof-storage / fireproof-storage/fireproof

Export default CSR subject fields from core-cli device-id-cmd

Open
#1,756 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
973
Forks
58
PR merge metrics
No merged PRs in 30d

Description

## Problem

The `deviceIdRegisterEvento` handler in `@fireproof/core-cli` accepts a `ReqDeviceIdRegister` with subject fields (`country`, `organization`, `locality`, `state`), but the default values for these fields are only defined inline in the cmd-ts option definitions in `cmds/device-id-cmd.js`:

```js
country: option({ defaultValue: () => "WD" }),
organization: option({ defaultValue: () => "You did not set the Organization" }),
locality: option({ defaultValue: () => "You did not set the City" }),
state: option({ defaultValue: () => "You did not set the State" }),
```

When calling `deviceIdRegisterEvento.handle()` directly (instead of shelling out to `core-cli deviceId register`), callers must duplicate these defaults. The server rejects empty strings — e.g. `country` must be >= 2 chars.

## Request

Export a `defaultCsrSubject` constant (or similar) from `@fireproof/core-cli` so direct callers can use it:

```ts
export const defaultCsrSubject = {
country: "WD",
organization: "You did not set the Organization",
locality: "You did not set the City",
state: "You did not set the State",
};
```

## Context

vibes.diy CLI switched from shelling out to `core-cli deviceId register` to calling `deviceIdRegisterEvento.handle()` directly (VibesDIY/vibes.diy#1313). Had to hardcode the defaults to avoid CSR validation errors.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.