@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,276 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for Store
|
|
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
|
-
name: 'string',
|
|
12
|
-
databaseId: 'uuid',
|
|
13
|
-
hash: 'uuid',
|
|
14
|
-
createdAt: 'string',
|
|
15
|
-
};
|
|
16
|
-
const usage = '\nstore <command>\n\nCommands:\n list List store records\n find-first Find first matching store record\n get Get a store by ID\n create Create a new store\n update Update an existing store\n delete Delete a store\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';
|
|
17
|
-
export default async (argv, prompter, _options) => {
|
|
18
|
-
if (argv.help || argv.h) {
|
|
19
|
-
console.log(usage);
|
|
20
|
-
process.exit(0);
|
|
21
|
-
}
|
|
22
|
-
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
23
|
-
if (!subcommand) {
|
|
24
|
-
const answer = await prompter.prompt(argv, [
|
|
25
|
-
{
|
|
26
|
-
type: 'autocomplete',
|
|
27
|
-
name: 'subcommand',
|
|
28
|
-
message: 'What do you want to do?',
|
|
29
|
-
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
30
|
-
},
|
|
31
|
-
]);
|
|
32
|
-
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
33
|
-
}
|
|
34
|
-
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
35
|
-
};
|
|
36
|
-
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
37
|
-
switch (subcommand) {
|
|
38
|
-
case 'list':
|
|
39
|
-
return handleList(argv, prompter);
|
|
40
|
-
case 'find-first':
|
|
41
|
-
return handleFindFirst(argv, prompter);
|
|
42
|
-
case 'get':
|
|
43
|
-
return handleGet(argv, prompter);
|
|
44
|
-
case 'create':
|
|
45
|
-
return handleCreate(argv, prompter);
|
|
46
|
-
case 'update':
|
|
47
|
-
return handleUpdate(argv, prompter);
|
|
48
|
-
case 'delete':
|
|
49
|
-
return handleDelete(argv, prompter);
|
|
50
|
-
default:
|
|
51
|
-
console.log(usage);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
async function handleList(argv, _prompter) {
|
|
56
|
-
try {
|
|
57
|
-
const defaultSelect = {
|
|
58
|
-
id: true,
|
|
59
|
-
name: true,
|
|
60
|
-
databaseId: true,
|
|
61
|
-
hash: true,
|
|
62
|
-
createdAt: true,
|
|
63
|
-
};
|
|
64
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
65
|
-
const client = getClient();
|
|
66
|
-
const result = await client.store.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
|
-
databaseId: true,
|
|
83
|
-
hash: true,
|
|
84
|
-
createdAt: true,
|
|
85
|
-
};
|
|
86
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
87
|
-
const client = getClient();
|
|
88
|
-
const result = await client.store.findFirst(findFirstArgs).execute();
|
|
89
|
-
console.log(JSON.stringify(result, null, 2));
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
console.error('Failed to find record.');
|
|
93
|
-
if (error instanceof Error) {
|
|
94
|
-
console.error(error.message);
|
|
95
|
-
}
|
|
96
|
-
process.exit(1);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
async function handleGet(argv, prompter) {
|
|
100
|
-
try {
|
|
101
|
-
const answers = await prompter.prompt(argv, [
|
|
102
|
-
{
|
|
103
|
-
type: 'text',
|
|
104
|
-
name: 'id',
|
|
105
|
-
message: 'id',
|
|
106
|
-
required: true,
|
|
107
|
-
},
|
|
108
|
-
]);
|
|
109
|
-
const client = getClient();
|
|
110
|
-
const result = await client.store
|
|
111
|
-
.findOne({
|
|
112
|
-
id: answers.id,
|
|
113
|
-
select: {
|
|
114
|
-
id: true,
|
|
115
|
-
name: true,
|
|
116
|
-
databaseId: true,
|
|
117
|
-
hash: true,
|
|
118
|
-
createdAt: true,
|
|
119
|
-
},
|
|
120
|
-
})
|
|
121
|
-
.execute();
|
|
122
|
-
console.log(JSON.stringify(result, null, 2));
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
console.error('Record not found.');
|
|
126
|
-
if (error instanceof Error) {
|
|
127
|
-
console.error(error.message);
|
|
128
|
-
}
|
|
129
|
-
process.exit(1);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
async function handleCreate(argv, prompter) {
|
|
133
|
-
try {
|
|
134
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
135
|
-
{
|
|
136
|
-
type: 'text',
|
|
137
|
-
name: 'name',
|
|
138
|
-
message: 'name',
|
|
139
|
-
required: true,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: 'text',
|
|
143
|
-
name: 'databaseId',
|
|
144
|
-
message: 'databaseId',
|
|
145
|
-
required: true,
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
type: 'text',
|
|
149
|
-
name: 'hash',
|
|
150
|
-
message: 'hash',
|
|
151
|
-
required: false,
|
|
152
|
-
skipPrompt: true,
|
|
153
|
-
},
|
|
154
|
-
]);
|
|
155
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
156
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
157
|
-
const client = getClient();
|
|
158
|
-
const result = await client.store
|
|
159
|
-
.create({
|
|
160
|
-
data: {
|
|
161
|
-
name: cleanedData.name,
|
|
162
|
-
databaseId: cleanedData.databaseId,
|
|
163
|
-
hash: cleanedData.hash,
|
|
164
|
-
},
|
|
165
|
-
select: {
|
|
166
|
-
id: true,
|
|
167
|
-
name: true,
|
|
168
|
-
databaseId: true,
|
|
169
|
-
hash: true,
|
|
170
|
-
createdAt: true,
|
|
171
|
-
},
|
|
172
|
-
})
|
|
173
|
-
.execute();
|
|
174
|
-
console.log(JSON.stringify(result, null, 2));
|
|
175
|
-
}
|
|
176
|
-
catch (error) {
|
|
177
|
-
console.error('Failed to create record.');
|
|
178
|
-
if (error instanceof Error) {
|
|
179
|
-
console.error(error.message);
|
|
180
|
-
}
|
|
181
|
-
process.exit(1);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
async function handleUpdate(argv, prompter) {
|
|
185
|
-
try {
|
|
186
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
187
|
-
{
|
|
188
|
-
type: 'text',
|
|
189
|
-
name: 'id',
|
|
190
|
-
message: 'id',
|
|
191
|
-
required: true,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
type: 'text',
|
|
195
|
-
name: 'name',
|
|
196
|
-
message: 'name',
|
|
197
|
-
required: false,
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
type: 'text',
|
|
201
|
-
name: 'databaseId',
|
|
202
|
-
message: 'databaseId',
|
|
203
|
-
required: false,
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
type: 'text',
|
|
207
|
-
name: 'hash',
|
|
208
|
-
message: 'hash',
|
|
209
|
-
required: false,
|
|
210
|
-
skipPrompt: true,
|
|
211
|
-
},
|
|
212
|
-
]);
|
|
213
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
214
|
-
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
215
|
-
const client = getClient();
|
|
216
|
-
const result = await client.store
|
|
217
|
-
.update({
|
|
218
|
-
where: {
|
|
219
|
-
id: answers.id,
|
|
220
|
-
},
|
|
221
|
-
data: {
|
|
222
|
-
name: cleanedData.name,
|
|
223
|
-
databaseId: cleanedData.databaseId,
|
|
224
|
-
hash: cleanedData.hash,
|
|
225
|
-
},
|
|
226
|
-
select: {
|
|
227
|
-
id: true,
|
|
228
|
-
name: true,
|
|
229
|
-
databaseId: true,
|
|
230
|
-
hash: true,
|
|
231
|
-
createdAt: true,
|
|
232
|
-
},
|
|
233
|
-
})
|
|
234
|
-
.execute();
|
|
235
|
-
console.log(JSON.stringify(result, null, 2));
|
|
236
|
-
}
|
|
237
|
-
catch (error) {
|
|
238
|
-
console.error('Failed to update record.');
|
|
239
|
-
if (error instanceof Error) {
|
|
240
|
-
console.error(error.message);
|
|
241
|
-
}
|
|
242
|
-
process.exit(1);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
async function handleDelete(argv, prompter) {
|
|
246
|
-
try {
|
|
247
|
-
const rawAnswers = await prompter.prompt(argv, [
|
|
248
|
-
{
|
|
249
|
-
type: 'text',
|
|
250
|
-
name: 'id',
|
|
251
|
-
message: 'id',
|
|
252
|
-
required: true,
|
|
253
|
-
},
|
|
254
|
-
]);
|
|
255
|
-
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
256
|
-
const client = getClient();
|
|
257
|
-
const result = await client.store
|
|
258
|
-
.delete({
|
|
259
|
-
where: {
|
|
260
|
-
id: answers.id,
|
|
261
|
-
},
|
|
262
|
-
select: {
|
|
263
|
-
id: true,
|
|
264
|
-
},
|
|
265
|
-
})
|
|
266
|
-
.execute();
|
|
267
|
-
console.log(JSON.stringify(result, null, 2));
|
|
268
|
-
}
|
|
269
|
-
catch (error) {
|
|
270
|
-
console.error('Failed to delete record.');
|
|
271
|
-
if (error instanceof Error) {
|
|
272
|
-
console.error(error.message);
|
|
273
|
-
}
|
|
274
|
-
process.exit(1);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for mutation updateNodeAtPath
|
|
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('update-node-at-path - updateNodeAtPath\n\nUsage: update-node-at-path [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
|
-
.updateNodeAtPath(parsedAnswers, {
|
|
22
|
-
select: selectFields,
|
|
23
|
-
})
|
|
24
|
-
.execute();
|
|
25
|
-
console.log(JSON.stringify(result, null, 2));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
console.error('Failed: updateNodeAtPath');
|
|
29
|
-
if (error instanceof Error) {
|
|
30
|
-
console.error(error.message);
|
|
31
|
-
}
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for UsageSnapshot
|
|
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,314 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI commands for UsageSnapshot
|
|
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
|
-
databaseId: 'uuid',
|
|
11
|
-
metricName: 'string',
|
|
12
|
-
metricValue: 'int',
|
|
13
|
-
dimensions: 'json',
|
|
14
|
-
capturedAt: 'string',
|
|
15
|
-
id: 'uuid',
|
|
16
|
-
};
|
|
17
|
-
const usage = '\nusage-snapshot <command>\n\nCommands:\n list List usageSnapshot records\n find-first Find first matching usageSnapshot record\n get Get a usageSnapshot by ID\n create Create a new usageSnapshot\n update Update an existing usageSnapshot\n delete Delete a usageSnapshot\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';
|
|
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
|
-
databaseId: true,
|
|
60
|
-
metricName: true,
|
|
61
|
-
metricValue: true,
|
|
62
|
-
dimensions: true,
|
|
63
|
-
capturedAt: true,
|
|
64
|
-
id: true,
|
|
65
|
-
};
|
|
66
|
-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
67
|
-
const client = getClient();
|
|
68
|
-
const result = await client.usageSnapshot.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
|
-
databaseId: true,
|
|
83
|
-
metricName: true,
|
|
84
|
-
metricValue: true,
|
|
85
|
-
dimensions: true,
|
|
86
|
-
capturedAt: true,
|
|
87
|
-
id: true,
|
|
88
|
-
};
|
|
89
|
-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
90
|
-
const client = getClient();
|
|
91
|
-
const result = await client.usageSnapshot.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.usageSnapshot
|
|
114
|
-
.findOne({
|
|
115
|
-
id: answers.id,
|
|
116
|
-
select: {
|
|
117
|
-
databaseId: true,
|
|
118
|
-
metricName: true,
|
|
119
|
-
metricValue: true,
|
|
120
|
-
dimensions: true,
|
|
121
|
-
capturedAt: true,
|
|
122
|
-
id: 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: 'databaseId',
|
|
142
|
-
message: 'databaseId',
|
|
143
|
-
required: true,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
type: 'text',
|
|
147
|
-
name: 'metricName',
|
|
148
|
-
message: 'metricName',
|
|
149
|
-
required: true,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
type: 'text',
|
|
153
|
-
name: 'metricValue',
|
|
154
|
-
message: 'metricValue',
|
|
155
|
-
required: false,
|
|
156
|
-
skipPrompt: true,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'json',
|
|
160
|
-
name: 'dimensions',
|
|
161
|
-
message: 'dimensions',
|
|
162
|
-
required: false,
|
|
163
|
-
skipPrompt: true,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
type: 'text',
|
|
167
|
-
name: 'capturedAt',
|
|
168
|
-
message: 'capturedAt',
|
|
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.usageSnapshot
|
|
177
|
-
.create({
|
|
178
|
-
data: {
|
|
179
|
-
databaseId: cleanedData.databaseId,
|
|
180
|
-
metricName: cleanedData.metricName,
|
|
181
|
-
metricValue: cleanedData.metricValue,
|
|
182
|
-
dimensions: cleanedData.dimensions,
|
|
183
|
-
capturedAt: cleanedData.capturedAt,
|
|
184
|
-
},
|
|
185
|
-
select: {
|
|
186
|
-
databaseId: true,
|
|
187
|
-
metricName: true,
|
|
188
|
-
metricValue: true,
|
|
189
|
-
dimensions: true,
|
|
190
|
-
capturedAt: true,
|
|
191
|
-
id: 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: 'databaseId',
|
|
217
|
-
message: 'databaseId',
|
|
218
|
-
required: false,
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
type: 'text',
|
|
222
|
-
name: 'metricName',
|
|
223
|
-
message: 'metricName',
|
|
224
|
-
required: false,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
type: 'text',
|
|
228
|
-
name: 'metricValue',
|
|
229
|
-
message: 'metricValue',
|
|
230
|
-
required: false,
|
|
231
|
-
skipPrompt: true,
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
type: 'json',
|
|
235
|
-
name: 'dimensions',
|
|
236
|
-
message: 'dimensions',
|
|
237
|
-
required: false,
|
|
238
|
-
skipPrompt: true,
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
type: 'text',
|
|
242
|
-
name: 'capturedAt',
|
|
243
|
-
message: 'capturedAt',
|
|
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.usageSnapshot
|
|
252
|
-
.update({
|
|
253
|
-
where: {
|
|
254
|
-
id: answers.id,
|
|
255
|
-
},
|
|
256
|
-
data: {
|
|
257
|
-
databaseId: cleanedData.databaseId,
|
|
258
|
-
metricName: cleanedData.metricName,
|
|
259
|
-
metricValue: cleanedData.metricValue,
|
|
260
|
-
dimensions: cleanedData.dimensions,
|
|
261
|
-
capturedAt: cleanedData.capturedAt,
|
|
262
|
-
},
|
|
263
|
-
select: {
|
|
264
|
-
databaseId: true,
|
|
265
|
-
metricName: true,
|
|
266
|
-
metricValue: true,
|
|
267
|
-
dimensions: true,
|
|
268
|
-
capturedAt: true,
|
|
269
|
-
id: 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.usageSnapshot
|
|
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
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentMessage model for ORM client
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { OrmClient } from '../client';
|
|
7
|
-
import { QueryBuilder } from '../query-builder';
|
|
8
|
-
import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { AgentMessageWithRelations, AgentMessageSelect, AgentMessageFilter, AgentMessageOrderBy, CreateAgentMessageInput, AgentMessagePatch } from '../input-types';
|
|
10
|
-
export declare class AgentMessageModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends AgentMessageSelect>(args: FindManyArgs<S, AgentMessageFilter, AgentMessageOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
16
|
-
agentMessages: ConnectionResult<InferSelectResult<AgentMessageWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends AgentMessageSelect>(args: FindFirstArgs<S, AgentMessageFilter, AgentMessageOrderBy> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
21
|
-
agentMessage: InferSelectResult<AgentMessageWithRelations, S> | null;
|
|
22
|
-
}>;
|
|
23
|
-
findOne<S extends AgentMessageSelect>(args: {
|
|
24
|
-
id: string;
|
|
25
|
-
select: S;
|
|
26
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
27
|
-
agentMessage: InferSelectResult<AgentMessageWithRelations, S> | null;
|
|
28
|
-
}>;
|
|
29
|
-
create<S extends AgentMessageSelect>(args: CreateArgs<S, CreateAgentMessageInput['agentMessage']> & {
|
|
30
|
-
select: S;
|
|
31
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
32
|
-
createAgentMessage: {
|
|
33
|
-
agentMessage: InferSelectResult<AgentMessageWithRelations, S>;
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
36
|
-
update<S extends AgentMessageSelect>(args: UpdateArgs<S, {
|
|
37
|
-
id: string;
|
|
38
|
-
}, AgentMessagePatch> & {
|
|
39
|
-
select: S;
|
|
40
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
41
|
-
updateAgentMessage: {
|
|
42
|
-
agentMessage: InferSelectResult<AgentMessageWithRelations, S>;
|
|
43
|
-
};
|
|
44
|
-
}>;
|
|
45
|
-
delete<S extends AgentMessageSelect>(args: DeleteArgs<{
|
|
46
|
-
id: string;
|
|
47
|
-
}, S> & {
|
|
48
|
-
select: S;
|
|
49
|
-
} & StrictSelect<S, AgentMessageSelect>): QueryBuilder<{
|
|
50
|
-
deleteAgentMessage: {
|
|
51
|
-
agentMessage: InferSelectResult<AgentMessageWithRelations, S>;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
54
|
-
}
|