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