@constructive-sdk/cli 0.14.6 → 0.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/admin/cli/commands/org-membership-default.js +0 -44
  2. package/admin/cli/commands/org-membership-setting.d.ts +8 -0
  3. package/admin/cli/commands/org-membership-setting.js +418 -0
  4. package/admin/cli/commands.js +5 -3
  5. package/admin/cli/executor.d.ts +2 -1
  6. package/admin/orm/index.d.ts +4 -2
  7. package/admin/orm/index.js +4 -2
  8. package/admin/orm/input-types.d.ts +303 -142
  9. package/admin/orm/models/index.d.ts +2 -1
  10. package/admin/orm/models/index.js +5 -3
  11. package/admin/orm/models/orgMembershipSetting.d.ts +56 -0
  12. package/admin/orm/models/orgMembershipSetting.js +100 -0
  13. package/auth/cli/commands/crypto-address.js +22 -0
  14. package/auth/cli/commands/email.js +22 -0
  15. package/auth/cli/commands/identity-provider.d.ts +8 -0
  16. package/auth/cli/commands/identity-provider.js +164 -0
  17. package/auth/cli/commands/phone-number.js +22 -0
  18. package/auth/cli/commands/webauthn-credential.d.ts +8 -0
  19. package/auth/cli/commands/webauthn-credential.js +456 -0
  20. package/auth/cli/commands.js +7 -3
  21. package/auth/cli/executor.d.ts +7 -5
  22. package/auth/orm/index.d.ts +9 -5
  23. package/auth/orm/index.js +4 -0
  24. package/auth/orm/input-types.d.ts +525 -81
  25. package/auth/orm/input-types.js +1 -0
  26. package/auth/orm/models/identityProvider.d.ts +32 -0
  27. package/auth/orm/models/identityProvider.js +55 -0
  28. package/auth/orm/models/index.d.ts +2 -0
  29. package/auth/orm/models/index.js +5 -1
  30. package/auth/orm/models/webauthnCredential.d.ts +56 -0
  31. package/auth/orm/models/webauthnCredential.js +100 -0
  32. package/auth/orm/mutation/index.d.ts +9 -9
  33. package/auth/orm/mutation/index.js +12 -12
  34. package/esm/admin/cli/commands/org-membership-default.js +0 -44
  35. package/esm/admin/cli/commands/org-membership-setting.d.ts +8 -0
  36. package/esm/admin/cli/commands/org-membership-setting.js +416 -0
  37. package/esm/admin/cli/commands.js +5 -3
  38. package/esm/admin/cli/executor.d.ts +2 -1
  39. package/esm/admin/orm/index.d.ts +4 -2
  40. package/esm/admin/orm/index.js +4 -2
  41. package/esm/admin/orm/input-types.d.ts +303 -142
  42. package/esm/admin/orm/models/index.d.ts +2 -1
  43. package/esm/admin/orm/models/index.js +2 -1
  44. package/esm/admin/orm/models/orgMembershipSetting.d.ts +56 -0
  45. package/esm/admin/orm/models/orgMembershipSetting.js +96 -0
  46. package/esm/auth/cli/commands/crypto-address.js +22 -0
  47. package/esm/auth/cli/commands/email.js +22 -0
  48. package/esm/auth/cli/commands/identity-provider.d.ts +8 -0
  49. package/esm/auth/cli/commands/identity-provider.js +162 -0
  50. package/esm/auth/cli/commands/phone-number.js +22 -0
  51. package/esm/auth/cli/commands/webauthn-credential.d.ts +8 -0
  52. package/esm/auth/cli/commands/webauthn-credential.js +454 -0
  53. package/esm/auth/cli/commands.js +7 -3
  54. package/esm/auth/cli/executor.d.ts +7 -5
  55. package/esm/auth/orm/index.d.ts +9 -5
  56. package/esm/auth/orm/index.js +4 -0
  57. package/esm/auth/orm/input-types.d.ts +525 -81
  58. package/esm/auth/orm/input-types.js +1 -0
  59. package/esm/auth/orm/models/identityProvider.d.ts +32 -0
  60. package/esm/auth/orm/models/identityProvider.js +51 -0
  61. package/esm/auth/orm/models/index.d.ts +2 -0
  62. package/esm/auth/orm/models/index.js +2 -0
  63. package/esm/auth/orm/models/webauthnCredential.d.ts +56 -0
  64. package/esm/auth/orm/models/webauthnCredential.js +96 -0
  65. package/esm/auth/orm/mutation/index.d.ts +9 -9
  66. package/esm/auth/orm/mutation/index.js +12 -12
  67. package/esm/objects/orm/input-types.d.ts +12 -0
  68. package/esm/public/cli/commands/crypto-address.js +22 -0
  69. package/esm/public/cli/commands/email.js +22 -0
  70. package/esm/public/cli/commands/entity-type-provision.js +110 -0
  71. package/esm/public/cli/commands/identity-provider.d.ts +8 -0
  72. package/esm/public/cli/commands/identity-provider.js +162 -0
  73. package/esm/public/cli/commands/identity-providers-module.d.ts +8 -0
  74. package/esm/public/cli/commands/identity-providers-module.js +316 -0
  75. package/esm/public/cli/commands/memberships-module.js +44 -0
  76. package/esm/public/cli/commands/notifications-module.d.ts +8 -0
  77. package/esm/public/cli/commands/notifications-module.js +448 -0
  78. package/esm/public/cli/commands/org-membership-default.js +0 -44
  79. package/esm/public/cli/commands/org-membership-setting.d.ts +8 -0
  80. package/esm/public/cli/commands/org-membership-setting.js +416 -0
  81. package/esm/public/cli/commands/phone-number.js +22 -0
  82. package/esm/public/cli/commands/relation-provision.js +24 -156
  83. package/esm/public/cli/commands/secure-table-provision.js +24 -156
  84. package/esm/public/cli/commands/storage-module.js +44 -0
  85. package/esm/public/cli/commands/webauthn-auth-module.d.ts +8 -0
  86. package/esm/public/cli/commands/webauthn-auth-module.js +536 -0
  87. package/esm/public/cli/commands/webauthn-credential.d.ts +8 -0
  88. package/esm/public/cli/commands/webauthn-credential.js +454 -0
  89. package/esm/public/cli/commands.js +17 -5
  90. package/esm/public/cli/executor.d.ts +12 -6
  91. package/esm/public/orm/index.d.ts +19 -7
  92. package/esm/public/orm/index.js +14 -2
  93. package/esm/public/orm/input-types.d.ts +1827 -366
  94. package/esm/public/orm/input-types.js +7 -0
  95. package/esm/public/orm/models/identityProvider.d.ts +32 -0
  96. package/esm/public/orm/models/identityProvider.js +51 -0
  97. package/esm/public/orm/models/identityProvidersModule.d.ts +56 -0
  98. package/esm/public/orm/models/identityProvidersModule.js +96 -0
  99. package/esm/public/orm/models/index.d.ts +7 -1
  100. package/esm/public/orm/models/index.js +7 -1
  101. package/esm/public/orm/models/notificationsModule.d.ts +56 -0
  102. package/esm/public/orm/models/notificationsModule.js +96 -0
  103. package/esm/public/orm/models/orgMembershipSetting.d.ts +56 -0
  104. package/esm/public/orm/models/orgMembershipSetting.js +96 -0
  105. package/esm/public/orm/models/webauthnAuthModule.d.ts +56 -0
  106. package/esm/public/orm/models/webauthnAuthModule.js +96 -0
  107. package/esm/public/orm/models/webauthnCredential.d.ts +56 -0
  108. package/esm/public/orm/models/webauthnCredential.js +96 -0
  109. package/esm/public/orm/mutation/index.d.ts +9 -9
  110. package/esm/public/orm/mutation/index.js +12 -12
  111. package/objects/orm/input-types.d.ts +12 -0
  112. package/package.json +3 -3
  113. package/public/cli/commands/crypto-address.js +22 -0
  114. package/public/cli/commands/email.js +22 -0
  115. package/public/cli/commands/entity-type-provision.js +110 -0
  116. package/public/cli/commands/identity-provider.d.ts +8 -0
  117. package/public/cli/commands/identity-provider.js +164 -0
  118. package/public/cli/commands/identity-providers-module.d.ts +8 -0
  119. package/public/cli/commands/identity-providers-module.js +318 -0
  120. package/public/cli/commands/memberships-module.js +44 -0
  121. package/public/cli/commands/notifications-module.d.ts +8 -0
  122. package/public/cli/commands/notifications-module.js +450 -0
  123. package/public/cli/commands/org-membership-default.js +0 -44
  124. package/public/cli/commands/org-membership-setting.d.ts +8 -0
  125. package/public/cli/commands/org-membership-setting.js +418 -0
  126. package/public/cli/commands/phone-number.js +22 -0
  127. package/public/cli/commands/relation-provision.js +24 -156
  128. package/public/cli/commands/secure-table-provision.js +24 -156
  129. package/public/cli/commands/storage-module.js +44 -0
  130. package/public/cli/commands/webauthn-auth-module.d.ts +8 -0
  131. package/public/cli/commands/webauthn-auth-module.js +538 -0
  132. package/public/cli/commands/webauthn-credential.d.ts +8 -0
  133. package/public/cli/commands/webauthn-credential.js +456 -0
  134. package/public/cli/commands.js +17 -5
  135. package/public/cli/executor.d.ts +12 -6
  136. package/public/orm/index.d.ts +19 -7
  137. package/public/orm/index.js +14 -2
  138. package/public/orm/input-types.d.ts +1827 -366
  139. package/public/orm/input-types.js +7 -0
  140. package/public/orm/models/identityProvider.d.ts +32 -0
  141. package/public/orm/models/identityProvider.js +55 -0
  142. package/public/orm/models/identityProvidersModule.d.ts +56 -0
  143. package/public/orm/models/identityProvidersModule.js +100 -0
  144. package/public/orm/models/index.d.ts +7 -1
  145. package/public/orm/models/index.js +17 -5
  146. package/public/orm/models/notificationsModule.d.ts +56 -0
  147. package/public/orm/models/notificationsModule.js +100 -0
  148. package/public/orm/models/orgMembershipSetting.d.ts +56 -0
  149. package/public/orm/models/orgMembershipSetting.js +100 -0
  150. package/public/orm/models/webauthnAuthModule.d.ts +56 -0
  151. package/public/orm/models/webauthnAuthModule.js +100 -0
  152. package/public/orm/models/webauthnCredential.d.ts +56 -0
  153. package/public/orm/models/webauthnCredential.js +100 -0
  154. package/public/orm/mutation/index.d.ts +9 -9
  155. package/public/orm/mutation/index.js +12 -12
@@ -0,0 +1,456 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for WebauthnCredential
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
+ ownerId: 'uuid',
14
+ credentialId: 'string',
15
+ publicKey: 'string',
16
+ signCount: 'int',
17
+ webauthnUserId: 'string',
18
+ transports: 'string',
19
+ credentialDeviceType: 'string',
20
+ backupEligible: 'boolean',
21
+ backupState: 'boolean',
22
+ name: 'string',
23
+ lastUsedAt: 'string',
24
+ createdAt: 'string',
25
+ updatedAt: 'string',
26
+ };
27
+ 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';
28
+ exports.default = async (argv, prompter, _options) => {
29
+ if (argv.help || argv.h) {
30
+ console.log(usage);
31
+ process.exit(0);
32
+ }
33
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
34
+ if (!subcommand) {
35
+ const answer = await prompter.prompt(argv, [
36
+ {
37
+ type: 'autocomplete',
38
+ name: 'subcommand',
39
+ message: 'What do you want to do?',
40
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
41
+ },
42
+ ]);
43
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
44
+ }
45
+ return handleTableSubcommand(subcommand, newArgv, prompter);
46
+ };
47
+ async function handleTableSubcommand(subcommand, argv, prompter) {
48
+ switch (subcommand) {
49
+ case 'list':
50
+ return handleList(argv, prompter);
51
+ case 'find-first':
52
+ return handleFindFirst(argv, prompter);
53
+ case 'get':
54
+ return handleGet(argv, prompter);
55
+ case 'create':
56
+ return handleCreate(argv, prompter);
57
+ case 'update':
58
+ return handleUpdate(argv, prompter);
59
+ case 'delete':
60
+ return handleDelete(argv, prompter);
61
+ default:
62
+ console.log(usage);
63
+ process.exit(1);
64
+ }
65
+ }
66
+ async function handleList(argv, _prompter) {
67
+ try {
68
+ const defaultSelect = {
69
+ id: true,
70
+ ownerId: true,
71
+ credentialId: true,
72
+ publicKey: true,
73
+ signCount: true,
74
+ webauthnUserId: true,
75
+ transports: true,
76
+ credentialDeviceType: true,
77
+ backupEligible: true,
78
+ backupState: true,
79
+ name: true,
80
+ lastUsedAt: true,
81
+ createdAt: true,
82
+ updatedAt: true,
83
+ };
84
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
85
+ const client = (0, executor_1.getClient)();
86
+ const result = await client.webauthnCredential.findMany(findManyArgs).execute();
87
+ console.log(JSON.stringify(result, null, 2));
88
+ }
89
+ catch (error) {
90
+ console.error('Failed to list records.');
91
+ if (error instanceof Error) {
92
+ console.error(error.message);
93
+ }
94
+ process.exit(1);
95
+ }
96
+ }
97
+ async function handleFindFirst(argv, _prompter) {
98
+ try {
99
+ const defaultSelect = {
100
+ id: true,
101
+ ownerId: true,
102
+ credentialId: true,
103
+ publicKey: true,
104
+ signCount: true,
105
+ webauthnUserId: true,
106
+ transports: true,
107
+ credentialDeviceType: true,
108
+ backupEligible: true,
109
+ backupState: true,
110
+ name: true,
111
+ lastUsedAt: true,
112
+ createdAt: true,
113
+ updatedAt: true,
114
+ };
115
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
116
+ const client = (0, executor_1.getClient)();
117
+ const result = await client.webauthnCredential.findFirst(findFirstArgs).execute();
118
+ console.log(JSON.stringify(result, null, 2));
119
+ }
120
+ catch (error) {
121
+ console.error('Failed to find record.');
122
+ if (error instanceof Error) {
123
+ console.error(error.message);
124
+ }
125
+ process.exit(1);
126
+ }
127
+ }
128
+ async function handleGet(argv, prompter) {
129
+ try {
130
+ const answers = await prompter.prompt(argv, [
131
+ {
132
+ type: 'text',
133
+ name: 'id',
134
+ message: 'id',
135
+ required: true,
136
+ },
137
+ ]);
138
+ const client = (0, executor_1.getClient)();
139
+ const result = await client.webauthnCredential
140
+ .findOne({
141
+ id: answers.id,
142
+ select: {
143
+ id: true,
144
+ ownerId: true,
145
+ credentialId: true,
146
+ publicKey: true,
147
+ signCount: true,
148
+ webauthnUserId: true,
149
+ transports: true,
150
+ credentialDeviceType: true,
151
+ backupEligible: true,
152
+ backupState: true,
153
+ name: true,
154
+ lastUsedAt: true,
155
+ createdAt: true,
156
+ updatedAt: true,
157
+ },
158
+ })
159
+ .execute();
160
+ console.log(JSON.stringify(result, null, 2));
161
+ }
162
+ catch (error) {
163
+ console.error('Record not found.');
164
+ if (error instanceof Error) {
165
+ console.error(error.message);
166
+ }
167
+ process.exit(1);
168
+ }
169
+ }
170
+ async function handleCreate(argv, prompter) {
171
+ try {
172
+ const rawAnswers = await prompter.prompt(argv, [
173
+ {
174
+ type: 'text',
175
+ name: 'ownerId',
176
+ message: 'ownerId',
177
+ required: false,
178
+ skipPrompt: true,
179
+ },
180
+ {
181
+ type: 'text',
182
+ name: 'credentialId',
183
+ message: 'credentialId',
184
+ required: true,
185
+ },
186
+ {
187
+ type: 'text',
188
+ name: 'publicKey',
189
+ message: 'publicKey',
190
+ required: true,
191
+ },
192
+ {
193
+ type: 'text',
194
+ name: 'signCount',
195
+ message: 'signCount',
196
+ required: false,
197
+ skipPrompt: true,
198
+ },
199
+ {
200
+ type: 'text',
201
+ name: 'webauthnUserId',
202
+ message: 'webauthnUserId',
203
+ required: true,
204
+ },
205
+ {
206
+ type: 'text',
207
+ name: 'transports',
208
+ message: 'transports',
209
+ required: false,
210
+ skipPrompt: true,
211
+ },
212
+ {
213
+ type: 'text',
214
+ name: 'credentialDeviceType',
215
+ message: 'credentialDeviceType',
216
+ required: true,
217
+ },
218
+ {
219
+ type: 'boolean',
220
+ name: 'backupEligible',
221
+ message: 'backupEligible',
222
+ required: false,
223
+ skipPrompt: true,
224
+ },
225
+ {
226
+ type: 'boolean',
227
+ name: 'backupState',
228
+ message: 'backupState',
229
+ required: false,
230
+ skipPrompt: true,
231
+ },
232
+ {
233
+ type: 'text',
234
+ name: 'name',
235
+ message: 'name',
236
+ required: false,
237
+ skipPrompt: true,
238
+ },
239
+ {
240
+ type: 'text',
241
+ name: 'lastUsedAt',
242
+ message: 'lastUsedAt',
243
+ required: false,
244
+ skipPrompt: true,
245
+ },
246
+ ]);
247
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
248
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
249
+ const client = (0, executor_1.getClient)();
250
+ const result = await client.webauthnCredential
251
+ .create({
252
+ data: {
253
+ ownerId: cleanedData.ownerId,
254
+ credentialId: cleanedData.credentialId,
255
+ publicKey: cleanedData.publicKey,
256
+ signCount: cleanedData.signCount,
257
+ webauthnUserId: cleanedData.webauthnUserId,
258
+ transports: cleanedData.transports,
259
+ credentialDeviceType: cleanedData.credentialDeviceType,
260
+ backupEligible: cleanedData.backupEligible,
261
+ backupState: cleanedData.backupState,
262
+ name: cleanedData.name,
263
+ lastUsedAt: cleanedData.lastUsedAt,
264
+ },
265
+ select: {
266
+ id: true,
267
+ ownerId: true,
268
+ credentialId: true,
269
+ publicKey: true,
270
+ signCount: true,
271
+ webauthnUserId: true,
272
+ transports: true,
273
+ credentialDeviceType: true,
274
+ backupEligible: true,
275
+ backupState: true,
276
+ name: true,
277
+ lastUsedAt: true,
278
+ createdAt: true,
279
+ updatedAt: true,
280
+ },
281
+ })
282
+ .execute();
283
+ console.log(JSON.stringify(result, null, 2));
284
+ }
285
+ catch (error) {
286
+ console.error('Failed to create record.');
287
+ if (error instanceof Error) {
288
+ console.error(error.message);
289
+ }
290
+ process.exit(1);
291
+ }
292
+ }
293
+ async function handleUpdate(argv, prompter) {
294
+ try {
295
+ const rawAnswers = await prompter.prompt(argv, [
296
+ {
297
+ type: 'text',
298
+ name: 'id',
299
+ message: 'id',
300
+ required: true,
301
+ },
302
+ {
303
+ type: 'text',
304
+ name: 'ownerId',
305
+ message: 'ownerId',
306
+ required: false,
307
+ skipPrompt: true,
308
+ },
309
+ {
310
+ type: 'text',
311
+ name: 'credentialId',
312
+ message: 'credentialId',
313
+ required: false,
314
+ },
315
+ {
316
+ type: 'text',
317
+ name: 'publicKey',
318
+ message: 'publicKey',
319
+ required: false,
320
+ },
321
+ {
322
+ type: 'text',
323
+ name: 'signCount',
324
+ message: 'signCount',
325
+ required: false,
326
+ skipPrompt: true,
327
+ },
328
+ {
329
+ type: 'text',
330
+ name: 'webauthnUserId',
331
+ message: 'webauthnUserId',
332
+ required: false,
333
+ },
334
+ {
335
+ type: 'text',
336
+ name: 'transports',
337
+ message: 'transports',
338
+ required: false,
339
+ skipPrompt: true,
340
+ },
341
+ {
342
+ type: 'text',
343
+ name: 'credentialDeviceType',
344
+ message: 'credentialDeviceType',
345
+ required: false,
346
+ },
347
+ {
348
+ type: 'boolean',
349
+ name: 'backupEligible',
350
+ message: 'backupEligible',
351
+ required: false,
352
+ skipPrompt: true,
353
+ },
354
+ {
355
+ type: 'boolean',
356
+ name: 'backupState',
357
+ message: 'backupState',
358
+ required: false,
359
+ skipPrompt: true,
360
+ },
361
+ {
362
+ type: 'text',
363
+ name: 'name',
364
+ message: 'name',
365
+ required: false,
366
+ skipPrompt: true,
367
+ },
368
+ {
369
+ type: 'text',
370
+ name: 'lastUsedAt',
371
+ message: 'lastUsedAt',
372
+ required: false,
373
+ skipPrompt: true,
374
+ },
375
+ ]);
376
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
377
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
378
+ const client = (0, executor_1.getClient)();
379
+ const result = await client.webauthnCredential
380
+ .update({
381
+ where: {
382
+ id: answers.id,
383
+ },
384
+ data: {
385
+ ownerId: cleanedData.ownerId,
386
+ credentialId: cleanedData.credentialId,
387
+ publicKey: cleanedData.publicKey,
388
+ signCount: cleanedData.signCount,
389
+ webauthnUserId: cleanedData.webauthnUserId,
390
+ transports: cleanedData.transports,
391
+ credentialDeviceType: cleanedData.credentialDeviceType,
392
+ backupEligible: cleanedData.backupEligible,
393
+ backupState: cleanedData.backupState,
394
+ name: cleanedData.name,
395
+ lastUsedAt: cleanedData.lastUsedAt,
396
+ },
397
+ select: {
398
+ id: true,
399
+ ownerId: true,
400
+ credentialId: true,
401
+ publicKey: true,
402
+ signCount: true,
403
+ webauthnUserId: true,
404
+ transports: true,
405
+ credentialDeviceType: true,
406
+ backupEligible: true,
407
+ backupState: true,
408
+ name: true,
409
+ lastUsedAt: true,
410
+ createdAt: true,
411
+ updatedAt: true,
412
+ },
413
+ })
414
+ .execute();
415
+ console.log(JSON.stringify(result, null, 2));
416
+ }
417
+ catch (error) {
418
+ console.error('Failed to update record.');
419
+ if (error instanceof Error) {
420
+ console.error(error.message);
421
+ }
422
+ process.exit(1);
423
+ }
424
+ }
425
+ async function handleDelete(argv, prompter) {
426
+ try {
427
+ const rawAnswers = await prompter.prompt(argv, [
428
+ {
429
+ type: 'text',
430
+ name: 'id',
431
+ message: 'id',
432
+ required: true,
433
+ },
434
+ ]);
435
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
436
+ const client = (0, executor_1.getClient)();
437
+ const result = await client.webauthnCredential
438
+ .delete({
439
+ where: {
440
+ id: answers.id,
441
+ },
442
+ select: {
443
+ id: true,
444
+ },
445
+ })
446
+ .execute();
447
+ console.log(JSON.stringify(result, null, 2));
448
+ }
449
+ catch (error) {
450
+ console.error('Failed to delete record.');
451
+ if (error instanceof Error) {
452
+ console.error(error.message);
453
+ }
454
+ process.exit(1);
455
+ }
456
+ }
@@ -41,6 +41,7 @@ const embedding_chunk_1 = __importDefault(require("./commands/embedding-chunk"))
41
41
  const secure_table_provision_1 = __importDefault(require("./commands/secure-table-provision"));
42
42
  const relation_provision_1 = __importDefault(require("./commands/relation-provision"));
43
43
  const session_secrets_module_1 = __importDefault(require("./commands/session-secrets-module"));
44
+ const identity_providers_module_1 = __importDefault(require("./commands/identity-providers-module"));
44
45
  const schema_grant_1 = __importDefault(require("./commands/schema-grant"));
45
46
  const default_privilege_1 = __importDefault(require("./commands/default-privilege"));
46
47
  const enum_1 = __importDefault(require("./commands/enum"));
@@ -80,6 +81,8 @@ const blueprint_construction_1 = __importDefault(require("./commands/blueprint-c
80
81
  const storage_module_1 = __importDefault(require("./commands/storage-module"));
81
82
  const entity_type_provision_1 = __importDefault(require("./commands/entity-type-provision"));
82
83
  const webauthn_credentials_module_1 = __importDefault(require("./commands/webauthn-credentials-module"));
84
+ const webauthn_auth_module_1 = __importDefault(require("./commands/webauthn-auth-module"));
85
+ const notifications_module_1 = __importDefault(require("./commands/notifications-module"));
83
86
  const database_provision_module_1 = __importDefault(require("./commands/database-provision-module"));
84
87
  const app_admin_grant_1 = __importDefault(require("./commands/app-admin-grant"));
85
88
  const app_owner_grant_1 = __importDefault(require("./commands/app-owner-grant"));
@@ -101,12 +104,14 @@ const app_level_1 = __importDefault(require("./commands/app-level"));
101
104
  const email_1 = __importDefault(require("./commands/email"));
102
105
  const phone_number_1 = __importDefault(require("./commands/phone-number"));
103
106
  const crypto_address_1 = __importDefault(require("./commands/crypto-address"));
107
+ const webauthn_credential_1 = __importDefault(require("./commands/webauthn-credential"));
104
108
  const app_invite_1 = __importDefault(require("./commands/app-invite"));
105
109
  const app_claimed_invite_1 = __importDefault(require("./commands/app-claimed-invite"));
106
110
  const org_invite_1 = __importDefault(require("./commands/org-invite"));
107
111
  const org_claimed_invite_1 = __importDefault(require("./commands/org-claimed-invite"));
108
112
  const audit_log_1 = __importDefault(require("./commands/audit-log"));
109
113
  const app_permission_default_1 = __importDefault(require("./commands/app-permission-default"));
114
+ const identity_provider_1 = __importDefault(require("./commands/identity-provider"));
110
115
  const ref_1 = __importDefault(require("./commands/ref"));
111
116
  const store_1 = __importDefault(require("./commands/store"));
112
117
  const role_type_1 = __importDefault(require("./commands/role-type"));
@@ -116,12 +121,13 @@ const org_limit_default_1 = __importDefault(require("./commands/org-limit-defaul
116
121
  const devices_module_1 = __importDefault(require("./commands/devices-module"));
117
122
  const user_connected_account_1 = __importDefault(require("./commands/user-connected-account"));
118
123
  const app_membership_default_1 = __importDefault(require("./commands/app-membership-default"));
124
+ const org_membership_default_1 = __importDefault(require("./commands/org-membership-default"));
119
125
  const commit_1 = __importDefault(require("./commands/commit"));
120
126
  const rate_limits_module_1 = __importDefault(require("./commands/rate-limits-module"));
121
127
  const membership_type_1 = __importDefault(require("./commands/membership-type"));
122
- const org_membership_default_1 = __importDefault(require("./commands/org-membership-default"));
123
128
  const rls_module_1 = __importDefault(require("./commands/rls-module"));
124
129
  const sql_action_1 = __importDefault(require("./commands/sql-action"));
130
+ const org_membership_setting_1 = __importDefault(require("./commands/org-membership-setting"));
125
131
  const user_1 = __importDefault(require("./commands/user"));
126
132
  const ast_migration_1 = __importDefault(require("./commands/ast-migration"));
127
133
  const app_membership_1 = __importDefault(require("./commands/app-membership"));
@@ -171,7 +177,6 @@ const provision_new_user_1 = __importDefault(require("./commands/provision-new-u
171
177
  const reset_password_1 = __importDefault(require("./commands/reset-password"));
172
178
  const remove_node_at_path_1 = __importDefault(require("./commands/remove-node-at-path"));
173
179
  const copy_template_to_blueprint_1 = __importDefault(require("./commands/copy-template-to-blueprint"));
174
- const create_api_key_1 = __importDefault(require("./commands/create-api-key"));
175
180
  const provision_spatial_relation_1 = __importDefault(require("./commands/provision-spatial-relation"));
176
181
  const bootstrap_user_1 = __importDefault(require("./commands/bootstrap-user"));
177
182
  const set_field_order_1 = __importDefault(require("./commands/set-field-order"));
@@ -189,6 +194,7 @@ const apply_rls_1 = __importDefault(require("./commands/apply-rls"));
189
194
  const sign_in_cross_origin_1 = __importDefault(require("./commands/sign-in-cross-origin"));
190
195
  const create_user_database_1 = __importDefault(require("./commands/create-user-database"));
191
196
  const extend_token_expires_1 = __importDefault(require("./commands/extend-token-expires"));
197
+ const create_api_key_1 = __importDefault(require("./commands/create-api-key"));
192
198
  const sign_up_1 = __importDefault(require("./commands/sign-up"));
193
199
  const request_cross_origin_token_1 = __importDefault(require("./commands/request-cross-origin-token"));
194
200
  const sign_in_1 = __importDefault(require("./commands/sign-in"));
@@ -230,6 +236,7 @@ const createCommandMap = () => ({
230
236
  'secure-table-provision': secure_table_provision_1.default,
231
237
  'relation-provision': relation_provision_1.default,
232
238
  'session-secrets-module': session_secrets_module_1.default,
239
+ 'identity-providers-module': identity_providers_module_1.default,
233
240
  'schema-grant': schema_grant_1.default,
234
241
  'default-privilege': default_privilege_1.default,
235
242
  enum: enum_1.default,
@@ -269,6 +276,8 @@ const createCommandMap = () => ({
269
276
  'storage-module': storage_module_1.default,
270
277
  'entity-type-provision': entity_type_provision_1.default,
271
278
  'webauthn-credentials-module': webauthn_credentials_module_1.default,
279
+ 'webauthn-auth-module': webauthn_auth_module_1.default,
280
+ 'notifications-module': notifications_module_1.default,
272
281
  'database-provision-module': database_provision_module_1.default,
273
282
  'app-admin-grant': app_admin_grant_1.default,
274
283
  'app-owner-grant': app_owner_grant_1.default,
@@ -290,12 +299,14 @@ const createCommandMap = () => ({
290
299
  email: email_1.default,
291
300
  'phone-number': phone_number_1.default,
292
301
  'crypto-address': crypto_address_1.default,
302
+ 'webauthn-credential': webauthn_credential_1.default,
293
303
  'app-invite': app_invite_1.default,
294
304
  'app-claimed-invite': app_claimed_invite_1.default,
295
305
  'org-invite': org_invite_1.default,
296
306
  'org-claimed-invite': org_claimed_invite_1.default,
297
307
  'audit-log': audit_log_1.default,
298
308
  'app-permission-default': app_permission_default_1.default,
309
+ 'identity-provider': identity_provider_1.default,
299
310
  ref: ref_1.default,
300
311
  store: store_1.default,
301
312
  'role-type': role_type_1.default,
@@ -305,12 +316,13 @@ const createCommandMap = () => ({
305
316
  'devices-module': devices_module_1.default,
306
317
  'user-connected-account': user_connected_account_1.default,
307
318
  'app-membership-default': app_membership_default_1.default,
319
+ 'org-membership-default': org_membership_default_1.default,
308
320
  commit: commit_1.default,
309
321
  'rate-limits-module': rate_limits_module_1.default,
310
322
  'membership-type': membership_type_1.default,
311
- 'org-membership-default': org_membership_default_1.default,
312
323
  'rls-module': rls_module_1.default,
313
324
  'sql-action': sql_action_1.default,
325
+ 'org-membership-setting': org_membership_setting_1.default,
314
326
  user: user_1.default,
315
327
  'ast-migration': ast_migration_1.default,
316
328
  'app-membership': app_membership_1.default,
@@ -360,7 +372,6 @@ const createCommandMap = () => ({
360
372
  'reset-password': reset_password_1.default,
361
373
  'remove-node-at-path': remove_node_at_path_1.default,
362
374
  'copy-template-to-blueprint': copy_template_to_blueprint_1.default,
363
- 'create-api-key': create_api_key_1.default,
364
375
  'provision-spatial-relation': provision_spatial_relation_1.default,
365
376
  'bootstrap-user': bootstrap_user_1.default,
366
377
  'set-field-order': set_field_order_1.default,
@@ -378,6 +389,7 @@ const createCommandMap = () => ({
378
389
  'sign-in-cross-origin': sign_in_cross_origin_1.default,
379
390
  'create-user-database': create_user_database_1.default,
380
391
  'extend-token-expires': extend_token_expires_1.default,
392
+ 'create-api-key': create_api_key_1.default,
381
393
  'sign-up': sign_up_1.default,
382
394
  'request-cross-origin-token': request_cross_origin_token_1.default,
383
395
  'sign-in': sign_in_1.default,
@@ -388,7 +400,7 @@ const createCommandMap = () => ({
388
400
  'confirm-upload': confirm_upload_1.default,
389
401
  'provision-bucket': provision_bucket_1.default,
390
402
  });
391
- 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";
403
+ 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";
392
404
  const commands = async (argv, prompter, options) => {
393
405
  if (argv.help || argv.h) {
394
406
  console.log(usage);