@constructive-sdk/cli 0.14.0 → 0.14.1

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 (237) hide show
  1. package/admin/cli/commands/app-membership.js +22 -0
  2. package/admin/cli/commands/membership-type.js +44 -0
  3. package/{auth/cli/commands/connected-account.d.ts → admin/cli/commands/org-member-profile.d.ts} +1 -1
  4. package/admin/cli/commands/org-member-profile.js +392 -0
  5. package/admin/cli/commands/org-membership.js +44 -0
  6. package/admin/cli/commands.js +7 -5
  7. package/admin/cli/executor.d.ts +3 -2
  8. package/admin/orm/index.d.ts +6 -4
  9. package/admin/orm/index.js +6 -4
  10. package/admin/orm/input-types.d.ts +503 -295
  11. package/admin/orm/models/index.d.ts +3 -2
  12. package/admin/orm/models/index.js +7 -5
  13. package/admin/orm/models/orgMemberProfile.d.ts +56 -0
  14. package/{auth/orm/models/connectedAccount.js → admin/orm/models/orgMemberProfile.js} +26 -26
  15. package/{esm/auth/cli/commands/one-time-token.d.ts → auth/cli/commands/create-api-key.d.ts} +1 -1
  16. package/{public/cli/commands/one-time-token.js → auth/cli/commands/create-api-key.js} +3 -3
  17. package/auth/cli/commands/disconnect-account.d.ts +8 -0
  18. package/auth/cli/commands/{sign-in-one-time-token.js → disconnect-account.js} +3 -3
  19. package/auth/cli/commands/provision-new-user.d.ts +8 -0
  20. package/{public/cli/commands/sign-in-one-time-token.js → auth/cli/commands/provision-new-user.js} +3 -3
  21. package/auth/cli/commands/request-cross-origin-token.d.ts +8 -0
  22. package/auth/cli/commands/request-cross-origin-token.js +36 -0
  23. package/auth/cli/commands/require-step-up.d.ts +8 -0
  24. package/auth/cli/commands/require-step-up.js +30 -0
  25. package/auth/cli/commands/{one-time-token.d.ts → revoke-api-key.d.ts} +1 -1
  26. package/auth/cli/commands/{one-time-token.js → revoke-api-key.js} +3 -3
  27. package/auth/cli/commands/revoke-session.d.ts +8 -0
  28. package/auth/cli/commands/revoke-session.js +36 -0
  29. package/auth/cli/commands/sign-in-cross-origin.d.ts +8 -0
  30. package/auth/cli/commands/sign-in-cross-origin.js +36 -0
  31. package/auth/cli/commands/user-connected-account.d.ts +8 -0
  32. package/auth/cli/commands/user-connected-account.js +176 -0
  33. package/auth/cli/commands.js +23 -11
  34. package/auth/cli/executor.d.ts +44 -14
  35. package/auth/orm/index.d.ts +45 -15
  36. package/auth/orm/index.js +2 -2
  37. package/auth/orm/input-types.d.ts +186 -251
  38. package/auth/orm/input-types.js +0 -1
  39. package/auth/orm/models/index.d.ts +1 -1
  40. package/auth/orm/models/index.js +3 -3
  41. package/auth/orm/models/userConnectedAccount.d.ts +38 -0
  42. package/auth/orm/models/userConnectedAccount.js +76 -0
  43. package/auth/orm/mutation/index.d.ts +56 -16
  44. package/auth/orm/mutation/index.js +78 -18
  45. package/auth/orm/query/index.d.ts +12 -4
  46. package/auth/orm/query/index.js +19 -7
  47. package/esm/admin/cli/commands/app-membership.js +22 -0
  48. package/esm/admin/cli/commands/membership-type.js +44 -0
  49. package/esm/{public/cli/commands/connected-account.d.ts → admin/cli/commands/org-member-profile.d.ts} +1 -1
  50. package/esm/admin/cli/commands/org-member-profile.js +390 -0
  51. package/esm/admin/cli/commands/org-membership.js +44 -0
  52. package/esm/admin/cli/commands.js +7 -5
  53. package/esm/admin/cli/executor.d.ts +3 -2
  54. package/esm/admin/orm/index.d.ts +6 -4
  55. package/esm/admin/orm/index.js +6 -4
  56. package/esm/admin/orm/input-types.d.ts +503 -295
  57. package/esm/admin/orm/models/index.d.ts +3 -2
  58. package/esm/admin/orm/models/index.js +3 -2
  59. package/esm/admin/orm/models/orgMemberProfile.d.ts +56 -0
  60. package/esm/{public/orm/models/connectedAccount.js → admin/orm/models/orgMemberProfile.js} +24 -24
  61. package/esm/auth/cli/commands/create-api-key.d.ts +8 -0
  62. package/esm/{public/cli/commands/one-time-token.js → auth/cli/commands/create-api-key.js} +3 -3
  63. package/esm/auth/cli/commands/disconnect-account.d.ts +8 -0
  64. package/esm/auth/cli/commands/{sign-in-one-time-token.js → disconnect-account.js} +3 -3
  65. package/esm/auth/cli/commands/provision-new-user.d.ts +8 -0
  66. package/esm/{public/cli/commands/sign-in-one-time-token.js → auth/cli/commands/provision-new-user.js} +3 -3
  67. package/esm/auth/cli/commands/request-cross-origin-token.d.ts +8 -0
  68. package/esm/auth/cli/commands/request-cross-origin-token.js +34 -0
  69. package/esm/auth/cli/commands/require-step-up.d.ts +8 -0
  70. package/esm/auth/cli/commands/require-step-up.js +28 -0
  71. package/esm/auth/cli/commands/revoke-api-key.d.ts +8 -0
  72. package/esm/auth/cli/commands/{one-time-token.js → revoke-api-key.js} +3 -3
  73. package/esm/auth/cli/commands/revoke-session.d.ts +8 -0
  74. package/esm/auth/cli/commands/revoke-session.js +34 -0
  75. package/esm/auth/cli/commands/sign-in-cross-origin.d.ts +8 -0
  76. package/esm/auth/cli/commands/sign-in-cross-origin.js +34 -0
  77. package/esm/auth/cli/commands/user-connected-account.d.ts +8 -0
  78. package/esm/auth/cli/commands/user-connected-account.js +174 -0
  79. package/esm/auth/cli/commands.js +23 -11
  80. package/esm/auth/cli/executor.d.ts +44 -14
  81. package/esm/auth/orm/index.d.ts +45 -15
  82. package/esm/auth/orm/index.js +2 -2
  83. package/esm/auth/orm/input-types.d.ts +186 -251
  84. package/esm/auth/orm/input-types.js +0 -1
  85. package/esm/auth/orm/models/index.d.ts +1 -1
  86. package/esm/auth/orm/models/index.js +1 -1
  87. package/esm/auth/orm/models/userConnectedAccount.d.ts +38 -0
  88. package/esm/auth/orm/models/userConnectedAccount.js +72 -0
  89. package/esm/auth/orm/mutation/index.d.ts +56 -16
  90. package/esm/auth/orm/mutation/index.js +78 -18
  91. package/esm/auth/orm/query/index.d.ts +12 -4
  92. package/esm/auth/orm/query/index.js +19 -7
  93. package/esm/public/cli/commands/app-membership.js +22 -0
  94. package/esm/public/cli/commands/construct-blueprint.js +1 -1
  95. package/esm/public/cli/commands/create-api-key.d.ts +8 -0
  96. package/esm/public/cli/commands/create-api-key.js +34 -0
  97. package/{public/cli/commands/connected-account.d.ts → esm/public/cli/commands/devices-module.d.ts} +1 -1
  98. package/esm/public/cli/commands/{connected-account.js → devices-module.js} +101 -87
  99. package/esm/public/cli/commands/disconnect-account.d.ts +8 -0
  100. package/esm/public/cli/commands/disconnect-account.js +34 -0
  101. package/esm/public/cli/commands/{table-template-module.d.ts → entity-type-provision.d.ts} +1 -1
  102. package/esm/public/cli/commands/entity-type-provision.js +554 -0
  103. package/esm/public/cli/commands/membership-type.js +44 -0
  104. package/esm/public/cli/commands/memberships-module.js +22 -0
  105. package/esm/{auth/cli/commands/connected-account.d.ts → public/cli/commands/org-member-profile.d.ts} +1 -1
  106. package/esm/public/cli/commands/org-member-profile.js +390 -0
  107. package/esm/public/cli/commands/org-membership.js +44 -0
  108. package/esm/public/cli/commands/provision-new-user.d.ts +8 -0
  109. package/esm/public/cli/commands/provision-new-user.js +34 -0
  110. package/esm/public/cli/commands/provision-spatial-relation.d.ts +8 -0
  111. package/esm/public/cli/commands/provision-spatial-relation.js +34 -0
  112. package/esm/public/cli/commands/request-cross-origin-token.d.ts +8 -0
  113. package/esm/public/cli/commands/request-cross-origin-token.js +34 -0
  114. package/esm/public/cli/commands/require-step-up.d.ts +8 -0
  115. package/esm/public/cli/commands/require-step-up.js +28 -0
  116. package/{auth/cli/commands/sign-in-one-time-token.d.ts → esm/public/cli/commands/resolve-blueprint-field.d.ts} +1 -1
  117. package/esm/public/cli/commands/resolve-blueprint-field.js +38 -0
  118. package/esm/public/cli/commands/revoke-api-key.d.ts +8 -0
  119. package/esm/public/cli/commands/revoke-api-key.js +34 -0
  120. package/esm/public/cli/commands/revoke-session.d.ts +8 -0
  121. package/esm/public/cli/commands/revoke-session.js +34 -0
  122. package/esm/public/cli/commands/session-secrets-module.d.ts +8 -0
  123. package/esm/{auth/cli/commands/connected-account.js → public/cli/commands/session-secrets-module.js} +82 -90
  124. package/esm/public/cli/commands/sign-in-cross-origin.d.ts +8 -0
  125. package/esm/public/cli/commands/sign-in-cross-origin.js +34 -0
  126. package/esm/public/cli/commands/spatial-relation.d.ts +8 -0
  127. package/esm/public/cli/commands/spatial-relation.js +472 -0
  128. package/esm/public/cli/commands/user-auth-module.js +24 -24
  129. package/esm/public/cli/commands/user-connected-account.d.ts +8 -0
  130. package/esm/public/cli/commands/user-connected-account.js +174 -0
  131. package/esm/public/cli/commands/webauthn-credentials-module.d.ts +8 -0
  132. package/esm/public/cli/commands/{table-template-module.js → webauthn-credentials-module.js} +8 -48
  133. package/esm/public/cli/commands.js +41 -15
  134. package/esm/public/cli/executor.d.ts +61 -16
  135. package/esm/public/orm/index.d.ts +69 -19
  136. package/esm/public/orm/index.js +16 -6
  137. package/esm/public/orm/input-types.d.ts +2047 -640
  138. package/esm/public/orm/input-types.js +15 -6
  139. package/esm/public/orm/models/devicesModule.d.ts +56 -0
  140. package/esm/public/orm/models/devicesModule.js +96 -0
  141. package/esm/public/orm/models/entityTypeProvision.d.ts +56 -0
  142. package/esm/public/orm/models/{tableTemplateModule.js → entityTypeProvision.js} +24 -24
  143. package/esm/public/orm/models/index.d.ts +8 -3
  144. package/esm/public/orm/models/index.js +8 -3
  145. package/esm/public/orm/models/orgMemberProfile.d.ts +56 -0
  146. package/esm/{auth/orm/models/connectedAccount.js → public/orm/models/orgMemberProfile.js} +24 -24
  147. package/esm/public/orm/models/sessionSecretsModule.d.ts +56 -0
  148. package/esm/public/orm/models/sessionSecretsModule.js +96 -0
  149. package/esm/public/orm/models/spatialRelation.d.ts +56 -0
  150. package/esm/public/orm/models/spatialRelation.js +96 -0
  151. package/esm/public/orm/models/userConnectedAccount.d.ts +38 -0
  152. package/esm/public/orm/models/userConnectedAccount.js +72 -0
  153. package/esm/public/orm/models/webauthnCredentialsModule.d.ts +56 -0
  154. package/esm/public/orm/models/webauthnCredentialsModule.js +96 -0
  155. package/esm/public/orm/mutation/index.d.ts +72 -20
  156. package/esm/public/orm/mutation/index.js +96 -24
  157. package/esm/public/orm/query/index.d.ts +24 -2
  158. package/esm/public/orm/query/index.js +36 -4
  159. package/package.json +2 -2
  160. package/public/cli/commands/app-membership.js +22 -0
  161. package/public/cli/commands/construct-blueprint.js +1 -1
  162. package/public/cli/commands/create-api-key.d.ts +8 -0
  163. package/public/cli/commands/create-api-key.js +36 -0
  164. package/public/cli/commands/devices-module.d.ts +8 -0
  165. package/{auth/cli/commands/connected-account.js → public/cli/commands/devices-module.js} +101 -87
  166. package/public/cli/commands/disconnect-account.d.ts +8 -0
  167. package/public/cli/commands/disconnect-account.js +36 -0
  168. package/public/cli/commands/entity-type-provision.d.ts +8 -0
  169. package/public/cli/commands/entity-type-provision.js +556 -0
  170. package/public/cli/commands/membership-type.js +44 -0
  171. package/public/cli/commands/memberships-module.js +22 -0
  172. package/public/cli/commands/org-member-profile.d.ts +8 -0
  173. package/public/cli/commands/org-member-profile.js +392 -0
  174. package/public/cli/commands/org-membership.js +44 -0
  175. package/public/cli/commands/provision-new-user.d.ts +8 -0
  176. package/public/cli/commands/provision-new-user.js +36 -0
  177. package/public/cli/commands/provision-spatial-relation.d.ts +8 -0
  178. package/public/cli/commands/provision-spatial-relation.js +36 -0
  179. package/public/cli/commands/request-cross-origin-token.d.ts +8 -0
  180. package/public/cli/commands/request-cross-origin-token.js +36 -0
  181. package/public/cli/commands/require-step-up.d.ts +8 -0
  182. package/public/cli/commands/require-step-up.js +30 -0
  183. package/public/cli/commands/resolve-blueprint-field.d.ts +8 -0
  184. package/public/cli/commands/resolve-blueprint-field.js +40 -0
  185. package/public/cli/commands/revoke-api-key.d.ts +8 -0
  186. package/public/cli/commands/revoke-api-key.js +36 -0
  187. package/public/cli/commands/revoke-session.d.ts +8 -0
  188. package/public/cli/commands/revoke-session.js +36 -0
  189. package/public/cli/commands/session-secrets-module.d.ts +8 -0
  190. package/public/cli/commands/{connected-account.js → session-secrets-module.js} +82 -90
  191. package/public/cli/commands/sign-in-cross-origin.d.ts +8 -0
  192. package/public/cli/commands/sign-in-cross-origin.js +36 -0
  193. package/public/cli/commands/spatial-relation.d.ts +8 -0
  194. package/public/cli/commands/spatial-relation.js +474 -0
  195. package/public/cli/commands/user-auth-module.js +24 -24
  196. package/public/cli/commands/user-connected-account.d.ts +8 -0
  197. package/public/cli/commands/user-connected-account.js +176 -0
  198. package/public/cli/commands/webauthn-credentials-module.d.ts +8 -0
  199. package/public/cli/commands/{table-template-module.js → webauthn-credentials-module.js} +8 -48
  200. package/public/cli/commands.js +41 -15
  201. package/public/cli/executor.d.ts +61 -16
  202. package/public/orm/index.d.ts +69 -19
  203. package/public/orm/index.js +16 -6
  204. package/public/orm/input-types.d.ts +2047 -640
  205. package/public/orm/input-types.js +15 -6
  206. package/public/orm/models/devicesModule.d.ts +56 -0
  207. package/public/orm/models/devicesModule.js +100 -0
  208. package/public/orm/models/entityTypeProvision.d.ts +56 -0
  209. package/public/orm/models/{tableTemplateModule.js → entityTypeProvision.js} +26 -26
  210. package/public/orm/models/index.d.ts +8 -3
  211. package/public/orm/models/index.js +19 -9
  212. package/public/orm/models/orgMemberProfile.d.ts +56 -0
  213. package/public/orm/models/{connectedAccount.js → orgMemberProfile.js} +26 -26
  214. package/public/orm/models/sessionSecretsModule.d.ts +56 -0
  215. package/public/orm/models/sessionSecretsModule.js +100 -0
  216. package/public/orm/models/spatialRelation.d.ts +56 -0
  217. package/public/orm/models/spatialRelation.js +100 -0
  218. package/public/orm/models/userConnectedAccount.d.ts +38 -0
  219. package/public/orm/models/userConnectedAccount.js +76 -0
  220. package/public/orm/models/webauthnCredentialsModule.d.ts +56 -0
  221. package/public/orm/models/webauthnCredentialsModule.js +100 -0
  222. package/public/orm/mutation/index.d.ts +72 -20
  223. package/public/orm/mutation/index.js +96 -24
  224. package/public/orm/query/index.d.ts +24 -2
  225. package/public/orm/query/index.js +36 -4
  226. package/auth/orm/models/connectedAccount.d.ts +0 -56
  227. package/esm/auth/cli/commands/sign-in-one-time-token.d.ts +0 -8
  228. package/esm/auth/orm/models/connectedAccount.d.ts +0 -56
  229. package/esm/public/cli/commands/one-time-token.d.ts +0 -8
  230. package/esm/public/cli/commands/sign-in-one-time-token.d.ts +0 -8
  231. package/esm/public/orm/models/connectedAccount.d.ts +0 -56
  232. package/esm/public/orm/models/tableTemplateModule.d.ts +0 -56
  233. package/public/cli/commands/one-time-token.d.ts +0 -8
  234. package/public/cli/commands/sign-in-one-time-token.d.ts +0 -8
  235. package/public/cli/commands/table-template-module.d.ts +0 -8
  236. package/public/orm/models/connectedAccount.d.ts +0 -56
  237. package/public/orm/models/tableTemplateModule.d.ts +0 -56
@@ -0,0 +1,554 @@
1
+ /**
2
+ * CLI commands for EntityTypeProvision
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
+ name: 'string',
13
+ prefix: 'string',
14
+ description: 'string',
15
+ parentEntity: 'string',
16
+ tableName: 'string',
17
+ isVisible: 'boolean',
18
+ hasLimits: 'boolean',
19
+ hasProfiles: 'boolean',
20
+ hasLevels: 'boolean',
21
+ skipEntityPolicies: 'boolean',
22
+ tableProvision: 'json',
23
+ outMembershipType: 'int',
24
+ outEntityTableId: 'uuid',
25
+ outEntityTableName: 'string',
26
+ outInstalledModules: 'string',
27
+ };
28
+ 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
+ export default async (argv, prompter, _options) => {
30
+ if (argv.help || argv.h) {
31
+ console.log(usage);
32
+ process.exit(0);
33
+ }
34
+ const { first: subcommand, newArgv } = extractFirst(argv);
35
+ if (!subcommand) {
36
+ const answer = await prompter.prompt(argv, [
37
+ {
38
+ type: 'autocomplete',
39
+ name: 'subcommand',
40
+ message: 'What do you want to do?',
41
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
42
+ },
43
+ ]);
44
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
45
+ }
46
+ return handleTableSubcommand(subcommand, newArgv, prompter);
47
+ };
48
+ async function handleTableSubcommand(subcommand, argv, prompter) {
49
+ switch (subcommand) {
50
+ case 'list':
51
+ return handleList(argv, prompter);
52
+ case 'find-first':
53
+ return handleFindFirst(argv, prompter);
54
+ case 'get':
55
+ return handleGet(argv, prompter);
56
+ case 'create':
57
+ return handleCreate(argv, prompter);
58
+ case 'update':
59
+ return handleUpdate(argv, prompter);
60
+ case 'delete':
61
+ return handleDelete(argv, prompter);
62
+ default:
63
+ console.log(usage);
64
+ process.exit(1);
65
+ }
66
+ }
67
+ async function handleList(argv, _prompter) {
68
+ try {
69
+ const defaultSelect = {
70
+ id: true,
71
+ databaseId: true,
72
+ name: true,
73
+ prefix: true,
74
+ description: true,
75
+ parentEntity: true,
76
+ tableName: true,
77
+ isVisible: true,
78
+ hasLimits: true,
79
+ hasProfiles: true,
80
+ hasLevels: true,
81
+ skipEntityPolicies: true,
82
+ tableProvision: true,
83
+ outMembershipType: true,
84
+ outEntityTableId: true,
85
+ outEntityTableName: true,
86
+ outInstalledModules: true,
87
+ };
88
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
89
+ const client = getClient();
90
+ const result = await client.entityTypeProvision.findMany(findManyArgs).execute();
91
+ console.log(JSON.stringify(result, null, 2));
92
+ }
93
+ catch (error) {
94
+ console.error('Failed to list records.');
95
+ if (error instanceof Error) {
96
+ console.error(error.message);
97
+ }
98
+ process.exit(1);
99
+ }
100
+ }
101
+ async function handleFindFirst(argv, _prompter) {
102
+ try {
103
+ const defaultSelect = {
104
+ id: true,
105
+ databaseId: true,
106
+ name: true,
107
+ prefix: true,
108
+ description: true,
109
+ parentEntity: true,
110
+ tableName: true,
111
+ isVisible: true,
112
+ hasLimits: true,
113
+ hasProfiles: true,
114
+ hasLevels: true,
115
+ skipEntityPolicies: true,
116
+ tableProvision: true,
117
+ outMembershipType: true,
118
+ outEntityTableId: true,
119
+ outEntityTableName: true,
120
+ outInstalledModules: true,
121
+ };
122
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
123
+ const client = getClient();
124
+ const result = await client.entityTypeProvision.findFirst(findFirstArgs).execute();
125
+ console.log(JSON.stringify(result, null, 2));
126
+ }
127
+ catch (error) {
128
+ console.error('Failed to find record.');
129
+ if (error instanceof Error) {
130
+ console.error(error.message);
131
+ }
132
+ process.exit(1);
133
+ }
134
+ }
135
+ async function handleGet(argv, prompter) {
136
+ try {
137
+ const answers = await prompter.prompt(argv, [
138
+ {
139
+ type: 'text',
140
+ name: 'id',
141
+ message: 'id',
142
+ required: true,
143
+ },
144
+ ]);
145
+ const client = getClient();
146
+ const result = await client.entityTypeProvision
147
+ .findOne({
148
+ id: answers.id,
149
+ select: {
150
+ id: true,
151
+ databaseId: true,
152
+ name: true,
153
+ prefix: true,
154
+ description: true,
155
+ parentEntity: true,
156
+ tableName: true,
157
+ isVisible: true,
158
+ hasLimits: true,
159
+ hasProfiles: true,
160
+ hasLevels: true,
161
+ skipEntityPolicies: true,
162
+ tableProvision: true,
163
+ outMembershipType: true,
164
+ outEntityTableId: true,
165
+ outEntityTableName: true,
166
+ outInstalledModules: true,
167
+ },
168
+ })
169
+ .execute();
170
+ console.log(JSON.stringify(result, null, 2));
171
+ }
172
+ catch (error) {
173
+ console.error('Record not found.');
174
+ if (error instanceof Error) {
175
+ console.error(error.message);
176
+ }
177
+ process.exit(1);
178
+ }
179
+ }
180
+ async function handleCreate(argv, prompter) {
181
+ try {
182
+ const rawAnswers = await prompter.prompt(argv, [
183
+ {
184
+ type: 'text',
185
+ name: 'databaseId',
186
+ message: 'databaseId',
187
+ required: true,
188
+ },
189
+ {
190
+ type: 'text',
191
+ name: 'name',
192
+ message: 'name',
193
+ required: true,
194
+ },
195
+ {
196
+ type: 'text',
197
+ name: 'prefix',
198
+ message: 'prefix',
199
+ required: true,
200
+ },
201
+ {
202
+ type: 'text',
203
+ name: 'description',
204
+ message: 'description',
205
+ required: false,
206
+ skipPrompt: true,
207
+ },
208
+ {
209
+ type: 'text',
210
+ name: 'parentEntity',
211
+ message: 'parentEntity',
212
+ required: false,
213
+ skipPrompt: true,
214
+ },
215
+ {
216
+ type: 'text',
217
+ name: 'tableName',
218
+ message: 'tableName',
219
+ required: false,
220
+ skipPrompt: true,
221
+ },
222
+ {
223
+ type: 'boolean',
224
+ name: 'isVisible',
225
+ message: 'isVisible',
226
+ required: false,
227
+ skipPrompt: true,
228
+ },
229
+ {
230
+ type: 'boolean',
231
+ name: 'hasLimits',
232
+ message: 'hasLimits',
233
+ required: false,
234
+ skipPrompt: true,
235
+ },
236
+ {
237
+ type: 'boolean',
238
+ name: 'hasProfiles',
239
+ message: 'hasProfiles',
240
+ required: false,
241
+ skipPrompt: true,
242
+ },
243
+ {
244
+ type: 'boolean',
245
+ name: 'hasLevels',
246
+ message: 'hasLevels',
247
+ required: false,
248
+ skipPrompt: true,
249
+ },
250
+ {
251
+ type: 'boolean',
252
+ name: 'skipEntityPolicies',
253
+ message: 'skipEntityPolicies',
254
+ required: false,
255
+ skipPrompt: true,
256
+ },
257
+ {
258
+ type: 'json',
259
+ name: 'tableProvision',
260
+ message: 'tableProvision',
261
+ required: false,
262
+ skipPrompt: true,
263
+ },
264
+ {
265
+ type: 'text',
266
+ name: 'outMembershipType',
267
+ message: 'outMembershipType',
268
+ required: false,
269
+ skipPrompt: true,
270
+ },
271
+ {
272
+ type: 'text',
273
+ name: 'outEntityTableId',
274
+ message: 'outEntityTableId',
275
+ required: false,
276
+ skipPrompt: true,
277
+ },
278
+ {
279
+ type: 'text',
280
+ name: 'outEntityTableName',
281
+ message: 'outEntityTableName',
282
+ required: false,
283
+ skipPrompt: true,
284
+ },
285
+ {
286
+ type: 'text',
287
+ name: 'outInstalledModules',
288
+ message: 'outInstalledModules',
289
+ required: false,
290
+ skipPrompt: true,
291
+ },
292
+ ]);
293
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
294
+ const cleanedData = stripUndefined(answers, fieldSchema);
295
+ const client = getClient();
296
+ const result = await client.entityTypeProvision
297
+ .create({
298
+ data: {
299
+ databaseId: cleanedData.databaseId,
300
+ name: cleanedData.name,
301
+ prefix: cleanedData.prefix,
302
+ description: cleanedData.description,
303
+ parentEntity: cleanedData.parentEntity,
304
+ tableName: cleanedData.tableName,
305
+ isVisible: cleanedData.isVisible,
306
+ hasLimits: cleanedData.hasLimits,
307
+ hasProfiles: cleanedData.hasProfiles,
308
+ hasLevels: cleanedData.hasLevels,
309
+ skipEntityPolicies: cleanedData.skipEntityPolicies,
310
+ tableProvision: cleanedData.tableProvision,
311
+ outMembershipType: cleanedData.outMembershipType,
312
+ outEntityTableId: cleanedData.outEntityTableId,
313
+ outEntityTableName: cleanedData.outEntityTableName,
314
+ outInstalledModules: cleanedData.outInstalledModules,
315
+ },
316
+ select: {
317
+ id: true,
318
+ databaseId: true,
319
+ name: true,
320
+ prefix: true,
321
+ description: true,
322
+ parentEntity: true,
323
+ tableName: true,
324
+ isVisible: true,
325
+ hasLimits: true,
326
+ hasProfiles: true,
327
+ hasLevels: true,
328
+ skipEntityPolicies: true,
329
+ tableProvision: true,
330
+ outMembershipType: true,
331
+ outEntityTableId: true,
332
+ outEntityTableName: true,
333
+ outInstalledModules: true,
334
+ },
335
+ })
336
+ .execute();
337
+ console.log(JSON.stringify(result, null, 2));
338
+ }
339
+ catch (error) {
340
+ console.error('Failed to create record.');
341
+ if (error instanceof Error) {
342
+ console.error(error.message);
343
+ }
344
+ process.exit(1);
345
+ }
346
+ }
347
+ async function handleUpdate(argv, prompter) {
348
+ try {
349
+ const rawAnswers = await prompter.prompt(argv, [
350
+ {
351
+ type: 'text',
352
+ name: 'id',
353
+ message: 'id',
354
+ required: true,
355
+ },
356
+ {
357
+ type: 'text',
358
+ name: 'databaseId',
359
+ message: 'databaseId',
360
+ required: false,
361
+ },
362
+ {
363
+ type: 'text',
364
+ name: 'name',
365
+ message: 'name',
366
+ required: false,
367
+ },
368
+ {
369
+ type: 'text',
370
+ name: 'prefix',
371
+ message: 'prefix',
372
+ required: false,
373
+ },
374
+ {
375
+ type: 'text',
376
+ name: 'description',
377
+ message: 'description',
378
+ required: false,
379
+ skipPrompt: true,
380
+ },
381
+ {
382
+ type: 'text',
383
+ name: 'parentEntity',
384
+ message: 'parentEntity',
385
+ required: false,
386
+ skipPrompt: true,
387
+ },
388
+ {
389
+ type: 'text',
390
+ name: 'tableName',
391
+ message: 'tableName',
392
+ required: false,
393
+ skipPrompt: true,
394
+ },
395
+ {
396
+ type: 'boolean',
397
+ name: 'isVisible',
398
+ message: 'isVisible',
399
+ required: false,
400
+ skipPrompt: true,
401
+ },
402
+ {
403
+ type: 'boolean',
404
+ name: 'hasLimits',
405
+ message: 'hasLimits',
406
+ required: false,
407
+ skipPrompt: true,
408
+ },
409
+ {
410
+ type: 'boolean',
411
+ name: 'hasProfiles',
412
+ message: 'hasProfiles',
413
+ required: false,
414
+ skipPrompt: true,
415
+ },
416
+ {
417
+ type: 'boolean',
418
+ name: 'hasLevels',
419
+ message: 'hasLevels',
420
+ required: false,
421
+ skipPrompt: true,
422
+ },
423
+ {
424
+ type: 'boolean',
425
+ name: 'skipEntityPolicies',
426
+ message: 'skipEntityPolicies',
427
+ required: false,
428
+ skipPrompt: true,
429
+ },
430
+ {
431
+ type: 'json',
432
+ name: 'tableProvision',
433
+ message: 'tableProvision',
434
+ required: false,
435
+ skipPrompt: true,
436
+ },
437
+ {
438
+ type: 'text',
439
+ name: 'outMembershipType',
440
+ message: 'outMembershipType',
441
+ required: false,
442
+ skipPrompt: true,
443
+ },
444
+ {
445
+ type: 'text',
446
+ name: 'outEntityTableId',
447
+ message: 'outEntityTableId',
448
+ required: false,
449
+ skipPrompt: true,
450
+ },
451
+ {
452
+ type: 'text',
453
+ name: 'outEntityTableName',
454
+ message: 'outEntityTableName',
455
+ required: false,
456
+ skipPrompt: true,
457
+ },
458
+ {
459
+ type: 'text',
460
+ name: 'outInstalledModules',
461
+ message: 'outInstalledModules',
462
+ required: false,
463
+ skipPrompt: true,
464
+ },
465
+ ]);
466
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
467
+ const cleanedData = stripUndefined(answers, fieldSchema);
468
+ const client = getClient();
469
+ const result = await client.entityTypeProvision
470
+ .update({
471
+ where: {
472
+ id: answers.id,
473
+ },
474
+ data: {
475
+ databaseId: cleanedData.databaseId,
476
+ name: cleanedData.name,
477
+ prefix: cleanedData.prefix,
478
+ description: cleanedData.description,
479
+ parentEntity: cleanedData.parentEntity,
480
+ tableName: cleanedData.tableName,
481
+ isVisible: cleanedData.isVisible,
482
+ hasLimits: cleanedData.hasLimits,
483
+ hasProfiles: cleanedData.hasProfiles,
484
+ hasLevels: cleanedData.hasLevels,
485
+ skipEntityPolicies: cleanedData.skipEntityPolicies,
486
+ tableProvision: cleanedData.tableProvision,
487
+ outMembershipType: cleanedData.outMembershipType,
488
+ outEntityTableId: cleanedData.outEntityTableId,
489
+ outEntityTableName: cleanedData.outEntityTableName,
490
+ outInstalledModules: cleanedData.outInstalledModules,
491
+ },
492
+ select: {
493
+ id: true,
494
+ databaseId: true,
495
+ name: true,
496
+ prefix: true,
497
+ description: true,
498
+ parentEntity: true,
499
+ tableName: true,
500
+ isVisible: true,
501
+ hasLimits: true,
502
+ hasProfiles: true,
503
+ hasLevels: true,
504
+ skipEntityPolicies: true,
505
+ tableProvision: true,
506
+ outMembershipType: true,
507
+ outEntityTableId: true,
508
+ outEntityTableName: true,
509
+ outInstalledModules: true,
510
+ },
511
+ })
512
+ .execute();
513
+ console.log(JSON.stringify(result, null, 2));
514
+ }
515
+ catch (error) {
516
+ console.error('Failed to update record.');
517
+ if (error instanceof Error) {
518
+ console.error(error.message);
519
+ }
520
+ process.exit(1);
521
+ }
522
+ }
523
+ async function handleDelete(argv, prompter) {
524
+ try {
525
+ const rawAnswers = await prompter.prompt(argv, [
526
+ {
527
+ type: 'text',
528
+ name: 'id',
529
+ message: 'id',
530
+ required: true,
531
+ },
532
+ ]);
533
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
534
+ const client = getClient();
535
+ const result = await client.entityTypeProvision
536
+ .delete({
537
+ where: {
538
+ id: answers.id,
539
+ },
540
+ select: {
541
+ id: true,
542
+ },
543
+ })
544
+ .execute();
545
+ console.log(JSON.stringify(result, null, 2));
546
+ }
547
+ catch (error) {
548
+ console.error('Failed to delete record.');
549
+ if (error instanceof Error) {
550
+ console.error(error.message);
551
+ }
552
+ process.exit(1);
553
+ }
554
+ }
@@ -11,6 +11,8 @@ const fieldSchema = {
11
11
  name: 'string',
12
12
  description: 'string',
13
13
  prefix: 'string',
14
+ parentMembershipType: 'int',
15
+ hasUsersTableEntry: 'boolean',
14
16
  };
15
17
  const usage = '\nmembership-type <command>\n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\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';
16
18
  export default async (argv, prompter, _options) => {
@@ -58,6 +60,8 @@ async function handleList(argv, _prompter) {
58
60
  name: true,
59
61
  description: true,
60
62
  prefix: true,
63
+ parentMembershipType: true,
64
+ hasUsersTableEntry: true,
61
65
  };
62
66
  const findManyArgs = parseFindManyArgs(argv, defaultSelect);
63
67
  const client = getClient();
@@ -79,6 +83,8 @@ async function handleFindFirst(argv, _prompter) {
79
83
  name: true,
80
84
  description: true,
81
85
  prefix: true,
86
+ parentMembershipType: true,
87
+ hasUsersTableEntry: true,
82
88
  };
83
89
  const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
84
90
  const client = getClient();
@@ -112,6 +118,8 @@ async function handleGet(argv, prompter) {
112
118
  name: true,
113
119
  description: true,
114
120
  prefix: true,
121
+ parentMembershipType: true,
122
+ hasUsersTableEntry: true,
115
123
  },
116
124
  })
117
125
  .execute();
@@ -146,6 +154,20 @@ async function handleCreate(argv, prompter) {
146
154
  message: 'prefix',
147
155
  required: true,
148
156
  },
157
+ {
158
+ type: 'text',
159
+ name: 'parentMembershipType',
160
+ message: 'parentMembershipType',
161
+ required: false,
162
+ skipPrompt: true,
163
+ },
164
+ {
165
+ type: 'boolean',
166
+ name: 'hasUsersTableEntry',
167
+ message: 'hasUsersTableEntry',
168
+ required: false,
169
+ skipPrompt: true,
170
+ },
149
171
  ]);
150
172
  const answers = coerceAnswers(rawAnswers, fieldSchema);
151
173
  const cleanedData = stripUndefined(answers, fieldSchema);
@@ -156,12 +178,16 @@ async function handleCreate(argv, prompter) {
156
178
  name: cleanedData.name,
157
179
  description: cleanedData.description,
158
180
  prefix: cleanedData.prefix,
181
+ parentMembershipType: cleanedData.parentMembershipType,
182
+ hasUsersTableEntry: cleanedData.hasUsersTableEntry,
159
183
  },
160
184
  select: {
161
185
  id: true,
162
186
  name: true,
163
187
  description: true,
164
188
  prefix: true,
189
+ parentMembershipType: true,
190
+ hasUsersTableEntry: true,
165
191
  },
166
192
  })
167
193
  .execute();
@@ -202,6 +228,20 @@ async function handleUpdate(argv, prompter) {
202
228
  message: 'prefix',
203
229
  required: false,
204
230
  },
231
+ {
232
+ type: 'text',
233
+ name: 'parentMembershipType',
234
+ message: 'parentMembershipType',
235
+ required: false,
236
+ skipPrompt: true,
237
+ },
238
+ {
239
+ type: 'boolean',
240
+ name: 'hasUsersTableEntry',
241
+ message: 'hasUsersTableEntry',
242
+ required: false,
243
+ skipPrompt: true,
244
+ },
205
245
  ]);
206
246
  const answers = coerceAnswers(rawAnswers, fieldSchema);
207
247
  const cleanedData = stripUndefined(answers, fieldSchema);
@@ -215,12 +255,16 @@ async function handleUpdate(argv, prompter) {
215
255
  name: cleanedData.name,
216
256
  description: cleanedData.description,
217
257
  prefix: cleanedData.prefix,
258
+ parentMembershipType: cleanedData.parentMembershipType,
259
+ hasUsersTableEntry: cleanedData.hasUsersTableEntry,
218
260
  },
219
261
  select: {
220
262
  id: true,
221
263
  name: true,
222
264
  description: true,
223
265
  prefix: true,
266
+ parentMembershipType: true,
267
+ hasUsersTableEntry: true,
224
268
  },
225
269
  })
226
270
  .execute();