@constructive-sdk/cli 0.23.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/cli/commands/app-limit-event.js +248 -2
- package/admin/cli/commands/app-limit.js +44 -0
- package/admin/cli/commands/org-limit-aggregate.js +44 -0
- package/admin/cli/commands/org-limit-event.js +248 -2
- package/admin/cli/commands/org-limit.js +44 -0
- package/admin/cli/commands.js +31 -33
- package/admin/cli/executor.d.ts +15 -16
- package/admin/orm/index.d.ts +31 -33
- package/admin/orm/index.js +32 -33
- package/admin/orm/input-types.d.ts +2090 -2039
- package/admin/orm/input-types.js +4 -4
- package/admin/orm/models/appLimitEvent.d.ts +26 -2
- package/admin/orm/models/appLimitEvent.js +45 -0
- package/admin/orm/models/index.d.ts +15 -16
- package/admin/orm/models/index.js +31 -33
- package/admin/orm/models/orgLimitEvent.d.ts +26 -2
- package/admin/orm/models/orgLimitEvent.js +45 -0
- package/{esm/public/cli/commands/agent-message.d.ts → auth/cli/commands/audit-log-auth.d.ts} +1 -1
- package/auth/cli/commands/{audit-log.js → audit-log-auth.js} +14 -14
- package/auth/cli/commands.js +5 -5
- package/auth/cli/executor.d.ts +6 -6
- package/auth/orm/index.d.ts +8 -8
- package/auth/orm/index.js +4 -3
- package/auth/orm/input-types.d.ts +94 -94
- package/auth/orm/input-types.js +1 -1
- package/auth/orm/models/auditLogAuth.d.ts +54 -0
- package/{public/orm/models/agentMessage.js → auth/orm/models/auditLogAuth.js} +27 -27
- package/auth/orm/models/index.d.ts +1 -1
- package/auth/orm/models/index.js +3 -3
- package/auth/orm/mutation/index.d.ts +9 -9
- package/auth/orm/mutation/index.js +12 -12
- package/esm/admin/cli/commands/app-limit-event.js +248 -2
- package/esm/admin/cli/commands/app-limit.js +44 -0
- package/esm/admin/cli/commands/org-limit-aggregate.js +44 -0
- package/esm/admin/cli/commands/org-limit-event.js +248 -2
- package/esm/admin/cli/commands/org-limit.js +44 -0
- package/esm/admin/cli/commands.js +31 -33
- package/esm/admin/cli/executor.d.ts +15 -16
- package/esm/admin/orm/index.d.ts +31 -33
- package/esm/admin/orm/index.js +31 -33
- package/esm/admin/orm/input-types.d.ts +2090 -2039
- package/esm/admin/orm/input-types.js +4 -4
- package/esm/admin/orm/models/appLimitEvent.d.ts +26 -2
- package/esm/admin/orm/models/appLimitEvent.js +46 -1
- package/esm/admin/orm/models/index.d.ts +15 -16
- package/esm/admin/orm/models/index.js +15 -16
- package/esm/admin/orm/models/orgLimitEvent.d.ts +26 -2
- package/esm/admin/orm/models/orgLimitEvent.js +46 -1
- package/esm/auth/cli/commands/audit-log-auth.d.ts +8 -0
- package/esm/{public/cli/commands/audit-log.js → auth/cli/commands/audit-log-auth.js} +14 -14
- package/esm/auth/cli/commands.js +5 -5
- package/esm/auth/cli/executor.d.ts +6 -6
- package/esm/auth/orm/index.d.ts +8 -8
- package/esm/auth/orm/index.js +3 -3
- package/esm/auth/orm/input-types.d.ts +94 -94
- package/esm/auth/orm/input-types.js +1 -1
- package/esm/auth/orm/models/auditLogAuth.d.ts +54 -0
- package/esm/{public/orm/models/auditLog.js → auth/orm/models/auditLogAuth.js} +25 -25
- package/esm/auth/orm/models/index.d.ts +1 -1
- package/esm/auth/orm/models/index.js +1 -1
- package/esm/auth/orm/mutation/index.d.ts +9 -9
- package/esm/auth/orm/mutation/index.js +12 -12
- package/esm/objects/orm/index.d.ts +1 -1
- package/esm/objects/orm/index.js +1 -1
- package/esm/public/cli/commands/{agent-thread.d.ts → agent-module.d.ts} +1 -1
- package/esm/public/cli/commands/agent-module.js +690 -0
- package/esm/public/cli/commands/app-limit-event.js +248 -2
- package/esm/public/cli/commands/app-limit.js +44 -0
- package/esm/public/cli/commands/apply-registry-defaults.d.ts +8 -0
- package/esm/public/cli/commands/{rev-parse.js → apply-registry-defaults.js} +9 -12
- package/esm/public/cli/commands/audit-log-auth.d.ts +8 -0
- package/esm/{auth/cli/commands/audit-log.js → public/cli/commands/audit-log-auth.js} +14 -14
- package/esm/public/cli/commands/billing-module.js +88 -0
- package/esm/public/cli/commands/compute-log-module.d.ts +8 -0
- package/esm/public/cli/commands/compute-log-module.js +514 -0
- package/esm/public/cli/commands/config-secrets-org-module.d.ts +8 -0
- package/esm/public/cli/commands/{encrypted-secrets-module.js → config-secrets-org-module.js} +8 -8
- package/esm/public/cli/commands/config-secrets-user-module.d.ts +8 -0
- package/esm/public/cli/commands/{object.js → config-secrets-user-module.js} +60 -67
- package/esm/public/cli/commands/construct-blueprint.js +1 -1
- package/{admin/cli/commands/usage-snapshot.d.ts → esm/public/cli/commands/db-usage-module.d.ts} +1 -1
- package/esm/public/cli/commands/db-usage-module.js +558 -0
- package/esm/public/cli/commands/entity-type-provision.js +386 -34
- package/esm/public/cli/commands/field.js +4 -26
- package/esm/public/cli/commands/function-module.d.ts +8 -0
- package/esm/public/cli/commands/function-module.js +778 -0
- package/{auth/cli/commands/audit-log.d.ts → esm/public/cli/commands/graph-module.d.ts} +1 -1
- package/esm/public/cli/commands/graph-module.js +584 -0
- package/esm/public/cli/commands/inference-log-module.d.ts +8 -0
- package/esm/public/cli/commands/inference-log-module.js +514 -0
- package/esm/public/cli/commands/memberships-module.js +22 -0
- package/esm/public/cli/commands/merkle-store-module.d.ts +8 -0
- package/esm/public/cli/commands/merkle-store-module.js +498 -0
- package/esm/public/cli/commands/namespace-module.d.ts +8 -0
- package/esm/public/cli/commands/namespace-module.js +558 -0
- package/esm/public/cli/commands/org-limit-aggregate.js +44 -0
- package/esm/public/cli/commands/org-limit-event.js +248 -2
- package/esm/public/cli/commands/org-limit.js +44 -0
- package/esm/public/cli/commands/partition.js +44 -0
- package/esm/public/cli/commands/storage-log-module.d.ts +8 -0
- package/esm/public/cli/commands/storage-log-module.js +514 -0
- package/esm/public/cli/commands/storage-module.js +36 -14
- package/esm/public/cli/commands/transfer-log-module.d.ts +8 -0
- package/esm/public/cli/commands/transfer-log-module.js +514 -0
- package/esm/public/cli/commands.js +83 -101
- package/esm/public/cli/executor.d.ts +72 -125
- package/esm/public/orm/index.d.ts +102 -153
- package/esm/public/orm/index.js +59 -55
- package/esm/public/orm/input-types.d.ts +6255 -3877
- package/esm/public/orm/input-types.js +24 -15
- package/esm/public/orm/models/agentModule.d.ts +54 -0
- package/esm/public/orm/models/{agentThread.js → agentModule.js} +25 -25
- package/esm/public/orm/models/appLimitEvent.d.ts +26 -2
- package/esm/public/orm/models/appLimitEvent.js +46 -1
- package/esm/public/orm/models/auditLogAuth.d.ts +54 -0
- package/esm/{auth/orm/models/auditLog.js → public/orm/models/auditLogAuth.js} +25 -25
- package/esm/public/orm/models/computeLogModule.d.ts +54 -0
- package/esm/public/orm/models/{commit.js → computeLogModule.js} +25 -25
- package/esm/public/orm/models/configSecretsOrgModule.d.ts +54 -0
- package/esm/public/orm/models/{encryptedSecretsModule.js → configSecretsOrgModule.js} +25 -25
- package/esm/public/orm/models/configSecretsUserModule.d.ts +54 -0
- package/esm/public/orm/models/configSecretsUserModule.js +100 -0
- package/esm/public/orm/models/dbUsageModule.d.ts +54 -0
- package/esm/{admin/orm/models/usageSnapshot.js → public/orm/models/dbUsageModule.js} +25 -25
- package/esm/public/orm/models/functionModule.d.ts +54 -0
- package/esm/public/orm/models/{agentMessage.js → functionModule.js} +25 -25
- package/esm/public/orm/models/graphModule.d.ts +54 -0
- package/esm/public/orm/models/{agentTask.js → graphModule.js} +25 -25
- package/esm/public/orm/models/index.d.ts +29 -27
- package/esm/public/orm/models/index.js +29 -27
- package/esm/public/orm/models/inferenceLogModule.d.ts +54 -0
- package/esm/public/orm/models/inferenceLogModule.js +100 -0
- package/esm/public/orm/models/merkleStoreModule.d.ts +54 -0
- package/esm/public/orm/models/merkleStoreModule.js +100 -0
- package/esm/public/orm/models/namespaceModule.d.ts +54 -0
- package/esm/public/orm/models/namespaceModule.js +100 -0
- package/esm/public/orm/models/orgLimitEvent.d.ts +26 -2
- package/esm/public/orm/models/orgLimitEvent.js +46 -1
- package/esm/public/orm/models/storageLogModule.d.ts +54 -0
- package/esm/public/orm/models/{store.js → storageLogModule.js} +25 -25
- package/esm/public/orm/models/transferLogModule.d.ts +54 -0
- package/esm/public/orm/models/transferLogModule.js +100 -0
- package/esm/public/orm/mutation/index.d.ts +69 -133
- package/esm/public/orm/mutation/index.js +78 -174
- package/esm/public/orm/query/index.d.ts +22 -71
- package/esm/public/orm/query/index.js +36 -124
- package/objects/orm/index.d.ts +1 -1
- package/objects/orm/index.js +2 -1
- package/package.json +6 -6
- package/{esm/public/cli/commands/agent-task.d.ts → public/cli/commands/agent-module.d.ts} +1 -1
- package/public/cli/commands/agent-module.js +692 -0
- package/public/cli/commands/app-limit-event.js +248 -2
- package/public/cli/commands/app-limit.js +44 -0
- package/public/cli/commands/apply-registry-defaults.d.ts +8 -0
- package/public/cli/commands/{rev-parse.js → apply-registry-defaults.js} +9 -12
- package/public/cli/commands/audit-log-auth.d.ts +8 -0
- package/public/cli/commands/{audit-log.js → audit-log-auth.js} +14 -14
- package/public/cli/commands/billing-module.js +88 -0
- package/public/cli/commands/compute-log-module.d.ts +8 -0
- package/public/cli/commands/compute-log-module.js +516 -0
- package/public/cli/commands/config-secrets-org-module.d.ts +8 -0
- package/public/cli/commands/{encrypted-secrets-module.js → config-secrets-org-module.js} +8 -8
- package/public/cli/commands/config-secrets-user-module.d.ts +8 -0
- package/public/cli/commands/{object.js → config-secrets-user-module.js} +60 -67
- package/public/cli/commands/construct-blueprint.js +1 -1
- package/{esm/admin/cli/commands/usage-snapshot.d.ts → public/cli/commands/db-usage-module.d.ts} +1 -1
- package/public/cli/commands/db-usage-module.js +560 -0
- package/public/cli/commands/entity-type-provision.js +386 -34
- package/public/cli/commands/field.js +4 -26
- package/public/cli/commands/function-module.d.ts +8 -0
- package/public/cli/commands/function-module.js +780 -0
- package/{esm/auth/cli/commands/audit-log.d.ts → public/cli/commands/graph-module.d.ts} +1 -1
- package/public/cli/commands/graph-module.js +586 -0
- package/public/cli/commands/inference-log-module.d.ts +8 -0
- package/public/cli/commands/inference-log-module.js +516 -0
- package/public/cli/commands/memberships-module.js +22 -0
- package/public/cli/commands/merkle-store-module.d.ts +8 -0
- package/public/cli/commands/merkle-store-module.js +500 -0
- package/public/cli/commands/namespace-module.d.ts +8 -0
- package/public/cli/commands/namespace-module.js +560 -0
- package/public/cli/commands/org-limit-aggregate.js +44 -0
- package/public/cli/commands/org-limit-event.js +248 -2
- package/public/cli/commands/org-limit.js +44 -0
- package/public/cli/commands/partition.js +44 -0
- package/public/cli/commands/storage-log-module.d.ts +8 -0
- package/public/cli/commands/storage-log-module.js +516 -0
- package/public/cli/commands/storage-module.js +36 -14
- package/public/cli/commands/transfer-log-module.d.ts +8 -0
- package/public/cli/commands/transfer-log-module.js +516 -0
- package/public/cli/commands.js +83 -101
- package/public/cli/executor.d.ts +72 -125
- package/public/orm/index.d.ts +102 -153
- package/public/orm/index.js +60 -55
- package/public/orm/input-types.d.ts +6255 -3877
- package/public/orm/input-types.js +24 -15
- package/public/orm/models/agentModule.d.ts +54 -0
- package/public/orm/models/{agentThread.js → agentModule.js} +27 -27
- package/public/orm/models/appLimitEvent.d.ts +26 -2
- package/public/orm/models/appLimitEvent.js +45 -0
- package/public/orm/models/auditLogAuth.d.ts +54 -0
- package/{admin/orm/models/usageSnapshot.js → public/orm/models/auditLogAuth.js} +27 -27
- package/public/orm/models/computeLogModule.d.ts +54 -0
- package/{auth/orm/models/auditLog.js → public/orm/models/computeLogModule.js} +27 -27
- package/public/orm/models/configSecretsOrgModule.d.ts +54 -0
- package/public/orm/models/{encryptedSecretsModule.js → configSecretsOrgModule.js} +27 -27
- package/public/orm/models/configSecretsUserModule.d.ts +54 -0
- package/public/orm/models/{ref.js → configSecretsUserModule.js} +27 -27
- package/public/orm/models/dbUsageModule.d.ts +54 -0
- package/public/orm/models/{usageSnapshot.js → dbUsageModule.js} +27 -27
- package/public/orm/models/functionModule.d.ts +54 -0
- package/public/orm/models/functionModule.js +104 -0
- package/public/orm/models/graphModule.d.ts +54 -0
- package/public/orm/models/{agentTask.js → graphModule.js} +27 -27
- package/public/orm/models/index.d.ts +29 -27
- package/public/orm/models/index.js +61 -57
- package/public/orm/models/inferenceLogModule.d.ts +54 -0
- package/public/orm/models/inferenceLogModule.js +104 -0
- package/public/orm/models/merkleStoreModule.d.ts +54 -0
- package/public/orm/models/merkleStoreModule.js +104 -0
- package/public/orm/models/namespaceModule.d.ts +54 -0
- package/public/orm/models/namespaceModule.js +104 -0
- package/public/orm/models/orgLimitEvent.d.ts +26 -2
- package/public/orm/models/orgLimitEvent.js +45 -0
- package/public/orm/models/storageLogModule.d.ts +54 -0
- package/public/orm/models/storageLogModule.js +104 -0
- package/public/orm/models/transferLogModule.d.ts +54 -0
- package/public/orm/models/transferLogModule.js +104 -0
- package/public/orm/mutation/index.d.ts +69 -133
- package/public/orm/mutation/index.js +78 -174
- package/public/orm/query/index.d.ts +22 -71
- package/public/orm/query/index.js +36 -124
- package/admin/cli/commands/usage-snapshot.js +0 -316
- package/admin/orm/models/usageSnapshot.d.ts +0 -54
- package/auth/orm/models/auditLog.d.ts +0 -54
- package/esm/admin/cli/commands/usage-snapshot.js +0 -314
- package/esm/admin/orm/models/usageSnapshot.d.ts +0 -54
- package/esm/auth/orm/models/auditLog.d.ts +0 -54
- package/esm/public/cli/commands/agent-message.js +0 -324
- package/esm/public/cli/commands/agent-task.js +0 -368
- package/esm/public/cli/commands/agent-thread.js +0 -372
- package/esm/public/cli/commands/audit-log.d.ts +0 -8
- package/esm/public/cli/commands/commit.d.ts +0 -8
- package/esm/public/cli/commands/commit.js +0 -380
- package/esm/public/cli/commands/encrypted-secrets-module.d.ts +0 -8
- package/esm/public/cli/commands/freeze-objects.d.ts +0 -8
- package/esm/public/cli/commands/freeze-objects.js +0 -34
- package/esm/public/cli/commands/get-all-objects-from-root.d.ts +0 -8
- package/esm/public/cli/commands/get-all-objects-from-root.js +0 -52
- package/esm/public/cli/commands/get-all-record.d.ts +0 -8
- package/esm/public/cli/commands/get-all-record.js +0 -124
- package/esm/public/cli/commands/get-object-at-path.d.ts +0 -8
- package/esm/public/cli/commands/get-object-at-path.js +0 -47
- package/esm/public/cli/commands/get-path-objects-from-root.d.ts +0 -8
- package/esm/public/cli/commands/get-path-objects-from-root.js +0 -57
- package/esm/public/cli/commands/init-empty-repo.d.ts +0 -8
- package/esm/public/cli/commands/init-empty-repo.js +0 -34
- package/esm/public/cli/commands/insert-node-at-path.d.ts +0 -8
- package/esm/public/cli/commands/insert-node-at-path.js +0 -34
- package/esm/public/cli/commands/object.d.ts +0 -8
- package/esm/public/cli/commands/ref.d.ts +0 -8
- package/esm/public/cli/commands/ref.js +0 -290
- package/esm/public/cli/commands/remove-node-at-path.d.ts +0 -8
- package/esm/public/cli/commands/remove-node-at-path.js +0 -34
- package/esm/public/cli/commands/rev-parse.d.ts +0 -8
- package/esm/public/cli/commands/set-and-commit.d.ts +0 -8
- package/esm/public/cli/commands/set-and-commit.js +0 -34
- package/esm/public/cli/commands/set-data-at-path.d.ts +0 -8
- package/esm/public/cli/commands/set-data-at-path.js +0 -34
- package/esm/public/cli/commands/set-props-and-commit.d.ts +0 -8
- package/esm/public/cli/commands/set-props-and-commit.js +0 -34
- package/esm/public/cli/commands/store.d.ts +0 -8
- package/esm/public/cli/commands/store.js +0 -276
- package/esm/public/cli/commands/update-node-at-path.d.ts +0 -8
- package/esm/public/cli/commands/update-node-at-path.js +0 -34
- package/esm/public/cli/commands/usage-snapshot.d.ts +0 -8
- package/esm/public/cli/commands/usage-snapshot.js +0 -314
- package/esm/public/orm/models/agentMessage.d.ts +0 -54
- package/esm/public/orm/models/agentTask.d.ts +0 -54
- package/esm/public/orm/models/agentThread.d.ts +0 -54
- package/esm/public/orm/models/auditLog.d.ts +0 -54
- package/esm/public/orm/models/commit.d.ts +0 -54
- package/esm/public/orm/models/encryptedSecretsModule.d.ts +0 -54
- package/esm/public/orm/models/getAllRecord.d.ts +0 -30
- package/esm/public/orm/models/getAllRecord.js +0 -55
- package/esm/public/orm/models/object.d.ts +0 -54
- package/esm/public/orm/models/object.js +0 -90
- package/esm/public/orm/models/ref.d.ts +0 -54
- package/esm/public/orm/models/ref.js +0 -100
- package/esm/public/orm/models/store.d.ts +0 -54
- package/esm/public/orm/models/usageSnapshot.d.ts +0 -54
- package/esm/public/orm/models/usageSnapshot.js +0 -100
- package/public/cli/commands/agent-message.d.ts +0 -8
- package/public/cli/commands/agent-message.js +0 -326
- package/public/cli/commands/agent-task.d.ts +0 -8
- package/public/cli/commands/agent-task.js +0 -370
- package/public/cli/commands/agent-thread.d.ts +0 -8
- package/public/cli/commands/agent-thread.js +0 -374
- package/public/cli/commands/audit-log.d.ts +0 -8
- package/public/cli/commands/commit.d.ts +0 -8
- package/public/cli/commands/commit.js +0 -382
- package/public/cli/commands/encrypted-secrets-module.d.ts +0 -8
- package/public/cli/commands/freeze-objects.d.ts +0 -8
- package/public/cli/commands/freeze-objects.js +0 -36
- package/public/cli/commands/get-all-objects-from-root.d.ts +0 -8
- package/public/cli/commands/get-all-objects-from-root.js +0 -54
- package/public/cli/commands/get-all-record.d.ts +0 -8
- package/public/cli/commands/get-all-record.js +0 -126
- package/public/cli/commands/get-object-at-path.d.ts +0 -8
- package/public/cli/commands/get-object-at-path.js +0 -49
- package/public/cli/commands/get-path-objects-from-root.d.ts +0 -8
- package/public/cli/commands/get-path-objects-from-root.js +0 -59
- package/public/cli/commands/init-empty-repo.d.ts +0 -8
- package/public/cli/commands/init-empty-repo.js +0 -36
- package/public/cli/commands/insert-node-at-path.d.ts +0 -8
- package/public/cli/commands/insert-node-at-path.js +0 -36
- package/public/cli/commands/object.d.ts +0 -8
- package/public/cli/commands/ref.d.ts +0 -8
- package/public/cli/commands/ref.js +0 -292
- package/public/cli/commands/remove-node-at-path.d.ts +0 -8
- package/public/cli/commands/remove-node-at-path.js +0 -36
- package/public/cli/commands/rev-parse.d.ts +0 -8
- package/public/cli/commands/set-and-commit.d.ts +0 -8
- package/public/cli/commands/set-and-commit.js +0 -36
- package/public/cli/commands/set-data-at-path.d.ts +0 -8
- package/public/cli/commands/set-data-at-path.js +0 -36
- package/public/cli/commands/set-props-and-commit.d.ts +0 -8
- package/public/cli/commands/set-props-and-commit.js +0 -36
- package/public/cli/commands/store.d.ts +0 -8
- package/public/cli/commands/store.js +0 -278
- package/public/cli/commands/update-node-at-path.d.ts +0 -8
- package/public/cli/commands/update-node-at-path.js +0 -36
- package/public/cli/commands/usage-snapshot.d.ts +0 -8
- package/public/cli/commands/usage-snapshot.js +0 -316
- package/public/orm/models/agentMessage.d.ts +0 -54
- package/public/orm/models/agentTask.d.ts +0 -54
- package/public/orm/models/agentThread.d.ts +0 -54
- package/public/orm/models/auditLog.d.ts +0 -54
- package/public/orm/models/auditLog.js +0 -104
- package/public/orm/models/commit.d.ts +0 -54
- package/public/orm/models/commit.js +0 -104
- package/public/orm/models/encryptedSecretsModule.d.ts +0 -54
- package/public/orm/models/getAllRecord.d.ts +0 -30
- package/public/orm/models/getAllRecord.js +0 -59
- package/public/orm/models/object.d.ts +0 -54
- package/public/orm/models/object.js +0 -94
- package/public/orm/models/ref.d.ts +0 -54
- package/public/orm/models/store.d.ts +0 -54
- package/public/orm/models/store.js +0 -104
- package/public/orm/models/usageSnapshot.d.ts +0 -54
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for Commit
|
|
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
|
-
message: 'string',
|
|
12
|
-
databaseId: 'uuid',
|
|
13
|
-
storeId: 'uuid',
|
|
14
|
-
parentIds: 'uuid',
|
|
15
|
-
authorId: 'uuid',
|
|
16
|
-
committerId: 'uuid',
|
|
17
|
-
treeId: 'uuid',
|
|
18
|
-
date: 'string',
|
|
19
|
-
};
|
|
20
|
-
const usage = '\ncommit <command>\n\nCommands:\n list List commit records\n find-first Find first matching commit record\n get Get a commit by ID\n create Create a new commit\n update Update an existing commit\n delete Delete a commit\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
21
|
-
export default async (argv, prompter, _options) => {
|
|
22
|
-
if (argv.help || argv.h) {
|
|
23
|
-
console.log(usage);
|
|
24
|
-
process.exit(0);
|
|
25
|
-
}
|
|
26
|
-
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
27
|
-
if (!subcommand) {
|
|
28
|
-
const answer = await prompter.prompt(argv, [
|
|
29
|
-
{
|
|
30
|
-
type: 'autocomplete',
|
|
31
|
-
name: 'subcommand',
|
|
32
|
-
message: 'What do you want to do?',
|
|
33
|
-
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
34
|
-
},
|
|
35
|
-
]);
|
|
36
|
-
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
37
|
-
}
|
|
38
|
-
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
39
|
-
};
|
|
40
|
-
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
41
|
-
switch (subcommand) {
|
|
42
|
-
case 'list':
|
|
43
|
-
return handleList(argv, prompter);
|
|
44
|
-
case 'find-first':
|
|
45
|
-
return handleFindFirst(argv, prompter);
|
|
46
|
-
case 'get':
|
|
47
|
-
return handleGet(argv, prompter);
|
|
48
|
-
case 'create':
|
|
49
|
-
return handleCreate(argv, prompter);
|
|
50
|
-
case 'update':
|
|
51
|
-
return handleUpdate(argv, prompter);
|
|
52
|
-
case 'delete':
|
|
53
|
-
return handleDelete(argv, prompter);
|
|
54
|
-
default:
|
|
55
|
-
console.log(usage);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async function handleList(argv, _prompter) {
|
|
60
|
-
try {
|
|
61
|
-
const defaultSelect = {
|
|
62
|
-
id: true,
|
|
63
|
-
message: true,
|
|
64
|
-
databaseId: true,
|
|
65
|
-
storeId: true,
|
|
66
|
-
parentIds: true,
|
|
67
|
-
authorId: true,
|
|
68
|
-
committerId: true,
|
|
69
|
-
treeId: true,
|
|
70
|
-
date: true,
|
|
71
|
-
};
|
|
72
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
73
|
-
const client = getClient();
|
|
74
|
-
const result = await client.commit.findMany(findManyArgs).execute();
|
|
75
|
-
console.log(JSON.stringify(result, null, 2));
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error('Failed to list records.');
|
|
79
|
-
if (error instanceof Error) {
|
|
80
|
-
console.error(error.message);
|
|
81
|
-
}
|
|
82
|
-
process.exit(1);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
async function handleFindFirst(argv, _prompter) {
|
|
86
|
-
try {
|
|
87
|
-
const defaultSelect = {
|
|
88
|
-
id: true,
|
|
89
|
-
message: true,
|
|
90
|
-
databaseId: true,
|
|
91
|
-
storeId: true,
|
|
92
|
-
parentIds: true,
|
|
93
|
-
authorId: true,
|
|
94
|
-
committerId: true,
|
|
95
|
-
treeId: true,
|
|
96
|
-
date: true,
|
|
97
|
-
};
|
|
98
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
99
|
-
const client = getClient();
|
|
100
|
-
const result = await client.commit.findFirst(findFirstArgs).execute();
|
|
101
|
-
console.log(JSON.stringify(result, null, 2));
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
console.error('Failed to find record.');
|
|
105
|
-
if (error instanceof Error) {
|
|
106
|
-
console.error(error.message);
|
|
107
|
-
}
|
|
108
|
-
process.exit(1);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
async function handleGet(argv, prompter) {
|
|
112
|
-
try {
|
|
113
|
-
const answers = await prompter.prompt(argv, [
|
|
114
|
-
{
|
|
115
|
-
type: 'text',
|
|
116
|
-
name: 'id',
|
|
117
|
-
message: 'id',
|
|
118
|
-
required: true,
|
|
119
|
-
},
|
|
120
|
-
]);
|
|
121
|
-
const client = getClient();
|
|
122
|
-
const result = await client.commit
|
|
123
|
-
.findOne({
|
|
124
|
-
id: answers.id,
|
|
125
|
-
select: {
|
|
126
|
-
id: true,
|
|
127
|
-
message: true,
|
|
128
|
-
databaseId: true,
|
|
129
|
-
storeId: true,
|
|
130
|
-
parentIds: true,
|
|
131
|
-
authorId: true,
|
|
132
|
-
committerId: true,
|
|
133
|
-
treeId: true,
|
|
134
|
-
date: true,
|
|
135
|
-
},
|
|
136
|
-
})
|
|
137
|
-
.execute();
|
|
138
|
-
console.log(JSON.stringify(result, null, 2));
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
console.error('Record not found.');
|
|
142
|
-
if (error instanceof Error) {
|
|
143
|
-
console.error(error.message);
|
|
144
|
-
}
|
|
145
|
-
process.exit(1);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
async function handleCreate(argv, prompter) {
|
|
149
|
-
try {
|
|
150
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
151
|
-
{
|
|
152
|
-
type: 'text',
|
|
153
|
-
name: 'message',
|
|
154
|
-
message: 'message',
|
|
155
|
-
required: false,
|
|
156
|
-
skipPrompt: true,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'text',
|
|
160
|
-
name: 'databaseId',
|
|
161
|
-
message: 'databaseId',
|
|
162
|
-
required: true,
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
type: 'text',
|
|
166
|
-
name: 'storeId',
|
|
167
|
-
message: 'storeId',
|
|
168
|
-
required: true,
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
type: 'text',
|
|
172
|
-
name: 'parentIds',
|
|
173
|
-
message: 'parentIds',
|
|
174
|
-
required: false,
|
|
175
|
-
skipPrompt: true,
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
type: 'text',
|
|
179
|
-
name: 'authorId',
|
|
180
|
-
message: 'authorId',
|
|
181
|
-
required: false,
|
|
182
|
-
skipPrompt: true,
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'text',
|
|
186
|
-
name: 'committerId',
|
|
187
|
-
message: 'committerId',
|
|
188
|
-
required: false,
|
|
189
|
-
skipPrompt: true,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'text',
|
|
193
|
-
name: 'treeId',
|
|
194
|
-
message: 'treeId',
|
|
195
|
-
required: false,
|
|
196
|
-
skipPrompt: true,
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
type: 'text',
|
|
200
|
-
name: 'date',
|
|
201
|
-
message: 'date',
|
|
202
|
-
required: false,
|
|
203
|
-
skipPrompt: true,
|
|
204
|
-
},
|
|
205
|
-
]);
|
|
206
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
207
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
208
|
-
const client = getClient();
|
|
209
|
-
const result = await client.commit
|
|
210
|
-
.create({
|
|
211
|
-
data: {
|
|
212
|
-
message: cleanedData.message,
|
|
213
|
-
databaseId: cleanedData.databaseId,
|
|
214
|
-
storeId: cleanedData.storeId,
|
|
215
|
-
parentIds: cleanedData.parentIds,
|
|
216
|
-
authorId: cleanedData.authorId,
|
|
217
|
-
committerId: cleanedData.committerId,
|
|
218
|
-
treeId: cleanedData.treeId,
|
|
219
|
-
date: cleanedData.date,
|
|
220
|
-
},
|
|
221
|
-
select: {
|
|
222
|
-
id: true,
|
|
223
|
-
message: true,
|
|
224
|
-
databaseId: true,
|
|
225
|
-
storeId: true,
|
|
226
|
-
parentIds: true,
|
|
227
|
-
authorId: true,
|
|
228
|
-
committerId: true,
|
|
229
|
-
treeId: true,
|
|
230
|
-
date: true,
|
|
231
|
-
},
|
|
232
|
-
})
|
|
233
|
-
.execute();
|
|
234
|
-
console.log(JSON.stringify(result, null, 2));
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
console.error('Failed to create record.');
|
|
238
|
-
if (error instanceof Error) {
|
|
239
|
-
console.error(error.message);
|
|
240
|
-
}
|
|
241
|
-
process.exit(1);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
async function handleUpdate(argv, prompter) {
|
|
245
|
-
try {
|
|
246
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
247
|
-
{
|
|
248
|
-
type: 'text',
|
|
249
|
-
name: 'id',
|
|
250
|
-
message: 'id',
|
|
251
|
-
required: true,
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
type: 'text',
|
|
255
|
-
name: 'message',
|
|
256
|
-
message: 'message',
|
|
257
|
-
required: false,
|
|
258
|
-
skipPrompt: true,
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
type: 'text',
|
|
262
|
-
name: 'databaseId',
|
|
263
|
-
message: 'databaseId',
|
|
264
|
-
required: false,
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
type: 'text',
|
|
268
|
-
name: 'storeId',
|
|
269
|
-
message: 'storeId',
|
|
270
|
-
required: false,
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
type: 'text',
|
|
274
|
-
name: 'parentIds',
|
|
275
|
-
message: 'parentIds',
|
|
276
|
-
required: false,
|
|
277
|
-
skipPrompt: true,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
type: 'text',
|
|
281
|
-
name: 'authorId',
|
|
282
|
-
message: 'authorId',
|
|
283
|
-
required: false,
|
|
284
|
-
skipPrompt: true,
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
type: 'text',
|
|
288
|
-
name: 'committerId',
|
|
289
|
-
message: 'committerId',
|
|
290
|
-
required: false,
|
|
291
|
-
skipPrompt: true,
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
type: 'text',
|
|
295
|
-
name: 'treeId',
|
|
296
|
-
message: 'treeId',
|
|
297
|
-
required: false,
|
|
298
|
-
skipPrompt: true,
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
type: 'text',
|
|
302
|
-
name: 'date',
|
|
303
|
-
message: 'date',
|
|
304
|
-
required: false,
|
|
305
|
-
skipPrompt: true,
|
|
306
|
-
},
|
|
307
|
-
]);
|
|
308
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
309
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
310
|
-
const client = getClient();
|
|
311
|
-
const result = await client.commit
|
|
312
|
-
.update({
|
|
313
|
-
where: {
|
|
314
|
-
id: answers.id,
|
|
315
|
-
},
|
|
316
|
-
data: {
|
|
317
|
-
message: cleanedData.message,
|
|
318
|
-
databaseId: cleanedData.databaseId,
|
|
319
|
-
storeId: cleanedData.storeId,
|
|
320
|
-
parentIds: cleanedData.parentIds,
|
|
321
|
-
authorId: cleanedData.authorId,
|
|
322
|
-
committerId: cleanedData.committerId,
|
|
323
|
-
treeId: cleanedData.treeId,
|
|
324
|
-
date: cleanedData.date,
|
|
325
|
-
},
|
|
326
|
-
select: {
|
|
327
|
-
id: true,
|
|
328
|
-
message: true,
|
|
329
|
-
databaseId: true,
|
|
330
|
-
storeId: true,
|
|
331
|
-
parentIds: true,
|
|
332
|
-
authorId: true,
|
|
333
|
-
committerId: true,
|
|
334
|
-
treeId: true,
|
|
335
|
-
date: true,
|
|
336
|
-
},
|
|
337
|
-
})
|
|
338
|
-
.execute();
|
|
339
|
-
console.log(JSON.stringify(result, null, 2));
|
|
340
|
-
}
|
|
341
|
-
catch (error) {
|
|
342
|
-
console.error('Failed to update record.');
|
|
343
|
-
if (error instanceof Error) {
|
|
344
|
-
console.error(error.message);
|
|
345
|
-
}
|
|
346
|
-
process.exit(1);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
async function handleDelete(argv, prompter) {
|
|
350
|
-
try {
|
|
351
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
352
|
-
{
|
|
353
|
-
type: 'text',
|
|
354
|
-
name: 'id',
|
|
355
|
-
message: 'id',
|
|
356
|
-
required: true,
|
|
357
|
-
},
|
|
358
|
-
]);
|
|
359
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
360
|
-
const client = getClient();
|
|
361
|
-
const result = await client.commit
|
|
362
|
-
.delete({
|
|
363
|
-
where: {
|
|
364
|
-
id: answers.id,
|
|
365
|
-
},
|
|
366
|
-
select: {
|
|
367
|
-
id: true,
|
|
368
|
-
},
|
|
369
|
-
})
|
|
370
|
-
.execute();
|
|
371
|
-
console.log(JSON.stringify(result, null, 2));
|
|
372
|
-
}
|
|
373
|
-
catch (error) {
|
|
374
|
-
console.error('Failed to delete record.');
|
|
375
|
-
if (error instanceof Error) {
|
|
376
|
-
console.error(error.message);
|
|
377
|
-
}
|
|
378
|
-
process.exit(1);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for EncryptedSecretsModule
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for mutation freezeObjects
|
|
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;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../executor';
|
|
2
|
-
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
|
-
export default async (argv, prompter, _options) => {
|
|
4
|
-
try {
|
|
5
|
-
if (argv.help || argv.h) {
|
|
6
|
-
console.log('freeze-objects - freezeObjects\n\nUsage: freeze-objects [OPTIONS]\n');
|
|
7
|
-
process.exit(0);
|
|
8
|
-
}
|
|
9
|
-
const answers = await prompter.prompt(argv, [
|
|
10
|
-
{
|
|
11
|
-
type: 'text',
|
|
12
|
-
name: 'input',
|
|
13
|
-
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
const client = getClient();
|
|
18
|
-
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
|
-
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
|
-
const result = await client.mutation
|
|
21
|
-
.freezeObjects(parsedAnswers, {
|
|
22
|
-
select: selectFields,
|
|
23
|
-
})
|
|
24
|
-
.execute();
|
|
25
|
-
console.log(JSON.stringify(result, null, 2));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
console.error('Failed: freezeObjects');
|
|
29
|
-
if (error instanceof Error) {
|
|
30
|
-
console.error(error.message);
|
|
31
|
-
}
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for query getAllObjectsFromRoot
|
|
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;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../executor';
|
|
2
|
-
import { buildSelectFromPaths } from '../utils';
|
|
3
|
-
export default async (argv, prompter, _options) => {
|
|
4
|
-
try {
|
|
5
|
-
if (argv.help || argv.h) {
|
|
6
|
-
console.log('get-all-objects-from-root - Reads and enables pagination through a set of `Object`.\n\nUsage: get-all-objects-from-root [OPTIONS]\n');
|
|
7
|
-
process.exit(0);
|
|
8
|
-
}
|
|
9
|
-
const answers = await prompter.prompt(argv, [
|
|
10
|
-
{
|
|
11
|
-
type: 'text',
|
|
12
|
-
name: 'databaseId',
|
|
13
|
-
message: 'databaseId',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'text',
|
|
17
|
-
name: 'id',
|
|
18
|
-
message: 'id',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'text',
|
|
22
|
-
name: 'first',
|
|
23
|
-
message: 'Only read the first `n` values of the set.',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'text',
|
|
27
|
-
name: 'offset',
|
|
28
|
-
message: 'Skip the first `n` values from our `after` cursor, an alternative to cursor\nbased pagination. May not be used with `last`.',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: 'text',
|
|
32
|
-
name: 'after',
|
|
33
|
-
message: 'Read all values in the set after (below) this cursor.',
|
|
34
|
-
},
|
|
35
|
-
]);
|
|
36
|
-
const client = getClient();
|
|
37
|
-
const selectFields = buildSelectFromPaths(argv.select ?? '');
|
|
38
|
-
const result = await client.query
|
|
39
|
-
.getAllObjectsFromRoot(answers, {
|
|
40
|
-
select: selectFields,
|
|
41
|
-
})
|
|
42
|
-
.execute();
|
|
43
|
-
console.log(JSON.stringify(result, null, 2));
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.error('Failed: getAllObjectsFromRoot');
|
|
47
|
-
if (error instanceof Error) {
|
|
48
|
-
console.error(error.message);
|
|
49
|
-
}
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for GetAllRecord
|
|
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;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for GetAllRecord
|
|
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
|
-
path: 'string',
|
|
11
|
-
data: 'json',
|
|
12
|
-
};
|
|
13
|
-
const usage = '\nget-all-record <command>\n\nCommands:\n list List getAllRecord records\n find-first Find first matching getAllRecord record\n create Create a new getAllRecord\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
14
|
-
export default async (argv, prompter, _options) => {
|
|
15
|
-
if (argv.help || argv.h) {
|
|
16
|
-
console.log(usage);
|
|
17
|
-
process.exit(0);
|
|
18
|
-
}
|
|
19
|
-
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
20
|
-
if (!subcommand) {
|
|
21
|
-
const answer = await prompter.prompt(argv, [
|
|
22
|
-
{
|
|
23
|
-
type: 'autocomplete',
|
|
24
|
-
name: 'subcommand',
|
|
25
|
-
message: 'What do you want to do?',
|
|
26
|
-
options: ['list', 'find-first', 'create'],
|
|
27
|
-
},
|
|
28
|
-
]);
|
|
29
|
-
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
30
|
-
}
|
|
31
|
-
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
32
|
-
};
|
|
33
|
-
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
34
|
-
switch (subcommand) {
|
|
35
|
-
case 'list':
|
|
36
|
-
return handleList(argv, prompter);
|
|
37
|
-
case 'find-first':
|
|
38
|
-
return handleFindFirst(argv, prompter);
|
|
39
|
-
case 'create':
|
|
40
|
-
return handleCreate(argv, prompter);
|
|
41
|
-
default:
|
|
42
|
-
console.log(usage);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async function handleList(argv, _prompter) {
|
|
47
|
-
try {
|
|
48
|
-
const defaultSelect = {
|
|
49
|
-
path: true,
|
|
50
|
-
data: true,
|
|
51
|
-
};
|
|
52
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
53
|
-
const client = getClient();
|
|
54
|
-
const result = await client.getAllRecord.findMany(findManyArgs).execute();
|
|
55
|
-
console.log(JSON.stringify(result, null, 2));
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
console.error('Failed to list records.');
|
|
59
|
-
if (error instanceof Error) {
|
|
60
|
-
console.error(error.message);
|
|
61
|
-
}
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async function handleFindFirst(argv, _prompter) {
|
|
66
|
-
try {
|
|
67
|
-
const defaultSelect = {
|
|
68
|
-
path: true,
|
|
69
|
-
data: true,
|
|
70
|
-
};
|
|
71
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
72
|
-
const client = getClient();
|
|
73
|
-
const result = await client.getAllRecord.findFirst(findFirstArgs).execute();
|
|
74
|
-
console.log(JSON.stringify(result, null, 2));
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
console.error('Failed to find record.');
|
|
78
|
-
if (error instanceof Error) {
|
|
79
|
-
console.error(error.message);
|
|
80
|
-
}
|
|
81
|
-
process.exit(1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function handleCreate(argv, prompter) {
|
|
85
|
-
try {
|
|
86
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
87
|
-
{
|
|
88
|
-
type: 'text',
|
|
89
|
-
name: 'path',
|
|
90
|
-
message: 'path',
|
|
91
|
-
required: true,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
type: 'json',
|
|
95
|
-
name: 'data',
|
|
96
|
-
message: 'data',
|
|
97
|
-
required: true,
|
|
98
|
-
},
|
|
99
|
-
]);
|
|
100
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
101
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
102
|
-
const client = getClient();
|
|
103
|
-
const result = await client.getAllRecord
|
|
104
|
-
.create({
|
|
105
|
-
data: {
|
|
106
|
-
path: cleanedData.path,
|
|
107
|
-
data: cleanedData.data,
|
|
108
|
-
},
|
|
109
|
-
select: {
|
|
110
|
-
path: true,
|
|
111
|
-
data: true,
|
|
112
|
-
},
|
|
113
|
-
})
|
|
114
|
-
.execute();
|
|
115
|
-
console.log(JSON.stringify(result, null, 2));
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
console.error('Failed to create record.');
|
|
119
|
-
if (error instanceof Error) {
|
|
120
|
-
console.error(error.message);
|
|
121
|
-
}
|
|
122
|
-
process.exit(1);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for query getObjectAtPath
|
|
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;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../executor';
|
|
2
|
-
import { buildSelectFromPaths } from '../utils';
|
|
3
|
-
export default async (argv, prompter, _options) => {
|
|
4
|
-
try {
|
|
5
|
-
if (argv.help || argv.h) {
|
|
6
|
-
console.log('get-object-at-path - getObjectAtPath\n\nUsage: get-object-at-path [OPTIONS]\n');
|
|
7
|
-
process.exit(0);
|
|
8
|
-
}
|
|
9
|
-
const answers = await prompter.prompt(argv, [
|
|
10
|
-
{
|
|
11
|
-
type: 'text',
|
|
12
|
-
name: 'dbId',
|
|
13
|
-
message: 'dbId',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'text',
|
|
17
|
-
name: 'storeId',
|
|
18
|
-
message: 'storeId',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'text',
|
|
22
|
-
name: 'path',
|
|
23
|
-
message: 'path',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'text',
|
|
27
|
-
name: 'refname',
|
|
28
|
-
message: 'refname',
|
|
29
|
-
},
|
|
30
|
-
]);
|
|
31
|
-
const client = getClient();
|
|
32
|
-
const selectFields = buildSelectFromPaths(argv.select ?? '');
|
|
33
|
-
const result = await client.query
|
|
34
|
-
.getObjectAtPath(answers, {
|
|
35
|
-
select: selectFields,
|
|
36
|
-
})
|
|
37
|
-
.execute();
|
|
38
|
-
console.log(JSON.stringify(result, null, 2));
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
console.error('Failed: getObjectAtPath');
|
|
42
|
-
if (error instanceof Error) {
|
|
43
|
-
console.error(error.message);
|
|
44
|
-
}
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
};
|