@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
|
@@ -17,6 +17,9 @@ const fieldSchema = {
|
|
|
17
17
|
softMax: 'int',
|
|
18
18
|
windowStart: 'string',
|
|
19
19
|
windowDuration: 'string',
|
|
20
|
+
planMax: 'int',
|
|
21
|
+
purchasedCredits: 'int',
|
|
22
|
+
periodCredits: 'int',
|
|
20
23
|
};
|
|
21
24
|
const usage = '\napp-limit <command>\n\nCommands:\n list List appLimit records\n find-first Find first matching appLimit record\n get Get a appLimit by ID\n create Create a new appLimit\n update Update an existing appLimit\n delete Delete a appLimit\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\n --help, -h Show this help message\n';
|
|
22
25
|
exports.default = async (argv, prompter, _options) => {
|
|
@@ -68,6 +71,9 @@ async function handleList(argv, _prompter) {
|
|
|
68
71
|
softMax: true,
|
|
69
72
|
windowStart: true,
|
|
70
73
|
windowDuration: true,
|
|
74
|
+
planMax: true,
|
|
75
|
+
purchasedCredits: true,
|
|
76
|
+
periodCredits: true,
|
|
71
77
|
};
|
|
72
78
|
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
73
79
|
const client = (0, executor_1.getClient)();
|
|
@@ -93,6 +99,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
93
99
|
softMax: true,
|
|
94
100
|
windowStart: true,
|
|
95
101
|
windowDuration: true,
|
|
102
|
+
planMax: true,
|
|
103
|
+
purchasedCredits: true,
|
|
104
|
+
periodCredits: true,
|
|
96
105
|
};
|
|
97
106
|
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
98
107
|
const client = (0, executor_1.getClient)();
|
|
@@ -130,6 +139,9 @@ async function handleGet(argv, prompter) {
|
|
|
130
139
|
softMax: true,
|
|
131
140
|
windowStart: true,
|
|
132
141
|
windowDuration: true,
|
|
142
|
+
planMax: true,
|
|
143
|
+
purchasedCredits: true,
|
|
144
|
+
periodCredits: true,
|
|
133
145
|
},
|
|
134
146
|
})
|
|
135
147
|
.execute();
|
|
@@ -194,6 +206,27 @@ async function handleCreate(argv, prompter) {
|
|
|
194
206
|
required: false,
|
|
195
207
|
skipPrompt: true,
|
|
196
208
|
},
|
|
209
|
+
{
|
|
210
|
+
type: 'text',
|
|
211
|
+
name: 'planMax',
|
|
212
|
+
message: 'planMax',
|
|
213
|
+
required: false,
|
|
214
|
+
skipPrompt: true,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'text',
|
|
218
|
+
name: 'purchasedCredits',
|
|
219
|
+
message: 'purchasedCredits',
|
|
220
|
+
required: false,
|
|
221
|
+
skipPrompt: true,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'text',
|
|
225
|
+
name: 'periodCredits',
|
|
226
|
+
message: 'periodCredits',
|
|
227
|
+
required: false,
|
|
228
|
+
skipPrompt: true,
|
|
229
|
+
},
|
|
197
230
|
]);
|
|
198
231
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
199
232
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
@@ -208,6 +241,9 @@ async function handleCreate(argv, prompter) {
|
|
|
208
241
|
softMax: cleanedData.softMax,
|
|
209
242
|
windowStart: cleanedData.windowStart,
|
|
210
243
|
windowDuration: cleanedData.windowDuration,
|
|
244
|
+
planMax: cleanedData.planMax,
|
|
245
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
246
|
+
periodCredits: cleanedData.periodCredits,
|
|
211
247
|
},
|
|
212
248
|
select: {
|
|
213
249
|
id: true,
|
|
@@ -218,6 +254,9 @@ async function handleCreate(argv, prompter) {
|
|
|
218
254
|
softMax: true,
|
|
219
255
|
windowStart: true,
|
|
220
256
|
windowDuration: true,
|
|
257
|
+
planMax: true,
|
|
258
|
+
purchasedCredits: true,
|
|
259
|
+
periodCredits: true,
|
|
221
260
|
},
|
|
222
261
|
})
|
|
223
262
|
.execute();
|
|
@@ -288,6 +327,27 @@ async function handleUpdate(argv, prompter) {
|
|
|
288
327
|
required: false,
|
|
289
328
|
skipPrompt: true,
|
|
290
329
|
},
|
|
330
|
+
{
|
|
331
|
+
type: 'text',
|
|
332
|
+
name: 'planMax',
|
|
333
|
+
message: 'planMax',
|
|
334
|
+
required: false,
|
|
335
|
+
skipPrompt: true,
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
type: 'text',
|
|
339
|
+
name: 'purchasedCredits',
|
|
340
|
+
message: 'purchasedCredits',
|
|
341
|
+
required: false,
|
|
342
|
+
skipPrompt: true,
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
type: 'text',
|
|
346
|
+
name: 'periodCredits',
|
|
347
|
+
message: 'periodCredits',
|
|
348
|
+
required: false,
|
|
349
|
+
skipPrompt: true,
|
|
350
|
+
},
|
|
291
351
|
]);
|
|
292
352
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
293
353
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
@@ -305,6 +365,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
305
365
|
softMax: cleanedData.softMax,
|
|
306
366
|
windowStart: cleanedData.windowStart,
|
|
307
367
|
windowDuration: cleanedData.windowDuration,
|
|
368
|
+
planMax: cleanedData.planMax,
|
|
369
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
370
|
+
periodCredits: cleanedData.periodCredits,
|
|
308
371
|
},
|
|
309
372
|
select: {
|
|
310
373
|
id: true,
|
|
@@ -315,6 +378,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
315
378
|
softMax: true,
|
|
316
379
|
windowStart: true,
|
|
317
380
|
windowDuration: true,
|
|
381
|
+
planMax: true,
|
|
382
|
+
purchasedCredits: true,
|
|
383
|
+
periodCredits: true,
|
|
318
384
|
},
|
|
319
385
|
})
|
|
320
386
|
.execute();
|
|
@@ -17,6 +17,10 @@ const fieldSchema = {
|
|
|
17
17
|
softMax: 'int',
|
|
18
18
|
windowStart: 'string',
|
|
19
19
|
windowDuration: 'string',
|
|
20
|
+
planMax: 'int',
|
|
21
|
+
purchasedCredits: 'int',
|
|
22
|
+
periodCredits: 'int',
|
|
23
|
+
reserved: 'int',
|
|
20
24
|
};
|
|
21
25
|
const usage = '\norg-limit-aggregate <command>\n\nCommands:\n list List orgLimitAggregate records\n find-first Find first matching orgLimitAggregate record\n get Get a orgLimitAggregate by ID\n create Create a new orgLimitAggregate\n update Update an existing orgLimitAggregate\n delete Delete a orgLimitAggregate\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\n --help, -h Show this help message\n';
|
|
22
26
|
exports.default = async (argv, prompter, _options) => {
|
|
@@ -68,6 +72,10 @@ async function handleList(argv, _prompter) {
|
|
|
68
72
|
softMax: true,
|
|
69
73
|
windowStart: true,
|
|
70
74
|
windowDuration: true,
|
|
75
|
+
planMax: true,
|
|
76
|
+
purchasedCredits: true,
|
|
77
|
+
periodCredits: true,
|
|
78
|
+
reserved: true,
|
|
71
79
|
};
|
|
72
80
|
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
73
81
|
const client = (0, executor_1.getClient)();
|
|
@@ -93,6 +101,10 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
93
101
|
softMax: true,
|
|
94
102
|
windowStart: true,
|
|
95
103
|
windowDuration: true,
|
|
104
|
+
planMax: true,
|
|
105
|
+
purchasedCredits: true,
|
|
106
|
+
periodCredits: true,
|
|
107
|
+
reserved: true,
|
|
96
108
|
};
|
|
97
109
|
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
98
110
|
const client = (0, executor_1.getClient)();
|
|
@@ -130,6 +142,10 @@ async function handleGet(argv, prompter) {
|
|
|
130
142
|
softMax: true,
|
|
131
143
|
windowStart: true,
|
|
132
144
|
windowDuration: true,
|
|
145
|
+
planMax: true,
|
|
146
|
+
purchasedCredits: true,
|
|
147
|
+
periodCredits: true,
|
|
148
|
+
reserved: true,
|
|
133
149
|
},
|
|
134
150
|
})
|
|
135
151
|
.execute();
|
|
@@ -194,6 +210,34 @@ async function handleCreate(argv, prompter) {
|
|
|
194
210
|
required: false,
|
|
195
211
|
skipPrompt: true,
|
|
196
212
|
},
|
|
213
|
+
{
|
|
214
|
+
type: 'text',
|
|
215
|
+
name: 'planMax',
|
|
216
|
+
message: 'planMax',
|
|
217
|
+
required: false,
|
|
218
|
+
skipPrompt: true,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
type: 'text',
|
|
222
|
+
name: 'purchasedCredits',
|
|
223
|
+
message: 'purchasedCredits',
|
|
224
|
+
required: false,
|
|
225
|
+
skipPrompt: true,
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
type: 'text',
|
|
229
|
+
name: 'periodCredits',
|
|
230
|
+
message: 'periodCredits',
|
|
231
|
+
required: false,
|
|
232
|
+
skipPrompt: true,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'text',
|
|
236
|
+
name: 'reserved',
|
|
237
|
+
message: 'reserved',
|
|
238
|
+
required: false,
|
|
239
|
+
skipPrompt: true,
|
|
240
|
+
},
|
|
197
241
|
]);
|
|
198
242
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
199
243
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
@@ -208,6 +252,10 @@ async function handleCreate(argv, prompter) {
|
|
|
208
252
|
softMax: cleanedData.softMax,
|
|
209
253
|
windowStart: cleanedData.windowStart,
|
|
210
254
|
windowDuration: cleanedData.windowDuration,
|
|
255
|
+
planMax: cleanedData.planMax,
|
|
256
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
257
|
+
periodCredits: cleanedData.periodCredits,
|
|
258
|
+
reserved: cleanedData.reserved,
|
|
211
259
|
},
|
|
212
260
|
select: {
|
|
213
261
|
id: true,
|
|
@@ -218,6 +266,10 @@ async function handleCreate(argv, prompter) {
|
|
|
218
266
|
softMax: true,
|
|
219
267
|
windowStart: true,
|
|
220
268
|
windowDuration: true,
|
|
269
|
+
planMax: true,
|
|
270
|
+
purchasedCredits: true,
|
|
271
|
+
periodCredits: true,
|
|
272
|
+
reserved: true,
|
|
221
273
|
},
|
|
222
274
|
})
|
|
223
275
|
.execute();
|
|
@@ -288,6 +340,34 @@ async function handleUpdate(argv, prompter) {
|
|
|
288
340
|
required: false,
|
|
289
341
|
skipPrompt: true,
|
|
290
342
|
},
|
|
343
|
+
{
|
|
344
|
+
type: 'text',
|
|
345
|
+
name: 'planMax',
|
|
346
|
+
message: 'planMax',
|
|
347
|
+
required: false,
|
|
348
|
+
skipPrompt: true,
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
type: 'text',
|
|
352
|
+
name: 'purchasedCredits',
|
|
353
|
+
message: 'purchasedCredits',
|
|
354
|
+
required: false,
|
|
355
|
+
skipPrompt: true,
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
type: 'text',
|
|
359
|
+
name: 'periodCredits',
|
|
360
|
+
message: 'periodCredits',
|
|
361
|
+
required: false,
|
|
362
|
+
skipPrompt: true,
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
type: 'text',
|
|
366
|
+
name: 'reserved',
|
|
367
|
+
message: 'reserved',
|
|
368
|
+
required: false,
|
|
369
|
+
skipPrompt: true,
|
|
370
|
+
},
|
|
291
371
|
]);
|
|
292
372
|
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
293
373
|
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
@@ -305,6 +385,10 @@ async function handleUpdate(argv, prompter) {
|
|
|
305
385
|
softMax: cleanedData.softMax,
|
|
306
386
|
windowStart: cleanedData.windowStart,
|
|
307
387
|
windowDuration: cleanedData.windowDuration,
|
|
388
|
+
planMax: cleanedData.planMax,
|
|
389
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
390
|
+
periodCredits: cleanedData.periodCredits,
|
|
391
|
+
reserved: cleanedData.reserved,
|
|
308
392
|
},
|
|
309
393
|
select: {
|
|
310
394
|
id: true,
|
|
@@ -315,6 +399,10 @@ async function handleUpdate(argv, prompter) {
|
|
|
315
399
|
softMax: true,
|
|
316
400
|
windowStart: true,
|
|
317
401
|
windowDuration: true,
|
|
402
|
+
planMax: true,
|
|
403
|
+
purchasedCredits: true,
|
|
404
|
+
periodCredits: true,
|
|
405
|
+
reserved: true,
|
|
318
406
|
},
|
|
319
407
|
})
|
|
320
408
|
.execute();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgLimitCap
|
|
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,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for OrgLimitCap
|
|
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
|
+
name: 'string',
|
|
14
|
+
entityId: 'uuid',
|
|
15
|
+
max: 'int',
|
|
16
|
+
};
|
|
17
|
+
const usage = '\norg-limit-cap <command>\n\nCommands:\n list List orgLimitCap records\n find-first Find first matching orgLimitCap record\n get Get a orgLimitCap by ID\n create Create a new orgLimitCap\n update Update an existing orgLimitCap\n delete Delete a orgLimitCap\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\n --help, -h Show this help message\n';
|
|
18
|
+
exports.default = async (argv, prompter, _options) => {
|
|
19
|
+
if (argv.help || argv.h) {
|
|
20
|
+
console.log(usage);
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
24
|
+
if (!subcommand) {
|
|
25
|
+
const answer = await prompter.prompt(argv, [
|
|
26
|
+
{
|
|
27
|
+
type: 'autocomplete',
|
|
28
|
+
name: 'subcommand',
|
|
29
|
+
message: 'What do you want to do?',
|
|
30
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
34
|
+
}
|
|
35
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
36
|
+
};
|
|
37
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
38
|
+
switch (subcommand) {
|
|
39
|
+
case 'list':
|
|
40
|
+
return handleList(argv, prompter);
|
|
41
|
+
case 'find-first':
|
|
42
|
+
return handleFindFirst(argv, prompter);
|
|
43
|
+
case 'get':
|
|
44
|
+
return handleGet(argv, prompter);
|
|
45
|
+
case 'create':
|
|
46
|
+
return handleCreate(argv, prompter);
|
|
47
|
+
case 'update':
|
|
48
|
+
return handleUpdate(argv, prompter);
|
|
49
|
+
case 'delete':
|
|
50
|
+
return handleDelete(argv, prompter);
|
|
51
|
+
default:
|
|
52
|
+
console.log(usage);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function handleList(argv, _prompter) {
|
|
57
|
+
try {
|
|
58
|
+
const defaultSelect = {
|
|
59
|
+
id: true,
|
|
60
|
+
name: true,
|
|
61
|
+
entityId: true,
|
|
62
|
+
max: true,
|
|
63
|
+
};
|
|
64
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
65
|
+
const client = (0, executor_1.getClient)();
|
|
66
|
+
const result = await client.orgLimitCap.findMany(findManyArgs).execute();
|
|
67
|
+
console.log(JSON.stringify(result, null, 2));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error('Failed to list records.');
|
|
71
|
+
if (error instanceof Error) {
|
|
72
|
+
console.error(error.message);
|
|
73
|
+
}
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function handleFindFirst(argv, _prompter) {
|
|
78
|
+
try {
|
|
79
|
+
const defaultSelect = {
|
|
80
|
+
id: true,
|
|
81
|
+
name: true,
|
|
82
|
+
entityId: true,
|
|
83
|
+
max: true,
|
|
84
|
+
};
|
|
85
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
86
|
+
const client = (0, executor_1.getClient)();
|
|
87
|
+
const result = await client.orgLimitCap.findFirst(findFirstArgs).execute();
|
|
88
|
+
console.log(JSON.stringify(result, null, 2));
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error('Failed to find record.');
|
|
92
|
+
if (error instanceof Error) {
|
|
93
|
+
console.error(error.message);
|
|
94
|
+
}
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function handleGet(argv, prompter) {
|
|
99
|
+
try {
|
|
100
|
+
const answers = await prompter.prompt(argv, [
|
|
101
|
+
{
|
|
102
|
+
type: 'text',
|
|
103
|
+
name: 'id',
|
|
104
|
+
message: 'id',
|
|
105
|
+
required: true,
|
|
106
|
+
},
|
|
107
|
+
]);
|
|
108
|
+
const client = (0, executor_1.getClient)();
|
|
109
|
+
const result = await client.orgLimitCap
|
|
110
|
+
.findOne({
|
|
111
|
+
id: answers.id,
|
|
112
|
+
select: {
|
|
113
|
+
id: true,
|
|
114
|
+
name: true,
|
|
115
|
+
entityId: true,
|
|
116
|
+
max: true,
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
.execute();
|
|
120
|
+
console.log(JSON.stringify(result, null, 2));
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
console.error('Record not found.');
|
|
124
|
+
if (error instanceof Error) {
|
|
125
|
+
console.error(error.message);
|
|
126
|
+
}
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function handleCreate(argv, prompter) {
|
|
131
|
+
try {
|
|
132
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
133
|
+
{
|
|
134
|
+
type: 'text',
|
|
135
|
+
name: 'name',
|
|
136
|
+
message: 'name',
|
|
137
|
+
required: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: 'text',
|
|
141
|
+
name: 'entityId',
|
|
142
|
+
message: 'entityId',
|
|
143
|
+
required: true,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
name: 'max',
|
|
148
|
+
message: 'max',
|
|
149
|
+
required: false,
|
|
150
|
+
skipPrompt: true,
|
|
151
|
+
},
|
|
152
|
+
]);
|
|
153
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
154
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
155
|
+
const client = (0, executor_1.getClient)();
|
|
156
|
+
const result = await client.orgLimitCap
|
|
157
|
+
.create({
|
|
158
|
+
data: {
|
|
159
|
+
name: cleanedData.name,
|
|
160
|
+
entityId: cleanedData.entityId,
|
|
161
|
+
max: cleanedData.max,
|
|
162
|
+
},
|
|
163
|
+
select: {
|
|
164
|
+
id: true,
|
|
165
|
+
name: true,
|
|
166
|
+
entityId: true,
|
|
167
|
+
max: true,
|
|
168
|
+
},
|
|
169
|
+
})
|
|
170
|
+
.execute();
|
|
171
|
+
console.log(JSON.stringify(result, null, 2));
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
console.error('Failed to create record.');
|
|
175
|
+
if (error instanceof Error) {
|
|
176
|
+
console.error(error.message);
|
|
177
|
+
}
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function handleUpdate(argv, prompter) {
|
|
182
|
+
try {
|
|
183
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
184
|
+
{
|
|
185
|
+
type: 'text',
|
|
186
|
+
name: 'id',
|
|
187
|
+
message: 'id',
|
|
188
|
+
required: true,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
name: 'name',
|
|
193
|
+
message: 'name',
|
|
194
|
+
required: false,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'text',
|
|
198
|
+
name: 'entityId',
|
|
199
|
+
message: 'entityId',
|
|
200
|
+
required: false,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: 'text',
|
|
204
|
+
name: 'max',
|
|
205
|
+
message: 'max',
|
|
206
|
+
required: false,
|
|
207
|
+
skipPrompt: true,
|
|
208
|
+
},
|
|
209
|
+
]);
|
|
210
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
211
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
212
|
+
const client = (0, executor_1.getClient)();
|
|
213
|
+
const result = await client.orgLimitCap
|
|
214
|
+
.update({
|
|
215
|
+
where: {
|
|
216
|
+
id: answers.id,
|
|
217
|
+
},
|
|
218
|
+
data: {
|
|
219
|
+
name: cleanedData.name,
|
|
220
|
+
entityId: cleanedData.entityId,
|
|
221
|
+
max: cleanedData.max,
|
|
222
|
+
},
|
|
223
|
+
select: {
|
|
224
|
+
id: true,
|
|
225
|
+
name: true,
|
|
226
|
+
entityId: true,
|
|
227
|
+
max: true,
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
.execute();
|
|
231
|
+
console.log(JSON.stringify(result, null, 2));
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
console.error('Failed to update record.');
|
|
235
|
+
if (error instanceof Error) {
|
|
236
|
+
console.error(error.message);
|
|
237
|
+
}
|
|
238
|
+
process.exit(1);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function handleDelete(argv, prompter) {
|
|
242
|
+
try {
|
|
243
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
244
|
+
{
|
|
245
|
+
type: 'text',
|
|
246
|
+
name: 'id',
|
|
247
|
+
message: 'id',
|
|
248
|
+
required: true,
|
|
249
|
+
},
|
|
250
|
+
]);
|
|
251
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
252
|
+
const client = (0, executor_1.getClient)();
|
|
253
|
+
const result = await client.orgLimitCap
|
|
254
|
+
.delete({
|
|
255
|
+
where: {
|
|
256
|
+
id: answers.id,
|
|
257
|
+
},
|
|
258
|
+
select: {
|
|
259
|
+
id: true,
|
|
260
|
+
},
|
|
261
|
+
})
|
|
262
|
+
.execute();
|
|
263
|
+
console.log(JSON.stringify(result, null, 2));
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
console.error('Failed to delete record.');
|
|
267
|
+
if (error instanceof Error) {
|
|
268
|
+
console.error(error.message);
|
|
269
|
+
}
|
|
270
|
+
process.exit(1);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgLimitCapsDefault
|
|
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;
|