zinkee 0.1.7 → 0.1.9

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/README.md CHANGED
@@ -131,50 +131,75 @@ Simple field types use `--type`, `--slug`, `--label`:
131
131
 
132
132
  ```bash
133
133
  zinkee schemas fields create projects --type text --slug name --label "Name"
134
- zinkee schemas fields create projects --type number --slug budget --label "Budget"
134
+ zinkee schemas fields create projects --type number --slug budget --label "Budget" --required true --default 0
135
135
  zinkee schemas fields create projects --type date --slug start-date --label "Start Date"
136
136
  zinkee schemas fields create projects --type file --slug attachment --label "Attachment"
137
137
  zinkee schemas fields create projects --type autoincremental --slug code --label "Code"
138
138
  zinkee schemas fields create projects --type member --slug owner --label "Owner"
139
139
  ```
140
140
 
141
- Valid types: `text`, `number`, `date`, `file`, `autoincremental`, `member`, `option`, `reference`, `formula`.
141
+ Valid types: `text`, `number`, `date`, `file`, `autoincremental`, `member`, `option`, `reference`, `formula`, `schedule`.
142
142
 
143
- Complex types require `--raw`:
143
+ Complex types require `--raw`. The JSON `type` uses the backend ClassName (`TextField`, `OptionField`, …) and type-specific fields go inside `config`:
144
144
 
145
145
  ```bash
146
146
  # Option field
147
147
  zinkee schemas fields create projects --raw '{
148
- "type":"option","slug":"status","label":"Status",
149
- "options":[
150
- {"id":1,"name":"Open","color":"default"},
151
- {"id":2,"name":"In Progress","color":"primary"},
152
- {"id":3,"name":"Done","color":"success"}
153
- ]
148
+ "type":"OptionField","slug":"status","label":"Status",
149
+ "config":{
150
+ "options":[
151
+ {"id":1,"name":"Open","color":"default"},
152
+ {"id":2,"name":"In Progress","color":"primary"},
153
+ {"id":3,"name":"Done","color":"success"}
154
+ ]
155
+ }
154
156
  }'
155
157
 
156
158
  # Reference field (targetSchema and targetDisplayField must be UUIDs)
157
159
  zinkee schemas fields create tasks --raw '{
158
- "type":"reference","slug":"project","label":"Project",
159
- "targetSchema":"<schema-uuid>",
160
- "targetDisplayField":"<field-uuid>",
161
- "deleteBehavior":"SET_NULL"
160
+ "type":"ReferenceField","slug":"project","label":"Project",
161
+ "config":{
162
+ "targetSchema":"<schema-uuid>",
163
+ "targetDisplayField":"<field-uuid>",
164
+ "deleteBehavior":"SET_NULL"
165
+ }
162
166
  }'
163
167
 
164
168
  # Formula field (use formulaText, not expression)
165
169
  zinkee schemas fields create projects --raw '{
166
- "type":"formula","slug":"code","label":"Code",
167
- "formulaText":"concat(\"PRJ-\", <_id-field-uuid>)"
170
+ "type":"FormulaField","slug":"code","label":"Code",
171
+ "config":{
172
+ "formulaText":"concat(\"PRJ-\", <_id-field-uuid>)"
173
+ }
174
+ }'
175
+
176
+ # Schedule field (frequency: monthly | daily). Bound to one NumberField (referenceField)
177
+ # and two DateField UUIDs (beginning/ending). Cannot be required.
178
+ zinkee schemas fields create projects --raw '{
179
+ "type":"ScheduleField","slug":"recurrence","label":"Recurrence",
180
+ "config":{
181
+ "referenceField":"<number-field-uuid>",
182
+ "beginningPeriodField":"<date-field-uuid>",
183
+ "endingPeriodField":"<date-field-uuid>",
184
+ "frequency":"monthly"
185
+ }
168
186
  }'
169
187
  ```
170
188
 
171
189
  ### Update field config
172
190
 
173
- Config properties must be wrapped inside a `config` key:
191
+ Use `--default <value>` for the common default-value case:
192
+
193
+ ```bash
194
+ zinkee schemas fields update projects budget --default 0
195
+ ```
196
+
197
+ PATCH bodies are flat (no `set` / `unset` wrapper). Config properties must be wrapped inside a `config` key:
174
198
 
175
199
  ```bash
176
200
  # Number formatting
177
201
  zinkee schemas fields update projects budget --raw '{
202
+ "type":"NumberField",
178
203
  "config":{
179
204
  "defaultValue":"0",
180
205
  "formatOptions":{
@@ -186,11 +211,12 @@ zinkee schemas fields update projects budget --raw '{
186
211
 
187
212
  # Date formatting
188
213
  zinkee schemas fields update projects start-date --raw '{
214
+ "type":"DateField",
189
215
  "config":{"formatOptions":{"format":"date","dateFormat":"L","showTime":false}}
190
216
  }'
191
217
 
192
218
  # Text type (valid values: NORMAL, LONG)
193
- zinkee schemas fields update projects description --raw '{"config":{"textType":"LONG"}}'
219
+ zinkee schemas fields update projects description --raw '{"type":"TextField","config":{"textType":"LONG"}}'
194
220
  ```
195
221
 
196
222
  ### Formula syntax