@formo/cli 0.2.0 → 1.0.2
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 +154 -40
- package/dist/commands/alerts.d.ts +16 -3
- package/dist/commands/alerts.js +94 -24
- package/dist/commands/analytics.d.ts +25 -0
- package/dist/commands/analytics.js +153 -0
- package/dist/commands/boards.d.ts +11 -2
- package/dist/commands/boards.js +49 -17
- package/dist/commands/charts.d.ts +30 -3
- package/dist/commands/charts.js +297 -33
- package/dist/commands/contracts.d.ts +17 -13
- package/dist/commands/contracts.js +165 -53
- package/dist/commands/events.d.ts +9 -0
- package/dist/commands/events.js +64 -0
- package/dist/commands/import.d.ts +8 -4
- package/dist/commands/import.js +33 -11
- package/dist/commands/profiles.d.ts +35 -2
- package/dist/commands/profiles.js +260 -32
- package/dist/commands/query.js +5 -1
- package/dist/commands/segments.d.ts +6 -2
- package/dist/commands/segments.js +20 -6
- package/dist/index.js +15 -3
- package/dist/lib/client.d.ts +10 -1
- package/dist/lib/client.js +27 -4
- package/dist/lib/config.js +10 -0
- package/dist/lib/json.d.ts +5 -0
- package/dist/lib/json.js +54 -0
- package/dist/lib/sql.d.ts +31 -0
- package/dist/lib/sql.js +151 -0
- package/package.json +3 -3
package/dist/commands/charts.js
CHANGED
|
@@ -1,26 +1,134 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.charts = void 0;
|
|
4
|
+
exports.buildChartBody = buildChartBody;
|
|
4
5
|
exports.listChartsRun = listChartsRun;
|
|
6
|
+
exports.listChartSummariesRun = listChartSummariesRun;
|
|
5
7
|
exports.getChartRun = getChartRun;
|
|
8
|
+
exports.queryChartRun = queryChartRun;
|
|
6
9
|
exports.createChartRun = createChartRun;
|
|
7
10
|
exports.updateChartRun = updateChartRun;
|
|
11
|
+
exports.moveChartRun = moveChartRun;
|
|
12
|
+
exports.normalizeDuplicateChartResponse = normalizeDuplicateChartResponse;
|
|
13
|
+
exports.duplicateChartRun = duplicateChartRun;
|
|
14
|
+
exports.reorderChartsRun = reorderChartsRun;
|
|
8
15
|
exports.deleteChartRun = deleteChartRun;
|
|
9
16
|
const incur_1 = require("incur");
|
|
10
17
|
const client_1 = require("../lib/client");
|
|
18
|
+
const json_1 = require("../lib/json");
|
|
19
|
+
const sql_1 = require("../lib/sql");
|
|
11
20
|
exports.charts = incur_1.Cli.create('charts', {
|
|
12
|
-
description: 'Chart commands — create, list, update, and delete charts within boards',
|
|
21
|
+
description: 'Chart commands — create, list, query, move, duplicate, reorder, update, and delete charts within boards',
|
|
22
|
+
});
|
|
23
|
+
const chartTypeSchema = incur_1.z.enum([
|
|
24
|
+
'table',
|
|
25
|
+
'number',
|
|
26
|
+
'funnel',
|
|
27
|
+
'bar',
|
|
28
|
+
'line',
|
|
29
|
+
'area',
|
|
30
|
+
'pie',
|
|
31
|
+
'stacked',
|
|
32
|
+
'user_paths',
|
|
33
|
+
'retention',
|
|
34
|
+
]);
|
|
35
|
+
function buildPaginationParams(options = {}) {
|
|
36
|
+
const params = {};
|
|
37
|
+
if (options.page !== undefined)
|
|
38
|
+
params.page = options.page;
|
|
39
|
+
if (options.size !== undefined)
|
|
40
|
+
params.size = options.size;
|
|
41
|
+
return params;
|
|
42
|
+
}
|
|
43
|
+
function hasTypedChartFields(options) {
|
|
44
|
+
return [
|
|
45
|
+
options.query,
|
|
46
|
+
options.chartType,
|
|
47
|
+
options.title,
|
|
48
|
+
options.description,
|
|
49
|
+
options.xAxis,
|
|
50
|
+
options.yAxis,
|
|
51
|
+
options.groupBy,
|
|
52
|
+
options.steps,
|
|
53
|
+
options.settings,
|
|
54
|
+
].some((value) => value !== undefined);
|
|
55
|
+
}
|
|
56
|
+
function buildChartBody(options) {
|
|
57
|
+
let body = {};
|
|
58
|
+
if (options.body) {
|
|
59
|
+
body = (0, json_1.parseJsonObject)(options.body, '--body');
|
|
60
|
+
}
|
|
61
|
+
if (!options.body && !hasTypedChartFields(options)) {
|
|
62
|
+
throw new Error('Provide --body or chart fields such as --title, --chart-type, and --query');
|
|
63
|
+
}
|
|
64
|
+
if (options.query !== undefined) {
|
|
65
|
+
body.query = (0, sql_1.stripTrailingFormatClause)(options.query);
|
|
66
|
+
}
|
|
67
|
+
if (options.chartType !== undefined)
|
|
68
|
+
body.chart_type = options.chartType;
|
|
69
|
+
if (options.title !== undefined)
|
|
70
|
+
body.title = options.title;
|
|
71
|
+
if (options.description !== undefined)
|
|
72
|
+
body.description = options.description;
|
|
73
|
+
if (options.xAxis !== undefined)
|
|
74
|
+
body.x_axis = options.xAxis;
|
|
75
|
+
if (options.yAxis !== undefined) {
|
|
76
|
+
body.y_axis = (0, json_1.parseStringArray)(options.yAxis, '--y-axis');
|
|
77
|
+
}
|
|
78
|
+
if (options.groupBy !== undefined)
|
|
79
|
+
body.group_by = options.groupBy;
|
|
80
|
+
if (options.steps !== undefined) {
|
|
81
|
+
body.steps = (0, json_1.parseJsonArray)(options.steps, '--steps');
|
|
82
|
+
}
|
|
83
|
+
if (options.settings !== undefined) {
|
|
84
|
+
body.settings = (0, json_1.parseJsonObject)(options.settings, '--settings');
|
|
85
|
+
}
|
|
86
|
+
return body;
|
|
87
|
+
}
|
|
88
|
+
function coerceChartBody(input) {
|
|
89
|
+
return typeof input === 'string' ? buildChartBody({ body: input }) : buildChartBody(input);
|
|
90
|
+
}
|
|
91
|
+
const chartBodyOptions = incur_1.z.object({
|
|
92
|
+
body: incur_1.z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('Raw JSON chart body. Typed flags below override matching body keys.'),
|
|
96
|
+
query: incur_1.z
|
|
97
|
+
.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('SQL query powering table/number/bar/line/area/pie/stacked charts'),
|
|
100
|
+
chartType: chartTypeSchema.optional().describe('Chart type'),
|
|
101
|
+
title: incur_1.z.string().optional().describe('Chart title'),
|
|
102
|
+
description: incur_1.z.string().optional().describe('Optional chart description'),
|
|
103
|
+
xAxis: incur_1.z.string().optional().describe('Column used as the x axis'),
|
|
104
|
+
yAxis: incur_1.z
|
|
105
|
+
.string()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Comma-separated or JSON array of y-axis metric columns'),
|
|
108
|
+
groupBy: incur_1.z.string().optional().describe('Column used to group or stack series'),
|
|
109
|
+
steps: incur_1.z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('JSON array of funnel/user-path step objects'),
|
|
113
|
+
settings: incur_1.z
|
|
114
|
+
.string()
|
|
115
|
+
.optional()
|
|
116
|
+
.describe('JSON object of type-specific chart settings'),
|
|
13
117
|
});
|
|
14
118
|
// ── List charts for a board ──
|
|
15
|
-
function listChartsRun(boardId) {
|
|
119
|
+
function listChartsRun(boardId, options = {}) {
|
|
16
120
|
(0, client_1.requireApiKey)();
|
|
17
121
|
const client = (0, client_1.createClient)();
|
|
18
|
-
return client.get(`/v0/boards/${encodeURIComponent(boardId)}/charts
|
|
122
|
+
return client.get(`/v0/boards/${encodeURIComponent(boardId)}/charts/`, {
|
|
123
|
+
params: buildPaginationParams(options),
|
|
124
|
+
});
|
|
19
125
|
}
|
|
20
126
|
exports.charts.command('list', {
|
|
21
|
-
description: 'List all charts for a board',
|
|
127
|
+
description: 'List all charts for a board, including executed results',
|
|
22
128
|
options: incur_1.z.object({
|
|
23
129
|
boardId: incur_1.z.string().describe('Board ID to list charts from'),
|
|
130
|
+
page: incur_1.z.coerce.number().optional().describe('Page number (1-indexed, default 1)'),
|
|
131
|
+
size: incur_1.z.coerce.number().optional().describe('Page size (default 100, max 200)'),
|
|
24
132
|
}),
|
|
25
133
|
examples: [
|
|
26
134
|
{
|
|
@@ -30,7 +138,33 @@ exports.charts.command('list', {
|
|
|
30
138
|
],
|
|
31
139
|
hint: 'Requires boards:read scope on your API key.',
|
|
32
140
|
run({ options }) {
|
|
33
|
-
return listChartsRun(options.boardId);
|
|
141
|
+
return listChartsRun(options.boardId, options);
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
// ── List chart metadata for a board ──
|
|
145
|
+
function listChartSummariesRun(boardId, options = {}) {
|
|
146
|
+
(0, client_1.requireApiKey)();
|
|
147
|
+
const client = (0, client_1.createClient)();
|
|
148
|
+
return client.get(`/v0/boards/${encodeURIComponent(boardId)}/charts/meta`, {
|
|
149
|
+
params: buildPaginationParams(options),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
exports.charts.command('meta', {
|
|
153
|
+
description: 'List lightweight chart metadata for a board without query results',
|
|
154
|
+
options: incur_1.z.object({
|
|
155
|
+
boardId: incur_1.z.string().describe('Board ID to list chart metadata from'),
|
|
156
|
+
page: incur_1.z.coerce.number().optional().describe('Page number (1-indexed, default 1)'),
|
|
157
|
+
size: incur_1.z.coerce.number().optional().describe('Page size (default 100, max 200)'),
|
|
158
|
+
}),
|
|
159
|
+
examples: [
|
|
160
|
+
{
|
|
161
|
+
options: { boardId: 'board_abc123', size: 25 },
|
|
162
|
+
description: 'List chart summaries for a board',
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
hint: 'Requires boards:read scope on your API key.',
|
|
166
|
+
run({ options }) {
|
|
167
|
+
return listChartSummariesRun(options.boardId, options);
|
|
34
168
|
},
|
|
35
169
|
});
|
|
36
170
|
// ── Get a single chart ──
|
|
@@ -59,74 +193,204 @@ exports.charts.command('get', {
|
|
|
59
193
|
return getChartRun(options.boardId, args.chartId);
|
|
60
194
|
},
|
|
61
195
|
});
|
|
196
|
+
function queryChartRun(boardId, chartId, options) {
|
|
197
|
+
(0, client_1.requireApiKey)();
|
|
198
|
+
const client = (0, client_1.createClient)();
|
|
199
|
+
return client.get(`/v0/boards/${encodeURIComponent(boardId)}/charts/${encodeURIComponent(chartId)}/query`, { params: { dateFrom: options.dateFrom, dateTo: options.dateTo } });
|
|
200
|
+
}
|
|
201
|
+
exports.charts.command('query', {
|
|
202
|
+
description: 'Execute a saved chart query after substituting date variables',
|
|
203
|
+
args: incur_1.z.object({
|
|
204
|
+
chartId: incur_1.z.string().describe('Chart ID to query'),
|
|
205
|
+
}),
|
|
206
|
+
options: incur_1.z.object({
|
|
207
|
+
boardId: incur_1.z.string().describe('Board ID the chart belongs to'),
|
|
208
|
+
dateFrom: incur_1.z.string().describe('Date variable value for {{date_from}}, YYYY-MM-DD'),
|
|
209
|
+
dateTo: incur_1.z.string().describe('Date variable value for {{date_to}}, YYYY-MM-DD'),
|
|
210
|
+
}),
|
|
211
|
+
examples: [
|
|
212
|
+
{
|
|
213
|
+
args: { chartId: 'chart_abc123' },
|
|
214
|
+
options: {
|
|
215
|
+
boardId: 'board_abc123',
|
|
216
|
+
dateFrom: '2026-04-01',
|
|
217
|
+
dateTo: '2026-04-30',
|
|
218
|
+
},
|
|
219
|
+
description: 'Query a chart for April 2026',
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
hint: 'Requires boards:read scope and a chart query containing {{date_from}}/{{date_to}} variables.',
|
|
223
|
+
run({ args, options }) {
|
|
224
|
+
return queryChartRun(options.boardId, args.chartId, options);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
62
227
|
// ── Create a chart ──
|
|
63
|
-
function createChartRun(boardId,
|
|
228
|
+
function createChartRun(boardId, input) {
|
|
64
229
|
(0, client_1.requireApiKey)();
|
|
65
230
|
const client = (0, client_1.createClient)();
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
parsed = JSON.parse(body);
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
throw new Error('--body must be valid JSON');
|
|
72
|
-
}
|
|
73
|
-
return client.post(`/v0/boards/${encodeURIComponent(boardId)}/charts/`, parsed);
|
|
231
|
+
return client.post(`/v0/boards/${encodeURIComponent(boardId)}/charts/`, coerceChartBody(input));
|
|
74
232
|
}
|
|
75
233
|
exports.charts.command('create', {
|
|
76
234
|
description: 'Create a new chart in a board',
|
|
77
|
-
options:
|
|
235
|
+
options: chartBodyOptions.extend({
|
|
78
236
|
boardId: incur_1.z.string().describe('Board ID to add the chart to'),
|
|
79
|
-
body: incur_1.z.string().describe('JSON string with chart configuration'),
|
|
80
237
|
}),
|
|
81
238
|
examples: [
|
|
82
239
|
{
|
|
83
240
|
options: {
|
|
84
241
|
boardId: 'board_abc123',
|
|
85
|
-
|
|
242
|
+
title: 'Daily active users',
|
|
243
|
+
chartType: 'line',
|
|
244
|
+
query: 'SELECT toDate(timestamp) AS date, countDistinct(address) AS users FROM events GROUP BY date ORDER BY date',
|
|
245
|
+
xAxis: 'date',
|
|
246
|
+
yAxis: 'users',
|
|
86
247
|
},
|
|
87
|
-
description: 'Create a line chart',
|
|
248
|
+
description: 'Create a line chart from typed flags',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
options: {
|
|
252
|
+
boardId: 'board_abc123',
|
|
253
|
+
body: '{"title":"Onboarding Funnel","chart_type":"funnel","query":"SELECT 1","steps":[{"type":"event","event":"page"},{"type":"event","event":"connect"}]}',
|
|
254
|
+
},
|
|
255
|
+
description: 'Create a chart from raw JSON',
|
|
88
256
|
},
|
|
89
257
|
],
|
|
90
258
|
hint: 'Requires boards:write scope on your API key.',
|
|
91
259
|
run({ options }) {
|
|
92
|
-
return createChartRun(options.boardId, options
|
|
260
|
+
return createChartRun(options.boardId, options);
|
|
93
261
|
},
|
|
94
262
|
});
|
|
95
263
|
// ── Update a chart ──
|
|
96
|
-
function updateChartRun(boardId, chartId,
|
|
264
|
+
function updateChartRun(boardId, chartId, input) {
|
|
97
265
|
(0, client_1.requireApiKey)();
|
|
98
266
|
const client = (0, client_1.createClient)();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
267
|
+
const updates = coerceChartBody(input);
|
|
268
|
+
return client
|
|
269
|
+
.get(`/v0/boards/${encodeURIComponent(boardId)}/charts/${encodeURIComponent(chartId)}`)
|
|
270
|
+
.then((current) => {
|
|
271
|
+
const existing = current && typeof current === 'object'
|
|
272
|
+
? current
|
|
273
|
+
: {};
|
|
274
|
+
const body = {
|
|
275
|
+
query: existing.query,
|
|
276
|
+
chart_type: existing.chart_type,
|
|
277
|
+
title: existing.title,
|
|
278
|
+
description: existing.description ?? undefined,
|
|
279
|
+
x_axis: existing.x_axis ?? undefined,
|
|
280
|
+
y_axis: existing.y_axis ?? undefined,
|
|
281
|
+
group_by: existing.group_by ?? undefined,
|
|
282
|
+
steps: existing.steps ?? undefined,
|
|
283
|
+
settings: existing.settings ?? undefined,
|
|
284
|
+
...updates,
|
|
285
|
+
};
|
|
286
|
+
return client.put(`/v0/boards/${encodeURIComponent(boardId)}/charts/${encodeURIComponent(chartId)}`, body);
|
|
287
|
+
});
|
|
107
288
|
}
|
|
108
289
|
exports.charts.command('update', {
|
|
109
290
|
description: 'Update an existing chart',
|
|
110
291
|
args: incur_1.z.object({
|
|
111
292
|
chartId: incur_1.z.string().describe('Chart ID to update'),
|
|
112
293
|
}),
|
|
113
|
-
options:
|
|
294
|
+
options: chartBodyOptions.extend({
|
|
114
295
|
boardId: incur_1.z.string().describe('Board ID the chart belongs to'),
|
|
115
|
-
body: incur_1.z.string().describe('JSON string with updated chart configuration'),
|
|
116
296
|
}),
|
|
117
297
|
examples: [
|
|
118
298
|
{
|
|
119
299
|
args: { chartId: 'chart_abc123' },
|
|
120
300
|
options: {
|
|
121
301
|
boardId: 'board_abc123',
|
|
122
|
-
|
|
302
|
+
title: 'Updated chart name',
|
|
123
303
|
},
|
|
124
|
-
description: 'Update a chart',
|
|
304
|
+
description: 'Update a chart title',
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
hint: 'Requires boards:write scope on your API key.',
|
|
308
|
+
run({ args, options }) {
|
|
309
|
+
return updateChartRun(options.boardId, args.chartId, options);
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
// ── Move a chart ──
|
|
313
|
+
function moveChartRun(boardId, chartId, targetBoardId) {
|
|
314
|
+
(0, client_1.requireApiKey)();
|
|
315
|
+
const client = (0, client_1.createClient)();
|
|
316
|
+
return client.put(`/v0/boards/${encodeURIComponent(boardId)}/charts/${encodeURIComponent(chartId)}/move`, { targetBoardId });
|
|
317
|
+
}
|
|
318
|
+
exports.charts.command('move', {
|
|
319
|
+
description: 'Move a chart to another board',
|
|
320
|
+
args: incur_1.z.object({
|
|
321
|
+
chartId: incur_1.z.string().describe('Chart ID to move'),
|
|
322
|
+
}),
|
|
323
|
+
options: incur_1.z.object({
|
|
324
|
+
boardId: incur_1.z.string().describe('Current board ID'),
|
|
325
|
+
targetBoardId: incur_1.z.string().describe('Destination board ID'),
|
|
326
|
+
}),
|
|
327
|
+
examples: [
|
|
328
|
+
{
|
|
329
|
+
args: { chartId: 'chart_abc123' },
|
|
330
|
+
options: { boardId: 'board_source', targetBoardId: 'board_target' },
|
|
331
|
+
description: 'Move a chart between boards',
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
hint: 'Requires boards:write scope on your API key.',
|
|
335
|
+
run({ args, options }) {
|
|
336
|
+
return moveChartRun(options.boardId, args.chartId, options.targetBoardId);
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
// ── Duplicate a chart ──
|
|
340
|
+
function normalizeDuplicateChartResponse(result) {
|
|
341
|
+
return typeof result === 'string' ? { id: result } : result;
|
|
342
|
+
}
|
|
343
|
+
function duplicateChartRun(boardId, chartId) {
|
|
344
|
+
(0, client_1.requireApiKey)();
|
|
345
|
+
const client = (0, client_1.createClient)();
|
|
346
|
+
return client.post(`/v0/boards/${encodeURIComponent(boardId)}/charts/${encodeURIComponent(chartId)}/duplicate`).then(normalizeDuplicateChartResponse);
|
|
347
|
+
}
|
|
348
|
+
exports.charts.command('duplicate', {
|
|
349
|
+
description: 'Duplicate a chart within its board',
|
|
350
|
+
args: incur_1.z.object({
|
|
351
|
+
chartId: incur_1.z.string().describe('Chart ID to duplicate'),
|
|
352
|
+
}),
|
|
353
|
+
options: incur_1.z.object({
|
|
354
|
+
boardId: incur_1.z.string().describe('Board ID the chart belongs to'),
|
|
355
|
+
}),
|
|
356
|
+
examples: [
|
|
357
|
+
{
|
|
358
|
+
args: { chartId: 'chart_abc123' },
|
|
359
|
+
options: { boardId: 'board_abc123' },
|
|
360
|
+
description: 'Duplicate a chart',
|
|
125
361
|
},
|
|
126
362
|
],
|
|
127
363
|
hint: 'Requires boards:write scope on your API key.',
|
|
128
364
|
run({ args, options }) {
|
|
129
|
-
return
|
|
365
|
+
return duplicateChartRun(options.boardId, args.chartId);
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
// ── Reorder charts ──
|
|
369
|
+
function reorderChartsRun(boardId, chartIds) {
|
|
370
|
+
(0, client_1.requireApiKey)();
|
|
371
|
+
const client = (0, client_1.createClient)();
|
|
372
|
+
return client.put(`/v0/boards/${encodeURIComponent(boardId)}/charts/reorder`, { chartIds: (0, json_1.parseStringArray)(chartIds, '--chart-ids') });
|
|
373
|
+
}
|
|
374
|
+
exports.charts.command('reorder', {
|
|
375
|
+
description: 'Reorder charts in a board',
|
|
376
|
+
options: incur_1.z.object({
|
|
377
|
+
boardId: incur_1.z.string().describe('Board ID whose charts should be reordered'),
|
|
378
|
+
chartIds: incur_1.z
|
|
379
|
+
.string()
|
|
380
|
+
.describe('Chart IDs in desired order, as comma-separated text or JSON array'),
|
|
381
|
+
}),
|
|
382
|
+
examples: [
|
|
383
|
+
{
|
|
384
|
+
options: {
|
|
385
|
+
boardId: 'board_abc123',
|
|
386
|
+
chartIds: 'chart_a,chart_b,chart_c',
|
|
387
|
+
},
|
|
388
|
+
description: 'Reorder charts using comma-separated IDs',
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
hint: 'Requires boards:write scope on your API key.',
|
|
392
|
+
run({ options }) {
|
|
393
|
+
return reorderChartsRun(options.boardId, options.chartIds);
|
|
130
394
|
},
|
|
131
395
|
});
|
|
132
396
|
// ── Delete a chart ──
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { Cli } from 'incur';
|
|
2
2
|
export declare const contracts: Cli.Cli<{}, undefined, undefined>;
|
|
3
|
-
export
|
|
3
|
+
export interface PaginationOptions {
|
|
4
|
+
page?: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function listContractsRun(options?: PaginationOptions): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
8
|
+
export declare function getContractRun(chain: string, address: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
9
|
+
export declare function getContractRecommendationsRun(): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
4
10
|
export interface CreateContractOptions {
|
|
5
11
|
address: string;
|
|
6
12
|
chain: number;
|
|
7
13
|
name: string;
|
|
8
14
|
abi: string;
|
|
9
15
|
events: string;
|
|
16
|
+
startBlock?: number;
|
|
17
|
+
includeInPipeline?: boolean;
|
|
10
18
|
}
|
|
11
|
-
export declare function buildCreateContractBody(options: CreateContractOptions):
|
|
12
|
-
address: string;
|
|
13
|
-
chain: number;
|
|
14
|
-
name: string;
|
|
15
|
-
abi: unknown;
|
|
16
|
-
events: unknown;
|
|
17
|
-
};
|
|
19
|
+
export declare function buildCreateContractBody(options: CreateContractOptions): Record<string, unknown>;
|
|
18
20
|
export declare function createContractRun(options: CreateContractOptions): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
19
21
|
export interface UpdateContractOptions {
|
|
20
22
|
name: string;
|
|
21
23
|
abi: string;
|
|
22
24
|
events: string;
|
|
25
|
+
startBlock?: number;
|
|
26
|
+
includeInPipeline?: boolean;
|
|
23
27
|
}
|
|
24
|
-
export declare function buildUpdateContractBody(options: UpdateContractOptions):
|
|
25
|
-
name: string;
|
|
26
|
-
abi: unknown;
|
|
27
|
-
events: unknown;
|
|
28
|
-
};
|
|
28
|
+
export declare function buildUpdateContractBody(chain: string | number, address: string, options: UpdateContractOptions): Record<string, unknown>;
|
|
29
29
|
export declare function updateContractRun(chain: string, address: string, options: UpdateContractOptions): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
30
|
+
export declare function updateContractPipelineRun(chain: string, address: string, includeInPipeline: boolean): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
31
|
+
export declare function buildUpdateContractPipelineBody(includeInPipeline: boolean): {
|
|
32
|
+
include_in_pipeline: boolean;
|
|
33
|
+
};
|
|
30
34
|
export declare function deleteContractRun(chain: string, address: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|