@constructive-sdk/cli 0.20.3 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/cli/commands/{request-upload-url.d.ts → app-limit-cap.d.ts} +1 -1
- package/admin/cli/commands/app-limit-cap.js +272 -0
- package/{esm/admin/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-caps-default.d.ts} +1 -1
- package/admin/cli/commands/app-limit-caps-default.js +252 -0
- package/{auth/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-credit-code-item.d.ts} +1 -1
- package/admin/cli/commands/app-limit-credit-code-item.js +292 -0
- package/{esm/auth/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-credit-code.d.ts} +1 -1
- package/admin/cli/commands/app-limit-credit-code.js +296 -0
- package/admin/cli/commands/app-limit-credit-redemption.d.ts +8 -0
- package/admin/cli/commands/app-limit-credit-redemption.js +250 -0
- package/admin/cli/commands/app-limit-credit.d.ts +8 -0
- package/admin/cli/commands/app-limit-credit.js +316 -0
- package/admin/cli/commands/app-limit.js +66 -0
- package/admin/cli/commands/org-limit-aggregate.js +88 -0
- package/admin/cli/commands/org-limit-cap.d.ts +8 -0
- package/admin/cli/commands/org-limit-cap.js +272 -0
- package/admin/cli/commands/org-limit-caps-default.d.ts +8 -0
- package/admin/cli/commands/org-limit-caps-default.js +252 -0
- package/admin/cli/commands/org-limit-credit.d.ts +8 -0
- package/admin/cli/commands/org-limit-credit.js +338 -0
- package/admin/cli/commands/org-limit.js +66 -0
- package/admin/cli/commands.js +25 -9
- package/admin/cli/executor.d.ts +12 -8
- package/admin/orm/index.d.ts +24 -11
- package/admin/orm/index.js +24 -6
- package/admin/orm/input-types.d.ts +2108 -545
- package/admin/orm/input-types.js +13 -1
- package/admin/orm/models/appLimitCap.d.ts +56 -0
- package/admin/orm/models/appLimitCap.js +100 -0
- package/admin/orm/models/appLimitCapsDefault.d.ts +56 -0
- package/admin/orm/models/appLimitCapsDefault.js +100 -0
- package/admin/orm/models/appLimitCredit.d.ts +56 -0
- package/admin/orm/models/appLimitCredit.js +100 -0
- package/admin/orm/models/appLimitCreditCode.d.ts +56 -0
- package/admin/orm/models/appLimitCreditCode.js +100 -0
- package/admin/orm/models/appLimitCreditCodeItem.d.ts +56 -0
- package/admin/orm/models/appLimitCreditCodeItem.js +100 -0
- package/admin/orm/models/appLimitCreditRedemption.d.ts +56 -0
- package/admin/orm/models/appLimitCreditRedemption.js +100 -0
- package/admin/orm/models/index.d.ts +12 -3
- package/admin/orm/models/index.js +25 -7
- package/admin/orm/models/orgLimitCap.d.ts +56 -0
- package/admin/orm/models/orgLimitCap.js +100 -0
- package/admin/orm/models/orgLimitCapsDefault.d.ts +56 -0
- package/admin/orm/models/orgLimitCapsDefault.js +100 -0
- package/admin/orm/models/orgLimitCredit.d.ts +56 -0
- package/admin/orm/models/orgLimitCredit.js +100 -0
- package/admin/orm/mutation/index.d.ts +1 -16
- package/admin/orm/mutation/index.js +0 -12
- package/admin/orm/query-builder.js +24 -0
- package/auth/cli/commands.js +1 -3
- package/auth/cli/executor.d.ts +0 -5
- package/auth/orm/index.d.ts +0 -5
- package/auth/orm/input-types.d.ts +0 -38
- package/auth/orm/mutation/index.d.ts +1 -16
- package/auth/orm/mutation/index.js +0 -12
- package/auth/orm/query-builder.js +24 -0
- package/esm/admin/cli/commands/app-limit-cap.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-cap.js +270 -0
- package/esm/admin/cli/commands/app-limit-caps-default.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-caps-default.js +250 -0
- package/esm/admin/cli/commands/app-limit-credit-code-item.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-credit-code-item.js +290 -0
- package/esm/admin/cli/commands/app-limit-credit-code.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-credit-code.js +294 -0
- package/esm/admin/cli/commands/app-limit-credit-redemption.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-credit-redemption.js +248 -0
- package/esm/admin/cli/commands/app-limit-credit.d.ts +8 -0
- package/esm/admin/cli/commands/app-limit-credit.js +314 -0
- package/esm/admin/cli/commands/app-limit.js +66 -0
- package/esm/admin/cli/commands/org-limit-aggregate.js +88 -0
- package/esm/admin/cli/commands/org-limit-cap.d.ts +8 -0
- package/esm/admin/cli/commands/org-limit-cap.js +270 -0
- package/esm/admin/cli/commands/org-limit-caps-default.d.ts +8 -0
- package/esm/admin/cli/commands/org-limit-caps-default.js +250 -0
- package/esm/admin/cli/commands/org-limit-credit.d.ts +8 -0
- package/esm/admin/cli/commands/org-limit-credit.js +336 -0
- package/esm/admin/cli/commands/org-limit.js +66 -0
- package/esm/admin/cli/commands.js +25 -9
- package/esm/admin/cli/executor.d.ts +12 -8
- package/esm/admin/orm/index.d.ts +24 -11
- package/esm/admin/orm/index.js +24 -6
- package/esm/admin/orm/input-types.d.ts +2108 -545
- package/esm/admin/orm/input-types.js +13 -1
- package/esm/admin/orm/models/appLimitCap.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCap.js +96 -0
- package/esm/admin/orm/models/appLimitCapsDefault.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCapsDefault.js +96 -0
- package/esm/admin/orm/models/appLimitCredit.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCredit.js +96 -0
- package/esm/admin/orm/models/appLimitCreditCode.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCreditCode.js +96 -0
- package/esm/admin/orm/models/appLimitCreditCodeItem.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCreditCodeItem.js +96 -0
- package/esm/admin/orm/models/appLimitCreditRedemption.d.ts +56 -0
- package/esm/admin/orm/models/appLimitCreditRedemption.js +96 -0
- package/esm/admin/orm/models/index.d.ts +12 -3
- package/esm/admin/orm/models/index.js +12 -3
- package/esm/admin/orm/models/orgLimitCap.d.ts +56 -0
- package/esm/admin/orm/models/orgLimitCap.js +96 -0
- package/esm/admin/orm/models/orgLimitCapsDefault.d.ts +56 -0
- package/esm/admin/orm/models/orgLimitCapsDefault.js +96 -0
- package/esm/admin/orm/models/orgLimitCredit.d.ts +56 -0
- package/esm/admin/orm/models/orgLimitCredit.js +96 -0
- package/esm/admin/orm/mutation/index.d.ts +1 -16
- package/esm/admin/orm/mutation/index.js +0 -12
- package/esm/admin/orm/query-builder.js +24 -0
- package/esm/auth/cli/commands.js +1 -3
- package/esm/auth/cli/executor.d.ts +0 -5
- package/esm/auth/orm/index.d.ts +0 -5
- package/esm/auth/orm/input-types.d.ts +0 -38
- package/esm/auth/orm/mutation/index.d.ts +1 -16
- package/esm/auth/orm/mutation/index.js +0 -12
- package/esm/auth/orm/query-builder.js +24 -0
- package/esm/objects/cli/commands.js +1 -3
- package/esm/objects/cli/executor.d.ts +0 -5
- package/esm/objects/orm/index.d.ts +0 -5
- package/esm/objects/orm/input-types.d.ts +0 -38
- package/esm/objects/orm/mutation/index.d.ts +1 -16
- package/esm/objects/orm/mutation/index.js +0 -12
- package/esm/objects/orm/query-builder.js +24 -0
- package/esm/public/cli/commands/api-setting.d.ts +8 -0
- package/esm/public/cli/commands/api-setting.js +468 -0
- package/esm/public/cli/commands/app-limit-cap.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-cap.js +270 -0
- package/esm/public/cli/commands/app-limit-caps-default.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-caps-default.js +250 -0
- package/esm/public/cli/commands/app-limit-credit-code-item.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-credit-code-item.js +290 -0
- package/esm/public/cli/commands/app-limit-credit-code.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-credit-code.js +294 -0
- package/esm/public/cli/commands/app-limit-credit-redemption.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-credit-redemption.js +248 -0
- package/esm/public/cli/commands/app-limit-credit.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-credit.js +314 -0
- package/esm/public/cli/commands/app-limit.js +66 -0
- package/esm/public/cli/commands/append-smart-tags.d.ts +8 -0
- package/esm/{admin/cli/commands/request-upload-url.js → public/cli/commands/append-smart-tags.js} +3 -3
- package/esm/public/cli/commands/billing-provider-module.d.ts +8 -0
- package/esm/public/cli/commands/billing-provider-module.js +624 -0
- package/esm/public/cli/commands/cors-setting.d.ts +8 -0
- package/esm/public/cli/commands/cors-setting.js +272 -0
- package/esm/public/cli/commands/database-setting.d.ts +8 -0
- package/esm/public/cli/commands/database-setting.js +448 -0
- package/esm/public/cli/commands/entity-type-provision.js +22 -0
- package/esm/public/cli/commands/function.d.ts +8 -0
- package/esm/public/cli/commands/function.js +268 -0
- package/esm/public/cli/commands/limits-module.js +198 -0
- package/esm/public/cli/commands/org-limit-aggregate.js +88 -0
- package/esm/public/cli/commands/org-limit-cap.d.ts +8 -0
- package/esm/public/cli/commands/org-limit-cap.js +270 -0
- package/esm/public/cli/commands/org-limit-caps-default.d.ts +8 -0
- package/esm/public/cli/commands/org-limit-caps-default.js +250 -0
- package/esm/public/cli/commands/org-limit-credit.d.ts +8 -0
- package/esm/public/cli/commands/org-limit-credit.js +336 -0
- package/esm/public/cli/commands/org-limit.js +66 -0
- package/esm/public/cli/commands/partition.d.ts +8 -0
- package/esm/public/cli/commands/partition.js +388 -0
- package/esm/public/cli/commands/plans-module.js +44 -0
- package/esm/public/cli/commands/pubkey-setting.d.ts +8 -0
- package/esm/public/cli/commands/pubkey-setting.js +382 -0
- package/esm/public/cli/commands/rls-setting.d.ts +8 -0
- package/esm/public/cli/commands/rls-setting.js +404 -0
- package/esm/public/cli/commands/storage-module.js +198 -0
- package/esm/public/cli/commands/webauthn-setting.d.ts +8 -0
- package/esm/public/cli/commands/webauthn-setting.js +580 -0
- package/esm/public/cli/commands.js +41 -5
- package/esm/public/cli/executor.d.ts +24 -6
- package/esm/public/orm/index.d.ts +43 -7
- package/esm/public/orm/index.js +38 -2
- package/esm/public/orm/input-types.d.ts +4601 -321
- package/esm/public/orm/input-types.js +21 -0
- package/esm/public/orm/models/apiSetting.d.ts +56 -0
- package/esm/public/orm/models/apiSetting.js +96 -0
- package/esm/public/orm/models/appLimitCap.d.ts +56 -0
- package/esm/public/orm/models/appLimitCap.js +96 -0
- package/esm/public/orm/models/appLimitCapsDefault.d.ts +56 -0
- package/esm/public/orm/models/appLimitCapsDefault.js +96 -0
- package/esm/public/orm/models/appLimitCredit.d.ts +56 -0
- package/esm/public/orm/models/appLimitCredit.js +96 -0
- package/esm/public/orm/models/appLimitCreditCode.d.ts +56 -0
- package/esm/public/orm/models/appLimitCreditCode.js +96 -0
- package/esm/public/orm/models/appLimitCreditCodeItem.d.ts +56 -0
- package/esm/public/orm/models/appLimitCreditCodeItem.js +96 -0
- package/esm/public/orm/models/appLimitCreditRedemption.d.ts +56 -0
- package/esm/public/orm/models/appLimitCreditRedemption.js +96 -0
- package/esm/public/orm/models/billingProviderModule.d.ts +56 -0
- package/esm/public/orm/models/billingProviderModule.js +96 -0
- package/esm/public/orm/models/corsSetting.d.ts +56 -0
- package/esm/public/orm/models/corsSetting.js +96 -0
- package/esm/public/orm/models/databaseSetting.d.ts +56 -0
- package/esm/public/orm/models/databaseSetting.js +96 -0
- package/esm/public/orm/models/function.d.ts +56 -0
- package/esm/public/orm/models/function.js +96 -0
- package/esm/public/orm/models/index.d.ts +19 -1
- package/esm/public/orm/models/index.js +19 -1
- package/esm/public/orm/models/orgLimitCap.d.ts +56 -0
- package/esm/public/orm/models/orgLimitCap.js +96 -0
- package/esm/public/orm/models/orgLimitCapsDefault.d.ts +56 -0
- package/esm/public/orm/models/orgLimitCapsDefault.js +96 -0
- package/esm/public/orm/models/orgLimitCredit.d.ts +56 -0
- package/esm/public/orm/models/orgLimitCredit.js +96 -0
- package/esm/public/orm/models/partition.d.ts +56 -0
- package/esm/public/orm/models/partition.js +96 -0
- package/esm/public/orm/models/pubkeySetting.d.ts +56 -0
- package/esm/public/orm/models/pubkeySetting.js +96 -0
- package/esm/public/orm/models/rlsSetting.d.ts +56 -0
- package/esm/public/orm/models/rlsSetting.js +96 -0
- package/esm/public/orm/models/webauthnSetting.d.ts +56 -0
- package/esm/public/orm/models/webauthnSetting.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +9 -16
- package/esm/public/orm/mutation/index.js +12 -12
- package/esm/public/orm/query-builder.js +24 -0
- package/objects/cli/commands.js +1 -3
- package/objects/cli/executor.d.ts +0 -5
- package/objects/orm/index.d.ts +0 -5
- package/objects/orm/input-types.d.ts +0 -38
- package/objects/orm/mutation/index.d.ts +1 -16
- package/objects/orm/mutation/index.js +0 -12
- package/objects/orm/query-builder.js +24 -0
- package/package.json +4 -4
- package/public/cli/commands/api-setting.d.ts +8 -0
- package/public/cli/commands/api-setting.js +470 -0
- package/public/cli/commands/app-limit-cap.d.ts +8 -0
- package/public/cli/commands/app-limit-cap.js +272 -0
- package/public/cli/commands/app-limit-caps-default.d.ts +8 -0
- package/public/cli/commands/app-limit-caps-default.js +252 -0
- package/public/cli/commands/app-limit-credit-code-item.d.ts +8 -0
- package/public/cli/commands/app-limit-credit-code-item.js +292 -0
- package/public/cli/commands/app-limit-credit-code.d.ts +8 -0
- package/public/cli/commands/app-limit-credit-code.js +296 -0
- package/public/cli/commands/app-limit-credit-redemption.d.ts +8 -0
- package/public/cli/commands/app-limit-credit-redemption.js +250 -0
- package/public/cli/commands/app-limit-credit.d.ts +8 -0
- package/public/cli/commands/app-limit-credit.js +316 -0
- package/public/cli/commands/app-limit.js +66 -0
- package/public/cli/commands/append-smart-tags.d.ts +8 -0
- package/{objects/cli/commands/request-upload-url.js → public/cli/commands/append-smart-tags.js} +3 -3
- package/public/cli/commands/billing-provider-module.d.ts +8 -0
- package/public/cli/commands/billing-provider-module.js +626 -0
- package/public/cli/commands/cors-setting.d.ts +8 -0
- package/public/cli/commands/cors-setting.js +274 -0
- package/public/cli/commands/database-setting.d.ts +8 -0
- package/public/cli/commands/database-setting.js +450 -0
- package/public/cli/commands/entity-type-provision.js +22 -0
- package/public/cli/commands/function.d.ts +8 -0
- package/public/cli/commands/function.js +270 -0
- package/public/cli/commands/limits-module.js +198 -0
- package/public/cli/commands/org-limit-aggregate.js +88 -0
- package/public/cli/commands/org-limit-cap.d.ts +8 -0
- package/public/cli/commands/org-limit-cap.js +272 -0
- package/public/cli/commands/org-limit-caps-default.d.ts +8 -0
- package/public/cli/commands/org-limit-caps-default.js +252 -0
- package/public/cli/commands/org-limit-credit.d.ts +8 -0
- package/public/cli/commands/org-limit-credit.js +338 -0
- package/public/cli/commands/org-limit.js +66 -0
- package/public/cli/commands/partition.d.ts +8 -0
- package/public/cli/commands/partition.js +390 -0
- package/public/cli/commands/plans-module.js +44 -0
- package/public/cli/commands/pubkey-setting.d.ts +8 -0
- package/public/cli/commands/pubkey-setting.js +384 -0
- package/public/cli/commands/rls-setting.d.ts +8 -0
- package/public/cli/commands/rls-setting.js +406 -0
- package/public/cli/commands/storage-module.js +198 -0
- package/public/cli/commands/webauthn-setting.d.ts +8 -0
- package/public/cli/commands/webauthn-setting.js +582 -0
- package/public/cli/commands.js +41 -5
- package/public/cli/executor.d.ts +24 -6
- package/public/orm/index.d.ts +43 -7
- package/public/orm/index.js +38 -2
- package/public/orm/input-types.d.ts +4601 -321
- package/public/orm/input-types.js +21 -0
- package/public/orm/models/apiSetting.d.ts +56 -0
- package/public/orm/models/apiSetting.js +100 -0
- package/public/orm/models/appLimitCap.d.ts +56 -0
- package/public/orm/models/appLimitCap.js +100 -0
- package/public/orm/models/appLimitCapsDefault.d.ts +56 -0
- package/public/orm/models/appLimitCapsDefault.js +100 -0
- package/public/orm/models/appLimitCredit.d.ts +56 -0
- package/public/orm/models/appLimitCredit.js +100 -0
- package/public/orm/models/appLimitCreditCode.d.ts +56 -0
- package/public/orm/models/appLimitCreditCode.js +100 -0
- package/public/orm/models/appLimitCreditCodeItem.d.ts +56 -0
- package/public/orm/models/appLimitCreditCodeItem.js +100 -0
- package/public/orm/models/appLimitCreditRedemption.d.ts +56 -0
- package/public/orm/models/appLimitCreditRedemption.js +100 -0
- package/public/orm/models/billingProviderModule.d.ts +56 -0
- package/public/orm/models/billingProviderModule.js +100 -0
- package/public/orm/models/corsSetting.d.ts +56 -0
- package/public/orm/models/corsSetting.js +100 -0
- package/public/orm/models/databaseSetting.d.ts +56 -0
- package/public/orm/models/databaseSetting.js +100 -0
- package/public/orm/models/function.d.ts +56 -0
- package/public/orm/models/function.js +100 -0
- package/public/orm/models/index.d.ts +19 -1
- package/public/orm/models/index.js +41 -5
- package/public/orm/models/orgLimitCap.d.ts +56 -0
- package/public/orm/models/orgLimitCap.js +100 -0
- package/public/orm/models/orgLimitCapsDefault.d.ts +56 -0
- package/public/orm/models/orgLimitCapsDefault.js +100 -0
- package/public/orm/models/orgLimitCredit.d.ts +56 -0
- package/public/orm/models/orgLimitCredit.js +100 -0
- package/public/orm/models/partition.d.ts +56 -0
- package/public/orm/models/partition.js +100 -0
- package/public/orm/models/pubkeySetting.d.ts +56 -0
- package/public/orm/models/pubkeySetting.js +100 -0
- package/public/orm/models/rlsSetting.d.ts +56 -0
- package/public/orm/models/rlsSetting.js +100 -0
- package/public/orm/models/webauthnSetting.d.ts +56 -0
- package/public/orm/models/webauthnSetting.js +100 -0
- package/public/orm/mutation/index.d.ts +9 -16
- package/public/orm/mutation/index.js +12 -12
- package/public/orm/query-builder.js +24 -0
- package/admin/cli/commands/request-upload-url.js +0 -36
- package/auth/cli/commands/request-upload-url.js +0 -36
- package/esm/auth/cli/commands/request-upload-url.js +0 -34
- package/esm/objects/cli/commands/request-upload-url.d.ts +0 -8
- package/esm/objects/cli/commands/request-upload-url.js +0 -34
- package/esm/public/cli/commands/request-upload-url.d.ts +0 -8
- package/esm/public/cli/commands/request-upload-url.js +0 -34
- package/objects/cli/commands/request-upload-url.d.ts +0 -8
- package/public/cli/commands/request-upload-url.d.ts +0 -8
- package/public/cli/commands/request-upload-url.js +0 -36
|
@@ -89,6 +89,30 @@ export function buildSelections(select, connectionFieldsMap, entityType) {
|
|
|
89
89
|
}
|
|
90
90
|
if (typeof value === 'object' && value !== null) {
|
|
91
91
|
const nested = value;
|
|
92
|
+
// Field with arguments (e.g. requestUploadUrl on bucket types)
|
|
93
|
+
if (nested.args && typeof nested.args === 'object') {
|
|
94
|
+
const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => t.argument({ name: argName, value: buildValueAst(argValue) }));
|
|
95
|
+
const nestedSelect = nested.select;
|
|
96
|
+
if (nestedSelect && typeof nestedSelect === 'object') {
|
|
97
|
+
const subSelections = Object.entries(nestedSelect)
|
|
98
|
+
.filter(([, v]) => v)
|
|
99
|
+
.map(([name]) => t.field({ name }));
|
|
100
|
+
fields.push(t.field({
|
|
101
|
+
name: key,
|
|
102
|
+
args: fieldArgs.length ? fieldArgs : undefined,
|
|
103
|
+
selectionSet: subSelections.length
|
|
104
|
+
? t.selectionSet({ selections: subSelections })
|
|
105
|
+
: undefined,
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
fields.push(t.field({
|
|
110
|
+
name: key,
|
|
111
|
+
args: fieldArgs.length ? fieldArgs : undefined,
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
92
116
|
if (!nested.select || typeof nested.select !== 'object') {
|
|
93
117
|
throw new Error(`Invalid selection for field "${key}": nested selections must include a "select" object.`);
|
|
94
118
|
}
|
package/objects/cli/commands.js
CHANGED
|
@@ -29,7 +29,6 @@ const set_props_and_commit_1 = __importDefault(require("./commands/set-props-and
|
|
|
29
29
|
const insert_node_at_path_1 = __importDefault(require("./commands/insert-node-at-path"));
|
|
30
30
|
const update_node_at_path_1 = __importDefault(require("./commands/update-node-at-path"));
|
|
31
31
|
const set_and_commit_1 = __importDefault(require("./commands/set-and-commit"));
|
|
32
|
-
const request_upload_url_1 = __importDefault(require("./commands/request-upload-url"));
|
|
33
32
|
const provision_bucket_1 = __importDefault(require("./commands/provision-bucket"));
|
|
34
33
|
const createCommandMap = () => ({
|
|
35
34
|
context: context_1.default,
|
|
@@ -51,10 +50,9 @@ const createCommandMap = () => ({
|
|
|
51
50
|
'insert-node-at-path': insert_node_at_path_1.default,
|
|
52
51
|
'update-node-at-path': update_node_at_path_1.default,
|
|
53
52
|
'set-and-commit': set_and_commit_1.default,
|
|
54
|
-
'request-upload-url': request_upload_url_1.default,
|
|
55
53
|
'provision-bucket': provision_bucket_1.default,
|
|
56
54
|
});
|
|
57
|
-
const usage = '\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n commit commit CRUD operations\n rev-parse revParse\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 freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n remove-node-at-path removeNodeAtPath\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n
|
|
55
|
+
const usage = '\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n get-all-record getAllRecord CRUD operations\n object object CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n commit commit CRUD operations\n rev-parse revParse\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 freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n remove-node-at-path removeNodeAtPath\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\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';
|
|
58
56
|
const commands = async (argv, prompter, options) => {
|
|
59
57
|
if (argv.help || argv.h) {
|
|
60
58
|
console.log(usage);
|
|
@@ -68,11 +68,6 @@ export declare function getClient(contextName?: string): {
|
|
|
68
68
|
} & import("../orm").StrictSelect<S, import("../orm/input-types").SetAndCommitPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
69
69
|
setAndCommit: import("../orm").InferSelectResult<import("../orm/input-types").SetAndCommitPayload, S> | null;
|
|
70
70
|
}>;
|
|
71
|
-
requestUploadUrl: <S extends import("../orm/input-types").RequestUploadUrlPayloadSelect>(args: import("../orm/mutation").RequestUploadUrlVariables, options: {
|
|
72
|
-
select: S;
|
|
73
|
-
} & import("../orm").StrictSelect<S, import("../orm/input-types").RequestUploadUrlPayloadSelect>) => import("../orm").QueryBuilder<{
|
|
74
|
-
requestUploadUrl: import("../orm").InferSelectResult<import("../orm/input-types").RequestUploadUrlPayload, S> | null;
|
|
75
|
-
}>;
|
|
76
71
|
provisionBucket: <S extends import("../orm/input-types").ProvisionBucketPayloadSelect>(args: import("../orm/mutation").ProvisionBucketVariables, options: {
|
|
77
72
|
select: S;
|
|
78
73
|
} & import("../orm").StrictSelect<S, import("../orm/input-types").ProvisionBucketPayloadSelect>) => import("../orm").QueryBuilder<{
|
package/objects/orm/index.d.ts
CHANGED
|
@@ -104,11 +104,6 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
104
104
|
} & import("./select-types").StrictSelect<S, import("./input-types").SetAndCommitPayloadSelect>) => import("./query-builder").QueryBuilder<{
|
|
105
105
|
setAndCommit: import("./select-types").InferSelectResult<import("./input-types").SetAndCommitPayload, S> | null;
|
|
106
106
|
}>;
|
|
107
|
-
requestUploadUrl: <S extends import("./input-types").RequestUploadUrlPayloadSelect>(args: import("./mutation").RequestUploadUrlVariables, options: {
|
|
108
|
-
select: S;
|
|
109
|
-
} & import("./select-types").StrictSelect<S, import("./input-types").RequestUploadUrlPayloadSelect>) => import("./query-builder").QueryBuilder<{
|
|
110
|
-
requestUploadUrl: import("./select-types").InferSelectResult<import("./input-types").RequestUploadUrlPayload, S> | null;
|
|
111
|
-
}>;
|
|
112
107
|
provisionBucket: <S extends import("./input-types").ProvisionBucketPayloadSelect>(args: import("./mutation").ProvisionBucketVariables, options: {
|
|
113
108
|
select: S;
|
|
114
109
|
} & import("./select-types").StrictSelect<S, import("./input-types").ProvisionBucketPayloadSelect>) => import("./query-builder").QueryBuilder<{
|
|
@@ -629,25 +629,6 @@ export interface SetAndCommitInput {
|
|
|
629
629
|
kids?: string[];
|
|
630
630
|
ktree?: string[];
|
|
631
631
|
}
|
|
632
|
-
export interface RequestUploadUrlInput {
|
|
633
|
-
/** Bucket key (e.g., "public", "private") */
|
|
634
|
-
bucketKey: string;
|
|
635
|
-
/**
|
|
636
|
-
* Owner entity ID for entity-scoped uploads.
|
|
637
|
-
* Omit for app-level (database-wide) storage.
|
|
638
|
-
* When provided, resolves the storage module for the entity type
|
|
639
|
-
* that owns this entity instance (e.g., a data room ID, team ID).
|
|
640
|
-
*/
|
|
641
|
-
ownerId?: string;
|
|
642
|
-
/** SHA-256 content hash computed by the client (hex-encoded, 64 chars) */
|
|
643
|
-
contentHash: string;
|
|
644
|
-
/** MIME type of the file (e.g., "image/png") */
|
|
645
|
-
contentType: string;
|
|
646
|
-
/** File size in bytes */
|
|
647
|
-
size: number;
|
|
648
|
-
/** Original filename (optional, for display and Content-Disposition) */
|
|
649
|
-
filename?: string;
|
|
650
|
-
}
|
|
651
632
|
export interface ProvisionBucketInput {
|
|
652
633
|
/** The logical bucket key (e.g., "public", "private") */
|
|
653
634
|
bucketKey: string;
|
|
@@ -736,25 +717,6 @@ export type SetAndCommitPayloadSelect = {
|
|
|
736
717
|
clientMutationId?: boolean;
|
|
737
718
|
result?: boolean;
|
|
738
719
|
};
|
|
739
|
-
export interface RequestUploadUrlPayload {
|
|
740
|
-
/** Presigned PUT URL (null if file was deduplicated) */
|
|
741
|
-
uploadUrl?: string | null;
|
|
742
|
-
/** The file ID (existing if deduplicated, new if fresh upload) */
|
|
743
|
-
fileId: string;
|
|
744
|
-
/** The S3 object key */
|
|
745
|
-
key: string;
|
|
746
|
-
/** Whether this file was deduplicated (already exists with same hash) */
|
|
747
|
-
deduplicated: boolean;
|
|
748
|
-
/** Presigned URL expiry time (null if deduplicated) */
|
|
749
|
-
expiresAt?: string | null;
|
|
750
|
-
}
|
|
751
|
-
export type RequestUploadUrlPayloadSelect = {
|
|
752
|
-
uploadUrl?: boolean;
|
|
753
|
-
fileId?: boolean;
|
|
754
|
-
key?: boolean;
|
|
755
|
-
deduplicated?: boolean;
|
|
756
|
-
expiresAt?: boolean;
|
|
757
|
-
};
|
|
758
720
|
export interface ProvisionBucketPayload {
|
|
759
721
|
/** Whether provisioning succeeded */
|
|
760
722
|
success: boolean;
|
|
@@ -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,
|
|
9
|
+
import type { FreezeObjectsInput, InitEmptyRepoInput, RemoveNodeAtPathInput, SetDataAtPathInput, SetPropsAndCommitInput, InsertNodeAtPathInput, UpdateNodeAtPathInput, SetAndCommitInput, ProvisionBucketInput, FreezeObjectsPayload, InitEmptyRepoPayload, RemoveNodeAtPathPayload, SetDataAtPathPayload, SetPropsAndCommitPayload, InsertNodeAtPathPayload, UpdateNodeAtPathPayload, SetAndCommitPayload, ProvisionBucketPayload, FreezeObjectsPayloadSelect, InitEmptyRepoPayloadSelect, RemoveNodeAtPathPayloadSelect, SetDataAtPathPayloadSelect, SetPropsAndCommitPayloadSelect, InsertNodeAtPathPayloadSelect, UpdateNodeAtPathPayloadSelect, SetAndCommitPayloadSelect, ProvisionBucketPayloadSelect } from '../input-types';
|
|
10
10
|
export interface FreezeObjectsVariables {
|
|
11
11
|
input: FreezeObjectsInput;
|
|
12
12
|
}
|
|
@@ -31,16 +31,6 @@ 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
34
|
/**
|
|
45
35
|
* Variables for provisionBucket
|
|
46
36
|
* Provision an S3 bucket for a logical bucket in the database.
|
|
@@ -92,11 +82,6 @@ export declare function createMutationOperations(client: OrmClient): {
|
|
|
92
82
|
} & StrictSelect<S, SetAndCommitPayloadSelect>) => QueryBuilder<{
|
|
93
83
|
setAndCommit: InferSelectResult<SetAndCommitPayload, S> | null;
|
|
94
84
|
}>;
|
|
95
|
-
requestUploadUrl: <S extends RequestUploadUrlPayloadSelect>(args: RequestUploadUrlVariables, options: {
|
|
96
|
-
select: S;
|
|
97
|
-
} & StrictSelect<S, RequestUploadUrlPayloadSelect>) => QueryBuilder<{
|
|
98
|
-
requestUploadUrl: InferSelectResult<RequestUploadUrlPayload, S> | null;
|
|
99
|
-
}>;
|
|
100
85
|
provisionBucket: <S extends ProvisionBucketPayloadSelect>(args: ProvisionBucketVariables, options: {
|
|
101
86
|
select: S;
|
|
102
87
|
} & StrictSelect<S, ProvisionBucketPayloadSelect>) => QueryBuilder<{
|
|
@@ -101,18 +101,6 @@ 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
104
|
provisionBucket: (args, options) => new query_builder_1.QueryBuilder({
|
|
117
105
|
client,
|
|
118
106
|
operation: 'mutation',
|
|
@@ -137,6 +137,30 @@ function buildSelections(select, connectionFieldsMap, entityType) {
|
|
|
137
137
|
}
|
|
138
138
|
if (typeof value === 'object' && value !== null) {
|
|
139
139
|
const nested = value;
|
|
140
|
+
// Field with arguments (e.g. requestUploadUrl on bucket types)
|
|
141
|
+
if (nested.args && typeof nested.args === 'object') {
|
|
142
|
+
const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => t.argument({ name: argName, value: buildValueAst(argValue) }));
|
|
143
|
+
const nestedSelect = nested.select;
|
|
144
|
+
if (nestedSelect && typeof nestedSelect === 'object') {
|
|
145
|
+
const subSelections = Object.entries(nestedSelect)
|
|
146
|
+
.filter(([, v]) => v)
|
|
147
|
+
.map(([name]) => t.field({ name }));
|
|
148
|
+
fields.push(t.field({
|
|
149
|
+
name: key,
|
|
150
|
+
args: fieldArgs.length ? fieldArgs : undefined,
|
|
151
|
+
selectionSet: subSelections.length
|
|
152
|
+
? t.selectionSet({ selections: subSelections })
|
|
153
|
+
: undefined,
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
fields.push(t.field({
|
|
158
|
+
name: key,
|
|
159
|
+
args: fieldArgs.length ? fieldArgs : undefined,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
140
164
|
if (!nested.select || typeof nested.select !== 'object') {
|
|
141
165
|
throw new Error(`Invalid selection for field "${key}": nested selections must include a "select" object.`);
|
|
142
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-sdk/cli",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.5",
|
|
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-query": "^3.21.
|
|
49
|
+
"@constructive-io/graphql-query": "^3.21.2",
|
|
50
50
|
"@constructive-io/graphql-types": "^3.8.0",
|
|
51
51
|
"appstash": "^0.7.0",
|
|
52
52
|
"gql-ast": "^3.8.0",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"yanse": "^0.2.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@constructive-io/graphql-codegen": "^4.38.
|
|
59
|
+
"@constructive-io/graphql-codegen": "^4.38.2",
|
|
60
60
|
"@types/node": "^22.19.11",
|
|
61
61
|
"makage": "^0.3.0",
|
|
62
62
|
"tsx": "^4.19.0",
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "38a99d5e61d756271a0024eb16d4f85923da936f"
|
|
66
66
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for ApiSetting
|
|
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;
|