@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.
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,536 @@
1
+ /**
2
+ * CLI commands for WebauthnAuthModule
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
+ databaseId: 'uuid',
12
+ schemaId: 'uuid',
13
+ usersTableId: 'uuid',
14
+ credentialsTableId: 'uuid',
15
+ sessionsTableId: 'uuid',
16
+ sessionCredentialsTableId: 'uuid',
17
+ sessionSecretsTableId: 'uuid',
18
+ authSettingsTableId: 'uuid',
19
+ rpId: 'string',
20
+ rpName: 'string',
21
+ originAllowlist: 'string',
22
+ attestationType: 'string',
23
+ requireUserVerification: 'boolean',
24
+ residentKey: 'string',
25
+ challengeExpiry: 'string',
26
+ };
27
+ const usage = '\nwebauthn-auth-module <command>\n\nCommands:\n list List webauthnAuthModule records\n find-first Find first matching webauthnAuthModule record\n get Get a webauthnAuthModule by ID\n create Create a new webauthnAuthModule\n update Update an existing webauthnAuthModule\n delete Delete a webauthnAuthModule\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
+ export 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 } = 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
+ databaseId: true,
71
+ schemaId: true,
72
+ usersTableId: true,
73
+ credentialsTableId: true,
74
+ sessionsTableId: true,
75
+ sessionCredentialsTableId: true,
76
+ sessionSecretsTableId: true,
77
+ authSettingsTableId: true,
78
+ rpId: true,
79
+ rpName: true,
80
+ originAllowlist: true,
81
+ attestationType: true,
82
+ requireUserVerification: true,
83
+ residentKey: true,
84
+ challengeExpiry: true,
85
+ };
86
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
87
+ const client = getClient();
88
+ const result = await client.webauthnAuthModule.findMany(findManyArgs).execute();
89
+ console.log(JSON.stringify(result, null, 2));
90
+ }
91
+ catch (error) {
92
+ console.error('Failed to list records.');
93
+ if (error instanceof Error) {
94
+ console.error(error.message);
95
+ }
96
+ process.exit(1);
97
+ }
98
+ }
99
+ async function handleFindFirst(argv, _prompter) {
100
+ try {
101
+ const defaultSelect = {
102
+ id: true,
103
+ databaseId: true,
104
+ schemaId: true,
105
+ usersTableId: true,
106
+ credentialsTableId: true,
107
+ sessionsTableId: true,
108
+ sessionCredentialsTableId: true,
109
+ sessionSecretsTableId: true,
110
+ authSettingsTableId: true,
111
+ rpId: true,
112
+ rpName: true,
113
+ originAllowlist: true,
114
+ attestationType: true,
115
+ requireUserVerification: true,
116
+ residentKey: true,
117
+ challengeExpiry: true,
118
+ };
119
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
120
+ const client = getClient();
121
+ const result = await client.webauthnAuthModule.findFirst(findFirstArgs).execute();
122
+ console.log(JSON.stringify(result, null, 2));
123
+ }
124
+ catch (error) {
125
+ console.error('Failed to find record.');
126
+ if (error instanceof Error) {
127
+ console.error(error.message);
128
+ }
129
+ process.exit(1);
130
+ }
131
+ }
132
+ async function handleGet(argv, prompter) {
133
+ try {
134
+ const answers = await prompter.prompt(argv, [
135
+ {
136
+ type: 'text',
137
+ name: 'id',
138
+ message: 'id',
139
+ required: true,
140
+ },
141
+ ]);
142
+ const client = getClient();
143
+ const result = await client.webauthnAuthModule
144
+ .findOne({
145
+ id: answers.id,
146
+ select: {
147
+ id: true,
148
+ databaseId: true,
149
+ schemaId: true,
150
+ usersTableId: true,
151
+ credentialsTableId: true,
152
+ sessionsTableId: true,
153
+ sessionCredentialsTableId: true,
154
+ sessionSecretsTableId: true,
155
+ authSettingsTableId: true,
156
+ rpId: true,
157
+ rpName: true,
158
+ originAllowlist: true,
159
+ attestationType: true,
160
+ requireUserVerification: true,
161
+ residentKey: true,
162
+ challengeExpiry: true,
163
+ },
164
+ })
165
+ .execute();
166
+ console.log(JSON.stringify(result, null, 2));
167
+ }
168
+ catch (error) {
169
+ console.error('Record not found.');
170
+ if (error instanceof Error) {
171
+ console.error(error.message);
172
+ }
173
+ process.exit(1);
174
+ }
175
+ }
176
+ async function handleCreate(argv, prompter) {
177
+ try {
178
+ const rawAnswers = await prompter.prompt(argv, [
179
+ {
180
+ type: 'text',
181
+ name: 'databaseId',
182
+ message: 'databaseId',
183
+ required: true,
184
+ },
185
+ {
186
+ type: 'text',
187
+ name: 'schemaId',
188
+ message: 'schemaId',
189
+ required: false,
190
+ skipPrompt: true,
191
+ },
192
+ {
193
+ type: 'text',
194
+ name: 'usersTableId',
195
+ message: 'usersTableId',
196
+ required: false,
197
+ skipPrompt: true,
198
+ },
199
+ {
200
+ type: 'text',
201
+ name: 'credentialsTableId',
202
+ message: 'credentialsTableId',
203
+ required: false,
204
+ skipPrompt: true,
205
+ },
206
+ {
207
+ type: 'text',
208
+ name: 'sessionsTableId',
209
+ message: 'sessionsTableId',
210
+ required: false,
211
+ skipPrompt: true,
212
+ },
213
+ {
214
+ type: 'text',
215
+ name: 'sessionCredentialsTableId',
216
+ message: 'sessionCredentialsTableId',
217
+ required: false,
218
+ skipPrompt: true,
219
+ },
220
+ {
221
+ type: 'text',
222
+ name: 'sessionSecretsTableId',
223
+ message: 'sessionSecretsTableId',
224
+ required: false,
225
+ skipPrompt: true,
226
+ },
227
+ {
228
+ type: 'text',
229
+ name: 'authSettingsTableId',
230
+ message: 'authSettingsTableId',
231
+ required: false,
232
+ skipPrompt: true,
233
+ },
234
+ {
235
+ type: 'text',
236
+ name: 'rpId',
237
+ message: 'rpId',
238
+ required: false,
239
+ skipPrompt: true,
240
+ },
241
+ {
242
+ type: 'text',
243
+ name: 'rpName',
244
+ message: 'rpName',
245
+ required: false,
246
+ skipPrompt: true,
247
+ },
248
+ {
249
+ type: 'text',
250
+ name: 'originAllowlist',
251
+ message: 'originAllowlist',
252
+ required: false,
253
+ skipPrompt: true,
254
+ },
255
+ {
256
+ type: 'text',
257
+ name: 'attestationType',
258
+ message: 'attestationType',
259
+ required: false,
260
+ skipPrompt: true,
261
+ },
262
+ {
263
+ type: 'boolean',
264
+ name: 'requireUserVerification',
265
+ message: 'requireUserVerification',
266
+ required: false,
267
+ skipPrompt: true,
268
+ },
269
+ {
270
+ type: 'text',
271
+ name: 'residentKey',
272
+ message: 'residentKey',
273
+ required: false,
274
+ skipPrompt: true,
275
+ },
276
+ {
277
+ type: 'text',
278
+ name: 'challengeExpiry',
279
+ message: 'challengeExpiry',
280
+ required: false,
281
+ skipPrompt: true,
282
+ },
283
+ ]);
284
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
285
+ const cleanedData = stripUndefined(answers, fieldSchema);
286
+ const client = getClient();
287
+ const result = await client.webauthnAuthModule
288
+ .create({
289
+ data: {
290
+ databaseId: cleanedData.databaseId,
291
+ schemaId: cleanedData.schemaId,
292
+ usersTableId: cleanedData.usersTableId,
293
+ credentialsTableId: cleanedData.credentialsTableId,
294
+ sessionsTableId: cleanedData.sessionsTableId,
295
+ sessionCredentialsTableId: cleanedData.sessionCredentialsTableId,
296
+ sessionSecretsTableId: cleanedData.sessionSecretsTableId,
297
+ authSettingsTableId: cleanedData.authSettingsTableId,
298
+ rpId: cleanedData.rpId,
299
+ rpName: cleanedData.rpName,
300
+ originAllowlist: cleanedData.originAllowlist,
301
+ attestationType: cleanedData.attestationType,
302
+ requireUserVerification: cleanedData.requireUserVerification,
303
+ residentKey: cleanedData.residentKey,
304
+ challengeExpiry: cleanedData.challengeExpiry,
305
+ },
306
+ select: {
307
+ id: true,
308
+ databaseId: true,
309
+ schemaId: true,
310
+ usersTableId: true,
311
+ credentialsTableId: true,
312
+ sessionsTableId: true,
313
+ sessionCredentialsTableId: true,
314
+ sessionSecretsTableId: true,
315
+ authSettingsTableId: true,
316
+ rpId: true,
317
+ rpName: true,
318
+ originAllowlist: true,
319
+ attestationType: true,
320
+ requireUserVerification: true,
321
+ residentKey: true,
322
+ challengeExpiry: true,
323
+ },
324
+ })
325
+ .execute();
326
+ console.log(JSON.stringify(result, null, 2));
327
+ }
328
+ catch (error) {
329
+ console.error('Failed to create record.');
330
+ if (error instanceof Error) {
331
+ console.error(error.message);
332
+ }
333
+ process.exit(1);
334
+ }
335
+ }
336
+ async function handleUpdate(argv, prompter) {
337
+ try {
338
+ const rawAnswers = await prompter.prompt(argv, [
339
+ {
340
+ type: 'text',
341
+ name: 'id',
342
+ message: 'id',
343
+ required: true,
344
+ },
345
+ {
346
+ type: 'text',
347
+ name: 'databaseId',
348
+ message: 'databaseId',
349
+ required: false,
350
+ },
351
+ {
352
+ type: 'text',
353
+ name: 'schemaId',
354
+ message: 'schemaId',
355
+ required: false,
356
+ skipPrompt: true,
357
+ },
358
+ {
359
+ type: 'text',
360
+ name: 'usersTableId',
361
+ message: 'usersTableId',
362
+ required: false,
363
+ skipPrompt: true,
364
+ },
365
+ {
366
+ type: 'text',
367
+ name: 'credentialsTableId',
368
+ message: 'credentialsTableId',
369
+ required: false,
370
+ skipPrompt: true,
371
+ },
372
+ {
373
+ type: 'text',
374
+ name: 'sessionsTableId',
375
+ message: 'sessionsTableId',
376
+ required: false,
377
+ skipPrompt: true,
378
+ },
379
+ {
380
+ type: 'text',
381
+ name: 'sessionCredentialsTableId',
382
+ message: 'sessionCredentialsTableId',
383
+ required: false,
384
+ skipPrompt: true,
385
+ },
386
+ {
387
+ type: 'text',
388
+ name: 'sessionSecretsTableId',
389
+ message: 'sessionSecretsTableId',
390
+ required: false,
391
+ skipPrompt: true,
392
+ },
393
+ {
394
+ type: 'text',
395
+ name: 'authSettingsTableId',
396
+ message: 'authSettingsTableId',
397
+ required: false,
398
+ skipPrompt: true,
399
+ },
400
+ {
401
+ type: 'text',
402
+ name: 'rpId',
403
+ message: 'rpId',
404
+ required: false,
405
+ skipPrompt: true,
406
+ },
407
+ {
408
+ type: 'text',
409
+ name: 'rpName',
410
+ message: 'rpName',
411
+ required: false,
412
+ skipPrompt: true,
413
+ },
414
+ {
415
+ type: 'text',
416
+ name: 'originAllowlist',
417
+ message: 'originAllowlist',
418
+ required: false,
419
+ skipPrompt: true,
420
+ },
421
+ {
422
+ type: 'text',
423
+ name: 'attestationType',
424
+ message: 'attestationType',
425
+ required: false,
426
+ skipPrompt: true,
427
+ },
428
+ {
429
+ type: 'boolean',
430
+ name: 'requireUserVerification',
431
+ message: 'requireUserVerification',
432
+ required: false,
433
+ skipPrompt: true,
434
+ },
435
+ {
436
+ type: 'text',
437
+ name: 'residentKey',
438
+ message: 'residentKey',
439
+ required: false,
440
+ skipPrompt: true,
441
+ },
442
+ {
443
+ type: 'text',
444
+ name: 'challengeExpiry',
445
+ message: 'challengeExpiry',
446
+ required: false,
447
+ skipPrompt: true,
448
+ },
449
+ ]);
450
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
451
+ const cleanedData = stripUndefined(answers, fieldSchema);
452
+ const client = getClient();
453
+ const result = await client.webauthnAuthModule
454
+ .update({
455
+ where: {
456
+ id: answers.id,
457
+ },
458
+ data: {
459
+ databaseId: cleanedData.databaseId,
460
+ schemaId: cleanedData.schemaId,
461
+ usersTableId: cleanedData.usersTableId,
462
+ credentialsTableId: cleanedData.credentialsTableId,
463
+ sessionsTableId: cleanedData.sessionsTableId,
464
+ sessionCredentialsTableId: cleanedData.sessionCredentialsTableId,
465
+ sessionSecretsTableId: cleanedData.sessionSecretsTableId,
466
+ authSettingsTableId: cleanedData.authSettingsTableId,
467
+ rpId: cleanedData.rpId,
468
+ rpName: cleanedData.rpName,
469
+ originAllowlist: cleanedData.originAllowlist,
470
+ attestationType: cleanedData.attestationType,
471
+ requireUserVerification: cleanedData.requireUserVerification,
472
+ residentKey: cleanedData.residentKey,
473
+ challengeExpiry: cleanedData.challengeExpiry,
474
+ },
475
+ select: {
476
+ id: true,
477
+ databaseId: true,
478
+ schemaId: true,
479
+ usersTableId: true,
480
+ credentialsTableId: true,
481
+ sessionsTableId: true,
482
+ sessionCredentialsTableId: true,
483
+ sessionSecretsTableId: true,
484
+ authSettingsTableId: true,
485
+ rpId: true,
486
+ rpName: true,
487
+ originAllowlist: true,
488
+ attestationType: true,
489
+ requireUserVerification: true,
490
+ residentKey: true,
491
+ challengeExpiry: true,
492
+ },
493
+ })
494
+ .execute();
495
+ console.log(JSON.stringify(result, null, 2));
496
+ }
497
+ catch (error) {
498
+ console.error('Failed to update record.');
499
+ if (error instanceof Error) {
500
+ console.error(error.message);
501
+ }
502
+ process.exit(1);
503
+ }
504
+ }
505
+ async function handleDelete(argv, prompter) {
506
+ try {
507
+ const rawAnswers = await prompter.prompt(argv, [
508
+ {
509
+ type: 'text',
510
+ name: 'id',
511
+ message: 'id',
512
+ required: true,
513
+ },
514
+ ]);
515
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
516
+ const client = getClient();
517
+ const result = await client.webauthnAuthModule
518
+ .delete({
519
+ where: {
520
+ id: answers.id,
521
+ },
522
+ select: {
523
+ id: true,
524
+ },
525
+ })
526
+ .execute();
527
+ console.log(JSON.stringify(result, null, 2));
528
+ }
529
+ catch (error) {
530
+ console.error('Failed to delete record.');
531
+ if (error instanceof Error) {
532
+ console.error(error.message);
533
+ }
534
+ process.exit(1);
535
+ }
536
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for WebauthnCredential
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { CLIOptions, Inquirerer } from 'inquirerer';
7
+ declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
8
+ export default _default;