@constructive-sdk/cli 0.14.7 → 0.14.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/cli/commands/org-membership-default.js +0 -44
- package/admin/cli/commands/org-membership-setting.d.ts +8 -0
- package/admin/cli/commands/org-membership-setting.js +418 -0
- package/admin/cli/commands.js +5 -3
- package/admin/cli/executor.d.ts +2 -1
- package/admin/orm/index.d.ts +4 -2
- package/admin/orm/index.js +4 -2
- package/admin/orm/input-types.d.ts +303 -142
- package/admin/orm/models/index.d.ts +2 -1
- package/admin/orm/models/index.js +5 -3
- package/admin/orm/models/orgMembershipSetting.d.ts +56 -0
- package/admin/orm/models/orgMembershipSetting.js +100 -0
- package/auth/cli/commands/crypto-address.js +22 -0
- package/auth/cli/commands/email.js +22 -0
- package/auth/cli/commands/identity-provider.d.ts +8 -0
- package/auth/cli/commands/identity-provider.js +164 -0
- package/auth/cli/commands/phone-number.js +22 -0
- package/auth/cli/commands/webauthn-credential.d.ts +8 -0
- package/auth/cli/commands/webauthn-credential.js +456 -0
- package/auth/cli/commands.js +7 -3
- package/auth/cli/executor.d.ts +7 -5
- package/auth/orm/index.d.ts +9 -5
- package/auth/orm/index.js +4 -0
- package/auth/orm/input-types.d.ts +525 -81
- package/auth/orm/input-types.js +1 -0
- package/auth/orm/models/identityProvider.d.ts +32 -0
- package/auth/orm/models/identityProvider.js +55 -0
- package/auth/orm/models/index.d.ts +2 -0
- package/auth/orm/models/index.js +5 -1
- package/auth/orm/models/webauthnCredential.d.ts +56 -0
- package/auth/orm/models/webauthnCredential.js +100 -0
- package/auth/orm/mutation/index.d.ts +9 -9
- package/auth/orm/mutation/index.js +12 -12
- package/esm/admin/cli/commands/org-membership-default.js +0 -44
- package/esm/admin/cli/commands/org-membership-setting.d.ts +8 -0
- package/esm/admin/cli/commands/org-membership-setting.js +416 -0
- package/esm/admin/cli/commands.js +5 -3
- package/esm/admin/cli/executor.d.ts +2 -1
- package/esm/admin/orm/index.d.ts +4 -2
- package/esm/admin/orm/index.js +4 -2
- package/esm/admin/orm/input-types.d.ts +303 -142
- package/esm/admin/orm/models/index.d.ts +2 -1
- package/esm/admin/orm/models/index.js +2 -1
- package/esm/admin/orm/models/orgMembershipSetting.d.ts +56 -0
- package/esm/admin/orm/models/orgMembershipSetting.js +96 -0
- package/esm/auth/cli/commands/crypto-address.js +22 -0
- package/esm/auth/cli/commands/email.js +22 -0
- package/esm/auth/cli/commands/identity-provider.d.ts +8 -0
- package/esm/auth/cli/commands/identity-provider.js +162 -0
- package/esm/auth/cli/commands/phone-number.js +22 -0
- package/esm/auth/cli/commands/webauthn-credential.d.ts +8 -0
- package/esm/auth/cli/commands/webauthn-credential.js +454 -0
- package/esm/auth/cli/commands.js +7 -3
- package/esm/auth/cli/executor.d.ts +7 -5
- package/esm/auth/orm/index.d.ts +9 -5
- package/esm/auth/orm/index.js +4 -0
- package/esm/auth/orm/input-types.d.ts +525 -81
- package/esm/auth/orm/input-types.js +1 -0
- package/esm/auth/orm/models/identityProvider.d.ts +32 -0
- package/esm/auth/orm/models/identityProvider.js +51 -0
- package/esm/auth/orm/models/index.d.ts +2 -0
- package/esm/auth/orm/models/index.js +2 -0
- package/esm/auth/orm/models/webauthnCredential.d.ts +56 -0
- package/esm/auth/orm/models/webauthnCredential.js +96 -0
- package/esm/auth/orm/mutation/index.d.ts +9 -9
- package/esm/auth/orm/mutation/index.js +12 -12
- package/esm/objects/orm/input-types.d.ts +12 -0
- package/esm/public/cli/commands/crypto-address.js +22 -0
- package/esm/public/cli/commands/email.js +22 -0
- package/esm/public/cli/commands/entity-type-provision.js +110 -0
- package/esm/public/cli/commands/identity-provider.d.ts +8 -0
- package/esm/public/cli/commands/identity-provider.js +162 -0
- package/esm/public/cli/commands/identity-providers-module.d.ts +8 -0
- package/esm/public/cli/commands/identity-providers-module.js +316 -0
- package/esm/public/cli/commands/memberships-module.js +44 -0
- package/esm/public/cli/commands/notifications-module.d.ts +8 -0
- package/esm/public/cli/commands/notifications-module.js +448 -0
- package/esm/public/cli/commands/org-membership-default.js +0 -44
- package/esm/public/cli/commands/org-membership-setting.d.ts +8 -0
- package/esm/public/cli/commands/org-membership-setting.js +416 -0
- package/esm/public/cli/commands/phone-number.js +22 -0
- package/esm/public/cli/commands/relation-provision.js +24 -156
- package/esm/public/cli/commands/secure-table-provision.js +24 -156
- package/esm/public/cli/commands/storage-module.js +44 -0
- package/esm/public/cli/commands/webauthn-auth-module.d.ts +8 -0
- package/esm/public/cli/commands/webauthn-auth-module.js +536 -0
- package/esm/public/cli/commands/webauthn-credential.d.ts +8 -0
- package/esm/public/cli/commands/webauthn-credential.js +454 -0
- package/esm/public/cli/commands.js +17 -5
- package/esm/public/cli/executor.d.ts +12 -6
- package/esm/public/orm/index.d.ts +19 -7
- package/esm/public/orm/index.js +14 -2
- package/esm/public/orm/input-types.d.ts +1827 -366
- package/esm/public/orm/input-types.js +7 -0
- package/esm/public/orm/models/identityProvider.d.ts +32 -0
- package/esm/public/orm/models/identityProvider.js +51 -0
- package/esm/public/orm/models/identityProvidersModule.d.ts +56 -0
- package/esm/public/orm/models/identityProvidersModule.js +96 -0
- package/esm/public/orm/models/index.d.ts +7 -1
- package/esm/public/orm/models/index.js +7 -1
- package/esm/public/orm/models/notificationsModule.d.ts +56 -0
- package/esm/public/orm/models/notificationsModule.js +96 -0
- package/esm/public/orm/models/orgMembershipSetting.d.ts +56 -0
- package/esm/public/orm/models/orgMembershipSetting.js +96 -0
- package/esm/public/orm/models/webauthnAuthModule.d.ts +56 -0
- package/esm/public/orm/models/webauthnAuthModule.js +96 -0
- package/esm/public/orm/models/webauthnCredential.d.ts +56 -0
- package/esm/public/orm/models/webauthnCredential.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +9 -9
- package/esm/public/orm/mutation/index.js +12 -12
- package/objects/orm/input-types.d.ts +12 -0
- package/package.json +3 -3
- package/public/cli/commands/crypto-address.js +22 -0
- package/public/cli/commands/email.js +22 -0
- package/public/cli/commands/entity-type-provision.js +110 -0
- package/public/cli/commands/identity-provider.d.ts +8 -0
- package/public/cli/commands/identity-provider.js +164 -0
- package/public/cli/commands/identity-providers-module.d.ts +8 -0
- package/public/cli/commands/identity-providers-module.js +318 -0
- package/public/cli/commands/memberships-module.js +44 -0
- package/public/cli/commands/notifications-module.d.ts +8 -0
- package/public/cli/commands/notifications-module.js +450 -0
- package/public/cli/commands/org-membership-default.js +0 -44
- package/public/cli/commands/org-membership-setting.d.ts +8 -0
- package/public/cli/commands/org-membership-setting.js +418 -0
- package/public/cli/commands/phone-number.js +22 -0
- package/public/cli/commands/relation-provision.js +24 -156
- package/public/cli/commands/secure-table-provision.js +24 -156
- package/public/cli/commands/storage-module.js +44 -0
- package/public/cli/commands/webauthn-auth-module.d.ts +8 -0
- package/public/cli/commands/webauthn-auth-module.js +538 -0
- package/public/cli/commands/webauthn-credential.d.ts +8 -0
- package/public/cli/commands/webauthn-credential.js +456 -0
- package/public/cli/commands.js +17 -5
- package/public/cli/executor.d.ts +12 -6
- package/public/orm/index.d.ts +19 -7
- package/public/orm/index.js +14 -2
- package/public/orm/input-types.d.ts +1827 -366
- package/public/orm/input-types.js +7 -0
- package/public/orm/models/identityProvider.d.ts +32 -0
- package/public/orm/models/identityProvider.js +55 -0
- package/public/orm/models/identityProvidersModule.d.ts +56 -0
- package/public/orm/models/identityProvidersModule.js +100 -0
- package/public/orm/models/index.d.ts +7 -1
- package/public/orm/models/index.js +17 -5
- package/public/orm/models/notificationsModule.d.ts +56 -0
- package/public/orm/models/notificationsModule.js +100 -0
- package/public/orm/models/orgMembershipSetting.d.ts +56 -0
- package/public/orm/models/orgMembershipSetting.js +100 -0
- package/public/orm/models/webauthnAuthModule.d.ts +56 -0
- package/public/orm/models/webauthnAuthModule.js +100 -0
- package/public/orm/models/webauthnCredential.d.ts +56 -0
- package/public/orm/models/webauthnCredential.js +100 -0
- package/public/orm/mutation/index.d.ts +9 -9
- package/public/orm/mutation/index.js +12 -12
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for WebauthnCredential
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
ownerId: 'uuid',
|
|
12
|
+
credentialId: 'string',
|
|
13
|
+
publicKey: 'string',
|
|
14
|
+
signCount: 'int',
|
|
15
|
+
webauthnUserId: 'string',
|
|
16
|
+
transports: 'string',
|
|
17
|
+
credentialDeviceType: 'string',
|
|
18
|
+
backupEligible: 'boolean',
|
|
19
|
+
backupState: 'boolean',
|
|
20
|
+
name: 'string',
|
|
21
|
+
lastUsedAt: 'string',
|
|
22
|
+
createdAt: 'string',
|
|
23
|
+
updatedAt: 'string',
|
|
24
|
+
};
|
|
25
|
+
const usage = '\nwebauthn-credential <command>\n\nCommands:\n list List webauthnCredential records\n find-first Find first matching webauthnCredential record\n get Get a webauthnCredential by ID\n create Create a new webauthnCredential\n update Update an existing webauthnCredential\n delete Delete a webauthnCredential\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';
|
|
26
|
+
export default async (argv, prompter, _options) => {
|
|
27
|
+
if (argv.help || argv.h) {
|
|
28
|
+
console.log(usage);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
32
|
+
if (!subcommand) {
|
|
33
|
+
const answer = await prompter.prompt(argv, [
|
|
34
|
+
{
|
|
35
|
+
type: 'autocomplete',
|
|
36
|
+
name: 'subcommand',
|
|
37
|
+
message: 'What do you want to do?',
|
|
38
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
42
|
+
}
|
|
43
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
44
|
+
};
|
|
45
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
46
|
+
switch (subcommand) {
|
|
47
|
+
case 'list':
|
|
48
|
+
return handleList(argv, prompter);
|
|
49
|
+
case 'find-first':
|
|
50
|
+
return handleFindFirst(argv, prompter);
|
|
51
|
+
case 'get':
|
|
52
|
+
return handleGet(argv, prompter);
|
|
53
|
+
case 'create':
|
|
54
|
+
return handleCreate(argv, prompter);
|
|
55
|
+
case 'update':
|
|
56
|
+
return handleUpdate(argv, prompter);
|
|
57
|
+
case 'delete':
|
|
58
|
+
return handleDelete(argv, prompter);
|
|
59
|
+
default:
|
|
60
|
+
console.log(usage);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function handleList(argv, _prompter) {
|
|
65
|
+
try {
|
|
66
|
+
const defaultSelect = {
|
|
67
|
+
id: true,
|
|
68
|
+
ownerId: true,
|
|
69
|
+
credentialId: true,
|
|
70
|
+
publicKey: true,
|
|
71
|
+
signCount: true,
|
|
72
|
+
webauthnUserId: true,
|
|
73
|
+
transports: true,
|
|
74
|
+
credentialDeviceType: true,
|
|
75
|
+
backupEligible: true,
|
|
76
|
+
backupState: true,
|
|
77
|
+
name: true,
|
|
78
|
+
lastUsedAt: true,
|
|
79
|
+
createdAt: true,
|
|
80
|
+
updatedAt: true,
|
|
81
|
+
};
|
|
82
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
83
|
+
const client = getClient();
|
|
84
|
+
const result = await client.webauthnCredential.findMany(findManyArgs).execute();
|
|
85
|
+
console.log(JSON.stringify(result, null, 2));
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error('Failed to list records.');
|
|
89
|
+
if (error instanceof Error) {
|
|
90
|
+
console.error(error.message);
|
|
91
|
+
}
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function handleFindFirst(argv, _prompter) {
|
|
96
|
+
try {
|
|
97
|
+
const defaultSelect = {
|
|
98
|
+
id: true,
|
|
99
|
+
ownerId: true,
|
|
100
|
+
credentialId: true,
|
|
101
|
+
publicKey: true,
|
|
102
|
+
signCount: true,
|
|
103
|
+
webauthnUserId: true,
|
|
104
|
+
transports: true,
|
|
105
|
+
credentialDeviceType: true,
|
|
106
|
+
backupEligible: true,
|
|
107
|
+
backupState: true,
|
|
108
|
+
name: true,
|
|
109
|
+
lastUsedAt: true,
|
|
110
|
+
createdAt: true,
|
|
111
|
+
updatedAt: true,
|
|
112
|
+
};
|
|
113
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
114
|
+
const client = getClient();
|
|
115
|
+
const result = await client.webauthnCredential.findFirst(findFirstArgs).execute();
|
|
116
|
+
console.log(JSON.stringify(result, null, 2));
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('Failed to find record.');
|
|
120
|
+
if (error instanceof Error) {
|
|
121
|
+
console.error(error.message);
|
|
122
|
+
}
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async function handleGet(argv, prompter) {
|
|
127
|
+
try {
|
|
128
|
+
const answers = await prompter.prompt(argv, [
|
|
129
|
+
{
|
|
130
|
+
type: 'text',
|
|
131
|
+
name: 'id',
|
|
132
|
+
message: 'id',
|
|
133
|
+
required: true,
|
|
134
|
+
},
|
|
135
|
+
]);
|
|
136
|
+
const client = getClient();
|
|
137
|
+
const result = await client.webauthnCredential
|
|
138
|
+
.findOne({
|
|
139
|
+
id: answers.id,
|
|
140
|
+
select: {
|
|
141
|
+
id: true,
|
|
142
|
+
ownerId: true,
|
|
143
|
+
credentialId: true,
|
|
144
|
+
publicKey: true,
|
|
145
|
+
signCount: true,
|
|
146
|
+
webauthnUserId: true,
|
|
147
|
+
transports: true,
|
|
148
|
+
credentialDeviceType: true,
|
|
149
|
+
backupEligible: true,
|
|
150
|
+
backupState: true,
|
|
151
|
+
name: true,
|
|
152
|
+
lastUsedAt: true,
|
|
153
|
+
createdAt: true,
|
|
154
|
+
updatedAt: true,
|
|
155
|
+
},
|
|
156
|
+
})
|
|
157
|
+
.execute();
|
|
158
|
+
console.log(JSON.stringify(result, null, 2));
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
console.error('Record not found.');
|
|
162
|
+
if (error instanceof Error) {
|
|
163
|
+
console.error(error.message);
|
|
164
|
+
}
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async function handleCreate(argv, prompter) {
|
|
169
|
+
try {
|
|
170
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
171
|
+
{
|
|
172
|
+
type: 'text',
|
|
173
|
+
name: 'ownerId',
|
|
174
|
+
message: 'ownerId',
|
|
175
|
+
required: false,
|
|
176
|
+
skipPrompt: true,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: 'text',
|
|
180
|
+
name: 'credentialId',
|
|
181
|
+
message: 'credentialId',
|
|
182
|
+
required: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'text',
|
|
186
|
+
name: 'publicKey',
|
|
187
|
+
message: 'publicKey',
|
|
188
|
+
required: true,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
name: 'signCount',
|
|
193
|
+
message: 'signCount',
|
|
194
|
+
required: false,
|
|
195
|
+
skipPrompt: true,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'text',
|
|
199
|
+
name: 'webauthnUserId',
|
|
200
|
+
message: 'webauthnUserId',
|
|
201
|
+
required: true,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: 'text',
|
|
205
|
+
name: 'transports',
|
|
206
|
+
message: 'transports',
|
|
207
|
+
required: false,
|
|
208
|
+
skipPrompt: true,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'text',
|
|
212
|
+
name: 'credentialDeviceType',
|
|
213
|
+
message: 'credentialDeviceType',
|
|
214
|
+
required: true,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'boolean',
|
|
218
|
+
name: 'backupEligible',
|
|
219
|
+
message: 'backupEligible',
|
|
220
|
+
required: false,
|
|
221
|
+
skipPrompt: true,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'boolean',
|
|
225
|
+
name: 'backupState',
|
|
226
|
+
message: 'backupState',
|
|
227
|
+
required: false,
|
|
228
|
+
skipPrompt: true,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: 'text',
|
|
232
|
+
name: 'name',
|
|
233
|
+
message: 'name',
|
|
234
|
+
required: false,
|
|
235
|
+
skipPrompt: true,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: 'text',
|
|
239
|
+
name: 'lastUsedAt',
|
|
240
|
+
message: 'lastUsedAt',
|
|
241
|
+
required: false,
|
|
242
|
+
skipPrompt: true,
|
|
243
|
+
},
|
|
244
|
+
]);
|
|
245
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
246
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
247
|
+
const client = getClient();
|
|
248
|
+
const result = await client.webauthnCredential
|
|
249
|
+
.create({
|
|
250
|
+
data: {
|
|
251
|
+
ownerId: cleanedData.ownerId,
|
|
252
|
+
credentialId: cleanedData.credentialId,
|
|
253
|
+
publicKey: cleanedData.publicKey,
|
|
254
|
+
signCount: cleanedData.signCount,
|
|
255
|
+
webauthnUserId: cleanedData.webauthnUserId,
|
|
256
|
+
transports: cleanedData.transports,
|
|
257
|
+
credentialDeviceType: cleanedData.credentialDeviceType,
|
|
258
|
+
backupEligible: cleanedData.backupEligible,
|
|
259
|
+
backupState: cleanedData.backupState,
|
|
260
|
+
name: cleanedData.name,
|
|
261
|
+
lastUsedAt: cleanedData.lastUsedAt,
|
|
262
|
+
},
|
|
263
|
+
select: {
|
|
264
|
+
id: true,
|
|
265
|
+
ownerId: true,
|
|
266
|
+
credentialId: true,
|
|
267
|
+
publicKey: true,
|
|
268
|
+
signCount: true,
|
|
269
|
+
webauthnUserId: true,
|
|
270
|
+
transports: true,
|
|
271
|
+
credentialDeviceType: true,
|
|
272
|
+
backupEligible: true,
|
|
273
|
+
backupState: true,
|
|
274
|
+
name: true,
|
|
275
|
+
lastUsedAt: true,
|
|
276
|
+
createdAt: true,
|
|
277
|
+
updatedAt: true,
|
|
278
|
+
},
|
|
279
|
+
})
|
|
280
|
+
.execute();
|
|
281
|
+
console.log(JSON.stringify(result, null, 2));
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
console.error('Failed to create record.');
|
|
285
|
+
if (error instanceof Error) {
|
|
286
|
+
console.error(error.message);
|
|
287
|
+
}
|
|
288
|
+
process.exit(1);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async function handleUpdate(argv, prompter) {
|
|
292
|
+
try {
|
|
293
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
294
|
+
{
|
|
295
|
+
type: 'text',
|
|
296
|
+
name: 'id',
|
|
297
|
+
message: 'id',
|
|
298
|
+
required: true,
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: 'text',
|
|
302
|
+
name: 'ownerId',
|
|
303
|
+
message: 'ownerId',
|
|
304
|
+
required: false,
|
|
305
|
+
skipPrompt: true,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
type: 'text',
|
|
309
|
+
name: 'credentialId',
|
|
310
|
+
message: 'credentialId',
|
|
311
|
+
required: false,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
type: 'text',
|
|
315
|
+
name: 'publicKey',
|
|
316
|
+
message: 'publicKey',
|
|
317
|
+
required: false,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
type: 'text',
|
|
321
|
+
name: 'signCount',
|
|
322
|
+
message: 'signCount',
|
|
323
|
+
required: false,
|
|
324
|
+
skipPrompt: true,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
type: 'text',
|
|
328
|
+
name: 'webauthnUserId',
|
|
329
|
+
message: 'webauthnUserId',
|
|
330
|
+
required: false,
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
type: 'text',
|
|
334
|
+
name: 'transports',
|
|
335
|
+
message: 'transports',
|
|
336
|
+
required: false,
|
|
337
|
+
skipPrompt: true,
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
type: 'text',
|
|
341
|
+
name: 'credentialDeviceType',
|
|
342
|
+
message: 'credentialDeviceType',
|
|
343
|
+
required: false,
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
type: 'boolean',
|
|
347
|
+
name: 'backupEligible',
|
|
348
|
+
message: 'backupEligible',
|
|
349
|
+
required: false,
|
|
350
|
+
skipPrompt: true,
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
type: 'boolean',
|
|
354
|
+
name: 'backupState',
|
|
355
|
+
message: 'backupState',
|
|
356
|
+
required: false,
|
|
357
|
+
skipPrompt: true,
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
type: 'text',
|
|
361
|
+
name: 'name',
|
|
362
|
+
message: 'name',
|
|
363
|
+
required: false,
|
|
364
|
+
skipPrompt: true,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
type: 'text',
|
|
368
|
+
name: 'lastUsedAt',
|
|
369
|
+
message: 'lastUsedAt',
|
|
370
|
+
required: false,
|
|
371
|
+
skipPrompt: true,
|
|
372
|
+
},
|
|
373
|
+
]);
|
|
374
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
375
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
376
|
+
const client = getClient();
|
|
377
|
+
const result = await client.webauthnCredential
|
|
378
|
+
.update({
|
|
379
|
+
where: {
|
|
380
|
+
id: answers.id,
|
|
381
|
+
},
|
|
382
|
+
data: {
|
|
383
|
+
ownerId: cleanedData.ownerId,
|
|
384
|
+
credentialId: cleanedData.credentialId,
|
|
385
|
+
publicKey: cleanedData.publicKey,
|
|
386
|
+
signCount: cleanedData.signCount,
|
|
387
|
+
webauthnUserId: cleanedData.webauthnUserId,
|
|
388
|
+
transports: cleanedData.transports,
|
|
389
|
+
credentialDeviceType: cleanedData.credentialDeviceType,
|
|
390
|
+
backupEligible: cleanedData.backupEligible,
|
|
391
|
+
backupState: cleanedData.backupState,
|
|
392
|
+
name: cleanedData.name,
|
|
393
|
+
lastUsedAt: cleanedData.lastUsedAt,
|
|
394
|
+
},
|
|
395
|
+
select: {
|
|
396
|
+
id: true,
|
|
397
|
+
ownerId: true,
|
|
398
|
+
credentialId: true,
|
|
399
|
+
publicKey: true,
|
|
400
|
+
signCount: true,
|
|
401
|
+
webauthnUserId: true,
|
|
402
|
+
transports: true,
|
|
403
|
+
credentialDeviceType: true,
|
|
404
|
+
backupEligible: true,
|
|
405
|
+
backupState: true,
|
|
406
|
+
name: true,
|
|
407
|
+
lastUsedAt: true,
|
|
408
|
+
createdAt: true,
|
|
409
|
+
updatedAt: true,
|
|
410
|
+
},
|
|
411
|
+
})
|
|
412
|
+
.execute();
|
|
413
|
+
console.log(JSON.stringify(result, null, 2));
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
console.error('Failed to update record.');
|
|
417
|
+
if (error instanceof Error) {
|
|
418
|
+
console.error(error.message);
|
|
419
|
+
}
|
|
420
|
+
process.exit(1);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
async function handleDelete(argv, prompter) {
|
|
424
|
+
try {
|
|
425
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
426
|
+
{
|
|
427
|
+
type: 'text',
|
|
428
|
+
name: 'id',
|
|
429
|
+
message: 'id',
|
|
430
|
+
required: true,
|
|
431
|
+
},
|
|
432
|
+
]);
|
|
433
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
434
|
+
const client = getClient();
|
|
435
|
+
const result = await client.webauthnCredential
|
|
436
|
+
.delete({
|
|
437
|
+
where: {
|
|
438
|
+
id: answers.id,
|
|
439
|
+
},
|
|
440
|
+
select: {
|
|
441
|
+
id: true,
|
|
442
|
+
},
|
|
443
|
+
})
|
|
444
|
+
.execute();
|
|
445
|
+
console.log(JSON.stringify(result, null, 2));
|
|
446
|
+
}
|
|
447
|
+
catch (error) {
|
|
448
|
+
console.error('Failed to delete record.');
|
|
449
|
+
if (error instanceof Error) {
|
|
450
|
+
console.error(error.message);
|
|
451
|
+
}
|
|
452
|
+
process.exit(1);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
@@ -35,6 +35,7 @@ import embeddingChunkCmd from './commands/embedding-chunk';
|
|
|
35
35
|
import secureTableProvisionCmd from './commands/secure-table-provision';
|
|
36
36
|
import relationProvisionCmd from './commands/relation-provision';
|
|
37
37
|
import sessionSecretsModuleCmd from './commands/session-secrets-module';
|
|
38
|
+
import identityProvidersModuleCmd from './commands/identity-providers-module';
|
|
38
39
|
import schemaGrantCmd from './commands/schema-grant';
|
|
39
40
|
import defaultPrivilegeCmd from './commands/default-privilege';
|
|
40
41
|
import enumCmd from './commands/enum';
|
|
@@ -74,6 +75,8 @@ import blueprintConstructionCmd from './commands/blueprint-construction';
|
|
|
74
75
|
import storageModuleCmd from './commands/storage-module';
|
|
75
76
|
import entityTypeProvisionCmd from './commands/entity-type-provision';
|
|
76
77
|
import webauthnCredentialsModuleCmd from './commands/webauthn-credentials-module';
|
|
78
|
+
import webauthnAuthModuleCmd from './commands/webauthn-auth-module';
|
|
79
|
+
import notificationsModuleCmd from './commands/notifications-module';
|
|
77
80
|
import databaseProvisionModuleCmd from './commands/database-provision-module';
|
|
78
81
|
import appAdminGrantCmd from './commands/app-admin-grant';
|
|
79
82
|
import appOwnerGrantCmd from './commands/app-owner-grant';
|
|
@@ -95,12 +98,14 @@ import appLevelCmd from './commands/app-level';
|
|
|
95
98
|
import emailCmd from './commands/email';
|
|
96
99
|
import phoneNumberCmd from './commands/phone-number';
|
|
97
100
|
import cryptoAddressCmd from './commands/crypto-address';
|
|
101
|
+
import webauthnCredentialCmd from './commands/webauthn-credential';
|
|
98
102
|
import appInviteCmd from './commands/app-invite';
|
|
99
103
|
import appClaimedInviteCmd from './commands/app-claimed-invite';
|
|
100
104
|
import orgInviteCmd from './commands/org-invite';
|
|
101
105
|
import orgClaimedInviteCmd from './commands/org-claimed-invite';
|
|
102
106
|
import auditLogCmd from './commands/audit-log';
|
|
103
107
|
import appPermissionDefaultCmd from './commands/app-permission-default';
|
|
108
|
+
import identityProviderCmd from './commands/identity-provider';
|
|
104
109
|
import refCmd from './commands/ref';
|
|
105
110
|
import storeCmd from './commands/store';
|
|
106
111
|
import roleTypeCmd from './commands/role-type';
|
|
@@ -110,12 +115,13 @@ import orgLimitDefaultCmd from './commands/org-limit-default';
|
|
|
110
115
|
import devicesModuleCmd from './commands/devices-module';
|
|
111
116
|
import userConnectedAccountCmd from './commands/user-connected-account';
|
|
112
117
|
import appMembershipDefaultCmd from './commands/app-membership-default';
|
|
118
|
+
import orgMembershipDefaultCmd from './commands/org-membership-default';
|
|
113
119
|
import commitCmd from './commands/commit';
|
|
114
120
|
import rateLimitsModuleCmd from './commands/rate-limits-module';
|
|
115
121
|
import membershipTypeCmd from './commands/membership-type';
|
|
116
|
-
import orgMembershipDefaultCmd from './commands/org-membership-default';
|
|
117
122
|
import rlsModuleCmd from './commands/rls-module';
|
|
118
123
|
import sqlActionCmd from './commands/sql-action';
|
|
124
|
+
import orgMembershipSettingCmd from './commands/org-membership-setting';
|
|
119
125
|
import userCmd from './commands/user';
|
|
120
126
|
import astMigrationCmd from './commands/ast-migration';
|
|
121
127
|
import appMembershipCmd from './commands/app-membership';
|
|
@@ -165,7 +171,6 @@ import provisionNewUserCmd from './commands/provision-new-user';
|
|
|
165
171
|
import resetPasswordCmd from './commands/reset-password';
|
|
166
172
|
import removeNodeAtPathCmd from './commands/remove-node-at-path';
|
|
167
173
|
import copyTemplateToBlueprintCmd from './commands/copy-template-to-blueprint';
|
|
168
|
-
import createApiKeyCmd from './commands/create-api-key';
|
|
169
174
|
import provisionSpatialRelationCmd from './commands/provision-spatial-relation';
|
|
170
175
|
import bootstrapUserCmd from './commands/bootstrap-user';
|
|
171
176
|
import setFieldOrderCmd from './commands/set-field-order';
|
|
@@ -183,6 +188,7 @@ import applyRlsCmd from './commands/apply-rls';
|
|
|
183
188
|
import signInCrossOriginCmd from './commands/sign-in-cross-origin';
|
|
184
189
|
import createUserDatabaseCmd from './commands/create-user-database';
|
|
185
190
|
import extendTokenExpiresCmd from './commands/extend-token-expires';
|
|
191
|
+
import createApiKeyCmd from './commands/create-api-key';
|
|
186
192
|
import signUpCmd from './commands/sign-up';
|
|
187
193
|
import requestCrossOriginTokenCmd from './commands/request-cross-origin-token';
|
|
188
194
|
import signInCmd from './commands/sign-in';
|
|
@@ -224,6 +230,7 @@ const createCommandMap = () => ({
|
|
|
224
230
|
'secure-table-provision': secureTableProvisionCmd,
|
|
225
231
|
'relation-provision': relationProvisionCmd,
|
|
226
232
|
'session-secrets-module': sessionSecretsModuleCmd,
|
|
233
|
+
'identity-providers-module': identityProvidersModuleCmd,
|
|
227
234
|
'schema-grant': schemaGrantCmd,
|
|
228
235
|
'default-privilege': defaultPrivilegeCmd,
|
|
229
236
|
enum: enumCmd,
|
|
@@ -263,6 +270,8 @@ const createCommandMap = () => ({
|
|
|
263
270
|
'storage-module': storageModuleCmd,
|
|
264
271
|
'entity-type-provision': entityTypeProvisionCmd,
|
|
265
272
|
'webauthn-credentials-module': webauthnCredentialsModuleCmd,
|
|
273
|
+
'webauthn-auth-module': webauthnAuthModuleCmd,
|
|
274
|
+
'notifications-module': notificationsModuleCmd,
|
|
266
275
|
'database-provision-module': databaseProvisionModuleCmd,
|
|
267
276
|
'app-admin-grant': appAdminGrantCmd,
|
|
268
277
|
'app-owner-grant': appOwnerGrantCmd,
|
|
@@ -284,12 +293,14 @@ const createCommandMap = () => ({
|
|
|
284
293
|
email: emailCmd,
|
|
285
294
|
'phone-number': phoneNumberCmd,
|
|
286
295
|
'crypto-address': cryptoAddressCmd,
|
|
296
|
+
'webauthn-credential': webauthnCredentialCmd,
|
|
287
297
|
'app-invite': appInviteCmd,
|
|
288
298
|
'app-claimed-invite': appClaimedInviteCmd,
|
|
289
299
|
'org-invite': orgInviteCmd,
|
|
290
300
|
'org-claimed-invite': orgClaimedInviteCmd,
|
|
291
301
|
'audit-log': auditLogCmd,
|
|
292
302
|
'app-permission-default': appPermissionDefaultCmd,
|
|
303
|
+
'identity-provider': identityProviderCmd,
|
|
293
304
|
ref: refCmd,
|
|
294
305
|
store: storeCmd,
|
|
295
306
|
'role-type': roleTypeCmd,
|
|
@@ -299,12 +310,13 @@ const createCommandMap = () => ({
|
|
|
299
310
|
'devices-module': devicesModuleCmd,
|
|
300
311
|
'user-connected-account': userConnectedAccountCmd,
|
|
301
312
|
'app-membership-default': appMembershipDefaultCmd,
|
|
313
|
+
'org-membership-default': orgMembershipDefaultCmd,
|
|
302
314
|
commit: commitCmd,
|
|
303
315
|
'rate-limits-module': rateLimitsModuleCmd,
|
|
304
316
|
'membership-type': membershipTypeCmd,
|
|
305
|
-
'org-membership-default': orgMembershipDefaultCmd,
|
|
306
317
|
'rls-module': rlsModuleCmd,
|
|
307
318
|
'sql-action': sqlActionCmd,
|
|
319
|
+
'org-membership-setting': orgMembershipSettingCmd,
|
|
308
320
|
user: userCmd,
|
|
309
321
|
'ast-migration': astMigrationCmd,
|
|
310
322
|
'app-membership': appMembershipCmd,
|
|
@@ -354,7 +366,6 @@ const createCommandMap = () => ({
|
|
|
354
366
|
'reset-password': resetPasswordCmd,
|
|
355
367
|
'remove-node-at-path': removeNodeAtPathCmd,
|
|
356
368
|
'copy-template-to-blueprint': copyTemplateToBlueprintCmd,
|
|
357
|
-
'create-api-key': createApiKeyCmd,
|
|
358
369
|
'provision-spatial-relation': provisionSpatialRelationCmd,
|
|
359
370
|
'bootstrap-user': bootstrapUserCmd,
|
|
360
371
|
'set-field-order': setFieldOrderCmd,
|
|
@@ -372,6 +383,7 @@ const createCommandMap = () => ({
|
|
|
372
383
|
'sign-in-cross-origin': signInCrossOriginCmd,
|
|
373
384
|
'create-user-database': createUserDatabaseCmd,
|
|
374
385
|
'extend-token-expires': extendTokenExpiresCmd,
|
|
386
|
+
'create-api-key': createApiKeyCmd,
|
|
375
387
|
'sign-up': signUpCmd,
|
|
376
388
|
'request-cross-origin-token': requestCrossOriginTokenCmd,
|
|
377
389
|
'sign-in': signInCmd,
|
|
@@ -382,7 +394,7 @@ const createCommandMap = () => ({
|
|
|
382
394
|
'confirm-upload': confirmUploadCmd,
|
|
383
395
|
'provision-bucket': provisionBucketCmd,
|
|
384
396
|
});
|
|
385
|
-
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 spatial-relation spatialRelation 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 secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule 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 entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule 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-member-profile orgMemberProfile 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 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 devices-module devicesModule CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n membership-type membershipType 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-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\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 disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\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. Six phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (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. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-new-user provisionNewUser\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 create-api-key createApiKey\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\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-cross-origin signInCrossOrigin\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-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\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";
|
|
397
|
+
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 spatial-relation spatialRelation 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 secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n identity-providers-module identityProvidersModule 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 entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n notifications-module notificationsModule 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-member-profile orgMemberProfile 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 webauthn-credential webauthnCredential 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 identity-provider identityProvider 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 devices-module devicesModule CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n commit commit CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n membership-type membershipType CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n org-membership-setting orgMembershipSetting 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-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\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 disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\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. Six phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (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. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-new-user provisionNewUser\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 provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\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-cross-origin signInCrossOrigin\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 create-api-key createApiKey\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\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";
|
|
386
398
|
export const commands = async (argv, prompter, options) => {
|
|
387
399
|
if (argv.help || argv.h) {
|
|
388
400
|
console.log(usage);
|