@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
@@ -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();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * CLI commands for ConnectedAccount
2
+ * CLI commands for OrgMemberProfile
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,390 @@
1
+ /**
2
+ * CLI commands for OrgMemberProfile
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
+ createdAt: 'string',
12
+ updatedAt: 'string',
13
+ membershipId: 'uuid',
14
+ entityId: 'uuid',
15
+ actorId: 'uuid',
16
+ displayName: 'string',
17
+ email: 'string',
18
+ title: 'string',
19
+ bio: 'string',
20
+ profilePicture: 'string',
21
+ };
22
+ const usage = '\norg-member-profile <command>\n\nCommands:\n list List orgMemberProfile records\n find-first Find first matching orgMemberProfile record\n get Get a orgMemberProfile by ID\n create Create a new orgMemberProfile\n update Update an existing orgMemberProfile\n delete Delete a orgMemberProfile\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';
23
+ export default async (argv, prompter, _options) => {
24
+ if (argv.help || argv.h) {
25
+ console.log(usage);
26
+ process.exit(0);
27
+ }
28
+ const { first: subcommand, newArgv } = extractFirst(argv);
29
+ if (!subcommand) {
30
+ const answer = await prompter.prompt(argv, [
31
+ {
32
+ type: 'autocomplete',
33
+ name: 'subcommand',
34
+ message: 'What do you want to do?',
35
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
36
+ },
37
+ ]);
38
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
39
+ }
40
+ return handleTableSubcommand(subcommand, newArgv, prompter);
41
+ };
42
+ async function handleTableSubcommand(subcommand, argv, prompter) {
43
+ switch (subcommand) {
44
+ case 'list':
45
+ return handleList(argv, prompter);
46
+ case 'find-first':
47
+ return handleFindFirst(argv, prompter);
48
+ case 'get':
49
+ return handleGet(argv, prompter);
50
+ case 'create':
51
+ return handleCreate(argv, prompter);
52
+ case 'update':
53
+ return handleUpdate(argv, prompter);
54
+ case 'delete':
55
+ return handleDelete(argv, prompter);
56
+ default:
57
+ console.log(usage);
58
+ process.exit(1);
59
+ }
60
+ }
61
+ async function handleList(argv, _prompter) {
62
+ try {
63
+ const defaultSelect = {
64
+ id: true,
65
+ createdAt: true,
66
+ updatedAt: true,
67
+ membershipId: true,
68
+ entityId: true,
69
+ actorId: true,
70
+ displayName: true,
71
+ email: true,
72
+ title: true,
73
+ bio: true,
74
+ profilePicture: true,
75
+ };
76
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
77
+ const client = getClient();
78
+ const result = await client.orgMemberProfile.findMany(findManyArgs).execute();
79
+ console.log(JSON.stringify(result, null, 2));
80
+ }
81
+ catch (error) {
82
+ console.error('Failed to list records.');
83
+ if (error instanceof Error) {
84
+ console.error(error.message);
85
+ }
86
+ process.exit(1);
87
+ }
88
+ }
89
+ async function handleFindFirst(argv, _prompter) {
90
+ try {
91
+ const defaultSelect = {
92
+ id: true,
93
+ createdAt: true,
94
+ updatedAt: true,
95
+ membershipId: true,
96
+ entityId: true,
97
+ actorId: true,
98
+ displayName: true,
99
+ email: true,
100
+ title: true,
101
+ bio: true,
102
+ profilePicture: true,
103
+ };
104
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
105
+ const client = getClient();
106
+ const result = await client.orgMemberProfile.findFirst(findFirstArgs).execute();
107
+ console.log(JSON.stringify(result, null, 2));
108
+ }
109
+ catch (error) {
110
+ console.error('Failed to find record.');
111
+ if (error instanceof Error) {
112
+ console.error(error.message);
113
+ }
114
+ process.exit(1);
115
+ }
116
+ }
117
+ async function handleGet(argv, prompter) {
118
+ try {
119
+ const answers = await prompter.prompt(argv, [
120
+ {
121
+ type: 'text',
122
+ name: 'id',
123
+ message: 'id',
124
+ required: true,
125
+ },
126
+ ]);
127
+ const client = getClient();
128
+ const result = await client.orgMemberProfile
129
+ .findOne({
130
+ id: answers.id,
131
+ select: {
132
+ id: true,
133
+ createdAt: true,
134
+ updatedAt: true,
135
+ membershipId: true,
136
+ entityId: true,
137
+ actorId: true,
138
+ displayName: true,
139
+ email: true,
140
+ title: true,
141
+ bio: true,
142
+ profilePicture: true,
143
+ },
144
+ })
145
+ .execute();
146
+ console.log(JSON.stringify(result, null, 2));
147
+ }
148
+ catch (error) {
149
+ console.error('Record not found.');
150
+ if (error instanceof Error) {
151
+ console.error(error.message);
152
+ }
153
+ process.exit(1);
154
+ }
155
+ }
156
+ async function handleCreate(argv, prompter) {
157
+ try {
158
+ const rawAnswers = await prompter.prompt(argv, [
159
+ {
160
+ type: 'text',
161
+ name: 'membershipId',
162
+ message: 'membershipId',
163
+ required: true,
164
+ },
165
+ {
166
+ type: 'text',
167
+ name: 'entityId',
168
+ message: 'entityId',
169
+ required: true,
170
+ },
171
+ {
172
+ type: 'text',
173
+ name: 'actorId',
174
+ message: 'actorId',
175
+ required: true,
176
+ },
177
+ {
178
+ type: 'text',
179
+ name: 'displayName',
180
+ message: 'displayName',
181
+ required: false,
182
+ skipPrompt: true,
183
+ },
184
+ {
185
+ type: 'text',
186
+ name: 'email',
187
+ message: 'email',
188
+ required: false,
189
+ skipPrompt: true,
190
+ },
191
+ {
192
+ type: 'text',
193
+ name: 'title',
194
+ message: 'title',
195
+ required: false,
196
+ skipPrompt: true,
197
+ },
198
+ {
199
+ type: 'text',
200
+ name: 'bio',
201
+ message: 'bio',
202
+ required: false,
203
+ skipPrompt: true,
204
+ },
205
+ {
206
+ type: 'text',
207
+ name: 'profilePicture',
208
+ message: 'profilePicture',
209
+ required: false,
210
+ skipPrompt: true,
211
+ },
212
+ ]);
213
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
214
+ const cleanedData = stripUndefined(answers, fieldSchema);
215
+ const client = getClient();
216
+ const result = await client.orgMemberProfile
217
+ .create({
218
+ data: {
219
+ membershipId: cleanedData.membershipId,
220
+ entityId: cleanedData.entityId,
221
+ actorId: cleanedData.actorId,
222
+ displayName: cleanedData.displayName,
223
+ email: cleanedData.email,
224
+ title: cleanedData.title,
225
+ bio: cleanedData.bio,
226
+ profilePicture: cleanedData.profilePicture,
227
+ },
228
+ select: {
229
+ id: true,
230
+ createdAt: true,
231
+ updatedAt: true,
232
+ membershipId: true,
233
+ entityId: true,
234
+ actorId: true,
235
+ displayName: true,
236
+ email: true,
237
+ title: true,
238
+ bio: true,
239
+ profilePicture: true,
240
+ },
241
+ })
242
+ .execute();
243
+ console.log(JSON.stringify(result, null, 2));
244
+ }
245
+ catch (error) {
246
+ console.error('Failed to create record.');
247
+ if (error instanceof Error) {
248
+ console.error(error.message);
249
+ }
250
+ process.exit(1);
251
+ }
252
+ }
253
+ async function handleUpdate(argv, prompter) {
254
+ try {
255
+ const rawAnswers = await prompter.prompt(argv, [
256
+ {
257
+ type: 'text',
258
+ name: 'id',
259
+ message: 'id',
260
+ required: true,
261
+ },
262
+ {
263
+ type: 'text',
264
+ name: 'membershipId',
265
+ message: 'membershipId',
266
+ required: false,
267
+ },
268
+ {
269
+ type: 'text',
270
+ name: 'entityId',
271
+ message: 'entityId',
272
+ required: false,
273
+ },
274
+ {
275
+ type: 'text',
276
+ name: 'actorId',
277
+ message: 'actorId',
278
+ required: false,
279
+ },
280
+ {
281
+ type: 'text',
282
+ name: 'displayName',
283
+ message: 'displayName',
284
+ required: false,
285
+ skipPrompt: true,
286
+ },
287
+ {
288
+ type: 'text',
289
+ name: 'email',
290
+ message: 'email',
291
+ required: false,
292
+ skipPrompt: true,
293
+ },
294
+ {
295
+ type: 'text',
296
+ name: 'title',
297
+ message: 'title',
298
+ required: false,
299
+ skipPrompt: true,
300
+ },
301
+ {
302
+ type: 'text',
303
+ name: 'bio',
304
+ message: 'bio',
305
+ required: false,
306
+ skipPrompt: true,
307
+ },
308
+ {
309
+ type: 'text',
310
+ name: 'profilePicture',
311
+ message: 'profilePicture',
312
+ required: false,
313
+ skipPrompt: true,
314
+ },
315
+ ]);
316
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
317
+ const cleanedData = stripUndefined(answers, fieldSchema);
318
+ const client = getClient();
319
+ const result = await client.orgMemberProfile
320
+ .update({
321
+ where: {
322
+ id: answers.id,
323
+ },
324
+ data: {
325
+ membershipId: cleanedData.membershipId,
326
+ entityId: cleanedData.entityId,
327
+ actorId: cleanedData.actorId,
328
+ displayName: cleanedData.displayName,
329
+ email: cleanedData.email,
330
+ title: cleanedData.title,
331
+ bio: cleanedData.bio,
332
+ profilePicture: cleanedData.profilePicture,
333
+ },
334
+ select: {
335
+ id: true,
336
+ createdAt: true,
337
+ updatedAt: true,
338
+ membershipId: true,
339
+ entityId: true,
340
+ actorId: true,
341
+ displayName: true,
342
+ email: true,
343
+ title: true,
344
+ bio: true,
345
+ profilePicture: true,
346
+ },
347
+ })
348
+ .execute();
349
+ console.log(JSON.stringify(result, null, 2));
350
+ }
351
+ catch (error) {
352
+ console.error('Failed to update record.');
353
+ if (error instanceof Error) {
354
+ console.error(error.message);
355
+ }
356
+ process.exit(1);
357
+ }
358
+ }
359
+ async function handleDelete(argv, prompter) {
360
+ try {
361
+ const rawAnswers = await prompter.prompt(argv, [
362
+ {
363
+ type: 'text',
364
+ name: 'id',
365
+ message: 'id',
366
+ required: true,
367
+ },
368
+ ]);
369
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
370
+ const client = getClient();
371
+ const result = await client.orgMemberProfile
372
+ .delete({
373
+ where: {
374
+ id: answers.id,
375
+ },
376
+ select: {
377
+ id: true,
378
+ },
379
+ })
380
+ .execute();
381
+ console.log(JSON.stringify(result, null, 2));
382
+ }
383
+ catch (error) {
384
+ console.error('Failed to delete record.');
385
+ if (error instanceof Error) {
386
+ console.error(error.message);
387
+ }
388
+ process.exit(1);
389
+ }
390
+ }
@@ -16,12 +16,14 @@ const fieldSchema = {
16
16
  isBanned: 'boolean',
17
17
  isDisabled: 'boolean',
18
18
  isActive: 'boolean',
19
+ isExternal: 'boolean',
19
20
  isOwner: 'boolean',
20
21
  isAdmin: 'boolean',
21
22
  permissions: 'string',
22
23
  granted: 'string',
23
24
  actorId: 'uuid',
24
25
  entityId: 'uuid',
26
+ isReadOnly: 'boolean',
25
27
  profileId: 'uuid',
26
28
  };
27
29
  const usage = '\norg-membership <command>\n\nCommands:\n list List orgMembership records\n find-first Find first matching orgMembership record\n get Get a orgMembership by ID\n create Create a new orgMembership\n update Update an existing orgMembership\n delete Delete a orgMembership\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';
@@ -75,12 +77,14 @@ async function handleList(argv, _prompter) {
75
77
  isBanned: true,
76
78
  isDisabled: true,
77
79
  isActive: true,
80
+ isExternal: true,
78
81
  isOwner: true,
79
82
  isAdmin: true,
80
83
  permissions: true,
81
84
  granted: true,
82
85
  actorId: true,
83
86
  entityId: true,
87
+ isReadOnly: true,
84
88
  profileId: true,
85
89
  };
86
90
  const findManyArgs = parseFindManyArgs(argv, defaultSelect);
@@ -108,12 +112,14 @@ async function handleFindFirst(argv, _prompter) {
108
112
  isBanned: true,
109
113
  isDisabled: true,
110
114
  isActive: true,
115
+ isExternal: true,
111
116
  isOwner: true,
112
117
  isAdmin: true,
113
118
  permissions: true,
114
119
  granted: true,
115
120
  actorId: true,
116
121
  entityId: true,
122
+ isReadOnly: true,
117
123
  profileId: true,
118
124
  };
119
125
  const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
@@ -153,12 +159,14 @@ async function handleGet(argv, prompter) {
153
159
  isBanned: true,
154
160
  isDisabled: true,
155
161
  isActive: true,
162
+ isExternal: true,
156
163
  isOwner: true,
157
164
  isAdmin: true,
158
165
  permissions: true,
159
166
  granted: true,
160
167
  actorId: true,
161
168
  entityId: true,
169
+ isReadOnly: true,
162
170
  profileId: true,
163
171
  },
164
172
  })
@@ -218,6 +226,13 @@ async function handleCreate(argv, prompter) {
218
226
  required: false,
219
227
  skipPrompt: true,
220
228
  },
229
+ {
230
+ type: 'boolean',
231
+ name: 'isExternal',
232
+ message: 'isExternal',
233
+ required: false,
234
+ skipPrompt: true,
235
+ },
221
236
  {
222
237
  type: 'boolean',
223
238
  name: 'isOwner',
@@ -258,6 +273,13 @@ async function handleCreate(argv, prompter) {
258
273
  message: 'entityId',
259
274
  required: true,
260
275
  },
276
+ {
277
+ type: 'boolean',
278
+ name: 'isReadOnly',
279
+ message: 'isReadOnly',
280
+ required: false,
281
+ skipPrompt: true,
282
+ },
261
283
  {
262
284
  type: 'text',
263
285
  name: 'profileId',
@@ -278,12 +300,14 @@ async function handleCreate(argv, prompter) {
278
300
  isBanned: cleanedData.isBanned,
279
301
  isDisabled: cleanedData.isDisabled,
280
302
  isActive: cleanedData.isActive,
303
+ isExternal: cleanedData.isExternal,
281
304
  isOwner: cleanedData.isOwner,
282
305
  isAdmin: cleanedData.isAdmin,
283
306
  permissions: cleanedData.permissions,
284
307
  granted: cleanedData.granted,
285
308
  actorId: cleanedData.actorId,
286
309
  entityId: cleanedData.entityId,
310
+ isReadOnly: cleanedData.isReadOnly,
287
311
  profileId: cleanedData.profileId,
288
312
  },
289
313
  select: {
@@ -296,12 +320,14 @@ async function handleCreate(argv, prompter) {
296
320
  isBanned: true,
297
321
  isDisabled: true,
298
322
  isActive: true,
323
+ isExternal: true,
299
324
  isOwner: true,
300
325
  isAdmin: true,
301
326
  permissions: true,
302
327
  granted: true,
303
328
  actorId: true,
304
329
  entityId: true,
330
+ isReadOnly: true,
305
331
  profileId: true,
306
332
  },
307
333
  })
@@ -367,6 +393,13 @@ async function handleUpdate(argv, prompter) {
367
393
  required: false,
368
394
  skipPrompt: true,
369
395
  },
396
+ {
397
+ type: 'boolean',
398
+ name: 'isExternal',
399
+ message: 'isExternal',
400
+ required: false,
401
+ skipPrompt: true,
402
+ },
370
403
  {
371
404
  type: 'boolean',
372
405
  name: 'isOwner',
@@ -407,6 +440,13 @@ async function handleUpdate(argv, prompter) {
407
440
  message: 'entityId',
408
441
  required: false,
409
442
  },
443
+ {
444
+ type: 'boolean',
445
+ name: 'isReadOnly',
446
+ message: 'isReadOnly',
447
+ required: false,
448
+ skipPrompt: true,
449
+ },
410
450
  {
411
451
  type: 'text',
412
452
  name: 'profileId',
@@ -430,12 +470,14 @@ async function handleUpdate(argv, prompter) {
430
470
  isBanned: cleanedData.isBanned,
431
471
  isDisabled: cleanedData.isDisabled,
432
472
  isActive: cleanedData.isActive,
473
+ isExternal: cleanedData.isExternal,
433
474
  isOwner: cleanedData.isOwner,
434
475
  isAdmin: cleanedData.isAdmin,
435
476
  permissions: cleanedData.permissions,
436
477
  granted: cleanedData.granted,
437
478
  actorId: cleanedData.actorId,
438
479
  entityId: cleanedData.entityId,
480
+ isReadOnly: cleanedData.isReadOnly,
439
481
  profileId: cleanedData.profileId,
440
482
  },
441
483
  select: {
@@ -448,12 +490,14 @@ async function handleUpdate(argv, prompter) {
448
490
  isBanned: true,
449
491
  isDisabled: true,
450
492
  isActive: true,
493
+ isExternal: true,
451
494
  isOwner: true,
452
495
  isAdmin: true,
453
496
  permissions: true,
454
497
  granted: true,
455
498
  actorId: true,
456
499
  entityId: true,
500
+ isReadOnly: true,
457
501
  profileId: true,
458
502
  },
459
503
  })