@purveyors/cli 0.1.0 → 0.3.0
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 +23 -23
- package/dist/commands/auth.js +4 -4
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/catalog.d.ts +5 -57
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +15 -82
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/inventory.d.ts +3 -26
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +53 -153
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/roast.d.ts +3 -42
- package/dist/commands/roast.d.ts.map +1 -1
- package/dist/commands/roast.js +144 -131
- package/dist/commands/roast.js.map +1 -1
- package/dist/commands/sales.d.ts +3 -11
- package/dist/commands/sales.d.ts.map +1 -1
- package/dist/commands/sales.js +35 -114
- package/dist/commands/sales.js.map +1 -1
- package/dist/commands/tasting.d.ts +5 -39
- package/dist/commands/tasting.d.ts.map +1 -1
- package/dist/commands/tasting.js +21 -111
- package/dist/commands/tasting.js.map +1 -1
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/lib/artisan/db.d.ts +37 -0
- package/dist/lib/artisan/db.d.ts.map +1 -0
- package/dist/lib/artisan/db.js +51 -0
- package/dist/lib/artisan/db.js.map +1 -0
- package/dist/lib/artisan/import.d.ts +16 -0
- package/dist/lib/artisan/import.d.ts.map +1 -0
- package/dist/lib/artisan/import.js +447 -0
- package/dist/lib/artisan/import.js.map +1 -0
- package/dist/lib/artisan/index.d.ts +9 -0
- package/dist/lib/artisan/index.d.ts.map +1 -0
- package/dist/lib/artisan/index.js +7 -0
- package/dist/lib/artisan/index.js.map +1 -0
- package/dist/lib/artisan/parser.d.ts +19 -0
- package/dist/lib/artisan/parser.d.ts.map +1 -0
- package/dist/lib/artisan/parser.js +376 -0
- package/dist/lib/artisan/parser.js.map +1 -0
- package/dist/lib/artisan/temperature.d.ts +52 -0
- package/dist/lib/artisan/temperature.d.ts.map +1 -0
- package/dist/lib/artisan/temperature.js +101 -0
- package/dist/lib/artisan/temperature.js.map +1 -0
- package/dist/lib/artisan/types.d.ts +195 -0
- package/dist/lib/artisan/types.d.ts.map +1 -0
- package/dist/lib/artisan/types.js +35 -0
- package/dist/lib/artisan/types.js.map +1 -0
- package/dist/lib/artisan/validator.d.ts +14 -0
- package/dist/lib/artisan/validator.d.ts.map +1 -0
- package/dist/lib/artisan/validator.js +228 -0
- package/dist/lib/artisan/validator.js.map +1 -0
- package/dist/lib/catalog.d.ts +87 -0
- package/dist/lib/catalog.d.ts.map +1 -0
- package/dist/lib/catalog.js +111 -0
- package/dist/lib/catalog.js.map +1 -0
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +20 -2
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.js +2 -2
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/inventory.d.ts +80 -0
- package/dist/lib/inventory.d.ts.map +1 -0
- package/dist/lib/inventory.js +205 -0
- package/dist/lib/inventory.js.map +1 -0
- package/dist/lib/roast.d.ts +127 -0
- package/dist/lib/roast.d.ts.map +1 -0
- package/dist/lib/roast.js +284 -0
- package/dist/lib/roast.js.map +1 -0
- package/dist/lib/sales.d.ts +53 -0
- package/dist/lib/sales.d.ts.map +1 -0
- package/dist/lib/sales.js +155 -0
- package/dist/lib/sales.js.map +1 -0
- package/dist/lib/supabase.js +2 -2
- package/dist/lib/supabase.js.map +1 -1
- package/dist/lib/tasting.d.ts +76 -0
- package/dist/lib/tasting.d.ts.map +1 -0
- package/dist/lib/tasting.js +136 -0
- package/dist/lib/tasting.js.map +1 -0
- package/package.json +24 -13
|
@@ -3,25 +3,10 @@ import { createAuthenticatedClient } from '../lib/supabase.js';
|
|
|
3
3
|
import { outputData, info, success } from '../lib/output.js';
|
|
4
4
|
import { withErrorHandling, AuthError, PrvrsError } from '../lib/errors.js';
|
|
5
5
|
import { confirm, todayIso } from '../lib/prompts.js';
|
|
6
|
-
|
|
7
|
-
const LIST_SELECT = [
|
|
8
|
-
'id',
|
|
9
|
-
'rank',
|
|
10
|
-
'notes',
|
|
11
|
-
'cupping_notes',
|
|
12
|
-
'purchase_date',
|
|
13
|
-
'purchased_qty_lbs',
|
|
14
|
-
'bean_cost',
|
|
15
|
-
'tax_ship_cost',
|
|
16
|
-
'last_updated',
|
|
17
|
-
'user',
|
|
18
|
-
'catalog_id',
|
|
19
|
-
'stocked',
|
|
20
|
-
'coffee_catalog!catalog_id (id, name, source, country, region, processing, cost_lb, description_short, stocked)',
|
|
21
|
-
].join(', ');
|
|
6
|
+
import { listInventory, getInventory, addInventory, updateInventory, deleteInventory, } from '../lib/inventory.js';
|
|
22
7
|
// ─── Command builder ──────────────────────────────────────────────────────────
|
|
23
8
|
/**
|
|
24
|
-
* `
|
|
9
|
+
* `purvey inventory` — Manage your green coffee inventory.
|
|
25
10
|
* Requires authentication.
|
|
26
11
|
*/
|
|
27
12
|
export function buildInventoryCommand() {
|
|
@@ -37,19 +22,13 @@ export function buildInventoryCommand() {
|
|
|
37
22
|
const supabase = await createAuthenticatedClient();
|
|
38
23
|
const { data: { user }, } = await supabase.auth.getUser();
|
|
39
24
|
if (!user) {
|
|
40
|
-
throw new AuthError('Not logged in. Run `
|
|
25
|
+
throw new AuthError('Not logged in. Run `purvey auth login` first.');
|
|
41
26
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const { data, error } = await query
|
|
48
|
-
.order('last_updated', { ascending: false })
|
|
49
|
-
.limit(limit);
|
|
50
|
-
if (error)
|
|
51
|
-
throw error;
|
|
52
|
-
if (!data || data.length === 0) {
|
|
27
|
+
const data = await listInventory(supabase, user.id, {
|
|
28
|
+
stocked: opts.stocked ? true : undefined,
|
|
29
|
+
limit: Math.max(1, parseInt(opts.limit, 10)),
|
|
30
|
+
});
|
|
31
|
+
if (data.length === 0) {
|
|
53
32
|
info('No inventory items found.');
|
|
54
33
|
return;
|
|
55
34
|
}
|
|
@@ -64,35 +43,9 @@ export function buildInventoryCommand() {
|
|
|
64
43
|
const supabase = await createAuthenticatedClient();
|
|
65
44
|
const { data: { user }, } = await supabase.auth.getUser();
|
|
66
45
|
if (!user) {
|
|
67
|
-
throw new AuthError('Not logged in. Run `
|
|
68
|
-
}
|
|
69
|
-
const selectColumns = [
|
|
70
|
-
'id',
|
|
71
|
-
'rank',
|
|
72
|
-
'notes',
|
|
73
|
-
'cupping_notes',
|
|
74
|
-
'purchase_date',
|
|
75
|
-
'purchased_qty_lbs',
|
|
76
|
-
'bean_cost',
|
|
77
|
-
'tax_ship_cost',
|
|
78
|
-
'last_updated',
|
|
79
|
-
'user',
|
|
80
|
-
'catalog_id',
|
|
81
|
-
'stocked',
|
|
82
|
-
'coffee_catalog!catalog_id (id, name, source, country, region, processing, cost_lb, description_short, description_long, farm_notes, cupping_notes, stocked)',
|
|
83
|
-
].join(', ');
|
|
84
|
-
const { data, error } = await supabase
|
|
85
|
-
.from('green_coffee_inv')
|
|
86
|
-
.select(selectColumns)
|
|
87
|
-
.eq('id', parseInt(id, 10))
|
|
88
|
-
.eq('user', user.id)
|
|
89
|
-
.single();
|
|
90
|
-
if (error) {
|
|
91
|
-
if (error.code === 'PGRST116') {
|
|
92
|
-
throw new AuthError(`Inventory item ${id} not found or does not belong to you.`);
|
|
93
|
-
}
|
|
94
|
-
throw error;
|
|
46
|
+
throw new AuthError('Not logged in. Run `purvey auth login` first.');
|
|
95
47
|
}
|
|
48
|
+
const data = await getInventory(supabase, user.id, parseInt(id, 10));
|
|
96
49
|
outputData(data, globalOpts);
|
|
97
50
|
}));
|
|
98
51
|
// ── inventory add ─────────────────────────────────────────────────────────
|
|
@@ -110,7 +63,7 @@ export function buildInventoryCommand() {
|
|
|
110
63
|
const supabase = await createAuthenticatedClient();
|
|
111
64
|
const { data: { user }, } = await supabase.auth.getUser();
|
|
112
65
|
if (!user) {
|
|
113
|
-
throw new AuthError('Not logged in. Run `
|
|
66
|
+
throw new AuthError('Not logged in. Run `purvey auth login` first.');
|
|
114
67
|
}
|
|
115
68
|
const catalogId = parseInt(opts.catalogId, 10);
|
|
116
69
|
if (isNaN(catalogId)) {
|
|
@@ -120,43 +73,23 @@ export function buildInventoryCommand() {
|
|
|
120
73
|
if (isNaN(qty) || qty <= 0) {
|
|
121
74
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --qty: "${opts.qty}". Must be a positive number.`);
|
|
122
75
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
if (opts.notes !== undefined) {
|
|
142
|
-
insertPayload.notes = opts.notes;
|
|
143
|
-
}
|
|
144
|
-
const { data: inserted, error: insertError } = await supabase
|
|
145
|
-
.from('green_coffee_inv')
|
|
146
|
-
.insert(insertPayload)
|
|
147
|
-
.select('id')
|
|
148
|
-
.single();
|
|
149
|
-
if (insertError)
|
|
150
|
-
throw insertError;
|
|
151
|
-
// Re-fetch the full row with catalog join
|
|
152
|
-
const { data, error } = await supabase
|
|
153
|
-
.from('green_coffee_inv')
|
|
154
|
-
.select(LIST_SELECT)
|
|
155
|
-
.eq('id', inserted.id)
|
|
156
|
-
.single();
|
|
157
|
-
if (error)
|
|
158
|
-
throw error;
|
|
159
|
-
success(`Inventory item ${inserted.id} created.`);
|
|
76
|
+
const cost = opts.cost !== undefined ? parseFloat(opts.cost) : undefined;
|
|
77
|
+
if (cost !== undefined && isNaN(cost)) {
|
|
78
|
+
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --cost: "${opts.cost}".`);
|
|
79
|
+
}
|
|
80
|
+
const taxShip = opts.taxShip !== undefined ? parseFloat(opts.taxShip) : undefined;
|
|
81
|
+
if (taxShip !== undefined && isNaN(taxShip)) {
|
|
82
|
+
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --tax-ship: "${opts.taxShip}".`);
|
|
83
|
+
}
|
|
84
|
+
const data = await addInventory(supabase, user.id, {
|
|
85
|
+
catalogId,
|
|
86
|
+
qty,
|
|
87
|
+
cost,
|
|
88
|
+
taxShip,
|
|
89
|
+
notes: opts.notes,
|
|
90
|
+
purchaseDate: opts.purchaseDate ?? todayIso(),
|
|
91
|
+
});
|
|
92
|
+
success(`Inventory item ${data.id} created.`);
|
|
160
93
|
outputData(data, globalOpts);
|
|
161
94
|
}));
|
|
162
95
|
// ── inventory update <id> ─────────────────────────────────────────────────
|
|
@@ -173,70 +106,53 @@ export function buildInventoryCommand() {
|
|
|
173
106
|
const supabase = await createAuthenticatedClient();
|
|
174
107
|
const { data: { user }, } = await supabase.auth.getUser();
|
|
175
108
|
if (!user) {
|
|
176
|
-
throw new AuthError('Not logged in. Run `
|
|
109
|
+
throw new AuthError('Not logged in. Run `purvey auth login` first.');
|
|
177
110
|
}
|
|
178
111
|
const itemId = parseInt(id, 10);
|
|
179
112
|
if (isNaN(itemId)) {
|
|
180
113
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid inventory ID: "${id}".`);
|
|
181
114
|
}
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
.from('green_coffee_inv')
|
|
185
|
-
.select('id')
|
|
186
|
-
.eq('id', itemId)
|
|
187
|
-
.eq('user', user.id)
|
|
188
|
-
.single();
|
|
189
|
-
if (fetchError || !existing) {
|
|
190
|
-
throw new AuthError(`Inventory item ${id} not found or does not belong to you.`);
|
|
191
|
-
}
|
|
192
|
-
// Build partial update — only include fields that were explicitly passed
|
|
193
|
-
const updates = {};
|
|
115
|
+
// Parse CLI strings into typed values
|
|
116
|
+
let qty;
|
|
194
117
|
if (opts.qty !== undefined) {
|
|
195
|
-
|
|
118
|
+
qty = parseFloat(opts.qty);
|
|
196
119
|
if (isNaN(qty) || qty <= 0)
|
|
197
120
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --qty: "${opts.qty}".`);
|
|
198
|
-
updates.purchased_qty_lbs = qty;
|
|
199
121
|
}
|
|
122
|
+
let cost;
|
|
200
123
|
if (opts.cost !== undefined) {
|
|
201
|
-
|
|
124
|
+
cost = parseFloat(opts.cost);
|
|
202
125
|
if (isNaN(cost))
|
|
203
126
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --cost: "${opts.cost}".`);
|
|
204
|
-
updates.bean_cost = cost;
|
|
205
127
|
}
|
|
128
|
+
let taxShip;
|
|
206
129
|
if (opts.taxShip !== undefined) {
|
|
207
|
-
|
|
130
|
+
taxShip = parseFloat(opts.taxShip);
|
|
208
131
|
if (isNaN(taxShip))
|
|
209
132
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --tax-ship: "${opts.taxShip}".`);
|
|
210
|
-
updates.tax_ship_cost = taxShip;
|
|
211
|
-
}
|
|
212
|
-
if (opts.notes !== undefined) {
|
|
213
|
-
updates.notes = opts.notes;
|
|
214
133
|
}
|
|
134
|
+
let stocked;
|
|
215
135
|
if (opts.stocked !== undefined) {
|
|
216
136
|
const stockedStr = opts.stocked.toLowerCase();
|
|
217
137
|
if (stockedStr !== 'true' && stockedStr !== 'false') {
|
|
218
138
|
throw new PrvrsError('INVALID_ARGUMENT', `--stocked must be "true" or "false".`);
|
|
219
139
|
}
|
|
220
|
-
|
|
140
|
+
stocked = stockedStr === 'true';
|
|
221
141
|
}
|
|
222
|
-
if (
|
|
142
|
+
if (qty === undefined &&
|
|
143
|
+
cost === undefined &&
|
|
144
|
+
taxShip === undefined &&
|
|
145
|
+
opts.notes === undefined &&
|
|
146
|
+
stocked === undefined) {
|
|
223
147
|
throw new PrvrsError('INVALID_ARGUMENT', 'No update fields provided. Pass at least one of: --qty, --cost, --tax-ship, --notes, --stocked.');
|
|
224
148
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
// Re-fetch the updated row
|
|
233
|
-
const { data, error } = await supabase
|
|
234
|
-
.from('green_coffee_inv')
|
|
235
|
-
.select(LIST_SELECT)
|
|
236
|
-
.eq('id', itemId)
|
|
237
|
-
.single();
|
|
238
|
-
if (error)
|
|
239
|
-
throw error;
|
|
149
|
+
const data = await updateInventory(supabase, user.id, itemId, {
|
|
150
|
+
qty,
|
|
151
|
+
cost,
|
|
152
|
+
taxShip,
|
|
153
|
+
notes: opts.notes,
|
|
154
|
+
stocked,
|
|
155
|
+
});
|
|
240
156
|
success(`Inventory item ${itemId} updated.`);
|
|
241
157
|
outputData(data, globalOpts);
|
|
242
158
|
}));
|
|
@@ -246,26 +162,16 @@ export function buildInventoryCommand() {
|
|
|
246
162
|
.description('Delete an inventory item (must be yours)')
|
|
247
163
|
.option('-y, --yes', 'Skip confirmation prompt')
|
|
248
164
|
.action(withErrorHandling(async (id, opts, cmd) => {
|
|
249
|
-
void cmd;
|
|
165
|
+
void cmd;
|
|
250
166
|
const supabase = await createAuthenticatedClient();
|
|
251
167
|
const { data: { user }, } = await supabase.auth.getUser();
|
|
252
168
|
if (!user) {
|
|
253
|
-
throw new AuthError('Not logged in. Run `
|
|
169
|
+
throw new AuthError('Not logged in. Run `purvey auth login` first.');
|
|
254
170
|
}
|
|
255
171
|
const itemId = parseInt(id, 10);
|
|
256
172
|
if (isNaN(itemId)) {
|
|
257
173
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid inventory ID: "${id}".`);
|
|
258
174
|
}
|
|
259
|
-
// Verify ownership
|
|
260
|
-
const { data: existing, error: fetchError } = await supabase
|
|
261
|
-
.from('green_coffee_inv')
|
|
262
|
-
.select('id, catalog_id')
|
|
263
|
-
.eq('id', itemId)
|
|
264
|
-
.eq('user', user.id)
|
|
265
|
-
.single();
|
|
266
|
-
if (fetchError || !existing) {
|
|
267
|
-
throw new AuthError(`Inventory item ${id} not found or does not belong to you.`);
|
|
268
|
-
}
|
|
269
175
|
if (!opts.yes) {
|
|
270
176
|
const ok = await confirm(`Delete inventory item ${itemId}?`);
|
|
271
177
|
if (!ok) {
|
|
@@ -273,13 +179,7 @@ export function buildInventoryCommand() {
|
|
|
273
179
|
return;
|
|
274
180
|
}
|
|
275
181
|
}
|
|
276
|
-
|
|
277
|
-
.from('green_coffee_inv')
|
|
278
|
-
.delete()
|
|
279
|
-
.eq('id', itemId)
|
|
280
|
-
.eq('user', user.id);
|
|
281
|
-
if (deleteError)
|
|
282
|
-
throw deleteError;
|
|
182
|
+
await deleteInventory(supabase, user.id, itemId);
|
|
283
183
|
success(`Inventory item ${itemId} deleted.`);
|
|
284
184
|
}));
|
|
285
185
|
return inventory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/commands/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/commands/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE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AAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;QAEnD,MAAM,EACJ,IAAI,EAAE,EAAE,IAAI,EAAE,GACf,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAElC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClB,MAAM,IAAI,UAAU,CAAC,kBAAkB,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,yBAAyB,MAAM,GAAG,CAAC,CAAC;YAC7D,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,IAAI,CAAC,UAAU,CAAC,CAAC;gBACjB,OAAO;YACT,CAAC;QACH,CAAC;QAED,MAAM,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,kBAAkB,MAAM,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC,CACH,CAAC;IAEJ,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/commands/roast.d.ts
CHANGED
|
@@ -1,47 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
batch_name: string | null;
|
|
5
|
-
coffee_id: number | null;
|
|
6
|
-
coffee_name: string | null;
|
|
7
|
-
roast_date: string | null;
|
|
8
|
-
oz_in: number | null;
|
|
9
|
-
oz_out: number | null;
|
|
10
|
-
weight_loss_percent: number | null;
|
|
11
|
-
roast_notes: string | null;
|
|
12
|
-
user: string;
|
|
13
|
-
last_updated: string;
|
|
14
|
-
roaster_type: string | null;
|
|
15
|
-
roaster_size: string | null;
|
|
16
|
-
temperature_unit: string | null;
|
|
17
|
-
charge_time: number | null;
|
|
18
|
-
drop_time: number | null;
|
|
19
|
-
fc_start_time: number | null;
|
|
20
|
-
fc_end_time: number | null;
|
|
21
|
-
fc_start_temp: number | null;
|
|
22
|
-
drop_temp: number | null;
|
|
23
|
-
charge_temp: number | null;
|
|
24
|
-
dry_percent: number | null;
|
|
25
|
-
maillard_percent: number | null;
|
|
26
|
-
development_percent: number | null;
|
|
27
|
-
total_roast_time: number | null;
|
|
28
|
-
data_source: string | null;
|
|
29
|
-
roast_uuid: string | null;
|
|
30
|
-
}
|
|
31
|
-
export interface TemperatureEntry {
|
|
32
|
-
roast_id: number;
|
|
33
|
-
time_seconds: number;
|
|
34
|
-
bean_temp: number | null;
|
|
35
|
-
environmental_temp: number | null;
|
|
36
|
-
}
|
|
37
|
-
export interface RoastEventEntry {
|
|
38
|
-
roast_id: number;
|
|
39
|
-
time_seconds: number;
|
|
40
|
-
event_type: number | null;
|
|
41
|
-
event_value: string | null;
|
|
42
|
-
}
|
|
2
|
+
import type { RoastProfile, TemperatureEntry, RoastEventEntry } from '../lib/roast.js';
|
|
3
|
+
export type { RoastProfile, TemperatureEntry, RoastEventEntry };
|
|
43
4
|
/**
|
|
44
|
-
* `
|
|
5
|
+
* `purvey roast` — Browse and manage your roast profiles.
|
|
45
6
|
* Requires authentication.
|
|
46
7
|
*/
|
|
47
8
|
export declare function buildRoastCommand(): Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roast.d.ts","sourceRoot":"","sources":["../../src/commands/roast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"roast.d.ts","sourceRoot":"","sources":["../../src/commands/roast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AAIhE;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAiO3C"}
|