@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
@@ -18,12 +18,17 @@ const fieldSchema = {
18
18
  hasLimits: 'boolean',
19
19
  hasProfiles: 'boolean',
20
20
  hasLevels: 'boolean',
21
+ hasStorage: 'boolean',
22
+ storageConfig: 'json',
21
23
  skipEntityPolicies: 'boolean',
22
24
  tableProvision: 'json',
23
25
  outMembershipType: 'int',
24
26
  outEntityTableId: 'uuid',
25
27
  outEntityTableName: 'string',
26
28
  outInstalledModules: 'string',
29
+ outStorageModuleId: 'uuid',
30
+ outBucketsTableId: 'uuid',
31
+ outFilesTableId: 'uuid',
27
32
  };
28
33
  const usage = '\nentity-type-provision <command>\n\nCommands:\n list List entityTypeProvision records\n find-first Find first matching entityTypeProvision record\n get Get a entityTypeProvision by ID\n create Create a new entityTypeProvision\n update Update an existing entityTypeProvision\n delete Delete a entityTypeProvision\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';
29
34
  export default async (argv, prompter, _options) => {
@@ -78,12 +83,17 @@ async function handleList(argv, _prompter) {
78
83
  hasLimits: true,
79
84
  hasProfiles: true,
80
85
  hasLevels: true,
86
+ hasStorage: true,
87
+ storageConfig: true,
81
88
  skipEntityPolicies: true,
82
89
  tableProvision: true,
83
90
  outMembershipType: true,
84
91
  outEntityTableId: true,
85
92
  outEntityTableName: true,
86
93
  outInstalledModules: true,
94
+ outStorageModuleId: true,
95
+ outBucketsTableId: true,
96
+ outFilesTableId: true,
87
97
  };
88
98
  const findManyArgs = parseFindManyArgs(argv, defaultSelect);
89
99
  const client = getClient();
@@ -112,12 +122,17 @@ async function handleFindFirst(argv, _prompter) {
112
122
  hasLimits: true,
113
123
  hasProfiles: true,
114
124
  hasLevels: true,
125
+ hasStorage: true,
126
+ storageConfig: true,
115
127
  skipEntityPolicies: true,
116
128
  tableProvision: true,
117
129
  outMembershipType: true,
118
130
  outEntityTableId: true,
119
131
  outEntityTableName: true,
120
132
  outInstalledModules: true,
133
+ outStorageModuleId: true,
134
+ outBucketsTableId: true,
135
+ outFilesTableId: true,
121
136
  };
122
137
  const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
123
138
  const client = getClient();
@@ -158,12 +173,17 @@ async function handleGet(argv, prompter) {
158
173
  hasLimits: true,
159
174
  hasProfiles: true,
160
175
  hasLevels: true,
176
+ hasStorage: true,
177
+ storageConfig: true,
161
178
  skipEntityPolicies: true,
162
179
  tableProvision: true,
163
180
  outMembershipType: true,
164
181
  outEntityTableId: true,
165
182
  outEntityTableName: true,
166
183
  outInstalledModules: true,
184
+ outStorageModuleId: true,
185
+ outBucketsTableId: true,
186
+ outFilesTableId: true,
167
187
  },
168
188
  })
169
189
  .execute();
@@ -247,6 +267,20 @@ async function handleCreate(argv, prompter) {
247
267
  required: false,
248
268
  skipPrompt: true,
249
269
  },
270
+ {
271
+ type: 'boolean',
272
+ name: 'hasStorage',
273
+ message: 'hasStorage',
274
+ required: false,
275
+ skipPrompt: true,
276
+ },
277
+ {
278
+ type: 'json',
279
+ name: 'storageConfig',
280
+ message: 'storageConfig',
281
+ required: false,
282
+ skipPrompt: true,
283
+ },
250
284
  {
251
285
  type: 'boolean',
252
286
  name: 'skipEntityPolicies',
@@ -289,6 +323,27 @@ async function handleCreate(argv, prompter) {
289
323
  required: false,
290
324
  skipPrompt: true,
291
325
  },
326
+ {
327
+ type: 'text',
328
+ name: 'outStorageModuleId',
329
+ message: 'outStorageModuleId',
330
+ required: false,
331
+ skipPrompt: true,
332
+ },
333
+ {
334
+ type: 'text',
335
+ name: 'outBucketsTableId',
336
+ message: 'outBucketsTableId',
337
+ required: false,
338
+ skipPrompt: true,
339
+ },
340
+ {
341
+ type: 'text',
342
+ name: 'outFilesTableId',
343
+ message: 'outFilesTableId',
344
+ required: false,
345
+ skipPrompt: true,
346
+ },
292
347
  ]);
293
348
  const answers = coerceAnswers(rawAnswers, fieldSchema);
294
349
  const cleanedData = stripUndefined(answers, fieldSchema);
@@ -306,12 +361,17 @@ async function handleCreate(argv, prompter) {
306
361
  hasLimits: cleanedData.hasLimits,
307
362
  hasProfiles: cleanedData.hasProfiles,
308
363
  hasLevels: cleanedData.hasLevels,
364
+ hasStorage: cleanedData.hasStorage,
365
+ storageConfig: cleanedData.storageConfig,
309
366
  skipEntityPolicies: cleanedData.skipEntityPolicies,
310
367
  tableProvision: cleanedData.tableProvision,
311
368
  outMembershipType: cleanedData.outMembershipType,
312
369
  outEntityTableId: cleanedData.outEntityTableId,
313
370
  outEntityTableName: cleanedData.outEntityTableName,
314
371
  outInstalledModules: cleanedData.outInstalledModules,
372
+ outStorageModuleId: cleanedData.outStorageModuleId,
373
+ outBucketsTableId: cleanedData.outBucketsTableId,
374
+ outFilesTableId: cleanedData.outFilesTableId,
315
375
  },
316
376
  select: {
317
377
  id: true,
@@ -325,12 +385,17 @@ async function handleCreate(argv, prompter) {
325
385
  hasLimits: true,
326
386
  hasProfiles: true,
327
387
  hasLevels: true,
388
+ hasStorage: true,
389
+ storageConfig: true,
328
390
  skipEntityPolicies: true,
329
391
  tableProvision: true,
330
392
  outMembershipType: true,
331
393
  outEntityTableId: true,
332
394
  outEntityTableName: true,
333
395
  outInstalledModules: true,
396
+ outStorageModuleId: true,
397
+ outBucketsTableId: true,
398
+ outFilesTableId: true,
334
399
  },
335
400
  })
336
401
  .execute();
@@ -420,6 +485,20 @@ async function handleUpdate(argv, prompter) {
420
485
  required: false,
421
486
  skipPrompt: true,
422
487
  },
488
+ {
489
+ type: 'boolean',
490
+ name: 'hasStorage',
491
+ message: 'hasStorage',
492
+ required: false,
493
+ skipPrompt: true,
494
+ },
495
+ {
496
+ type: 'json',
497
+ name: 'storageConfig',
498
+ message: 'storageConfig',
499
+ required: false,
500
+ skipPrompt: true,
501
+ },
423
502
  {
424
503
  type: 'boolean',
425
504
  name: 'skipEntityPolicies',
@@ -462,6 +541,27 @@ async function handleUpdate(argv, prompter) {
462
541
  required: false,
463
542
  skipPrompt: true,
464
543
  },
544
+ {
545
+ type: 'text',
546
+ name: 'outStorageModuleId',
547
+ message: 'outStorageModuleId',
548
+ required: false,
549
+ skipPrompt: true,
550
+ },
551
+ {
552
+ type: 'text',
553
+ name: 'outBucketsTableId',
554
+ message: 'outBucketsTableId',
555
+ required: false,
556
+ skipPrompt: true,
557
+ },
558
+ {
559
+ type: 'text',
560
+ name: 'outFilesTableId',
561
+ message: 'outFilesTableId',
562
+ required: false,
563
+ skipPrompt: true,
564
+ },
465
565
  ]);
466
566
  const answers = coerceAnswers(rawAnswers, fieldSchema);
467
567
  const cleanedData = stripUndefined(answers, fieldSchema);
@@ -482,12 +582,17 @@ async function handleUpdate(argv, prompter) {
482
582
  hasLimits: cleanedData.hasLimits,
483
583
  hasProfiles: cleanedData.hasProfiles,
484
584
  hasLevels: cleanedData.hasLevels,
585
+ hasStorage: cleanedData.hasStorage,
586
+ storageConfig: cleanedData.storageConfig,
485
587
  skipEntityPolicies: cleanedData.skipEntityPolicies,
486
588
  tableProvision: cleanedData.tableProvision,
487
589
  outMembershipType: cleanedData.outMembershipType,
488
590
  outEntityTableId: cleanedData.outEntityTableId,
489
591
  outEntityTableName: cleanedData.outEntityTableName,
490
592
  outInstalledModules: cleanedData.outInstalledModules,
593
+ outStorageModuleId: cleanedData.outStorageModuleId,
594
+ outBucketsTableId: cleanedData.outBucketsTableId,
595
+ outFilesTableId: cleanedData.outFilesTableId,
491
596
  },
492
597
  select: {
493
598
  id: true,
@@ -501,12 +606,17 @@ async function handleUpdate(argv, prompter) {
501
606
  hasLimits: true,
502
607
  hasProfiles: true,
503
608
  hasLevels: true,
609
+ hasStorage: true,
610
+ storageConfig: true,
504
611
  skipEntityPolicies: true,
505
612
  tableProvision: true,
506
613
  outMembershipType: true,
507
614
  outEntityTableId: true,
508
615
  outEntityTableName: true,
509
616
  outInstalledModules: true,
617
+ outStorageModuleId: true,
618
+ outBucketsTableId: true,
619
+ outFilesTableId: true,
510
620
  },
511
621
  })
512
622
  .execute();
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for IdentityProvider
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;
@@ -0,0 +1,162 @@
1
+ /**
2
+ * CLI commands for IdentityProvider
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
+ slug: 'string',
11
+ kind: 'string',
12
+ displayName: 'string',
13
+ enabled: 'boolean',
14
+ isBuiltIn: 'boolean',
15
+ };
16
+ const usage = '\nidentity-provider <command>\n\nCommands:\n list List identityProvider records\n find-first Find first matching identityProvider record\n create Create a new identityProvider\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';
17
+ export default async (argv, prompter, _options) => {
18
+ if (argv.help || argv.h) {
19
+ console.log(usage);
20
+ process.exit(0);
21
+ }
22
+ const { first: subcommand, newArgv } = extractFirst(argv);
23
+ if (!subcommand) {
24
+ const answer = await prompter.prompt(argv, [
25
+ {
26
+ type: 'autocomplete',
27
+ name: 'subcommand',
28
+ message: 'What do you want to do?',
29
+ options: ['list', 'find-first', 'create'],
30
+ },
31
+ ]);
32
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
33
+ }
34
+ return handleTableSubcommand(subcommand, newArgv, prompter);
35
+ };
36
+ async function handleTableSubcommand(subcommand, argv, prompter) {
37
+ switch (subcommand) {
38
+ case 'list':
39
+ return handleList(argv, prompter);
40
+ case 'find-first':
41
+ return handleFindFirst(argv, prompter);
42
+ case 'create':
43
+ return handleCreate(argv, prompter);
44
+ default:
45
+ console.log(usage);
46
+ process.exit(1);
47
+ }
48
+ }
49
+ async function handleList(argv, _prompter) {
50
+ try {
51
+ const defaultSelect = {
52
+ slug: true,
53
+ kind: true,
54
+ displayName: true,
55
+ enabled: true,
56
+ isBuiltIn: true,
57
+ };
58
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
59
+ const client = getClient();
60
+ const result = await client.identityProvider.findMany(findManyArgs).execute();
61
+ console.log(JSON.stringify(result, null, 2));
62
+ }
63
+ catch (error) {
64
+ console.error('Failed to list records.');
65
+ if (error instanceof Error) {
66
+ console.error(error.message);
67
+ }
68
+ process.exit(1);
69
+ }
70
+ }
71
+ async function handleFindFirst(argv, _prompter) {
72
+ try {
73
+ const defaultSelect = {
74
+ slug: true,
75
+ kind: true,
76
+ displayName: true,
77
+ enabled: true,
78
+ isBuiltIn: true,
79
+ };
80
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
81
+ const client = getClient();
82
+ const result = await client.identityProvider.findFirst(findFirstArgs).execute();
83
+ console.log(JSON.stringify(result, null, 2));
84
+ }
85
+ catch (error) {
86
+ console.error('Failed to find record.');
87
+ if (error instanceof Error) {
88
+ console.error(error.message);
89
+ }
90
+ process.exit(1);
91
+ }
92
+ }
93
+ async function handleCreate(argv, prompter) {
94
+ try {
95
+ const rawAnswers = await prompter.prompt(argv, [
96
+ {
97
+ type: 'text',
98
+ name: 'slug',
99
+ message: 'slug',
100
+ required: false,
101
+ skipPrompt: true,
102
+ },
103
+ {
104
+ type: 'text',
105
+ name: 'kind',
106
+ message: 'kind',
107
+ required: false,
108
+ skipPrompt: true,
109
+ },
110
+ {
111
+ type: 'text',
112
+ name: 'displayName',
113
+ message: 'displayName',
114
+ required: false,
115
+ skipPrompt: true,
116
+ },
117
+ {
118
+ type: 'boolean',
119
+ name: 'enabled',
120
+ message: 'enabled',
121
+ required: false,
122
+ skipPrompt: true,
123
+ },
124
+ {
125
+ type: 'boolean',
126
+ name: 'isBuiltIn',
127
+ message: 'isBuiltIn',
128
+ required: false,
129
+ skipPrompt: true,
130
+ },
131
+ ]);
132
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
133
+ const cleanedData = stripUndefined(answers, fieldSchema);
134
+ const client = getClient();
135
+ const result = await client.identityProvider
136
+ .create({
137
+ data: {
138
+ slug: cleanedData.slug,
139
+ kind: cleanedData.kind,
140
+ displayName: cleanedData.displayName,
141
+ enabled: cleanedData.enabled,
142
+ isBuiltIn: cleanedData.isBuiltIn,
143
+ },
144
+ select: {
145
+ slug: true,
146
+ kind: true,
147
+ displayName: true,
148
+ enabled: true,
149
+ isBuiltIn: true,
150
+ },
151
+ })
152
+ .execute();
153
+ console.log(JSON.stringify(result, null, 2));
154
+ }
155
+ catch (error) {
156
+ console.error('Failed to create record.');
157
+ if (error instanceof Error) {
158
+ console.error(error.message);
159
+ }
160
+ process.exit(1);
161
+ }
162
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for IdentityProvidersModule
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;