@constructive-sdk/cli 0.13.3 → 0.14.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/admin/cli/commands/{claimed-invite.d.ts → app-claimed-invite.d.ts} +1 -1
- package/admin/cli/commands/{claimed-invite.js → app-claimed-invite.js} +8 -8
- package/{esm/public/cli/commands/invite.d.ts → admin/cli/commands/app-invite.d.ts} +1 -1
- package/{public/cli/commands/invite.js → admin/cli/commands/app-invite.js} +8 -8
- package/admin/cli/commands/steps-achieved.js +4 -4
- package/admin/cli/commands/steps-required.js +4 -4
- package/admin/cli/commands/{submit-invite-code.d.ts → submit-app-invite-code.d.ts} +1 -1
- package/admin/cli/commands/{submit-invite-code.js → submit-app-invite-code.js} +3 -3
- package/admin/cli/commands.js +7 -7
- package/admin/cli/executor.d.ts +5 -5
- package/admin/orm/index.d.ts +7 -7
- package/admin/orm/index.js +4 -4
- package/admin/orm/input-types.d.ts +99 -99
- package/admin/orm/models/appClaimedInvite.d.ts +56 -0
- package/{public/orm/models/claimedInvite.js → admin/orm/models/appClaimedInvite.js} +26 -26
- package/admin/orm/models/appInvite.d.ts +56 -0
- package/{public/orm/models/invite.js → admin/orm/models/appInvite.js} +26 -26
- package/admin/orm/models/index.d.ts +2 -2
- package/admin/orm/models/index.js +5 -5
- package/admin/orm/mutation/index.d.ts +6 -6
- package/admin/orm/mutation/index.js +6 -6
- package/admin/orm/query/index.d.ts +4 -4
- package/admin/orm/query/index.js +4 -4
- package/auth/cli/commands.js +5 -5
- package/auth/cli/executor.d.ts +10 -10
- package/auth/orm/index.d.ts +10 -10
- package/auth/orm/input-types.d.ts +24 -72
- package/auth/orm/mutation/index.d.ts +17 -17
- package/auth/orm/mutation/index.js +24 -24
- package/esm/admin/cli/commands/{claimed-invite.d.ts → app-claimed-invite.d.ts} +1 -1
- package/esm/admin/cli/commands/{claimed-invite.js → app-claimed-invite.js} +8 -8
- package/esm/admin/cli/commands/{invite.d.ts → app-invite.d.ts} +1 -1
- package/esm/{public/cli/commands/invite.js → admin/cli/commands/app-invite.js} +8 -8
- package/esm/admin/cli/commands/steps-achieved.js +4 -4
- package/esm/admin/cli/commands/steps-required.js +4 -4
- package/esm/admin/cli/commands/submit-app-invite-code.d.ts +8 -0
- package/esm/admin/cli/commands/{submit-invite-code.js → submit-app-invite-code.js} +3 -3
- package/esm/admin/cli/commands.js +7 -7
- package/esm/admin/cli/executor.d.ts +5 -5
- package/esm/admin/orm/index.d.ts +7 -7
- package/esm/admin/orm/index.js +4 -4
- package/esm/admin/orm/input-types.d.ts +99 -99
- package/esm/admin/orm/models/appClaimedInvite.d.ts +56 -0
- package/esm/admin/orm/models/{claimedInvite.js → appClaimedInvite.js} +24 -24
- package/esm/admin/orm/models/appInvite.d.ts +56 -0
- package/esm/admin/orm/models/{invite.js → appInvite.js} +24 -24
- package/esm/admin/orm/models/index.d.ts +2 -2
- package/esm/admin/orm/models/index.js +2 -2
- package/esm/admin/orm/mutation/index.d.ts +6 -6
- package/esm/admin/orm/mutation/index.js +6 -6
- package/esm/admin/orm/query/index.d.ts +4 -4
- package/esm/admin/orm/query/index.js +4 -4
- package/esm/auth/cli/commands.js +5 -5
- package/esm/auth/cli/executor.d.ts +10 -10
- package/esm/auth/orm/index.d.ts +10 -10
- package/esm/auth/orm/input-types.d.ts +24 -72
- package/esm/auth/orm/mutation/index.d.ts +17 -17
- package/esm/auth/orm/mutation/index.js +24 -24
- package/esm/public/cli/commands/app-claimed-invite.d.ts +8 -0
- package/esm/public/cli/commands/{claimed-invite.js → app-claimed-invite.js} +8 -8
- package/{admin/cli/commands/invite.d.ts → esm/public/cli/commands/app-invite.d.ts} +1 -1
- package/esm/{admin/cli/commands/invite.js → public/cli/commands/app-invite.js} +8 -8
- package/esm/public/cli/commands/rate-limits-module.d.ts +8 -0
- package/esm/public/cli/commands/rate-limits-module.js +382 -0
- package/esm/public/cli/commands/steps-achieved.js +4 -4
- package/esm/public/cli/commands/steps-required.js +4 -4
- package/esm/public/cli/commands/submit-app-invite-code.d.ts +8 -0
- package/esm/public/cli/commands/{submit-invite-code.js → submit-app-invite-code.js} +3 -3
- package/esm/public/cli/commands.js +13 -11
- package/esm/public/cli/executor.d.ts +16 -15
- package/esm/public/orm/index.d.ts +19 -17
- package/esm/public/orm/index.js +6 -4
- package/esm/public/orm/input-types.d.ts +402 -230
- package/esm/public/orm/input-types.js +3 -3
- package/esm/public/orm/models/appClaimedInvite.d.ts +56 -0
- package/esm/public/orm/models/{claimedInvite.js → appClaimedInvite.js} +24 -24
- package/esm/public/orm/models/appInvite.d.ts +56 -0
- package/esm/public/orm/models/{invite.js → appInvite.js} +24 -24
- package/esm/public/orm/models/index.d.ts +3 -2
- package/esm/public/orm/models/index.js +3 -2
- package/esm/public/orm/models/rateLimitsModule.d.ts +56 -0
- package/esm/public/orm/models/rateLimitsModule.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +22 -22
- package/esm/public/orm/mutation/index.js +30 -30
- package/esm/public/orm/query/index.d.ts +4 -4
- package/esm/public/orm/query/index.js +4 -4
- package/package.json +5 -5
- package/public/cli/commands/app-claimed-invite.d.ts +8 -0
- package/public/cli/commands/{claimed-invite.js → app-claimed-invite.js} +8 -8
- package/public/cli/commands/{invite.d.ts → app-invite.d.ts} +1 -1
- package/{admin/cli/commands/invite.js → public/cli/commands/app-invite.js} +8 -8
- package/public/cli/commands/rate-limits-module.d.ts +8 -0
- package/public/cli/commands/rate-limits-module.js +384 -0
- package/public/cli/commands/steps-achieved.js +4 -4
- package/public/cli/commands/steps-required.js +4 -4
- package/public/cli/commands/submit-app-invite-code.d.ts +8 -0
- package/public/cli/commands/{submit-invite-code.js → submit-app-invite-code.js} +3 -3
- package/public/cli/commands.js +13 -11
- package/public/cli/executor.d.ts +16 -15
- package/public/orm/index.d.ts +19 -17
- package/public/orm/index.js +6 -4
- package/public/orm/input-types.d.ts +402 -230
- package/public/orm/input-types.js +3 -3
- package/public/orm/models/appClaimedInvite.d.ts +56 -0
- package/{admin/orm/models/claimedInvite.js → public/orm/models/appClaimedInvite.js} +26 -26
- package/public/orm/models/appInvite.d.ts +56 -0
- package/{admin/orm/models/invite.js → public/orm/models/appInvite.js} +26 -26
- package/public/orm/models/index.d.ts +3 -2
- package/public/orm/models/index.js +8 -6
- package/public/orm/models/rateLimitsModule.d.ts +56 -0
- package/public/orm/models/rateLimitsModule.js +100 -0
- package/public/orm/mutation/index.d.ts +22 -22
- package/public/orm/mutation/index.js +30 -30
- package/public/orm/query/index.d.ts +4 -4
- package/public/orm/query/index.js +4 -4
- package/admin/orm/models/claimedInvite.d.ts +0 -56
- package/admin/orm/models/invite.d.ts +0 -56
- package/esm/admin/cli/commands/submit-invite-code.d.ts +0 -8
- package/esm/admin/orm/models/claimedInvite.d.ts +0 -56
- package/esm/admin/orm/models/invite.d.ts +0 -56
- package/esm/public/cli/commands/claimed-invite.d.ts +0 -8
- package/esm/public/cli/commands/submit-invite-code.d.ts +0 -8
- package/esm/public/orm/models/claimedInvite.d.ts +0 -56
- package/esm/public/orm/models/invite.d.ts +0 -56
- package/public/cli/commands/claimed-invite.d.ts +0 -8
- package/public/cli/commands/submit-invite-code.d.ts +0 -8
- package/public/orm/models/claimedInvite.d.ts +0 -56
- package/public/orm/models/invite.d.ts +0 -56
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for RateLimitsModule
|
|
5
|
+
* @generated by @constructive-io/graphql-codegen
|
|
6
|
+
* DO NOT EDIT - changes will be overwritten
|
|
7
|
+
*/
|
|
8
|
+
const inquirerer_1 = require("inquirerer");
|
|
9
|
+
const executor_1 = require("../executor");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const fieldSchema = {
|
|
12
|
+
id: 'uuid',
|
|
13
|
+
databaseId: 'uuid',
|
|
14
|
+
schemaId: 'uuid',
|
|
15
|
+
rateLimitSettingsTableId: 'uuid',
|
|
16
|
+
ipRateLimitsTableId: 'uuid',
|
|
17
|
+
rateLimitsTableId: 'uuid',
|
|
18
|
+
rateLimitSettingsTable: 'string',
|
|
19
|
+
ipRateLimitsTable: 'string',
|
|
20
|
+
rateLimitsTable: 'string',
|
|
21
|
+
};
|
|
22
|
+
const usage = '\nrate-limits-module <command>\n\nCommands:\n list List rateLimitsModule records\n find-first Find first matching rateLimitsModule record\n get Get a rateLimitsModule by ID\n create Create a new rateLimitsModule\n update Update an existing rateLimitsModule\n delete Delete a rateLimitsModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
23
|
+
exports.default = async (argv, prompter, _options) => {
|
|
24
|
+
if (argv.help || argv.h) {
|
|
25
|
+
console.log(usage);
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
29
|
+
if (!subcommand) {
|
|
30
|
+
const answer = await prompter.prompt(argv, [
|
|
31
|
+
{
|
|
32
|
+
type: 'autocomplete',
|
|
33
|
+
name: 'subcommand',
|
|
34
|
+
message: 'What do you want to do?',
|
|
35
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
39
|
+
}
|
|
40
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
41
|
+
};
|
|
42
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
43
|
+
switch (subcommand) {
|
|
44
|
+
case 'list':
|
|
45
|
+
return handleList(argv, prompter);
|
|
46
|
+
case 'find-first':
|
|
47
|
+
return handleFindFirst(argv, prompter);
|
|
48
|
+
case 'get':
|
|
49
|
+
return handleGet(argv, prompter);
|
|
50
|
+
case 'create':
|
|
51
|
+
return handleCreate(argv, prompter);
|
|
52
|
+
case 'update':
|
|
53
|
+
return handleUpdate(argv, prompter);
|
|
54
|
+
case 'delete':
|
|
55
|
+
return handleDelete(argv, prompter);
|
|
56
|
+
default:
|
|
57
|
+
console.log(usage);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function handleList(argv, _prompter) {
|
|
62
|
+
try {
|
|
63
|
+
const defaultSelect = {
|
|
64
|
+
id: true,
|
|
65
|
+
databaseId: true,
|
|
66
|
+
schemaId: true,
|
|
67
|
+
rateLimitSettingsTableId: true,
|
|
68
|
+
ipRateLimitsTableId: true,
|
|
69
|
+
rateLimitsTableId: true,
|
|
70
|
+
rateLimitSettingsTable: true,
|
|
71
|
+
ipRateLimitsTable: true,
|
|
72
|
+
rateLimitsTable: true,
|
|
73
|
+
};
|
|
74
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
75
|
+
const client = (0, executor_1.getClient)();
|
|
76
|
+
const result = await client.rateLimitsModule.findMany(findManyArgs).execute();
|
|
77
|
+
console.log(JSON.stringify(result, null, 2));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error('Failed to list records.');
|
|
81
|
+
if (error instanceof Error) {
|
|
82
|
+
console.error(error.message);
|
|
83
|
+
}
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function handleFindFirst(argv, _prompter) {
|
|
88
|
+
try {
|
|
89
|
+
const defaultSelect = {
|
|
90
|
+
id: true,
|
|
91
|
+
databaseId: true,
|
|
92
|
+
schemaId: true,
|
|
93
|
+
rateLimitSettingsTableId: true,
|
|
94
|
+
ipRateLimitsTableId: true,
|
|
95
|
+
rateLimitsTableId: true,
|
|
96
|
+
rateLimitSettingsTable: true,
|
|
97
|
+
ipRateLimitsTable: true,
|
|
98
|
+
rateLimitsTable: true,
|
|
99
|
+
};
|
|
100
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
101
|
+
const client = (0, executor_1.getClient)();
|
|
102
|
+
const result = await client.rateLimitsModule.findFirst(findFirstArgs).execute();
|
|
103
|
+
console.log(JSON.stringify(result, null, 2));
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.error('Failed to find record.');
|
|
107
|
+
if (error instanceof Error) {
|
|
108
|
+
console.error(error.message);
|
|
109
|
+
}
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function handleGet(argv, prompter) {
|
|
114
|
+
try {
|
|
115
|
+
const answers = await prompter.prompt(argv, [
|
|
116
|
+
{
|
|
117
|
+
type: 'text',
|
|
118
|
+
name: 'id',
|
|
119
|
+
message: 'id',
|
|
120
|
+
required: true,
|
|
121
|
+
},
|
|
122
|
+
]);
|
|
123
|
+
const client = (0, executor_1.getClient)();
|
|
124
|
+
const result = await client.rateLimitsModule
|
|
125
|
+
.findOne({
|
|
126
|
+
id: answers.id,
|
|
127
|
+
select: {
|
|
128
|
+
id: true,
|
|
129
|
+
databaseId: true,
|
|
130
|
+
schemaId: true,
|
|
131
|
+
rateLimitSettingsTableId: true,
|
|
132
|
+
ipRateLimitsTableId: true,
|
|
133
|
+
rateLimitsTableId: true,
|
|
134
|
+
rateLimitSettingsTable: true,
|
|
135
|
+
ipRateLimitsTable: true,
|
|
136
|
+
rateLimitsTable: true,
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
.execute();
|
|
140
|
+
console.log(JSON.stringify(result, null, 2));
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
console.error('Record not found.');
|
|
144
|
+
if (error instanceof Error) {
|
|
145
|
+
console.error(error.message);
|
|
146
|
+
}
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async function handleCreate(argv, prompter) {
|
|
151
|
+
try {
|
|
152
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
153
|
+
{
|
|
154
|
+
type: 'text',
|
|
155
|
+
name: 'databaseId',
|
|
156
|
+
message: 'databaseId',
|
|
157
|
+
required: true,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'text',
|
|
161
|
+
name: 'schemaId',
|
|
162
|
+
message: 'schemaId',
|
|
163
|
+
required: false,
|
|
164
|
+
skipPrompt: true,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
type: 'text',
|
|
168
|
+
name: 'rateLimitSettingsTableId',
|
|
169
|
+
message: 'rateLimitSettingsTableId',
|
|
170
|
+
required: false,
|
|
171
|
+
skipPrompt: true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'text',
|
|
175
|
+
name: 'ipRateLimitsTableId',
|
|
176
|
+
message: 'ipRateLimitsTableId',
|
|
177
|
+
required: false,
|
|
178
|
+
skipPrompt: true,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'text',
|
|
182
|
+
name: 'rateLimitsTableId',
|
|
183
|
+
message: 'rateLimitsTableId',
|
|
184
|
+
required: false,
|
|
185
|
+
skipPrompt: true,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: 'text',
|
|
189
|
+
name: 'rateLimitSettingsTable',
|
|
190
|
+
message: 'rateLimitSettingsTable',
|
|
191
|
+
required: false,
|
|
192
|
+
skipPrompt: true,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'text',
|
|
196
|
+
name: 'ipRateLimitsTable',
|
|
197
|
+
message: 'ipRateLimitsTable',
|
|
198
|
+
required: false,
|
|
199
|
+
skipPrompt: true,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: 'text',
|
|
203
|
+
name: 'rateLimitsTable',
|
|
204
|
+
message: 'rateLimitsTable',
|
|
205
|
+
required: false,
|
|
206
|
+
skipPrompt: true,
|
|
207
|
+
},
|
|
208
|
+
]);
|
|
209
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
210
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
211
|
+
const client = (0, executor_1.getClient)();
|
|
212
|
+
const result = await client.rateLimitsModule
|
|
213
|
+
.create({
|
|
214
|
+
data: {
|
|
215
|
+
databaseId: cleanedData.databaseId,
|
|
216
|
+
schemaId: cleanedData.schemaId,
|
|
217
|
+
rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId,
|
|
218
|
+
ipRateLimitsTableId: cleanedData.ipRateLimitsTableId,
|
|
219
|
+
rateLimitsTableId: cleanedData.rateLimitsTableId,
|
|
220
|
+
rateLimitSettingsTable: cleanedData.rateLimitSettingsTable,
|
|
221
|
+
ipRateLimitsTable: cleanedData.ipRateLimitsTable,
|
|
222
|
+
rateLimitsTable: cleanedData.rateLimitsTable,
|
|
223
|
+
},
|
|
224
|
+
select: {
|
|
225
|
+
id: true,
|
|
226
|
+
databaseId: true,
|
|
227
|
+
schemaId: true,
|
|
228
|
+
rateLimitSettingsTableId: true,
|
|
229
|
+
ipRateLimitsTableId: true,
|
|
230
|
+
rateLimitsTableId: true,
|
|
231
|
+
rateLimitSettingsTable: true,
|
|
232
|
+
ipRateLimitsTable: true,
|
|
233
|
+
rateLimitsTable: true,
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
.execute();
|
|
237
|
+
console.log(JSON.stringify(result, null, 2));
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
console.error('Failed to create record.');
|
|
241
|
+
if (error instanceof Error) {
|
|
242
|
+
console.error(error.message);
|
|
243
|
+
}
|
|
244
|
+
process.exit(1);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function handleUpdate(argv, prompter) {
|
|
248
|
+
try {
|
|
249
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
250
|
+
{
|
|
251
|
+
type: 'text',
|
|
252
|
+
name: 'id',
|
|
253
|
+
message: 'id',
|
|
254
|
+
required: true,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
type: 'text',
|
|
258
|
+
name: 'databaseId',
|
|
259
|
+
message: 'databaseId',
|
|
260
|
+
required: false,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
type: 'text',
|
|
264
|
+
name: 'schemaId',
|
|
265
|
+
message: 'schemaId',
|
|
266
|
+
required: false,
|
|
267
|
+
skipPrompt: true,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
type: 'text',
|
|
271
|
+
name: 'rateLimitSettingsTableId',
|
|
272
|
+
message: 'rateLimitSettingsTableId',
|
|
273
|
+
required: false,
|
|
274
|
+
skipPrompt: true,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
type: 'text',
|
|
278
|
+
name: 'ipRateLimitsTableId',
|
|
279
|
+
message: 'ipRateLimitsTableId',
|
|
280
|
+
required: false,
|
|
281
|
+
skipPrompt: true,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
type: 'text',
|
|
285
|
+
name: 'rateLimitsTableId',
|
|
286
|
+
message: 'rateLimitsTableId',
|
|
287
|
+
required: false,
|
|
288
|
+
skipPrompt: true,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
type: 'text',
|
|
292
|
+
name: 'rateLimitSettingsTable',
|
|
293
|
+
message: 'rateLimitSettingsTable',
|
|
294
|
+
required: false,
|
|
295
|
+
skipPrompt: true,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
type: 'text',
|
|
299
|
+
name: 'ipRateLimitsTable',
|
|
300
|
+
message: 'ipRateLimitsTable',
|
|
301
|
+
required: false,
|
|
302
|
+
skipPrompt: true,
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: 'text',
|
|
306
|
+
name: 'rateLimitsTable',
|
|
307
|
+
message: 'rateLimitsTable',
|
|
308
|
+
required: false,
|
|
309
|
+
skipPrompt: true,
|
|
310
|
+
},
|
|
311
|
+
]);
|
|
312
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
313
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
314
|
+
const client = (0, executor_1.getClient)();
|
|
315
|
+
const result = await client.rateLimitsModule
|
|
316
|
+
.update({
|
|
317
|
+
where: {
|
|
318
|
+
id: answers.id,
|
|
319
|
+
},
|
|
320
|
+
data: {
|
|
321
|
+
databaseId: cleanedData.databaseId,
|
|
322
|
+
schemaId: cleanedData.schemaId,
|
|
323
|
+
rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId,
|
|
324
|
+
ipRateLimitsTableId: cleanedData.ipRateLimitsTableId,
|
|
325
|
+
rateLimitsTableId: cleanedData.rateLimitsTableId,
|
|
326
|
+
rateLimitSettingsTable: cleanedData.rateLimitSettingsTable,
|
|
327
|
+
ipRateLimitsTable: cleanedData.ipRateLimitsTable,
|
|
328
|
+
rateLimitsTable: cleanedData.rateLimitsTable,
|
|
329
|
+
},
|
|
330
|
+
select: {
|
|
331
|
+
id: true,
|
|
332
|
+
databaseId: true,
|
|
333
|
+
schemaId: true,
|
|
334
|
+
rateLimitSettingsTableId: true,
|
|
335
|
+
ipRateLimitsTableId: true,
|
|
336
|
+
rateLimitsTableId: true,
|
|
337
|
+
rateLimitSettingsTable: true,
|
|
338
|
+
ipRateLimitsTable: true,
|
|
339
|
+
rateLimitsTable: true,
|
|
340
|
+
},
|
|
341
|
+
})
|
|
342
|
+
.execute();
|
|
343
|
+
console.log(JSON.stringify(result, null, 2));
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
console.error('Failed to update record.');
|
|
347
|
+
if (error instanceof Error) {
|
|
348
|
+
console.error(error.message);
|
|
349
|
+
}
|
|
350
|
+
process.exit(1);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
async function handleDelete(argv, prompter) {
|
|
354
|
+
try {
|
|
355
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
356
|
+
{
|
|
357
|
+
type: 'text',
|
|
358
|
+
name: 'id',
|
|
359
|
+
message: 'id',
|
|
360
|
+
required: true,
|
|
361
|
+
},
|
|
362
|
+
]);
|
|
363
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
364
|
+
const client = (0, executor_1.getClient)();
|
|
365
|
+
const result = await client.rateLimitsModule
|
|
366
|
+
.delete({
|
|
367
|
+
where: {
|
|
368
|
+
id: answers.id,
|
|
369
|
+
},
|
|
370
|
+
select: {
|
|
371
|
+
id: true,
|
|
372
|
+
},
|
|
373
|
+
})
|
|
374
|
+
.execute();
|
|
375
|
+
console.log(JSON.stringify(result, null, 2));
|
|
376
|
+
}
|
|
377
|
+
catch (error) {
|
|
378
|
+
console.error('Failed to delete record.');
|
|
379
|
+
if (error instanceof Error) {
|
|
380
|
+
console.error(error.message);
|
|
381
|
+
}
|
|
382
|
+
process.exit(1);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
@@ -10,13 +10,13 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
10
10
|
const answers = await prompter.prompt(argv, [
|
|
11
11
|
{
|
|
12
12
|
type: 'text',
|
|
13
|
-
name: '
|
|
14
|
-
message: '
|
|
13
|
+
name: 'level',
|
|
14
|
+
message: 'level',
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
type: 'text',
|
|
18
|
-
name: '
|
|
19
|
-
message: '
|
|
18
|
+
name: 'roleId',
|
|
19
|
+
message: 'roleId',
|
|
20
20
|
},
|
|
21
21
|
]);
|
|
22
22
|
const client = (0, executor_1.getClient)();
|
|
@@ -11,13 +11,13 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
11
11
|
const answers = await prompter.prompt(argv, [
|
|
12
12
|
{
|
|
13
13
|
type: 'text',
|
|
14
|
-
name: '
|
|
15
|
-
message: '
|
|
14
|
+
name: 'level',
|
|
15
|
+
message: 'level',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
type: 'text',
|
|
19
|
-
name: '
|
|
20
|
-
message: '
|
|
19
|
+
name: 'roleId',
|
|
20
|
+
message: 'roleId',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
type: 'text',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command for mutation submitAppInviteCode
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
+
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
+
export default _default;
|
|
@@ -5,7 +5,7 @@ const utils_1 = require("../utils");
|
|
|
5
5
|
exports.default = async (argv, prompter, _options) => {
|
|
6
6
|
try {
|
|
7
7
|
if (argv.help || argv.h) {
|
|
8
|
-
console.log('submit-invite-code -
|
|
8
|
+
console.log('submit-app-invite-code - submitAppInviteCode\n\nUsage: submit-app-invite-code [OPTIONS]\n');
|
|
9
9
|
process.exit(0);
|
|
10
10
|
}
|
|
11
11
|
const answers = await prompter.prompt(argv, [
|
|
@@ -20,14 +20,14 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
20
20
|
const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
|
|
21
21
|
const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
|
|
22
22
|
const result = await client.mutation
|
|
23
|
-
.
|
|
23
|
+
.submitAppInviteCode(parsedAnswers, {
|
|
24
24
|
select: selectFields,
|
|
25
25
|
})
|
|
26
26
|
.execute();
|
|
27
27
|
console.log(JSON.stringify(result, null, 2));
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
|
-
console.error('Failed:
|
|
30
|
+
console.error('Failed: submitAppInviteCode');
|
|
31
31
|
if (error instanceof Error) {
|
|
32
32
|
console.error(error.message);
|
|
33
33
|
}
|
package/public/cli/commands.js
CHANGED
|
@@ -98,8 +98,8 @@ const email_1 = __importDefault(require("./commands/email"));
|
|
|
98
98
|
const phone_number_1 = __importDefault(require("./commands/phone-number"));
|
|
99
99
|
const crypto_address_1 = __importDefault(require("./commands/crypto-address"));
|
|
100
100
|
const connected_account_1 = __importDefault(require("./commands/connected-account"));
|
|
101
|
-
const
|
|
102
|
-
const
|
|
101
|
+
const app_invite_1 = __importDefault(require("./commands/app-invite"));
|
|
102
|
+
const app_claimed_invite_1 = __importDefault(require("./commands/app-claimed-invite"));
|
|
103
103
|
const org_invite_1 = __importDefault(require("./commands/org-invite"));
|
|
104
104
|
const org_claimed_invite_1 = __importDefault(require("./commands/org-claimed-invite"));
|
|
105
105
|
const audit_log_1 = __importDefault(require("./commands/audit-log"));
|
|
@@ -113,6 +113,7 @@ const org_limit_default_1 = __importDefault(require("./commands/org-limit-defaul
|
|
|
113
113
|
const membership_type_1 = __importDefault(require("./commands/membership-type"));
|
|
114
114
|
const app_membership_default_1 = __importDefault(require("./commands/app-membership-default"));
|
|
115
115
|
const commit_1 = __importDefault(require("./commands/commit"));
|
|
116
|
+
const rate_limits_module_1 = __importDefault(require("./commands/rate-limits-module"));
|
|
116
117
|
const org_membership_default_1 = __importDefault(require("./commands/org-membership-default"));
|
|
117
118
|
const rls_module_1 = __importDefault(require("./commands/rls-module"));
|
|
118
119
|
const sql_action_1 = __importDefault(require("./commands/sql-action"));
|
|
@@ -145,7 +146,9 @@ const sign_out_1 = __importDefault(require("./commands/sign-out"));
|
|
|
145
146
|
const accept_database_transfer_1 = __importDefault(require("./commands/accept-database-transfer"));
|
|
146
147
|
const cancel_database_transfer_1 = __importDefault(require("./commands/cancel-database-transfer"));
|
|
147
148
|
const reject_database_transfer_1 = __importDefault(require("./commands/reject-database-transfer"));
|
|
148
|
-
const
|
|
149
|
+
const verify_password_1 = __importDefault(require("./commands/verify-password"));
|
|
150
|
+
const verify_totp_1 = __importDefault(require("./commands/verify-totp"));
|
|
151
|
+
const submit_app_invite_code_1 = __importDefault(require("./commands/submit-app-invite-code"));
|
|
149
152
|
const submit_org_invite_code_1 = __importDefault(require("./commands/submit-org-invite-code"));
|
|
150
153
|
const check_password_1 = __importDefault(require("./commands/check-password"));
|
|
151
154
|
const confirm_delete_account_1 = __importDefault(require("./commands/confirm-delete-account"));
|
|
@@ -179,8 +182,6 @@ const one_time_token_1 = __importDefault(require("./commands/one-time-token"));
|
|
|
179
182
|
const provision_table_1 = __importDefault(require("./commands/provision-table"));
|
|
180
183
|
const send_verification_email_1 = __importDefault(require("./commands/send-verification-email"));
|
|
181
184
|
const forgot_password_1 = __importDefault(require("./commands/forgot-password"));
|
|
182
|
-
const verify_password_1 = __importDefault(require("./commands/verify-password"));
|
|
183
|
-
const verify_totp_1 = __importDefault(require("./commands/verify-totp"));
|
|
184
185
|
const request_upload_url_1 = __importDefault(require("./commands/request-upload-url"));
|
|
185
186
|
const confirm_upload_1 = __importDefault(require("./commands/confirm-upload"));
|
|
186
187
|
const provision_bucket_1 = __importDefault(require("./commands/provision-bucket"));
|
|
@@ -273,8 +274,8 @@ const createCommandMap = () => ({
|
|
|
273
274
|
'phone-number': phone_number_1.default,
|
|
274
275
|
'crypto-address': crypto_address_1.default,
|
|
275
276
|
'connected-account': connected_account_1.default,
|
|
276
|
-
invite:
|
|
277
|
-
'claimed-invite':
|
|
277
|
+
'app-invite': app_invite_1.default,
|
|
278
|
+
'app-claimed-invite': app_claimed_invite_1.default,
|
|
278
279
|
'org-invite': org_invite_1.default,
|
|
279
280
|
'org-claimed-invite': org_claimed_invite_1.default,
|
|
280
281
|
'audit-log': audit_log_1.default,
|
|
@@ -288,6 +289,7 @@ const createCommandMap = () => ({
|
|
|
288
289
|
'membership-type': membership_type_1.default,
|
|
289
290
|
'app-membership-default': app_membership_default_1.default,
|
|
290
291
|
commit: commit_1.default,
|
|
292
|
+
'rate-limits-module': rate_limits_module_1.default,
|
|
291
293
|
'org-membership-default': org_membership_default_1.default,
|
|
292
294
|
'rls-module': rls_module_1.default,
|
|
293
295
|
'sql-action': sql_action_1.default,
|
|
@@ -320,7 +322,9 @@ const createCommandMap = () => ({
|
|
|
320
322
|
'accept-database-transfer': accept_database_transfer_1.default,
|
|
321
323
|
'cancel-database-transfer': cancel_database_transfer_1.default,
|
|
322
324
|
'reject-database-transfer': reject_database_transfer_1.default,
|
|
323
|
-
'
|
|
325
|
+
'verify-password': verify_password_1.default,
|
|
326
|
+
'verify-totp': verify_totp_1.default,
|
|
327
|
+
'submit-app-invite-code': submit_app_invite_code_1.default,
|
|
324
328
|
'submit-org-invite-code': submit_org_invite_code_1.default,
|
|
325
329
|
'check-password': check_password_1.default,
|
|
326
330
|
'confirm-delete-account': confirm_delete_account_1.default,
|
|
@@ -354,13 +358,11 @@ const createCommandMap = () => ({
|
|
|
354
358
|
'provision-table': provision_table_1.default,
|
|
355
359
|
'send-verification-email': send_verification_email_1.default,
|
|
356
360
|
'forgot-password': forgot_password_1.default,
|
|
357
|
-
'verify-password': verify_password_1.default,
|
|
358
|
-
'verify-totp': verify_totp_1.default,
|
|
359
361
|
'request-upload-url': request_upload_url_1.default,
|
|
360
362
|
'confirm-upload': confirm_upload_1.default,
|
|
361
363
|
'provision-bucket': provision_bucket_1.default,
|
|
362
364
|
});
|
|
363
|
-
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n invite invite CRUD operations\n claimed-invite claimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n submit-invite-code submitInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n verify-password verifyPassword\n verify-totp verifyTotp\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
365
|
+
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
364
366
|
const commands = async (argv, prompter, options) => {
|
|
365
367
|
if (argv.help || argv.h) {
|
|
366
368
|
console.log(usage);
|
package/public/cli/executor.d.ts
CHANGED
|
@@ -86,8 +86,8 @@ export declare function getClient(contextName?: string): {
|
|
|
86
86
|
phoneNumber: import("../orm").PhoneNumberModel;
|
|
87
87
|
cryptoAddress: import("../orm").CryptoAddressModel;
|
|
88
88
|
connectedAccount: import("../orm").ConnectedAccountModel;
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
appInvite: import("../orm").AppInviteModel;
|
|
90
|
+
appClaimedInvite: import("../orm").AppClaimedInviteModel;
|
|
91
91
|
orgInvite: import("../orm").OrgInviteModel;
|
|
92
92
|
orgClaimedInvite: import("../orm").OrgClaimedInviteModel;
|
|
93
93
|
auditLog: import("../orm").AuditLogModel;
|
|
@@ -101,6 +101,7 @@ export declare function getClient(contextName?: string): {
|
|
|
101
101
|
membershipType: import("../orm").MembershipTypeModel;
|
|
102
102
|
appMembershipDefault: import("../orm").AppMembershipDefaultModel;
|
|
103
103
|
commit: import("../orm").CommitModel;
|
|
104
|
+
rateLimitsModule: import("../orm").RateLimitsModuleModel;
|
|
104
105
|
orgMembershipDefault: import("../orm").OrgMembershipDefaultModel;
|
|
105
106
|
rlsModule: import("../orm").RlsModuleModel;
|
|
106
107
|
sqlAction: import("../orm").SqlActionModel;
|
|
@@ -236,10 +237,20 @@ export declare function getClient(contextName?: string): {
|
|
|
236
237
|
} & import("../orm").StrictSelect<S, import("../orm/input-types").RejectDatabaseTransferPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
237
238
|
rejectDatabaseTransfer: import("../orm").InferSelectResult<import("../orm/input-types").RejectDatabaseTransferPayload, S> | null;
|
|
238
239
|
}>;
|
|
239
|
-
|
|
240
|
+
verifyPassword: <S extends import("../orm/input-types").VerifyPasswordPayloadSelect>(args: import("../orm/mutation").VerifyPasswordVariables, options: {
|
|
241
|
+
select: S;
|
|
242
|
+
} & import("../orm").StrictSelect<S, import("../orm/input-types").VerifyPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
243
|
+
verifyPassword: import("../orm").InferSelectResult<import("../orm/input-types").VerifyPasswordPayload, S> | null;
|
|
244
|
+
}>;
|
|
245
|
+
verifyTotp: <S extends import("../orm/input-types").VerifyTotpPayloadSelect>(args: import("../orm/mutation").VerifyTotpVariables, options: {
|
|
246
|
+
select: S;
|
|
247
|
+
} & import("../orm").StrictSelect<S, import("../orm/input-types").VerifyTotpPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
248
|
+
verifyTotp: import("../orm").InferSelectResult<import("../orm/input-types").VerifyTotpPayload, S> | null;
|
|
249
|
+
}>;
|
|
250
|
+
submitAppInviteCode: <S extends import("../orm/input-types").SubmitAppInviteCodePayloadSelect>(args: import("../orm/mutation").SubmitAppInviteCodeVariables, options: {
|
|
240
251
|
select: S;
|
|
241
|
-
} & import("../orm").StrictSelect<S, import("../orm/input-types").
|
|
242
|
-
|
|
252
|
+
} & import("../orm").StrictSelect<S, import("../orm/input-types").SubmitAppInviteCodePayloadSelect>) => import("../orm").QueryBuilder<{
|
|
253
|
+
submitAppInviteCode: import("../orm").InferSelectResult<import("../orm/input-types").SubmitAppInviteCodePayload, S> | null;
|
|
243
254
|
}>;
|
|
244
255
|
submitOrgInviteCode: <S extends import("../orm/input-types").SubmitOrgInviteCodePayloadSelect>(args: import("../orm/mutation").SubmitOrgInviteCodeVariables, options: {
|
|
245
256
|
select: S;
|
|
@@ -406,16 +417,6 @@ export declare function getClient(contextName?: string): {
|
|
|
406
417
|
} & import("../orm").StrictSelect<S, import("../orm/input-types").ForgotPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
407
418
|
forgotPassword: import("../orm").InferSelectResult<import("../orm/input-types").ForgotPasswordPayload, S> | null;
|
|
408
419
|
}>;
|
|
409
|
-
verifyPassword: <S extends import("../orm/input-types").VerifyPasswordPayloadSelect>(args: import("../orm/mutation").VerifyPasswordVariables, options: {
|
|
410
|
-
select: S;
|
|
411
|
-
} & import("../orm").StrictSelect<S, import("../orm/input-types").VerifyPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
412
|
-
verifyPassword: import("../orm").InferSelectResult<import("../orm/input-types").VerifyPasswordPayload, S> | null;
|
|
413
|
-
}>;
|
|
414
|
-
verifyTotp: <S extends import("../orm/input-types").VerifyTotpPayloadSelect>(args: import("../orm/mutation").VerifyTotpVariables, options: {
|
|
415
|
-
select: S;
|
|
416
|
-
} & import("../orm").StrictSelect<S, import("../orm/input-types").VerifyTotpPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
417
|
-
verifyTotp: import("../orm").InferSelectResult<import("../orm/input-types").VerifyTotpPayload, S> | null;
|
|
418
|
-
}>;
|
|
419
420
|
requestUploadUrl: <S extends import("../orm/input-types").RequestUploadUrlPayloadSelect>(args: import("../orm/mutation").RequestUploadUrlVariables, options: {
|
|
420
421
|
select: S;
|
|
421
422
|
} & import("../orm").StrictSelect<S, import("../orm/input-types").RequestUploadUrlPayloadSelect>) => import("../orm").QueryBuilder<{
|