zinkee 0.1.7 → 0.1.8
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/.claude/settings.local.json +3 -1
- package/README.md +36 -16
- package/dist/index.js +975 -147
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/schemas.test.ts +93 -6
- package/src/index.test.ts +10 -5
- package/src/utils/examples.test.ts +44 -8
- package/src/utils/examples.ts +447 -66
- package/src/utils/schema-fields.ts +571 -86
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"Bash(npx tsc *)",
|
|
9
9
|
"Read(//home/guillermo/dev/z2-backend/api/src/main/java/com/zinkee/api/domain/model/v2/log/**)",
|
|
10
10
|
"Read(//home/guillermo/dev/z2-backend/**)",
|
|
11
|
-
"Bash(grep *)"
|
|
11
|
+
"Bash(grep *)",
|
|
12
|
+
"Bash(npx vitest *)",
|
|
13
|
+
"Bash(npx tsx *)"
|
|
12
14
|
]
|
|
13
15
|
}
|
|
14
16
|
}
|
package/README.md
CHANGED
|
@@ -138,43 +138,62 @@ zinkee schemas fields create projects --type autoincremental --slug code --label
|
|
|
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":"
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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":"
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
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":"
|
|
167
|
-
"
|
|
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
|
+
PATCH bodies are flat (no `set` / `unset` wrapper). Config properties must be wrapped inside a `config` key:
|
|
174
192
|
|
|
175
193
|
```bash
|
|
176
194
|
# Number formatting
|
|
177
195
|
zinkee schemas fields update projects budget --raw '{
|
|
196
|
+
"type":"NumberField",
|
|
178
197
|
"config":{
|
|
179
198
|
"defaultValue":"0",
|
|
180
199
|
"formatOptions":{
|
|
@@ -186,11 +205,12 @@ zinkee schemas fields update projects budget --raw '{
|
|
|
186
205
|
|
|
187
206
|
# Date formatting
|
|
188
207
|
zinkee schemas fields update projects start-date --raw '{
|
|
208
|
+
"type":"DateField",
|
|
189
209
|
"config":{"formatOptions":{"format":"date","dateFormat":"L","showTime":false}}
|
|
190
210
|
}'
|
|
191
211
|
|
|
192
212
|
# Text type (valid values: NORMAL, LONG)
|
|
193
|
-
zinkee schemas fields update projects description --raw '{"config":{"textType":"LONG"}}'
|
|
213
|
+
zinkee schemas fields update projects description --raw '{"type":"TextField","config":{"textType":"LONG"}}'
|
|
194
214
|
```
|
|
195
215
|
|
|
196
216
|
### Formula syntax
|