@constructive-sdk/cli 0.20.4 → 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
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AppLimitCreditRedemption
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
creditCodeId: 'uuid',
|
|
12
|
+
entityId: 'uuid',
|
|
13
|
+
};
|
|
14
|
+
const usage = '\napp-limit-credit-redemption <command>\n\nCommands:\n list List appLimitCreditRedemption records\n find-first Find first matching appLimitCreditRedemption record\n get Get a appLimitCreditRedemption by ID\n create Create a new appLimitCreditRedemption\n update Update an existing appLimitCreditRedemption\n delete Delete a appLimitCreditRedemption\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';
|
|
15
|
+
export default async (argv, prompter, _options) => {
|
|
16
|
+
if (argv.help || argv.h) {
|
|
17
|
+
console.log(usage);
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
21
|
+
if (!subcommand) {
|
|
22
|
+
const answer = await prompter.prompt(argv, [
|
|
23
|
+
{
|
|
24
|
+
type: 'autocomplete',
|
|
25
|
+
name: 'subcommand',
|
|
26
|
+
message: 'What do you want to do?',
|
|
27
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
31
|
+
}
|
|
32
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
33
|
+
};
|
|
34
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
35
|
+
switch (subcommand) {
|
|
36
|
+
case 'list':
|
|
37
|
+
return handleList(argv, prompter);
|
|
38
|
+
case 'find-first':
|
|
39
|
+
return handleFindFirst(argv, prompter);
|
|
40
|
+
case 'get':
|
|
41
|
+
return handleGet(argv, prompter);
|
|
42
|
+
case 'create':
|
|
43
|
+
return handleCreate(argv, prompter);
|
|
44
|
+
case 'update':
|
|
45
|
+
return handleUpdate(argv, prompter);
|
|
46
|
+
case 'delete':
|
|
47
|
+
return handleDelete(argv, prompter);
|
|
48
|
+
default:
|
|
49
|
+
console.log(usage);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function handleList(argv, _prompter) {
|
|
54
|
+
try {
|
|
55
|
+
const defaultSelect = {
|
|
56
|
+
id: true,
|
|
57
|
+
creditCodeId: true,
|
|
58
|
+
entityId: true,
|
|
59
|
+
};
|
|
60
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
61
|
+
const client = getClient();
|
|
62
|
+
const result = await client.appLimitCreditRedemption.findMany(findManyArgs).execute();
|
|
63
|
+
console.log(JSON.stringify(result, null, 2));
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error('Failed to list records.');
|
|
67
|
+
if (error instanceof Error) {
|
|
68
|
+
console.error(error.message);
|
|
69
|
+
}
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async function handleFindFirst(argv, _prompter) {
|
|
74
|
+
try {
|
|
75
|
+
const defaultSelect = {
|
|
76
|
+
id: true,
|
|
77
|
+
creditCodeId: true,
|
|
78
|
+
entityId: true,
|
|
79
|
+
};
|
|
80
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
81
|
+
const client = getClient();
|
|
82
|
+
const result = await client.appLimitCreditRedemption.findFirst(findFirstArgs).execute();
|
|
83
|
+
console.log(JSON.stringify(result, null, 2));
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error('Failed to find record.');
|
|
87
|
+
if (error instanceof Error) {
|
|
88
|
+
console.error(error.message);
|
|
89
|
+
}
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function handleGet(argv, prompter) {
|
|
94
|
+
try {
|
|
95
|
+
const answers = await prompter.prompt(argv, [
|
|
96
|
+
{
|
|
97
|
+
type: 'text',
|
|
98
|
+
name: 'id',
|
|
99
|
+
message: 'id',
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
const client = getClient();
|
|
104
|
+
const result = await client.appLimitCreditRedemption
|
|
105
|
+
.findOne({
|
|
106
|
+
id: answers.id,
|
|
107
|
+
select: {
|
|
108
|
+
id: true,
|
|
109
|
+
creditCodeId: true,
|
|
110
|
+
entityId: true,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
.execute();
|
|
114
|
+
console.log(JSON.stringify(result, null, 2));
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error('Record not found.');
|
|
118
|
+
if (error instanceof Error) {
|
|
119
|
+
console.error(error.message);
|
|
120
|
+
}
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function handleCreate(argv, prompter) {
|
|
125
|
+
try {
|
|
126
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
127
|
+
{
|
|
128
|
+
type: 'text',
|
|
129
|
+
name: 'creditCodeId',
|
|
130
|
+
message: 'creditCodeId',
|
|
131
|
+
required: true,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: 'text',
|
|
135
|
+
name: 'entityId',
|
|
136
|
+
message: 'entityId',
|
|
137
|
+
required: true,
|
|
138
|
+
},
|
|
139
|
+
]);
|
|
140
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
141
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
142
|
+
const client = getClient();
|
|
143
|
+
const result = await client.appLimitCreditRedemption
|
|
144
|
+
.create({
|
|
145
|
+
data: {
|
|
146
|
+
creditCodeId: cleanedData.creditCodeId,
|
|
147
|
+
entityId: cleanedData.entityId,
|
|
148
|
+
},
|
|
149
|
+
select: {
|
|
150
|
+
id: true,
|
|
151
|
+
creditCodeId: true,
|
|
152
|
+
entityId: true,
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
.execute();
|
|
156
|
+
console.log(JSON.stringify(result, null, 2));
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('Failed to create record.');
|
|
160
|
+
if (error instanceof Error) {
|
|
161
|
+
console.error(error.message);
|
|
162
|
+
}
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
async function handleUpdate(argv, prompter) {
|
|
167
|
+
try {
|
|
168
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
name: 'id',
|
|
172
|
+
message: 'id',
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'text',
|
|
177
|
+
name: 'creditCodeId',
|
|
178
|
+
message: 'creditCodeId',
|
|
179
|
+
required: false,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
type: 'text',
|
|
183
|
+
name: 'entityId',
|
|
184
|
+
message: 'entityId',
|
|
185
|
+
required: false,
|
|
186
|
+
},
|
|
187
|
+
]);
|
|
188
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
189
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
190
|
+
const client = getClient();
|
|
191
|
+
const result = await client.appLimitCreditRedemption
|
|
192
|
+
.update({
|
|
193
|
+
where: {
|
|
194
|
+
id: answers.id,
|
|
195
|
+
},
|
|
196
|
+
data: {
|
|
197
|
+
creditCodeId: cleanedData.creditCodeId,
|
|
198
|
+
entityId: cleanedData.entityId,
|
|
199
|
+
},
|
|
200
|
+
select: {
|
|
201
|
+
id: true,
|
|
202
|
+
creditCodeId: true,
|
|
203
|
+
entityId: true,
|
|
204
|
+
},
|
|
205
|
+
})
|
|
206
|
+
.execute();
|
|
207
|
+
console.log(JSON.stringify(result, null, 2));
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
console.error('Failed to update record.');
|
|
211
|
+
if (error instanceof Error) {
|
|
212
|
+
console.error(error.message);
|
|
213
|
+
}
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async function handleDelete(argv, prompter) {
|
|
218
|
+
try {
|
|
219
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
220
|
+
{
|
|
221
|
+
type: 'text',
|
|
222
|
+
name: 'id',
|
|
223
|
+
message: 'id',
|
|
224
|
+
required: true,
|
|
225
|
+
},
|
|
226
|
+
]);
|
|
227
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
228
|
+
const client = getClient();
|
|
229
|
+
const result = await client.appLimitCreditRedemption
|
|
230
|
+
.delete({
|
|
231
|
+
where: {
|
|
232
|
+
id: answers.id,
|
|
233
|
+
},
|
|
234
|
+
select: {
|
|
235
|
+
id: true,
|
|
236
|
+
},
|
|
237
|
+
})
|
|
238
|
+
.execute();
|
|
239
|
+
console.log(JSON.stringify(result, null, 2));
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
console.error('Failed to delete record.');
|
|
243
|
+
if (error instanceof Error) {
|
|
244
|
+
console.error(error.message);
|
|
245
|
+
}
|
|
246
|
+
process.exit(1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AppLimitCredit
|
|
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,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AppLimitCredit
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
defaultLimitId: 'uuid',
|
|
12
|
+
actorId: 'uuid',
|
|
13
|
+
amount: 'int',
|
|
14
|
+
creditType: 'string',
|
|
15
|
+
reason: 'string',
|
|
16
|
+
};
|
|
17
|
+
const usage = '\napp-limit-credit <command>\n\nCommands:\n list List appLimitCredit records\n find-first Find first matching appLimitCredit record\n get Get a appLimitCredit by ID\n create Create a new appLimitCredit\n update Update an existing appLimitCredit\n delete Delete a appLimitCredit\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
|
+
export 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 } = 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
|
+
defaultLimitId: true,
|
|
61
|
+
actorId: true,
|
|
62
|
+
amount: true,
|
|
63
|
+
creditType: true,
|
|
64
|
+
reason: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
67
|
+
const client = getClient();
|
|
68
|
+
const result = await client.appLimitCredit.findMany(findManyArgs).execute();
|
|
69
|
+
console.log(JSON.stringify(result, null, 2));
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('Failed to list records.');
|
|
73
|
+
if (error instanceof Error) {
|
|
74
|
+
console.error(error.message);
|
|
75
|
+
}
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async function handleFindFirst(argv, _prompter) {
|
|
80
|
+
try {
|
|
81
|
+
const defaultSelect = {
|
|
82
|
+
id: true,
|
|
83
|
+
defaultLimitId: true,
|
|
84
|
+
actorId: true,
|
|
85
|
+
amount: true,
|
|
86
|
+
creditType: true,
|
|
87
|
+
reason: true,
|
|
88
|
+
};
|
|
89
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
90
|
+
const client = getClient();
|
|
91
|
+
const result = await client.appLimitCredit.findFirst(findFirstArgs).execute();
|
|
92
|
+
console.log(JSON.stringify(result, null, 2));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Failed to find record.');
|
|
96
|
+
if (error instanceof Error) {
|
|
97
|
+
console.error(error.message);
|
|
98
|
+
}
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async function handleGet(argv, prompter) {
|
|
103
|
+
try {
|
|
104
|
+
const answers = await prompter.prompt(argv, [
|
|
105
|
+
{
|
|
106
|
+
type: 'text',
|
|
107
|
+
name: 'id',
|
|
108
|
+
message: 'id',
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
]);
|
|
112
|
+
const client = getClient();
|
|
113
|
+
const result = await client.appLimitCredit
|
|
114
|
+
.findOne({
|
|
115
|
+
id: answers.id,
|
|
116
|
+
select: {
|
|
117
|
+
id: true,
|
|
118
|
+
defaultLimitId: true,
|
|
119
|
+
actorId: true,
|
|
120
|
+
amount: true,
|
|
121
|
+
creditType: true,
|
|
122
|
+
reason: true,
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
.execute();
|
|
126
|
+
console.log(JSON.stringify(result, null, 2));
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error('Record not found.');
|
|
130
|
+
if (error instanceof Error) {
|
|
131
|
+
console.error(error.message);
|
|
132
|
+
}
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async function handleCreate(argv, prompter) {
|
|
137
|
+
try {
|
|
138
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
139
|
+
{
|
|
140
|
+
type: 'text',
|
|
141
|
+
name: 'defaultLimitId',
|
|
142
|
+
message: 'defaultLimitId',
|
|
143
|
+
required: true,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
name: 'actorId',
|
|
148
|
+
message: 'actorId',
|
|
149
|
+
required: false,
|
|
150
|
+
skipPrompt: true,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: 'text',
|
|
154
|
+
name: 'amount',
|
|
155
|
+
message: 'amount',
|
|
156
|
+
required: true,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'text',
|
|
160
|
+
name: 'creditType',
|
|
161
|
+
message: 'creditType',
|
|
162
|
+
required: false,
|
|
163
|
+
skipPrompt: true,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: 'text',
|
|
167
|
+
name: 'reason',
|
|
168
|
+
message: 'reason',
|
|
169
|
+
required: false,
|
|
170
|
+
skipPrompt: true,
|
|
171
|
+
},
|
|
172
|
+
]);
|
|
173
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
174
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
175
|
+
const client = getClient();
|
|
176
|
+
const result = await client.appLimitCredit
|
|
177
|
+
.create({
|
|
178
|
+
data: {
|
|
179
|
+
defaultLimitId: cleanedData.defaultLimitId,
|
|
180
|
+
actorId: cleanedData.actorId,
|
|
181
|
+
amount: cleanedData.amount,
|
|
182
|
+
creditType: cleanedData.creditType,
|
|
183
|
+
reason: cleanedData.reason,
|
|
184
|
+
},
|
|
185
|
+
select: {
|
|
186
|
+
id: true,
|
|
187
|
+
defaultLimitId: true,
|
|
188
|
+
actorId: true,
|
|
189
|
+
amount: true,
|
|
190
|
+
creditType: true,
|
|
191
|
+
reason: true,
|
|
192
|
+
},
|
|
193
|
+
})
|
|
194
|
+
.execute();
|
|
195
|
+
console.log(JSON.stringify(result, null, 2));
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
console.error('Failed to create record.');
|
|
199
|
+
if (error instanceof Error) {
|
|
200
|
+
console.error(error.message);
|
|
201
|
+
}
|
|
202
|
+
process.exit(1);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async function handleUpdate(argv, prompter) {
|
|
206
|
+
try {
|
|
207
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
208
|
+
{
|
|
209
|
+
type: 'text',
|
|
210
|
+
name: 'id',
|
|
211
|
+
message: 'id',
|
|
212
|
+
required: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'defaultLimitId',
|
|
217
|
+
message: 'defaultLimitId',
|
|
218
|
+
required: false,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
type: 'text',
|
|
222
|
+
name: 'actorId',
|
|
223
|
+
message: 'actorId',
|
|
224
|
+
required: false,
|
|
225
|
+
skipPrompt: true,
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
type: 'text',
|
|
229
|
+
name: 'amount',
|
|
230
|
+
message: 'amount',
|
|
231
|
+
required: false,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: 'text',
|
|
235
|
+
name: 'creditType',
|
|
236
|
+
message: 'creditType',
|
|
237
|
+
required: false,
|
|
238
|
+
skipPrompt: true,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
name: 'reason',
|
|
243
|
+
message: 'reason',
|
|
244
|
+
required: false,
|
|
245
|
+
skipPrompt: true,
|
|
246
|
+
},
|
|
247
|
+
]);
|
|
248
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
249
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
250
|
+
const client = getClient();
|
|
251
|
+
const result = await client.appLimitCredit
|
|
252
|
+
.update({
|
|
253
|
+
where: {
|
|
254
|
+
id: answers.id,
|
|
255
|
+
},
|
|
256
|
+
data: {
|
|
257
|
+
defaultLimitId: cleanedData.defaultLimitId,
|
|
258
|
+
actorId: cleanedData.actorId,
|
|
259
|
+
amount: cleanedData.amount,
|
|
260
|
+
creditType: cleanedData.creditType,
|
|
261
|
+
reason: cleanedData.reason,
|
|
262
|
+
},
|
|
263
|
+
select: {
|
|
264
|
+
id: true,
|
|
265
|
+
defaultLimitId: true,
|
|
266
|
+
actorId: true,
|
|
267
|
+
amount: true,
|
|
268
|
+
creditType: true,
|
|
269
|
+
reason: true,
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
.execute();
|
|
273
|
+
console.log(JSON.stringify(result, null, 2));
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
console.error('Failed to update record.');
|
|
277
|
+
if (error instanceof Error) {
|
|
278
|
+
console.error(error.message);
|
|
279
|
+
}
|
|
280
|
+
process.exit(1);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
async function handleDelete(argv, prompter) {
|
|
284
|
+
try {
|
|
285
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
286
|
+
{
|
|
287
|
+
type: 'text',
|
|
288
|
+
name: 'id',
|
|
289
|
+
message: 'id',
|
|
290
|
+
required: true,
|
|
291
|
+
},
|
|
292
|
+
]);
|
|
293
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
294
|
+
const client = getClient();
|
|
295
|
+
const result = await client.appLimitCredit
|
|
296
|
+
.delete({
|
|
297
|
+
where: {
|
|
298
|
+
id: answers.id,
|
|
299
|
+
},
|
|
300
|
+
select: {
|
|
301
|
+
id: true,
|
|
302
|
+
},
|
|
303
|
+
})
|
|
304
|
+
.execute();
|
|
305
|
+
console.log(JSON.stringify(result, null, 2));
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
console.error('Failed to delete record.');
|
|
309
|
+
if (error instanceof Error) {
|
|
310
|
+
console.error(error.message);
|
|
311
|
+
}
|
|
312
|
+
process.exit(1);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
@@ -15,6 +15,9 @@ const fieldSchema = {
|
|
|
15
15
|
softMax: 'int',
|
|
16
16
|
windowStart: 'string',
|
|
17
17
|
windowDuration: 'string',
|
|
18
|
+
planMax: 'int',
|
|
19
|
+
purchasedCredits: 'int',
|
|
20
|
+
periodCredits: 'int',
|
|
18
21
|
};
|
|
19
22
|
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';
|
|
20
23
|
export default async (argv, prompter, _options) => {
|
|
@@ -66,6 +69,9 @@ async function handleList(argv, _prompter) {
|
|
|
66
69
|
softMax: true,
|
|
67
70
|
windowStart: true,
|
|
68
71
|
windowDuration: true,
|
|
72
|
+
planMax: true,
|
|
73
|
+
purchasedCredits: true,
|
|
74
|
+
periodCredits: true,
|
|
69
75
|
};
|
|
70
76
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
71
77
|
const client = getClient();
|
|
@@ -91,6 +97,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
91
97
|
softMax: true,
|
|
92
98
|
windowStart: true,
|
|
93
99
|
windowDuration: true,
|
|
100
|
+
planMax: true,
|
|
101
|
+
purchasedCredits: true,
|
|
102
|
+
periodCredits: true,
|
|
94
103
|
};
|
|
95
104
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
96
105
|
const client = getClient();
|
|
@@ -128,6 +137,9 @@ async function handleGet(argv, prompter) {
|
|
|
128
137
|
softMax: true,
|
|
129
138
|
windowStart: true,
|
|
130
139
|
windowDuration: true,
|
|
140
|
+
planMax: true,
|
|
141
|
+
purchasedCredits: true,
|
|
142
|
+
periodCredits: true,
|
|
131
143
|
},
|
|
132
144
|
})
|
|
133
145
|
.execute();
|
|
@@ -192,6 +204,27 @@ async function handleCreate(argv, prompter) {
|
|
|
192
204
|
required: false,
|
|
193
205
|
skipPrompt: true,
|
|
194
206
|
},
|
|
207
|
+
{
|
|
208
|
+
type: 'text',
|
|
209
|
+
name: 'planMax',
|
|
210
|
+
message: 'planMax',
|
|
211
|
+
required: false,
|
|
212
|
+
skipPrompt: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'purchasedCredits',
|
|
217
|
+
message: 'purchasedCredits',
|
|
218
|
+
required: false,
|
|
219
|
+
skipPrompt: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
name: 'periodCredits',
|
|
224
|
+
message: 'periodCredits',
|
|
225
|
+
required: false,
|
|
226
|
+
skipPrompt: true,
|
|
227
|
+
},
|
|
195
228
|
]);
|
|
196
229
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
197
230
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -206,6 +239,9 @@ async function handleCreate(argv, prompter) {
|
|
|
206
239
|
softMax: cleanedData.softMax,
|
|
207
240
|
windowStart: cleanedData.windowStart,
|
|
208
241
|
windowDuration: cleanedData.windowDuration,
|
|
242
|
+
planMax: cleanedData.planMax,
|
|
243
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
244
|
+
periodCredits: cleanedData.periodCredits,
|
|
209
245
|
},
|
|
210
246
|
select: {
|
|
211
247
|
id: true,
|
|
@@ -216,6 +252,9 @@ async function handleCreate(argv, prompter) {
|
|
|
216
252
|
softMax: true,
|
|
217
253
|
windowStart: true,
|
|
218
254
|
windowDuration: true,
|
|
255
|
+
planMax: true,
|
|
256
|
+
purchasedCredits: true,
|
|
257
|
+
periodCredits: true,
|
|
219
258
|
},
|
|
220
259
|
})
|
|
221
260
|
.execute();
|
|
@@ -286,6 +325,27 @@ async function handleUpdate(argv, prompter) {
|
|
|
286
325
|
required: false,
|
|
287
326
|
skipPrompt: true,
|
|
288
327
|
},
|
|
328
|
+
{
|
|
329
|
+
type: 'text',
|
|
330
|
+
name: 'planMax',
|
|
331
|
+
message: 'planMax',
|
|
332
|
+
required: false,
|
|
333
|
+
skipPrompt: true,
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
type: 'text',
|
|
337
|
+
name: 'purchasedCredits',
|
|
338
|
+
message: 'purchasedCredits',
|
|
339
|
+
required: false,
|
|
340
|
+
skipPrompt: true,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'text',
|
|
344
|
+
name: 'periodCredits',
|
|
345
|
+
message: 'periodCredits',
|
|
346
|
+
required: false,
|
|
347
|
+
skipPrompt: true,
|
|
348
|
+
},
|
|
289
349
|
]);
|
|
290
350
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
291
351
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -303,6 +363,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
303
363
|
softMax: cleanedData.softMax,
|
|
304
364
|
windowStart: cleanedData.windowStart,
|
|
305
365
|
windowDuration: cleanedData.windowDuration,
|
|
366
|
+
planMax: cleanedData.planMax,
|
|
367
|
+
purchasedCredits: cleanedData.purchasedCredits,
|
|
368
|
+
periodCredits: cleanedData.periodCredits,
|
|
306
369
|
},
|
|
307
370
|
select: {
|
|
308
371
|
id: true,
|
|
@@ -313,6 +376,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
313
376
|
softMax: true,
|
|
314
377
|
windowStart: true,
|
|
315
378
|
windowDuration: true,
|
|
379
|
+
planMax: true,
|
|
380
|
+
purchasedCredits: true,
|
|
381
|
+
periodCredits: true,
|
|
316
382
|
},
|
|
317
383
|
})
|
|
318
384
|
.execute();
|