@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,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for PrincipalScopeOverride
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
+ membershipType: 'int',
17
+ allowedMask: 'string',
18
+ isAdmin: 'boolean',
19
+ isReadOnly: 'boolean',
20
+ };
21
+ 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';
22
+ exports.default = async (argv, prompter, _options) => {
23
+ if (argv.help || argv.h) {
24
+ console.log(usage);
25
+ process.exit(0);
26
+ }
27
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
28
+ if (!subcommand) {
29
+ const answer = await prompter.prompt(argv, [
30
+ {
31
+ type: 'autocomplete',
32
+ name: 'subcommand',
33
+ message: 'What do you want to do?',
34
+ options: ['list', 'find-first', 'create'],
35
+ },
36
+ ]);
37
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
38
+ }
39
+ return handleTableSubcommand(subcommand, newArgv, prompter);
40
+ };
41
+ async function handleTableSubcommand(subcommand, argv, prompter) {
42
+ switch (subcommand) {
43
+ case 'list':
44
+ return handleList(argv, prompter);
45
+ case 'find-first':
46
+ return handleFindFirst(argv, prompter);
47
+ case 'create':
48
+ return handleCreate(argv, prompter);
49
+ default:
50
+ console.log(usage);
51
+ process.exit(1);
52
+ }
53
+ }
54
+ async function handleList(argv, _prompter) {
55
+ try {
56
+ const defaultSelect = {
57
+ id: true,
58
+ createdAt: true,
59
+ updatedAt: true,
60
+ principalId: true,
61
+ membershipType: true,
62
+ allowedMask: true,
63
+ isAdmin: true,
64
+ isReadOnly: true,
65
+ };
66
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
67
+ const client = (0, executor_1.getClient)();
68
+ const result = await client.principalScopeOverride.findMany(findManyArgs).execute();
69
+ console.log(JSON.stringify(result, null, 2));
70
+ }
71
+ catch (error) {
72
+ console.error('Failed to list records.');
73
+ if (error instanceof Error) {
74
+ console.error(error.message);
75
+ }
76
+ process.exit(1);
77
+ }
78
+ }
79
+ async function handleFindFirst(argv, _prompter) {
80
+ try {
81
+ const defaultSelect = {
82
+ id: true,
83
+ createdAt: true,
84
+ updatedAt: true,
85
+ principalId: true,
86
+ membershipType: true,
87
+ allowedMask: true,
88
+ isAdmin: true,
89
+ isReadOnly: true,
90
+ };
91
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
92
+ const client = (0, executor_1.getClient)();
93
+ const result = await client.principalScopeOverride.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 handleCreate(argv, prompter) {
105
+ try {
106
+ const rawAnswers = await prompter.prompt(argv, [
107
+ {
108
+ type: 'text',
109
+ name: 'principalId',
110
+ message: 'principalId',
111
+ required: true,
112
+ },
113
+ {
114
+ type: 'text',
115
+ name: 'membershipType',
116
+ message: 'membershipType',
117
+ required: true,
118
+ },
119
+ {
120
+ type: 'text',
121
+ name: 'allowedMask',
122
+ message: 'allowedMask',
123
+ required: true,
124
+ },
125
+ {
126
+ type: 'boolean',
127
+ name: 'isAdmin',
128
+ message: 'isAdmin',
129
+ required: true,
130
+ },
131
+ {
132
+ type: 'boolean',
133
+ name: 'isReadOnly',
134
+ message: 'isReadOnly',
135
+ required: true,
136
+ },
137
+ ]);
138
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
139
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
140
+ const client = (0, executor_1.getClient)();
141
+ const result = await client.principalScopeOverride
142
+ .create({
143
+ data: {
144
+ principalId: cleanedData.principalId,
145
+ membershipType: cleanedData.membershipType,
146
+ allowedMask: cleanedData.allowedMask,
147
+ isAdmin: cleanedData.isAdmin,
148
+ isReadOnly: cleanedData.isReadOnly,
149
+ },
150
+ select: {
151
+ id: true,
152
+ createdAt: true,
153
+ updatedAt: true,
154
+ principalId: true,
155
+ membershipType: true,
156
+ allowedMask: true,
157
+ isAdmin: true,
158
+ isReadOnly: true,
159
+ },
160
+ })
161
+ .execute();
162
+ console.log(JSON.stringify(result, null, 2));
163
+ }
164
+ catch (error) {
165
+ console.error('Failed to create record.');
166
+ if (error instanceof Error) {
167
+ console.error(error.message);
168
+ }
169
+ process.exit(1);
170
+ }
171
+ }
@@ -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,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for Principal
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
+ ownerId: "uuid",
16
+ userId: "uuid",
17
+ name: "string",
18
+ allowedMask: "string",
19
+ isReadOnly: "boolean",
20
+ bypassStepUp: "boolean"
21
+ };
22
+ 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";
23
+ exports.default = async (argv, prompter, _options) => {
24
+ if (argv.help || argv.h) {
25
+ console.log(usage);
26
+ process.exit(0);
27
+ }
28
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
29
+ if (!subcommand) {
30
+ const answer = await prompter.prompt(argv, [{
31
+ type: "autocomplete",
32
+ name: "subcommand",
33
+ message: "What do you want to do?",
34
+ options: ["list", "find-first", "create"]
35
+ }]);
36
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
37
+ }
38
+ return handleTableSubcommand(subcommand, newArgv, prompter);
39
+ };
40
+ async function handleTableSubcommand(subcommand, argv, prompter) {
41
+ switch (subcommand) {
42
+ case "list":
43
+ return handleList(argv, prompter);
44
+ case "find-first":
45
+ return handleFindFirst(argv, prompter);
46
+ case "create":
47
+ return handleCreate(argv, prompter);
48
+ default:
49
+ console.log(usage);
50
+ process.exit(1);
51
+ }
52
+ }
53
+ async function handleList(argv, _prompter) {
54
+ try {
55
+ const defaultSelect = {
56
+ id: true,
57
+ createdAt: true,
58
+ updatedAt: true,
59
+ ownerId: true,
60
+ userId: true,
61
+ name: true,
62
+ allowedMask: true,
63
+ isReadOnly: true,
64
+ bypassStepUp: true
65
+ };
66
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
67
+ const client = (0, executor_1.getClient)();
68
+ const result = await client.principal.findMany(findManyArgs).execute();
69
+ console.log(JSON.stringify(result, null, 2));
70
+ }
71
+ catch (error) {
72
+ console.error("Failed to list records.");
73
+ if (error instanceof Error) {
74
+ console.error(error.message);
75
+ }
76
+ process.exit(1);
77
+ }
78
+ }
79
+ async function handleFindFirst(argv, _prompter) {
80
+ try {
81
+ const defaultSelect = {
82
+ id: true,
83
+ createdAt: true,
84
+ updatedAt: true,
85
+ ownerId: true,
86
+ userId: true,
87
+ name: true,
88
+ allowedMask: true,
89
+ isReadOnly: true,
90
+ bypassStepUp: true
91
+ };
92
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
93
+ const client = (0, executor_1.getClient)();
94
+ const result = await client.principal.findFirst(findFirstArgs).execute();
95
+ console.log(JSON.stringify(result, null, 2));
96
+ }
97
+ catch (error) {
98
+ console.error("Failed to find record.");
99
+ if (error instanceof Error) {
100
+ console.error(error.message);
101
+ }
102
+ process.exit(1);
103
+ }
104
+ }
105
+ async function handleCreate(argv, prompter) {
106
+ try {
107
+ const rawAnswers = await prompter.prompt(argv, [{
108
+ type: "text",
109
+ name: "ownerId",
110
+ message: "ownerId",
111
+ required: true
112
+ }, {
113
+ type: "text",
114
+ name: "userId",
115
+ message: "userId",
116
+ required: true
117
+ }, {
118
+ type: "text",
119
+ name: "name",
120
+ message: "name",
121
+ required: true
122
+ }, {
123
+ type: "text",
124
+ name: "allowedMask",
125
+ message: "allowedMask",
126
+ required: true
127
+ }, {
128
+ type: "boolean",
129
+ name: "isReadOnly",
130
+ message: "isReadOnly",
131
+ required: true
132
+ }, {
133
+ type: "boolean",
134
+ name: "bypassStepUp",
135
+ message: "bypassStepUp",
136
+ required: true
137
+ }]);
138
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
139
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
140
+ const client = (0, executor_1.getClient)();
141
+ const result = await client.principal.create({
142
+ data: {
143
+ ownerId: cleanedData.ownerId,
144
+ userId: cleanedData.userId,
145
+ name: cleanedData.name,
146
+ allowedMask: cleanedData.allowedMask,
147
+ isReadOnly: cleanedData.isReadOnly,
148
+ bypassStepUp: cleanedData.bypassStepUp
149
+ },
150
+ select: {
151
+ id: true,
152
+ createdAt: true,
153
+ updatedAt: true,
154
+ ownerId: true,
155
+ userId: true,
156
+ name: true,
157
+ allowedMask: true,
158
+ isReadOnly: true,
159
+ bypassStepUp: true
160
+ }
161
+ }).execute();
162
+ console.log(JSON.stringify(result, null, 2));
163
+ }
164
+ catch (error) {
165
+ console.error("Failed to create record.");
166
+ if (error instanceof Error) {
167
+ console.error(error.message);
168
+ }
169
+ process.exit(1);
170
+ }
171
+ }
@@ -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,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('revoke-org-api-key - revokeOrgApiKey\n\nUsage: revoke-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
+ .revokeOrgApiKey(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: revokeOrgApiKey');
31
+ if (error instanceof Error) {
32
+ console.error(error.message);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ };
@@ -12,6 +12,9 @@ exports.commands = void 0;
12
12
  const inquirerer_1 = require("inquirerer");
13
13
  const context_1 = __importDefault(require("./commands/context"));
14
14
  const auth_1 = __importDefault(require("./commands/auth"));
15
+ const principal_1 = __importDefault(require("./commands/principal"));
16
+ const principal_entity_1 = __importDefault(require("./commands/principal-entity"));
17
+ const principal_scope_override_1 = __importDefault(require("./commands/principal-scope-override"));
15
18
  const email_1 = __importDefault(require("./commands/email"));
16
19
  const phone_number_1 = __importDefault(require("./commands/phone-number"));
17
20
  const crypto_address_1 = __importDefault(require("./commands/crypto-address"));
@@ -20,21 +23,24 @@ const audit_log_auth_1 = __importDefault(require("./commands/audit-log-auth"));
20
23
  const identity_provider_1 = __importDefault(require("./commands/identity-provider"));
21
24
  const role_type_1 = __importDefault(require("./commands/role-type"));
22
25
  const user_connected_account_1 = __importDefault(require("./commands/user-connected-account"));
26
+ const org_api_key_list_1 = __importDefault(require("./commands/org-api-key-list"));
23
27
  const user_1 = __importDefault(require("./commands/user"));
24
28
  const current_user_agent_1 = __importDefault(require("./commands/current-user-agent"));
25
- const current_ip_address_1 = __importDefault(require("./commands/current-ip-address"));
26
29
  const current_user_id_1 = __importDefault(require("./commands/current-user-id"));
30
+ const current_ip_address_1 = __importDefault(require("./commands/current-ip-address"));
27
31
  const require_step_up_1 = __importDefault(require("./commands/require-step-up"));
28
32
  const current_user_1 = __importDefault(require("./commands/current-user"));
29
33
  const sign_out_1 = __importDefault(require("./commands/sign-out"));
30
34
  const send_account_deletion_email_1 = __importDefault(require("./commands/send-account-deletion-email"));
31
35
  const check_password_1 = __importDefault(require("./commands/check-password"));
36
+ const delete_org_principal_1 = __importDefault(require("./commands/delete-org-principal"));
32
37
  const disconnect_account_1 = __importDefault(require("./commands/disconnect-account"));
33
38
  const revoke_api_key_1 = __importDefault(require("./commands/revoke-api-key"));
34
39
  const revoke_session_1 = __importDefault(require("./commands/revoke-session"));
35
40
  const verify_password_1 = __importDefault(require("./commands/verify-password"));
36
41
  const verify_totp_1 = __importDefault(require("./commands/verify-totp"));
37
42
  const confirm_delete_account_1 = __importDefault(require("./commands/confirm-delete-account"));
43
+ const revoke_org_api_key_1 = __importDefault(require("./commands/revoke-org-api-key"));
38
44
  const set_password_1 = __importDefault(require("./commands/set-password"));
39
45
  const verify_email_1 = __importDefault(require("./commands/verify-email"));
40
46
  const provision_new_user_1 = __importDefault(require("./commands/provision-new-user"));
@@ -45,7 +51,9 @@ const sign_up_sms_1 = __importDefault(require("./commands/sign-up-sms"));
45
51
  const sign_up_1 = __importDefault(require("./commands/sign-up"));
46
52
  const sign_in_1 = __importDefault(require("./commands/sign-in"));
47
53
  const link_identity_1 = __importDefault(require("./commands/link-identity"));
54
+ const create_org_principal_1 = __importDefault(require("./commands/create-org-principal"));
48
55
  const extend_token_expires_1 = __importDefault(require("./commands/extend-token-expires"));
56
+ const create_org_api_key_1 = __importDefault(require("./commands/create-org-api-key"));
49
57
  const create_api_key_1 = __importDefault(require("./commands/create-api-key"));
50
58
  const request_cross_origin_token_1 = __importDefault(require("./commands/request-cross-origin-token"));
51
59
  const forgot_password_1 = __importDefault(require("./commands/forgot-password"));
@@ -54,6 +62,9 @@ const provision_bucket_1 = __importDefault(require("./commands/provision-bucket"
54
62
  const createCommandMap = () => ({
55
63
  context: context_1.default,
56
64
  auth: auth_1.default,
65
+ principal: principal_1.default,
66
+ 'principal-entity': principal_entity_1.default,
67
+ 'principal-scope-override': principal_scope_override_1.default,
57
68
  email: email_1.default,
58
69
  'phone-number': phone_number_1.default,
59
70
  'crypto-address': crypto_address_1.default,
@@ -62,21 +73,24 @@ const createCommandMap = () => ({
62
73
  'identity-provider': identity_provider_1.default,
63
74
  'role-type': role_type_1.default,
64
75
  'user-connected-account': user_connected_account_1.default,
76
+ 'org-api-key-list': org_api_key_list_1.default,
65
77
  user: user_1.default,
66
78
  'current-user-agent': current_user_agent_1.default,
67
- 'current-ip-address': current_ip_address_1.default,
68
79
  'current-user-id': current_user_id_1.default,
80
+ 'current-ip-address': current_ip_address_1.default,
69
81
  'require-step-up': require_step_up_1.default,
70
82
  'current-user': current_user_1.default,
71
83
  'sign-out': sign_out_1.default,
72
84
  'send-account-deletion-email': send_account_deletion_email_1.default,
73
85
  'check-password': check_password_1.default,
86
+ 'delete-org-principal': delete_org_principal_1.default,
74
87
  'disconnect-account': disconnect_account_1.default,
75
88
  'revoke-api-key': revoke_api_key_1.default,
76
89
  'revoke-session': revoke_session_1.default,
77
90
  'verify-password': verify_password_1.default,
78
91
  'verify-totp': verify_totp_1.default,
79
92
  'confirm-delete-account': confirm_delete_account_1.default,
93
+ 'revoke-org-api-key': revoke_org_api_key_1.default,
80
94
  'set-password': set_password_1.default,
81
95
  'verify-email': verify_email_1.default,
82
96
  'provision-new-user': provision_new_user_1.default,
@@ -87,14 +101,16 @@ const createCommandMap = () => ({
87
101
  'sign-up': sign_up_1.default,
88
102
  'sign-in': sign_in_1.default,
89
103
  'link-identity': link_identity_1.default,
104
+ 'create-org-principal': create_org_principal_1.default,
90
105
  'extend-token-expires': extend_token_expires_1.default,
106
+ 'create-org-api-key': create_org_api_key_1.default,
91
107
  'create-api-key': create_api_key_1.default,
92
108
  'request-cross-origin-token': request_cross_origin_token_1.default,
93
109
  'forgot-password': forgot_password_1.default,
94
110
  'send-verification-email': send_verification_email_1.default,
95
111
  'provision-bucket': provision_bucket_1.default,
96
112
  });
97
- 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';
113
+ 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';
98
114
  const commands = async (argv, prompter, options) => {
99
115
  if (argv.help || argv.h) {
100
116
  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("../orm").PrincipalModel;
4
+ principalEntity: import("../orm").PrincipalEntityModel;
5
+ principalScopeOverride: import("../orm").PrincipalScopeOverrideModel;
3
6
  email: import("../orm").EmailModel;
4
7
  phoneNumber: import("../orm").PhoneNumberModel;
5
8
  cryptoAddress: import("../orm").CryptoAddressModel;
@@ -8,6 +11,7 @@ export declare function getClient(contextName?: string): {
8
11
  identityProvider: import("../orm").IdentityProviderModel;
9
12
  roleType: import("../orm").RoleTypeModel;
10
13
  userConnectedAccount: import("../orm").UserConnectedAccountModel;
14
+ orgApiKeyList: import("../orm").OrgApiKeyListModel;
11
15
  user: import("../orm").UserModel;
12
16
  query: {
13
17
  currentUserAgent: (options?: {
@@ -15,15 +19,15 @@ export declare function getClient(contextName?: string): {
15
19
  }) => import("../orm").QueryBuilder<{
16
20
  currentUserAgent: string | null;
17
21
  }>;
18
- currentIpAddress: (options?: {
22
+ currentUserId: (options?: {
19
23
  select?: Record<string, unknown>;
20
24
  }) => import("../orm").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("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").CheckPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
53
57
  checkPassword: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").DeleteOrgPrincipalPayloadSelect>) => import("../orm").QueryBuilder<{
62
+ deleteOrgPrincipal: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").DisconnectAccountPayloadSelect>) => import("../orm").QueryBuilder<{
@@ -82,6 +91,11 @@ export declare function getClient(contextName?: string): {
82
91
  } & import("../orm").StrictSelect<S, import("../orm/input-types").ConfirmDeleteAccountPayloadSelect>) => import("../orm").QueryBuilder<{
83
92
  confirmDeleteAccount: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").RevokeOrgApiKeyPayloadSelect>) => import("../orm").QueryBuilder<{
97
+ revokeOrgApiKey: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").SetPasswordPayloadSelect>) => import("../orm").QueryBuilder<{
@@ -132,11 +146,21 @@ export declare function getClient(contextName?: string): {
132
146
  } & import("../orm").StrictSelect<S, import("../orm/input-types").LinkIdentityPayloadSelect>) => import("../orm").QueryBuilder<{
133
147
  linkIdentity: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").CreateOrgPrincipalPayloadSelect>) => import("../orm").QueryBuilder<{
152
+ createOrgPrincipal: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").ExtendTokenExpiresPayloadSelect>) => import("../orm").QueryBuilder<{
138
157
  extendTokenExpires: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").CreateOrgApiKeyPayloadSelect>) => import("../orm").QueryBuilder<{
162
+ createOrgApiKey: import("../orm").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("../orm").StrictSelect<S, import("../orm/input-types").CreateApiKeyPayloadSelect>) => import("../orm").QueryBuilder<{