@constructive-sdk/cli 0.12.22 → 0.13.0

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 (99) hide show
  1. package/admin/cli/commands/confirm-upload.d.ts +8 -0
  2. package/admin/cli/commands/confirm-upload.js +36 -0
  3. package/admin/cli/commands/provision-bucket.d.ts +8 -0
  4. package/admin/cli/commands/provision-bucket.js +36 -0
  5. package/admin/cli/commands/request-upload-url.d.ts +8 -0
  6. package/admin/cli/commands/request-upload-url.js +36 -0
  7. package/admin/cli/commands.js +7 -1
  8. package/admin/cli/executor.d.ts +15 -0
  9. package/admin/orm/index.d.ts +15 -0
  10. package/admin/orm/input-types.d.ts +74 -0
  11. package/admin/orm/mutation/index.d.ts +45 -1
  12. package/admin/orm/mutation/index.js +36 -0
  13. package/auth/cli/commands/confirm-upload.d.ts +8 -0
  14. package/auth/cli/commands/confirm-upload.js +36 -0
  15. package/auth/cli/commands/provision-bucket.d.ts +8 -0
  16. package/auth/cli/commands/provision-bucket.js +36 -0
  17. package/auth/cli/commands/request-upload-url.d.ts +8 -0
  18. package/auth/cli/commands/request-upload-url.js +36 -0
  19. package/auth/cli/commands.js +7 -1
  20. package/auth/cli/executor.d.ts +15 -0
  21. package/auth/orm/index.d.ts +15 -0
  22. package/auth/orm/input-types.d.ts +74 -0
  23. package/auth/orm/mutation/index.d.ts +45 -1
  24. package/auth/orm/mutation/index.js +36 -0
  25. package/esm/admin/cli/commands/confirm-upload.d.ts +8 -0
  26. package/esm/admin/cli/commands/confirm-upload.js +34 -0
  27. package/esm/admin/cli/commands/provision-bucket.d.ts +8 -0
  28. package/esm/admin/cli/commands/provision-bucket.js +34 -0
  29. package/esm/admin/cli/commands/request-upload-url.d.ts +8 -0
  30. package/esm/admin/cli/commands/request-upload-url.js +34 -0
  31. package/esm/admin/cli/commands.js +7 -1
  32. package/esm/admin/cli/executor.d.ts +15 -0
  33. package/esm/admin/orm/index.d.ts +15 -0
  34. package/esm/admin/orm/input-types.d.ts +74 -0
  35. package/esm/admin/orm/mutation/index.d.ts +45 -1
  36. package/esm/admin/orm/mutation/index.js +36 -0
  37. package/esm/auth/cli/commands/confirm-upload.d.ts +8 -0
  38. package/esm/auth/cli/commands/confirm-upload.js +34 -0
  39. package/esm/auth/cli/commands/provision-bucket.d.ts +8 -0
  40. package/esm/auth/cli/commands/provision-bucket.js +34 -0
  41. package/esm/auth/cli/commands/request-upload-url.d.ts +8 -0
  42. package/esm/auth/cli/commands/request-upload-url.js +34 -0
  43. package/esm/auth/cli/commands.js +7 -1
  44. package/esm/auth/cli/executor.d.ts +15 -0
  45. package/esm/auth/orm/index.d.ts +15 -0
  46. package/esm/auth/orm/input-types.d.ts +74 -0
  47. package/esm/auth/orm/mutation/index.d.ts +45 -1
  48. package/esm/auth/orm/mutation/index.js +36 -0
  49. package/esm/objects/cli/commands/confirm-upload.d.ts +8 -0
  50. package/esm/objects/cli/commands/confirm-upload.js +34 -0
  51. package/esm/objects/cli/commands/provision-bucket.d.ts +8 -0
  52. package/esm/objects/cli/commands/provision-bucket.js +34 -0
  53. package/esm/objects/cli/commands/request-upload-url.d.ts +8 -0
  54. package/esm/objects/cli/commands/request-upload-url.js +34 -0
  55. package/esm/objects/cli/commands.js +7 -1
  56. package/esm/objects/cli/executor.d.ts +15 -0
  57. package/esm/objects/orm/index.d.ts +15 -0
  58. package/esm/objects/orm/input-types.d.ts +74 -0
  59. package/esm/objects/orm/mutation/index.d.ts +45 -1
  60. package/esm/objects/orm/mutation/index.js +36 -0
  61. package/esm/public/cli/commands/confirm-upload.d.ts +8 -0
  62. package/esm/public/cli/commands/confirm-upload.js +34 -0
  63. package/esm/public/cli/commands/provision-bucket.d.ts +8 -0
  64. package/esm/public/cli/commands/provision-bucket.js +34 -0
  65. package/esm/public/cli/commands/request-upload-url.d.ts +8 -0
  66. package/esm/public/cli/commands/request-upload-url.js +34 -0
  67. package/esm/public/cli/commands/storage-module.js +88 -0
  68. package/esm/public/cli/commands.js +7 -1
  69. package/esm/public/cli/executor.d.ts +15 -0
  70. package/esm/public/orm/index.d.ts +15 -0
  71. package/esm/public/orm/input-types.d.ts +107 -1
  72. package/esm/public/orm/mutation/index.d.ts +45 -1
  73. package/esm/public/orm/mutation/index.js +36 -0
  74. package/objects/cli/commands/confirm-upload.d.ts +8 -0
  75. package/objects/cli/commands/confirm-upload.js +36 -0
  76. package/objects/cli/commands/provision-bucket.d.ts +8 -0
  77. package/objects/cli/commands/provision-bucket.js +36 -0
  78. package/objects/cli/commands/request-upload-url.d.ts +8 -0
  79. package/objects/cli/commands/request-upload-url.js +36 -0
  80. package/objects/cli/commands.js +7 -1
  81. package/objects/cli/executor.d.ts +15 -0
  82. package/objects/orm/index.d.ts +15 -0
  83. package/objects/orm/input-types.d.ts +74 -0
  84. package/objects/orm/mutation/index.d.ts +45 -1
  85. package/objects/orm/mutation/index.js +36 -0
  86. package/package.json +4 -4
  87. package/public/cli/commands/confirm-upload.d.ts +8 -0
  88. package/public/cli/commands/confirm-upload.js +36 -0
  89. package/public/cli/commands/provision-bucket.d.ts +8 -0
  90. package/public/cli/commands/provision-bucket.js +36 -0
  91. package/public/cli/commands/request-upload-url.d.ts +8 -0
  92. package/public/cli/commands/request-upload-url.js +36 -0
  93. package/public/cli/commands/storage-module.js +88 -0
  94. package/public/cli/commands.js +7 -1
  95. package/public/cli/executor.d.ts +15 -0
  96. package/public/orm/index.d.ts +15 -0
  97. package/public/orm/input-types.d.ts +107 -1
  98. package/public/orm/mutation/index.d.ts +45 -1
  99. package/public/orm/mutation/index.js +36 -0
@@ -6,7 +6,7 @@
6
6
  import { OrmClient } from '../client';
7
7
  import { QueryBuilder } from '../query-builder';
8
8
  import type { InferSelectResult, StrictSelect } from '../select-types';
9
- import type { FreezeObjectsInput, InitEmptyRepoInput, RemoveNodeAtPathInput, SetDataAtPathInput, SetPropsAndCommitInput, InsertNodeAtPathInput, UpdateNodeAtPathInput, SetAndCommitInput, FreezeObjectsPayload, InitEmptyRepoPayload, RemoveNodeAtPathPayload, SetDataAtPathPayload, SetPropsAndCommitPayload, InsertNodeAtPathPayload, UpdateNodeAtPathPayload, SetAndCommitPayload, FreezeObjectsPayloadSelect, InitEmptyRepoPayloadSelect, RemoveNodeAtPathPayloadSelect, SetDataAtPathPayloadSelect, SetPropsAndCommitPayloadSelect, InsertNodeAtPathPayloadSelect, UpdateNodeAtPathPayloadSelect, SetAndCommitPayloadSelect } from '../input-types';
9
+ import type { FreezeObjectsInput, InitEmptyRepoInput, RemoveNodeAtPathInput, SetDataAtPathInput, SetPropsAndCommitInput, InsertNodeAtPathInput, UpdateNodeAtPathInput, SetAndCommitInput, RequestUploadUrlInput, ConfirmUploadInput, ProvisionBucketInput, FreezeObjectsPayload, InitEmptyRepoPayload, RemoveNodeAtPathPayload, SetDataAtPathPayload, SetPropsAndCommitPayload, InsertNodeAtPathPayload, UpdateNodeAtPathPayload, SetAndCommitPayload, RequestUploadUrlPayload, ConfirmUploadPayload, ProvisionBucketPayload, FreezeObjectsPayloadSelect, InitEmptyRepoPayloadSelect, RemoveNodeAtPathPayloadSelect, SetDataAtPathPayloadSelect, SetPropsAndCommitPayloadSelect, InsertNodeAtPathPayloadSelect, UpdateNodeAtPathPayloadSelect, SetAndCommitPayloadSelect, RequestUploadUrlPayloadSelect, ConfirmUploadPayloadSelect, ProvisionBucketPayloadSelect } from '../input-types';
10
10
  export interface FreezeObjectsVariables {
11
11
  input: FreezeObjectsInput;
12
12
  }
@@ -31,6 +31,35 @@ export interface UpdateNodeAtPathVariables {
31
31
  export interface SetAndCommitVariables {
32
32
  input: SetAndCommitInput;
33
33
  }
34
+ /**
35
+ * Variables for requestUploadUrl
36
+ * Request a presigned URL for uploading a file directly to S3.
37
+ Client computes SHA-256 of the file content and provides it here.
38
+ If a file with the same hash already exists (dedup), returns the
39
+ existing file ID and deduplicated=true with no uploadUrl.
40
+ */
41
+ export interface RequestUploadUrlVariables {
42
+ input: RequestUploadUrlInput;
43
+ }
44
+ /**
45
+ * Variables for confirmUpload
46
+ * Confirm that a file has been uploaded to S3.
47
+ Verifies the object exists in S3, checks content-type,
48
+ and transitions the file status from 'pending' to 'ready'.
49
+ */
50
+ export interface ConfirmUploadVariables {
51
+ input: ConfirmUploadInput;
52
+ }
53
+ /**
54
+ * Variables for provisionBucket
55
+ * Provision an S3 bucket for a logical bucket in the database.
56
+ Reads the bucket config via RLS, then creates and configures
57
+ the S3 bucket with the appropriate privacy policies, CORS rules,
58
+ and lifecycle settings.
59
+ */
60
+ export interface ProvisionBucketVariables {
61
+ input: ProvisionBucketInput;
62
+ }
34
63
  export declare function createMutationOperations(client: OrmClient): {
35
64
  freezeObjects: <S extends FreezeObjectsPayloadSelect>(args: FreezeObjectsVariables, options: {
36
65
  select: S;
@@ -72,4 +101,19 @@ export declare function createMutationOperations(client: OrmClient): {
72
101
  } & StrictSelect<S, SetAndCommitPayloadSelect>) => QueryBuilder<{
73
102
  setAndCommit: InferSelectResult<SetAndCommitPayload, S> | null;
74
103
  }>;
104
+ requestUploadUrl: <S extends RequestUploadUrlPayloadSelect>(args: RequestUploadUrlVariables, options: {
105
+ select: S;
106
+ } & StrictSelect<S, RequestUploadUrlPayloadSelect>) => QueryBuilder<{
107
+ requestUploadUrl: InferSelectResult<RequestUploadUrlPayload, S> | null;
108
+ }>;
109
+ confirmUpload: <S extends ConfirmUploadPayloadSelect>(args: ConfirmUploadVariables, options: {
110
+ select: S;
111
+ } & StrictSelect<S, ConfirmUploadPayloadSelect>) => QueryBuilder<{
112
+ confirmUpload: InferSelectResult<ConfirmUploadPayload, S> | null;
113
+ }>;
114
+ provisionBucket: <S extends ProvisionBucketPayloadSelect>(args: ProvisionBucketVariables, options: {
115
+ select: S;
116
+ } & StrictSelect<S, ProvisionBucketPayloadSelect>) => QueryBuilder<{
117
+ provisionBucket: InferSelectResult<ProvisionBucketPayload, S> | null;
118
+ }>;
75
119
  };
@@ -101,5 +101,41 @@ function createMutationOperations(client) {
101
101
  },
102
102
  ], input_types_1.connectionFieldsMap, 'SetAndCommitPayload'),
103
103
  }),
104
+ requestUploadUrl: (args, options) => new query_builder_1.QueryBuilder({
105
+ client,
106
+ operation: 'mutation',
107
+ operationName: 'RequestUploadUrl',
108
+ fieldName: 'requestUploadUrl',
109
+ ...(0, query_builder_1.buildCustomDocument)('mutation', 'RequestUploadUrl', 'requestUploadUrl', options.select, args, [
110
+ {
111
+ name: 'input',
112
+ type: 'RequestUploadUrlInput!',
113
+ },
114
+ ], input_types_1.connectionFieldsMap, 'RequestUploadUrlPayload'),
115
+ }),
116
+ confirmUpload: (args, options) => new query_builder_1.QueryBuilder({
117
+ client,
118
+ operation: 'mutation',
119
+ operationName: 'ConfirmUpload',
120
+ fieldName: 'confirmUpload',
121
+ ...(0, query_builder_1.buildCustomDocument)('mutation', 'ConfirmUpload', 'confirmUpload', options.select, args, [
122
+ {
123
+ name: 'input',
124
+ type: 'ConfirmUploadInput!',
125
+ },
126
+ ], input_types_1.connectionFieldsMap, 'ConfirmUploadPayload'),
127
+ }),
128
+ provisionBucket: (args, options) => new query_builder_1.QueryBuilder({
129
+ client,
130
+ operation: 'mutation',
131
+ operationName: 'ProvisionBucket',
132
+ fieldName: 'provisionBucket',
133
+ ...(0, query_builder_1.buildCustomDocument)('mutation', 'ProvisionBucket', 'provisionBucket', options.select, args, [
134
+ {
135
+ name: 'input',
136
+ type: 'ProvisionBucketInput!',
137
+ },
138
+ ], input_types_1.connectionFieldsMap, 'ProvisionBucketPayload'),
139
+ }),
104
140
  };
105
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-sdk/cli",
3
- "version": "0.12.22",
3
+ "version": "0.13.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive CLI SDK - Auto-generated GraphQL CLI with ORM client, context management, and interactive prompts",
6
6
  "main": "index.js",
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "dependencies": {
48
48
  "@0no-co/graphql.web": "^1.1.2",
49
- "@constructive-io/graphql-types": "^3.4.3",
49
+ "@constructive-io/graphql-types": "^3.4.4",
50
50
  "appstash": "^0.7.0",
51
51
  "gql-ast": "^3.4.2",
52
52
  "graphql": "16.13.0",
@@ -55,11 +55,11 @@
55
55
  "yanse": "^0.2.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@constructive-io/graphql-codegen": "^4.28.5",
58
+ "@constructive-io/graphql-codegen": "^4.29.0",
59
59
  "@types/node": "^22.19.11",
60
60
  "makage": "^0.3.0",
61
61
  "tsx": "^4.19.0",
62
62
  "typescript": "^5.9.3"
63
63
  },
64
- "gitHead": "9356877ea3ea61013b28b1496f015776e82ccb85"
64
+ "gitHead": "3bf7c522cf9f9d2595750ac7cea81d470b3e6c30"
65
65
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command for mutation confirmUpload
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("confirm-upload - Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\n\nUsage: confirm-upload [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
+ .confirmUpload(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: confirmUpload');
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 provisionBucket
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('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\nUsage: provision-bucket [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
+ .provisionBucket(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: provisionBucket');
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 requestUploadUrl
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('request-upload-url - Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n\nUsage: request-upload-url [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
+ .requestUploadUrl(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: requestUploadUrl');
31
+ if (error instanceof Error) {
32
+ console.error(error.message);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ };
@@ -20,6 +20,10 @@ const fieldSchema = {
20
20
  filesTableName: 'string',
21
21
  uploadRequestsTableName: 'string',
22
22
  entityTableId: 'uuid',
23
+ endpoint: 'string',
24
+ publicUrlPrefix: 'string',
25
+ provider: 'string',
26
+ allowedOrigins: 'string',
23
27
  uploadUrlExpirySeconds: 'int',
24
28
  downloadUrlExpirySeconds: 'int',
25
29
  defaultMaxFileSize: 'int',
@@ -79,6 +83,10 @@ async function handleList(argv, _prompter) {
79
83
  filesTableName: true,
80
84
  uploadRequestsTableName: true,
81
85
  entityTableId: true,
86
+ endpoint: true,
87
+ publicUrlPrefix: true,
88
+ provider: true,
89
+ allowedOrigins: true,
82
90
  uploadUrlExpirySeconds: true,
83
91
  downloadUrlExpirySeconds: true,
84
92
  defaultMaxFileSize: true,
@@ -112,6 +120,10 @@ async function handleFindFirst(argv, _prompter) {
112
120
  filesTableName: true,
113
121
  uploadRequestsTableName: true,
114
122
  entityTableId: true,
123
+ endpoint: true,
124
+ publicUrlPrefix: true,
125
+ provider: true,
126
+ allowedOrigins: true,
115
127
  uploadUrlExpirySeconds: true,
116
128
  downloadUrlExpirySeconds: true,
117
129
  defaultMaxFileSize: true,
@@ -157,6 +169,10 @@ async function handleGet(argv, prompter) {
157
169
  filesTableName: true,
158
170
  uploadRequestsTableName: true,
159
171
  entityTableId: true,
172
+ endpoint: true,
173
+ publicUrlPrefix: true,
174
+ provider: true,
175
+ allowedOrigins: true,
160
176
  uploadUrlExpirySeconds: true,
161
177
  downloadUrlExpirySeconds: true,
162
178
  defaultMaxFileSize: true,
@@ -247,6 +263,34 @@ async function handleCreate(argv, prompter) {
247
263
  required: false,
248
264
  skipPrompt: true,
249
265
  },
266
+ {
267
+ type: 'text',
268
+ name: 'endpoint',
269
+ message: 'endpoint',
270
+ required: false,
271
+ skipPrompt: true,
272
+ },
273
+ {
274
+ type: 'text',
275
+ name: 'publicUrlPrefix',
276
+ message: 'publicUrlPrefix',
277
+ required: false,
278
+ skipPrompt: true,
279
+ },
280
+ {
281
+ type: 'text',
282
+ name: 'provider',
283
+ message: 'provider',
284
+ required: false,
285
+ skipPrompt: true,
286
+ },
287
+ {
288
+ type: 'text',
289
+ name: 'allowedOrigins',
290
+ message: 'allowedOrigins',
291
+ required: false,
292
+ skipPrompt: true,
293
+ },
250
294
  {
251
295
  type: 'text',
252
296
  name: 'uploadUrlExpirySeconds',
@@ -299,6 +343,10 @@ async function handleCreate(argv, prompter) {
299
343
  filesTableName: cleanedData.filesTableName,
300
344
  uploadRequestsTableName: cleanedData.uploadRequestsTableName,
301
345
  entityTableId: cleanedData.entityTableId,
346
+ endpoint: cleanedData.endpoint,
347
+ publicUrlPrefix: cleanedData.publicUrlPrefix,
348
+ provider: cleanedData.provider,
349
+ allowedOrigins: cleanedData.allowedOrigins,
302
350
  uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds,
303
351
  downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds,
304
352
  defaultMaxFileSize: cleanedData.defaultMaxFileSize,
@@ -317,6 +365,10 @@ async function handleCreate(argv, prompter) {
317
365
  filesTableName: true,
318
366
  uploadRequestsTableName: true,
319
367
  entityTableId: true,
368
+ endpoint: true,
369
+ publicUrlPrefix: true,
370
+ provider: true,
371
+ allowedOrigins: true,
320
372
  uploadUrlExpirySeconds: true,
321
373
  downloadUrlExpirySeconds: true,
322
374
  defaultMaxFileSize: true,
@@ -413,6 +465,34 @@ async function handleUpdate(argv, prompter) {
413
465
  required: false,
414
466
  skipPrompt: true,
415
467
  },
468
+ {
469
+ type: 'text',
470
+ name: 'endpoint',
471
+ message: 'endpoint',
472
+ required: false,
473
+ skipPrompt: true,
474
+ },
475
+ {
476
+ type: 'text',
477
+ name: 'publicUrlPrefix',
478
+ message: 'publicUrlPrefix',
479
+ required: false,
480
+ skipPrompt: true,
481
+ },
482
+ {
483
+ type: 'text',
484
+ name: 'provider',
485
+ message: 'provider',
486
+ required: false,
487
+ skipPrompt: true,
488
+ },
489
+ {
490
+ type: 'text',
491
+ name: 'allowedOrigins',
492
+ message: 'allowedOrigins',
493
+ required: false,
494
+ skipPrompt: true,
495
+ },
416
496
  {
417
497
  type: 'text',
418
498
  name: 'uploadUrlExpirySeconds',
@@ -468,6 +548,10 @@ async function handleUpdate(argv, prompter) {
468
548
  filesTableName: cleanedData.filesTableName,
469
549
  uploadRequestsTableName: cleanedData.uploadRequestsTableName,
470
550
  entityTableId: cleanedData.entityTableId,
551
+ endpoint: cleanedData.endpoint,
552
+ publicUrlPrefix: cleanedData.publicUrlPrefix,
553
+ provider: cleanedData.provider,
554
+ allowedOrigins: cleanedData.allowedOrigins,
471
555
  uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds,
472
556
  downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds,
473
557
  defaultMaxFileSize: cleanedData.defaultMaxFileSize,
@@ -486,6 +570,10 @@ async function handleUpdate(argv, prompter) {
486
570
  filesTableName: true,
487
571
  uploadRequestsTableName: true,
488
572
  entityTableId: true,
573
+ endpoint: true,
574
+ publicUrlPrefix: true,
575
+ provider: true,
576
+ allowedOrigins: true,
489
577
  uploadUrlExpirySeconds: true,
490
578
  downloadUrlExpirySeconds: true,
491
579
  defaultMaxFileSize: true,
@@ -181,6 +181,9 @@ const send_verification_email_1 = __importDefault(require("./commands/send-verif
181
181
  const forgot_password_1 = __importDefault(require("./commands/forgot-password"));
182
182
  const verify_password_1 = __importDefault(require("./commands/verify-password"));
183
183
  const verify_totp_1 = __importDefault(require("./commands/verify-totp"));
184
+ const request_upload_url_1 = __importDefault(require("./commands/request-upload-url"));
185
+ const confirm_upload_1 = __importDefault(require("./commands/confirm-upload"));
186
+ const provision_bucket_1 = __importDefault(require("./commands/provision-bucket"));
184
187
  const createCommandMap = () => ({
185
188
  context: context_1.default,
186
189
  auth: auth_1.default,
@@ -353,8 +356,11 @@ const createCommandMap = () => ({
353
356
  'forgot-password': forgot_password_1.default,
354
357
  'verify-password': verify_password_1.default,
355
358
  'verify-totp': verify_totp_1.default,
359
+ 'request-upload-url': request_upload_url_1.default,
360
+ 'confirm-upload': confirm_upload_1.default,
361
+ 'provision-bucket': provision_bucket_1.default,
356
362
  });
357
- const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n invite invite CRUD operations\n claimed-invite claimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n submit-invite-code submitInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with all nodes[], fields[], policies[], grants, and table-level indexes/fts/unique_constraints in a single call, (2) provision_relation() for each relation, (3) provision_index() for top-level indexes, (4) provision_full_text_search() for top-level FTS, (5) provision_unique_constraint() for top-level unique constraints. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n verify-password verifyPassword\n verify-totp verifyTotp\n\n --help, -h Show this help message\n --version, -v Show version\n";
363
+ const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n org-limit orgLimit CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n connected-account connectedAccount CRUD operations\n invite invite CRUD operations\n claimed-invite claimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n submit-invite-code submitInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Five phases: (1) provision_table() for each table with all nodes[], fields[], policies[], grants, and table-level indexes/fts/unique_constraints in a single call, (2) provision_relation() for each relation, (3) provision_index() for top-level indexes, (4) provision_full_text_search() for top-level FTS, (5) provision_unique_constraint() for top-level unique constraints. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-one-time-token signInOneTimeToken\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n verify-password verifyPassword\n verify-totp verifyTotp\n request-upload-url Request a presigned URL for uploading a file directly to S3.\nClient computes SHA-256 of the file content and provides it here.\nIf a file with the same hash already exists (dedup), returns the\nexisting file ID and deduplicated=true with no uploadUrl.\n confirm-upload Confirm that a file has been uploaded to S3.\nVerifies the object exists in S3, checks content-type,\nand transitions the file status from 'pending' to 'ready'.\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";
358
364
  const commands = async (argv, prompter, options) => {
359
365
  if (argv.help || argv.h) {
360
366
  console.log(usage);
@@ -416,5 +416,20 @@ export declare function getClient(contextName?: string): {
416
416
  } & import("../orm").StrictSelect<S, import("../orm/input-types").VerifyTotpPayloadSelect>) => import("../orm").QueryBuilder<{
417
417
  verifyTotp: import("../orm").InferSelectResult<import("../orm/input-types").VerifyTotpPayload, S> | null;
418
418
  }>;
419
+ requestUploadUrl: <S extends import("../orm/input-types").RequestUploadUrlPayloadSelect>(args: import("../orm/mutation").RequestUploadUrlVariables, options: {
420
+ select: S;
421
+ } & import("../orm").StrictSelect<S, import("../orm/input-types").RequestUploadUrlPayloadSelect>) => import("../orm").QueryBuilder<{
422
+ requestUploadUrl: import("../orm").InferSelectResult<import("../orm/input-types").RequestUploadUrlPayload, S> | null;
423
+ }>;
424
+ confirmUpload: <S extends import("../orm/input-types").ConfirmUploadPayloadSelect>(args: import("../orm/mutation").ConfirmUploadVariables, options: {
425
+ select: S;
426
+ } & import("../orm").StrictSelect<S, import("../orm/input-types").ConfirmUploadPayloadSelect>) => import("../orm").QueryBuilder<{
427
+ confirmUpload: import("../orm").InferSelectResult<import("../orm/input-types").ConfirmUploadPayload, S> | null;
428
+ }>;
429
+ provisionBucket: <S extends import("../orm/input-types").ProvisionBucketPayloadSelect>(args: import("../orm/mutation").ProvisionBucketVariables, options: {
430
+ select: S;
431
+ } & import("../orm").StrictSelect<S, import("../orm/input-types").ProvisionBucketPayloadSelect>) => import("../orm").QueryBuilder<{
432
+ provisionBucket: import("../orm").InferSelectResult<import("../orm/input-types").ProvisionBucketPayload, S> | null;
433
+ }>;
419
434
  };
420
435
  };
@@ -555,5 +555,20 @@ export declare function createClient(config: OrmClientConfig): {
555
555
  } & import("./select-types").StrictSelect<S, import("./input-types").VerifyTotpPayloadSelect>) => import("./query-builder").QueryBuilder<{
556
556
  verifyTotp: import("./select-types").InferSelectResult<import("./input-types").VerifyTotpPayload, S> | null;
557
557
  }>;
558
+ requestUploadUrl: <S extends import("./input-types").RequestUploadUrlPayloadSelect>(args: import("./mutation").RequestUploadUrlVariables, options: {
559
+ select: S;
560
+ } & import("./select-types").StrictSelect<S, import("./input-types").RequestUploadUrlPayloadSelect>) => import("./query-builder").QueryBuilder<{
561
+ requestUploadUrl: import("./select-types").InferSelectResult<import("./input-types").RequestUploadUrlPayload, S> | null;
562
+ }>;
563
+ confirmUpload: <S extends import("./input-types").ConfirmUploadPayloadSelect>(args: import("./mutation").ConfirmUploadVariables, options: {
564
+ select: S;
565
+ } & import("./select-types").StrictSelect<S, import("./input-types").ConfirmUploadPayloadSelect>) => import("./query-builder").QueryBuilder<{
566
+ confirmUpload: import("./select-types").InferSelectResult<import("./input-types").ConfirmUploadPayload, S> | null;
567
+ }>;
568
+ provisionBucket: <S extends import("./input-types").ProvisionBucketPayloadSelect>(args: import("./mutation").ProvisionBucketVariables, options: {
569
+ select: S;
570
+ } & import("./select-types").StrictSelect<S, import("./input-types").ProvisionBucketPayloadSelect>) => import("./query-builder").QueryBuilder<{
571
+ provisionBucket: import("./select-types").InferSelectResult<import("./input-types").ProvisionBucketPayload, S> | null;
572
+ }>;
558
573
  };
559
574
  };