@constructive-sdk/cli 1.21.4 → 1.21.6
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/provision-bucket.js +1 -1
- package/admin/cli/commands.js +1 -1
- package/admin/orm/input-types.d.ts +4 -4
- package/admin/orm/mutation/index.d.ts +5 -4
- package/agent/cli/commands/provision-bucket.js +1 -1
- package/agent/cli/commands.js +1 -1
- package/agent/orm/input-types.d.ts +4 -4
- package/agent/orm/mutation/index.d.ts +5 -4
- package/api/cli/commands/{route-binding.d.ts → create-function-from-source.d.ts} +1 -1
- package/api/cli/commands/create-function-from-source.js +36 -0
- package/api/cli/commands/{hostname-binding.d.ts → email-shared-account.d.ts} +1 -1
- package/api/cli/commands/email-shared-account.js +21 -0
- package/api/cli/commands/managed-domain.js +22 -0
- package/api/cli/commands/platform-managed-domain.js +22 -0
- package/api/cli/commands/provision-bucket.js +1 -1
- package/api/cli/commands/unique-constraint.js +22 -0
- package/{esm/api/cli/commands/route-binding.d.ts → api/cli/commands/update-function-from-source.d.ts} +1 -1
- package/api/cli/commands/update-function-from-source.js +36 -0
- package/api/cli/commands.js +7 -5
- package/api/cli/executor.d.ts +15 -2
- package/api/orm/index.d.ts +15 -4
- package/api/orm/index.js +0 -4
- package/api/orm/input-types.d.ts +96 -439
- package/api/orm/models/index.d.ts +0 -2
- package/api/orm/models/index.js +2 -6
- package/api/orm/mutation/index.d.ts +30 -5
- package/api/orm/mutation/index.js +24 -0
- package/api/orm/query/index.d.ts +5 -0
- package/api/orm/query/index.js +7 -0
- package/auth/cli/commands/provision-bucket.js +1 -1
- package/auth/cli/commands.js +1 -1
- package/auth/orm/input-types.d.ts +5 -29
- package/auth/orm/mutation/index.d.ts +5 -4
- package/compute/cli/commands/function-invocation.js +44 -0
- package/compute/cli/commands/platform-function-invocation.js +44 -0
- package/compute/cli/commands/provision-bucket.js +1 -1
- package/compute/cli/commands.js +1 -1
- package/compute/orm/input-types.d.ts +50 -6
- package/compute/orm/mutation/index.d.ts +5 -4
- package/config/cli/commands/provision-bucket.js +1 -1
- package/config/cli/commands.js +1 -1
- package/config/orm/input-types.d.ts +4 -4
- package/config/orm/mutation/index.d.ts +5 -4
- package/esm/admin/cli/commands/provision-bucket.js +1 -1
- package/esm/admin/cli/commands.js +1 -1
- package/esm/admin/orm/input-types.d.ts +4 -4
- package/esm/admin/orm/mutation/index.d.ts +5 -4
- package/esm/agent/cli/commands/provision-bucket.js +1 -1
- package/esm/agent/cli/commands.js +1 -1
- package/esm/agent/orm/input-types.d.ts +4 -4
- package/esm/agent/orm/mutation/index.d.ts +5 -4
- package/esm/api/cli/commands/create-function-from-source.d.ts +8 -0
- package/esm/api/cli/commands/create-function-from-source.js +34 -0
- package/esm/api/cli/commands/{hostname-binding.d.ts → email-shared-account.d.ts} +1 -1
- package/esm/api/cli/commands/email-shared-account.js +19 -0
- package/esm/api/cli/commands/managed-domain.js +22 -0
- package/esm/api/cli/commands/platform-managed-domain.js +22 -0
- package/esm/api/cli/commands/provision-bucket.js +1 -1
- package/esm/api/cli/commands/unique-constraint.js +22 -0
- package/esm/api/cli/commands/update-function-from-source.d.ts +8 -0
- package/esm/api/cli/commands/update-function-from-source.js +34 -0
- package/esm/api/cli/commands.js +7 -5
- package/esm/api/cli/executor.d.ts +15 -2
- package/esm/api/orm/index.d.ts +15 -4
- package/esm/api/orm/index.js +0 -4
- package/esm/api/orm/input-types.d.ts +96 -439
- package/esm/api/orm/models/index.d.ts +0 -2
- package/esm/api/orm/models/index.js +0 -2
- package/esm/api/orm/mutation/index.d.ts +30 -5
- package/esm/api/orm/mutation/index.js +24 -0
- package/esm/api/orm/query/index.d.ts +5 -0
- package/esm/api/orm/query/index.js +7 -0
- package/esm/auth/cli/commands/provision-bucket.js +1 -1
- package/esm/auth/cli/commands.js +1 -1
- package/esm/auth/orm/input-types.d.ts +5 -29
- package/esm/auth/orm/mutation/index.d.ts +5 -4
- package/esm/compute/cli/commands/function-invocation.js +44 -0
- package/esm/compute/cli/commands/platform-function-invocation.js +44 -0
- package/esm/compute/cli/commands/provision-bucket.js +1 -1
- package/esm/compute/cli/commands.js +1 -1
- package/esm/compute/orm/input-types.d.ts +50 -6
- package/esm/compute/orm/mutation/index.d.ts +5 -4
- package/esm/config/cli/commands/provision-bucket.js +1 -1
- package/esm/config/cli/commands.js +1 -1
- package/esm/config/orm/input-types.d.ts +4 -4
- package/esm/config/orm/mutation/index.d.ts +5 -4
- package/esm/infra/cli/commands/provision-bucket.js +1 -1
- package/esm/infra/cli/commands.js +1 -1
- package/esm/infra/orm/input-types.d.ts +4 -4
- package/esm/infra/orm/mutation/index.d.ts +5 -4
- package/esm/modules/cli/commands/billing-provider-module.js +110 -0
- package/esm/modules/cli/commands/blueprint-construction.js +0 -22
- package/esm/modules/cli/commands/catalog-module.js +44 -0
- package/esm/modules/cli/commands/construct-blueprint.js +1 -1
- package/esm/modules/cli/commands/provision-bucket.js +1 -1
- package/esm/modules/cli/commands/storage-module.js +22 -0
- package/esm/modules/cli/commands.js +1 -1
- package/esm/modules/orm/input-types.d.ts +72 -21
- package/esm/modules/orm/mutation/index.d.ts +6 -5
- package/esm/objects/cli/commands/provision-bucket.js +1 -1
- package/esm/objects/cli/commands.js +1 -1
- package/esm/objects/orm/input-types.d.ts +4 -4
- package/esm/objects/orm/mutation/index.d.ts +5 -4
- package/esm/remote/cli/commands/provision-bucket.js +1 -1
- package/esm/remote/cli/commands.js +1 -1
- package/esm/remote/orm/input-types.d.ts +4 -4
- package/esm/remote/orm/mutation/index.d.ts +5 -4
- package/esm/storage/cli/commands/bucket.js +23 -0
- package/esm/storage/cli/commands/platform-bucket.js +23 -0
- package/esm/storage/cli/commands/provision-bucket.js +1 -1
- package/esm/storage/cli/commands/upload-files.js +1 -1
- package/esm/storage/cli/commands/upload-platform-files.js +1 -1
- package/esm/storage/cli/commands.js +1 -1
- package/esm/storage/orm/input-types.d.ts +34 -6
- package/esm/storage/orm/mutation/index.d.ts +7 -6
- package/esm/usage/cli/commands/provision-bucket.js +1 -1
- package/esm/usage/cli/commands.js +1 -1
- package/esm/usage/orm/input-types.d.ts +4 -4
- package/esm/usage/orm/mutation/index.d.ts +5 -4
- package/infra/cli/commands/provision-bucket.js +1 -1
- package/infra/cli/commands.js +1 -1
- package/infra/orm/input-types.d.ts +4 -4
- package/infra/orm/mutation/index.d.ts +5 -4
- package/modules/cli/commands/billing-provider-module.js +110 -0
- package/modules/cli/commands/blueprint-construction.js +0 -22
- package/modules/cli/commands/catalog-module.js +44 -0
- package/modules/cli/commands/construct-blueprint.js +1 -1
- package/modules/cli/commands/provision-bucket.js +1 -1
- package/modules/cli/commands/storage-module.js +22 -0
- package/modules/cli/commands.js +1 -1
- package/modules/orm/input-types.d.ts +72 -21
- package/modules/orm/mutation/index.d.ts +6 -5
- package/objects/cli/commands/provision-bucket.js +1 -1
- package/objects/cli/commands.js +1 -1
- package/objects/orm/input-types.d.ts +4 -4
- package/objects/orm/mutation/index.d.ts +5 -4
- package/package.json +4 -4
- package/remote/cli/commands/provision-bucket.js +1 -1
- package/remote/cli/commands.js +1 -1
- package/remote/orm/input-types.d.ts +4 -4
- package/remote/orm/mutation/index.d.ts +5 -4
- package/storage/cli/commands/bucket.js +23 -0
- package/storage/cli/commands/platform-bucket.js +23 -0
- package/storage/cli/commands/provision-bucket.js +1 -1
- package/storage/cli/commands/upload-files.js +1 -1
- package/storage/cli/commands/upload-platform-files.js +1 -1
- package/storage/cli/commands.js +1 -1
- package/storage/orm/input-types.d.ts +34 -6
- package/storage/orm/mutation/index.d.ts +7 -6
- package/usage/cli/commands/provision-bucket.js +1 -1
- package/usage/cli/commands.js +1 -1
- package/usage/orm/input-types.d.ts +4 -4
- package/usage/orm/mutation/index.d.ts +5 -4
- package/api/cli/commands/hostname-binding.js +0 -388
- package/api/cli/commands/route-binding.js +0 -476
- package/api/orm/models/hostnameBinding.d.ts +0 -54
- package/api/orm/models/hostnameBinding.js +0 -104
- package/api/orm/models/routeBinding.d.ts +0 -54
- package/api/orm/models/routeBinding.js +0 -104
- package/esm/api/cli/commands/hostname-binding.js +0 -386
- package/esm/api/cli/commands/route-binding.js +0 -474
- package/esm/api/orm/models/hostnameBinding.d.ts +0 -54
- package/esm/api/orm/models/hostnameBinding.js +0 -100
- package/esm/api/orm/models/routeBinding.d.ts +0 -54
- package/esm/api/orm/models/routeBinding.js +0 -100
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for RouteBinding
|
|
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
|
-
domainId: 'uuid',
|
|
11
|
-
id: 'uuid',
|
|
12
|
-
isActive: 'boolean',
|
|
13
|
-
method: 'string',
|
|
14
|
-
path: 'string',
|
|
15
|
-
priority: 'int',
|
|
16
|
-
servingSiteId: 'uuid',
|
|
17
|
-
targetApiId: 'uuid',
|
|
18
|
-
targetBucketId: 'uuid',
|
|
19
|
-
targetFunctionId: 'uuid',
|
|
20
|
-
targetRedirectId: 'uuid',
|
|
21
|
-
targetServiceId: 'uuid',
|
|
22
|
-
targetSiteId: 'uuid',
|
|
23
|
-
updatedAt: 'string',
|
|
24
|
-
};
|
|
25
|
-
const usage = '\nroute-binding <command>\n\nCommands:\n list List routeBinding records\n find-first Find first matching routeBinding record\n get Get a routeBinding by ID\n create Create a new routeBinding\n update Update an existing routeBinding\n delete Delete a routeBinding\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';
|
|
26
|
-
export default async (argv, prompter, _options) => {
|
|
27
|
-
if (argv.help || argv.h) {
|
|
28
|
-
console.log(usage);
|
|
29
|
-
process.exit(0);
|
|
30
|
-
}
|
|
31
|
-
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
32
|
-
if (!subcommand) {
|
|
33
|
-
const answer = await prompter.prompt(argv, [
|
|
34
|
-
{
|
|
35
|
-
type: 'autocomplete',
|
|
36
|
-
name: 'subcommand',
|
|
37
|
-
message: 'What do you want to do?',
|
|
38
|
-
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
39
|
-
},
|
|
40
|
-
]);
|
|
41
|
-
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
42
|
-
}
|
|
43
|
-
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
44
|
-
};
|
|
45
|
-
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
46
|
-
switch (subcommand) {
|
|
47
|
-
case 'list':
|
|
48
|
-
return handleList(argv, prompter);
|
|
49
|
-
case 'find-first':
|
|
50
|
-
return handleFindFirst(argv, prompter);
|
|
51
|
-
case 'get':
|
|
52
|
-
return handleGet(argv, prompter);
|
|
53
|
-
case 'create':
|
|
54
|
-
return handleCreate(argv, prompter);
|
|
55
|
-
case 'update':
|
|
56
|
-
return handleUpdate(argv, prompter);
|
|
57
|
-
case 'delete':
|
|
58
|
-
return handleDelete(argv, prompter);
|
|
59
|
-
default:
|
|
60
|
-
console.log(usage);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async function handleList(argv, _prompter) {
|
|
65
|
-
try {
|
|
66
|
-
const defaultSelect = {
|
|
67
|
-
domainId: true,
|
|
68
|
-
id: true,
|
|
69
|
-
isActive: true,
|
|
70
|
-
method: true,
|
|
71
|
-
path: true,
|
|
72
|
-
priority: true,
|
|
73
|
-
servingSiteId: true,
|
|
74
|
-
targetApiId: true,
|
|
75
|
-
targetBucketId: true,
|
|
76
|
-
targetFunctionId: true,
|
|
77
|
-
targetRedirectId: true,
|
|
78
|
-
targetServiceId: true,
|
|
79
|
-
targetSiteId: true,
|
|
80
|
-
updatedAt: true,
|
|
81
|
-
};
|
|
82
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
83
|
-
const client = getClient();
|
|
84
|
-
const result = await client.routeBinding.findMany(findManyArgs).execute();
|
|
85
|
-
console.log(JSON.stringify(result, null, 2));
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
console.error('Failed to list records.');
|
|
89
|
-
if (error instanceof Error) {
|
|
90
|
-
console.error(error.message);
|
|
91
|
-
}
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
async function handleFindFirst(argv, _prompter) {
|
|
96
|
-
try {
|
|
97
|
-
const defaultSelect = {
|
|
98
|
-
domainId: true,
|
|
99
|
-
id: true,
|
|
100
|
-
isActive: true,
|
|
101
|
-
method: true,
|
|
102
|
-
path: true,
|
|
103
|
-
priority: true,
|
|
104
|
-
servingSiteId: true,
|
|
105
|
-
targetApiId: true,
|
|
106
|
-
targetBucketId: true,
|
|
107
|
-
targetFunctionId: true,
|
|
108
|
-
targetRedirectId: true,
|
|
109
|
-
targetServiceId: true,
|
|
110
|
-
targetSiteId: true,
|
|
111
|
-
updatedAt: true,
|
|
112
|
-
};
|
|
113
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
114
|
-
const client = getClient();
|
|
115
|
-
const result = await client.routeBinding.findFirst(findFirstArgs).execute();
|
|
116
|
-
console.log(JSON.stringify(result, null, 2));
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
console.error('Failed to find record.');
|
|
120
|
-
if (error instanceof Error) {
|
|
121
|
-
console.error(error.message);
|
|
122
|
-
}
|
|
123
|
-
process.exit(1);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
async function handleGet(argv, prompter) {
|
|
127
|
-
try {
|
|
128
|
-
const answers = await prompter.prompt(argv, [
|
|
129
|
-
{
|
|
130
|
-
type: 'text',
|
|
131
|
-
name: 'id',
|
|
132
|
-
message: 'id',
|
|
133
|
-
required: true,
|
|
134
|
-
},
|
|
135
|
-
]);
|
|
136
|
-
const client = getClient();
|
|
137
|
-
const result = await client.routeBinding
|
|
138
|
-
.findOne({
|
|
139
|
-
id: answers.id,
|
|
140
|
-
select: {
|
|
141
|
-
domainId: true,
|
|
142
|
-
id: true,
|
|
143
|
-
isActive: true,
|
|
144
|
-
method: true,
|
|
145
|
-
path: true,
|
|
146
|
-
priority: true,
|
|
147
|
-
servingSiteId: true,
|
|
148
|
-
targetApiId: true,
|
|
149
|
-
targetBucketId: true,
|
|
150
|
-
targetFunctionId: true,
|
|
151
|
-
targetRedirectId: true,
|
|
152
|
-
targetServiceId: true,
|
|
153
|
-
targetSiteId: true,
|
|
154
|
-
updatedAt: true,
|
|
155
|
-
},
|
|
156
|
-
})
|
|
157
|
-
.execute();
|
|
158
|
-
console.log(JSON.stringify(result, null, 2));
|
|
159
|
-
}
|
|
160
|
-
catch (error) {
|
|
161
|
-
console.error('Record not found.');
|
|
162
|
-
if (error instanceof Error) {
|
|
163
|
-
console.error(error.message);
|
|
164
|
-
}
|
|
165
|
-
process.exit(1);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async function handleCreate(argv, prompter) {
|
|
169
|
-
try {
|
|
170
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
171
|
-
{
|
|
172
|
-
type: 'text',
|
|
173
|
-
name: 'domainId',
|
|
174
|
-
message: 'domainId',
|
|
175
|
-
required: true,
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
type: 'boolean',
|
|
179
|
-
name: 'isActive',
|
|
180
|
-
message: 'isActive',
|
|
181
|
-
required: false,
|
|
182
|
-
skipPrompt: true,
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'text',
|
|
186
|
-
name: 'method',
|
|
187
|
-
message: 'method',
|
|
188
|
-
required: false,
|
|
189
|
-
skipPrompt: true,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'text',
|
|
193
|
-
name: 'path',
|
|
194
|
-
message: 'path',
|
|
195
|
-
required: true,
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
type: 'text',
|
|
199
|
-
name: 'priority',
|
|
200
|
-
message: 'priority',
|
|
201
|
-
required: false,
|
|
202
|
-
skipPrompt: true,
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
type: 'text',
|
|
206
|
-
name: 'servingSiteId',
|
|
207
|
-
message: 'servingSiteId',
|
|
208
|
-
required: false,
|
|
209
|
-
skipPrompt: true,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
type: 'text',
|
|
213
|
-
name: 'targetApiId',
|
|
214
|
-
message: 'targetApiId',
|
|
215
|
-
required: false,
|
|
216
|
-
skipPrompt: true,
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
type: 'text',
|
|
220
|
-
name: 'targetBucketId',
|
|
221
|
-
message: 'targetBucketId',
|
|
222
|
-
required: false,
|
|
223
|
-
skipPrompt: true,
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
type: 'text',
|
|
227
|
-
name: 'targetFunctionId',
|
|
228
|
-
message: 'targetFunctionId',
|
|
229
|
-
required: false,
|
|
230
|
-
skipPrompt: true,
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
type: 'text',
|
|
234
|
-
name: 'targetRedirectId',
|
|
235
|
-
message: 'targetRedirectId',
|
|
236
|
-
required: false,
|
|
237
|
-
skipPrompt: true,
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
type: 'text',
|
|
241
|
-
name: 'targetServiceId',
|
|
242
|
-
message: 'targetServiceId',
|
|
243
|
-
required: false,
|
|
244
|
-
skipPrompt: true,
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
type: 'text',
|
|
248
|
-
name: 'targetSiteId',
|
|
249
|
-
message: 'targetSiteId',
|
|
250
|
-
required: false,
|
|
251
|
-
skipPrompt: true,
|
|
252
|
-
},
|
|
253
|
-
]);
|
|
254
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
255
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
256
|
-
const client = getClient();
|
|
257
|
-
const result = await client.routeBinding
|
|
258
|
-
.create({
|
|
259
|
-
data: {
|
|
260
|
-
domainId: cleanedData.domainId,
|
|
261
|
-
isActive: cleanedData.isActive,
|
|
262
|
-
method: cleanedData.method,
|
|
263
|
-
path: cleanedData.path,
|
|
264
|
-
priority: cleanedData.priority,
|
|
265
|
-
servingSiteId: cleanedData.servingSiteId,
|
|
266
|
-
targetApiId: cleanedData.targetApiId,
|
|
267
|
-
targetBucketId: cleanedData.targetBucketId,
|
|
268
|
-
targetFunctionId: cleanedData.targetFunctionId,
|
|
269
|
-
targetRedirectId: cleanedData.targetRedirectId,
|
|
270
|
-
targetServiceId: cleanedData.targetServiceId,
|
|
271
|
-
targetSiteId: cleanedData.targetSiteId,
|
|
272
|
-
},
|
|
273
|
-
select: {
|
|
274
|
-
domainId: true,
|
|
275
|
-
id: true,
|
|
276
|
-
isActive: true,
|
|
277
|
-
method: true,
|
|
278
|
-
path: true,
|
|
279
|
-
priority: true,
|
|
280
|
-
servingSiteId: true,
|
|
281
|
-
targetApiId: true,
|
|
282
|
-
targetBucketId: true,
|
|
283
|
-
targetFunctionId: true,
|
|
284
|
-
targetRedirectId: true,
|
|
285
|
-
targetServiceId: true,
|
|
286
|
-
targetSiteId: true,
|
|
287
|
-
updatedAt: true,
|
|
288
|
-
},
|
|
289
|
-
})
|
|
290
|
-
.execute();
|
|
291
|
-
console.log(JSON.stringify(result, null, 2));
|
|
292
|
-
}
|
|
293
|
-
catch (error) {
|
|
294
|
-
console.error('Failed to create record.');
|
|
295
|
-
if (error instanceof Error) {
|
|
296
|
-
console.error(error.message);
|
|
297
|
-
}
|
|
298
|
-
process.exit(1);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
async function handleUpdate(argv, prompter) {
|
|
302
|
-
try {
|
|
303
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
304
|
-
{
|
|
305
|
-
type: 'text',
|
|
306
|
-
name: 'id',
|
|
307
|
-
message: 'id',
|
|
308
|
-
required: true,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
type: 'text',
|
|
312
|
-
name: 'domainId',
|
|
313
|
-
message: 'domainId',
|
|
314
|
-
required: false,
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
type: 'boolean',
|
|
318
|
-
name: 'isActive',
|
|
319
|
-
message: 'isActive',
|
|
320
|
-
required: false,
|
|
321
|
-
skipPrompt: true,
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
type: 'text',
|
|
325
|
-
name: 'method',
|
|
326
|
-
message: 'method',
|
|
327
|
-
required: false,
|
|
328
|
-
skipPrompt: true,
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
type: 'text',
|
|
332
|
-
name: 'path',
|
|
333
|
-
message: 'path',
|
|
334
|
-
required: false,
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
type: 'text',
|
|
338
|
-
name: 'priority',
|
|
339
|
-
message: 'priority',
|
|
340
|
-
required: false,
|
|
341
|
-
skipPrompt: true,
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
type: 'text',
|
|
345
|
-
name: 'servingSiteId',
|
|
346
|
-
message: 'servingSiteId',
|
|
347
|
-
required: false,
|
|
348
|
-
skipPrompt: true,
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
type: 'text',
|
|
352
|
-
name: 'targetApiId',
|
|
353
|
-
message: 'targetApiId',
|
|
354
|
-
required: false,
|
|
355
|
-
skipPrompt: true,
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
type: 'text',
|
|
359
|
-
name: 'targetBucketId',
|
|
360
|
-
message: 'targetBucketId',
|
|
361
|
-
required: false,
|
|
362
|
-
skipPrompt: true,
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
type: 'text',
|
|
366
|
-
name: 'targetFunctionId',
|
|
367
|
-
message: 'targetFunctionId',
|
|
368
|
-
required: false,
|
|
369
|
-
skipPrompt: true,
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
type: 'text',
|
|
373
|
-
name: 'targetRedirectId',
|
|
374
|
-
message: 'targetRedirectId',
|
|
375
|
-
required: false,
|
|
376
|
-
skipPrompt: true,
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
type: 'text',
|
|
380
|
-
name: 'targetServiceId',
|
|
381
|
-
message: 'targetServiceId',
|
|
382
|
-
required: false,
|
|
383
|
-
skipPrompt: true,
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
type: 'text',
|
|
387
|
-
name: 'targetSiteId',
|
|
388
|
-
message: 'targetSiteId',
|
|
389
|
-
required: false,
|
|
390
|
-
skipPrompt: true,
|
|
391
|
-
},
|
|
392
|
-
]);
|
|
393
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
394
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
395
|
-
const client = getClient();
|
|
396
|
-
const result = await client.routeBinding
|
|
397
|
-
.update({
|
|
398
|
-
where: {
|
|
399
|
-
id: answers.id,
|
|
400
|
-
},
|
|
401
|
-
data: {
|
|
402
|
-
domainId: cleanedData.domainId,
|
|
403
|
-
isActive: cleanedData.isActive,
|
|
404
|
-
method: cleanedData.method,
|
|
405
|
-
path: cleanedData.path,
|
|
406
|
-
priority: cleanedData.priority,
|
|
407
|
-
servingSiteId: cleanedData.servingSiteId,
|
|
408
|
-
targetApiId: cleanedData.targetApiId,
|
|
409
|
-
targetBucketId: cleanedData.targetBucketId,
|
|
410
|
-
targetFunctionId: cleanedData.targetFunctionId,
|
|
411
|
-
targetRedirectId: cleanedData.targetRedirectId,
|
|
412
|
-
targetServiceId: cleanedData.targetServiceId,
|
|
413
|
-
targetSiteId: cleanedData.targetSiteId,
|
|
414
|
-
},
|
|
415
|
-
select: {
|
|
416
|
-
domainId: true,
|
|
417
|
-
id: true,
|
|
418
|
-
isActive: true,
|
|
419
|
-
method: true,
|
|
420
|
-
path: true,
|
|
421
|
-
priority: true,
|
|
422
|
-
servingSiteId: true,
|
|
423
|
-
targetApiId: true,
|
|
424
|
-
targetBucketId: true,
|
|
425
|
-
targetFunctionId: true,
|
|
426
|
-
targetRedirectId: true,
|
|
427
|
-
targetServiceId: true,
|
|
428
|
-
targetSiteId: true,
|
|
429
|
-
updatedAt: true,
|
|
430
|
-
},
|
|
431
|
-
})
|
|
432
|
-
.execute();
|
|
433
|
-
console.log(JSON.stringify(result, null, 2));
|
|
434
|
-
}
|
|
435
|
-
catch (error) {
|
|
436
|
-
console.error('Failed to update record.');
|
|
437
|
-
if (error instanceof Error) {
|
|
438
|
-
console.error(error.message);
|
|
439
|
-
}
|
|
440
|
-
process.exit(1);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
async function handleDelete(argv, prompter) {
|
|
444
|
-
try {
|
|
445
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
446
|
-
{
|
|
447
|
-
type: 'text',
|
|
448
|
-
name: 'id',
|
|
449
|
-
message: 'id',
|
|
450
|
-
required: true,
|
|
451
|
-
},
|
|
452
|
-
]);
|
|
453
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
454
|
-
const client = getClient();
|
|
455
|
-
const result = await client.routeBinding
|
|
456
|
-
.delete({
|
|
457
|
-
where: {
|
|
458
|
-
id: answers.id,
|
|
459
|
-
},
|
|
460
|
-
select: {
|
|
461
|
-
id: true,
|
|
462
|
-
},
|
|
463
|
-
})
|
|
464
|
-
.execute();
|
|
465
|
-
console.log(JSON.stringify(result, null, 2));
|
|
466
|
-
}
|
|
467
|
-
catch (error) {
|
|
468
|
-
console.error('Failed to delete record.');
|
|
469
|
-
if (error instanceof Error) {
|
|
470
|
-
console.error(error.message);
|
|
471
|
-
}
|
|
472
|
-
process.exit(1);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HostnameBinding model for ORM client
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { OrmClient } from '../client';
|
|
7
|
-
import { QueryBuilder } from '../query-builder';
|
|
8
|
-
import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { HostnameBindingWithRelations, HostnameBindingSelect, HostnameBindingFilter, HostnameBindingOrderBy, CreateHostnameBindingInput, HostnameBindingPatch } from '../input-types';
|
|
10
|
-
export declare class HostnameBindingModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends HostnameBindingSelect>(args: FindManyArgs<S, HostnameBindingFilter, HostnameBindingOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
16
|
-
hostnameBindings: ConnectionResult<InferSelectResult<HostnameBindingWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends HostnameBindingSelect>(args: FindFirstArgs<S, HostnameBindingFilter, HostnameBindingOrderBy> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
21
|
-
hostnameBinding: InferSelectResult<HostnameBindingWithRelations, S> | null;
|
|
22
|
-
}>;
|
|
23
|
-
findOne<S extends HostnameBindingSelect>(args: {
|
|
24
|
-
id: string;
|
|
25
|
-
select: S;
|
|
26
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
27
|
-
hostnameBinding: InferSelectResult<HostnameBindingWithRelations, S> | null;
|
|
28
|
-
}>;
|
|
29
|
-
create<S extends HostnameBindingSelect>(args: CreateArgs<S, CreateHostnameBindingInput['hostnameBinding']> & {
|
|
30
|
-
select: S;
|
|
31
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
32
|
-
createHostnameBinding: {
|
|
33
|
-
hostnameBinding: InferSelectResult<HostnameBindingWithRelations, S>;
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
36
|
-
update<S extends HostnameBindingSelect>(args: UpdateArgs<S, {
|
|
37
|
-
id: string;
|
|
38
|
-
}, HostnameBindingPatch> & {
|
|
39
|
-
select: S;
|
|
40
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
41
|
-
updateHostnameBinding: {
|
|
42
|
-
hostnameBinding: InferSelectResult<HostnameBindingWithRelations, S>;
|
|
43
|
-
};
|
|
44
|
-
}>;
|
|
45
|
-
delete<S extends HostnameBindingSelect>(args: DeleteArgs<{
|
|
46
|
-
id: string;
|
|
47
|
-
}, S> & {
|
|
48
|
-
select: S;
|
|
49
|
-
} & StrictSelect<S, HostnameBindingSelect>): QueryBuilder<{
|
|
50
|
-
deleteHostnameBinding: {
|
|
51
|
-
hostnameBinding: InferSelectResult<HostnameBindingWithRelations, S>;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
54
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
|
|
2
|
-
import { connectionFieldsMap } from '../input-types';
|
|
3
|
-
export class HostnameBindingModel {
|
|
4
|
-
client;
|
|
5
|
-
constructor(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
}
|
|
8
|
-
findMany(args) {
|
|
9
|
-
const { document, variables } = buildFindManyDocument('HostnameBinding', 'hostnameBindings', args.select, {
|
|
10
|
-
where: args?.where,
|
|
11
|
-
orderBy: args?.orderBy,
|
|
12
|
-
first: args?.first,
|
|
13
|
-
last: args?.last,
|
|
14
|
-
after: args?.after,
|
|
15
|
-
before: args?.before,
|
|
16
|
-
offset: args?.offset,
|
|
17
|
-
}, 'HostnameBindingFilter', 'HostnameBindingOrderBy', connectionFieldsMap);
|
|
18
|
-
return new QueryBuilder({
|
|
19
|
-
client: this.client,
|
|
20
|
-
operation: 'query',
|
|
21
|
-
operationName: 'HostnameBinding',
|
|
22
|
-
fieldName: 'hostnameBindings',
|
|
23
|
-
document,
|
|
24
|
-
variables,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
findFirst(args) {
|
|
28
|
-
const { document, variables } = buildFindFirstDocument('HostnameBinding', 'hostnameBindings', args.select, {
|
|
29
|
-
where: args?.where,
|
|
30
|
-
orderBy: args?.orderBy,
|
|
31
|
-
}, 'HostnameBindingFilter', 'HostnameBindingOrderBy', connectionFieldsMap);
|
|
32
|
-
return new QueryBuilder({
|
|
33
|
-
client: this.client,
|
|
34
|
-
operation: 'query',
|
|
35
|
-
operationName: 'HostnameBinding',
|
|
36
|
-
fieldName: 'hostnameBinding',
|
|
37
|
-
document,
|
|
38
|
-
variables,
|
|
39
|
-
transform: (data) => ({
|
|
40
|
-
hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null,
|
|
41
|
-
}),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
findOne(args) {
|
|
45
|
-
const { document, variables } = buildFindManyDocument('HostnameBinding', 'hostnameBindings', args.select, {
|
|
46
|
-
where: {
|
|
47
|
-
id: {
|
|
48
|
-
equalTo: args.id,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
first: 1,
|
|
52
|
-
}, 'HostnameBindingFilter', 'HostnameBindingOrderBy', connectionFieldsMap);
|
|
53
|
-
return new QueryBuilder({
|
|
54
|
-
client: this.client,
|
|
55
|
-
operation: 'query',
|
|
56
|
-
operationName: 'HostnameBinding',
|
|
57
|
-
fieldName: 'hostnameBinding',
|
|
58
|
-
document,
|
|
59
|
-
variables,
|
|
60
|
-
transform: (data) => ({
|
|
61
|
-
hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null,
|
|
62
|
-
}),
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
create(args) {
|
|
66
|
-
const { document, variables } = buildCreateDocument('HostnameBinding', 'createHostnameBinding', 'hostnameBinding', args.select, args.data, 'CreateHostnameBindingInput', connectionFieldsMap);
|
|
67
|
-
return new QueryBuilder({
|
|
68
|
-
client: this.client,
|
|
69
|
-
operation: 'mutation',
|
|
70
|
-
operationName: 'HostnameBinding',
|
|
71
|
-
fieldName: 'createHostnameBinding',
|
|
72
|
-
document,
|
|
73
|
-
variables,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
update(args) {
|
|
77
|
-
const { document, variables } = buildUpdateByPkDocument('HostnameBinding', 'updateHostnameBinding', 'hostnameBinding', args.select, args.where.id, args.data, 'UpdateHostnameBindingInput', 'id', 'hostnameBindingPatch', connectionFieldsMap, undefined);
|
|
78
|
-
return new QueryBuilder({
|
|
79
|
-
client: this.client,
|
|
80
|
-
operation: 'mutation',
|
|
81
|
-
operationName: 'HostnameBinding',
|
|
82
|
-
fieldName: 'updateHostnameBinding',
|
|
83
|
-
document,
|
|
84
|
-
variables,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
delete(args) {
|
|
88
|
-
const { document, variables } = buildDeleteByPkDocument('HostnameBinding', 'deleteHostnameBinding', 'hostnameBinding', {
|
|
89
|
-
id: args.where.id,
|
|
90
|
-
}, 'DeleteHostnameBindingInput', args.select, connectionFieldsMap);
|
|
91
|
-
return new QueryBuilder({
|
|
92
|
-
client: this.client,
|
|
93
|
-
operation: 'mutation',
|
|
94
|
-
operationName: 'HostnameBinding',
|
|
95
|
-
fieldName: 'deleteHostnameBinding',
|
|
96
|
-
document,
|
|
97
|
-
variables,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RouteBinding model for ORM client
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { OrmClient } from '../client';
|
|
7
|
-
import { QueryBuilder } from '../query-builder';
|
|
8
|
-
import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { RouteBindingWithRelations, RouteBindingSelect, RouteBindingFilter, RouteBindingOrderBy, CreateRouteBindingInput, RouteBindingPatch } from '../input-types';
|
|
10
|
-
export declare class RouteBindingModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends RouteBindingSelect>(args: FindManyArgs<S, RouteBindingFilter, RouteBindingOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
16
|
-
routeBindings: ConnectionResult<InferSelectResult<RouteBindingWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends RouteBindingSelect>(args: FindFirstArgs<S, RouteBindingFilter, RouteBindingOrderBy> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
21
|
-
routeBinding: InferSelectResult<RouteBindingWithRelations, S> | null;
|
|
22
|
-
}>;
|
|
23
|
-
findOne<S extends RouteBindingSelect>(args: {
|
|
24
|
-
id: string;
|
|
25
|
-
select: S;
|
|
26
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
27
|
-
routeBinding: InferSelectResult<RouteBindingWithRelations, S> | null;
|
|
28
|
-
}>;
|
|
29
|
-
create<S extends RouteBindingSelect>(args: CreateArgs<S, CreateRouteBindingInput['routeBinding']> & {
|
|
30
|
-
select: S;
|
|
31
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
32
|
-
createRouteBinding: {
|
|
33
|
-
routeBinding: InferSelectResult<RouteBindingWithRelations, S>;
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
36
|
-
update<S extends RouteBindingSelect>(args: UpdateArgs<S, {
|
|
37
|
-
id: string;
|
|
38
|
-
}, RouteBindingPatch> & {
|
|
39
|
-
select: S;
|
|
40
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
41
|
-
updateRouteBinding: {
|
|
42
|
-
routeBinding: InferSelectResult<RouteBindingWithRelations, S>;
|
|
43
|
-
};
|
|
44
|
-
}>;
|
|
45
|
-
delete<S extends RouteBindingSelect>(args: DeleteArgs<{
|
|
46
|
-
id: string;
|
|
47
|
-
}, S> & {
|
|
48
|
-
select: S;
|
|
49
|
-
} & StrictSelect<S, RouteBindingSelect>): QueryBuilder<{
|
|
50
|
-
deleteRouteBinding: {
|
|
51
|
-
routeBinding: InferSelectResult<RouteBindingWithRelations, S>;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
54
|
-
}
|