@constructive-sdk/cli 0.25.9 → 0.25.11
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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for AppPermissionDefaultPermission
|
|
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
|
+
createdAt: 'string',
|
|
15
|
+
updatedAt: 'string',
|
|
16
|
+
};
|
|
17
|
+
const usage = '\napp-permission-default-permission <command>\n\nCommands:\n list List appPermissionDefaultPermission records\n find-first Find first matching appPermissionDefaultPermission record\n get Get a appPermissionDefaultPermission by ID\n create Create a new appPermissionDefaultPermission\n update Update an existing appPermissionDefaultPermission\n delete Delete a appPermissionDefaultPermission\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';
|
|
18
|
+
exports.default = async (argv, prompter, _options) => {
|
|
19
|
+
if (argv.help || argv.h) {
|
|
20
|
+
console.log(usage);
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
24
|
+
if (!subcommand) {
|
|
25
|
+
const answer = await prompter.prompt(argv, [
|
|
26
|
+
{
|
|
27
|
+
type: 'autocomplete',
|
|
28
|
+
name: 'subcommand',
|
|
29
|
+
message: 'What do you want to do?',
|
|
30
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
34
|
+
}
|
|
35
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
36
|
+
};
|
|
37
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
38
|
+
switch (subcommand) {
|
|
39
|
+
case 'list':
|
|
40
|
+
return handleList(argv, prompter);
|
|
41
|
+
case 'find-first':
|
|
42
|
+
return handleFindFirst(argv, prompter);
|
|
43
|
+
case 'get':
|
|
44
|
+
return handleGet(argv, prompter);
|
|
45
|
+
case 'create':
|
|
46
|
+
return handleCreate(argv, prompter);
|
|
47
|
+
case 'update':
|
|
48
|
+
return handleUpdate(argv, prompter);
|
|
49
|
+
case 'delete':
|
|
50
|
+
return handleDelete(argv, prompter);
|
|
51
|
+
default:
|
|
52
|
+
console.log(usage);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function handleList(argv, _prompter) {
|
|
57
|
+
try {
|
|
58
|
+
const defaultSelect = {
|
|
59
|
+
id: true,
|
|
60
|
+
permissionId: true,
|
|
61
|
+
createdAt: true,
|
|
62
|
+
updatedAt: true,
|
|
63
|
+
};
|
|
64
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
65
|
+
const client = (0, executor_1.getClient)();
|
|
66
|
+
const result = await client.appPermissionDefaultPermission.findMany(findManyArgs).execute();
|
|
67
|
+
console.log(JSON.stringify(result, null, 2));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error('Failed to list records.');
|
|
71
|
+
if (error instanceof Error) {
|
|
72
|
+
console.error(error.message);
|
|
73
|
+
}
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function handleFindFirst(argv, _prompter) {
|
|
78
|
+
try {
|
|
79
|
+
const defaultSelect = {
|
|
80
|
+
id: true,
|
|
81
|
+
permissionId: true,
|
|
82
|
+
createdAt: true,
|
|
83
|
+
updatedAt: true,
|
|
84
|
+
};
|
|
85
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
86
|
+
const client = (0, executor_1.getClient)();
|
|
87
|
+
const result = await client.appPermissionDefaultPermission.findFirst(findFirstArgs).execute();
|
|
88
|
+
console.log(JSON.stringify(result, null, 2));
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error('Failed to find record.');
|
|
92
|
+
if (error instanceof Error) {
|
|
93
|
+
console.error(error.message);
|
|
94
|
+
}
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function handleGet(argv, prompter) {
|
|
99
|
+
try {
|
|
100
|
+
const answers = await prompter.prompt(argv, [
|
|
101
|
+
{
|
|
102
|
+
type: 'text',
|
|
103
|
+
name: 'id',
|
|
104
|
+
message: 'id',
|
|
105
|
+
required: true,
|
|
106
|
+
},
|
|
107
|
+
]);
|
|
108
|
+
const client = (0, executor_1.getClient)();
|
|
109
|
+
const result = await client.appPermissionDefaultPermission
|
|
110
|
+
.findOne({
|
|
111
|
+
id: answers.id,
|
|
112
|
+
select: {
|
|
113
|
+
id: true,
|
|
114
|
+
permissionId: true,
|
|
115
|
+
createdAt: true,
|
|
116
|
+
updatedAt: true,
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
.execute();
|
|
120
|
+
console.log(JSON.stringify(result, null, 2));
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
console.error('Record not found.');
|
|
124
|
+
if (error instanceof Error) {
|
|
125
|
+
console.error(error.message);
|
|
126
|
+
}
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function handleCreate(argv, prompter) {
|
|
131
|
+
try {
|
|
132
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
133
|
+
{
|
|
134
|
+
type: 'text',
|
|
135
|
+
name: 'permissionId',
|
|
136
|
+
message: 'permissionId',
|
|
137
|
+
required: true,
|
|
138
|
+
},
|
|
139
|
+
]);
|
|
140
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
141
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
142
|
+
const client = (0, executor_1.getClient)();
|
|
143
|
+
const result = await client.appPermissionDefaultPermission
|
|
144
|
+
.create({
|
|
145
|
+
data: {
|
|
146
|
+
permissionId: cleanedData.permissionId,
|
|
147
|
+
},
|
|
148
|
+
select: {
|
|
149
|
+
id: true,
|
|
150
|
+
permissionId: true,
|
|
151
|
+
createdAt: true,
|
|
152
|
+
updatedAt: true,
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
.execute();
|
|
156
|
+
console.log(JSON.stringify(result, null, 2));
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('Failed to create record.');
|
|
160
|
+
if (error instanceof Error) {
|
|
161
|
+
console.error(error.message);
|
|
162
|
+
}
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
async function handleUpdate(argv, prompter) {
|
|
167
|
+
try {
|
|
168
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
name: 'id',
|
|
172
|
+
message: 'id',
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'text',
|
|
177
|
+
name: 'permissionId',
|
|
178
|
+
message: 'permissionId',
|
|
179
|
+
required: false,
|
|
180
|
+
},
|
|
181
|
+
]);
|
|
182
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
183
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
184
|
+
const client = (0, executor_1.getClient)();
|
|
185
|
+
const result = await client.appPermissionDefaultPermission
|
|
186
|
+
.update({
|
|
187
|
+
where: {
|
|
188
|
+
id: answers.id,
|
|
189
|
+
},
|
|
190
|
+
data: {
|
|
191
|
+
permissionId: cleanedData.permissionId,
|
|
192
|
+
},
|
|
193
|
+
select: {
|
|
194
|
+
id: true,
|
|
195
|
+
permissionId: true,
|
|
196
|
+
createdAt: true,
|
|
197
|
+
updatedAt: true,
|
|
198
|
+
},
|
|
199
|
+
})
|
|
200
|
+
.execute();
|
|
201
|
+
console.log(JSON.stringify(result, null, 2));
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
console.error('Failed to update record.');
|
|
205
|
+
if (error instanceof Error) {
|
|
206
|
+
console.error(error.message);
|
|
207
|
+
}
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function handleDelete(argv, prompter) {
|
|
212
|
+
try {
|
|
213
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'id',
|
|
217
|
+
message: 'id',
|
|
218
|
+
required: true,
|
|
219
|
+
},
|
|
220
|
+
]);
|
|
221
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
222
|
+
const client = (0, executor_1.getClient)();
|
|
223
|
+
const result = await client.appPermissionDefaultPermission
|
|
224
|
+
.delete({
|
|
225
|
+
where: {
|
|
226
|
+
id: answers.id,
|
|
227
|
+
},
|
|
228
|
+
select: {
|
|
229
|
+
id: true,
|
|
230
|
+
},
|
|
231
|
+
})
|
|
232
|
+
.execute();
|
|
233
|
+
console.log(JSON.stringify(result, null, 2));
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
console.error('Failed to delete record.');
|
|
237
|
+
if (error instanceof Error) {
|
|
238
|
+
console.error(error.message);
|
|
239
|
+
}
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -153,7 +153,8 @@ async function handleCreate(argv, prompter) {
|
|
|
153
153
|
type: 'text',
|
|
154
154
|
name: 'actorId',
|
|
155
155
|
message: 'actorId',
|
|
156
|
-
required:
|
|
156
|
+
required: false,
|
|
157
|
+
skipPrompt: true,
|
|
157
158
|
},
|
|
158
159
|
{
|
|
159
160
|
type: 'text',
|
|
@@ -222,6 +223,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
222
223
|
name: 'actorId',
|
|
223
224
|
message: 'actorId',
|
|
224
225
|
required: false,
|
|
226
|
+
skipPrompt: true,
|
|
225
227
|
},
|
|
226
228
|
{
|
|
227
229
|
type: 'text',
|
|
@@ -164,7 +164,8 @@ async function handleCreate(argv, prompter) {
|
|
|
164
164
|
type: 'text',
|
|
165
165
|
name: 'actorId',
|
|
166
166
|
message: 'actorId',
|
|
167
|
-
required:
|
|
167
|
+
required: false,
|
|
168
|
+
skipPrompt: true,
|
|
168
169
|
},
|
|
169
170
|
{
|
|
170
171
|
type: 'text',
|
|
@@ -242,6 +243,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
242
243
|
name: 'actorId',
|
|
243
244
|
message: 'actorId',
|
|
244
245
|
required: false,
|
|
246
|
+
skipPrompt: true,
|
|
245
247
|
},
|
|
246
248
|
{
|
|
247
249
|
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
|
receiverId: 'uuid',
|
|
16
18
|
inviteToken: 'string',
|
|
@@ -69,7 +71,9 @@ async function handleList(argv, _prompter) {
|
|
|
69
71
|
try {
|
|
70
72
|
const defaultSelect = {
|
|
71
73
|
id: true,
|
|
74
|
+
channel: true,
|
|
72
75
|
email: true,
|
|
76
|
+
phone: true,
|
|
73
77
|
senderId: true,
|
|
74
78
|
receiverId: true,
|
|
75
79
|
inviteToken: true,
|
|
@@ -102,7 +106,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
102
106
|
try {
|
|
103
107
|
const defaultSelect = {
|
|
104
108
|
id: true,
|
|
109
|
+
channel: true,
|
|
105
110
|
email: true,
|
|
111
|
+
phone: true,
|
|
106
112
|
senderId: true,
|
|
107
113
|
receiverId: true,
|
|
108
114
|
inviteToken: true,
|
|
@@ -147,7 +153,9 @@ async function handleGet(argv, prompter) {
|
|
|
147
153
|
id: answers.id,
|
|
148
154
|
select: {
|
|
149
155
|
id: true,
|
|
156
|
+
channel: true,
|
|
150
157
|
email: true,
|
|
158
|
+
phone: true,
|
|
151
159
|
senderId: true,
|
|
152
160
|
receiverId: true,
|
|
153
161
|
inviteToken: true,
|
|
@@ -178,6 +186,13 @@ async function handleGet(argv, prompter) {
|
|
|
178
186
|
async function handleCreate(argv, prompter) {
|
|
179
187
|
try {
|
|
180
188
|
const rawAnswers = await prompter.prompt(argv, [
|
|
189
|
+
{
|
|
190
|
+
type: 'text',
|
|
191
|
+
name: 'channel',
|
|
192
|
+
message: 'channel',
|
|
193
|
+
required: false,
|
|
194
|
+
skipPrompt: true,
|
|
195
|
+
},
|
|
181
196
|
{
|
|
182
197
|
type: 'text',
|
|
183
198
|
name: 'email',
|
|
@@ -185,6 +200,13 @@ async function handleCreate(argv, prompter) {
|
|
|
185
200
|
required: false,
|
|
186
201
|
skipPrompt: true,
|
|
187
202
|
},
|
|
203
|
+
{
|
|
204
|
+
type: 'text',
|
|
205
|
+
name: 'phone',
|
|
206
|
+
message: 'phone',
|
|
207
|
+
required: false,
|
|
208
|
+
skipPrompt: true,
|
|
209
|
+
},
|
|
188
210
|
{
|
|
189
211
|
type: 'text',
|
|
190
212
|
name: 'senderId',
|
|
@@ -275,7 +297,9 @@ async function handleCreate(argv, prompter) {
|
|
|
275
297
|
const result = await client.orgInvite
|
|
276
298
|
.create({
|
|
277
299
|
data: {
|
|
300
|
+
channel: cleanedData.channel,
|
|
278
301
|
email: cleanedData.email,
|
|
302
|
+
phone: cleanedData.phone,
|
|
279
303
|
senderId: cleanedData.senderId,
|
|
280
304
|
receiverId: cleanedData.receiverId,
|
|
281
305
|
inviteToken: cleanedData.inviteToken,
|
|
@@ -291,7 +315,9 @@ async function handleCreate(argv, prompter) {
|
|
|
291
315
|
},
|
|
292
316
|
select: {
|
|
293
317
|
id: true,
|
|
318
|
+
channel: true,
|
|
294
319
|
email: true,
|
|
320
|
+
phone: true,
|
|
295
321
|
senderId: true,
|
|
296
322
|
receiverId: true,
|
|
297
323
|
inviteToken: true,
|
|
@@ -328,6 +354,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
328
354
|
message: 'id',
|
|
329
355
|
required: true,
|
|
330
356
|
},
|
|
357
|
+
{
|
|
358
|
+
type: 'text',
|
|
359
|
+
name: 'channel',
|
|
360
|
+
message: 'channel',
|
|
361
|
+
required: false,
|
|
362
|
+
skipPrompt: true,
|
|
363
|
+
},
|
|
331
364
|
{
|
|
332
365
|
type: 'text',
|
|
333
366
|
name: 'email',
|
|
@@ -335,6 +368,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
335
368
|
required: false,
|
|
336
369
|
skipPrompt: true,
|
|
337
370
|
},
|
|
371
|
+
{
|
|
372
|
+
type: 'text',
|
|
373
|
+
name: 'phone',
|
|
374
|
+
message: 'phone',
|
|
375
|
+
required: false,
|
|
376
|
+
skipPrompt: true,
|
|
377
|
+
},
|
|
338
378
|
{
|
|
339
379
|
type: 'text',
|
|
340
380
|
name: 'senderId',
|
|
@@ -428,7 +468,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
428
468
|
id: answers.id,
|
|
429
469
|
},
|
|
430
470
|
data: {
|
|
471
|
+
channel: cleanedData.channel,
|
|
431
472
|
email: cleanedData.email,
|
|
473
|
+
phone: cleanedData.phone,
|
|
432
474
|
senderId: cleanedData.senderId,
|
|
433
475
|
receiverId: cleanedData.receiverId,
|
|
434
476
|
inviteToken: cleanedData.inviteToken,
|
|
@@ -444,7 +486,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
444
486
|
},
|
|
445
487
|
select: {
|
|
446
488
|
id: true,
|
|
489
|
+
channel: true,
|
|
447
490
|
email: true,
|
|
491
|
+
phone: true,
|
|
448
492
|
senderId: true,
|
|
449
493
|
receiverId: true,
|
|
450
494
|
inviteToken: true,
|
|
@@ -153,7 +153,8 @@ async function handleCreate(argv, prompter) {
|
|
|
153
153
|
type: 'text',
|
|
154
154
|
name: 'actorId',
|
|
155
155
|
message: 'actorId',
|
|
156
|
-
required:
|
|
156
|
+
required: false,
|
|
157
|
+
skipPrompt: true,
|
|
157
158
|
},
|
|
158
159
|
{
|
|
159
160
|
type: 'text',
|
|
@@ -222,6 +223,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
222
223
|
name: 'actorId',
|
|
223
224
|
message: 'actorId',
|
|
224
225
|
required: false,
|
|
226
|
+
skipPrompt: true,
|
|
225
227
|
},
|
|
226
228
|
{
|
|
227
229
|
type: 'text',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgPermissionDefaultGrant
|
|
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;
|