@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
+ }
@@ -15,7 +15,9 @@ const auth_1 = __importDefault(require("./commands/auth"));
15
15
  const email_1 = __importDefault(require("./commands/email"));
16
16
  const phone_number_1 = __importDefault(require("./commands/phone-number"));
17
17
  const crypto_address_1 = __importDefault(require("./commands/crypto-address"));
18
+ const webauthn_credential_1 = __importDefault(require("./commands/webauthn-credential"));
18
19
  const audit_log_1 = __importDefault(require("./commands/audit-log"));
20
+ const identity_provider_1 = __importDefault(require("./commands/identity-provider"));
19
21
  const role_type_1 = __importDefault(require("./commands/role-type"));
20
22
  const user_connected_account_1 = __importDefault(require("./commands/user-connected-account"));
21
23
  const user_1 = __importDefault(require("./commands/user"));
@@ -37,12 +39,12 @@ const set_password_1 = __importDefault(require("./commands/set-password"));
37
39
  const verify_email_1 = __importDefault(require("./commands/verify-email"));
38
40
  const provision_new_user_1 = __importDefault(require("./commands/provision-new-user"));
39
41
  const reset_password_1 = __importDefault(require("./commands/reset-password"));
40
- const create_api_key_1 = __importDefault(require("./commands/create-api-key"));
41
42
  const sign_in_cross_origin_1 = __importDefault(require("./commands/sign-in-cross-origin"));
42
43
  const sign_up_1 = __importDefault(require("./commands/sign-up"));
43
44
  const request_cross_origin_token_1 = __importDefault(require("./commands/request-cross-origin-token"));
44
45
  const sign_in_1 = __importDefault(require("./commands/sign-in"));
45
46
  const extend_token_expires_1 = __importDefault(require("./commands/extend-token-expires"));
47
+ const create_api_key_1 = __importDefault(require("./commands/create-api-key"));
46
48
  const forgot_password_1 = __importDefault(require("./commands/forgot-password"));
47
49
  const send_verification_email_1 = __importDefault(require("./commands/send-verification-email"));
48
50
  const request_upload_url_1 = __importDefault(require("./commands/request-upload-url"));
@@ -54,7 +56,9 @@ const createCommandMap = () => ({
54
56
  email: email_1.default,
55
57
  'phone-number': phone_number_1.default,
56
58
  'crypto-address': crypto_address_1.default,
59
+ 'webauthn-credential': webauthn_credential_1.default,
57
60
  'audit-log': audit_log_1.default,
61
+ 'identity-provider': identity_provider_1.default,
58
62
  'role-type': role_type_1.default,
59
63
  'user-connected-account': user_connected_account_1.default,
60
64
  user: user_1.default,
@@ -76,19 +80,19 @@ const createCommandMap = () => ({
76
80
  'verify-email': verify_email_1.default,
77
81
  'provision-new-user': provision_new_user_1.default,
78
82
  'reset-password': reset_password_1.default,
79
- 'create-api-key': create_api_key_1.default,
80
83
  'sign-in-cross-origin': sign_in_cross_origin_1.default,
81
84
  'sign-up': sign_up_1.default,
82
85
  'request-cross-origin-token': request_cross_origin_token_1.default,
83
86
  'sign-in': sign_in_1.default,
84
87
  'extend-token-expires': extend_token_expires_1.default,
88
+ 'create-api-key': create_api_key_1.default,
85
89
  'forgot-password': forgot_password_1.default,
86
90
  'send-verification-email': send_verification_email_1.default,
87
91
  'request-upload-url': request_upload_url_1.default,
88
92
  'confirm-upload': confirm_upload_1.default,
89
93
  'provision-bucket': provision_bucket_1.default,
90
94
  });
91
- const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n audit-log auditLog CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n current-user-id currentUserId\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n create-api-key createApiKey\n sign-in-cross-origin signInCrossOrigin\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\n extend-token-expires extendTokenExpires\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\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";
95
+ const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n audit-log auditLog CRUD operations\n identity-provider identityProvider CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n current-user-id currentUserId\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n sign-in-cross-origin signInCrossOrigin\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\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";
92
96
  const commands = async (argv, prompter, options) => {
93
97
  if (argv.help || argv.h) {
94
98
  console.log(usage);
@@ -3,7 +3,9 @@ export declare function getClient(contextName?: string): {
3
3
  email: import("../orm").EmailModel;
4
4
  phoneNumber: import("../orm").PhoneNumberModel;
5
5
  cryptoAddress: import("../orm").CryptoAddressModel;
6
+ webauthnCredential: import("../orm").WebauthnCredentialModel;
6
7
  auditLog: import("../orm").AuditLogModel;
8
+ identityProvider: import("../orm").IdentityProviderModel;
7
9
  roleType: import("../orm").RoleTypeModel;
8
10
  userConnectedAccount: import("../orm").UserConnectedAccountModel;
9
11
  user: import("../orm").UserModel;
@@ -100,11 +102,6 @@ export declare function getClient(contextName?: string): {
100
102
  } & import("../orm").StrictSelect<S, import("../orm/input-types").ResetPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
101
103
  resetPassword: import("../orm").InferSelectResult<import("../orm/input-types").ResetPasswordPayload, S> | null;
102
104
  }>;
103
- createApiKey: <S extends import("../orm/input-types").CreateApiKeyPayloadSelect>(args: import("../orm/mutation").CreateApiKeyVariables, options: {
104
- select: S;
105
- } & import("../orm").StrictSelect<S, import("../orm/input-types").CreateApiKeyPayloadSelect>) => import("../orm").QueryBuilder<{
106
- createApiKey: import("../orm").InferSelectResult<import("../orm/input-types").CreateApiKeyPayload, S> | null;
107
- }>;
108
105
  signInCrossOrigin: <S extends import("../orm/input-types").SignInCrossOriginPayloadSelect>(args: import("../orm/mutation").SignInCrossOriginVariables, options: {
109
106
  select: S;
110
107
  } & import("../orm").StrictSelect<S, import("../orm/input-types").SignInCrossOriginPayloadSelect>) => import("../orm").QueryBuilder<{
@@ -130,6 +127,11 @@ export declare function getClient(contextName?: string): {
130
127
  } & import("../orm").StrictSelect<S, import("../orm/input-types").ExtendTokenExpiresPayloadSelect>) => import("../orm").QueryBuilder<{
131
128
  extendTokenExpires: import("../orm").InferSelectResult<import("../orm/input-types").ExtendTokenExpiresPayload, S> | null;
132
129
  }>;
130
+ createApiKey: <S extends import("../orm/input-types").CreateApiKeyPayloadSelect>(args: import("../orm/mutation").CreateApiKeyVariables, options: {
131
+ select: S;
132
+ } & import("../orm").StrictSelect<S, import("../orm/input-types").CreateApiKeyPayloadSelect>) => import("../orm").QueryBuilder<{
133
+ createApiKey: import("../orm").InferSelectResult<import("../orm/input-types").CreateApiKeyPayload, S> | null;
134
+ }>;
133
135
  forgotPassword: <S extends import("../orm/input-types").ForgotPasswordPayloadSelect>(args: import("../orm/mutation").ForgotPasswordVariables, options: {
134
136
  select: S;
135
137
  } & import("../orm").StrictSelect<S, import("../orm/input-types").ForgotPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
@@ -2,7 +2,9 @@ import type { OrmClientConfig } from './client';
2
2
  import { EmailModel } from './models/email';
3
3
  import { PhoneNumberModel } from './models/phoneNumber';
4
4
  import { CryptoAddressModel } from './models/cryptoAddress';
5
+ import { WebauthnCredentialModel } from './models/webauthnCredential';
5
6
  import { AuditLogModel } from './models/auditLog';
7
+ import { IdentityProviderModel } from './models/identityProvider';
6
8
  import { RoleTypeModel } from './models/roleType';
7
9
  import { UserConnectedAccountModel } from './models/userConnectedAccount';
8
10
  import { UserModel } from './models/user';
@@ -41,7 +43,9 @@ export declare function createClient(config: OrmClientConfig): {
41
43
  email: EmailModel;
42
44
  phoneNumber: PhoneNumberModel;
43
45
  cryptoAddress: CryptoAddressModel;
46
+ webauthnCredential: WebauthnCredentialModel;
44
47
  auditLog: AuditLogModel;
48
+ identityProvider: IdentityProviderModel;
45
49
  roleType: RoleTypeModel;
46
50
  userConnectedAccount: UserConnectedAccountModel;
47
51
  user: UserModel;
@@ -138,11 +142,6 @@ export declare function createClient(config: OrmClientConfig): {
138
142
  } & import("./select-types").StrictSelect<S, import("./input-types").ResetPasswordPayloadSelect>) => import("./query-builder").QueryBuilder<{
139
143
  resetPassword: import("./select-types").InferSelectResult<import("./input-types").ResetPasswordPayload, S> | null;
140
144
  }>;
141
- createApiKey: <S extends import("./input-types").CreateApiKeyPayloadSelect>(args: import("./mutation").CreateApiKeyVariables, options: {
142
- select: S;
143
- } & import("./select-types").StrictSelect<S, import("./input-types").CreateApiKeyPayloadSelect>) => import("./query-builder").QueryBuilder<{
144
- createApiKey: import("./select-types").InferSelectResult<import("./input-types").CreateApiKeyPayload, S> | null;
145
- }>;
146
145
  signInCrossOrigin: <S extends import("./input-types").SignInCrossOriginPayloadSelect>(args: import("./mutation").SignInCrossOriginVariables, options: {
147
146
  select: S;
148
147
  } & import("./select-types").StrictSelect<S, import("./input-types").SignInCrossOriginPayloadSelect>) => import("./query-builder").QueryBuilder<{
@@ -168,6 +167,11 @@ export declare function createClient(config: OrmClientConfig): {
168
167
  } & import("./select-types").StrictSelect<S, import("./input-types").ExtendTokenExpiresPayloadSelect>) => import("./query-builder").QueryBuilder<{
169
168
  extendTokenExpires: import("./select-types").InferSelectResult<import("./input-types").ExtendTokenExpiresPayload, S> | null;
170
169
  }>;
170
+ createApiKey: <S extends import("./input-types").CreateApiKeyPayloadSelect>(args: import("./mutation").CreateApiKeyVariables, options: {
171
+ select: S;
172
+ } & import("./select-types").StrictSelect<S, import("./input-types").CreateApiKeyPayloadSelect>) => import("./query-builder").QueryBuilder<{
173
+ createApiKey: import("./select-types").InferSelectResult<import("./input-types").CreateApiKeyPayload, S> | null;
174
+ }>;
171
175
  forgotPassword: <S extends import("./input-types").ForgotPasswordPayloadSelect>(args: import("./mutation").ForgotPasswordVariables, options: {
172
176
  select: S;
173
177
  } & import("./select-types").StrictSelect<S, import("./input-types").ForgotPasswordPayloadSelect>) => import("./query-builder").QueryBuilder<{
package/auth/orm/index.js CHANGED
@@ -25,7 +25,9 @@ const client_1 = require("./client");
25
25
  const email_1 = require("./models/email");
26
26
  const phoneNumber_1 = require("./models/phoneNumber");
27
27
  const cryptoAddress_1 = require("./models/cryptoAddress");
28
+ const webauthnCredential_1 = require("./models/webauthnCredential");
28
29
  const auditLog_1 = require("./models/auditLog");
30
+ const identityProvider_1 = require("./models/identityProvider");
29
31
  const roleType_1 = require("./models/roleType");
30
32
  const userConnectedAccount_1 = require("./models/userConnectedAccount");
31
33
  const user_1 = require("./models/user");
@@ -72,7 +74,9 @@ function createClient(config) {
72
74
  email: new email_1.EmailModel(client),
73
75
  phoneNumber: new phoneNumber_1.PhoneNumberModel(client),
74
76
  cryptoAddress: new cryptoAddress_1.CryptoAddressModel(client),
77
+ webauthnCredential: new webauthnCredential_1.WebauthnCredentialModel(client),
75
78
  auditLog: new auditLog_1.AuditLogModel(client),
79
+ identityProvider: new identityProvider_1.IdentityProviderModel(client),
76
80
  roleType: new roleType_1.RoleTypeModel(client),
77
81
  userConnectedAccount: new userConnectedAccount_1.UserConnectedAccountModel(client),
78
82
  user: new user_1.UserModel(client),