@constructive-sdk/cli 1.9.2 → 1.9.4
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/{api/cli/commands/platform-api-module.d.ts → admin/cli/commands/org-chart-edge-grant.d.ts} +1 -1
- package/{api/cli/commands/platform-api-module.js → admin/cli/commands/org-chart-edge-grant.js} +137 -53
- package/{esm/api/cli/commands/platform-api-module.d.ts → admin/cli/commands/org-chart-edge.d.ts} +1 -1
- package/{api/cli/commands/api-module.js → admin/cli/commands/org-chart-edge.js} +86 -60
- package/admin/cli/commands/org-get-managers-record.d.ts +8 -0
- package/admin/cli/commands/org-get-managers-record.js +126 -0
- package/admin/cli/commands/org-get-subordinates-record.d.ts +8 -0
- package/admin/cli/commands/org-get-subordinates-record.js +126 -0
- package/admin/cli/commands/org-is-manager-of.d.ts +8 -0
- package/admin/cli/commands/org-is-manager-of.js +45 -0
- package/admin/cli/commands.js +11 -1
- package/admin/cli/executor.d.ts +9 -0
- package/admin/orm/index.d.ts +13 -0
- package/admin/orm/index.js +8 -0
- package/admin/orm/input-types.d.ts +399 -0
- package/admin/orm/models/index.d.ts +4 -0
- package/admin/orm/models/index.js +9 -1
- package/admin/orm/models/orgChartEdge.d.ts +54 -0
- package/admin/orm/models/orgChartEdge.js +104 -0
- package/admin/orm/models/orgChartEdgeGrant.d.ts +54 -0
- package/{api/orm/models/platformApiModule.js → admin/orm/models/orgChartEdgeGrant.js} +27 -27
- package/admin/orm/models/orgGetManagersRecord.d.ts +30 -0
- package/admin/orm/models/orgGetManagersRecord.js +59 -0
- package/admin/orm/models/orgGetSubordinatesRecord.d.ts +30 -0
- package/admin/orm/models/orgGetSubordinatesRecord.js +59 -0
- package/admin/orm/query/index.d.ts +11 -0
- package/admin/orm/query/index.js +24 -0
- package/api/cli/commands/{api-module.d.ts → domain-type.d.ts} +1 -1
- package/api/cli/commands/domain-type.js +466 -0
- package/api/cli/commands/table.js +22 -0
- package/api/cli/commands.js +3 -5
- package/api/cli/executor.d.ts +1 -2
- package/api/orm/index.d.ts +2 -4
- package/api/orm/index.js +2 -4
- package/api/orm/input-types.d.ts +378 -468
- package/api/orm/input-types.js +2 -2
- package/api/orm/models/domainType.d.ts +54 -0
- package/api/orm/models/{apiModule.js → domainType.js} +27 -27
- package/api/orm/models/index.d.ts +1 -2
- package/api/orm/models/index.js +4 -6
- package/compute/cli/commands/function-api-binding.js +12 -0
- package/compute/cli/commands/platform-function-api-binding.js +12 -0
- package/compute/cli/commands/platform-function-invocation.js +22 -0
- package/compute/orm/input-types.d.ts +42 -3
- package/esm/admin/cli/commands/org-chart-edge-grant.d.ts +8 -0
- package/esm/{api/cli/commands/platform-api-module.js → admin/cli/commands/org-chart-edge-grant.js} +137 -53
- package/esm/admin/cli/commands/org-chart-edge.d.ts +8 -0
- package/esm/{api/cli/commands/api-module.js → admin/cli/commands/org-chart-edge.js} +86 -60
- package/esm/admin/cli/commands/org-get-managers-record.d.ts +8 -0
- package/esm/admin/cli/commands/org-get-managers-record.js +124 -0
- package/esm/admin/cli/commands/org-get-subordinates-record.d.ts +8 -0
- package/esm/admin/cli/commands/org-get-subordinates-record.js +124 -0
- package/esm/admin/cli/commands/org-is-manager-of.d.ts +8 -0
- package/esm/admin/cli/commands/org-is-manager-of.js +43 -0
- package/esm/admin/cli/commands.js +11 -1
- package/esm/admin/cli/executor.d.ts +9 -0
- package/esm/admin/orm/index.d.ts +13 -0
- package/esm/admin/orm/index.js +8 -0
- package/esm/admin/orm/input-types.d.ts +399 -0
- package/esm/admin/orm/models/index.d.ts +4 -0
- package/esm/admin/orm/models/index.js +4 -0
- package/esm/admin/orm/models/orgChartEdge.d.ts +54 -0
- package/esm/admin/orm/models/orgChartEdge.js +100 -0
- package/esm/admin/orm/models/orgChartEdgeGrant.d.ts +54 -0
- package/esm/{api/orm/models/platformApiModule.js → admin/orm/models/orgChartEdgeGrant.js} +25 -25
- package/esm/admin/orm/models/orgGetManagersRecord.d.ts +30 -0
- package/esm/admin/orm/models/orgGetManagersRecord.js +55 -0
- package/esm/admin/orm/models/orgGetSubordinatesRecord.d.ts +30 -0
- package/esm/admin/orm/models/orgGetSubordinatesRecord.js +55 -0
- package/esm/admin/orm/query/index.d.ts +11 -0
- package/esm/admin/orm/query/index.js +24 -0
- package/esm/api/cli/commands/{api-module.d.ts → domain-type.d.ts} +1 -1
- package/esm/api/cli/commands/domain-type.js +464 -0
- package/esm/api/cli/commands/table.js +22 -0
- package/esm/api/cli/commands.js +3 -5
- package/esm/api/cli/executor.d.ts +1 -2
- package/esm/api/orm/index.d.ts +2 -4
- package/esm/api/orm/index.js +2 -4
- package/esm/api/orm/input-types.d.ts +378 -468
- package/esm/api/orm/input-types.js +2 -2
- package/esm/api/orm/models/domainType.d.ts +54 -0
- package/esm/api/orm/models/{apiModule.js → domainType.js} +25 -25
- package/esm/api/orm/models/index.d.ts +1 -2
- package/esm/api/orm/models/index.js +1 -2
- package/esm/compute/cli/commands/function-api-binding.js +12 -0
- package/esm/compute/cli/commands/platform-function-api-binding.js +12 -0
- package/esm/compute/cli/commands/platform-function-invocation.js +22 -0
- package/esm/compute/orm/input-types.d.ts +42 -3
- package/esm/modules/cli/commands/api-surface-module.js +0 -44
- package/esm/modules/cli/commands/billing-module.js +22 -0
- package/esm/modules/orm/input-types.d.ts +9 -16
- package/modules/cli/commands/api-surface-module.js +0 -44
- package/modules/cli/commands/billing-module.js +22 -0
- package/modules/orm/input-types.d.ts +9 -16
- package/package.json +5 -5
- package/api/orm/models/apiModule.d.ts +0 -54
- package/api/orm/models/platformApiModule.d.ts +0 -54
- package/esm/api/orm/models/apiModule.d.ts +0 -54
- package/esm/api/orm/models/platformApiModule.d.ts +0 -54
package/{api/cli/commands/platform-api-module.js → admin/cli/commands/org-chart-edge-grant.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/**
|
|
4
|
-
* CLI commands for
|
|
4
|
+
* CLI commands for OrgChartEdgeGrant
|
|
5
5
|
* @generated by @constructive-io/graphql-codegen
|
|
6
6
|
* DO NOT EDIT - changes will be overwritten
|
|
7
7
|
*/
|
|
@@ -9,14 +9,17 @@ const inquirerer_1 = require("inquirerer");
|
|
|
9
9
|
const executor_1 = require("../executor");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const fieldSchema = {
|
|
12
|
-
|
|
12
|
+
childId: 'uuid',
|
|
13
13
|
createdAt: 'string',
|
|
14
|
-
|
|
14
|
+
entityId: 'uuid',
|
|
15
|
+
grantorId: 'uuid',
|
|
15
16
|
id: 'uuid',
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
isGrant: 'boolean',
|
|
18
|
+
parentId: 'uuid',
|
|
19
|
+
positionLevel: 'int',
|
|
20
|
+
positionTitle: 'string',
|
|
18
21
|
};
|
|
19
|
-
const usage = '\
|
|
22
|
+
const usage = '\norg-chart-edge-grant <command>\n\nCommands:\n list List orgChartEdgeGrant records\n find-first Find first matching orgChartEdgeGrant record\n get Get a orgChartEdgeGrant by ID\n create Create a new orgChartEdgeGrant\n update Update an existing orgChartEdgeGrant\n delete Delete a orgChartEdgeGrant\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
23
|
exports.default = async (argv, prompter, _options) => {
|
|
21
24
|
if (argv.help || argv.h) {
|
|
22
25
|
console.log(usage);
|
|
@@ -58,16 +61,19 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
58
61
|
async function handleList(argv, _prompter) {
|
|
59
62
|
try {
|
|
60
63
|
const defaultSelect = {
|
|
61
|
-
|
|
64
|
+
childId: true,
|
|
62
65
|
createdAt: true,
|
|
63
|
-
|
|
66
|
+
entityId: true,
|
|
67
|
+
grantorId: true,
|
|
64
68
|
id: true,
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
isGrant: true,
|
|
70
|
+
parentId: true,
|
|
71
|
+
positionLevel: true,
|
|
72
|
+
positionTitle: true,
|
|
67
73
|
};
|
|
68
74
|
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
69
75
|
const client = (0, executor_1.getClient)();
|
|
70
|
-
const result = await client.
|
|
76
|
+
const result = await client.orgChartEdgeGrant.findMany(findManyArgs).execute();
|
|
71
77
|
console.log(JSON.stringify(result, null, 2));
|
|
72
78
|
}
|
|
73
79
|
catch (error) {
|
|
@@ -81,16 +87,19 @@ async function handleList(argv, _prompter) {
|
|
|
81
87
|
async function handleFindFirst(argv, _prompter) {
|
|
82
88
|
try {
|
|
83
89
|
const defaultSelect = {
|
|
84
|
-
|
|
90
|
+
childId: true,
|
|
85
91
|
createdAt: true,
|
|
86
|
-
|
|
92
|
+
entityId: true,
|
|
93
|
+
grantorId: true,
|
|
87
94
|
id: true,
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
isGrant: true,
|
|
96
|
+
parentId: true,
|
|
97
|
+
positionLevel: true,
|
|
98
|
+
positionTitle: true,
|
|
90
99
|
};
|
|
91
100
|
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
92
101
|
const client = (0, executor_1.getClient)();
|
|
93
|
-
const result = await client.
|
|
102
|
+
const result = await client.orgChartEdgeGrant.findFirst(findFirstArgs).execute();
|
|
94
103
|
console.log(JSON.stringify(result, null, 2));
|
|
95
104
|
}
|
|
96
105
|
catch (error) {
|
|
@@ -112,16 +121,19 @@ async function handleGet(argv, prompter) {
|
|
|
112
121
|
},
|
|
113
122
|
]);
|
|
114
123
|
const client = (0, executor_1.getClient)();
|
|
115
|
-
const result = await client.
|
|
124
|
+
const result = await client.orgChartEdgeGrant
|
|
116
125
|
.findOne({
|
|
117
126
|
id: answers.id,
|
|
118
127
|
select: {
|
|
119
|
-
|
|
128
|
+
childId: true,
|
|
120
129
|
createdAt: true,
|
|
121
|
-
|
|
130
|
+
entityId: true,
|
|
131
|
+
grantorId: true,
|
|
122
132
|
id: true,
|
|
123
|
-
|
|
124
|
-
|
|
133
|
+
isGrant: true,
|
|
134
|
+
parentId: true,
|
|
135
|
+
positionLevel: true,
|
|
136
|
+
positionTitle: true,
|
|
125
137
|
},
|
|
126
138
|
})
|
|
127
139
|
.execute();
|
|
@@ -140,40 +152,76 @@ async function handleCreate(argv, prompter) {
|
|
|
140
152
|
const rawAnswers = await prompter.prompt(argv, [
|
|
141
153
|
{
|
|
142
154
|
type: 'text',
|
|
143
|
-
name: '
|
|
144
|
-
message: '
|
|
155
|
+
name: 'childId',
|
|
156
|
+
message: 'childId',
|
|
145
157
|
required: true,
|
|
146
158
|
},
|
|
147
159
|
{
|
|
148
|
-
type: '
|
|
149
|
-
name: '
|
|
150
|
-
message: '
|
|
160
|
+
type: 'text',
|
|
161
|
+
name: 'entityId',
|
|
162
|
+
message: 'entityId',
|
|
151
163
|
required: true,
|
|
152
164
|
},
|
|
153
165
|
{
|
|
154
166
|
type: 'text',
|
|
155
|
-
name: '
|
|
156
|
-
message: '
|
|
157
|
-
required:
|
|
167
|
+
name: 'grantorId',
|
|
168
|
+
message: 'grantorId',
|
|
169
|
+
required: false,
|
|
170
|
+
skipPrompt: true,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'boolean',
|
|
174
|
+
name: 'isGrant',
|
|
175
|
+
message: 'isGrant',
|
|
176
|
+
required: false,
|
|
177
|
+
skipPrompt: true,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'text',
|
|
181
|
+
name: 'parentId',
|
|
182
|
+
message: 'parentId',
|
|
183
|
+
required: false,
|
|
184
|
+
skipPrompt: true,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'text',
|
|
188
|
+
name: 'positionLevel',
|
|
189
|
+
message: 'positionLevel',
|
|
190
|
+
required: false,
|
|
191
|
+
skipPrompt: true,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: 'text',
|
|
195
|
+
name: 'positionTitle',
|
|
196
|
+
message: 'positionTitle',
|
|
197
|
+
required: false,
|
|
198
|
+
skipPrompt: true,
|
|
158
199
|
},
|
|
159
200
|
]);
|
|
160
201
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
161
202
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
162
203
|
const client = (0, executor_1.getClient)();
|
|
163
|
-
const result = await client.
|
|
204
|
+
const result = await client.orgChartEdgeGrant
|
|
164
205
|
.create({
|
|
165
206
|
data: {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
207
|
+
childId: cleanedData.childId,
|
|
208
|
+
entityId: cleanedData.entityId,
|
|
209
|
+
grantorId: cleanedData.grantorId,
|
|
210
|
+
isGrant: cleanedData.isGrant,
|
|
211
|
+
parentId: cleanedData.parentId,
|
|
212
|
+
positionLevel: cleanedData.positionLevel,
|
|
213
|
+
positionTitle: cleanedData.positionTitle,
|
|
169
214
|
},
|
|
170
215
|
select: {
|
|
171
|
-
|
|
216
|
+
childId: true,
|
|
172
217
|
createdAt: true,
|
|
173
|
-
|
|
218
|
+
entityId: true,
|
|
219
|
+
grantorId: true,
|
|
174
220
|
id: true,
|
|
175
|
-
|
|
176
|
-
|
|
221
|
+
isGrant: true,
|
|
222
|
+
parentId: true,
|
|
223
|
+
positionLevel: true,
|
|
224
|
+
positionTitle: true,
|
|
177
225
|
},
|
|
178
226
|
})
|
|
179
227
|
.execute();
|
|
@@ -198,43 +246,79 @@ async function handleUpdate(argv, prompter) {
|
|
|
198
246
|
},
|
|
199
247
|
{
|
|
200
248
|
type: 'text',
|
|
201
|
-
name: '
|
|
202
|
-
message: '
|
|
249
|
+
name: 'childId',
|
|
250
|
+
message: 'childId',
|
|
251
|
+
required: false,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
type: 'text',
|
|
255
|
+
name: 'entityId',
|
|
256
|
+
message: 'entityId',
|
|
257
|
+
required: false,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: 'text',
|
|
261
|
+
name: 'grantorId',
|
|
262
|
+
message: 'grantorId',
|
|
203
263
|
required: false,
|
|
264
|
+
skipPrompt: true,
|
|
204
265
|
},
|
|
205
266
|
{
|
|
206
|
-
type: '
|
|
207
|
-
name: '
|
|
208
|
-
message: '
|
|
267
|
+
type: 'boolean',
|
|
268
|
+
name: 'isGrant',
|
|
269
|
+
message: 'isGrant',
|
|
270
|
+
required: false,
|
|
271
|
+
skipPrompt: true,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
type: 'text',
|
|
275
|
+
name: 'parentId',
|
|
276
|
+
message: 'parentId',
|
|
277
|
+
required: false,
|
|
278
|
+
skipPrompt: true,
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
type: 'text',
|
|
282
|
+
name: 'positionLevel',
|
|
283
|
+
message: 'positionLevel',
|
|
209
284
|
required: false,
|
|
285
|
+
skipPrompt: true,
|
|
210
286
|
},
|
|
211
287
|
{
|
|
212
288
|
type: 'text',
|
|
213
|
-
name: '
|
|
214
|
-
message: '
|
|
289
|
+
name: 'positionTitle',
|
|
290
|
+
message: 'positionTitle',
|
|
215
291
|
required: false,
|
|
292
|
+
skipPrompt: true,
|
|
216
293
|
},
|
|
217
294
|
]);
|
|
218
295
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
219
296
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
220
297
|
const client = (0, executor_1.getClient)();
|
|
221
|
-
const result = await client.
|
|
298
|
+
const result = await client.orgChartEdgeGrant
|
|
222
299
|
.update({
|
|
223
300
|
where: {
|
|
224
301
|
id: answers.id,
|
|
225
302
|
},
|
|
226
303
|
data: {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
304
|
+
childId: cleanedData.childId,
|
|
305
|
+
entityId: cleanedData.entityId,
|
|
306
|
+
grantorId: cleanedData.grantorId,
|
|
307
|
+
isGrant: cleanedData.isGrant,
|
|
308
|
+
parentId: cleanedData.parentId,
|
|
309
|
+
positionLevel: cleanedData.positionLevel,
|
|
310
|
+
positionTitle: cleanedData.positionTitle,
|
|
230
311
|
},
|
|
231
312
|
select: {
|
|
232
|
-
|
|
313
|
+
childId: true,
|
|
233
314
|
createdAt: true,
|
|
234
|
-
|
|
315
|
+
entityId: true,
|
|
316
|
+
grantorId: true,
|
|
235
317
|
id: true,
|
|
236
|
-
|
|
237
|
-
|
|
318
|
+
isGrant: true,
|
|
319
|
+
parentId: true,
|
|
320
|
+
positionLevel: true,
|
|
321
|
+
positionTitle: true,
|
|
238
322
|
},
|
|
239
323
|
})
|
|
240
324
|
.execute();
|
|
@@ -260,7 +344,7 @@ async function handleDelete(argv, prompter) {
|
|
|
260
344
|
]);
|
|
261
345
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
262
346
|
const client = (0, executor_1.getClient)();
|
|
263
|
-
const result = await client.
|
|
347
|
+
const result = await client.orgChartEdgeGrant
|
|
264
348
|
.delete({
|
|
265
349
|
where: {
|
|
266
350
|
id: answers.id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/**
|
|
4
|
-
* CLI commands for
|
|
4
|
+
* CLI commands for OrgChartEdge
|
|
5
5
|
* @generated by @constructive-io/graphql-codegen
|
|
6
6
|
* DO NOT EDIT - changes will be overwritten
|
|
7
7
|
*/
|
|
@@ -9,15 +9,16 @@ const inquirerer_1 = require("inquirerer");
|
|
|
9
9
|
const executor_1 = require("../executor");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const fieldSchema = {
|
|
12
|
-
|
|
12
|
+
childId: 'uuid',
|
|
13
13
|
createdAt: 'string',
|
|
14
|
-
|
|
15
|
-
databaseId: 'uuid',
|
|
14
|
+
entityId: 'uuid',
|
|
16
15
|
id: 'uuid',
|
|
17
|
-
|
|
16
|
+
parentId: 'uuid',
|
|
17
|
+
positionLevel: 'int',
|
|
18
|
+
positionTitle: 'string',
|
|
18
19
|
updatedAt: 'string',
|
|
19
20
|
};
|
|
20
|
-
const usage = '\
|
|
21
|
+
const usage = '\norg-chart-edge <command>\n\nCommands:\n list List orgChartEdge records\n find-first Find first matching orgChartEdge record\n get Get a orgChartEdge by ID\n create Create a new orgChartEdge\n update Update an existing orgChartEdge\n delete Delete a orgChartEdge\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';
|
|
21
22
|
exports.default = async (argv, prompter, _options) => {
|
|
22
23
|
if (argv.help || argv.h) {
|
|
23
24
|
console.log(usage);
|
|
@@ -59,17 +60,18 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
59
60
|
async function handleList(argv, _prompter) {
|
|
60
61
|
try {
|
|
61
62
|
const defaultSelect = {
|
|
62
|
-
|
|
63
|
+
childId: true,
|
|
63
64
|
createdAt: true,
|
|
64
|
-
|
|
65
|
-
databaseId: true,
|
|
65
|
+
entityId: true,
|
|
66
66
|
id: true,
|
|
67
|
-
|
|
67
|
+
parentId: true,
|
|
68
|
+
positionLevel: true,
|
|
69
|
+
positionTitle: true,
|
|
68
70
|
updatedAt: true,
|
|
69
71
|
};
|
|
70
72
|
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
71
73
|
const client = (0, executor_1.getClient)();
|
|
72
|
-
const result = await client.
|
|
74
|
+
const result = await client.orgChartEdge.findMany(findManyArgs).execute();
|
|
73
75
|
console.log(JSON.stringify(result, null, 2));
|
|
74
76
|
}
|
|
75
77
|
catch (error) {
|
|
@@ -83,17 +85,18 @@ async function handleList(argv, _prompter) {
|
|
|
83
85
|
async function handleFindFirst(argv, _prompter) {
|
|
84
86
|
try {
|
|
85
87
|
const defaultSelect = {
|
|
86
|
-
|
|
88
|
+
childId: true,
|
|
87
89
|
createdAt: true,
|
|
88
|
-
|
|
89
|
-
databaseId: true,
|
|
90
|
+
entityId: true,
|
|
90
91
|
id: true,
|
|
91
|
-
|
|
92
|
+
parentId: true,
|
|
93
|
+
positionLevel: true,
|
|
94
|
+
positionTitle: true,
|
|
92
95
|
updatedAt: true,
|
|
93
96
|
};
|
|
94
97
|
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
95
98
|
const client = (0, executor_1.getClient)();
|
|
96
|
-
const result = await client.
|
|
99
|
+
const result = await client.orgChartEdge.findFirst(findFirstArgs).execute();
|
|
97
100
|
console.log(JSON.stringify(result, null, 2));
|
|
98
101
|
}
|
|
99
102
|
catch (error) {
|
|
@@ -115,16 +118,17 @@ async function handleGet(argv, prompter) {
|
|
|
115
118
|
},
|
|
116
119
|
]);
|
|
117
120
|
const client = (0, executor_1.getClient)();
|
|
118
|
-
const result = await client.
|
|
121
|
+
const result = await client.orgChartEdge
|
|
119
122
|
.findOne({
|
|
120
123
|
id: answers.id,
|
|
121
124
|
select: {
|
|
122
|
-
|
|
125
|
+
childId: true,
|
|
123
126
|
createdAt: true,
|
|
124
|
-
|
|
125
|
-
databaseId: true,
|
|
127
|
+
entityId: true,
|
|
126
128
|
id: true,
|
|
127
|
-
|
|
129
|
+
parentId: true,
|
|
130
|
+
positionLevel: true,
|
|
131
|
+
positionTitle: true,
|
|
128
132
|
updatedAt: true,
|
|
129
133
|
},
|
|
130
134
|
})
|
|
@@ -144,47 +148,58 @@ async function handleCreate(argv, prompter) {
|
|
|
144
148
|
const rawAnswers = await prompter.prompt(argv, [
|
|
145
149
|
{
|
|
146
150
|
type: 'text',
|
|
147
|
-
name: '
|
|
148
|
-
message: '
|
|
151
|
+
name: 'childId',
|
|
152
|
+
message: 'childId',
|
|
149
153
|
required: true,
|
|
150
154
|
},
|
|
151
155
|
{
|
|
152
|
-
type: '
|
|
153
|
-
name: '
|
|
154
|
-
message: '
|
|
156
|
+
type: 'text',
|
|
157
|
+
name: 'entityId',
|
|
158
|
+
message: 'entityId',
|
|
155
159
|
required: true,
|
|
156
160
|
},
|
|
157
161
|
{
|
|
158
162
|
type: 'text',
|
|
159
|
-
name: '
|
|
160
|
-
message: '
|
|
161
|
-
required:
|
|
163
|
+
name: 'parentId',
|
|
164
|
+
message: 'parentId',
|
|
165
|
+
required: false,
|
|
166
|
+
skipPrompt: true,
|
|
162
167
|
},
|
|
163
168
|
{
|
|
164
169
|
type: 'text',
|
|
165
|
-
name: '
|
|
166
|
-
message: '
|
|
167
|
-
required:
|
|
170
|
+
name: 'positionLevel',
|
|
171
|
+
message: 'positionLevel',
|
|
172
|
+
required: false,
|
|
173
|
+
skipPrompt: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'text',
|
|
177
|
+
name: 'positionTitle',
|
|
178
|
+
message: 'positionTitle',
|
|
179
|
+
required: false,
|
|
180
|
+
skipPrompt: true,
|
|
168
181
|
},
|
|
169
182
|
]);
|
|
170
183
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
171
184
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
172
185
|
const client = (0, executor_1.getClient)();
|
|
173
|
-
const result = await client.
|
|
186
|
+
const result = await client.orgChartEdge
|
|
174
187
|
.create({
|
|
175
188
|
data: {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
childId: cleanedData.childId,
|
|
190
|
+
entityId: cleanedData.entityId,
|
|
191
|
+
parentId: cleanedData.parentId,
|
|
192
|
+
positionLevel: cleanedData.positionLevel,
|
|
193
|
+
positionTitle: cleanedData.positionTitle,
|
|
180
194
|
},
|
|
181
195
|
select: {
|
|
182
|
-
|
|
196
|
+
childId: true,
|
|
183
197
|
createdAt: true,
|
|
184
|
-
|
|
185
|
-
databaseId: true,
|
|
198
|
+
entityId: true,
|
|
186
199
|
id: true,
|
|
187
|
-
|
|
200
|
+
parentId: true,
|
|
201
|
+
positionLevel: true,
|
|
202
|
+
positionTitle: true,
|
|
188
203
|
updatedAt: true,
|
|
189
204
|
},
|
|
190
205
|
})
|
|
@@ -210,50 +225,61 @@ async function handleUpdate(argv, prompter) {
|
|
|
210
225
|
},
|
|
211
226
|
{
|
|
212
227
|
type: 'text',
|
|
213
|
-
name: '
|
|
214
|
-
message: '
|
|
228
|
+
name: 'childId',
|
|
229
|
+
message: 'childId',
|
|
215
230
|
required: false,
|
|
216
231
|
},
|
|
217
232
|
{
|
|
218
|
-
type: '
|
|
219
|
-
name: '
|
|
220
|
-
message: '
|
|
233
|
+
type: 'text',
|
|
234
|
+
name: 'entityId',
|
|
235
|
+
message: 'entityId',
|
|
236
|
+
required: false,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: 'text',
|
|
240
|
+
name: 'parentId',
|
|
241
|
+
message: 'parentId',
|
|
221
242
|
required: false,
|
|
243
|
+
skipPrompt: true,
|
|
222
244
|
},
|
|
223
245
|
{
|
|
224
246
|
type: 'text',
|
|
225
|
-
name: '
|
|
226
|
-
message: '
|
|
247
|
+
name: 'positionLevel',
|
|
248
|
+
message: 'positionLevel',
|
|
227
249
|
required: false,
|
|
250
|
+
skipPrompt: true,
|
|
228
251
|
},
|
|
229
252
|
{
|
|
230
253
|
type: 'text',
|
|
231
|
-
name: '
|
|
232
|
-
message: '
|
|
254
|
+
name: 'positionTitle',
|
|
255
|
+
message: 'positionTitle',
|
|
233
256
|
required: false,
|
|
257
|
+
skipPrompt: true,
|
|
234
258
|
},
|
|
235
259
|
]);
|
|
236
260
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
237
261
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
238
262
|
const client = (0, executor_1.getClient)();
|
|
239
|
-
const result = await client.
|
|
263
|
+
const result = await client.orgChartEdge
|
|
240
264
|
.update({
|
|
241
265
|
where: {
|
|
242
266
|
id: answers.id,
|
|
243
267
|
},
|
|
244
268
|
data: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
childId: cleanedData.childId,
|
|
270
|
+
entityId: cleanedData.entityId,
|
|
271
|
+
parentId: cleanedData.parentId,
|
|
272
|
+
positionLevel: cleanedData.positionLevel,
|
|
273
|
+
positionTitle: cleanedData.positionTitle,
|
|
249
274
|
},
|
|
250
275
|
select: {
|
|
251
|
-
|
|
276
|
+
childId: true,
|
|
252
277
|
createdAt: true,
|
|
253
|
-
|
|
254
|
-
databaseId: true,
|
|
278
|
+
entityId: true,
|
|
255
279
|
id: true,
|
|
256
|
-
|
|
280
|
+
parentId: true,
|
|
281
|
+
positionLevel: true,
|
|
282
|
+
positionTitle: true,
|
|
257
283
|
updatedAt: true,
|
|
258
284
|
},
|
|
259
285
|
})
|
|
@@ -280,7 +306,7 @@ async function handleDelete(argv, prompter) {
|
|
|
280
306
|
]);
|
|
281
307
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
282
308
|
const client = (0, executor_1.getClient)();
|
|
283
|
-
const result = await client.
|
|
309
|
+
const result = await client.orgChartEdge
|
|
284
310
|
.delete({
|
|
285
311
|
where: {
|
|
286
312
|
id: answers.id,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgGetManagersRecord
|
|
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;
|