@constructive-sdk/cli 0.12.18 → 0.12.20
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.js +13 -13
- package/admin/cli/executor.d.ts +6 -6
- package/admin/orm/index.d.ts +12 -12
- package/admin/orm/index.js +12 -12
- package/admin/orm/input-types.d.ts +849 -849
- package/admin/orm/models/index.d.ts +6 -6
- package/admin/orm/models/index.js +13 -13
- package/esm/admin/cli/commands.js +13 -13
- package/esm/admin/cli/executor.d.ts +6 -6
- package/esm/admin/orm/index.d.ts +12 -12
- package/esm/admin/orm/index.js +12 -12
- package/esm/admin/orm/input-types.d.ts +849 -849
- package/esm/admin/orm/models/index.d.ts +6 -6
- package/esm/admin/orm/models/index.js +6 -6
- package/esm/public/cli/commands/provision-table.js +1 -1
- package/esm/public/cli/commands.js +9 -11
- package/esm/public/cli/executor.d.ts +4 -5
- package/esm/public/orm/index.d.ts +8 -10
- package/esm/public/orm/index.js +8 -10
- package/esm/public/orm/input-types.d.ts +368 -529
- package/esm/public/orm/models/index.d.ts +4 -5
- package/esm/public/orm/models/index.js +4 -5
- package/esm/public/orm/mutation/index.d.ts +1 -1
- package/package.json +3 -3
- package/public/cli/commands/provision-table.js +1 -1
- package/public/cli/commands.js +9 -11
- package/public/cli/executor.d.ts +4 -5
- package/public/orm/index.d.ts +8 -10
- package/public/orm/index.js +8 -10
- package/public/orm/input-types.d.ts +368 -529
- package/public/orm/models/index.d.ts +4 -5
- package/public/orm/models/index.js +10 -12
- package/public/orm/mutation/index.d.ts +1 -1
- package/esm/public/cli/commands/node-type-registry.d.ts +0 -8
- package/esm/public/cli/commands/node-type-registry.js +0 -399
- package/esm/public/orm/models/nodeTypeRegistry.d.ts +0 -56
- package/esm/public/orm/models/nodeTypeRegistry.js +0 -96
- package/public/cli/commands/node-type-registry.d.ts +0 -8
- package/public/cli/commands/node-type-registry.js +0 -401
- package/public/orm/models/nodeTypeRegistry.d.ts +0 -56
- package/public/orm/models/nodeTypeRegistry.js +0 -100
|
@@ -94,19 +94,18 @@ export { ClaimedInviteModel } from './claimedInvite';
|
|
|
94
94
|
export { OrgInviteModel } from './orgInvite';
|
|
95
95
|
export { OrgClaimedInviteModel } from './orgClaimedInvite';
|
|
96
96
|
export { AuditLogModel } from './auditLog';
|
|
97
|
+
export { AppPermissionDefaultModel } from './appPermissionDefault';
|
|
97
98
|
export { RefModel } from './ref';
|
|
98
99
|
export { StoreModel } from './store';
|
|
99
|
-
export { AppPermissionDefaultModel } from './appPermissionDefault';
|
|
100
100
|
export { RoleTypeModel } from './roleType';
|
|
101
|
+
export { MigrateFileModel } from './migrateFile';
|
|
101
102
|
export { AppLimitDefaultModel } from './appLimitDefault';
|
|
102
103
|
export { OrgLimitDefaultModel } from './orgLimitDefault';
|
|
103
|
-
export { MigrateFileModel } from './migrateFile';
|
|
104
104
|
export { MembershipTypeModel } from './membershipType';
|
|
105
|
-
export { CommitModel } from './commit';
|
|
106
105
|
export { AppMembershipDefaultModel } from './appMembershipDefault';
|
|
107
|
-
export {
|
|
108
|
-
export { NodeTypeRegistryModel } from './nodeTypeRegistry';
|
|
106
|
+
export { CommitModel } from './commit';
|
|
109
107
|
export { OrgMembershipDefaultModel } from './orgMembershipDefault';
|
|
108
|
+
export { RlsModuleModel } from './rlsModule';
|
|
110
109
|
export { SqlActionModel } from './sqlAction';
|
|
111
110
|
export { UserModel } from './user';
|
|
112
111
|
export { AstMigrationModel } from './astMigration';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvitesModuleModel = exports.EncryptedSecretsModuleModel = exports.EmailsModuleModel = exports.DenormalizedTableFieldModel = exports.DefaultIdsModuleModel = exports.CryptoAuthModuleModel = exports.CryptoAddressesModuleModel = exports.ConnectedAccountsModuleModel = exports.AppModel = exports.SiteModel = exports.ApiModel = exports.DatabaseTransferModel = exports.TriggerFunctionModel = exports.SiteThemeModel = exports.SiteModuleModel = exports.SiteMetadatumModel = exports.DomainModel = exports.ApiModuleModel = exports.ApiSchemaModel = exports.EnumModel = exports.DefaultPrivilegeModel = exports.SchemaGrantModel = exports.RelationProvisionModel = exports.SecureTableProvisionModel = exports.TableTemplateModuleModel = exports.EmbeddingChunkModel = exports.ViewRuleModel = exports.ViewGrantModel = exports.ViewTableModel = exports.ViewModel = exports.UniqueConstraintModel = exports.TriggerModel = exports.TableGrantModel = exports.PrimaryKeyConstraintModel = exports.PolicyModel = exports.IndexModel = exports.FullTextSearchModel = exports.ForeignKeyConstraintModel = exports.FieldModel = exports.CheckConstraintModel = exports.TableModel = exports.SchemaModel = exports.DatabaseModel = exports.AppLevelRequirementModel = exports.OrgPermissionModel = exports.AppPermissionModel = exports.ObjectModel = exports.GetAllRecordModel = exports.OrgGetSubordinatesRecordModel = exports.OrgGetManagersRecordModel = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.HierarchyModuleModel = exports.AppMembershipModel = exports.AstMigrationModel = exports.UserModel = exports.SqlActionModel = exports.
|
|
4
|
+
exports.AppMembershipDefaultModel = exports.MembershipTypeModel = exports.OrgLimitDefaultModel = exports.AppLimitDefaultModel = exports.MigrateFileModel = exports.RoleTypeModel = exports.StoreModel = exports.RefModel = exports.AppPermissionDefaultModel = exports.AuditLogModel = exports.OrgClaimedInviteModel = exports.OrgInviteModel = exports.ClaimedInviteModel = exports.InviteModel = exports.ConnectedAccountModel = exports.CryptoAddressModel = exports.PhoneNumberModel = exports.EmailModel = exports.AppLevelModel = exports.AppAchievementModel = exports.AppStepModel = exports.OrgLimitModel = exports.AppLimitModel = exports.OrgPermissionDefaultModel = exports.OrgChartEdgeGrantModel = exports.OrgChartEdgeModel = exports.OrgGrantModel = exports.OrgOwnerGrantModel = exports.OrgAdminGrantModel = exports.OrgMemberModel = exports.OrgMembershipModel = exports.AppGrantModel = exports.AppOwnerGrantModel = exports.AppAdminGrantModel = exports.DatabaseProvisionModuleModel = exports.StorageModuleModel = exports.BlueprintConstructionModel = exports.BlueprintTemplateModel = exports.BlueprintModel = exports.UsersModuleModel = exports.UserAuthModuleModel = exports.SessionsModuleModel = exports.SecretsModuleModel = exports.ProfilesModuleModel = exports.PhoneNumbersModuleModel = exports.PermissionsModuleModel = exports.MembershipsModuleModel = exports.MembershipTypesModuleModel = exports.LimitsModuleModel = exports.LevelsModuleModel = void 0;
|
|
5
|
+
exports.HierarchyModuleModel = exports.AppMembershipModel = exports.AstMigrationModel = exports.UserModel = exports.SqlActionModel = exports.RlsModuleModel = exports.OrgMembershipDefaultModel = exports.CommitModel = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Models barrel export
|
|
8
8
|
* @generated by @constructive-io/graphql-codegen
|
|
@@ -190,32 +190,30 @@ var orgClaimedInvite_1 = require("./orgClaimedInvite");
|
|
|
190
190
|
Object.defineProperty(exports, "OrgClaimedInviteModel", { enumerable: true, get: function () { return orgClaimedInvite_1.OrgClaimedInviteModel; } });
|
|
191
191
|
var auditLog_1 = require("./auditLog");
|
|
192
192
|
Object.defineProperty(exports, "AuditLogModel", { enumerable: true, get: function () { return auditLog_1.AuditLogModel; } });
|
|
193
|
+
var appPermissionDefault_1 = require("./appPermissionDefault");
|
|
194
|
+
Object.defineProperty(exports, "AppPermissionDefaultModel", { enumerable: true, get: function () { return appPermissionDefault_1.AppPermissionDefaultModel; } });
|
|
193
195
|
var ref_1 = require("./ref");
|
|
194
196
|
Object.defineProperty(exports, "RefModel", { enumerable: true, get: function () { return ref_1.RefModel; } });
|
|
195
197
|
var store_1 = require("./store");
|
|
196
198
|
Object.defineProperty(exports, "StoreModel", { enumerable: true, get: function () { return store_1.StoreModel; } });
|
|
197
|
-
var appPermissionDefault_1 = require("./appPermissionDefault");
|
|
198
|
-
Object.defineProperty(exports, "AppPermissionDefaultModel", { enumerable: true, get: function () { return appPermissionDefault_1.AppPermissionDefaultModel; } });
|
|
199
199
|
var roleType_1 = require("./roleType");
|
|
200
200
|
Object.defineProperty(exports, "RoleTypeModel", { enumerable: true, get: function () { return roleType_1.RoleTypeModel; } });
|
|
201
|
+
var migrateFile_1 = require("./migrateFile");
|
|
202
|
+
Object.defineProperty(exports, "MigrateFileModel", { enumerable: true, get: function () { return migrateFile_1.MigrateFileModel; } });
|
|
201
203
|
var appLimitDefault_1 = require("./appLimitDefault");
|
|
202
204
|
Object.defineProperty(exports, "AppLimitDefaultModel", { enumerable: true, get: function () { return appLimitDefault_1.AppLimitDefaultModel; } });
|
|
203
205
|
var orgLimitDefault_1 = require("./orgLimitDefault");
|
|
204
206
|
Object.defineProperty(exports, "OrgLimitDefaultModel", { enumerable: true, get: function () { return orgLimitDefault_1.OrgLimitDefaultModel; } });
|
|
205
|
-
var migrateFile_1 = require("./migrateFile");
|
|
206
|
-
Object.defineProperty(exports, "MigrateFileModel", { enumerable: true, get: function () { return migrateFile_1.MigrateFileModel; } });
|
|
207
207
|
var membershipType_1 = require("./membershipType");
|
|
208
208
|
Object.defineProperty(exports, "MembershipTypeModel", { enumerable: true, get: function () { return membershipType_1.MembershipTypeModel; } });
|
|
209
|
-
var commit_1 = require("./commit");
|
|
210
|
-
Object.defineProperty(exports, "CommitModel", { enumerable: true, get: function () { return commit_1.CommitModel; } });
|
|
211
209
|
var appMembershipDefault_1 = require("./appMembershipDefault");
|
|
212
210
|
Object.defineProperty(exports, "AppMembershipDefaultModel", { enumerable: true, get: function () { return appMembershipDefault_1.AppMembershipDefaultModel; } });
|
|
213
|
-
var
|
|
214
|
-
Object.defineProperty(exports, "
|
|
215
|
-
var nodeTypeRegistry_1 = require("./nodeTypeRegistry");
|
|
216
|
-
Object.defineProperty(exports, "NodeTypeRegistryModel", { enumerable: true, get: function () { return nodeTypeRegistry_1.NodeTypeRegistryModel; } });
|
|
211
|
+
var commit_1 = require("./commit");
|
|
212
|
+
Object.defineProperty(exports, "CommitModel", { enumerable: true, get: function () { return commit_1.CommitModel; } });
|
|
217
213
|
var orgMembershipDefault_1 = require("./orgMembershipDefault");
|
|
218
214
|
Object.defineProperty(exports, "OrgMembershipDefaultModel", { enumerable: true, get: function () { return orgMembershipDefault_1.OrgMembershipDefaultModel; } });
|
|
215
|
+
var rlsModule_1 = require("./rlsModule");
|
|
216
|
+
Object.defineProperty(exports, "RlsModuleModel", { enumerable: true, get: function () { return rlsModule_1.RlsModuleModel; } });
|
|
219
217
|
var sqlAction_1 = require("./sqlAction");
|
|
220
218
|
Object.defineProperty(exports, "SqlActionModel", { enumerable: true, get: function () { return sqlAction_1.SqlActionModel; } });
|
|
221
219
|
var user_1 = require("./user");
|
|
@@ -160,7 +160,7 @@ export interface OneTimeTokenVariables {
|
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Variables for provisionTable
|
|
163
|
-
* Composable table provisioning: creates or finds a table, then applies N nodes (Data* modules),
|
|
163
|
+
* Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).
|
|
164
164
|
*/
|
|
165
165
|
export interface ProvisionTableVariables {
|
|
166
166
|
input: ProvisionTableInput;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for NodeTypeRegistry
|
|
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,399 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for NodeTypeRegistry
|
|
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
|
-
name: 'string',
|
|
11
|
-
slug: 'string',
|
|
12
|
-
category: 'string',
|
|
13
|
-
displayName: 'string',
|
|
14
|
-
description: 'string',
|
|
15
|
-
summary: 'string',
|
|
16
|
-
parameterSchema: 'json',
|
|
17
|
-
guidance: 'json',
|
|
18
|
-
tags: 'string',
|
|
19
|
-
createdAt: 'string',
|
|
20
|
-
updatedAt: 'string',
|
|
21
|
-
};
|
|
22
|
-
const usage = '\nnode-type-registry <command>\n\nCommands:\n list List nodeTypeRegistry records\n find-first Find first matching nodeTypeRegistry record\n get Get a nodeTypeRegistry by ID\n create Create a new nodeTypeRegistry\n update Update an existing nodeTypeRegistry\n delete Delete a nodeTypeRegistry\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\n --help, -h Show this help message\n';
|
|
23
|
-
export default async (argv, prompter, _options) => {
|
|
24
|
-
if (argv.help || argv.h) {
|
|
25
|
-
console.log(usage);
|
|
26
|
-
process.exit(0);
|
|
27
|
-
}
|
|
28
|
-
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
29
|
-
if (!subcommand) {
|
|
30
|
-
const answer = await prompter.prompt(argv, [
|
|
31
|
-
{
|
|
32
|
-
type: 'autocomplete',
|
|
33
|
-
name: 'subcommand',
|
|
34
|
-
message: 'What do you want to do?',
|
|
35
|
-
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
36
|
-
},
|
|
37
|
-
]);
|
|
38
|
-
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
39
|
-
}
|
|
40
|
-
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
41
|
-
};
|
|
42
|
-
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
43
|
-
switch (subcommand) {
|
|
44
|
-
case 'list':
|
|
45
|
-
return handleList(argv, prompter);
|
|
46
|
-
case 'find-first':
|
|
47
|
-
return handleFindFirst(argv, prompter);
|
|
48
|
-
case 'get':
|
|
49
|
-
return handleGet(argv, prompter);
|
|
50
|
-
case 'create':
|
|
51
|
-
return handleCreate(argv, prompter);
|
|
52
|
-
case 'update':
|
|
53
|
-
return handleUpdate(argv, prompter);
|
|
54
|
-
case 'delete':
|
|
55
|
-
return handleDelete(argv, prompter);
|
|
56
|
-
default:
|
|
57
|
-
console.log(usage);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async function handleList(argv, _prompter) {
|
|
62
|
-
try {
|
|
63
|
-
const defaultSelect = {
|
|
64
|
-
name: true,
|
|
65
|
-
slug: true,
|
|
66
|
-
category: true,
|
|
67
|
-
displayName: true,
|
|
68
|
-
description: true,
|
|
69
|
-
summary: true,
|
|
70
|
-
parameterSchema: true,
|
|
71
|
-
guidance: true,
|
|
72
|
-
tags: true,
|
|
73
|
-
createdAt: true,
|
|
74
|
-
updatedAt: true,
|
|
75
|
-
};
|
|
76
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
77
|
-
const client = getClient();
|
|
78
|
-
const result = await client.nodeTypeRegistry.findMany(findManyArgs).execute();
|
|
79
|
-
console.log(JSON.stringify(result, null, 2));
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
console.error('Failed to list records.');
|
|
83
|
-
if (error instanceof Error) {
|
|
84
|
-
console.error(error.message);
|
|
85
|
-
}
|
|
86
|
-
process.exit(1);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async function handleFindFirst(argv, _prompter) {
|
|
90
|
-
try {
|
|
91
|
-
const defaultSelect = {
|
|
92
|
-
name: true,
|
|
93
|
-
slug: true,
|
|
94
|
-
category: true,
|
|
95
|
-
displayName: true,
|
|
96
|
-
description: true,
|
|
97
|
-
summary: true,
|
|
98
|
-
parameterSchema: true,
|
|
99
|
-
guidance: true,
|
|
100
|
-
tags: true,
|
|
101
|
-
createdAt: true,
|
|
102
|
-
updatedAt: true,
|
|
103
|
-
};
|
|
104
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
105
|
-
const client = getClient();
|
|
106
|
-
const result = await client.nodeTypeRegistry.findFirst(findFirstArgs).execute();
|
|
107
|
-
console.log(JSON.stringify(result, null, 2));
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
console.error('Failed to find record.');
|
|
111
|
-
if (error instanceof Error) {
|
|
112
|
-
console.error(error.message);
|
|
113
|
-
}
|
|
114
|
-
process.exit(1);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function handleGet(argv, prompter) {
|
|
118
|
-
try {
|
|
119
|
-
const answers = await prompter.prompt(argv, [
|
|
120
|
-
{
|
|
121
|
-
type: 'text',
|
|
122
|
-
name: 'name',
|
|
123
|
-
message: 'name',
|
|
124
|
-
required: true,
|
|
125
|
-
},
|
|
126
|
-
]);
|
|
127
|
-
const client = getClient();
|
|
128
|
-
const result = await client.nodeTypeRegistry
|
|
129
|
-
.findOne({
|
|
130
|
-
name: answers.name,
|
|
131
|
-
select: {
|
|
132
|
-
name: true,
|
|
133
|
-
slug: true,
|
|
134
|
-
category: true,
|
|
135
|
-
displayName: true,
|
|
136
|
-
description: true,
|
|
137
|
-
summary: true,
|
|
138
|
-
parameterSchema: true,
|
|
139
|
-
guidance: true,
|
|
140
|
-
tags: true,
|
|
141
|
-
createdAt: true,
|
|
142
|
-
updatedAt: true,
|
|
143
|
-
},
|
|
144
|
-
})
|
|
145
|
-
.execute();
|
|
146
|
-
console.log(JSON.stringify(result, null, 2));
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
console.error('Record not found.');
|
|
150
|
-
if (error instanceof Error) {
|
|
151
|
-
console.error(error.message);
|
|
152
|
-
}
|
|
153
|
-
process.exit(1);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
async function handleCreate(argv, prompter) {
|
|
157
|
-
try {
|
|
158
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
159
|
-
{
|
|
160
|
-
type: 'text',
|
|
161
|
-
name: 'name',
|
|
162
|
-
message: 'name',
|
|
163
|
-
required: true,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
type: 'text',
|
|
167
|
-
name: 'slug',
|
|
168
|
-
message: 'slug',
|
|
169
|
-
required: true,
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
type: 'text',
|
|
173
|
-
name: 'category',
|
|
174
|
-
message: 'category',
|
|
175
|
-
required: true,
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
type: 'text',
|
|
179
|
-
name: 'displayName',
|
|
180
|
-
message: 'displayName',
|
|
181
|
-
required: false,
|
|
182
|
-
skipPrompt: true,
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'text',
|
|
186
|
-
name: 'description',
|
|
187
|
-
message: 'description',
|
|
188
|
-
required: false,
|
|
189
|
-
skipPrompt: true,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'text',
|
|
193
|
-
name: 'summary',
|
|
194
|
-
message: 'summary',
|
|
195
|
-
required: false,
|
|
196
|
-
skipPrompt: true,
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
type: 'json',
|
|
200
|
-
name: 'parameterSchema',
|
|
201
|
-
message: 'parameterSchema',
|
|
202
|
-
required: false,
|
|
203
|
-
skipPrompt: true,
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
type: 'json',
|
|
207
|
-
name: 'guidance',
|
|
208
|
-
message: 'guidance',
|
|
209
|
-
required: false,
|
|
210
|
-
skipPrompt: true,
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
type: 'text',
|
|
214
|
-
name: 'tags',
|
|
215
|
-
message: 'tags',
|
|
216
|
-
required: false,
|
|
217
|
-
skipPrompt: true,
|
|
218
|
-
},
|
|
219
|
-
]);
|
|
220
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
221
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
222
|
-
const client = getClient();
|
|
223
|
-
const result = await client.nodeTypeRegistry
|
|
224
|
-
.create({
|
|
225
|
-
data: {
|
|
226
|
-
name: cleanedData.name,
|
|
227
|
-
slug: cleanedData.slug,
|
|
228
|
-
category: cleanedData.category,
|
|
229
|
-
displayName: cleanedData.displayName,
|
|
230
|
-
description: cleanedData.description,
|
|
231
|
-
summary: cleanedData.summary,
|
|
232
|
-
parameterSchema: cleanedData.parameterSchema,
|
|
233
|
-
guidance: cleanedData.guidance,
|
|
234
|
-
tags: cleanedData.tags,
|
|
235
|
-
},
|
|
236
|
-
select: {
|
|
237
|
-
name: true,
|
|
238
|
-
slug: true,
|
|
239
|
-
category: true,
|
|
240
|
-
displayName: true,
|
|
241
|
-
description: true,
|
|
242
|
-
summary: true,
|
|
243
|
-
parameterSchema: true,
|
|
244
|
-
guidance: true,
|
|
245
|
-
tags: true,
|
|
246
|
-
createdAt: true,
|
|
247
|
-
updatedAt: true,
|
|
248
|
-
},
|
|
249
|
-
})
|
|
250
|
-
.execute();
|
|
251
|
-
console.log(JSON.stringify(result, null, 2));
|
|
252
|
-
}
|
|
253
|
-
catch (error) {
|
|
254
|
-
console.error('Failed to create record.');
|
|
255
|
-
if (error instanceof Error) {
|
|
256
|
-
console.error(error.message);
|
|
257
|
-
}
|
|
258
|
-
process.exit(1);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
async function handleUpdate(argv, prompter) {
|
|
262
|
-
try {
|
|
263
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
264
|
-
{
|
|
265
|
-
type: 'text',
|
|
266
|
-
name: 'name',
|
|
267
|
-
message: 'name',
|
|
268
|
-
required: true,
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
type: 'text',
|
|
272
|
-
name: 'slug',
|
|
273
|
-
message: 'slug',
|
|
274
|
-
required: false,
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
type: 'text',
|
|
278
|
-
name: 'category',
|
|
279
|
-
message: 'category',
|
|
280
|
-
required: false,
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
type: 'text',
|
|
284
|
-
name: 'displayName',
|
|
285
|
-
message: 'displayName',
|
|
286
|
-
required: false,
|
|
287
|
-
skipPrompt: true,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
type: 'text',
|
|
291
|
-
name: 'description',
|
|
292
|
-
message: 'description',
|
|
293
|
-
required: false,
|
|
294
|
-
skipPrompt: true,
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
type: 'text',
|
|
298
|
-
name: 'summary',
|
|
299
|
-
message: 'summary',
|
|
300
|
-
required: false,
|
|
301
|
-
skipPrompt: true,
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
type: 'json',
|
|
305
|
-
name: 'parameterSchema',
|
|
306
|
-
message: 'parameterSchema',
|
|
307
|
-
required: false,
|
|
308
|
-
skipPrompt: true,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
type: 'json',
|
|
312
|
-
name: 'guidance',
|
|
313
|
-
message: 'guidance',
|
|
314
|
-
required: false,
|
|
315
|
-
skipPrompt: true,
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
type: 'text',
|
|
319
|
-
name: 'tags',
|
|
320
|
-
message: 'tags',
|
|
321
|
-
required: false,
|
|
322
|
-
skipPrompt: true,
|
|
323
|
-
},
|
|
324
|
-
]);
|
|
325
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
326
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
327
|
-
const client = getClient();
|
|
328
|
-
const result = await client.nodeTypeRegistry
|
|
329
|
-
.update({
|
|
330
|
-
where: {
|
|
331
|
-
name: answers.name,
|
|
332
|
-
},
|
|
333
|
-
data: {
|
|
334
|
-
slug: cleanedData.slug,
|
|
335
|
-
category: cleanedData.category,
|
|
336
|
-
displayName: cleanedData.displayName,
|
|
337
|
-
description: cleanedData.description,
|
|
338
|
-
summary: cleanedData.summary,
|
|
339
|
-
parameterSchema: cleanedData.parameterSchema,
|
|
340
|
-
guidance: cleanedData.guidance,
|
|
341
|
-
tags: cleanedData.tags,
|
|
342
|
-
},
|
|
343
|
-
select: {
|
|
344
|
-
name: true,
|
|
345
|
-
slug: true,
|
|
346
|
-
category: true,
|
|
347
|
-
displayName: true,
|
|
348
|
-
description: true,
|
|
349
|
-
summary: true,
|
|
350
|
-
parameterSchema: true,
|
|
351
|
-
guidance: true,
|
|
352
|
-
tags: true,
|
|
353
|
-
createdAt: true,
|
|
354
|
-
updatedAt: true,
|
|
355
|
-
},
|
|
356
|
-
})
|
|
357
|
-
.execute();
|
|
358
|
-
console.log(JSON.stringify(result, null, 2));
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
console.error('Failed to update record.');
|
|
362
|
-
if (error instanceof Error) {
|
|
363
|
-
console.error(error.message);
|
|
364
|
-
}
|
|
365
|
-
process.exit(1);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
async function handleDelete(argv, prompter) {
|
|
369
|
-
try {
|
|
370
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
371
|
-
{
|
|
372
|
-
type: 'text',
|
|
373
|
-
name: 'name',
|
|
374
|
-
message: 'name',
|
|
375
|
-
required: true,
|
|
376
|
-
},
|
|
377
|
-
]);
|
|
378
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
379
|
-
const client = getClient();
|
|
380
|
-
const result = await client.nodeTypeRegistry
|
|
381
|
-
.delete({
|
|
382
|
-
where: {
|
|
383
|
-
name: answers.name,
|
|
384
|
-
},
|
|
385
|
-
select: {
|
|
386
|
-
name: true,
|
|
387
|
-
},
|
|
388
|
-
})
|
|
389
|
-
.execute();
|
|
390
|
-
console.log(JSON.stringify(result, null, 2));
|
|
391
|
-
}
|
|
392
|
-
catch (error) {
|
|
393
|
-
console.error('Failed to delete record.');
|
|
394
|
-
if (error instanceof Error) {
|
|
395
|
-
console.error(error.message);
|
|
396
|
-
}
|
|
397
|
-
process.exit(1);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NodeTypeRegistry 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 { NodeTypeRegistryWithRelations, NodeTypeRegistrySelect, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy, CreateNodeTypeRegistryInput, NodeTypeRegistryPatch } from '../input-types';
|
|
10
|
-
export declare class NodeTypeRegistryModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends NodeTypeRegistrySelect>(args: FindManyArgs<S, NodeTypeRegistryFilter, never, NodeTypeRegistryOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
16
|
-
nodeTypeRegistries: ConnectionResult<InferSelectResult<NodeTypeRegistryWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends NodeTypeRegistrySelect>(args: FindFirstArgs<S, NodeTypeRegistryFilter> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
21
|
-
nodeTypeRegistries: {
|
|
22
|
-
nodes: InferSelectResult<NodeTypeRegistryWithRelations, S>[];
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
findOne<S extends NodeTypeRegistrySelect>(args: {
|
|
26
|
-
name: string;
|
|
27
|
-
select: S;
|
|
28
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
29
|
-
nodeTypeRegistry: InferSelectResult<NodeTypeRegistryWithRelations, S> | null;
|
|
30
|
-
}>;
|
|
31
|
-
create<S extends NodeTypeRegistrySelect>(args: CreateArgs<S, CreateNodeTypeRegistryInput['nodeTypeRegistry']> & {
|
|
32
|
-
select: S;
|
|
33
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
34
|
-
createNodeTypeRegistry: {
|
|
35
|
-
nodeTypeRegistry: InferSelectResult<NodeTypeRegistryWithRelations, S>;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
update<S extends NodeTypeRegistrySelect>(args: UpdateArgs<S, {
|
|
39
|
-
name: string;
|
|
40
|
-
}, NodeTypeRegistryPatch> & {
|
|
41
|
-
select: S;
|
|
42
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
43
|
-
updateNodeTypeRegistry: {
|
|
44
|
-
nodeTypeRegistry: InferSelectResult<NodeTypeRegistryWithRelations, S>;
|
|
45
|
-
};
|
|
46
|
-
}>;
|
|
47
|
-
delete<S extends NodeTypeRegistrySelect>(args: DeleteArgs<{
|
|
48
|
-
name: string;
|
|
49
|
-
}, S> & {
|
|
50
|
-
select: S;
|
|
51
|
-
} & StrictSelect<S, NodeTypeRegistrySelect>): QueryBuilder<{
|
|
52
|
-
deleteNodeTypeRegistry: {
|
|
53
|
-
nodeTypeRegistry: InferSelectResult<NodeTypeRegistryWithRelations, S>;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
|
|
2
|
-
import { connectionFieldsMap } from '../input-types';
|
|
3
|
-
export class NodeTypeRegistryModel {
|
|
4
|
-
client;
|
|
5
|
-
constructor(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
}
|
|
8
|
-
findMany(args) {
|
|
9
|
-
const { document, variables } = buildFindManyDocument('NodeTypeRegistry', 'nodeTypeRegistries', 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
|
-
}, 'NodeTypeRegistryFilter', 'NodeTypeRegistryOrderBy', connectionFieldsMap);
|
|
18
|
-
return new QueryBuilder({
|
|
19
|
-
client: this.client,
|
|
20
|
-
operation: 'query',
|
|
21
|
-
operationName: 'NodeTypeRegistry',
|
|
22
|
-
fieldName: 'nodeTypeRegistries',
|
|
23
|
-
document,
|
|
24
|
-
variables,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
findFirst(args) {
|
|
28
|
-
const { document, variables } = buildFindFirstDocument('NodeTypeRegistry', 'nodeTypeRegistries', args.select, {
|
|
29
|
-
where: args?.where,
|
|
30
|
-
}, 'NodeTypeRegistryFilter', connectionFieldsMap);
|
|
31
|
-
return new QueryBuilder({
|
|
32
|
-
client: this.client,
|
|
33
|
-
operation: 'query',
|
|
34
|
-
operationName: 'NodeTypeRegistry',
|
|
35
|
-
fieldName: 'nodeTypeRegistries',
|
|
36
|
-
document,
|
|
37
|
-
variables,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
findOne(args) {
|
|
41
|
-
const { document, variables } = buildFindManyDocument('NodeTypeRegistry', 'nodeTypeRegistries', args.select, {
|
|
42
|
-
where: {
|
|
43
|
-
name: {
|
|
44
|
-
equalTo: args.name,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
first: 1,
|
|
48
|
-
}, 'NodeTypeRegistryFilter', 'NodeTypeRegistryOrderBy', connectionFieldsMap);
|
|
49
|
-
return new QueryBuilder({
|
|
50
|
-
client: this.client,
|
|
51
|
-
operation: 'query',
|
|
52
|
-
operationName: 'NodeTypeRegistry',
|
|
53
|
-
fieldName: 'nodeTypeRegistry',
|
|
54
|
-
document,
|
|
55
|
-
variables,
|
|
56
|
-
transform: (data) => ({
|
|
57
|
-
nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null,
|
|
58
|
-
}),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
create(args) {
|
|
62
|
-
const { document, variables } = buildCreateDocument('NodeTypeRegistry', 'createNodeTypeRegistry', 'nodeTypeRegistry', args.select, args.data, 'CreateNodeTypeRegistryInput', connectionFieldsMap);
|
|
63
|
-
return new QueryBuilder({
|
|
64
|
-
client: this.client,
|
|
65
|
-
operation: 'mutation',
|
|
66
|
-
operationName: 'NodeTypeRegistry',
|
|
67
|
-
fieldName: 'createNodeTypeRegistry',
|
|
68
|
-
document,
|
|
69
|
-
variables,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
update(args) {
|
|
73
|
-
const { document, variables } = buildUpdateByPkDocument('NodeTypeRegistry', 'updateNodeTypeRegistry', 'nodeTypeRegistry', args.select, args.where.name, args.data, 'UpdateNodeTypeRegistryInput', 'name', 'nodeTypeRegistryPatch', connectionFieldsMap);
|
|
74
|
-
return new QueryBuilder({
|
|
75
|
-
client: this.client,
|
|
76
|
-
operation: 'mutation',
|
|
77
|
-
operationName: 'NodeTypeRegistry',
|
|
78
|
-
fieldName: 'updateNodeTypeRegistry',
|
|
79
|
-
document,
|
|
80
|
-
variables,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
delete(args) {
|
|
84
|
-
const { document, variables } = buildDeleteByPkDocument('NodeTypeRegistry', 'deleteNodeTypeRegistry', 'nodeTypeRegistry', {
|
|
85
|
-
name: args.where.name,
|
|
86
|
-
}, 'DeleteNodeTypeRegistryInput', args.select, connectionFieldsMap);
|
|
87
|
-
return new QueryBuilder({
|
|
88
|
-
client: this.client,
|
|
89
|
-
operation: 'mutation',
|
|
90
|
-
operationName: 'NodeTypeRegistry',
|
|
91
|
-
fieldName: 'deleteNodeTypeRegistry',
|
|
92
|
-
document,
|
|
93
|
-
variables,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for NodeTypeRegistry
|
|
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;
|