@constructive-sdk/cli 0.29.1 → 0.29.3

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.
Files changed (199) hide show
  1. package/api/cli/commands/api.js +44 -0
  2. package/api/cli/commands/check-constraint.js +0 -22
  3. package/api/cli/commands/composite-type.js +0 -22
  4. package/api/cli/commands/database-setting.js +44 -0
  5. package/api/cli/commands/domain.js +66 -0
  6. package/api/cli/commands/enum.js +0 -22
  7. package/api/cli/commands/field.js +0 -22
  8. package/api/cli/commands/foreign-key-constraint.js +0 -22
  9. package/api/cli/commands/index.js +0 -22
  10. package/api/cli/commands/policy.js +0 -22
  11. package/api/cli/commands/primary-key-constraint.js +0 -22
  12. package/api/cli/commands/schema.js +0 -22
  13. package/api/cli/commands/site.js +44 -0
  14. package/api/cli/commands/spatial-relation.js +0 -22
  15. package/api/cli/commands/table.js +0 -22
  16. package/api/cli/commands/trigger.js +0 -22
  17. package/api/cli/commands/unique-constraint.js +0 -22
  18. package/api/cli/commands/view.js +0 -22
  19. package/api/orm/input-types.d.ts +144 -171
  20. package/auth/cli/commands/create-org-api-key.d.ts +8 -0
  21. package/auth/cli/commands/create-org-api-key.js +36 -0
  22. package/auth/cli/commands/create-org-principal.d.ts +8 -0
  23. package/auth/cli/commands/create-org-principal.js +36 -0
  24. package/auth/cli/commands/delete-org-principal.d.ts +8 -0
  25. package/auth/cli/commands/delete-org-principal.js +36 -0
  26. package/auth/cli/commands/org-api-key-list.d.ts +8 -0
  27. package/auth/cli/commands/org-api-key-list.js +224 -0
  28. package/auth/cli/commands/principal-entity.d.ts +8 -0
  29. package/auth/cli/commands/principal-entity.js +282 -0
  30. package/auth/cli/commands/principal-scope-override.d.ts +8 -0
  31. package/auth/cli/commands/principal-scope-override.js +171 -0
  32. package/auth/cli/commands/principal.d.ts +8 -0
  33. package/auth/cli/commands/principal.js +171 -0
  34. package/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
  35. package/auth/cli/commands/revoke-org-api-key.js +36 -0
  36. package/auth/cli/commands.js +19 -3
  37. package/auth/cli/executor.d.ts +28 -4
  38. package/auth/orm/index.d.ts +32 -4
  39. package/auth/orm/index.js +8 -0
  40. package/auth/orm/input-types.d.ts +915 -145
  41. package/auth/orm/input-types.js +7 -0
  42. package/auth/orm/models/index.d.ts +4 -0
  43. package/auth/orm/models/index.js +9 -1
  44. package/auth/orm/models/orgApiKeyList.d.ts +36 -0
  45. package/auth/orm/models/orgApiKeyList.js +80 -0
  46. package/auth/orm/models/principal.d.ts +45 -0
  47. package/auth/orm/models/principal.js +93 -0
  48. package/auth/orm/models/principalEntity.d.ts +54 -0
  49. package/auth/orm/models/principalEntity.js +104 -0
  50. package/auth/orm/models/principalScopeOverride.d.ts +36 -0
  51. package/auth/orm/models/principalScopeOverride.js +80 -0
  52. package/auth/orm/mutation/index.d.ts +33 -1
  53. package/auth/orm/mutation/index.js +48 -0
  54. package/auth/orm/query/index.d.ts +4 -4
  55. package/auth/orm/query/index.js +7 -7
  56. package/compute/cli/commands/function-graph-execution.js +0 -22
  57. package/compute/cli/commands/function-graph.js +0 -20
  58. package/compute/cli/commands/platform-namespace-event.d.ts +8 -0
  59. package/compute/cli/commands/platform-namespace-event.js +510 -0
  60. package/compute/cli/commands/platform-namespace.d.ts +8 -0
  61. package/compute/cli/commands/platform-namespace.js +436 -0
  62. package/compute/cli/commands/resource-event.d.ts +8 -0
  63. package/compute/cli/commands/resource-event.js +356 -0
  64. package/compute/cli/commands/resource.d.ts +8 -0
  65. package/compute/cli/commands/resource.js +520 -0
  66. package/compute/cli/commands.js +13 -5
  67. package/compute/cli/executor.d.ts +10 -6
  68. package/compute/orm/index.d.ts +15 -7
  69. package/compute/orm/index.js +10 -2
  70. package/compute/orm/input-types.d.ts +1159 -221
  71. package/compute/orm/input-types.js +4 -0
  72. package/compute/orm/models/index.d.ts +5 -1
  73. package/compute/orm/models/index.js +11 -3
  74. package/compute/orm/models/platformNamespace.d.ts +54 -0
  75. package/compute/orm/models/platformNamespace.js +104 -0
  76. package/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
  77. package/compute/orm/models/platformNamespaceEvent.js +107 -0
  78. package/compute/orm/models/resource.d.ts +54 -0
  79. package/compute/orm/models/resource.js +104 -0
  80. package/compute/orm/models/resourceEvent.d.ts +56 -0
  81. package/compute/orm/models/resourceEvent.js +107 -0
  82. package/compute/orm/mutation/index.d.ts +9 -9
  83. package/compute/orm/mutation/index.js +12 -12
  84. package/esm/api/cli/commands/api.js +44 -0
  85. package/esm/api/cli/commands/check-constraint.js +0 -22
  86. package/esm/api/cli/commands/composite-type.js +0 -22
  87. package/esm/api/cli/commands/database-setting.js +44 -0
  88. package/esm/api/cli/commands/domain.js +66 -0
  89. package/esm/api/cli/commands/enum.js +0 -22
  90. package/esm/api/cli/commands/field.js +0 -22
  91. package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
  92. package/esm/api/cli/commands/index.js +0 -22
  93. package/esm/api/cli/commands/policy.js +0 -22
  94. package/esm/api/cli/commands/primary-key-constraint.js +0 -22
  95. package/esm/api/cli/commands/schema.js +0 -22
  96. package/esm/api/cli/commands/site.js +44 -0
  97. package/esm/api/cli/commands/spatial-relation.js +0 -22
  98. package/esm/api/cli/commands/table.js +0 -22
  99. package/esm/api/cli/commands/trigger.js +0 -22
  100. package/esm/api/cli/commands/unique-constraint.js +0 -22
  101. package/esm/api/cli/commands/view.js +0 -22
  102. package/esm/api/orm/input-types.d.ts +144 -171
  103. package/esm/auth/cli/commands/create-org-api-key.d.ts +8 -0
  104. package/esm/auth/cli/commands/create-org-api-key.js +34 -0
  105. package/esm/auth/cli/commands/create-org-principal.d.ts +8 -0
  106. package/esm/auth/cli/commands/create-org-principal.js +34 -0
  107. package/esm/auth/cli/commands/delete-org-principal.d.ts +8 -0
  108. package/esm/auth/cli/commands/delete-org-principal.js +34 -0
  109. package/esm/auth/cli/commands/org-api-key-list.d.ts +8 -0
  110. package/esm/auth/cli/commands/org-api-key-list.js +222 -0
  111. package/esm/auth/cli/commands/principal-entity.d.ts +8 -0
  112. package/esm/auth/cli/commands/principal-entity.js +280 -0
  113. package/esm/auth/cli/commands/principal-scope-override.d.ts +8 -0
  114. package/esm/auth/cli/commands/principal-scope-override.js +169 -0
  115. package/esm/auth/cli/commands/principal.d.ts +8 -0
  116. package/esm/auth/cli/commands/principal.js +169 -0
  117. package/esm/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
  118. package/esm/auth/cli/commands/revoke-org-api-key.js +34 -0
  119. package/esm/auth/cli/commands.js +19 -3
  120. package/esm/auth/cli/executor.d.ts +28 -4
  121. package/esm/auth/orm/index.d.ts +32 -4
  122. package/esm/auth/orm/index.js +8 -0
  123. package/esm/auth/orm/input-types.d.ts +915 -145
  124. package/esm/auth/orm/input-types.js +7 -0
  125. package/esm/auth/orm/models/index.d.ts +4 -0
  126. package/esm/auth/orm/models/index.js +4 -0
  127. package/esm/auth/orm/models/orgApiKeyList.d.ts +36 -0
  128. package/esm/auth/orm/models/orgApiKeyList.js +76 -0
  129. package/esm/auth/orm/models/principal.d.ts +45 -0
  130. package/esm/auth/orm/models/principal.js +89 -0
  131. package/esm/auth/orm/models/principalEntity.d.ts +54 -0
  132. package/esm/auth/orm/models/principalEntity.js +100 -0
  133. package/esm/auth/orm/models/principalScopeOverride.d.ts +36 -0
  134. package/esm/auth/orm/models/principalScopeOverride.js +76 -0
  135. package/esm/auth/orm/mutation/index.d.ts +33 -1
  136. package/esm/auth/orm/mutation/index.js +48 -0
  137. package/esm/auth/orm/query/index.d.ts +4 -4
  138. package/esm/auth/orm/query/index.js +7 -7
  139. package/esm/compute/cli/commands/function-graph-execution.js +0 -22
  140. package/esm/compute/cli/commands/function-graph.js +0 -20
  141. package/esm/compute/cli/commands/platform-namespace-event.d.ts +8 -0
  142. package/esm/compute/cli/commands/platform-namespace-event.js +508 -0
  143. package/esm/compute/cli/commands/platform-namespace.d.ts +8 -0
  144. package/esm/compute/cli/commands/platform-namespace.js +434 -0
  145. package/esm/compute/cli/commands/resource-event.d.ts +8 -0
  146. package/esm/compute/cli/commands/resource-event.js +354 -0
  147. package/esm/compute/cli/commands/resource.d.ts +8 -0
  148. package/esm/compute/cli/commands/resource.js +518 -0
  149. package/esm/compute/cli/commands.js +13 -5
  150. package/esm/compute/cli/executor.d.ts +10 -6
  151. package/esm/compute/orm/index.d.ts +15 -7
  152. package/esm/compute/orm/index.js +10 -2
  153. package/esm/compute/orm/input-types.d.ts +1159 -221
  154. package/esm/compute/orm/input-types.js +4 -0
  155. package/esm/compute/orm/models/index.d.ts +5 -1
  156. package/esm/compute/orm/models/index.js +5 -1
  157. package/esm/compute/orm/models/platformNamespace.d.ts +54 -0
  158. package/esm/compute/orm/models/platformNamespace.js +100 -0
  159. package/esm/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
  160. package/esm/compute/orm/models/platformNamespaceEvent.js +103 -0
  161. package/esm/compute/orm/models/resource.d.ts +54 -0
  162. package/esm/compute/orm/models/resource.js +100 -0
  163. package/esm/compute/orm/models/resourceEvent.d.ts +56 -0
  164. package/esm/compute/orm/models/resourceEvent.js +103 -0
  165. package/esm/compute/orm/mutation/index.d.ts +9 -9
  166. package/esm/compute/orm/mutation/index.js +12 -12
  167. package/esm/modules/cli/commands/merkle-store-module.js +22 -0
  168. package/esm/modules/cli/commands/principal-auth-module.d.ts +8 -0
  169. package/esm/modules/cli/commands/principal-auth-module.js +580 -0
  170. package/esm/modules/cli/commands/resource-module.d.ts +8 -0
  171. package/esm/modules/cli/commands/resource-module.js +602 -0
  172. package/esm/modules/cli/commands.js +9 -5
  173. package/esm/modules/cli/executor.d.ts +4 -2
  174. package/esm/modules/orm/index.d.ts +8 -4
  175. package/esm/modules/orm/index.js +8 -4
  176. package/esm/modules/orm/input-types.d.ts +868 -411
  177. package/esm/modules/orm/models/index.d.ts +4 -2
  178. package/esm/modules/orm/models/index.js +4 -2
  179. package/esm/modules/orm/models/principalAuthModule.d.ts +54 -0
  180. package/esm/modules/orm/models/principalAuthModule.js +100 -0
  181. package/esm/modules/orm/models/resourceModule.d.ts +54 -0
  182. package/esm/modules/orm/models/resourceModule.js +100 -0
  183. package/modules/cli/commands/merkle-store-module.js +22 -0
  184. package/modules/cli/commands/principal-auth-module.d.ts +8 -0
  185. package/modules/cli/commands/principal-auth-module.js +582 -0
  186. package/modules/cli/commands/resource-module.d.ts +8 -0
  187. package/modules/cli/commands/resource-module.js +604 -0
  188. package/modules/cli/commands.js +9 -5
  189. package/modules/cli/executor.d.ts +4 -2
  190. package/modules/orm/index.d.ts +8 -4
  191. package/modules/orm/index.js +8 -4
  192. package/modules/orm/input-types.d.ts +868 -411
  193. package/modules/orm/models/index.d.ts +4 -2
  194. package/modules/orm/models/index.js +10 -6
  195. package/modules/orm/models/principalAuthModule.d.ts +54 -0
  196. package/modules/orm/models/principalAuthModule.js +104 -0
  197. package/modules/orm/models/resourceModule.d.ts +54 -0
  198. package/modules/orm/models/resourceModule.js +104 -0
  199. package/package.json +5 -5
@@ -0,0 +1,169 @@
1
+ /**
2
+ * CLI commands for PrincipalScopeOverride
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
+ createdAt: 'string',
12
+ updatedAt: 'string',
13
+ principalId: 'uuid',
14
+ membershipType: 'int',
15
+ allowedMask: 'string',
16
+ isAdmin: 'boolean',
17
+ isReadOnly: 'boolean',
18
+ };
19
+ const usage = '\nprincipal-scope-override <command>\n\nCommands:\n list List principalScopeOverride records\n find-first Find first matching principalScopeOverride record\n create Create a new principalScopeOverride\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
+ export 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 } = 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', 'create'],
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 'create':
46
+ return handleCreate(argv, prompter);
47
+ default:
48
+ console.log(usage);
49
+ process.exit(1);
50
+ }
51
+ }
52
+ async function handleList(argv, _prompter) {
53
+ try {
54
+ const defaultSelect = {
55
+ id: true,
56
+ createdAt: true,
57
+ updatedAt: true,
58
+ principalId: true,
59
+ membershipType: true,
60
+ allowedMask: true,
61
+ isAdmin: true,
62
+ isReadOnly: true,
63
+ };
64
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
65
+ const client = getClient();
66
+ const result = await client.principalScopeOverride.findMany(findManyArgs).execute();
67
+ console.log(JSON.stringify(result, null, 2));
68
+ }
69
+ catch (error) {
70
+ console.error('Failed to list records.');
71
+ if (error instanceof Error) {
72
+ console.error(error.message);
73
+ }
74
+ process.exit(1);
75
+ }
76
+ }
77
+ async function handleFindFirst(argv, _prompter) {
78
+ try {
79
+ const defaultSelect = {
80
+ id: true,
81
+ createdAt: true,
82
+ updatedAt: true,
83
+ principalId: true,
84
+ membershipType: true,
85
+ allowedMask: true,
86
+ isAdmin: true,
87
+ isReadOnly: true,
88
+ };
89
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
90
+ const client = getClient();
91
+ const result = await client.principalScopeOverride.findFirst(findFirstArgs).execute();
92
+ console.log(JSON.stringify(result, null, 2));
93
+ }
94
+ catch (error) {
95
+ console.error('Failed to find record.');
96
+ if (error instanceof Error) {
97
+ console.error(error.message);
98
+ }
99
+ process.exit(1);
100
+ }
101
+ }
102
+ async function handleCreate(argv, prompter) {
103
+ try {
104
+ const rawAnswers = await prompter.prompt(argv, [
105
+ {
106
+ type: 'text',
107
+ name: 'principalId',
108
+ message: 'principalId',
109
+ required: true,
110
+ },
111
+ {
112
+ type: 'text',
113
+ name: 'membershipType',
114
+ message: 'membershipType',
115
+ required: true,
116
+ },
117
+ {
118
+ type: 'text',
119
+ name: 'allowedMask',
120
+ message: 'allowedMask',
121
+ required: true,
122
+ },
123
+ {
124
+ type: 'boolean',
125
+ name: 'isAdmin',
126
+ message: 'isAdmin',
127
+ required: true,
128
+ },
129
+ {
130
+ type: 'boolean',
131
+ name: 'isReadOnly',
132
+ message: 'isReadOnly',
133
+ required: true,
134
+ },
135
+ ]);
136
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
137
+ const cleanedData = stripUndefined(answers, fieldSchema);
138
+ const client = getClient();
139
+ const result = await client.principalScopeOverride
140
+ .create({
141
+ data: {
142
+ principalId: cleanedData.principalId,
143
+ membershipType: cleanedData.membershipType,
144
+ allowedMask: cleanedData.allowedMask,
145
+ isAdmin: cleanedData.isAdmin,
146
+ isReadOnly: cleanedData.isReadOnly,
147
+ },
148
+ select: {
149
+ id: true,
150
+ createdAt: true,
151
+ updatedAt: true,
152
+ principalId: true,
153
+ membershipType: true,
154
+ allowedMask: true,
155
+ isAdmin: true,
156
+ isReadOnly: true,
157
+ },
158
+ })
159
+ .execute();
160
+ console.log(JSON.stringify(result, null, 2));
161
+ }
162
+ catch (error) {
163
+ console.error('Failed to create record.');
164
+ if (error instanceof Error) {
165
+ console.error(error.message);
166
+ }
167
+ process.exit(1);
168
+ }
169
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for Principal
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,169 @@
1
+ /**
2
+ * CLI commands for Principal
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
+ createdAt: "string",
12
+ updatedAt: "string",
13
+ ownerId: "uuid",
14
+ userId: "uuid",
15
+ name: "string",
16
+ allowedMask: "string",
17
+ isReadOnly: "boolean",
18
+ bypassStepUp: "boolean"
19
+ };
20
+ const usage = "\nprincipal <command>\n\nCommands:\n list List principal records\n find-first Find first matching principal record\n create Create a new principal\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";
21
+ export default async (argv, prompter, _options) => {
22
+ if (argv.help || argv.h) {
23
+ console.log(usage);
24
+ process.exit(0);
25
+ }
26
+ const { first: subcommand, newArgv } = extractFirst(argv);
27
+ if (!subcommand) {
28
+ const answer = await prompter.prompt(argv, [{
29
+ type: "autocomplete",
30
+ name: "subcommand",
31
+ message: "What do you want to do?",
32
+ options: ["list", "find-first", "create"]
33
+ }]);
34
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
35
+ }
36
+ return handleTableSubcommand(subcommand, newArgv, prompter);
37
+ };
38
+ async function handleTableSubcommand(subcommand, argv, prompter) {
39
+ switch (subcommand) {
40
+ case "list":
41
+ return handleList(argv, prompter);
42
+ case "find-first":
43
+ return handleFindFirst(argv, prompter);
44
+ case "create":
45
+ return handleCreate(argv, prompter);
46
+ default:
47
+ console.log(usage);
48
+ process.exit(1);
49
+ }
50
+ }
51
+ async function handleList(argv, _prompter) {
52
+ try {
53
+ const defaultSelect = {
54
+ id: true,
55
+ createdAt: true,
56
+ updatedAt: true,
57
+ ownerId: true,
58
+ userId: true,
59
+ name: true,
60
+ allowedMask: true,
61
+ isReadOnly: true,
62
+ bypassStepUp: true
63
+ };
64
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
65
+ const client = getClient();
66
+ const result = await client.principal.findMany(findManyArgs).execute();
67
+ console.log(JSON.stringify(result, null, 2));
68
+ }
69
+ catch (error) {
70
+ console.error("Failed to list records.");
71
+ if (error instanceof Error) {
72
+ console.error(error.message);
73
+ }
74
+ process.exit(1);
75
+ }
76
+ }
77
+ async function handleFindFirst(argv, _prompter) {
78
+ try {
79
+ const defaultSelect = {
80
+ id: true,
81
+ createdAt: true,
82
+ updatedAt: true,
83
+ ownerId: true,
84
+ userId: true,
85
+ name: true,
86
+ allowedMask: true,
87
+ isReadOnly: true,
88
+ bypassStepUp: true
89
+ };
90
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
91
+ const client = getClient();
92
+ const result = await client.principal.findFirst(findFirstArgs).execute();
93
+ console.log(JSON.stringify(result, null, 2));
94
+ }
95
+ catch (error) {
96
+ console.error("Failed to find record.");
97
+ if (error instanceof Error) {
98
+ console.error(error.message);
99
+ }
100
+ process.exit(1);
101
+ }
102
+ }
103
+ async function handleCreate(argv, prompter) {
104
+ try {
105
+ const rawAnswers = await prompter.prompt(argv, [{
106
+ type: "text",
107
+ name: "ownerId",
108
+ message: "ownerId",
109
+ required: true
110
+ }, {
111
+ type: "text",
112
+ name: "userId",
113
+ message: "userId",
114
+ required: true
115
+ }, {
116
+ type: "text",
117
+ name: "name",
118
+ message: "name",
119
+ required: true
120
+ }, {
121
+ type: "text",
122
+ name: "allowedMask",
123
+ message: "allowedMask",
124
+ required: true
125
+ }, {
126
+ type: "boolean",
127
+ name: "isReadOnly",
128
+ message: "isReadOnly",
129
+ required: true
130
+ }, {
131
+ type: "boolean",
132
+ name: "bypassStepUp",
133
+ message: "bypassStepUp",
134
+ required: true
135
+ }]);
136
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
137
+ const cleanedData = stripUndefined(answers, fieldSchema);
138
+ const client = getClient();
139
+ const result = await client.principal.create({
140
+ data: {
141
+ ownerId: cleanedData.ownerId,
142
+ userId: cleanedData.userId,
143
+ name: cleanedData.name,
144
+ allowedMask: cleanedData.allowedMask,
145
+ isReadOnly: cleanedData.isReadOnly,
146
+ bypassStepUp: cleanedData.bypassStepUp
147
+ },
148
+ select: {
149
+ id: true,
150
+ createdAt: true,
151
+ updatedAt: true,
152
+ ownerId: true,
153
+ userId: true,
154
+ name: true,
155
+ allowedMask: true,
156
+ isReadOnly: true,
157
+ bypassStepUp: true
158
+ }
159
+ }).execute();
160
+ console.log(JSON.stringify(result, null, 2));
161
+ }
162
+ catch (error) {
163
+ console.error("Failed to create record.");
164
+ if (error instanceof Error) {
165
+ console.error(error.message);
166
+ }
167
+ process.exit(1);
168
+ }
169
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command for mutation revokeOrgApiKey
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,34 @@
1
+ import { getClient } from '../executor';
2
+ import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
3
+ export default async (argv, prompter, _options) => {
4
+ try {
5
+ if (argv.help || argv.h) {
6
+ console.log('revoke-org-api-key - revokeOrgApiKey\n\nUsage: revoke-org-api-key [OPTIONS]\n');
7
+ process.exit(0);
8
+ }
9
+ const answers = await prompter.prompt(argv, [
10
+ {
11
+ type: 'text',
12
+ name: 'input',
13
+ message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
14
+ required: true,
15
+ },
16
+ ]);
17
+ const client = getClient();
18
+ const parsedAnswers = unflattenDotNotation(answers);
19
+ const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
20
+ const result = await client.mutation
21
+ .revokeOrgApiKey(parsedAnswers, {
22
+ select: selectFields,
23
+ })
24
+ .execute();
25
+ console.log(JSON.stringify(result, null, 2));
26
+ }
27
+ catch (error) {
28
+ console.error('Failed: revokeOrgApiKey');
29
+ if (error instanceof Error) {
30
+ console.error(error.message);
31
+ }
32
+ process.exit(1);
33
+ }
34
+ };
@@ -6,6 +6,9 @@
6
6
  import { extractFirst } from 'inquirerer';
7
7
  import contextCmd from './commands/context';
8
8
  import authCmd from './commands/auth';
9
+ import principalCmd from './commands/principal';
10
+ import principalEntityCmd from './commands/principal-entity';
11
+ import principalScopeOverrideCmd from './commands/principal-scope-override';
9
12
  import emailCmd from './commands/email';
10
13
  import phoneNumberCmd from './commands/phone-number';
11
14
  import cryptoAddressCmd from './commands/crypto-address';
@@ -14,21 +17,24 @@ import auditLogAuthCmd from './commands/audit-log-auth';
14
17
  import identityProviderCmd from './commands/identity-provider';
15
18
  import roleTypeCmd from './commands/role-type';
16
19
  import userConnectedAccountCmd from './commands/user-connected-account';
20
+ import orgApiKeyListCmd from './commands/org-api-key-list';
17
21
  import userCmd from './commands/user';
18
22
  import currentUserAgentCmd from './commands/current-user-agent';
19
- import currentIpAddressCmd from './commands/current-ip-address';
20
23
  import currentUserIdCmd from './commands/current-user-id';
24
+ import currentIpAddressCmd from './commands/current-ip-address';
21
25
  import requireStepUpCmd from './commands/require-step-up';
22
26
  import currentUserCmd from './commands/current-user';
23
27
  import signOutCmd from './commands/sign-out';
24
28
  import sendAccountDeletionEmailCmd from './commands/send-account-deletion-email';
25
29
  import checkPasswordCmd from './commands/check-password';
30
+ import deleteOrgPrincipalCmd from './commands/delete-org-principal';
26
31
  import disconnectAccountCmd from './commands/disconnect-account';
27
32
  import revokeApiKeyCmd from './commands/revoke-api-key';
28
33
  import revokeSessionCmd from './commands/revoke-session';
29
34
  import verifyPasswordCmd from './commands/verify-password';
30
35
  import verifyTotpCmd from './commands/verify-totp';
31
36
  import confirmDeleteAccountCmd from './commands/confirm-delete-account';
37
+ import revokeOrgApiKeyCmd from './commands/revoke-org-api-key';
32
38
  import setPasswordCmd from './commands/set-password';
33
39
  import verifyEmailCmd from './commands/verify-email';
34
40
  import provisionNewUserCmd from './commands/provision-new-user';
@@ -39,7 +45,9 @@ import signUpSmsCmd from './commands/sign-up-sms';
39
45
  import signUpCmd from './commands/sign-up';
40
46
  import signInCmd from './commands/sign-in';
41
47
  import linkIdentityCmd from './commands/link-identity';
48
+ import createOrgPrincipalCmd from './commands/create-org-principal';
42
49
  import extendTokenExpiresCmd from './commands/extend-token-expires';
50
+ import createOrgApiKeyCmd from './commands/create-org-api-key';
43
51
  import createApiKeyCmd from './commands/create-api-key';
44
52
  import requestCrossOriginTokenCmd from './commands/request-cross-origin-token';
45
53
  import forgotPasswordCmd from './commands/forgot-password';
@@ -48,6 +56,9 @@ import provisionBucketCmd from './commands/provision-bucket';
48
56
  const createCommandMap = () => ({
49
57
  context: contextCmd,
50
58
  auth: authCmd,
59
+ principal: principalCmd,
60
+ 'principal-entity': principalEntityCmd,
61
+ 'principal-scope-override': principalScopeOverrideCmd,
51
62
  email: emailCmd,
52
63
  'phone-number': phoneNumberCmd,
53
64
  'crypto-address': cryptoAddressCmd,
@@ -56,21 +67,24 @@ const createCommandMap = () => ({
56
67
  'identity-provider': identityProviderCmd,
57
68
  'role-type': roleTypeCmd,
58
69
  'user-connected-account': userConnectedAccountCmd,
70
+ 'org-api-key-list': orgApiKeyListCmd,
59
71
  user: userCmd,
60
72
  'current-user-agent': currentUserAgentCmd,
61
- 'current-ip-address': currentIpAddressCmd,
62
73
  'current-user-id': currentUserIdCmd,
74
+ 'current-ip-address': currentIpAddressCmd,
63
75
  'require-step-up': requireStepUpCmd,
64
76
  'current-user': currentUserCmd,
65
77
  'sign-out': signOutCmd,
66
78
  'send-account-deletion-email': sendAccountDeletionEmailCmd,
67
79
  'check-password': checkPasswordCmd,
80
+ 'delete-org-principal': deleteOrgPrincipalCmd,
68
81
  'disconnect-account': disconnectAccountCmd,
69
82
  'revoke-api-key': revokeApiKeyCmd,
70
83
  'revoke-session': revokeSessionCmd,
71
84
  'verify-password': verifyPasswordCmd,
72
85
  'verify-totp': verifyTotpCmd,
73
86
  'confirm-delete-account': confirmDeleteAccountCmd,
87
+ 'revoke-org-api-key': revokeOrgApiKeyCmd,
74
88
  'set-password': setPasswordCmd,
75
89
  'verify-email': verifyEmailCmd,
76
90
  'provision-new-user': provisionNewUserCmd,
@@ -81,14 +95,16 @@ const createCommandMap = () => ({
81
95
  'sign-up': signUpCmd,
82
96
  'sign-in': signInCmd,
83
97
  'link-identity': linkIdentityCmd,
98
+ 'create-org-principal': createOrgPrincipalCmd,
84
99
  'extend-token-expires': extendTokenExpiresCmd,
100
+ 'create-org-api-key': createOrgApiKeyCmd,
85
101
  'create-api-key': createApiKeyCmd,
86
102
  'request-cross-origin-token': requestCrossOriginTokenCmd,
87
103
  'forgot-password': forgotPasswordCmd,
88
104
  'send-verification-email': sendVerificationEmailCmd,
89
105
  'provision-bucket': provisionBucketCmd,
90
106
  });
91
- const usage = '\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n audit-log-auth auditLogAuth CRUD operations\n identity-provider identityProvider CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n current-user-id currentUserId\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-up-sms signUpSms\n sign-up signUp\n sign-in signIn\n link-identity linkIdentity\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n request-cross-origin-token requestCrossOriginToken\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n';
107
+ const usage = '\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n principal principal CRUD operations\n principal-entity principalEntity CRUD operations\n principal-scope-override principalScopeOverride CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n audit-log-auth auditLogAuth CRUD operations\n identity-provider identityProvider CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n org-api-key-list orgApiKeyList CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-user-id currentUserId\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n delete-org-principal deleteOrgPrincipal\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n revoke-org-api-key revokeOrgApiKey\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-up-sms signUpSms\n sign-up signUp\n sign-in signIn\n link-identity linkIdentity\n create-org-principal createOrgPrincipal\n extend-token-expires extendTokenExpires\n create-org-api-key createOrgApiKey\n create-api-key createApiKey\n request-cross-origin-token requestCrossOriginToken\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n';
92
108
  export const commands = async (argv, prompter, options) => {
93
109
  if (argv.help || argv.h) {
94
110
  console.log(usage);
@@ -1,5 +1,8 @@
1
1
  export declare const getStore: () => import("appstash").ConfigStore;
2
2
  export declare function getClient(contextName?: string): {
3
+ principal: import("..").PrincipalModel;
4
+ principalEntity: import("..").PrincipalEntityModel;
5
+ principalScopeOverride: import("..").PrincipalScopeOverrideModel;
3
6
  email: import("..").EmailModel;
4
7
  phoneNumber: import("..").PhoneNumberModel;
5
8
  cryptoAddress: import("..").CryptoAddressModel;
@@ -8,6 +11,7 @@ export declare function getClient(contextName?: string): {
8
11
  identityProvider: import("..").IdentityProviderModel;
9
12
  roleType: import("..").RoleTypeModel;
10
13
  userConnectedAccount: import("..").UserConnectedAccountModel;
14
+ orgApiKeyList: import("..").OrgApiKeyListModel;
11
15
  user: import("..").UserModel;
12
16
  query: {
13
17
  currentUserAgent: (options?: {
@@ -15,15 +19,15 @@ export declare function getClient(contextName?: string): {
15
19
  }) => import("..").QueryBuilder<{
16
20
  currentUserAgent: string | null;
17
21
  }>;
18
- currentIpAddress: (options?: {
22
+ currentUserId: (options?: {
19
23
  select?: Record<string, unknown>;
20
24
  }) => import("..").QueryBuilder<{
21
- currentIpAddress: string | null;
25
+ currentUserId: string | null;
22
26
  }>;
23
- currentUserId: (options?: {
27
+ currentIpAddress: (options?: {
24
28
  select?: Record<string, unknown>;
25
29
  }) => import("..").QueryBuilder<{
26
- currentUserId: string | null;
30
+ currentIpAddress: string | null;
27
31
  }>;
28
32
  requireStepUp: (args: import("../orm/query").RequireStepUpVariables, options?: {
29
33
  select?: Record<string, unknown>;
@@ -52,6 +56,11 @@ export declare function getClient(contextName?: string): {
52
56
  } & import("..").StrictSelect<S, import("../orm/input-types").CheckPasswordPayloadSelect>) => import("..").QueryBuilder<{
53
57
  checkPassword: import("..").InferSelectResult<import("../orm/input-types").CheckPasswordPayload, S> | null;
54
58
  }>;
59
+ deleteOrgPrincipal: <S extends import("../orm/input-types").DeleteOrgPrincipalPayloadSelect>(args: import("../orm/mutation").DeleteOrgPrincipalVariables, options: {
60
+ select: S;
61
+ } & import("..").StrictSelect<S, import("../orm/input-types").DeleteOrgPrincipalPayloadSelect>) => import("..").QueryBuilder<{
62
+ deleteOrgPrincipal: import("..").InferSelectResult<import("../orm/input-types").DeleteOrgPrincipalPayload, S> | null;
63
+ }>;
55
64
  disconnectAccount: <S extends import("../orm/input-types").DisconnectAccountPayloadSelect>(args: import("../orm/mutation").DisconnectAccountVariables, options: {
56
65
  select: S;
57
66
  } & import("..").StrictSelect<S, import("../orm/input-types").DisconnectAccountPayloadSelect>) => import("..").QueryBuilder<{
@@ -82,6 +91,11 @@ export declare function getClient(contextName?: string): {
82
91
  } & import("..").StrictSelect<S, import("../orm/input-types").ConfirmDeleteAccountPayloadSelect>) => import("..").QueryBuilder<{
83
92
  confirmDeleteAccount: import("..").InferSelectResult<import("../orm/input-types").ConfirmDeleteAccountPayload, S> | null;
84
93
  }>;
94
+ revokeOrgApiKey: <S extends import("../orm/input-types").RevokeOrgApiKeyPayloadSelect>(args: import("../orm/mutation").RevokeOrgApiKeyVariables, options: {
95
+ select: S;
96
+ } & import("..").StrictSelect<S, import("../orm/input-types").RevokeOrgApiKeyPayloadSelect>) => import("..").QueryBuilder<{
97
+ revokeOrgApiKey: import("..").InferSelectResult<import("../orm/input-types").RevokeOrgApiKeyPayload, S> | null;
98
+ }>;
85
99
  setPassword: <S extends import("../orm/input-types").SetPasswordPayloadSelect>(args: import("../orm/mutation").SetPasswordVariables, options: {
86
100
  select: S;
87
101
  } & import("..").StrictSelect<S, import("../orm/input-types").SetPasswordPayloadSelect>) => import("..").QueryBuilder<{
@@ -132,11 +146,21 @@ export declare function getClient(contextName?: string): {
132
146
  } & import("..").StrictSelect<S, import("../orm/input-types").LinkIdentityPayloadSelect>) => import("..").QueryBuilder<{
133
147
  linkIdentity: import("..").InferSelectResult<import("../orm/input-types").LinkIdentityPayload, S> | null;
134
148
  }>;
149
+ createOrgPrincipal: <S extends import("../orm/input-types").CreateOrgPrincipalPayloadSelect>(args: import("../orm/mutation").CreateOrgPrincipalVariables, options: {
150
+ select: S;
151
+ } & import("..").StrictSelect<S, import("../orm/input-types").CreateOrgPrincipalPayloadSelect>) => import("..").QueryBuilder<{
152
+ createOrgPrincipal: import("..").InferSelectResult<import("../orm/input-types").CreateOrgPrincipalPayload, S> | null;
153
+ }>;
135
154
  extendTokenExpires: <S extends import("../orm/input-types").ExtendTokenExpiresPayloadSelect>(args: import("../orm/mutation").ExtendTokenExpiresVariables, options: {
136
155
  select: S;
137
156
  } & import("..").StrictSelect<S, import("../orm/input-types").ExtendTokenExpiresPayloadSelect>) => import("..").QueryBuilder<{
138
157
  extendTokenExpires: import("..").InferSelectResult<import("../orm/input-types").ExtendTokenExpiresPayload, S> | null;
139
158
  }>;
159
+ createOrgApiKey: <S extends import("../orm/input-types").CreateOrgApiKeyPayloadSelect>(args: import("../orm/mutation").CreateOrgApiKeyVariables, options: {
160
+ select: S;
161
+ } & import("..").StrictSelect<S, import("../orm/input-types").CreateOrgApiKeyPayloadSelect>) => import("..").QueryBuilder<{
162
+ createOrgApiKey: import("..").InferSelectResult<import("../orm/input-types").CreateOrgApiKeyPayload, S> | null;
163
+ }>;
140
164
  createApiKey: <S extends import("../orm/input-types").CreateApiKeyPayloadSelect>(args: import("../orm/mutation").CreateApiKeyVariables, options: {
141
165
  select: S;
142
166
  } & import("..").StrictSelect<S, import("../orm/input-types").CreateApiKeyPayloadSelect>) => import("..").QueryBuilder<{