@constructive-sdk/cli 0.20.9 → 0.21.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/usage-snapshot.d.ts +8 -0
- package/admin/cli/commands/usage-snapshot.js +316 -0
- package/admin/cli/commands.js +3 -1
- package/admin/cli/executor.d.ts +1 -0
- package/admin/orm/index.d.ts +2 -0
- package/admin/orm/index.js +2 -0
- package/admin/orm/input-types.d.ts +129 -0
- package/admin/orm/models/index.d.ts +1 -0
- package/admin/orm/models/index.js +3 -1
- package/admin/orm/models/usageSnapshot.d.ts +56 -0
- package/admin/orm/models/usageSnapshot.js +100 -0
- package/esm/admin/cli/commands/usage-snapshot.d.ts +8 -0
- package/esm/admin/cli/commands/usage-snapshot.js +314 -0
- package/esm/admin/cli/commands.js +3 -1
- package/esm/admin/cli/executor.d.ts +1 -0
- package/esm/admin/orm/index.d.ts +2 -0
- package/esm/admin/orm/index.js +2 -0
- package/esm/admin/orm/input-types.d.ts +129 -0
- package/esm/admin/orm/models/index.d.ts +1 -0
- package/esm/admin/orm/models/index.js +1 -0
- package/esm/admin/orm/models/usageSnapshot.d.ts +56 -0
- package/esm/admin/orm/models/usageSnapshot.js +96 -0
- package/esm/public/cli/commands/usage-snapshot.d.ts +8 -0
- package/esm/public/cli/commands/usage-snapshot.js +314 -0
- package/esm/public/cli/commands.js +3 -1
- package/esm/public/cli/executor.d.ts +1 -0
- package/esm/public/orm/index.d.ts +2 -0
- package/esm/public/orm/index.js +2 -0
- package/esm/public/orm/input-types.d.ts +129 -0
- package/esm/public/orm/models/index.d.ts +1 -0
- package/esm/public/orm/models/index.js +1 -0
- package/esm/public/orm/models/usageSnapshot.d.ts +56 -0
- package/esm/public/orm/models/usageSnapshot.js +96 -0
- package/package.json +6 -6
- package/public/cli/commands/usage-snapshot.d.ts +8 -0
- package/public/cli/commands/usage-snapshot.js +316 -0
- package/public/cli/commands.js +3 -1
- package/public/cli/executor.d.ts +1 -0
- package/public/orm/index.d.ts +2 -0
- package/public/orm/index.js +2 -0
- package/public/orm/input-types.d.ts +129 -0
- package/public/orm/models/index.d.ts +1 -0
- package/public/orm/models/index.js +3 -1
- package/public/orm/models/usageSnapshot.d.ts +56 -0
- package/public/orm/models/usageSnapshot.js +100 -0
|
@@ -137,6 +137,7 @@ import userConnectedAccountCmd from './commands/user-connected-account';
|
|
|
137
137
|
import commitCmd from './commands/commit';
|
|
138
138
|
import pubkeySettingCmd from './commands/pubkey-setting';
|
|
139
139
|
import rateLimitsModuleCmd from './commands/rate-limits-module';
|
|
140
|
+
import usageSnapshotCmd from './commands/usage-snapshot';
|
|
140
141
|
import appMembershipDefaultCmd from './commands/app-membership-default';
|
|
141
142
|
import orgMembershipDefaultCmd from './commands/org-membership-default';
|
|
142
143
|
import rlsSettingCmd from './commands/rls-setting';
|
|
@@ -358,6 +359,7 @@ const createCommandMap = () => ({
|
|
|
358
359
|
commit: commitCmd,
|
|
359
360
|
'pubkey-setting': pubkeySettingCmd,
|
|
360
361
|
'rate-limits-module': rateLimitsModuleCmd,
|
|
362
|
+
'usage-snapshot': usageSnapshotCmd,
|
|
361
363
|
'app-membership-default': appMembershipDefaultCmd,
|
|
362
364
|
'org-membership-default': orgMembershipDefaultCmd,
|
|
363
365
|
'rls-setting': rlsSettingCmd,
|
|
@@ -446,7 +448,7 @@ const createCommandMap = () => ({
|
|
|
446
448
|
'provision-table': provisionTableCmd,
|
|
447
449
|
'provision-bucket': provisionBucketCmd,
|
|
448
450
|
});
|
|
449
|
-
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n object object CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n spatial-relation spatialRelation CRUD operations\n partition partition CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n function function CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n cors-setting corsSetting CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n api-setting apiSetting CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n notifications-module notificationsModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n agent-thread agentThread CRUD operations\n agent-message agentMessage CRUD operations\n agent-task agentTask CRUD operations\n role-type roleType CRUD operations\n identity-provider identityProvider CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n app-limit-cap appLimitCap CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n membership-type membershipType CRUD operations\n migrate-file migrateFile CRUD operations\n devices-module devicesModule CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n commit commit CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-setting rlsSetting CRUD operations\n app-limit-event appLimitEvent CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n rls-module rlsModule CRUD operations\n database-setting databaseSetting CRUD operations\n plans-module plansModule CRUD operations\n sql-action sqlAction CRUD operations\n billing-module billingModule CRUD operations\n ast-migration astMigration CRUD operations\n user user CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n app-membership appMembership CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Six phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-new-user provisionNewUser\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-cross-origin signInCrossOrigin\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
451
|
+
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n object object CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n spatial-relation spatialRelation CRUD operations\n partition partition CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n function function CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n cors-setting corsSetting CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n api-setting apiSetting CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n notifications-module notificationsModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n agent-thread agentThread CRUD operations\n agent-message agentMessage CRUD operations\n agent-task agentTask CRUD operations\n role-type roleType CRUD operations\n identity-provider identityProvider CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n app-limit-cap appLimitCap CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n membership-type membershipType CRUD operations\n migrate-file migrateFile CRUD operations\n devices-module devicesModule CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n commit commit CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n usage-snapshot usageSnapshot CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-setting rlsSetting CRUD operations\n app-limit-event appLimitEvent CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n rls-module rlsModule CRUD operations\n database-setting databaseSetting CRUD operations\n plans-module plansModule CRUD operations\n sql-action sqlAction CRUD operations\n billing-module billingModule CRUD operations\n ast-migration astMigration CRUD operations\n user user CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n app-membership appMembership CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Six phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints are deferred), (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level indexes/fts/unique_constraints are deferred to phases 3-5 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-new-user provisionNewUser\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n apply-rls applyRls\n sign-in-cross-origin signInCrossOrigin\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
450
452
|
export const commands = async (argv, prompter, options) => {
|
|
451
453
|
if (argv.help || argv.h) {
|
|
452
454
|
console.log(usage);
|
|
@@ -131,6 +131,7 @@ export declare function getClient(contextName?: string): {
|
|
|
131
131
|
commit: import("..").CommitModel;
|
|
132
132
|
pubkeySetting: import("..").PubkeySettingModel;
|
|
133
133
|
rateLimitsModule: import("..").RateLimitsModuleModel;
|
|
134
|
+
usageSnapshot: import("..").UsageSnapshotModel;
|
|
134
135
|
appMembershipDefault: import("..").AppMembershipDefaultModel;
|
|
135
136
|
orgMembershipDefault: import("..").OrgMembershipDefaultModel;
|
|
136
137
|
rlsSetting: import("..").RlsSettingModel;
|
|
@@ -130,6 +130,7 @@ import { UserConnectedAccountModel } from './models/userConnectedAccount';
|
|
|
130
130
|
import { CommitModel } from './models/commit';
|
|
131
131
|
import { PubkeySettingModel } from './models/pubkeySetting';
|
|
132
132
|
import { RateLimitsModuleModel } from './models/rateLimitsModule';
|
|
133
|
+
import { UsageSnapshotModel } from './models/usageSnapshot';
|
|
133
134
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
134
135
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
135
136
|
import { RlsSettingModel } from './models/rlsSetting';
|
|
@@ -310,6 +311,7 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
310
311
|
commit: CommitModel;
|
|
311
312
|
pubkeySetting: PubkeySettingModel;
|
|
312
313
|
rateLimitsModule: RateLimitsModuleModel;
|
|
314
|
+
usageSnapshot: UsageSnapshotModel;
|
|
313
315
|
appMembershipDefault: AppMembershipDefaultModel;
|
|
314
316
|
orgMembershipDefault: OrgMembershipDefaultModel;
|
|
315
317
|
rlsSetting: RlsSettingModel;
|
package/esm/public/orm/index.js
CHANGED
|
@@ -135,6 +135,7 @@ import { UserConnectedAccountModel } from './models/userConnectedAccount';
|
|
|
135
135
|
import { CommitModel } from './models/commit';
|
|
136
136
|
import { PubkeySettingModel } from './models/pubkeySetting';
|
|
137
137
|
import { RateLimitsModuleModel } from './models/rateLimitsModule';
|
|
138
|
+
import { UsageSnapshotModel } from './models/usageSnapshot';
|
|
138
139
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
139
140
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
140
141
|
import { RlsSettingModel } from './models/rlsSetting';
|
|
@@ -318,6 +319,7 @@ export function createClient(config) {
|
|
|
318
319
|
commit: new CommitModel(client),
|
|
319
320
|
pubkeySetting: new PubkeySettingModel(client),
|
|
320
321
|
rateLimitsModule: new RateLimitsModuleModel(client),
|
|
322
|
+
usageSnapshot: new UsageSnapshotModel(client),
|
|
321
323
|
appMembershipDefault: new AppMembershipDefaultModel(client),
|
|
322
324
|
orgMembershipDefault: new OrgMembershipDefaultModel(client),
|
|
323
325
|
rlsSetting: new RlsSettingModel(client),
|
|
@@ -2521,6 +2521,20 @@ export interface RateLimitsModule {
|
|
|
2521
2521
|
ipRateLimitsTable?: string | null;
|
|
2522
2522
|
rateLimitsTable?: string | null;
|
|
2523
2523
|
}
|
|
2524
|
+
/** Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns. */
|
|
2525
|
+
export interface UsageSnapshot {
|
|
2526
|
+
/** The database this snapshot belongs to. References metaschema_public.database.id but declared without an FK constraint — the snapshot collector runs in a platform context where the FK would add overhead without value. */
|
|
2527
|
+
databaseId?: string | null;
|
|
2528
|
+
/** Identifier for the metric being measured (e.g. 'reads', 'writes', 'storage_bytes', 'compute_time_ms'). */
|
|
2529
|
+
metricName?: string | null;
|
|
2530
|
+
/** The measured value at the time of capture. Interpretation depends on metric_name (count, bytes, milliseconds, etc.). */
|
|
2531
|
+
metricValue?: string | null;
|
|
2532
|
+
/** Optional sub-metric breakdowns as key-value pairs (e.g. {"query_type": "select"} for reads). Empty object when no breakdown is needed. */
|
|
2533
|
+
dimensions?: Record<string, unknown> | null;
|
|
2534
|
+
/** When this snapshot was taken. Defaults to the current timestamp; the snapshot collector may override this for backdated imports. */
|
|
2535
|
+
capturedAt?: string | null;
|
|
2536
|
+
id: string;
|
|
2537
|
+
}
|
|
2524
2538
|
/** Default membership settings per entity, controlling initial approval and verification state for new members */
|
|
2525
2539
|
export interface AppMembershipDefault {
|
|
2526
2540
|
id: string;
|
|
@@ -3628,6 +3642,8 @@ export interface RateLimitsModuleRelations {
|
|
|
3628
3642
|
rateLimitsTableByRateLimitsTableId?: Table | null;
|
|
3629
3643
|
schema?: Schema | null;
|
|
3630
3644
|
}
|
|
3645
|
+
export interface UsageSnapshotRelations {
|
|
3646
|
+
}
|
|
3631
3647
|
export interface AppMembershipDefaultRelations {
|
|
3632
3648
|
}
|
|
3633
3649
|
export interface OrgMembershipDefaultRelations {
|
|
@@ -3917,6 +3933,7 @@ export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConne
|
|
|
3917
3933
|
export type CommitWithRelations = Commit & CommitRelations;
|
|
3918
3934
|
export type PubkeySettingWithRelations = PubkeySetting & PubkeySettingRelations;
|
|
3919
3935
|
export type RateLimitsModuleWithRelations = RateLimitsModule & RateLimitsModuleRelations;
|
|
3936
|
+
export type UsageSnapshotWithRelations = UsageSnapshot & UsageSnapshotRelations;
|
|
3920
3937
|
export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations;
|
|
3921
3938
|
export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & OrgMembershipDefaultRelations;
|
|
3922
3939
|
export type RlsSettingWithRelations = RlsSetting & RlsSettingRelations;
|
|
@@ -7330,6 +7347,14 @@ export type RateLimitsModuleSelect = {
|
|
|
7330
7347
|
select: SchemaSelect;
|
|
7331
7348
|
};
|
|
7332
7349
|
};
|
|
7350
|
+
export type UsageSnapshotSelect = {
|
|
7351
|
+
databaseId?: boolean;
|
|
7352
|
+
metricName?: boolean;
|
|
7353
|
+
metricValue?: boolean;
|
|
7354
|
+
dimensions?: boolean;
|
|
7355
|
+
capturedAt?: boolean;
|
|
7356
|
+
id?: boolean;
|
|
7357
|
+
};
|
|
7333
7358
|
export type AppMembershipDefaultSelect = {
|
|
7334
7359
|
id?: boolean;
|
|
7335
7360
|
createdAt?: boolean;
|
|
@@ -13088,6 +13113,26 @@ export interface RateLimitsModuleFilter {
|
|
|
13088
13113
|
/** Filter by the object’s `schema` relation. */
|
|
13089
13114
|
schema?: SchemaFilter;
|
|
13090
13115
|
}
|
|
13116
|
+
export interface UsageSnapshotFilter {
|
|
13117
|
+
/** Filter by the object’s `databaseId` field. */
|
|
13118
|
+
databaseId?: UUIDFilter;
|
|
13119
|
+
/** Filter by the object’s `metricName` field. */
|
|
13120
|
+
metricName?: StringFilter;
|
|
13121
|
+
/** Filter by the object’s `metricValue` field. */
|
|
13122
|
+
metricValue?: BigIntFilter;
|
|
13123
|
+
/** Filter by the object’s `dimensions` field. */
|
|
13124
|
+
dimensions?: JSONFilter;
|
|
13125
|
+
/** Filter by the object’s `capturedAt` field. */
|
|
13126
|
+
capturedAt?: DatetimeFilter;
|
|
13127
|
+
/** Filter by the object’s `id` field. */
|
|
13128
|
+
id?: UUIDFilter;
|
|
13129
|
+
/** Checks for all expressions in this list. */
|
|
13130
|
+
and?: UsageSnapshotFilter[];
|
|
13131
|
+
/** Checks for any expressions in this list. */
|
|
13132
|
+
or?: UsageSnapshotFilter[];
|
|
13133
|
+
/** Negates the expression. */
|
|
13134
|
+
not?: UsageSnapshotFilter;
|
|
13135
|
+
}
|
|
13091
13136
|
export interface AppMembershipDefaultFilter {
|
|
13092
13137
|
/** Filter by the object’s `id` field. */
|
|
13093
13138
|
id?: UUIDFilter;
|
|
@@ -14206,6 +14251,7 @@ export type UserConnectedAccountOrderBy = 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'OW
|
|
|
14206
14251
|
export type CommitOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'MESSAGE_ASC' | 'MESSAGE_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' | 'PARENT_IDS_ASC' | 'PARENT_IDS_DESC' | 'AUTHOR_ID_ASC' | 'AUTHOR_ID_DESC' | 'COMMITTER_ID_ASC' | 'COMMITTER_ID_DESC' | 'TREE_ID_ASC' | 'TREE_ID_DESC' | 'DATE_ASC' | 'DATE_DESC';
|
|
14207
14252
|
export type PubkeySettingOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'CRYPTO_NETWORK_ASC' | 'CRYPTO_NETWORK_DESC' | 'USER_FIELD_ASC' | 'USER_FIELD_DESC' | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC';
|
|
14208
14253
|
export type RateLimitsModuleOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' | 'IP_RATE_LIMITS_TABLE_ID_ASC' | 'IP_RATE_LIMITS_TABLE_ID_DESC' | 'RATE_LIMITS_TABLE_ID_ASC' | 'RATE_LIMITS_TABLE_ID_DESC' | 'RATE_LIMIT_SETTINGS_TABLE_ASC' | 'RATE_LIMIT_SETTINGS_TABLE_DESC' | 'IP_RATE_LIMITS_TABLE_ASC' | 'IP_RATE_LIMITS_TABLE_DESC' | 'RATE_LIMITS_TABLE_ASC' | 'RATE_LIMITS_TABLE_DESC';
|
|
14254
|
+
export type UsageSnapshotOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'METRIC_NAME_ASC' | 'METRIC_NAME_DESC' | 'METRIC_VALUE_ASC' | 'METRIC_VALUE_DESC' | 'DIMENSIONS_ASC' | 'DIMENSIONS_DESC' | 'CAPTURED_AT_ASC' | 'CAPTURED_AT_DESC' | 'ID_ASC' | 'ID_DESC';
|
|
14209
14255
|
export type AppMembershipDefaultOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'CREATED_BY_ASC' | 'CREATED_BY_DESC' | 'UPDATED_BY_ASC' | 'UPDATED_BY_DESC' | 'IS_APPROVED_ASC' | 'IS_APPROVED_DESC' | 'IS_VERIFIED_ASC' | 'IS_VERIFIED_DESC';
|
|
14210
14256
|
export type OrgMembershipDefaultOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'CREATED_BY_ASC' | 'CREATED_BY_DESC' | 'UPDATED_BY_ASC' | 'UPDATED_BY_DESC' | 'IS_APPROVED_ASC' | 'IS_APPROVED_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC';
|
|
14211
14257
|
export type RlsSettingOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'AUTHENTICATE_SCHEMA_ID_ASC' | 'AUTHENTICATE_SCHEMA_ID_DESC' | 'ROLE_SCHEMA_ID_ASC' | 'ROLE_SCHEMA_ID_DESC' | 'AUTHENTICATE_FUNCTION_ID_ASC' | 'AUTHENTICATE_FUNCTION_ID_DESC' | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' | 'AUTHENTICATE_STRICT_FUNCTION_ID_DESC' | 'CURRENT_ROLE_FUNCTION_ID_ASC' | 'CURRENT_ROLE_FUNCTION_ID_DESC' | 'CURRENT_ROLE_ID_FUNCTION_ID_ASC' | 'CURRENT_ROLE_ID_FUNCTION_ID_DESC' | 'CURRENT_USER_AGENT_FUNCTION_ID_ASC' | 'CURRENT_USER_AGENT_FUNCTION_ID_DESC' | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC';
|
|
@@ -18427,6 +18473,32 @@ export interface DeleteRateLimitsModuleInput {
|
|
|
18427
18473
|
clientMutationId?: string;
|
|
18428
18474
|
id: string;
|
|
18429
18475
|
}
|
|
18476
|
+
export interface CreateUsageSnapshotInput {
|
|
18477
|
+
clientMutationId?: string;
|
|
18478
|
+
usageSnapshot: {
|
|
18479
|
+
databaseId: string;
|
|
18480
|
+
metricName: string;
|
|
18481
|
+
metricValue?: string;
|
|
18482
|
+
dimensions?: Record<string, unknown>;
|
|
18483
|
+
capturedAt?: string;
|
|
18484
|
+
};
|
|
18485
|
+
}
|
|
18486
|
+
export interface UsageSnapshotPatch {
|
|
18487
|
+
databaseId?: string | null;
|
|
18488
|
+
metricName?: string | null;
|
|
18489
|
+
metricValue?: string | null;
|
|
18490
|
+
dimensions?: Record<string, unknown> | null;
|
|
18491
|
+
capturedAt?: string | null;
|
|
18492
|
+
}
|
|
18493
|
+
export interface UpdateUsageSnapshotInput {
|
|
18494
|
+
clientMutationId?: string;
|
|
18495
|
+
id: string;
|
|
18496
|
+
usageSnapshotPatch: UsageSnapshotPatch;
|
|
18497
|
+
}
|
|
18498
|
+
export interface DeleteUsageSnapshotInput {
|
|
18499
|
+
clientMutationId?: string;
|
|
18500
|
+
id: string;
|
|
18501
|
+
}
|
|
18430
18502
|
export interface CreateAppMembershipDefaultInput {
|
|
18431
18503
|
clientMutationId?: string;
|
|
18432
18504
|
appMembershipDefault: {
|
|
@@ -33570,6 +33642,51 @@ export type DeleteRateLimitsModulePayloadSelect = {
|
|
|
33570
33642
|
select: RateLimitsModuleEdgeSelect;
|
|
33571
33643
|
};
|
|
33572
33644
|
};
|
|
33645
|
+
export interface CreateUsageSnapshotPayload {
|
|
33646
|
+
clientMutationId?: string | null;
|
|
33647
|
+
/** The `UsageSnapshot` that was created by this mutation. */
|
|
33648
|
+
usageSnapshot?: UsageSnapshot | null;
|
|
33649
|
+
usageSnapshotEdge?: UsageSnapshotEdge | null;
|
|
33650
|
+
}
|
|
33651
|
+
export type CreateUsageSnapshotPayloadSelect = {
|
|
33652
|
+
clientMutationId?: boolean;
|
|
33653
|
+
usageSnapshot?: {
|
|
33654
|
+
select: UsageSnapshotSelect;
|
|
33655
|
+
};
|
|
33656
|
+
usageSnapshotEdge?: {
|
|
33657
|
+
select: UsageSnapshotEdgeSelect;
|
|
33658
|
+
};
|
|
33659
|
+
};
|
|
33660
|
+
export interface UpdateUsageSnapshotPayload {
|
|
33661
|
+
clientMutationId?: string | null;
|
|
33662
|
+
/** The `UsageSnapshot` that was updated by this mutation. */
|
|
33663
|
+
usageSnapshot?: UsageSnapshot | null;
|
|
33664
|
+
usageSnapshotEdge?: UsageSnapshotEdge | null;
|
|
33665
|
+
}
|
|
33666
|
+
export type UpdateUsageSnapshotPayloadSelect = {
|
|
33667
|
+
clientMutationId?: boolean;
|
|
33668
|
+
usageSnapshot?: {
|
|
33669
|
+
select: UsageSnapshotSelect;
|
|
33670
|
+
};
|
|
33671
|
+
usageSnapshotEdge?: {
|
|
33672
|
+
select: UsageSnapshotEdgeSelect;
|
|
33673
|
+
};
|
|
33674
|
+
};
|
|
33675
|
+
export interface DeleteUsageSnapshotPayload {
|
|
33676
|
+
clientMutationId?: string | null;
|
|
33677
|
+
/** The `UsageSnapshot` that was deleted by this mutation. */
|
|
33678
|
+
usageSnapshot?: UsageSnapshot | null;
|
|
33679
|
+
usageSnapshotEdge?: UsageSnapshotEdge | null;
|
|
33680
|
+
}
|
|
33681
|
+
export type DeleteUsageSnapshotPayloadSelect = {
|
|
33682
|
+
clientMutationId?: boolean;
|
|
33683
|
+
usageSnapshot?: {
|
|
33684
|
+
select: UsageSnapshotSelect;
|
|
33685
|
+
};
|
|
33686
|
+
usageSnapshotEdge?: {
|
|
33687
|
+
select: UsageSnapshotEdgeSelect;
|
|
33688
|
+
};
|
|
33689
|
+
};
|
|
33573
33690
|
export interface CreateAppMembershipDefaultPayload {
|
|
33574
33691
|
clientMutationId?: string | null;
|
|
33575
33692
|
/** The `AppMembershipDefault` that was created by this mutation. */
|
|
@@ -35836,6 +35953,18 @@ export type RateLimitsModuleEdgeSelect = {
|
|
|
35836
35953
|
select: RateLimitsModuleSelect;
|
|
35837
35954
|
};
|
|
35838
35955
|
};
|
|
35956
|
+
/** A `UsageSnapshot` edge in the connection. */
|
|
35957
|
+
export interface UsageSnapshotEdge {
|
|
35958
|
+
cursor?: string | null;
|
|
35959
|
+
/** The `UsageSnapshot` at the end of the edge. */
|
|
35960
|
+
node?: UsageSnapshot | null;
|
|
35961
|
+
}
|
|
35962
|
+
export type UsageSnapshotEdgeSelect = {
|
|
35963
|
+
cursor?: boolean;
|
|
35964
|
+
node?: {
|
|
35965
|
+
select: UsageSnapshotSelect;
|
|
35966
|
+
};
|
|
35967
|
+
};
|
|
35839
35968
|
/** A `AppMembershipDefault` edge in the connection. */
|
|
35840
35969
|
export interface AppMembershipDefaultEdge {
|
|
35841
35970
|
cursor?: string | null;
|
|
@@ -134,6 +134,7 @@ export { UserConnectedAccountModel } from './userConnectedAccount';
|
|
|
134
134
|
export { CommitModel } from './commit';
|
|
135
135
|
export { PubkeySettingModel } from './pubkeySetting';
|
|
136
136
|
export { RateLimitsModuleModel } from './rateLimitsModule';
|
|
137
|
+
export { UsageSnapshotModel } from './usageSnapshot';
|
|
137
138
|
export { AppMembershipDefaultModel } from './appMembershipDefault';
|
|
138
139
|
export { OrgMembershipDefaultModel } from './orgMembershipDefault';
|
|
139
140
|
export { RlsSettingModel } from './rlsSetting';
|
|
@@ -134,6 +134,7 @@ export { UserConnectedAccountModel } from './userConnectedAccount';
|
|
|
134
134
|
export { CommitModel } from './commit';
|
|
135
135
|
export { PubkeySettingModel } from './pubkeySetting';
|
|
136
136
|
export { RateLimitsModuleModel } from './rateLimitsModule';
|
|
137
|
+
export { UsageSnapshotModel } from './usageSnapshot';
|
|
137
138
|
export { AppMembershipDefaultModel } from './appMembershipDefault';
|
|
138
139
|
export { OrgMembershipDefaultModel } from './orgMembershipDefault';
|
|
139
140
|
export { RlsSettingModel } from './rlsSetting';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UsageSnapshot 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 { UsageSnapshotWithRelations, UsageSnapshotSelect, UsageSnapshotFilter, UsageSnapshotOrderBy, CreateUsageSnapshotInput, UsageSnapshotPatch } from '../input-types';
|
|
10
|
+
export declare class UsageSnapshotModel {
|
|
11
|
+
private client;
|
|
12
|
+
constructor(client: OrmClient);
|
|
13
|
+
findMany<S extends UsageSnapshotSelect>(args: FindManyArgs<S, UsageSnapshotFilter, UsageSnapshotOrderBy> & {
|
|
14
|
+
select: S;
|
|
15
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
16
|
+
usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
|
|
17
|
+
}>;
|
|
18
|
+
findFirst<S extends UsageSnapshotSelect>(args: FindFirstArgs<S, UsageSnapshotFilter> & {
|
|
19
|
+
select: S;
|
|
20
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
21
|
+
usageSnapshots: {
|
|
22
|
+
nodes: InferSelectResult<UsageSnapshotWithRelations, S>[];
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
findOne<S extends UsageSnapshotSelect>(args: {
|
|
26
|
+
id: string;
|
|
27
|
+
select: S;
|
|
28
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
29
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
|
|
30
|
+
}>;
|
|
31
|
+
create<S extends UsageSnapshotSelect>(args: CreateArgs<S, CreateUsageSnapshotInput['usageSnapshot']> & {
|
|
32
|
+
select: S;
|
|
33
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
34
|
+
createUsageSnapshot: {
|
|
35
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
update<S extends UsageSnapshotSelect>(args: UpdateArgs<S, {
|
|
39
|
+
id: string;
|
|
40
|
+
}, UsageSnapshotPatch> & {
|
|
41
|
+
select: S;
|
|
42
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
43
|
+
updateUsageSnapshot: {
|
|
44
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
delete<S extends UsageSnapshotSelect>(args: DeleteArgs<{
|
|
48
|
+
id: string;
|
|
49
|
+
}, S> & {
|
|
50
|
+
select: S;
|
|
51
|
+
} & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
|
|
52
|
+
deleteUsageSnapshot: {
|
|
53
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
|
|
2
|
+
import { connectionFieldsMap } from '../input-types';
|
|
3
|
+
export class UsageSnapshotModel {
|
|
4
|
+
client;
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
findMany(args) {
|
|
9
|
+
const { document, variables } = buildFindManyDocument('UsageSnapshot', 'usageSnapshots', args.select, {
|
|
10
|
+
where: args?.where,
|
|
11
|
+
orderBy: args?.orderBy,
|
|
12
|
+
first: args?.first,
|
|
13
|
+
last: args?.last,
|
|
14
|
+
after: args?.after,
|
|
15
|
+
before: args?.before,
|
|
16
|
+
offset: args?.offset,
|
|
17
|
+
}, 'UsageSnapshotFilter', 'UsageSnapshotOrderBy', connectionFieldsMap);
|
|
18
|
+
return new QueryBuilder({
|
|
19
|
+
client: this.client,
|
|
20
|
+
operation: 'query',
|
|
21
|
+
operationName: 'UsageSnapshot',
|
|
22
|
+
fieldName: 'usageSnapshots',
|
|
23
|
+
document,
|
|
24
|
+
variables,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
findFirst(args) {
|
|
28
|
+
const { document, variables } = buildFindFirstDocument('UsageSnapshot', 'usageSnapshots', args.select, {
|
|
29
|
+
where: args?.where,
|
|
30
|
+
}, 'UsageSnapshotFilter', connectionFieldsMap);
|
|
31
|
+
return new QueryBuilder({
|
|
32
|
+
client: this.client,
|
|
33
|
+
operation: 'query',
|
|
34
|
+
operationName: 'UsageSnapshot',
|
|
35
|
+
fieldName: 'usageSnapshots',
|
|
36
|
+
document,
|
|
37
|
+
variables,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
findOne(args) {
|
|
41
|
+
const { document, variables } = buildFindManyDocument('UsageSnapshot', 'usageSnapshots', args.select, {
|
|
42
|
+
where: {
|
|
43
|
+
id: {
|
|
44
|
+
equalTo: args.id,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
first: 1,
|
|
48
|
+
}, 'UsageSnapshotFilter', 'UsageSnapshotOrderBy', connectionFieldsMap);
|
|
49
|
+
return new QueryBuilder({
|
|
50
|
+
client: this.client,
|
|
51
|
+
operation: 'query',
|
|
52
|
+
operationName: 'UsageSnapshot',
|
|
53
|
+
fieldName: 'usageSnapshot',
|
|
54
|
+
document,
|
|
55
|
+
variables,
|
|
56
|
+
transform: (data) => ({
|
|
57
|
+
usageSnapshot: data.usageSnapshots?.nodes?.[0] ?? null,
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
create(args) {
|
|
62
|
+
const { document, variables } = buildCreateDocument('UsageSnapshot', 'createUsageSnapshot', 'usageSnapshot', args.select, args.data, 'CreateUsageSnapshotInput', connectionFieldsMap);
|
|
63
|
+
return new QueryBuilder({
|
|
64
|
+
client: this.client,
|
|
65
|
+
operation: 'mutation',
|
|
66
|
+
operationName: 'UsageSnapshot',
|
|
67
|
+
fieldName: 'createUsageSnapshot',
|
|
68
|
+
document,
|
|
69
|
+
variables,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
update(args) {
|
|
73
|
+
const { document, variables } = buildUpdateByPkDocument('UsageSnapshot', 'updateUsageSnapshot', 'usageSnapshot', args.select, args.where.id, args.data, 'UpdateUsageSnapshotInput', 'id', 'usageSnapshotPatch', connectionFieldsMap);
|
|
74
|
+
return new QueryBuilder({
|
|
75
|
+
client: this.client,
|
|
76
|
+
operation: 'mutation',
|
|
77
|
+
operationName: 'UsageSnapshot',
|
|
78
|
+
fieldName: 'updateUsageSnapshot',
|
|
79
|
+
document,
|
|
80
|
+
variables,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
delete(args) {
|
|
84
|
+
const { document, variables } = buildDeleteByPkDocument('UsageSnapshot', 'deleteUsageSnapshot', 'usageSnapshot', {
|
|
85
|
+
id: args.where.id,
|
|
86
|
+
}, 'DeleteUsageSnapshotInput', args.select, connectionFieldsMap);
|
|
87
|
+
return new QueryBuilder({
|
|
88
|
+
client: this.client,
|
|
89
|
+
operation: 'mutation',
|
|
90
|
+
operationName: 'UsageSnapshot',
|
|
91
|
+
fieldName: 'deleteUsageSnapshot',
|
|
92
|
+
document,
|
|
93
|
+
variables,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-sdk/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive CLI SDK - Auto-generated GraphQL CLI with ORM client, context management, and interactive prompts",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@0no-co/graphql.web": "^1.1.2",
|
|
49
|
-
"@constructive-io/graphql-query": "^3.
|
|
50
|
-
"@constructive-io/graphql-types": "^3.
|
|
49
|
+
"@constructive-io/graphql-query": "^3.23.0",
|
|
50
|
+
"@constructive-io/graphql-types": "^3.9.0",
|
|
51
51
|
"appstash": "^0.7.0",
|
|
52
|
-
"gql-ast": "^3.
|
|
52
|
+
"gql-ast": "^3.9.0",
|
|
53
53
|
"graphql": "16.13.0",
|
|
54
54
|
"inquirerer": "^4.7.0",
|
|
55
55
|
"nested-obj": "^0.2.2",
|
|
56
56
|
"yanse": "^0.2.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@constructive-io/graphql-codegen": "^4.
|
|
59
|
+
"@constructive-io/graphql-codegen": "^4.40.0",
|
|
60
60
|
"@types/node": "^22.19.11",
|
|
61
61
|
"makage": "^0.3.0",
|
|
62
62
|
"tsx": "^4.19.0",
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "c665e2443ec98da61e9f372cf663cb9973afef4b"
|
|
66
66
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|