@constructive-sdk/cli 0.14.6 → 0.14.8
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/org-membership-default.js +0 -44
- package/admin/cli/commands/org-membership-setting.d.ts +8 -0
- package/admin/cli/commands/org-membership-setting.js +418 -0
- package/admin/cli/commands.js +5 -3
- package/admin/cli/executor.d.ts +2 -1
- package/admin/orm/index.d.ts +4 -2
- package/admin/orm/index.js +4 -2
- package/admin/orm/input-types.d.ts +303 -142
- package/admin/orm/models/index.d.ts +2 -1
- package/admin/orm/models/index.js +5 -3
- package/admin/orm/models/orgMembershipSetting.d.ts +56 -0
- package/admin/orm/models/orgMembershipSetting.js +100 -0
- package/auth/cli/commands/crypto-address.js +22 -0
- package/auth/cli/commands/email.js +22 -0
- package/auth/cli/commands/identity-provider.d.ts +8 -0
- package/auth/cli/commands/identity-provider.js +164 -0
- package/auth/cli/commands/phone-number.js +22 -0
- package/auth/cli/commands/webauthn-credential.d.ts +8 -0
- package/auth/cli/commands/webauthn-credential.js +456 -0
- package/auth/cli/commands.js +7 -3
- package/auth/cli/executor.d.ts +7 -5
- package/auth/orm/index.d.ts +9 -5
- package/auth/orm/index.js +4 -0
- package/auth/orm/input-types.d.ts +525 -81
- package/auth/orm/input-types.js +1 -0
- package/auth/orm/models/identityProvider.d.ts +32 -0
- package/auth/orm/models/identityProvider.js +55 -0
- package/auth/orm/models/index.d.ts +2 -0
- package/auth/orm/models/index.js +5 -1
- package/auth/orm/models/webauthnCredential.d.ts +56 -0
- package/auth/orm/models/webauthnCredential.js +100 -0
- package/auth/orm/mutation/index.d.ts +9 -9
- package/auth/orm/mutation/index.js +12 -12
- package/esm/admin/cli/commands/org-membership-default.js +0 -44
- package/esm/admin/cli/commands/org-membership-setting.d.ts +8 -0
- package/esm/admin/cli/commands/org-membership-setting.js +416 -0
- package/esm/admin/cli/commands.js +5 -3
- package/esm/admin/cli/executor.d.ts +2 -1
- package/esm/admin/orm/index.d.ts +4 -2
- package/esm/admin/orm/index.js +4 -2
- package/esm/admin/orm/input-types.d.ts +303 -142
- package/esm/admin/orm/models/index.d.ts +2 -1
- package/esm/admin/orm/models/index.js +2 -1
- package/esm/admin/orm/models/orgMembershipSetting.d.ts +56 -0
- package/esm/admin/orm/models/orgMembershipSetting.js +96 -0
- package/esm/auth/cli/commands/crypto-address.js +22 -0
- package/esm/auth/cli/commands/email.js +22 -0
- package/esm/auth/cli/commands/identity-provider.d.ts +8 -0
- package/esm/auth/cli/commands/identity-provider.js +162 -0
- package/esm/auth/cli/commands/phone-number.js +22 -0
- package/esm/auth/cli/commands/webauthn-credential.d.ts +8 -0
- package/esm/auth/cli/commands/webauthn-credential.js +454 -0
- package/esm/auth/cli/commands.js +7 -3
- package/esm/auth/cli/executor.d.ts +7 -5
- package/esm/auth/orm/index.d.ts +9 -5
- package/esm/auth/orm/index.js +4 -0
- package/esm/auth/orm/input-types.d.ts +525 -81
- package/esm/auth/orm/input-types.js +1 -0
- package/esm/auth/orm/models/identityProvider.d.ts +32 -0
- package/esm/auth/orm/models/identityProvider.js +51 -0
- package/esm/auth/orm/models/index.d.ts +2 -0
- package/esm/auth/orm/models/index.js +2 -0
- package/esm/auth/orm/models/webauthnCredential.d.ts +56 -0
- package/esm/auth/orm/models/webauthnCredential.js +96 -0
- package/esm/auth/orm/mutation/index.d.ts +9 -9
- package/esm/auth/orm/mutation/index.js +12 -12
- package/esm/objects/orm/input-types.d.ts +12 -0
- package/esm/public/cli/commands/crypto-address.js +22 -0
- package/esm/public/cli/commands/email.js +22 -0
- package/esm/public/cli/commands/entity-type-provision.js +110 -0
- package/esm/public/cli/commands/identity-provider.d.ts +8 -0
- package/esm/public/cli/commands/identity-provider.js +162 -0
- package/esm/public/cli/commands/identity-providers-module.d.ts +8 -0
- package/esm/public/cli/commands/identity-providers-module.js +316 -0
- package/esm/public/cli/commands/memberships-module.js +44 -0
- package/esm/public/cli/commands/notifications-module.d.ts +8 -0
- package/esm/public/cli/commands/notifications-module.js +448 -0
- package/esm/public/cli/commands/org-membership-default.js +0 -44
- package/esm/public/cli/commands/org-membership-setting.d.ts +8 -0
- package/esm/public/cli/commands/org-membership-setting.js +416 -0
- package/esm/public/cli/commands/phone-number.js +22 -0
- package/esm/public/cli/commands/relation-provision.js +24 -156
- package/esm/public/cli/commands/secure-table-provision.js +24 -156
- package/esm/public/cli/commands/storage-module.js +44 -0
- package/esm/public/cli/commands/webauthn-auth-module.d.ts +8 -0
- package/esm/public/cli/commands/webauthn-auth-module.js +536 -0
- package/esm/public/cli/commands/webauthn-credential.d.ts +8 -0
- package/esm/public/cli/commands/webauthn-credential.js +454 -0
- package/esm/public/cli/commands.js +17 -5
- package/esm/public/cli/executor.d.ts +12 -6
- package/esm/public/orm/index.d.ts +19 -7
- package/esm/public/orm/index.js +14 -2
- package/esm/public/orm/input-types.d.ts +1827 -366
- package/esm/public/orm/input-types.js +7 -0
- package/esm/public/orm/models/identityProvider.d.ts +32 -0
- package/esm/public/orm/models/identityProvider.js +51 -0
- package/esm/public/orm/models/identityProvidersModule.d.ts +56 -0
- package/esm/public/orm/models/identityProvidersModule.js +96 -0
- package/esm/public/orm/models/index.d.ts +7 -1
- package/esm/public/orm/models/index.js +7 -1
- package/esm/public/orm/models/notificationsModule.d.ts +56 -0
- package/esm/public/orm/models/notificationsModule.js +96 -0
- package/esm/public/orm/models/orgMembershipSetting.d.ts +56 -0
- package/esm/public/orm/models/orgMembershipSetting.js +96 -0
- package/esm/public/orm/models/webauthnAuthModule.d.ts +56 -0
- package/esm/public/orm/models/webauthnAuthModule.js +96 -0
- package/esm/public/orm/models/webauthnCredential.d.ts +56 -0
- package/esm/public/orm/models/webauthnCredential.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +9 -9
- package/esm/public/orm/mutation/index.js +12 -12
- package/objects/orm/input-types.d.ts +12 -0
- package/package.json +3 -3
- package/public/cli/commands/crypto-address.js +22 -0
- package/public/cli/commands/email.js +22 -0
- package/public/cli/commands/entity-type-provision.js +110 -0
- package/public/cli/commands/identity-provider.d.ts +8 -0
- package/public/cli/commands/identity-provider.js +164 -0
- package/public/cli/commands/identity-providers-module.d.ts +8 -0
- package/public/cli/commands/identity-providers-module.js +318 -0
- package/public/cli/commands/memberships-module.js +44 -0
- package/public/cli/commands/notifications-module.d.ts +8 -0
- package/public/cli/commands/notifications-module.js +450 -0
- package/public/cli/commands/org-membership-default.js +0 -44
- package/public/cli/commands/org-membership-setting.d.ts +8 -0
- package/public/cli/commands/org-membership-setting.js +418 -0
- package/public/cli/commands/phone-number.js +22 -0
- package/public/cli/commands/relation-provision.js +24 -156
- package/public/cli/commands/secure-table-provision.js +24 -156
- package/public/cli/commands/storage-module.js +44 -0
- package/public/cli/commands/webauthn-auth-module.d.ts +8 -0
- package/public/cli/commands/webauthn-auth-module.js +538 -0
- package/public/cli/commands/webauthn-credential.d.ts +8 -0
- package/public/cli/commands/webauthn-credential.js +456 -0
- package/public/cli/commands.js +17 -5
- package/public/cli/executor.d.ts +12 -6
- package/public/orm/index.d.ts +19 -7
- package/public/orm/index.js +14 -2
- package/public/orm/input-types.d.ts +1827 -366
- package/public/orm/input-types.js +7 -0
- package/public/orm/models/identityProvider.d.ts +32 -0
- package/public/orm/models/identityProvider.js +55 -0
- package/public/orm/models/identityProvidersModule.d.ts +56 -0
- package/public/orm/models/identityProvidersModule.js +100 -0
- package/public/orm/models/index.d.ts +7 -1
- package/public/orm/models/index.js +17 -5
- package/public/orm/models/notificationsModule.d.ts +56 -0
- package/public/orm/models/notificationsModule.js +100 -0
- package/public/orm/models/orgMembershipSetting.d.ts +56 -0
- package/public/orm/models/orgMembershipSetting.js +100 -0
- package/public/orm/models/webauthnAuthModule.d.ts +56 -0
- package/public/orm/models/webauthnAuthModule.js +100 -0
- package/public/orm/models/webauthnCredential.d.ts +56 -0
- package/public/orm/models/webauthnCredential.js +100 -0
- package/public/orm/mutation/index.d.ts +9 -9
- package/public/orm/mutation/index.js +12 -12
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for NotificationsModule
|
|
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
|
+
notificationsTableId: 'uuid',
|
|
15
|
+
eventsTableId: 'uuid',
|
|
16
|
+
preferencesTableId: 'uuid',
|
|
17
|
+
channelsTableId: 'uuid',
|
|
18
|
+
deliveryLogTableId: 'uuid',
|
|
19
|
+
ownerTableId: 'uuid',
|
|
20
|
+
userSettingsTableId: 'uuid',
|
|
21
|
+
organizationSettingsTableId: 'uuid',
|
|
22
|
+
};
|
|
23
|
+
const usage = '\nnotifications-module <command>\n\nCommands:\n list List notificationsModule records\n find-first Find first matching notificationsModule record\n get Get a notificationsModule by ID\n create Create a new notificationsModule\n update Update an existing notificationsModule\n delete Delete a notificationsModule\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';
|
|
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
|
+
notificationsTableId: true,
|
|
70
|
+
eventsTableId: true,
|
|
71
|
+
preferencesTableId: true,
|
|
72
|
+
channelsTableId: true,
|
|
73
|
+
deliveryLogTableId: true,
|
|
74
|
+
ownerTableId: true,
|
|
75
|
+
userSettingsTableId: true,
|
|
76
|
+
organizationSettingsTableId: true,
|
|
77
|
+
};
|
|
78
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
79
|
+
const client = getClient();
|
|
80
|
+
const result = await client.notificationsModule.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
|
+
notificationsTableId: true,
|
|
99
|
+
eventsTableId: true,
|
|
100
|
+
preferencesTableId: true,
|
|
101
|
+
channelsTableId: true,
|
|
102
|
+
deliveryLogTableId: true,
|
|
103
|
+
ownerTableId: true,
|
|
104
|
+
userSettingsTableId: true,
|
|
105
|
+
organizationSettingsTableId: true,
|
|
106
|
+
};
|
|
107
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
108
|
+
const client = getClient();
|
|
109
|
+
const result = await client.notificationsModule.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.notificationsModule
|
|
132
|
+
.findOne({
|
|
133
|
+
id: answers.id,
|
|
134
|
+
select: {
|
|
135
|
+
id: true,
|
|
136
|
+
databaseId: true,
|
|
137
|
+
schemaId: true,
|
|
138
|
+
privateSchemaId: true,
|
|
139
|
+
notificationsTableId: true,
|
|
140
|
+
eventsTableId: true,
|
|
141
|
+
preferencesTableId: true,
|
|
142
|
+
channelsTableId: true,
|
|
143
|
+
deliveryLogTableId: true,
|
|
144
|
+
ownerTableId: true,
|
|
145
|
+
userSettingsTableId: true,
|
|
146
|
+
organizationSettingsTableId: 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: 'notificationsTableId',
|
|
186
|
+
message: 'notificationsTableId',
|
|
187
|
+
required: false,
|
|
188
|
+
skipPrompt: true,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
name: 'eventsTableId',
|
|
193
|
+
message: 'eventsTableId',
|
|
194
|
+
required: false,
|
|
195
|
+
skipPrompt: true,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'text',
|
|
199
|
+
name: 'preferencesTableId',
|
|
200
|
+
message: 'preferencesTableId',
|
|
201
|
+
required: false,
|
|
202
|
+
skipPrompt: true,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
type: 'text',
|
|
206
|
+
name: 'channelsTableId',
|
|
207
|
+
message: 'channelsTableId',
|
|
208
|
+
required: false,
|
|
209
|
+
skipPrompt: true,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: 'text',
|
|
213
|
+
name: 'deliveryLogTableId',
|
|
214
|
+
message: 'deliveryLogTableId',
|
|
215
|
+
required: false,
|
|
216
|
+
skipPrompt: true,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: 'text',
|
|
220
|
+
name: 'ownerTableId',
|
|
221
|
+
message: 'ownerTableId',
|
|
222
|
+
required: false,
|
|
223
|
+
skipPrompt: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'text',
|
|
227
|
+
name: 'userSettingsTableId',
|
|
228
|
+
message: 'userSettingsTableId',
|
|
229
|
+
required: false,
|
|
230
|
+
skipPrompt: true,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
name: 'organizationSettingsTableId',
|
|
235
|
+
message: 'organizationSettingsTableId',
|
|
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.notificationsModule
|
|
244
|
+
.create({
|
|
245
|
+
data: {
|
|
246
|
+
databaseId: cleanedData.databaseId,
|
|
247
|
+
schemaId: cleanedData.schemaId,
|
|
248
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
249
|
+
notificationsTableId: cleanedData.notificationsTableId,
|
|
250
|
+
eventsTableId: cleanedData.eventsTableId,
|
|
251
|
+
preferencesTableId: cleanedData.preferencesTableId,
|
|
252
|
+
channelsTableId: cleanedData.channelsTableId,
|
|
253
|
+
deliveryLogTableId: cleanedData.deliveryLogTableId,
|
|
254
|
+
ownerTableId: cleanedData.ownerTableId,
|
|
255
|
+
userSettingsTableId: cleanedData.userSettingsTableId,
|
|
256
|
+
organizationSettingsTableId: cleanedData.organizationSettingsTableId,
|
|
257
|
+
},
|
|
258
|
+
select: {
|
|
259
|
+
id: true,
|
|
260
|
+
databaseId: true,
|
|
261
|
+
schemaId: true,
|
|
262
|
+
privateSchemaId: true,
|
|
263
|
+
notificationsTableId: true,
|
|
264
|
+
eventsTableId: true,
|
|
265
|
+
preferencesTableId: true,
|
|
266
|
+
channelsTableId: true,
|
|
267
|
+
deliveryLogTableId: true,
|
|
268
|
+
ownerTableId: true,
|
|
269
|
+
userSettingsTableId: true,
|
|
270
|
+
organizationSettingsTableId: 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: 'notificationsTableId',
|
|
316
|
+
message: 'notificationsTableId',
|
|
317
|
+
required: false,
|
|
318
|
+
skipPrompt: true,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
type: 'text',
|
|
322
|
+
name: 'eventsTableId',
|
|
323
|
+
message: 'eventsTableId',
|
|
324
|
+
required: false,
|
|
325
|
+
skipPrompt: true,
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
type: 'text',
|
|
329
|
+
name: 'preferencesTableId',
|
|
330
|
+
message: 'preferencesTableId',
|
|
331
|
+
required: false,
|
|
332
|
+
skipPrompt: true,
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
type: 'text',
|
|
336
|
+
name: 'channelsTableId',
|
|
337
|
+
message: 'channelsTableId',
|
|
338
|
+
required: false,
|
|
339
|
+
skipPrompt: true,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: 'text',
|
|
343
|
+
name: 'deliveryLogTableId',
|
|
344
|
+
message: 'deliveryLogTableId',
|
|
345
|
+
required: false,
|
|
346
|
+
skipPrompt: true,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: 'text',
|
|
350
|
+
name: 'ownerTableId',
|
|
351
|
+
message: 'ownerTableId',
|
|
352
|
+
required: false,
|
|
353
|
+
skipPrompt: true,
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
type: 'text',
|
|
357
|
+
name: 'userSettingsTableId',
|
|
358
|
+
message: 'userSettingsTableId',
|
|
359
|
+
required: false,
|
|
360
|
+
skipPrompt: true,
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
type: 'text',
|
|
364
|
+
name: 'organizationSettingsTableId',
|
|
365
|
+
message: 'organizationSettingsTableId',
|
|
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.notificationsModule
|
|
374
|
+
.update({
|
|
375
|
+
where: {
|
|
376
|
+
id: answers.id,
|
|
377
|
+
},
|
|
378
|
+
data: {
|
|
379
|
+
databaseId: cleanedData.databaseId,
|
|
380
|
+
schemaId: cleanedData.schemaId,
|
|
381
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
382
|
+
notificationsTableId: cleanedData.notificationsTableId,
|
|
383
|
+
eventsTableId: cleanedData.eventsTableId,
|
|
384
|
+
preferencesTableId: cleanedData.preferencesTableId,
|
|
385
|
+
channelsTableId: cleanedData.channelsTableId,
|
|
386
|
+
deliveryLogTableId: cleanedData.deliveryLogTableId,
|
|
387
|
+
ownerTableId: cleanedData.ownerTableId,
|
|
388
|
+
userSettingsTableId: cleanedData.userSettingsTableId,
|
|
389
|
+
organizationSettingsTableId: cleanedData.organizationSettingsTableId,
|
|
390
|
+
},
|
|
391
|
+
select: {
|
|
392
|
+
id: true,
|
|
393
|
+
databaseId: true,
|
|
394
|
+
schemaId: true,
|
|
395
|
+
privateSchemaId: true,
|
|
396
|
+
notificationsTableId: true,
|
|
397
|
+
eventsTableId: true,
|
|
398
|
+
preferencesTableId: true,
|
|
399
|
+
channelsTableId: true,
|
|
400
|
+
deliveryLogTableId: true,
|
|
401
|
+
ownerTableId: true,
|
|
402
|
+
userSettingsTableId: true,
|
|
403
|
+
organizationSettingsTableId: 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.notificationsModule
|
|
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
|
+
}
|
|
@@ -14,8 +14,6 @@ const fieldSchema = {
|
|
|
14
14
|
updatedBy: 'uuid',
|
|
15
15
|
isApproved: 'boolean',
|
|
16
16
|
entityId: 'uuid',
|
|
17
|
-
deleteMemberCascadeGroups: 'boolean',
|
|
18
|
-
createGroupsCascadeMembers: 'boolean',
|
|
19
17
|
};
|
|
20
18
|
const usage = '\norg-membership-default <command>\n\nCommands:\n list List orgMembershipDefault records\n find-first Find first matching orgMembershipDefault record\n get Get a orgMembershipDefault by ID\n create Create a new orgMembershipDefault\n update Update an existing orgMembershipDefault\n delete Delete a orgMembershipDefault\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';
|
|
21
19
|
export default async (argv, prompter, _options) => {
|
|
@@ -66,8 +64,6 @@ async function handleList(argv, _prompter) {
|
|
|
66
64
|
updatedBy: true,
|
|
67
65
|
isApproved: true,
|
|
68
66
|
entityId: true,
|
|
69
|
-
deleteMemberCascadeGroups: true,
|
|
70
|
-
createGroupsCascadeMembers: true,
|
|
71
67
|
};
|
|
72
68
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
73
69
|
const client = getClient();
|
|
@@ -92,8 +88,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
92
88
|
updatedBy: true,
|
|
93
89
|
isApproved: true,
|
|
94
90
|
entityId: true,
|
|
95
|
-
deleteMemberCascadeGroups: true,
|
|
96
|
-
createGroupsCascadeMembers: true,
|
|
97
91
|
};
|
|
98
92
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
99
93
|
const client = getClient();
|
|
@@ -130,8 +124,6 @@ async function handleGet(argv, prompter) {
|
|
|
130
124
|
updatedBy: true,
|
|
131
125
|
isApproved: true,
|
|
132
126
|
entityId: true,
|
|
133
|
-
deleteMemberCascadeGroups: true,
|
|
134
|
-
createGroupsCascadeMembers: true,
|
|
135
127
|
},
|
|
136
128
|
})
|
|
137
129
|
.execute();
|
|
@@ -175,20 +167,6 @@ async function handleCreate(argv, prompter) {
|
|
|
175
167
|
message: 'entityId',
|
|
176
168
|
required: true,
|
|
177
169
|
},
|
|
178
|
-
{
|
|
179
|
-
type: 'boolean',
|
|
180
|
-
name: 'deleteMemberCascadeGroups',
|
|
181
|
-
message: 'deleteMemberCascadeGroups',
|
|
182
|
-
required: false,
|
|
183
|
-
skipPrompt: true,
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
type: 'boolean',
|
|
187
|
-
name: 'createGroupsCascadeMembers',
|
|
188
|
-
message: 'createGroupsCascadeMembers',
|
|
189
|
-
required: false,
|
|
190
|
-
skipPrompt: true,
|
|
191
|
-
},
|
|
192
170
|
]);
|
|
193
171
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
194
172
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -200,8 +178,6 @@ async function handleCreate(argv, prompter) {
|
|
|
200
178
|
updatedBy: cleanedData.updatedBy,
|
|
201
179
|
isApproved: cleanedData.isApproved,
|
|
202
180
|
entityId: cleanedData.entityId,
|
|
203
|
-
deleteMemberCascadeGroups: cleanedData.deleteMemberCascadeGroups,
|
|
204
|
-
createGroupsCascadeMembers: cleanedData.createGroupsCascadeMembers,
|
|
205
181
|
},
|
|
206
182
|
select: {
|
|
207
183
|
id: true,
|
|
@@ -211,8 +187,6 @@ async function handleCreate(argv, prompter) {
|
|
|
211
187
|
updatedBy: true,
|
|
212
188
|
isApproved: true,
|
|
213
189
|
entityId: true,
|
|
214
|
-
deleteMemberCascadeGroups: true,
|
|
215
|
-
createGroupsCascadeMembers: true,
|
|
216
190
|
},
|
|
217
191
|
})
|
|
218
192
|
.execute();
|
|
@@ -262,20 +236,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
262
236
|
message: 'entityId',
|
|
263
237
|
required: false,
|
|
264
238
|
},
|
|
265
|
-
{
|
|
266
|
-
type: 'boolean',
|
|
267
|
-
name: 'deleteMemberCascadeGroups',
|
|
268
|
-
message: 'deleteMemberCascadeGroups',
|
|
269
|
-
required: false,
|
|
270
|
-
skipPrompt: true,
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
type: 'boolean',
|
|
274
|
-
name: 'createGroupsCascadeMembers',
|
|
275
|
-
message: 'createGroupsCascadeMembers',
|
|
276
|
-
required: false,
|
|
277
|
-
skipPrompt: true,
|
|
278
|
-
},
|
|
279
239
|
]);
|
|
280
240
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
281
241
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -290,8 +250,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
290
250
|
updatedBy: cleanedData.updatedBy,
|
|
291
251
|
isApproved: cleanedData.isApproved,
|
|
292
252
|
entityId: cleanedData.entityId,
|
|
293
|
-
deleteMemberCascadeGroups: cleanedData.deleteMemberCascadeGroups,
|
|
294
|
-
createGroupsCascadeMembers: cleanedData.createGroupsCascadeMembers,
|
|
295
253
|
},
|
|
296
254
|
select: {
|
|
297
255
|
id: true,
|
|
@@ -301,8 +259,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
301
259
|
updatedBy: true,
|
|
302
260
|
isApproved: true,
|
|
303
261
|
entityId: true,
|
|
304
|
-
deleteMemberCascadeGroups: true,
|
|
305
|
-
createGroupsCascadeMembers: true,
|
|
306
262
|
},
|
|
307
263
|
})
|
|
308
264
|
.execute();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgMembershipSetting
|
|
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;
|