@constructive-sdk/cli 0.25.9 → 0.25.10
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.
- package/admin/cli/commands/app-admin-grant.js +3 -1
- package/admin/cli/commands/app-grant.js +3 -1
- package/admin/cli/commands/app-invite.js +44 -0
- package/admin/cli/commands/app-owner-grant.js +3 -1
- package/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
- package/admin/cli/commands/app-permission-default-grant.js +286 -0
- package/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
- package/admin/cli/commands/app-permission-default-permission.js +242 -0
- package/admin/cli/commands/org-admin-grant.js +3 -1
- package/admin/cli/commands/org-grant.js +3 -1
- package/admin/cli/commands/org-invite.js +44 -0
- package/admin/cli/commands/org-owner-grant.js +3 -1
- package/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
- package/admin/cli/commands/org-permission-default-grant.js +306 -0
- package/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
- package/admin/cli/commands/org-permission-default-permission.js +262 -0
- package/admin/cli/commands.js +11 -3
- package/admin/cli/executor.d.ts +5 -1
- package/admin/orm/index.d.ts +10 -2
- package/admin/orm/index.js +10 -2
- package/admin/orm/input-types.d.ts +1611 -230
- package/admin/orm/input-types.js +9 -1
- package/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
- package/admin/orm/models/appPermissionDefaultGrant.js +104 -0
- package/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
- package/admin/orm/models/appPermissionDefaultPermission.js +104 -0
- package/admin/orm/models/index.d.ts +5 -1
- package/admin/orm/models/index.js +11 -3
- package/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
- package/admin/orm/models/orgPermissionDefaultGrant.js +104 -0
- package/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
- package/admin/orm/models/orgPermissionDefaultPermission.js +104 -0
- package/agent/cli/commands/agent-message.js +34 -12
- package/agent/cli/commands/agent-task.js +12 -12
- package/agent/cli/embedder.d.ts +5 -0
- package/agent/cli/embedder.js +46 -9
- package/agent/orm/input-types.d.ts +289 -47
- package/agent/orm/input-types.js +1 -0
- package/api/cli/commands/check-constraint.js +0 -22
- package/api/cli/commands/composite-type.d.ts +8 -0
- package/api/cli/commands/composite-type.js +424 -0
- package/api/cli/commands/enum.js +0 -22
- package/api/cli/commands/field.js +0 -22
- package/api/cli/commands/foreign-key-constraint.js +0 -22
- package/api/cli/commands/index.js +0 -22
- package/api/cli/commands/policy.js +0 -22
- package/api/cli/commands/primary-key-constraint.js +0 -22
- package/api/cli/commands/schema.js +0 -22
- package/api/cli/commands/spatial-relation.js +0 -22
- package/api/cli/commands/table.js +6 -28
- package/api/cli/commands/trigger.js +0 -22
- package/api/cli/commands/unique-constraint.js +0 -22
- package/api/cli/commands/view-table.js +22 -0
- package/api/cli/commands/view.js +0 -22
- package/api/cli/commands.js +3 -1
- package/api/cli/executor.d.ts +1 -0
- package/api/orm/index.d.ts +2 -0
- package/api/orm/index.js +2 -0
- package/api/orm/input-types.d.ts +1064 -125
- package/api/orm/input-types.js +3 -0
- package/api/orm/models/compositeType.d.ts +54 -0
- package/api/orm/models/compositeType.js +104 -0
- package/api/orm/models/index.d.ts +1 -0
- package/api/orm/models/index.js +3 -1
- package/auth/cli/commands/link-identity.d.ts +8 -0
- package/auth/cli/commands/link-identity.js +36 -0
- package/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
- package/auth/cli/commands/sign-in-sms-otp.js +36 -0
- package/auth/cli/commands/sign-up-sms.d.ts +8 -0
- package/auth/cli/commands/sign-up-sms.js +36 -0
- package/auth/cli/commands.js +7 -1
- package/auth/cli/executor.d.ts +15 -0
- package/auth/orm/index.d.ts +15 -0
- package/auth/orm/input-types.d.ts +197 -1
- package/auth/orm/mutation/index.d.ts +25 -1
- package/auth/orm/mutation/index.js +36 -0
- package/esm/admin/cli/commands/app-admin-grant.js +3 -1
- package/esm/admin/cli/commands/app-grant.js +3 -1
- package/esm/admin/cli/commands/app-invite.js +44 -0
- package/esm/admin/cli/commands/app-owner-grant.js +3 -1
- package/esm/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
- package/esm/admin/cli/commands/app-permission-default-grant.js +284 -0
- package/esm/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
- package/esm/admin/cli/commands/app-permission-default-permission.js +240 -0
- package/esm/admin/cli/commands/org-admin-grant.js +3 -1
- package/esm/admin/cli/commands/org-grant.js +3 -1
- package/esm/admin/cli/commands/org-invite.js +44 -0
- package/esm/admin/cli/commands/org-owner-grant.js +3 -1
- package/esm/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
- package/esm/admin/cli/commands/org-permission-default-grant.js +304 -0
- package/esm/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
- package/esm/admin/cli/commands/org-permission-default-permission.js +260 -0
- package/esm/admin/cli/commands.js +11 -3
- package/esm/admin/cli/executor.d.ts +5 -1
- package/esm/admin/orm/index.d.ts +10 -2
- package/esm/admin/orm/index.js +10 -2
- package/esm/admin/orm/input-types.d.ts +1611 -230
- package/esm/admin/orm/input-types.js +9 -1
- package/esm/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
- package/esm/admin/orm/models/appPermissionDefaultGrant.js +100 -0
- package/esm/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
- package/esm/admin/orm/models/appPermissionDefaultPermission.js +100 -0
- package/esm/admin/orm/models/index.d.ts +5 -1
- package/esm/admin/orm/models/index.js +5 -1
- package/esm/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
- package/esm/admin/orm/models/orgPermissionDefaultGrant.js +100 -0
- package/esm/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
- package/esm/admin/orm/models/orgPermissionDefaultPermission.js +100 -0
- package/esm/agent/cli/commands/agent-message.js +34 -12
- package/esm/agent/cli/commands/agent-task.js +12 -12
- package/esm/agent/cli/embedder.d.ts +5 -0
- package/esm/agent/cli/embedder.js +10 -2
- package/esm/agent/orm/input-types.d.ts +289 -47
- package/esm/agent/orm/input-types.js +1 -0
- package/esm/api/cli/commands/check-constraint.js +0 -22
- package/esm/api/cli/commands/composite-type.d.ts +8 -0
- package/esm/api/cli/commands/composite-type.js +422 -0
- package/esm/api/cli/commands/enum.js +0 -22
- package/esm/api/cli/commands/field.js +0 -22
- package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
- package/esm/api/cli/commands/index.js +0 -22
- package/esm/api/cli/commands/policy.js +0 -22
- package/esm/api/cli/commands/primary-key-constraint.js +0 -22
- package/esm/api/cli/commands/schema.js +0 -22
- package/esm/api/cli/commands/spatial-relation.js +0 -22
- package/esm/api/cli/commands/table.js +6 -28
- package/esm/api/cli/commands/trigger.js +0 -22
- package/esm/api/cli/commands/unique-constraint.js +0 -22
- package/esm/api/cli/commands/view-table.js +22 -0
- package/esm/api/cli/commands/view.js +0 -22
- package/esm/api/cli/commands.js +3 -1
- package/esm/api/cli/executor.d.ts +1 -0
- package/esm/api/orm/index.d.ts +2 -0
- package/esm/api/orm/index.js +2 -0
- package/esm/api/orm/input-types.d.ts +1064 -125
- package/esm/api/orm/input-types.js +3 -0
- package/esm/api/orm/models/compositeType.d.ts +54 -0
- package/esm/api/orm/models/compositeType.js +100 -0
- package/esm/api/orm/models/index.d.ts +1 -0
- package/esm/api/orm/models/index.js +1 -0
- package/esm/auth/cli/commands/link-identity.d.ts +8 -0
- package/esm/auth/cli/commands/link-identity.js +34 -0
- package/esm/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
- package/esm/auth/cli/commands/sign-in-sms-otp.js +34 -0
- package/esm/auth/cli/commands/sign-up-sms.d.ts +8 -0
- package/esm/auth/cli/commands/sign-up-sms.js +34 -0
- package/esm/auth/cli/commands.js +7 -1
- package/esm/auth/cli/executor.d.ts +15 -0
- package/esm/auth/orm/index.d.ts +15 -0
- package/esm/auth/orm/input-types.d.ts +197 -1
- package/esm/auth/orm/mutation/index.d.ts +25 -1
- package/esm/auth/orm/mutation/index.js +36 -0
- package/esm/modules/cli/commands/agent-module.js +88 -0
- package/esm/modules/cli/commands/billing-module.js +66 -0
- package/esm/modules/cli/commands/compute-log-module.js +44 -0
- package/esm/modules/cli/commands/config-secrets-module.js +44 -0
- package/esm/modules/cli/commands/db-usage-module.js +66 -0
- package/esm/modules/cli/commands/entity-type-provision.js +0 -44
- package/esm/modules/cli/commands/events-module.js +66 -0
- package/esm/modules/cli/commands/function-invocation-module.d.ts +8 -0
- package/esm/modules/cli/commands/function-invocation-module.js +580 -0
- package/esm/modules/cli/commands/function-module.js +22 -198
- package/esm/modules/cli/commands/graph-module.js +22 -0
- package/esm/modules/cli/commands/hierarchy-module.js +22 -0
- package/esm/modules/cli/commands/identity-providers-module.js +44 -0
- package/esm/modules/cli/commands/inference-log-module.js +44 -0
- package/esm/modules/cli/commands/invites-module.js +44 -0
- package/esm/modules/cli/commands/limits-module.js +44 -0
- package/esm/modules/cli/commands/memberships-module.js +88 -0
- package/esm/modules/cli/commands/merkle-store-module.js +22 -0
- package/esm/modules/cli/commands/namespace-module.js +22 -0
- package/esm/modules/cli/commands/notifications-module.js +88 -0
- package/esm/modules/cli/commands/permissions-module.js +44 -0
- package/esm/modules/cli/commands/plans-module.js +44 -0
- package/esm/modules/cli/commands/profiles-module.js +44 -0
- package/esm/modules/cli/commands/rate-limit-meters-module.js +66 -0
- package/esm/modules/cli/commands/storage-log-module.js +44 -0
- package/esm/modules/cli/commands/storage-module.js +66 -0
- package/esm/modules/cli/commands/transfer-log-module.js +44 -0
- package/esm/modules/cli/commands.js +29 -27
- package/esm/modules/cli/executor.d.ts +14 -13
- package/esm/modules/orm/index.d.ts +28 -26
- package/esm/modules/orm/index.js +28 -26
- package/esm/modules/orm/input-types.d.ts +4485 -2514
- package/esm/modules/orm/models/functionInvocationModule.d.ts +54 -0
- package/esm/modules/orm/models/functionInvocationModule.js +100 -0
- package/esm/modules/orm/models/index.d.ts +14 -13
- package/esm/modules/orm/models/index.js +14 -13
- package/esm/objects/orm/input-types.d.ts +62 -0
- package/esm/usage/orm/input-types.d.ts +314 -19
- package/modules/cli/commands/agent-module.js +88 -0
- package/modules/cli/commands/billing-module.js +66 -0
- package/modules/cli/commands/compute-log-module.js +44 -0
- package/modules/cli/commands/config-secrets-module.js +44 -0
- package/modules/cli/commands/db-usage-module.js +66 -0
- package/modules/cli/commands/entity-type-provision.js +0 -44
- package/modules/cli/commands/events-module.js +66 -0
- package/modules/cli/commands/function-invocation-module.d.ts +8 -0
- package/modules/cli/commands/function-invocation-module.js +582 -0
- package/modules/cli/commands/function-module.js +22 -198
- package/modules/cli/commands/graph-module.js +22 -0
- package/modules/cli/commands/hierarchy-module.js +22 -0
- package/modules/cli/commands/identity-providers-module.js +44 -0
- package/modules/cli/commands/inference-log-module.js +44 -0
- package/modules/cli/commands/invites-module.js +44 -0
- package/modules/cli/commands/limits-module.js +44 -0
- package/modules/cli/commands/memberships-module.js +88 -0
- package/modules/cli/commands/merkle-store-module.js +22 -0
- package/modules/cli/commands/namespace-module.js +22 -0
- package/modules/cli/commands/notifications-module.js +88 -0
- package/modules/cli/commands/permissions-module.js +44 -0
- package/modules/cli/commands/plans-module.js +44 -0
- package/modules/cli/commands/profiles-module.js +44 -0
- package/modules/cli/commands/rate-limit-meters-module.js +66 -0
- package/modules/cli/commands/storage-log-module.js +44 -0
- package/modules/cli/commands/storage-module.js +66 -0
- package/modules/cli/commands/transfer-log-module.js +44 -0
- package/modules/cli/commands.js +29 -27
- package/modules/cli/executor.d.ts +14 -13
- package/modules/orm/index.d.ts +28 -26
- package/modules/orm/index.js +28 -26
- package/modules/orm/input-types.d.ts +4485 -2514
- package/modules/orm/models/functionInvocationModule.d.ts +54 -0
- package/modules/orm/models/functionInvocationModule.js +104 -0
- package/modules/orm/models/index.d.ts +14 -13
- package/modules/orm/models/index.js +30 -28
- package/objects/orm/input-types.d.ts +62 -0
- package/package.json +4 -4
- package/usage/orm/input-types.d.ts +314 -19
|
@@ -149,7 +149,8 @@ async function handleCreate(argv, prompter) {
|
|
|
149
149
|
type: 'text',
|
|
150
150
|
name: 'actorId',
|
|
151
151
|
message: 'actorId',
|
|
152
|
-
required:
|
|
152
|
+
required: false,
|
|
153
|
+
skipPrompt: true,
|
|
153
154
|
},
|
|
154
155
|
{
|
|
155
156
|
type: 'text',
|
|
@@ -210,6 +211,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
210
211
|
name: 'actorId',
|
|
211
212
|
message: 'actorId',
|
|
212
213
|
required: false,
|
|
214
|
+
skipPrompt: true,
|
|
213
215
|
},
|
|
214
216
|
{
|
|
215
217
|
type: 'text',
|
|
@@ -160,7 +160,8 @@ async function handleCreate(argv, prompter) {
|
|
|
160
160
|
type: 'text',
|
|
161
161
|
name: 'actorId',
|
|
162
162
|
message: 'actorId',
|
|
163
|
-
required:
|
|
163
|
+
required: false,
|
|
164
|
+
skipPrompt: true,
|
|
164
165
|
},
|
|
165
166
|
{
|
|
166
167
|
type: 'text',
|
|
@@ -230,6 +231,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
230
231
|
name: 'actorId',
|
|
231
232
|
message: 'actorId',
|
|
232
233
|
required: false,
|
|
234
|
+
skipPrompt: true,
|
|
233
235
|
},
|
|
234
236
|
{
|
|
235
237
|
type: 'text',
|
|
@@ -10,7 +10,9 @@ const executor_1 = require("../executor");
|
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const fieldSchema = {
|
|
12
12
|
id: 'uuid',
|
|
13
|
+
channel: 'string',
|
|
13
14
|
email: 'string',
|
|
15
|
+
phone: 'string',
|
|
14
16
|
senderId: 'uuid',
|
|
15
17
|
inviteToken: 'string',
|
|
16
18
|
inviteValid: 'boolean',
|
|
@@ -66,7 +68,9 @@ async function handleList(argv, _prompter) {
|
|
|
66
68
|
try {
|
|
67
69
|
const defaultSelect = {
|
|
68
70
|
id: true,
|
|
71
|
+
channel: true,
|
|
69
72
|
email: true,
|
|
73
|
+
phone: true,
|
|
70
74
|
senderId: true,
|
|
71
75
|
inviteToken: true,
|
|
72
76
|
inviteValid: true,
|
|
@@ -96,7 +100,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
96
100
|
try {
|
|
97
101
|
const defaultSelect = {
|
|
98
102
|
id: true,
|
|
103
|
+
channel: true,
|
|
99
104
|
email: true,
|
|
105
|
+
phone: true,
|
|
100
106
|
senderId: true,
|
|
101
107
|
inviteToken: true,
|
|
102
108
|
inviteValid: true,
|
|
@@ -138,7 +144,9 @@ async function handleGet(argv, prompter) {
|
|
|
138
144
|
id: answers.id,
|
|
139
145
|
select: {
|
|
140
146
|
id: true,
|
|
147
|
+
channel: true,
|
|
141
148
|
email: true,
|
|
149
|
+
phone: true,
|
|
142
150
|
senderId: true,
|
|
143
151
|
inviteToken: true,
|
|
144
152
|
inviteValid: true,
|
|
@@ -166,6 +174,13 @@ async function handleGet(argv, prompter) {
|
|
|
166
174
|
async function handleCreate(argv, prompter) {
|
|
167
175
|
try {
|
|
168
176
|
const rawAnswers = await prompter.prompt(argv, [
|
|
177
|
+
{
|
|
178
|
+
type: 'text',
|
|
179
|
+
name: 'channel',
|
|
180
|
+
message: 'channel',
|
|
181
|
+
required: false,
|
|
182
|
+
skipPrompt: true,
|
|
183
|
+
},
|
|
169
184
|
{
|
|
170
185
|
type: 'text',
|
|
171
186
|
name: 'email',
|
|
@@ -173,6 +188,13 @@ async function handleCreate(argv, prompter) {
|
|
|
173
188
|
required: false,
|
|
174
189
|
skipPrompt: true,
|
|
175
190
|
},
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
name: 'phone',
|
|
194
|
+
message: 'phone',
|
|
195
|
+
required: false,
|
|
196
|
+
skipPrompt: true,
|
|
197
|
+
},
|
|
176
198
|
{
|
|
177
199
|
type: 'text',
|
|
178
200
|
name: 'senderId',
|
|
@@ -243,7 +265,9 @@ async function handleCreate(argv, prompter) {
|
|
|
243
265
|
const result = await client.appInvite
|
|
244
266
|
.create({
|
|
245
267
|
data: {
|
|
268
|
+
channel: cleanedData.channel,
|
|
246
269
|
email: cleanedData.email,
|
|
270
|
+
phone: cleanedData.phone,
|
|
247
271
|
senderId: cleanedData.senderId,
|
|
248
272
|
inviteToken: cleanedData.inviteToken,
|
|
249
273
|
inviteValid: cleanedData.inviteValid,
|
|
@@ -256,7 +280,9 @@ async function handleCreate(argv, prompter) {
|
|
|
256
280
|
},
|
|
257
281
|
select: {
|
|
258
282
|
id: true,
|
|
283
|
+
channel: true,
|
|
259
284
|
email: true,
|
|
285
|
+
phone: true,
|
|
260
286
|
senderId: true,
|
|
261
287
|
inviteToken: true,
|
|
262
288
|
inviteValid: true,
|
|
@@ -290,6 +316,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
290
316
|
message: 'id',
|
|
291
317
|
required: true,
|
|
292
318
|
},
|
|
319
|
+
{
|
|
320
|
+
type: 'text',
|
|
321
|
+
name: 'channel',
|
|
322
|
+
message: 'channel',
|
|
323
|
+
required: false,
|
|
324
|
+
skipPrompt: true,
|
|
325
|
+
},
|
|
293
326
|
{
|
|
294
327
|
type: 'text',
|
|
295
328
|
name: 'email',
|
|
@@ -297,6 +330,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
297
330
|
required: false,
|
|
298
331
|
skipPrompt: true,
|
|
299
332
|
},
|
|
333
|
+
{
|
|
334
|
+
type: 'text',
|
|
335
|
+
name: 'phone',
|
|
336
|
+
message: 'phone',
|
|
337
|
+
required: false,
|
|
338
|
+
skipPrompt: true,
|
|
339
|
+
},
|
|
300
340
|
{
|
|
301
341
|
type: 'text',
|
|
302
342
|
name: 'senderId',
|
|
@@ -370,7 +410,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
370
410
|
id: answers.id,
|
|
371
411
|
},
|
|
372
412
|
data: {
|
|
413
|
+
channel: cleanedData.channel,
|
|
373
414
|
email: cleanedData.email,
|
|
415
|
+
phone: cleanedData.phone,
|
|
374
416
|
senderId: cleanedData.senderId,
|
|
375
417
|
inviteToken: cleanedData.inviteToken,
|
|
376
418
|
inviteValid: cleanedData.inviteValid,
|
|
@@ -383,7 +425,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
383
425
|
},
|
|
384
426
|
select: {
|
|
385
427
|
id: true,
|
|
428
|
+
channel: true,
|
|
386
429
|
email: true,
|
|
430
|
+
phone: true,
|
|
387
431
|
senderId: true,
|
|
388
432
|
inviteToken: true,
|
|
389
433
|
inviteValid: true,
|
|
@@ -149,7 +149,8 @@ async function handleCreate(argv, prompter) {
|
|
|
149
149
|
type: 'text',
|
|
150
150
|
name: 'actorId',
|
|
151
151
|
message: 'actorId',
|
|
152
|
-
required:
|
|
152
|
+
required: false,
|
|
153
|
+
skipPrompt: true,
|
|
153
154
|
},
|
|
154
155
|
{
|
|
155
156
|
type: 'text',
|
|
@@ -210,6 +211,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
210
211
|
name: 'actorId',
|
|
211
212
|
message: 'actorId',
|
|
212
213
|
required: false,
|
|
214
|
+
skipPrompt: true,
|
|
213
215
|
},
|
|
214
216
|
{
|
|
215
217
|
type: 'text',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AppPermissionDefaultGrant
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
+
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for AppPermissionDefaultGrant
|
|
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
|
+
permissionId: 'uuid',
|
|
14
|
+
isGrant: 'boolean',
|
|
15
|
+
grantorId: 'uuid',
|
|
16
|
+
createdAt: 'string',
|
|
17
|
+
updatedAt: 'string',
|
|
18
|
+
};
|
|
19
|
+
const usage = '\napp-permission-default-grant <command>\n\nCommands:\n list List appPermissionDefaultGrant records\n find-first Find first matching appPermissionDefaultGrant record\n get Get a appPermissionDefaultGrant by ID\n create Create a new appPermissionDefaultGrant\n update Update an existing appPermissionDefaultGrant\n delete Delete a appPermissionDefaultGrant\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 --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
20
|
+
exports.default = async (argv, prompter, _options) => {
|
|
21
|
+
if (argv.help || argv.h) {
|
|
22
|
+
console.log(usage);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
26
|
+
if (!subcommand) {
|
|
27
|
+
const answer = await prompter.prompt(argv, [
|
|
28
|
+
{
|
|
29
|
+
type: 'autocomplete',
|
|
30
|
+
name: 'subcommand',
|
|
31
|
+
message: 'What do you want to do?',
|
|
32
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
36
|
+
}
|
|
37
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
38
|
+
};
|
|
39
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
40
|
+
switch (subcommand) {
|
|
41
|
+
case 'list':
|
|
42
|
+
return handleList(argv, prompter);
|
|
43
|
+
case 'find-first':
|
|
44
|
+
return handleFindFirst(argv, prompter);
|
|
45
|
+
case 'get':
|
|
46
|
+
return handleGet(argv, prompter);
|
|
47
|
+
case 'create':
|
|
48
|
+
return handleCreate(argv, prompter);
|
|
49
|
+
case 'update':
|
|
50
|
+
return handleUpdate(argv, prompter);
|
|
51
|
+
case 'delete':
|
|
52
|
+
return handleDelete(argv, prompter);
|
|
53
|
+
default:
|
|
54
|
+
console.log(usage);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
59
|
+
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
permissionId: true,
|
|
63
|
+
isGrant: true,
|
|
64
|
+
grantorId: true,
|
|
65
|
+
createdAt: true,
|
|
66
|
+
updatedAt: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
69
|
+
const client = (0, executor_1.getClient)();
|
|
70
|
+
const result = await client.appPermissionDefaultGrant.findMany(findManyArgs).execute();
|
|
71
|
+
console.log(JSON.stringify(result, null, 2));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error('Failed to list records.');
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
console.error(error.message);
|
|
77
|
+
}
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function handleFindFirst(argv, _prompter) {
|
|
82
|
+
try {
|
|
83
|
+
const defaultSelect = {
|
|
84
|
+
id: true,
|
|
85
|
+
permissionId: true,
|
|
86
|
+
isGrant: true,
|
|
87
|
+
grantorId: true,
|
|
88
|
+
createdAt: true,
|
|
89
|
+
updatedAt: true,
|
|
90
|
+
};
|
|
91
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
92
|
+
const client = (0, executor_1.getClient)();
|
|
93
|
+
const result = await client.appPermissionDefaultGrant.findFirst(findFirstArgs).execute();
|
|
94
|
+
console.log(JSON.stringify(result, null, 2));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Failed to find record.');
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
console.error(error.message);
|
|
100
|
+
}
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function handleGet(argv, prompter) {
|
|
105
|
+
try {
|
|
106
|
+
const answers = await prompter.prompt(argv, [
|
|
107
|
+
{
|
|
108
|
+
type: 'text',
|
|
109
|
+
name: 'id',
|
|
110
|
+
message: 'id',
|
|
111
|
+
required: true,
|
|
112
|
+
},
|
|
113
|
+
]);
|
|
114
|
+
const client = (0, executor_1.getClient)();
|
|
115
|
+
const result = await client.appPermissionDefaultGrant
|
|
116
|
+
.findOne({
|
|
117
|
+
id: answers.id,
|
|
118
|
+
select: {
|
|
119
|
+
id: true,
|
|
120
|
+
permissionId: true,
|
|
121
|
+
isGrant: true,
|
|
122
|
+
grantorId: true,
|
|
123
|
+
createdAt: true,
|
|
124
|
+
updatedAt: true,
|
|
125
|
+
},
|
|
126
|
+
})
|
|
127
|
+
.execute();
|
|
128
|
+
console.log(JSON.stringify(result, null, 2));
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error('Record not found.');
|
|
132
|
+
if (error instanceof Error) {
|
|
133
|
+
console.error(error.message);
|
|
134
|
+
}
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function handleCreate(argv, prompter) {
|
|
139
|
+
try {
|
|
140
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
141
|
+
{
|
|
142
|
+
type: 'text',
|
|
143
|
+
name: 'permissionId',
|
|
144
|
+
message: 'permissionId',
|
|
145
|
+
required: true,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'boolean',
|
|
149
|
+
name: 'isGrant',
|
|
150
|
+
message: 'isGrant',
|
|
151
|
+
required: false,
|
|
152
|
+
skipPrompt: true,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'text',
|
|
156
|
+
name: 'grantorId',
|
|
157
|
+
message: 'grantorId',
|
|
158
|
+
required: false,
|
|
159
|
+
skipPrompt: true,
|
|
160
|
+
},
|
|
161
|
+
]);
|
|
162
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
163
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
164
|
+
const client = (0, executor_1.getClient)();
|
|
165
|
+
const result = await client.appPermissionDefaultGrant
|
|
166
|
+
.create({
|
|
167
|
+
data: {
|
|
168
|
+
permissionId: cleanedData.permissionId,
|
|
169
|
+
isGrant: cleanedData.isGrant,
|
|
170
|
+
grantorId: cleanedData.grantorId,
|
|
171
|
+
},
|
|
172
|
+
select: {
|
|
173
|
+
id: true,
|
|
174
|
+
permissionId: true,
|
|
175
|
+
isGrant: true,
|
|
176
|
+
grantorId: true,
|
|
177
|
+
createdAt: true,
|
|
178
|
+
updatedAt: true,
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
.execute();
|
|
182
|
+
console.log(JSON.stringify(result, null, 2));
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error('Failed to create record.');
|
|
186
|
+
if (error instanceof Error) {
|
|
187
|
+
console.error(error.message);
|
|
188
|
+
}
|
|
189
|
+
process.exit(1);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async function handleUpdate(argv, prompter) {
|
|
193
|
+
try {
|
|
194
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
195
|
+
{
|
|
196
|
+
type: 'text',
|
|
197
|
+
name: 'id',
|
|
198
|
+
message: 'id',
|
|
199
|
+
required: true,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: 'text',
|
|
203
|
+
name: 'permissionId',
|
|
204
|
+
message: 'permissionId',
|
|
205
|
+
required: false,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'boolean',
|
|
209
|
+
name: 'isGrant',
|
|
210
|
+
message: 'isGrant',
|
|
211
|
+
required: false,
|
|
212
|
+
skipPrompt: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'grantorId',
|
|
217
|
+
message: 'grantorId',
|
|
218
|
+
required: false,
|
|
219
|
+
skipPrompt: true,
|
|
220
|
+
},
|
|
221
|
+
]);
|
|
222
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
223
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
224
|
+
const client = (0, executor_1.getClient)();
|
|
225
|
+
const result = await client.appPermissionDefaultGrant
|
|
226
|
+
.update({
|
|
227
|
+
where: {
|
|
228
|
+
id: answers.id,
|
|
229
|
+
},
|
|
230
|
+
data: {
|
|
231
|
+
permissionId: cleanedData.permissionId,
|
|
232
|
+
isGrant: cleanedData.isGrant,
|
|
233
|
+
grantorId: cleanedData.grantorId,
|
|
234
|
+
},
|
|
235
|
+
select: {
|
|
236
|
+
id: true,
|
|
237
|
+
permissionId: true,
|
|
238
|
+
isGrant: true,
|
|
239
|
+
grantorId: true,
|
|
240
|
+
createdAt: true,
|
|
241
|
+
updatedAt: true,
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
.execute();
|
|
245
|
+
console.log(JSON.stringify(result, null, 2));
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
console.error('Failed to update record.');
|
|
249
|
+
if (error instanceof Error) {
|
|
250
|
+
console.error(error.message);
|
|
251
|
+
}
|
|
252
|
+
process.exit(1);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async function handleDelete(argv, prompter) {
|
|
256
|
+
try {
|
|
257
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
258
|
+
{
|
|
259
|
+
type: 'text',
|
|
260
|
+
name: 'id',
|
|
261
|
+
message: 'id',
|
|
262
|
+
required: true,
|
|
263
|
+
},
|
|
264
|
+
]);
|
|
265
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
266
|
+
const client = (0, executor_1.getClient)();
|
|
267
|
+
const result = await client.appPermissionDefaultGrant
|
|
268
|
+
.delete({
|
|
269
|
+
where: {
|
|
270
|
+
id: answers.id,
|
|
271
|
+
},
|
|
272
|
+
select: {
|
|
273
|
+
id: true,
|
|
274
|
+
},
|
|
275
|
+
})
|
|
276
|
+
.execute();
|
|
277
|
+
console.log(JSON.stringify(result, null, 2));
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
console.error('Failed to delete record.');
|
|
281
|
+
if (error instanceof Error) {
|
|
282
|
+
console.error(error.message);
|
|
283
|
+
}
|
|
284
|
+
process.exit(1);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AppPermissionDefaultPermission
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
+
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
+
export default _default;
|