@constructive-sdk/cli 0.29.0 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/cli/commands/api.js +44 -0
- package/api/cli/commands/check-constraint.js +0 -22
- package/api/cli/commands/composite-type.js +0 -22
- package/api/cli/commands/database-setting.js +44 -0
- package/api/cli/commands/domain.js +66 -0
- package/api/cli/commands/enum.js +0 -22
- package/api/cli/commands/field.js +0 -22
- package/api/cli/commands/foreign-key-constraint.js +0 -22
- package/api/cli/commands/index.js +0 -22
- package/api/cli/commands/policy.js +0 -22
- package/api/cli/commands/primary-key-constraint.js +0 -22
- package/api/cli/commands/schema.js +0 -22
- package/api/cli/commands/site.js +44 -0
- package/api/cli/commands/spatial-relation.js +0 -22
- package/api/cli/commands/table.js +0 -22
- package/api/cli/commands/trigger.js +0 -22
- package/api/cli/commands/unique-constraint.js +0 -22
- package/api/cli/commands/view.js +0 -22
- package/api/orm/input-types.d.ts +144 -171
- package/auth/cli/commands/create-org-api-key.d.ts +8 -0
- package/auth/cli/commands/create-org-api-key.js +36 -0
- package/auth/cli/commands/create-org-principal.d.ts +8 -0
- package/auth/cli/commands/create-org-principal.js +36 -0
- package/auth/cli/commands/delete-org-principal.d.ts +8 -0
- package/auth/cli/commands/delete-org-principal.js +36 -0
- package/auth/cli/commands/org-api-key-list.d.ts +8 -0
- package/auth/cli/commands/org-api-key-list.js +224 -0
- package/auth/cli/commands/principal-entity.d.ts +8 -0
- package/auth/cli/commands/principal-entity.js +282 -0
- package/auth/cli/commands/principal-scope-override.d.ts +8 -0
- package/auth/cli/commands/principal-scope-override.js +171 -0
- package/auth/cli/commands/principal.d.ts +8 -0
- package/auth/cli/commands/principal.js +171 -0
- package/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
- package/auth/cli/commands/revoke-org-api-key.js +36 -0
- package/auth/cli/commands.js +19 -3
- package/auth/cli/executor.d.ts +28 -4
- package/auth/orm/index.d.ts +32 -4
- package/auth/orm/index.js +8 -0
- package/auth/orm/input-types.d.ts +915 -145
- package/auth/orm/input-types.js +7 -0
- package/auth/orm/models/index.d.ts +4 -0
- package/auth/orm/models/index.js +9 -1
- package/auth/orm/models/orgApiKeyList.d.ts +36 -0
- package/auth/orm/models/orgApiKeyList.js +80 -0
- package/auth/orm/models/principal.d.ts +45 -0
- package/auth/orm/models/principal.js +93 -0
- package/auth/orm/models/principalEntity.d.ts +54 -0
- package/auth/orm/models/principalEntity.js +104 -0
- package/auth/orm/models/principalScopeOverride.d.ts +36 -0
- package/auth/orm/models/principalScopeOverride.js +80 -0
- package/auth/orm/mutation/index.d.ts +33 -1
- package/auth/orm/mutation/index.js +48 -0
- package/auth/orm/query/index.d.ts +4 -4
- package/auth/orm/query/index.js +7 -7
- package/compute/cli/commands/function-graph-execution.js +0 -22
- package/compute/cli/commands/function-graph.js +0 -20
- package/compute/cli/commands/platform-namespace-event.d.ts +8 -0
- package/compute/cli/commands/platform-namespace-event.js +510 -0
- package/compute/cli/commands/platform-namespace.d.ts +8 -0
- package/compute/cli/commands/platform-namespace.js +436 -0
- package/compute/cli/commands/resource-event.d.ts +8 -0
- package/compute/cli/commands/resource-event.js +356 -0
- package/compute/cli/commands/resource.d.ts +8 -0
- package/compute/cli/commands/resource.js +520 -0
- package/compute/cli/commands.js +13 -5
- package/compute/cli/executor.d.ts +10 -6
- package/compute/orm/index.d.ts +15 -7
- package/compute/orm/index.js +10 -2
- package/compute/orm/input-types.d.ts +1159 -221
- package/compute/orm/input-types.js +4 -0
- package/compute/orm/models/index.d.ts +5 -1
- package/compute/orm/models/index.js +11 -3
- package/compute/orm/models/platformNamespace.d.ts +54 -0
- package/compute/orm/models/platformNamespace.js +104 -0
- package/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
- package/compute/orm/models/platformNamespaceEvent.js +107 -0
- package/compute/orm/models/resource.d.ts +54 -0
- package/compute/orm/models/resource.js +104 -0
- package/compute/orm/models/resourceEvent.d.ts +56 -0
- package/compute/orm/models/resourceEvent.js +107 -0
- package/compute/orm/mutation/index.d.ts +9 -9
- package/compute/orm/mutation/index.js +12 -12
- package/esm/api/cli/commands/api.js +44 -0
- package/esm/api/cli/commands/check-constraint.js +0 -22
- package/esm/api/cli/commands/composite-type.js +0 -22
- package/esm/api/cli/commands/database-setting.js +44 -0
- package/esm/api/cli/commands/domain.js +66 -0
- package/esm/api/cli/commands/enum.js +0 -22
- package/esm/api/cli/commands/field.js +0 -22
- package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
- package/esm/api/cli/commands/index.js +0 -22
- package/esm/api/cli/commands/policy.js +0 -22
- package/esm/api/cli/commands/primary-key-constraint.js +0 -22
- package/esm/api/cli/commands/schema.js +0 -22
- package/esm/api/cli/commands/site.js +44 -0
- package/esm/api/cli/commands/spatial-relation.js +0 -22
- package/esm/api/cli/commands/table.js +0 -22
- package/esm/api/cli/commands/trigger.js +0 -22
- package/esm/api/cli/commands/unique-constraint.js +0 -22
- package/esm/api/cli/commands/view.js +0 -22
- package/esm/api/orm/input-types.d.ts +144 -171
- package/esm/auth/cli/commands/create-org-api-key.d.ts +8 -0
- package/esm/auth/cli/commands/create-org-api-key.js +34 -0
- package/esm/auth/cli/commands/create-org-principal.d.ts +8 -0
- package/esm/auth/cli/commands/create-org-principal.js +34 -0
- package/esm/auth/cli/commands/delete-org-principal.d.ts +8 -0
- package/esm/auth/cli/commands/delete-org-principal.js +34 -0
- package/esm/auth/cli/commands/org-api-key-list.d.ts +8 -0
- package/esm/auth/cli/commands/org-api-key-list.js +222 -0
- package/esm/auth/cli/commands/principal-entity.d.ts +8 -0
- package/esm/auth/cli/commands/principal-entity.js +280 -0
- package/esm/auth/cli/commands/principal-scope-override.d.ts +8 -0
- package/esm/auth/cli/commands/principal-scope-override.js +169 -0
- package/esm/auth/cli/commands/principal.d.ts +8 -0
- package/esm/auth/cli/commands/principal.js +169 -0
- package/esm/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
- package/esm/auth/cli/commands/revoke-org-api-key.js +34 -0
- package/esm/auth/cli/commands.js +19 -3
- package/esm/auth/cli/executor.d.ts +28 -4
- package/esm/auth/orm/index.d.ts +32 -4
- package/esm/auth/orm/index.js +8 -0
- package/esm/auth/orm/input-types.d.ts +915 -145
- package/esm/auth/orm/input-types.js +7 -0
- package/esm/auth/orm/models/index.d.ts +4 -0
- package/esm/auth/orm/models/index.js +4 -0
- package/esm/auth/orm/models/orgApiKeyList.d.ts +36 -0
- package/esm/auth/orm/models/orgApiKeyList.js +76 -0
- package/esm/auth/orm/models/principal.d.ts +45 -0
- package/esm/auth/orm/models/principal.js +89 -0
- package/esm/auth/orm/models/principalEntity.d.ts +54 -0
- package/esm/auth/orm/models/principalEntity.js +100 -0
- package/esm/auth/orm/models/principalScopeOverride.d.ts +36 -0
- package/esm/auth/orm/models/principalScopeOverride.js +76 -0
- package/esm/auth/orm/mutation/index.d.ts +33 -1
- package/esm/auth/orm/mutation/index.js +48 -0
- package/esm/auth/orm/query/index.d.ts +4 -4
- package/esm/auth/orm/query/index.js +7 -7
- package/esm/compute/cli/commands/function-graph-execution.js +0 -22
- package/esm/compute/cli/commands/function-graph.js +0 -20
- package/esm/compute/cli/commands/platform-namespace-event.d.ts +8 -0
- package/esm/compute/cli/commands/platform-namespace-event.js +508 -0
- package/esm/compute/cli/commands/platform-namespace.d.ts +8 -0
- package/esm/compute/cli/commands/platform-namespace.js +434 -0
- package/esm/compute/cli/commands/resource-event.d.ts +8 -0
- package/esm/compute/cli/commands/resource-event.js +354 -0
- package/esm/compute/cli/commands/resource.d.ts +8 -0
- package/esm/compute/cli/commands/resource.js +518 -0
- package/esm/compute/cli/commands.js +13 -5
- package/esm/compute/cli/executor.d.ts +10 -6
- package/esm/compute/orm/index.d.ts +15 -7
- package/esm/compute/orm/index.js +10 -2
- package/esm/compute/orm/input-types.d.ts +1159 -221
- package/esm/compute/orm/input-types.js +4 -0
- package/esm/compute/orm/models/index.d.ts +5 -1
- package/esm/compute/orm/models/index.js +5 -1
- package/esm/compute/orm/models/platformNamespace.d.ts +54 -0
- package/esm/compute/orm/models/platformNamespace.js +100 -0
- package/esm/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
- package/esm/compute/orm/models/platformNamespaceEvent.js +103 -0
- package/esm/compute/orm/models/resource.d.ts +54 -0
- package/esm/compute/orm/models/resource.js +100 -0
- package/esm/compute/orm/models/resourceEvent.d.ts +56 -0
- package/esm/compute/orm/models/resourceEvent.js +103 -0
- package/esm/compute/orm/mutation/index.d.ts +9 -9
- package/esm/compute/orm/mutation/index.js +12 -12
- package/esm/modules/cli/commands/merkle-store-module.js +22 -0
- package/esm/modules/cli/commands/principal-auth-module.d.ts +8 -0
- package/esm/modules/cli/commands/principal-auth-module.js +580 -0
- package/esm/modules/cli/commands/resource-module.d.ts +8 -0
- package/esm/modules/cli/commands/resource-module.js +602 -0
- package/esm/modules/cli/commands.js +9 -5
- package/esm/modules/cli/executor.d.ts +4 -2
- package/esm/modules/orm/index.d.ts +8 -4
- package/esm/modules/orm/index.js +8 -4
- package/esm/modules/orm/input-types.d.ts +868 -411
- package/esm/modules/orm/models/index.d.ts +4 -2
- package/esm/modules/orm/models/index.js +4 -2
- package/esm/modules/orm/models/principalAuthModule.d.ts +54 -0
- package/esm/modules/orm/models/principalAuthModule.js +100 -0
- package/esm/modules/orm/models/resourceModule.d.ts +54 -0
- package/esm/modules/orm/models/resourceModule.js +100 -0
- package/modules/cli/commands/merkle-store-module.js +22 -0
- package/modules/cli/commands/principal-auth-module.d.ts +8 -0
- package/modules/cli/commands/principal-auth-module.js +582 -0
- package/modules/cli/commands/resource-module.d.ts +8 -0
- package/modules/cli/commands/resource-module.js +604 -0
- package/modules/cli/commands.js +9 -5
- package/modules/cli/executor.d.ts +4 -2
- package/modules/orm/index.d.ts +8 -4
- package/modules/orm/index.js +8 -4
- package/modules/orm/input-types.d.ts +868 -411
- package/modules/orm/models/index.d.ts +4 -2
- package/modules/orm/models/index.js +10 -6
- package/modules/orm/models/principalAuthModule.d.ts +54 -0
- package/modules/orm/models/principalAuthModule.js +104 -0
- package/modules/orm/models/resourceModule.d.ts +54 -0
- package/modules/orm/models/resourceModule.js +104 -0
- package/package.json +5 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command for mutation createOrgApiKey
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const executor_1 = require("../executor");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
exports.default = async (argv, prompter, _options) => {
|
|
6
|
+
try {
|
|
7
|
+
if (argv.help || argv.h) {
|
|
8
|
+
console.log('create-org-api-key - createOrgApiKey\n\nUsage: create-org-api-key [OPTIONS]\n');
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
const answers = await prompter.prompt(argv, [
|
|
12
|
+
{
|
|
13
|
+
type: 'text',
|
|
14
|
+
name: 'input',
|
|
15
|
+
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
]);
|
|
19
|
+
const client = (0, executor_1.getClient)();
|
|
20
|
+
const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
|
|
21
|
+
const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
|
|
22
|
+
const result = await client.mutation
|
|
23
|
+
.createOrgApiKey(parsedAnswers, {
|
|
24
|
+
select: selectFields,
|
|
25
|
+
})
|
|
26
|
+
.execute();
|
|
27
|
+
console.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Failed: createOrgApiKey');
|
|
31
|
+
if (error instanceof Error) {
|
|
32
|
+
console.error(error.message);
|
|
33
|
+
}
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command for mutation createOrgPrincipal
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const executor_1 = require("../executor");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
exports.default = async (argv, prompter, _options) => {
|
|
6
|
+
try {
|
|
7
|
+
if (argv.help || argv.h) {
|
|
8
|
+
console.log('create-org-principal - createOrgPrincipal\n\nUsage: create-org-principal [OPTIONS]\n');
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
const answers = await prompter.prompt(argv, [
|
|
12
|
+
{
|
|
13
|
+
type: 'text',
|
|
14
|
+
name: 'input',
|
|
15
|
+
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
]);
|
|
19
|
+
const client = (0, executor_1.getClient)();
|
|
20
|
+
const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
|
|
21
|
+
const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
|
|
22
|
+
const result = await client.mutation
|
|
23
|
+
.createOrgPrincipal(parsedAnswers, {
|
|
24
|
+
select: selectFields,
|
|
25
|
+
})
|
|
26
|
+
.execute();
|
|
27
|
+
console.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Failed: createOrgPrincipal');
|
|
31
|
+
if (error instanceof Error) {
|
|
32
|
+
console.error(error.message);
|
|
33
|
+
}
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command for mutation deleteOrgPrincipal
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const executor_1 = require("../executor");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
exports.default = async (argv, prompter, _options) => {
|
|
6
|
+
try {
|
|
7
|
+
if (argv.help || argv.h) {
|
|
8
|
+
console.log('delete-org-principal - deleteOrgPrincipal\n\nUsage: delete-org-principal [OPTIONS]\n');
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
const answers = await prompter.prompt(argv, [
|
|
12
|
+
{
|
|
13
|
+
type: 'text',
|
|
14
|
+
name: 'input',
|
|
15
|
+
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
]);
|
|
19
|
+
const client = (0, executor_1.getClient)();
|
|
20
|
+
const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
|
|
21
|
+
const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
|
|
22
|
+
const result = await client.mutation
|
|
23
|
+
.deleteOrgPrincipal(parsedAnswers, {
|
|
24
|
+
select: selectFields,
|
|
25
|
+
})
|
|
26
|
+
.execute();
|
|
27
|
+
console.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Failed: deleteOrgPrincipal');
|
|
31
|
+
if (error instanceof Error) {
|
|
32
|
+
console.error(error.message);
|
|
33
|
+
}
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgApiKeyList
|
|
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;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for OrgApiKeyList
|
|
5
|
+
* @generated by @constructive-io/graphql-codegen
|
|
6
|
+
* DO NOT EDIT - changes will be overwritten
|
|
7
|
+
*/
|
|
8
|
+
const inquirerer_1 = require("inquirerer");
|
|
9
|
+
const executor_1 = require("../executor");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const fieldSchema = {
|
|
12
|
+
id: 'uuid',
|
|
13
|
+
keyId: 'string',
|
|
14
|
+
name: 'string',
|
|
15
|
+
principalId: 'uuid',
|
|
16
|
+
orgId: 'uuid',
|
|
17
|
+
expiresAt: 'string',
|
|
18
|
+
revokedAt: 'string',
|
|
19
|
+
lastUsedAt: 'string',
|
|
20
|
+
mfaLevel: 'string',
|
|
21
|
+
accessLevel: 'string',
|
|
22
|
+
createdAt: 'string',
|
|
23
|
+
updatedAt: 'string',
|
|
24
|
+
};
|
|
25
|
+
const usage = '\norg-api-key-list <command>\n\nCommands:\n list List orgApiKeyList records\n find-first Find first matching orgApiKeyList record\n create Create a new orgApiKeyList\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
26
|
+
exports.default = async (argv, prompter, _options) => {
|
|
27
|
+
if (argv.help || argv.h) {
|
|
28
|
+
console.log(usage);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
32
|
+
if (!subcommand) {
|
|
33
|
+
const answer = await prompter.prompt(argv, [
|
|
34
|
+
{
|
|
35
|
+
type: 'autocomplete',
|
|
36
|
+
name: 'subcommand',
|
|
37
|
+
message: 'What do you want to do?',
|
|
38
|
+
options: ['list', 'find-first', 'create'],
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
42
|
+
}
|
|
43
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
44
|
+
};
|
|
45
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
46
|
+
switch (subcommand) {
|
|
47
|
+
case 'list':
|
|
48
|
+
return handleList(argv, prompter);
|
|
49
|
+
case 'find-first':
|
|
50
|
+
return handleFindFirst(argv, prompter);
|
|
51
|
+
case 'create':
|
|
52
|
+
return handleCreate(argv, prompter);
|
|
53
|
+
default:
|
|
54
|
+
console.log(usage);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
59
|
+
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
keyId: true,
|
|
63
|
+
name: true,
|
|
64
|
+
principalId: true,
|
|
65
|
+
orgId: true,
|
|
66
|
+
expiresAt: true,
|
|
67
|
+
revokedAt: true,
|
|
68
|
+
lastUsedAt: true,
|
|
69
|
+
mfaLevel: true,
|
|
70
|
+
accessLevel: true,
|
|
71
|
+
createdAt: true,
|
|
72
|
+
updatedAt: true,
|
|
73
|
+
};
|
|
74
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
75
|
+
const client = (0, executor_1.getClient)();
|
|
76
|
+
const result = await client.orgApiKeyList.findMany(findManyArgs).execute();
|
|
77
|
+
console.log(JSON.stringify(result, null, 2));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error('Failed to list records.');
|
|
81
|
+
if (error instanceof Error) {
|
|
82
|
+
console.error(error.message);
|
|
83
|
+
}
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function handleFindFirst(argv, _prompter) {
|
|
88
|
+
try {
|
|
89
|
+
const defaultSelect = {
|
|
90
|
+
id: true,
|
|
91
|
+
keyId: true,
|
|
92
|
+
name: true,
|
|
93
|
+
principalId: true,
|
|
94
|
+
orgId: true,
|
|
95
|
+
expiresAt: true,
|
|
96
|
+
revokedAt: true,
|
|
97
|
+
lastUsedAt: true,
|
|
98
|
+
mfaLevel: true,
|
|
99
|
+
accessLevel: true,
|
|
100
|
+
createdAt: true,
|
|
101
|
+
updatedAt: true,
|
|
102
|
+
};
|
|
103
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
104
|
+
const client = (0, executor_1.getClient)();
|
|
105
|
+
const result = await client.orgApiKeyList.findFirst(findFirstArgs).execute();
|
|
106
|
+
console.log(JSON.stringify(result, null, 2));
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error('Failed to find record.');
|
|
110
|
+
if (error instanceof Error) {
|
|
111
|
+
console.error(error.message);
|
|
112
|
+
}
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function handleCreate(argv, prompter) {
|
|
117
|
+
try {
|
|
118
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
119
|
+
{
|
|
120
|
+
type: 'text',
|
|
121
|
+
name: 'keyId',
|
|
122
|
+
message: 'keyId',
|
|
123
|
+
required: false,
|
|
124
|
+
skipPrompt: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: 'text',
|
|
128
|
+
name: 'name',
|
|
129
|
+
message: 'name',
|
|
130
|
+
required: false,
|
|
131
|
+
skipPrompt: true,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: 'text',
|
|
135
|
+
name: 'principalId',
|
|
136
|
+
message: 'principalId',
|
|
137
|
+
required: false,
|
|
138
|
+
skipPrompt: true,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: 'text',
|
|
142
|
+
name: 'orgId',
|
|
143
|
+
message: 'orgId',
|
|
144
|
+
required: false,
|
|
145
|
+
skipPrompt: true,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'text',
|
|
149
|
+
name: 'expiresAt',
|
|
150
|
+
message: 'expiresAt',
|
|
151
|
+
required: false,
|
|
152
|
+
skipPrompt: true,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'text',
|
|
156
|
+
name: 'revokedAt',
|
|
157
|
+
message: 'revokedAt',
|
|
158
|
+
required: false,
|
|
159
|
+
skipPrompt: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'text',
|
|
163
|
+
name: 'lastUsedAt',
|
|
164
|
+
message: 'lastUsedAt',
|
|
165
|
+
required: false,
|
|
166
|
+
skipPrompt: true,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'text',
|
|
170
|
+
name: 'mfaLevel',
|
|
171
|
+
message: 'mfaLevel',
|
|
172
|
+
required: false,
|
|
173
|
+
skipPrompt: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'text',
|
|
177
|
+
name: 'accessLevel',
|
|
178
|
+
message: 'accessLevel',
|
|
179
|
+
required: false,
|
|
180
|
+
skipPrompt: true,
|
|
181
|
+
},
|
|
182
|
+
]);
|
|
183
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
184
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
185
|
+
const client = (0, executor_1.getClient)();
|
|
186
|
+
const result = await client.orgApiKeyList
|
|
187
|
+
.create({
|
|
188
|
+
data: {
|
|
189
|
+
keyId: cleanedData.keyId,
|
|
190
|
+
name: cleanedData.name,
|
|
191
|
+
principalId: cleanedData.principalId,
|
|
192
|
+
orgId: cleanedData.orgId,
|
|
193
|
+
expiresAt: cleanedData.expiresAt,
|
|
194
|
+
revokedAt: cleanedData.revokedAt,
|
|
195
|
+
lastUsedAt: cleanedData.lastUsedAt,
|
|
196
|
+
mfaLevel: cleanedData.mfaLevel,
|
|
197
|
+
accessLevel: cleanedData.accessLevel,
|
|
198
|
+
},
|
|
199
|
+
select: {
|
|
200
|
+
id: true,
|
|
201
|
+
keyId: true,
|
|
202
|
+
name: true,
|
|
203
|
+
principalId: true,
|
|
204
|
+
orgId: true,
|
|
205
|
+
expiresAt: true,
|
|
206
|
+
revokedAt: true,
|
|
207
|
+
lastUsedAt: true,
|
|
208
|
+
mfaLevel: true,
|
|
209
|
+
accessLevel: true,
|
|
210
|
+
createdAt: true,
|
|
211
|
+
updatedAt: true,
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
.execute();
|
|
215
|
+
console.log(JSON.stringify(result, null, 2));
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.error('Failed to create record.');
|
|
219
|
+
if (error instanceof Error) {
|
|
220
|
+
console.error(error.message);
|
|
221
|
+
}
|
|
222
|
+
process.exit(1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for PrincipalEntity
|
|
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;
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for PrincipalEntity
|
|
5
|
+
* @generated by @constructive-io/graphql-codegen
|
|
6
|
+
* DO NOT EDIT - changes will be overwritten
|
|
7
|
+
*/
|
|
8
|
+
const inquirerer_1 = require("inquirerer");
|
|
9
|
+
const executor_1 = require("../executor");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const fieldSchema = {
|
|
12
|
+
id: 'uuid',
|
|
13
|
+
createdAt: 'string',
|
|
14
|
+
updatedAt: 'string',
|
|
15
|
+
principalId: 'uuid',
|
|
16
|
+
entityId: 'uuid',
|
|
17
|
+
ownerId: 'uuid',
|
|
18
|
+
};
|
|
19
|
+
const usage = '\nprincipal-entity <command>\n\nCommands:\n list List principalEntity records\n find-first Find first matching principalEntity record\n get Get a principalEntity by ID\n create Create a new principalEntity\n update Update an existing principalEntity\n delete Delete a principalEntity\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
20
|
+
exports.default = async (argv, prompter, _options) => {
|
|
21
|
+
if (argv.help || argv.h) {
|
|
22
|
+
console.log(usage);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
26
|
+
if (!subcommand) {
|
|
27
|
+
const answer = await prompter.prompt(argv, [
|
|
28
|
+
{
|
|
29
|
+
type: 'autocomplete',
|
|
30
|
+
name: 'subcommand',
|
|
31
|
+
message: 'What do you want to do?',
|
|
32
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
36
|
+
}
|
|
37
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
38
|
+
};
|
|
39
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
40
|
+
switch (subcommand) {
|
|
41
|
+
case 'list':
|
|
42
|
+
return handleList(argv, prompter);
|
|
43
|
+
case 'find-first':
|
|
44
|
+
return handleFindFirst(argv, prompter);
|
|
45
|
+
case 'get':
|
|
46
|
+
return handleGet(argv, prompter);
|
|
47
|
+
case 'create':
|
|
48
|
+
return handleCreate(argv, prompter);
|
|
49
|
+
case 'update':
|
|
50
|
+
return handleUpdate(argv, prompter);
|
|
51
|
+
case 'delete':
|
|
52
|
+
return handleDelete(argv, prompter);
|
|
53
|
+
default:
|
|
54
|
+
console.log(usage);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
59
|
+
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
createdAt: true,
|
|
63
|
+
updatedAt: true,
|
|
64
|
+
principalId: true,
|
|
65
|
+
entityId: true,
|
|
66
|
+
ownerId: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
69
|
+
const client = (0, executor_1.getClient)();
|
|
70
|
+
const result = await client.principalEntity.findMany(findManyArgs).execute();
|
|
71
|
+
console.log(JSON.stringify(result, null, 2));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error('Failed to list records.');
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
console.error(error.message);
|
|
77
|
+
}
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function handleFindFirst(argv, _prompter) {
|
|
82
|
+
try {
|
|
83
|
+
const defaultSelect = {
|
|
84
|
+
id: true,
|
|
85
|
+
createdAt: true,
|
|
86
|
+
updatedAt: true,
|
|
87
|
+
principalId: true,
|
|
88
|
+
entityId: true,
|
|
89
|
+
ownerId: true,
|
|
90
|
+
};
|
|
91
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
92
|
+
const client = (0, executor_1.getClient)();
|
|
93
|
+
const result = await client.principalEntity.findFirst(findFirstArgs).execute();
|
|
94
|
+
console.log(JSON.stringify(result, null, 2));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Failed to find record.');
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
console.error(error.message);
|
|
100
|
+
}
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function handleGet(argv, prompter) {
|
|
105
|
+
try {
|
|
106
|
+
const answers = await prompter.prompt(argv, [
|
|
107
|
+
{
|
|
108
|
+
type: 'text',
|
|
109
|
+
name: 'id',
|
|
110
|
+
message: 'id',
|
|
111
|
+
required: true,
|
|
112
|
+
},
|
|
113
|
+
]);
|
|
114
|
+
const client = (0, executor_1.getClient)();
|
|
115
|
+
const result = await client.principalEntity
|
|
116
|
+
.findOne({
|
|
117
|
+
id: answers.id,
|
|
118
|
+
select: {
|
|
119
|
+
id: true,
|
|
120
|
+
createdAt: true,
|
|
121
|
+
updatedAt: true,
|
|
122
|
+
principalId: true,
|
|
123
|
+
entityId: true,
|
|
124
|
+
ownerId: true,
|
|
125
|
+
},
|
|
126
|
+
})
|
|
127
|
+
.execute();
|
|
128
|
+
console.log(JSON.stringify(result, null, 2));
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error('Record not found.');
|
|
132
|
+
if (error instanceof Error) {
|
|
133
|
+
console.error(error.message);
|
|
134
|
+
}
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function handleCreate(argv, prompter) {
|
|
139
|
+
try {
|
|
140
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
141
|
+
{
|
|
142
|
+
type: 'text',
|
|
143
|
+
name: 'principalId',
|
|
144
|
+
message: 'principalId',
|
|
145
|
+
required: true,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'text',
|
|
149
|
+
name: 'entityId',
|
|
150
|
+
message: 'entityId',
|
|
151
|
+
required: true,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: 'text',
|
|
155
|
+
name: 'ownerId',
|
|
156
|
+
message: 'ownerId',
|
|
157
|
+
required: true,
|
|
158
|
+
},
|
|
159
|
+
]);
|
|
160
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
161
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
162
|
+
const client = (0, executor_1.getClient)();
|
|
163
|
+
const result = await client.principalEntity
|
|
164
|
+
.create({
|
|
165
|
+
data: {
|
|
166
|
+
principalId: cleanedData.principalId,
|
|
167
|
+
entityId: cleanedData.entityId,
|
|
168
|
+
ownerId: cleanedData.ownerId,
|
|
169
|
+
},
|
|
170
|
+
select: {
|
|
171
|
+
id: true,
|
|
172
|
+
createdAt: true,
|
|
173
|
+
updatedAt: true,
|
|
174
|
+
principalId: true,
|
|
175
|
+
entityId: true,
|
|
176
|
+
ownerId: true,
|
|
177
|
+
},
|
|
178
|
+
})
|
|
179
|
+
.execute();
|
|
180
|
+
console.log(JSON.stringify(result, null, 2));
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
console.error('Failed to create record.');
|
|
184
|
+
if (error instanceof Error) {
|
|
185
|
+
console.error(error.message);
|
|
186
|
+
}
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async function handleUpdate(argv, prompter) {
|
|
191
|
+
try {
|
|
192
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
193
|
+
{
|
|
194
|
+
type: 'text',
|
|
195
|
+
name: 'id',
|
|
196
|
+
message: 'id',
|
|
197
|
+
required: true,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
type: 'text',
|
|
201
|
+
name: 'principalId',
|
|
202
|
+
message: 'principalId',
|
|
203
|
+
required: false,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
type: 'text',
|
|
207
|
+
name: 'entityId',
|
|
208
|
+
message: 'entityId',
|
|
209
|
+
required: false,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: 'text',
|
|
213
|
+
name: 'ownerId',
|
|
214
|
+
message: 'ownerId',
|
|
215
|
+
required: false,
|
|
216
|
+
},
|
|
217
|
+
]);
|
|
218
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
219
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
220
|
+
const client = (0, executor_1.getClient)();
|
|
221
|
+
const result = await client.principalEntity
|
|
222
|
+
.update({
|
|
223
|
+
where: {
|
|
224
|
+
id: answers.id,
|
|
225
|
+
},
|
|
226
|
+
data: {
|
|
227
|
+
principalId: cleanedData.principalId,
|
|
228
|
+
entityId: cleanedData.entityId,
|
|
229
|
+
ownerId: cleanedData.ownerId,
|
|
230
|
+
},
|
|
231
|
+
select: {
|
|
232
|
+
id: true,
|
|
233
|
+
createdAt: true,
|
|
234
|
+
updatedAt: true,
|
|
235
|
+
principalId: true,
|
|
236
|
+
entityId: true,
|
|
237
|
+
ownerId: true,
|
|
238
|
+
},
|
|
239
|
+
})
|
|
240
|
+
.execute();
|
|
241
|
+
console.log(JSON.stringify(result, null, 2));
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
console.error('Failed to update record.');
|
|
245
|
+
if (error instanceof Error) {
|
|
246
|
+
console.error(error.message);
|
|
247
|
+
}
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async function handleDelete(argv, prompter) {
|
|
252
|
+
try {
|
|
253
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
254
|
+
{
|
|
255
|
+
type: 'text',
|
|
256
|
+
name: 'id',
|
|
257
|
+
message: 'id',
|
|
258
|
+
required: true,
|
|
259
|
+
},
|
|
260
|
+
]);
|
|
261
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
262
|
+
const client = (0, executor_1.getClient)();
|
|
263
|
+
const result = await client.principalEntity
|
|
264
|
+
.delete({
|
|
265
|
+
where: {
|
|
266
|
+
id: answers.id,
|
|
267
|
+
},
|
|
268
|
+
select: {
|
|
269
|
+
id: true,
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
.execute();
|
|
273
|
+
console.log(JSON.stringify(result, null, 2));
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
console.error('Failed to delete record.');
|
|
277
|
+
if (error instanceof Error) {
|
|
278
|
+
console.error(error.message);
|
|
279
|
+
}
|
|
280
|
+
process.exit(1);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for PrincipalScopeOverride
|
|
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;
|