@constructive-sdk/cli 0.22.3 → 0.22.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/admin/cli/commands/{app-achievement.d.ts → app-limit-warning.d.ts} +1 -1
- package/{public/cli/commands/app-step.js → admin/cli/commands/app-limit-warning.js} +58 -54
- package/{esm/admin/cli/commands/app-achievement.d.ts → admin/cli/commands/org-limit-warning.d.ts} +1 -1
- package/admin/cli/commands/{app-level.js → org-limit-warning.js} +66 -62
- package/admin/cli/commands.js +7 -15
- package/admin/cli/executor.d.ts +3 -15
- package/admin/orm/index.d.ts +6 -20
- package/admin/orm/index.js +6 -10
- package/admin/orm/input-types.d.ts +488 -768
- package/admin/orm/models/appLimitWarning.d.ts +54 -0
- package/{public/orm/models/secretsModule.js → admin/orm/models/appLimitWarning.js} +27 -27
- package/admin/orm/models/index.d.ts +3 -5
- package/admin/orm/models/index.js +7 -11
- package/admin/orm/models/orgLimitWarning.d.ts +54 -0
- package/admin/orm/models/{appAchievement.js → orgLimitWarning.js} +27 -27
- package/admin/orm/query/index.d.ts +1 -28
- package/admin/orm/query/index.js +0 -44
- package/{admin/cli/commands/app-step.d.ts → esm/admin/cli/commands/app-limit-warning.d.ts} +1 -1
- package/esm/{public/cli/commands/app-step.js → admin/cli/commands/app-limit-warning.js} +58 -54
- package/esm/admin/cli/commands/org-limit-warning.d.ts +8 -0
- package/esm/{public/cli/commands/app-level.js → admin/cli/commands/org-limit-warning.js} +66 -62
- package/esm/admin/cli/commands.js +7 -15
- package/esm/admin/cli/executor.d.ts +3 -15
- package/esm/admin/orm/index.d.ts +6 -20
- package/esm/admin/orm/index.js +6 -10
- package/esm/admin/orm/input-types.d.ts +488 -768
- package/esm/admin/orm/models/appLimitWarning.d.ts +54 -0
- package/esm/{public/orm/models/appAchievement.js → admin/orm/models/appLimitWarning.js} +25 -25
- package/esm/admin/orm/models/index.d.ts +3 -5
- package/esm/admin/orm/models/index.js +3 -5
- package/esm/admin/orm/models/orgLimitWarning.d.ts +54 -0
- package/esm/admin/orm/models/{appAchievement.js → orgLimitWarning.js} +25 -25
- package/esm/admin/orm/query/index.d.ts +1 -28
- package/esm/admin/orm/query/index.js +0 -44
- package/esm/public/cli/commands/app-limit-warning.d.ts +8 -0
- package/esm/{admin/cli/commands/app-step.js → public/cli/commands/app-limit-warning.js} +58 -54
- package/esm/public/cli/commands/construct-blueprint.js +1 -1
- package/esm/public/cli/commands/create-user-database.js +1 -1
- package/esm/public/cli/commands/embedding-chunk.js +66 -0
- package/esm/public/cli/commands/entity-type-provision.js +22 -0
- package/esm/{admin/cli/commands/app-level.d.ts → public/cli/commands/events-module.d.ts} +1 -1
- package/esm/public/cli/commands/{levels-module.js → events-module.js} +438 -152
- package/esm/public/cli/commands/limits-module.js +88 -0
- package/esm/public/cli/commands/org-limit-warning.d.ts +8 -0
- package/esm/{admin/cli/commands/app-level.js → public/cli/commands/org-limit-warning.js} +66 -62
- package/esm/public/cli/commands/partition.js +24 -24
- package/{admin/cli/commands/app-level-requirement.d.ts → esm/public/cli/commands/rate-limit-meters-module.d.ts} +1 -1
- package/esm/public/cli/commands/rate-limit-meters-module.js +448 -0
- package/esm/public/cli/commands/realtime-module.js +24 -24
- package/esm/public/cli/commands/user-state-module.d.ts +8 -0
- package/esm/public/cli/commands/{secrets-module.js → user-state-module.js} +8 -8
- package/esm/public/cli/commands.js +11 -17
- package/esm/public/cli/executor.d.ts +5 -16
- package/esm/public/orm/index.d.ts +10 -22
- package/esm/public/orm/index.js +10 -12
- package/esm/public/orm/input-types.d.ts +1024 -919
- package/esm/public/orm/input-types.js +3 -5
- package/esm/public/orm/models/appLimitWarning.d.ts +54 -0
- package/esm/{admin/orm/models/appLevel.js → public/orm/models/appLimitWarning.js} +25 -25
- package/esm/public/orm/models/eventsModule.d.ts +54 -0
- package/esm/public/orm/models/{levelsModule.js → eventsModule.js} +25 -25
- package/esm/public/orm/models/index.d.ts +5 -6
- package/esm/public/orm/models/index.js +5 -6
- package/esm/public/orm/models/orgLimitWarning.d.ts +54 -0
- package/esm/{admin/orm/models/appStep.js → public/orm/models/orgLimitWarning.js} +25 -25
- package/esm/public/orm/models/rateLimitMetersModule.d.ts +54 -0
- package/esm/{admin/orm/models/appLevelRequirement.js → public/orm/models/rateLimitMetersModule.js} +25 -25
- package/esm/public/orm/models/userStateModule.d.ts +54 -0
- package/esm/public/orm/models/userStateModule.js +100 -0
- package/esm/public/orm/mutation/index.d.ts +2 -2
- package/esm/public/orm/query/index.d.ts +1 -28
- package/esm/public/orm/query/index.js +0 -44
- package/package.json +4 -4
- package/public/cli/commands/app-limit-warning.d.ts +8 -0
- package/{admin/cli/commands/app-step.js → public/cli/commands/app-limit-warning.js} +58 -54
- package/public/cli/commands/construct-blueprint.js +1 -1
- package/public/cli/commands/create-user-database.js +1 -1
- package/public/cli/commands/embedding-chunk.js +66 -0
- package/public/cli/commands/entity-type-provision.js +22 -0
- package/{admin/cli/commands/app-level.d.ts → public/cli/commands/events-module.d.ts} +1 -1
- package/public/cli/commands/{levels-module.js → events-module.js} +438 -152
- package/public/cli/commands/limits-module.js +88 -0
- package/public/cli/commands/org-limit-warning.d.ts +8 -0
- package/public/cli/commands/{app-level.js → org-limit-warning.js} +66 -62
- package/public/cli/commands/partition.js +24 -24
- package/public/cli/commands/rate-limit-meters-module.d.ts +8 -0
- package/public/cli/commands/rate-limit-meters-module.js +450 -0
- package/public/cli/commands/realtime-module.js +24 -24
- package/public/cli/commands/user-state-module.d.ts +8 -0
- package/public/cli/commands/{secrets-module.js → user-state-module.js} +8 -8
- package/public/cli/commands.js +11 -17
- package/public/cli/executor.d.ts +5 -16
- package/public/orm/index.d.ts +10 -22
- package/public/orm/index.js +10 -12
- package/public/orm/input-types.d.ts +1024 -919
- package/public/orm/input-types.js +3 -5
- package/public/orm/models/appLimitWarning.d.ts +54 -0
- package/{admin/orm/models/appStep.js → public/orm/models/appLimitWarning.js} +27 -27
- package/public/orm/models/eventsModule.d.ts +54 -0
- package/public/orm/models/{levelsModule.js → eventsModule.js} +27 -27
- package/public/orm/models/index.d.ts +5 -6
- package/public/orm/models/index.js +13 -15
- package/public/orm/models/orgLimitWarning.d.ts +54 -0
- package/{admin/orm/models/appLevel.js → public/orm/models/orgLimitWarning.js} +27 -27
- package/public/orm/models/rateLimitMetersModule.d.ts +54 -0
- package/public/orm/models/{appAchievement.js → rateLimitMetersModule.js} +27 -27
- package/public/orm/models/userStateModule.d.ts +54 -0
- package/public/orm/models/userStateModule.js +104 -0
- package/public/orm/mutation/index.d.ts +2 -2
- package/public/orm/query/index.d.ts +1 -28
- package/public/orm/query/index.js +0 -44
- package/admin/cli/commands/app-achievement.js +0 -286
- package/admin/cli/commands/app-level-requirement.js +0 -328
- package/admin/cli/commands/steps-achieved.d.ts +0 -8
- package/admin/cli/commands/steps-achieved.js +0 -35
- package/admin/cli/commands/steps-required.d.ts +0 -8
- package/admin/cli/commands/steps-required.js +0 -54
- package/admin/orm/models/appAchievement.d.ts +0 -54
- package/admin/orm/models/appLevel.d.ts +0 -54
- package/admin/orm/models/appLevelRequirement.d.ts +0 -54
- package/admin/orm/models/appLevelRequirement.js +0 -104
- package/admin/orm/models/appStep.d.ts +0 -54
- package/esm/admin/cli/commands/app-achievement.js +0 -284
- package/esm/admin/cli/commands/app-level-requirement.d.ts +0 -8
- package/esm/admin/cli/commands/app-level-requirement.js +0 -326
- package/esm/admin/cli/commands/app-step.d.ts +0 -8
- package/esm/admin/cli/commands/steps-achieved.d.ts +0 -8
- package/esm/admin/cli/commands/steps-achieved.js +0 -33
- package/esm/admin/cli/commands/steps-required.d.ts +0 -8
- package/esm/admin/cli/commands/steps-required.js +0 -52
- package/esm/admin/orm/models/appAchievement.d.ts +0 -54
- package/esm/admin/orm/models/appLevel.d.ts +0 -54
- package/esm/admin/orm/models/appLevelRequirement.d.ts +0 -54
- package/esm/admin/orm/models/appStep.d.ts +0 -54
- package/esm/public/cli/commands/app-achievement.d.ts +0 -8
- package/esm/public/cli/commands/app-achievement.js +0 -284
- package/esm/public/cli/commands/app-level-requirement.d.ts +0 -8
- package/esm/public/cli/commands/app-level-requirement.js +0 -326
- package/esm/public/cli/commands/app-level.d.ts +0 -8
- package/esm/public/cli/commands/app-step.d.ts +0 -8
- package/esm/public/cli/commands/levels-module.d.ts +0 -8
- package/esm/public/cli/commands/secrets-module.d.ts +0 -8
- package/esm/public/cli/commands/steps-achieved.d.ts +0 -8
- package/esm/public/cli/commands/steps-achieved.js +0 -33
- package/esm/public/cli/commands/steps-required.d.ts +0 -8
- package/esm/public/cli/commands/steps-required.js +0 -52
- package/esm/public/orm/models/appAchievement.d.ts +0 -54
- package/esm/public/orm/models/appLevel.d.ts +0 -54
- package/esm/public/orm/models/appLevel.js +0 -100
- package/esm/public/orm/models/appLevelRequirement.d.ts +0 -54
- package/esm/public/orm/models/appLevelRequirement.js +0 -100
- package/esm/public/orm/models/appStep.d.ts +0 -54
- package/esm/public/orm/models/appStep.js +0 -100
- package/esm/public/orm/models/levelsModule.d.ts +0 -54
- package/esm/public/orm/models/secretsModule.d.ts +0 -54
- package/esm/public/orm/models/secretsModule.js +0 -100
- package/public/cli/commands/app-achievement.d.ts +0 -8
- package/public/cli/commands/app-achievement.js +0 -286
- package/public/cli/commands/app-level-requirement.d.ts +0 -8
- package/public/cli/commands/app-level-requirement.js +0 -328
- package/public/cli/commands/app-level.d.ts +0 -8
- package/public/cli/commands/app-step.d.ts +0 -8
- package/public/cli/commands/levels-module.d.ts +0 -8
- package/public/cli/commands/secrets-module.d.ts +0 -8
- package/public/cli/commands/steps-achieved.d.ts +0 -8
- package/public/cli/commands/steps-achieved.js +0 -35
- package/public/cli/commands/steps-required.d.ts +0 -8
- package/public/cli/commands/steps-required.js +0 -54
- package/public/orm/models/appAchievement.d.ts +0 -54
- package/public/orm/models/appLevel.d.ts +0 -54
- package/public/orm/models/appLevel.js +0 -104
- package/public/orm/models/appLevelRequirement.d.ts +0 -54
- package/public/orm/models/appLevelRequirement.js +0 -104
- package/public/orm/models/appStep.d.ts +0 -54
- package/public/orm/models/appStep.js +0 -104
- package/public/orm/models/levelsModule.d.ts +0 -54
- package/public/orm/models/secretsModule.d.ts +0 -54
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for RateLimitMetersModule
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
databaseId: 'uuid',
|
|
12
|
+
schemaId: 'uuid',
|
|
13
|
+
privateSchemaId: 'uuid',
|
|
14
|
+
rateLimitStateTableId: 'uuid',
|
|
15
|
+
rateLimitStateTableName: 'string',
|
|
16
|
+
rateLimitOverridesTableId: 'uuid',
|
|
17
|
+
rateLimitOverridesTableName: 'string',
|
|
18
|
+
rateWindowLimitsTableId: 'uuid',
|
|
19
|
+
rateWindowLimitsTableName: 'string',
|
|
20
|
+
checkRateLimitFunction: 'string',
|
|
21
|
+
prefix: 'string',
|
|
22
|
+
};
|
|
23
|
+
const usage = '\nrate-limit-meters-module <command>\n\nCommands:\n list List rateLimitMetersModule records\n find-first Find first matching rateLimitMetersModule record\n get Get a rateLimitMetersModule by ID\n create Create a new rateLimitMetersModule\n update Update an existing rateLimitMetersModule\n delete Delete a rateLimitMetersModule\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';
|
|
24
|
+
export default async (argv, prompter, _options) => {
|
|
25
|
+
if (argv.help || argv.h) {
|
|
26
|
+
console.log(usage);
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
30
|
+
if (!subcommand) {
|
|
31
|
+
const answer = await prompter.prompt(argv, [
|
|
32
|
+
{
|
|
33
|
+
type: 'autocomplete',
|
|
34
|
+
name: 'subcommand',
|
|
35
|
+
message: 'What do you want to do?',
|
|
36
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
39
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
40
|
+
}
|
|
41
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
42
|
+
};
|
|
43
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
44
|
+
switch (subcommand) {
|
|
45
|
+
case 'list':
|
|
46
|
+
return handleList(argv, prompter);
|
|
47
|
+
case 'find-first':
|
|
48
|
+
return handleFindFirst(argv, prompter);
|
|
49
|
+
case 'get':
|
|
50
|
+
return handleGet(argv, prompter);
|
|
51
|
+
case 'create':
|
|
52
|
+
return handleCreate(argv, prompter);
|
|
53
|
+
case 'update':
|
|
54
|
+
return handleUpdate(argv, prompter);
|
|
55
|
+
case 'delete':
|
|
56
|
+
return handleDelete(argv, prompter);
|
|
57
|
+
default:
|
|
58
|
+
console.log(usage);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function handleList(argv, _prompter) {
|
|
63
|
+
try {
|
|
64
|
+
const defaultSelect = {
|
|
65
|
+
id: true,
|
|
66
|
+
databaseId: true,
|
|
67
|
+
schemaId: true,
|
|
68
|
+
privateSchemaId: true,
|
|
69
|
+
rateLimitStateTableId: true,
|
|
70
|
+
rateLimitStateTableName: true,
|
|
71
|
+
rateLimitOverridesTableId: true,
|
|
72
|
+
rateLimitOverridesTableName: true,
|
|
73
|
+
rateWindowLimitsTableId: true,
|
|
74
|
+
rateWindowLimitsTableName: true,
|
|
75
|
+
checkRateLimitFunction: true,
|
|
76
|
+
prefix: true,
|
|
77
|
+
};
|
|
78
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
79
|
+
const client = getClient();
|
|
80
|
+
const result = await client.rateLimitMetersModule.findMany(findManyArgs).execute();
|
|
81
|
+
console.log(JSON.stringify(result, null, 2));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error('Failed to list records.');
|
|
85
|
+
if (error instanceof Error) {
|
|
86
|
+
console.error(error.message);
|
|
87
|
+
}
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function handleFindFirst(argv, _prompter) {
|
|
92
|
+
try {
|
|
93
|
+
const defaultSelect = {
|
|
94
|
+
id: true,
|
|
95
|
+
databaseId: true,
|
|
96
|
+
schemaId: true,
|
|
97
|
+
privateSchemaId: true,
|
|
98
|
+
rateLimitStateTableId: true,
|
|
99
|
+
rateLimitStateTableName: true,
|
|
100
|
+
rateLimitOverridesTableId: true,
|
|
101
|
+
rateLimitOverridesTableName: true,
|
|
102
|
+
rateWindowLimitsTableId: true,
|
|
103
|
+
rateWindowLimitsTableName: true,
|
|
104
|
+
checkRateLimitFunction: true,
|
|
105
|
+
prefix: true,
|
|
106
|
+
};
|
|
107
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
108
|
+
const client = getClient();
|
|
109
|
+
const result = await client.rateLimitMetersModule.findFirst(findFirstArgs).execute();
|
|
110
|
+
console.log(JSON.stringify(result, null, 2));
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('Failed to find record.');
|
|
114
|
+
if (error instanceof Error) {
|
|
115
|
+
console.error(error.message);
|
|
116
|
+
}
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function handleGet(argv, prompter) {
|
|
121
|
+
try {
|
|
122
|
+
const answers = await prompter.prompt(argv, [
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
name: 'id',
|
|
126
|
+
message: 'id',
|
|
127
|
+
required: true,
|
|
128
|
+
},
|
|
129
|
+
]);
|
|
130
|
+
const client = getClient();
|
|
131
|
+
const result = await client.rateLimitMetersModule
|
|
132
|
+
.findOne({
|
|
133
|
+
id: answers.id,
|
|
134
|
+
select: {
|
|
135
|
+
id: true,
|
|
136
|
+
databaseId: true,
|
|
137
|
+
schemaId: true,
|
|
138
|
+
privateSchemaId: true,
|
|
139
|
+
rateLimitStateTableId: true,
|
|
140
|
+
rateLimitStateTableName: true,
|
|
141
|
+
rateLimitOverridesTableId: true,
|
|
142
|
+
rateLimitOverridesTableName: true,
|
|
143
|
+
rateWindowLimitsTableId: true,
|
|
144
|
+
rateWindowLimitsTableName: true,
|
|
145
|
+
checkRateLimitFunction: true,
|
|
146
|
+
prefix: true,
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
.execute();
|
|
150
|
+
console.log(JSON.stringify(result, null, 2));
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error('Record not found.');
|
|
154
|
+
if (error instanceof Error) {
|
|
155
|
+
console.error(error.message);
|
|
156
|
+
}
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async function handleCreate(argv, prompter) {
|
|
161
|
+
try {
|
|
162
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
163
|
+
{
|
|
164
|
+
type: 'text',
|
|
165
|
+
name: 'databaseId',
|
|
166
|
+
message: 'databaseId',
|
|
167
|
+
required: true,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
name: 'schemaId',
|
|
172
|
+
message: 'schemaId',
|
|
173
|
+
required: false,
|
|
174
|
+
skipPrompt: true,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: 'text',
|
|
178
|
+
name: 'privateSchemaId',
|
|
179
|
+
message: 'privateSchemaId',
|
|
180
|
+
required: false,
|
|
181
|
+
skipPrompt: true,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'text',
|
|
185
|
+
name: 'rateLimitStateTableId',
|
|
186
|
+
message: 'rateLimitStateTableId',
|
|
187
|
+
required: false,
|
|
188
|
+
skipPrompt: true,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
name: 'rateLimitStateTableName',
|
|
193
|
+
message: 'rateLimitStateTableName',
|
|
194
|
+
required: false,
|
|
195
|
+
skipPrompt: true,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'text',
|
|
199
|
+
name: 'rateLimitOverridesTableId',
|
|
200
|
+
message: 'rateLimitOverridesTableId',
|
|
201
|
+
required: false,
|
|
202
|
+
skipPrompt: true,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
type: 'text',
|
|
206
|
+
name: 'rateLimitOverridesTableName',
|
|
207
|
+
message: 'rateLimitOverridesTableName',
|
|
208
|
+
required: false,
|
|
209
|
+
skipPrompt: true,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: 'text',
|
|
213
|
+
name: 'rateWindowLimitsTableId',
|
|
214
|
+
message: 'rateWindowLimitsTableId',
|
|
215
|
+
required: false,
|
|
216
|
+
skipPrompt: true,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: 'text',
|
|
220
|
+
name: 'rateWindowLimitsTableName',
|
|
221
|
+
message: 'rateWindowLimitsTableName',
|
|
222
|
+
required: false,
|
|
223
|
+
skipPrompt: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'text',
|
|
227
|
+
name: 'checkRateLimitFunction',
|
|
228
|
+
message: 'checkRateLimitFunction',
|
|
229
|
+
required: false,
|
|
230
|
+
skipPrompt: true,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
name: 'prefix',
|
|
235
|
+
message: 'prefix',
|
|
236
|
+
required: false,
|
|
237
|
+
skipPrompt: true,
|
|
238
|
+
},
|
|
239
|
+
]);
|
|
240
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
241
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
242
|
+
const client = getClient();
|
|
243
|
+
const result = await client.rateLimitMetersModule
|
|
244
|
+
.create({
|
|
245
|
+
data: {
|
|
246
|
+
databaseId: cleanedData.databaseId,
|
|
247
|
+
schemaId: cleanedData.schemaId,
|
|
248
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
249
|
+
rateLimitStateTableId: cleanedData.rateLimitStateTableId,
|
|
250
|
+
rateLimitStateTableName: cleanedData.rateLimitStateTableName,
|
|
251
|
+
rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId,
|
|
252
|
+
rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName,
|
|
253
|
+
rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId,
|
|
254
|
+
rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName,
|
|
255
|
+
checkRateLimitFunction: cleanedData.checkRateLimitFunction,
|
|
256
|
+
prefix: cleanedData.prefix,
|
|
257
|
+
},
|
|
258
|
+
select: {
|
|
259
|
+
id: true,
|
|
260
|
+
databaseId: true,
|
|
261
|
+
schemaId: true,
|
|
262
|
+
privateSchemaId: true,
|
|
263
|
+
rateLimitStateTableId: true,
|
|
264
|
+
rateLimitStateTableName: true,
|
|
265
|
+
rateLimitOverridesTableId: true,
|
|
266
|
+
rateLimitOverridesTableName: true,
|
|
267
|
+
rateWindowLimitsTableId: true,
|
|
268
|
+
rateWindowLimitsTableName: true,
|
|
269
|
+
checkRateLimitFunction: true,
|
|
270
|
+
prefix: true,
|
|
271
|
+
},
|
|
272
|
+
})
|
|
273
|
+
.execute();
|
|
274
|
+
console.log(JSON.stringify(result, null, 2));
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
console.error('Failed to create record.');
|
|
278
|
+
if (error instanceof Error) {
|
|
279
|
+
console.error(error.message);
|
|
280
|
+
}
|
|
281
|
+
process.exit(1);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
async function handleUpdate(argv, prompter) {
|
|
285
|
+
try {
|
|
286
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
287
|
+
{
|
|
288
|
+
type: 'text',
|
|
289
|
+
name: 'id',
|
|
290
|
+
message: 'id',
|
|
291
|
+
required: true,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
type: 'text',
|
|
295
|
+
name: 'databaseId',
|
|
296
|
+
message: 'databaseId',
|
|
297
|
+
required: false,
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
type: 'text',
|
|
301
|
+
name: 'schemaId',
|
|
302
|
+
message: 'schemaId',
|
|
303
|
+
required: false,
|
|
304
|
+
skipPrompt: true,
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
type: 'text',
|
|
308
|
+
name: 'privateSchemaId',
|
|
309
|
+
message: 'privateSchemaId',
|
|
310
|
+
required: false,
|
|
311
|
+
skipPrompt: true,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
type: 'text',
|
|
315
|
+
name: 'rateLimitStateTableId',
|
|
316
|
+
message: 'rateLimitStateTableId',
|
|
317
|
+
required: false,
|
|
318
|
+
skipPrompt: true,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
type: 'text',
|
|
322
|
+
name: 'rateLimitStateTableName',
|
|
323
|
+
message: 'rateLimitStateTableName',
|
|
324
|
+
required: false,
|
|
325
|
+
skipPrompt: true,
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
type: 'text',
|
|
329
|
+
name: 'rateLimitOverridesTableId',
|
|
330
|
+
message: 'rateLimitOverridesTableId',
|
|
331
|
+
required: false,
|
|
332
|
+
skipPrompt: true,
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
type: 'text',
|
|
336
|
+
name: 'rateLimitOverridesTableName',
|
|
337
|
+
message: 'rateLimitOverridesTableName',
|
|
338
|
+
required: false,
|
|
339
|
+
skipPrompt: true,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: 'text',
|
|
343
|
+
name: 'rateWindowLimitsTableId',
|
|
344
|
+
message: 'rateWindowLimitsTableId',
|
|
345
|
+
required: false,
|
|
346
|
+
skipPrompt: true,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: 'text',
|
|
350
|
+
name: 'rateWindowLimitsTableName',
|
|
351
|
+
message: 'rateWindowLimitsTableName',
|
|
352
|
+
required: false,
|
|
353
|
+
skipPrompt: true,
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
type: 'text',
|
|
357
|
+
name: 'checkRateLimitFunction',
|
|
358
|
+
message: 'checkRateLimitFunction',
|
|
359
|
+
required: false,
|
|
360
|
+
skipPrompt: true,
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
type: 'text',
|
|
364
|
+
name: 'prefix',
|
|
365
|
+
message: 'prefix',
|
|
366
|
+
required: false,
|
|
367
|
+
skipPrompt: true,
|
|
368
|
+
},
|
|
369
|
+
]);
|
|
370
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
371
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
372
|
+
const client = getClient();
|
|
373
|
+
const result = await client.rateLimitMetersModule
|
|
374
|
+
.update({
|
|
375
|
+
where: {
|
|
376
|
+
id: answers.id,
|
|
377
|
+
},
|
|
378
|
+
data: {
|
|
379
|
+
databaseId: cleanedData.databaseId,
|
|
380
|
+
schemaId: cleanedData.schemaId,
|
|
381
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
382
|
+
rateLimitStateTableId: cleanedData.rateLimitStateTableId,
|
|
383
|
+
rateLimitStateTableName: cleanedData.rateLimitStateTableName,
|
|
384
|
+
rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId,
|
|
385
|
+
rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName,
|
|
386
|
+
rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId,
|
|
387
|
+
rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName,
|
|
388
|
+
checkRateLimitFunction: cleanedData.checkRateLimitFunction,
|
|
389
|
+
prefix: cleanedData.prefix,
|
|
390
|
+
},
|
|
391
|
+
select: {
|
|
392
|
+
id: true,
|
|
393
|
+
databaseId: true,
|
|
394
|
+
schemaId: true,
|
|
395
|
+
privateSchemaId: true,
|
|
396
|
+
rateLimitStateTableId: true,
|
|
397
|
+
rateLimitStateTableName: true,
|
|
398
|
+
rateLimitOverridesTableId: true,
|
|
399
|
+
rateLimitOverridesTableName: true,
|
|
400
|
+
rateWindowLimitsTableId: true,
|
|
401
|
+
rateWindowLimitsTableName: true,
|
|
402
|
+
checkRateLimitFunction: true,
|
|
403
|
+
prefix: true,
|
|
404
|
+
},
|
|
405
|
+
})
|
|
406
|
+
.execute();
|
|
407
|
+
console.log(JSON.stringify(result, null, 2));
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
console.error('Failed to update record.');
|
|
411
|
+
if (error instanceof Error) {
|
|
412
|
+
console.error(error.message);
|
|
413
|
+
}
|
|
414
|
+
process.exit(1);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
async function handleDelete(argv, prompter) {
|
|
418
|
+
try {
|
|
419
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
420
|
+
{
|
|
421
|
+
type: 'text',
|
|
422
|
+
name: 'id',
|
|
423
|
+
message: 'id',
|
|
424
|
+
required: true,
|
|
425
|
+
},
|
|
426
|
+
]);
|
|
427
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
428
|
+
const client = getClient();
|
|
429
|
+
const result = await client.rateLimitMetersModule
|
|
430
|
+
.delete({
|
|
431
|
+
where: {
|
|
432
|
+
id: answers.id,
|
|
433
|
+
},
|
|
434
|
+
select: {
|
|
435
|
+
id: true,
|
|
436
|
+
},
|
|
437
|
+
})
|
|
438
|
+
.execute();
|
|
439
|
+
console.log(JSON.stringify(result, null, 2));
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
console.error('Failed to delete record.');
|
|
443
|
+
if (error instanceof Error) {
|
|
444
|
+
console.error(error.message);
|
|
445
|
+
}
|
|
446
|
+
process.exit(1);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
@@ -16,8 +16,8 @@ const fieldSchema = {
|
|
|
16
16
|
listenerNodeTableId: 'uuid',
|
|
17
17
|
sourceRegistryTableId: 'uuid',
|
|
18
18
|
retentionHours: 'int',
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
premake: 'int',
|
|
20
|
+
interval: 'string',
|
|
21
21
|
notifyChannel: 'string',
|
|
22
22
|
};
|
|
23
23
|
const usage = '\nrealtime-module <command>\n\nCommands:\n list List realtimeModule records\n find-first Find first matching realtimeModule record\n get Get a realtimeModule by ID\n create Create a new realtimeModule\n update Update an existing realtimeModule\n delete Delete a realtimeModule\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';
|
|
@@ -71,8 +71,8 @@ async function handleList(argv, _prompter) {
|
|
|
71
71
|
listenerNodeTableId: true,
|
|
72
72
|
sourceRegistryTableId: true,
|
|
73
73
|
retentionHours: true,
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
premake: true,
|
|
75
|
+
interval: true,
|
|
76
76
|
notifyChannel: true,
|
|
77
77
|
};
|
|
78
78
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
@@ -100,8 +100,8 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
100
100
|
listenerNodeTableId: true,
|
|
101
101
|
sourceRegistryTableId: true,
|
|
102
102
|
retentionHours: true,
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
premake: true,
|
|
104
|
+
interval: true,
|
|
105
105
|
notifyChannel: true,
|
|
106
106
|
};
|
|
107
107
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
@@ -141,8 +141,8 @@ async function handleGet(argv, prompter) {
|
|
|
141
141
|
listenerNodeTableId: true,
|
|
142
142
|
sourceRegistryTableId: true,
|
|
143
143
|
retentionHours: true,
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
premake: true,
|
|
145
|
+
interval: true,
|
|
146
146
|
notifyChannel: true,
|
|
147
147
|
},
|
|
148
148
|
})
|
|
@@ -217,15 +217,15 @@ async function handleCreate(argv, prompter) {
|
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
type: 'text',
|
|
220
|
-
name: '
|
|
221
|
-
message: '
|
|
220
|
+
name: 'premake',
|
|
221
|
+
message: 'premake',
|
|
222
222
|
required: false,
|
|
223
223
|
skipPrompt: true,
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
type: 'text',
|
|
227
|
-
name: '
|
|
228
|
-
message: '
|
|
227
|
+
name: 'interval',
|
|
228
|
+
message: 'interval',
|
|
229
229
|
required: false,
|
|
230
230
|
skipPrompt: true,
|
|
231
231
|
},
|
|
@@ -251,8 +251,8 @@ async function handleCreate(argv, prompter) {
|
|
|
251
251
|
listenerNodeTableId: cleanedData.listenerNodeTableId,
|
|
252
252
|
sourceRegistryTableId: cleanedData.sourceRegistryTableId,
|
|
253
253
|
retentionHours: cleanedData.retentionHours,
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
premake: cleanedData.premake,
|
|
255
|
+
interval: cleanedData.interval,
|
|
256
256
|
notifyChannel: cleanedData.notifyChannel,
|
|
257
257
|
},
|
|
258
258
|
select: {
|
|
@@ -265,8 +265,8 @@ async function handleCreate(argv, prompter) {
|
|
|
265
265
|
listenerNodeTableId: true,
|
|
266
266
|
sourceRegistryTableId: true,
|
|
267
267
|
retentionHours: true,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
premake: true,
|
|
269
|
+
interval: true,
|
|
270
270
|
notifyChannel: true,
|
|
271
271
|
},
|
|
272
272
|
})
|
|
@@ -347,15 +347,15 @@ async function handleUpdate(argv, prompter) {
|
|
|
347
347
|
},
|
|
348
348
|
{
|
|
349
349
|
type: 'text',
|
|
350
|
-
name: '
|
|
351
|
-
message: '
|
|
350
|
+
name: 'premake',
|
|
351
|
+
message: 'premake',
|
|
352
352
|
required: false,
|
|
353
353
|
skipPrompt: true,
|
|
354
354
|
},
|
|
355
355
|
{
|
|
356
356
|
type: 'text',
|
|
357
|
-
name: '
|
|
358
|
-
message: '
|
|
357
|
+
name: 'interval',
|
|
358
|
+
message: 'interval',
|
|
359
359
|
required: false,
|
|
360
360
|
skipPrompt: true,
|
|
361
361
|
},
|
|
@@ -384,8 +384,8 @@ async function handleUpdate(argv, prompter) {
|
|
|
384
384
|
listenerNodeTableId: cleanedData.listenerNodeTableId,
|
|
385
385
|
sourceRegistryTableId: cleanedData.sourceRegistryTableId,
|
|
386
386
|
retentionHours: cleanedData.retentionHours,
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
premake: cleanedData.premake,
|
|
388
|
+
interval: cleanedData.interval,
|
|
389
389
|
notifyChannel: cleanedData.notifyChannel,
|
|
390
390
|
},
|
|
391
391
|
select: {
|
|
@@ -398,8 +398,8 @@ async function handleUpdate(argv, prompter) {
|
|
|
398
398
|
listenerNodeTableId: true,
|
|
399
399
|
sourceRegistryTableId: true,
|
|
400
400
|
retentionHours: true,
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
premake: true,
|
|
402
|
+
interval: true,
|
|
403
403
|
notifyChannel: true,
|
|
404
404
|
},
|
|
405
405
|
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for UserStateModule
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI commands for
|
|
2
|
+
* CLI commands for UserStateModule
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
* DO NOT EDIT - changes will be overwritten
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@ const fieldSchema = {
|
|
|
13
13
|
tableId: 'uuid',
|
|
14
14
|
tableName: 'string',
|
|
15
15
|
};
|
|
16
|
-
const usage = '\
|
|
16
|
+
const usage = '\nuser-state-module <command>\n\nCommands:\n list List userStateModule records\n find-first Find first matching userStateModule record\n get Get a userStateModule by ID\n create Create a new userStateModule\n update Update an existing userStateModule\n delete Delete a userStateModule\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';
|
|
17
17
|
export default async (argv, prompter, _options) => {
|
|
18
18
|
if (argv.help || argv.h) {
|
|
19
19
|
console.log(usage);
|
|
@@ -63,7 +63,7 @@ async function handleList(argv, _prompter) {
|
|
|
63
63
|
};
|
|
64
64
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
65
65
|
const client = getClient();
|
|
66
|
-
const result = await client.
|
|
66
|
+
const result = await client.userStateModule.findMany(findManyArgs).execute();
|
|
67
67
|
console.log(JSON.stringify(result, null, 2));
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
@@ -85,7 +85,7 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
85
85
|
};
|
|
86
86
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
87
87
|
const client = getClient();
|
|
88
|
-
const result = await client.
|
|
88
|
+
const result = await client.userStateModule.findFirst(findFirstArgs).execute();
|
|
89
89
|
console.log(JSON.stringify(result, null, 2));
|
|
90
90
|
}
|
|
91
91
|
catch (error) {
|
|
@@ -107,7 +107,7 @@ async function handleGet(argv, prompter) {
|
|
|
107
107
|
},
|
|
108
108
|
]);
|
|
109
109
|
const client = getClient();
|
|
110
|
-
const result = await client.
|
|
110
|
+
const result = await client.userStateModule
|
|
111
111
|
.findOne({
|
|
112
112
|
id: answers.id,
|
|
113
113
|
select: {
|
|
@@ -163,7 +163,7 @@ async function handleCreate(argv, prompter) {
|
|
|
163
163
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
164
164
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
165
165
|
const client = getClient();
|
|
166
|
-
const result = await client.
|
|
166
|
+
const result = await client.userStateModule
|
|
167
167
|
.create({
|
|
168
168
|
data: {
|
|
169
169
|
databaseId: cleanedData.databaseId,
|
|
@@ -230,7 +230,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
230
230
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
231
231
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
232
232
|
const client = getClient();
|
|
233
|
-
const result = await client.
|
|
233
|
+
const result = await client.userStateModule
|
|
234
234
|
.update({
|
|
235
235
|
where: {
|
|
236
236
|
id: answers.id,
|
|
@@ -272,7 +272,7 @@ async function handleDelete(argv, prompter) {
|
|
|
272
272
|
]);
|
|
273
273
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
274
274
|
const client = getClient();
|
|
275
|
-
const result = await client.
|
|
275
|
+
const result = await client.userStateModule
|
|
276
276
|
.delete({
|
|
277
277
|
where: {
|
|
278
278
|
id: answers.id,
|