From 9f545bea1c6acabaedde14778dafdc056e07f6d1 Mon Sep 17 00:00:00 2001 From: kwasniew Date: Wed, 8 Mar 2023 11:11:50 +0100 Subject: [PATCH] feat: generated db types --- package.json | 2 + src/lib/db/db-extend-knex-types.ts | 98 ++ src/lib/db/db-type-generate-config.json | 4 + src/lib/db/db-types.ts | 1663 +++++++++++++++++++++++ yarn.lock | 90 +- 5 files changed, 1855 insertions(+), 2 deletions(-) create mode 100644 src/lib/db/db-extend-knex-types.ts create mode 100644 src/lib/db/db-type-generate-config.json create mode 100644 src/lib/db/db-types.ts diff --git a/package.json b/package.json index 4352448554..4d5ab180a1 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "start:dev": "NODE_ENV=development tsc-watch --onSuccess \"node dist/server-dev.js\"", "copy-templates": "copyfiles -u 1 src/mailtemplates/**/*.mustache dist/", "db-migrate": "db-migrate --migrations-dir ./src/migrations", + "db-generate-types": "pg-to-ts generate --config src/lib/db/db-type-generate-config.json", "lint": "eslint ./src", "local:package": "del-cli --force build && mkdir build && cp -r dist docs CHANGELOG.md LICENSE README.md package.json build", "prebuild:watch": "yarn run clean", @@ -180,6 +181,7 @@ "lint-staged": "13.1.2", "nock": "13.3.0", "openapi-enforcer": "1.22.2", + "pg-to-ts": "4.1.0", "prettier": "2.8.1", "proxyquire": "2.1.3", "source-map-support": "0.5.21", diff --git a/src/lib/db/db-extend-knex-types.ts b/src/lib/db/db-extend-knex-types.ts new file mode 100644 index 0000000000..c898f659ab --- /dev/null +++ b/src/lib/db/db-extend-knex-types.ts @@ -0,0 +1,98 @@ +import { + Addons, + ApiTokenProject, + ApiTokens, + ChangeRequestApprovals, + ChangeRequestComments, + ChangeRequestEvents, + ChangeRequestSettings, + ChangeRequests, + ClientApplications, + ClientInstances, + ClientMetricsEnv, + ContextFields, + Environments, + Events, + FavoriteFeatures, + FavoriteProjects, + FeatureEnvironments, + FeatureStrategies, + FeatureStrategySegment, + FeatureTag, + FeatureTypes, + Features, + GroupRole, + GroupUser, + Groups, + Permissions, + PersonalAccessTokens, + ProjectEnvironments, + ProjectStats, + Projects, + PublicSignupTokens, + PublicSignupTokensUser, + ResetTokens, + RolePermission, + RoleUser, + Roles, + Segments, + Settings, + Strategies, + TagTypes, + Tags, + UnleashSession, + UserFeedback, + UserSplash, + Users, +} from './db-types'; + +declare module 'knex/types/tables' { + interface Tables { + // This is same as specifying `knex('users')` + addons: Addons; + api_token_project: ApiTokenProject; + api_tokens: ApiTokens; + change_request_approvals: ChangeRequestApprovals; + change_request_comments: ChangeRequestComments; + change_request_events: ChangeRequestEvents; + change_request_settings: ChangeRequestSettings; + change_requests: ChangeRequests; + client_applications: ClientApplications; + client_instances: ClientInstances; + client_metrics_env: ClientMetricsEnv; + context_fields: ContextFields; + environments: Environments; + events: Events; + favorite_features: FavoriteFeatures; + favorite_projects: FavoriteProjects; + feature_environments: FeatureEnvironments; + feature_strategies: FeatureStrategies; + feature_strategy_segment: FeatureStrategySegment; + feature_tag: FeatureTag; + feature_types: FeatureTypes; + features: Features; + group_role: GroupRole; + group_user: GroupUser; + groups: Groups; + permissions: Permissions; + personal_access_tokens: PersonalAccessTokens; + project_environments: ProjectEnvironments; + project_stats: ProjectStats; + projects: Projects; + public_signup_tokens: PublicSignupTokens; + public_signup_tokens_user: PublicSignupTokensUser; + reset_tokens: ResetTokens; + role_permissions: RolePermission; + role_user: RoleUser; + roles: Roles; + segments: Segments; + settings: Settings; + strategies: Strategies; + tag_types: TagTypes; + tag: Tags; + unleash_session: UnleashSession; + user_feedback: UserFeedback; + user_splash: UserSplash; + users: Users; + } +} diff --git a/src/lib/db/db-type-generate-config.json b/src/lib/db/db-type-generate-config.json new file mode 100644 index 0000000000..f4f34a64b7 --- /dev/null +++ b/src/lib/db/db-type-generate-config.json @@ -0,0 +1,4 @@ +{ + "conn": "postgres://unleash_user:passord@localhost:5432/unleash", + "output": "./src/lib/db/db-types.ts" +} diff --git a/src/lib/db/db-types.ts b/src/lib/db/db-types.ts new file mode 100644 index 0000000000..b66baa9016 --- /dev/null +++ b/src/lib/db/db-types.ts @@ -0,0 +1,1663 @@ +/* tslint:disable */ +/* eslint-disable */ + + +/** + * AUTO-GENERATED FILE - DO NOT EDIT! + * + * This file was automatically generated by pg-to-ts v.4.1.0 + * $ pg-to-ts generate -c postgres://username:password@localhost:5432/unleash -t addons -t api_token_project -t api_tokens -t change_request_approvals -t change_request_comments -t change_request_events -t change_request_settings -t change_requests -t client_applications -t client_instances -t client_metrics_env -t context_fields -t environments -t events -t favorite_features -t favorite_projects -t feature_environments -t feature_strategies -t feature_strategy_segment -t feature_tag -t feature_types -t features -t features_view -t group_role -t group_user -t groups -t login_history -t migrations -t notifications -t permissions -t personal_access_tokens -t project_environments -t project_stats -t projects -t public_signup_tokens -t public_signup_tokens_user -t reset_tokens -t role_permission -t role_user -t roles -t segments -t settings -t strategies -t tag_types -t tags -t unleash_session -t user_feedback -t user_notifications -t user_splash -t users -s public + * + */ + + +export type Json = unknown; + +// Table addons +export interface Addons { + id: number; + provider: string; + description: string | null; + enabled: boolean | null; + parameters: Json | null; + events: Json | null; + created_at: Date | null; + projects: Json | null; + environments: Json | null; +} +export interface AddonsInput { + id?: number; + provider: string; + description?: string | null; + enabled?: boolean | null; + parameters?: Json | null; + events?: Json | null; + created_at?: Date | null; + projects?: Json | null; + environments?: Json | null; +} +const addons = { + tableName: 'addons', + columns: ['id', 'provider', 'description', 'enabled', 'parameters', 'events', 'created_at', 'projects', 'environments'], + requiredForInsert: ['provider'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Addons, + $input: null as unknown as AddonsInput +} as const; + +// Table api_token_project +export interface ApiTokenProject { + secret: string; + project: string; +} +export interface ApiTokenProjectInput { + secret: string; + project: string; +} +const api_token_project = { + tableName: 'api_token_project', + columns: ['secret', 'project'], + requiredForInsert: ['secret', 'project'], + primaryKey: null, + foreignKeys: { + secret: { table: 'api_tokens', column: 'secret', $type: null as unknown as ApiTokens }, + project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + }, + $type: null as unknown as ApiTokenProject, + $input: null as unknown as ApiTokenProjectInput +} as const; + +// Table api_tokens +export interface ApiTokens { + secret: string; + username: string; + type: string; + created_at: Date | null; + expires_at: Date | null; + seen_at: Date | null; + environment: string | null; + alias: string | null; +} +export interface ApiTokensInput { + secret: string; + username: string; + type: string; + created_at?: Date | null; + expires_at?: Date | null; + seen_at?: Date | null; + environment?: string | null; + alias?: string | null; +} +const api_tokens = { + tableName: 'api_tokens', + columns: ['secret', 'username', 'type', 'created_at', 'expires_at', 'seen_at', 'environment', 'alias'], + requiredForInsert: ['secret', 'username', 'type'], + primaryKey: 'secret', + foreignKeys: {}, + $type: null as unknown as ApiTokens, + $input: null as unknown as ApiTokensInput +} as const; + +// Table change_request_approvals +export interface ChangeRequestApprovals { + id: number; + change_request_id: number; + created_by: number; + created_at: Date | null; +} +export interface ChangeRequestApprovalsInput { + id?: number; + change_request_id: number; + created_by: number; + created_at?: Date | null; +} +const change_request_approvals = { + tableName: 'change_request_approvals', + columns: ['id', 'change_request_id', 'created_by', 'created_at'], + requiredForInsert: ['change_request_id', 'created_by'], + primaryKey: 'id', + foreignKeys: { + change_request_id: { table: 'change_requests', column: 'id', $type: null as unknown as ChangeRequests }, + created_by: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as ChangeRequestApprovals, + $input: null as unknown as ChangeRequestApprovalsInput +} as const; + +// Table change_request_comments +export interface ChangeRequestComments { + id: number; + change_request: number; + text: string; + created_at: Date | null; + created_by: number; +} +export interface ChangeRequestCommentsInput { + id?: number; + change_request: number; + text: string; + created_at?: Date | null; + created_by: number; +} +const change_request_comments = { + tableName: 'change_request_comments', + columns: ['id', 'change_request', 'text', 'created_at', 'created_by'], + requiredForInsert: ['change_request', 'text', 'created_by'], + primaryKey: 'id', + foreignKeys: { + change_request: { table: 'change_requests', column: 'id', $type: null as unknown as ChangeRequests }, + created_by: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as ChangeRequestComments, + $input: null as unknown as ChangeRequestCommentsInput +} as const; + +// Table change_request_events +export interface ChangeRequestEvents { + id: number; + feature: string; + action: string; + payload: Json; + created_by: number; + created_at: Date | null; + change_request_id: number; +} +export interface ChangeRequestEventsInput { + id?: number; + feature: string; + action: string; + payload?: Json; + created_by: number; + created_at?: Date | null; + change_request_id: number; +} +const change_request_events = { + tableName: 'change_request_events', + columns: ['id', 'feature', 'action', 'payload', 'created_by', 'created_at', 'change_request_id'], + requiredForInsert: ['feature', 'action', 'created_by', 'change_request_id'], + primaryKey: 'id', + foreignKeys: { + feature: { table: 'features', column: 'name', $type: null as unknown as Features }, + created_by: { table: 'users', column: 'id', $type: null as unknown as Users }, + change_request_id: { table: 'change_requests', column: 'id', $type: null as unknown as ChangeRequests }, + }, + $type: null as unknown as ChangeRequestEvents, + $input: null as unknown as ChangeRequestEventsInput +} as const; + +// Table change_request_settings +export interface ChangeRequestSettings { + project: string; + environment: string; + required_approvals: number | null; +} +export interface ChangeRequestSettingsInput { + project: string; + environment: string; + required_approvals?: number | null; +} +const change_request_settings = { + tableName: 'change_request_settings', + columns: ['project', 'environment', 'required_approvals'], + requiredForInsert: ['project', 'environment'], + primaryKey: 'project', + foreignKeys: { + project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + environment: { table: 'environments', column: 'name', $type: null as unknown as Environments }, + }, + $type: null as unknown as ChangeRequestSettings, + $input: null as unknown as ChangeRequestSettingsInput +} as const; + +// Table change_requests +export interface ChangeRequests { + id: number; + environment: string | null; + state: string; + project: string | null; + created_by: number; + created_at: Date | null; + min_approvals: number | null; +} +export interface ChangeRequestsInput { + id?: number; + environment?: string | null; + state: string; + project?: string | null; + created_by: number; + created_at?: Date | null; + min_approvals?: number | null; +} +const change_requests = { + tableName: 'change_requests', + columns: ['id', 'environment', 'state', 'project', 'created_by', 'created_at', 'min_approvals'], + requiredForInsert: ['state', 'created_by'], + primaryKey: 'id', + foreignKeys: { + environment: { table: 'environments', column: 'name', $type: null as unknown as Environments }, + project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + created_by: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as ChangeRequests, + $input: null as unknown as ChangeRequestsInput +} as const; + +// Table client_applications +export interface ClientApplications { + app_name: string; + created_at: Date | null; + updated_at: Date | null; + seen_at: Date | null; + strategies: Json | null; + description: string | null; + icon: string | null; + url: string | null; + color: string | null; + announced: boolean | null; + created_by: string | null; +} +export interface ClientApplicationsInput { + app_name: string; + created_at?: Date | null; + updated_at?: Date | null; + seen_at?: Date | null; + strategies?: Json | null; + description?: string | null; + icon?: string | null; + url?: string | null; + color?: string | null; + announced?: boolean | null; + created_by?: string | null; +} +const client_applications = { + tableName: 'client_applications', + columns: ['app_name', 'created_at', 'updated_at', 'seen_at', 'strategies', 'description', 'icon', 'url', 'color', 'announced', 'created_by'], + requiredForInsert: ['app_name'], + primaryKey: 'app_name', + foreignKeys: {}, + $type: null as unknown as ClientApplications, + $input: null as unknown as ClientApplicationsInput +} as const; + +// Table client_instances +export interface ClientInstances { + app_name: string; + instance_id: string; + client_ip: string | null; + last_seen: Date | null; + created_at: Date | null; + sdk_version: string | null; + environment: string; +} +export interface ClientInstancesInput { + app_name: string; + instance_id: string; + client_ip?: string | null; + last_seen?: Date | null; + created_at?: Date | null; + sdk_version?: string | null; + environment?: string; +} +const client_instances = { + tableName: 'client_instances', + columns: ['app_name', 'instance_id', 'client_ip', 'last_seen', 'created_at', 'sdk_version', 'environment'], + requiredForInsert: ['app_name', 'instance_id'], + primaryKey: 'app_name', + foreignKeys: {}, + $type: null as unknown as ClientInstances, + $input: null as unknown as ClientInstancesInput +} as const; + +// Table client_metrics_env +export interface ClientMetricsEnv { + feature_name: string; + app_name: string; + environment: string; + timestamp: Date; + yes: number | null; + no: number | null; +} +export interface ClientMetricsEnvInput { + feature_name: string; + app_name: string; + environment: string; + timestamp: Date; + yes?: number | null; + no?: number | null; +} +const client_metrics_env = { + tableName: 'client_metrics_env', + columns: ['feature_name', 'app_name', 'environment', 'timestamp', 'yes', 'no'], + requiredForInsert: ['feature_name', 'app_name', 'environment', 'timestamp'], + primaryKey: 'feature_name', + foreignKeys: {}, + $type: null as unknown as ClientMetricsEnv, + $input: null as unknown as ClientMetricsEnvInput +} as const; + +// Table context_fields +export interface ContextFields { + name: string; + description: string | null; + sort_order: number | null; + legal_values: Json | null; + created_at: Date | null; + updated_at: Date | null; + stickiness: boolean | null; +} +export interface ContextFieldsInput { + name: string; + description?: string | null; + sort_order?: number | null; + legal_values?: Json | null; + created_at?: Date | null; + updated_at?: Date | null; + stickiness?: boolean | null; +} +const context_fields = { + tableName: 'context_fields', + columns: ['name', 'description', 'sort_order', 'legal_values', 'created_at', 'updated_at', 'stickiness'], + requiredForInsert: ['name'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as ContextFields, + $input: null as unknown as ContextFieldsInput +} as const; + +// Table environments +export interface Environments { + name: string; + created_at: Date | null; + sort_order: number | null; + type: string; + enabled: boolean | null; + protected: boolean | null; +} +export interface EnvironmentsInput { + name: string; + created_at?: Date | null; + sort_order?: number | null; + type: string; + enabled?: boolean | null; + protected?: boolean | null; +} +const environments = { + tableName: 'environments', + columns: ['name', 'created_at', 'sort_order', 'type', 'enabled', 'protected'], + requiredForInsert: ['name', 'type'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as Environments, + $input: null as unknown as EnvironmentsInput +} as const; + +// Table events +export interface Events { + id: number; + created_at: Date | null; + type: string; + created_by: string; + data: Json | null; + tags: Json | null; + project: string | null; + environment: string | null; + feature_name: string | null; + pre_data: Json | null; +} +export interface EventsInput { + id?: number; + created_at?: Date | null; + type: string; + created_by: string; + data?: Json | null; + tags?: Json | null; + project?: string | null; + environment?: string | null; + feature_name?: string | null; + pre_data?: Json | null; +} +const events = { + tableName: 'events', + columns: ['id', 'created_at', 'type', 'created_by', 'data', 'tags', 'project', 'environment', 'feature_name', 'pre_data'], + requiredForInsert: ['type', 'created_by'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Events, + $input: null as unknown as EventsInput +} as const; + +// Table favorite_features +export interface FavoriteFeatures { + feature: string; + user_id: number; + created_at: Date; +} +export interface FavoriteFeaturesInput { + feature: string; + user_id: number; + created_at?: Date; +} +const favorite_features = { + tableName: 'favorite_features', + columns: ['feature', 'user_id', 'created_at'], + requiredForInsert: ['feature', 'user_id'], + primaryKey: 'feature', + foreignKeys: { + feature: { table: 'features', column: 'name', $type: null as unknown as Features }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as FavoriteFeatures, + $input: null as unknown as FavoriteFeaturesInput +} as const; + +// Table favorite_projects +export interface FavoriteProjects { + project: string; + user_id: number; + created_at: Date; +} +export interface FavoriteProjectsInput { + project: string; + user_id: number; + created_at?: Date; +} +const favorite_projects = { + tableName: 'favorite_projects', + columns: ['project', 'user_id', 'created_at'], + requiredForInsert: ['project', 'user_id'], + primaryKey: 'project', + foreignKeys: { + project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as FavoriteProjects, + $input: null as unknown as FavoriteProjectsInput +} as const; + +// Table feature_environments +export interface FeatureEnvironments { + environment: string; + feature_name: string; + enabled: boolean; + variants: Json; +} +export interface FeatureEnvironmentsInput { + environment?: string; + feature_name: string; + enabled: boolean; + variants?: Json; +} +const feature_environments = { + tableName: 'feature_environments', + columns: ['environment', 'feature_name', 'enabled', 'variants'], + requiredForInsert: ['feature_name', 'enabled'], + primaryKey: 'environment', + foreignKeys: { + environment: { table: 'environments', column: 'name', $type: null as unknown as Environments }, + feature_name: { table: 'features', column: 'name', $type: null as unknown as Features }, + }, + $type: null as unknown as FeatureEnvironments, + $input: null as unknown as FeatureEnvironmentsInput +} as const; + +// Table feature_strategies +export interface FeatureStrategies { + id: string; + feature_name: string; + project_name: string; + environment: string; + strategy_name: string; + parameters: Json; + constraints: Json | null; + sort_order: number; + created_at: Date | null; +} +export interface FeatureStrategiesInput { + id: string; + feature_name: string; + project_name: string; + environment?: string; + strategy_name: string; + parameters?: Json; + constraints?: Json | null; + sort_order?: number; + created_at?: Date | null; +} +const feature_strategies = { + tableName: 'feature_strategies', + columns: ['id', 'feature_name', 'project_name', 'environment', 'strategy_name', 'parameters', 'constraints', 'sort_order', 'created_at'], + requiredForInsert: ['id', 'feature_name', 'project_name', 'strategy_name'], + primaryKey: 'id', + foreignKeys: { + feature_name: { table: 'features', column: 'name', $type: null as unknown as Features }, + environment: { table: 'environments', column: 'name', $type: null as unknown as Environments }, + }, + $type: null as unknown as FeatureStrategies, + $input: null as unknown as FeatureStrategiesInput +} as const; + +// Table feature_strategy_segment +export interface FeatureStrategySegment { + feature_strategy_id: string; + segment_id: number; + created_at: Date; +} +export interface FeatureStrategySegmentInput { + feature_strategy_id: string; + segment_id: number; + created_at?: Date; +} +const feature_strategy_segment = { + tableName: 'feature_strategy_segment', + columns: ['feature_strategy_id', 'segment_id', 'created_at'], + requiredForInsert: ['feature_strategy_id', 'segment_id'], + primaryKey: 'feature_strategy_id', + foreignKeys: { + feature_strategy_id: { table: 'feature_strategies', column: 'id', $type: null as unknown as FeatureStrategies }, + segment_id: { table: 'segments', column: 'id', $type: null as unknown as Segments }, + }, + $type: null as unknown as FeatureStrategySegment, + $input: null as unknown as FeatureStrategySegmentInput +} as const; + +// Table feature_tag +export interface FeatureTag { + feature_name: string; + tag_type: string; + tag_value: string; + created_at: Date | null; +} +export interface FeatureTagInput { + feature_name: string; + tag_type: string; + tag_value: string; + created_at?: Date | null; +} +const feature_tag = { + tableName: 'feature_tag', + columns: ['feature_name', 'tag_type', 'tag_value', 'created_at'], + requiredForInsert: ['feature_name', 'tag_type', 'tag_value'], + primaryKey: 'feature_name', + foreignKeys: { feature_name: { table: 'features', column: 'name', $type: null as unknown as Features }, }, + $type: null as unknown as FeatureTag, + $input: null as unknown as FeatureTagInput +} as const; + +// Table feature_types +export interface FeatureTypes { + id: string; + name: string; + description: string | null; + lifetime_days: number | null; + created_at: Date | null; +} +export interface FeatureTypesInput { + id: string; + name: string; + description?: string | null; + lifetime_days?: number | null; + created_at?: Date | null; +} +const feature_types = { + tableName: 'feature_types', + columns: ['id', 'name', 'description', 'lifetime_days', 'created_at'], + requiredForInsert: ['id', 'name'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as FeatureTypes, + $input: null as unknown as FeatureTypesInput +} as const; + +// Table features +export interface Features { + created_at: Date | null; + name: string; + description: string | null; + archived: boolean | null; + variants: Json | null; + type: string | null; + stale: boolean | null; + project: string | null; + last_seen_at: Date | null; + impression_data: boolean | null; + archived_at: Date | null; +} +export interface FeaturesInput { + created_at?: Date | null; + name: string; + description?: string | null; + archived?: boolean | null; + variants?: Json | null; + type?: string | null; + stale?: boolean | null; + project?: string | null; + last_seen_at?: Date | null; + impression_data?: boolean | null; + archived_at?: Date | null; +} +const features = { + tableName: 'features', + columns: ['created_at', 'name', 'description', 'archived', 'variants', 'type', 'stale', 'project', 'last_seen_at', 'impression_data', 'archived_at'], + requiredForInsert: ['name'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as Features, + $input: null as unknown as FeaturesInput +} as const; + +// Table features_view +export interface FeaturesView { + name: string | null; + description: string | null; + type: string | null; + project: string | null; + stale: boolean | null; + variants: Json | null; + impression_data: boolean | null; + created_at: Date | null; + last_seen_at: Date | null; + archived_at: Date | null; + enabled: boolean | null; + environment: string | null; + environment_name: string | null; + environment_type: string | null; + environment_sort_order: number | null; + strategy_id: string | null; + strategy_name: string | null; + parameters: Json | null; + constraints: Json | null; + sort_order: number | null; + segments: number | null; +} +export interface FeaturesViewInput { + name?: string | null; + description?: string | null; + type?: string | null; + project?: string | null; + stale?: boolean | null; + variants?: Json | null; + impression_data?: boolean | null; + created_at?: Date | null; + last_seen_at?: Date | null; + archived_at?: Date | null; + enabled?: boolean | null; + environment?: string | null; + environment_name?: string | null; + environment_type?: string | null; + environment_sort_order?: number | null; + strategy_id?: string | null; + strategy_name?: string | null; + parameters?: Json | null; + constraints?: Json | null; + sort_order?: number | null; + segments?: number | null; +} +const features_view = { + tableName: 'features_view', + columns: ['name', 'description', 'type', 'project', 'stale', 'variants', 'impression_data', 'created_at', 'last_seen_at', 'archived_at', 'enabled', 'environment', 'environment_name', 'environment_type', 'environment_sort_order', 'strategy_id', 'strategy_name', 'parameters', 'constraints', 'sort_order', 'segments'], + requiredForInsert: [], + primaryKey: null, + foreignKeys: {}, + $type: null as unknown as FeaturesView, + $input: null as unknown as FeaturesViewInput +} as const; + +// Table group_role +export interface GroupRole { + group_id: number; + role_id: number; + created_by: string | null; + created_at: Date | null; + project: string; +} +export interface GroupRoleInput { + group_id: number; + role_id: number; + created_by?: string | null; + created_at?: Date | null; + project: string; +} +const group_role = { + tableName: 'group_role', + columns: ['group_id', 'role_id', 'created_by', 'created_at', 'project'], + requiredForInsert: ['group_id', 'role_id', 'project'], + primaryKey: 'group_id', + foreignKeys: { + group_id: { table: 'groups', column: 'id', $type: null as unknown as Groups }, + role_id: { table: 'roles', column: 'id', $type: null as unknown as Roles }, + project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + }, + $type: null as unknown as GroupRole, + $input: null as unknown as GroupRoleInput +} as const; + +// Table group_user +export interface GroupUser { + group_id: number; + user_id: number; + created_by: string | null; + created_at: Date; +} +export interface GroupUserInput { + group_id: number; + user_id: number; + created_by?: string | null; + created_at?: Date; +} +const group_user = { + tableName: 'group_user', + columns: ['group_id', 'user_id', 'created_by', 'created_at'], + requiredForInsert: ['group_id', 'user_id'], + primaryKey: 'group_id', + foreignKeys: { + group_id: { table: 'groups', column: 'id', $type: null as unknown as Groups }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as GroupUser, + $input: null as unknown as GroupUserInput +} as const; + +// Table groups +export interface Groups { + id: number; + name: string; + description: string | null; + created_by: string | null; + created_at: Date; + mappings_sso: Json | null; +} +export interface GroupsInput { + id?: number; + name: string; + description?: string | null; + created_by?: string | null; + created_at?: Date; + mappings_sso?: Json | null; +} +const groups = { + tableName: 'groups', + columns: ['id', 'name', 'description', 'created_by', 'created_at', 'mappings_sso'], + requiredForInsert: ['name'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Groups, + $input: null as unknown as GroupsInput +} as const; + +// Table login_history +export interface LoginHistory { + id: number; + username: string; + auth_type: string; + created_at: Date; + successful: boolean; + ip: string | null; + failure_reason: string | null; +} +export interface LoginHistoryInput { + id?: number; + username: string; + auth_type: string; + created_at?: Date; + successful: boolean; + ip?: string | null; + failure_reason?: string | null; +} +const login_history = { + tableName: 'login_history', + columns: ['id', 'username', 'auth_type', 'created_at', 'successful', 'ip', 'failure_reason'], + requiredForInsert: ['username', 'auth_type', 'successful'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as LoginHistory, + $input: null as unknown as LoginHistoryInput +} as const; + +// Table migrations +export interface Migrations { + id: number; + name: string; + run_on: Date; +} +export interface MigrationsInput { + id?: number; + name: string; + run_on: Date; +} +const migrations = { + tableName: 'migrations', + columns: ['id', 'name', 'run_on'], + requiredForInsert: ['name', 'run_on'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Migrations, + $input: null as unknown as MigrationsInput +} as const; + +// Table notifications +export interface Notifications { + id: number; + event_id: number; + created_at: Date; +} +export interface NotificationsInput { + id?: number; + event_id: number; + created_at?: Date; +} +const notifications = { + tableName: 'notifications', + columns: ['id', 'event_id', 'created_at'], + requiredForInsert: ['event_id'], + primaryKey: 'id', + foreignKeys: { event_id: { table: 'events', column: 'id', $type: null as unknown as Events }, }, + $type: null as unknown as Notifications, + $input: null as unknown as NotificationsInput +} as const; + +// Table permissions +export interface Permissions { + id: number; + permission: string; + display_name: string | null; + type: string | null; + created_at: Date | null; +} +export interface PermissionsInput { + id?: number; + permission: string; + display_name?: string | null; + type?: string | null; + created_at?: Date | null; +} +const permissions = { + tableName: 'permissions', + columns: ['id', 'permission', 'display_name', 'type', 'created_at'], + requiredForInsert: ['permission'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Permissions, + $input: null as unknown as PermissionsInput +} as const; + +// Table personal_access_tokens +export interface PersonalAccessTokens { + secret: string; + description: string | null; + user_id: number; + expires_at: Date; + seen_at: Date | null; + created_at: Date; + id: number; +} +export interface PersonalAccessTokensInput { + secret: string; + description?: string | null; + user_id: number; + expires_at: Date; + seen_at?: Date | null; + created_at?: Date; + id?: number; +} +const personal_access_tokens = { + tableName: 'personal_access_tokens', + columns: ['secret', 'description', 'user_id', 'expires_at', 'seen_at', 'created_at', 'id'], + requiredForInsert: ['secret', 'user_id', 'expires_at'], + primaryKey: 'id', + foreignKeys: { user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, }, + $type: null as unknown as PersonalAccessTokens, + $input: null as unknown as PersonalAccessTokensInput +} as const; + +// Table project_environments +export interface ProjectEnvironments { + project_id: string; + environment_name: string; +} +export interface ProjectEnvironmentsInput { + project_id: string; + environment_name: string; +} +const project_environments = { + tableName: 'project_environments', + columns: ['project_id', 'environment_name'], + requiredForInsert: ['project_id', 'environment_name'], + primaryKey: 'project_id', + foreignKeys: { + project_id: { table: 'projects', column: 'id', $type: null as unknown as Projects }, + environment_name: { table: 'environments', column: 'name', $type: null as unknown as Environments }, + }, + $type: null as unknown as ProjectEnvironments, + $input: null as unknown as ProjectEnvironmentsInput +} as const; + +// Table project_stats +export interface ProjectStats { + project: string; + avg_time_to_prod_current_window: number | null; + avg_time_to_prod_past_window: number | null; + project_changes_current_window: number | null; + project_changes_past_window: number | null; + features_created_current_window: number | null; + features_created_past_window: number | null; + features_archived_current_window: number | null; + features_archived_past_window: number | null; + project_members_added_current_window: number | null; +} +export interface ProjectStatsInput { + project: string; + avg_time_to_prod_current_window?: number | null; + avg_time_to_prod_past_window?: number | null; + project_changes_current_window?: number | null; + project_changes_past_window?: number | null; + features_created_current_window?: number | null; + features_created_past_window?: number | null; + features_archived_current_window?: number | null; + features_archived_past_window?: number | null; + project_members_added_current_window?: number | null; +} +const project_stats = { + tableName: 'project_stats', + columns: ['project', 'avg_time_to_prod_current_window', 'avg_time_to_prod_past_window', 'project_changes_current_window', 'project_changes_past_window', 'features_created_current_window', 'features_created_past_window', 'features_archived_current_window', 'features_archived_past_window', 'project_members_added_current_window'], + requiredForInsert: ['project'], + primaryKey: null, + foreignKeys: { project: { table: 'projects', column: 'id', $type: null as unknown as Projects }, }, + $type: null as unknown as ProjectStats, + $input: null as unknown as ProjectStatsInput +} as const; + +// Table projects +export interface Projects { + id: string; + name: string; + description: string | null; + created_at: Date | null; + health: number | null; + updated_at: Date | null; +} +export interface ProjectsInput { + id: string; + name: string; + description?: string | null; + created_at?: Date | null; + health?: number | null; + updated_at?: Date | null; +} +const projects = { + tableName: 'projects', + columns: ['id', 'name', 'description', 'created_at', 'health', 'updated_at'], + requiredForInsert: ['id', 'name'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Projects, + $input: null as unknown as ProjectsInput +} as const; + +// Table public_signup_tokens +export interface PublicSignupTokens { + secret: string; + name: string | null; + expires_at: Date; + created_at: Date; + created_by: string | null; + role_id: number; + url: string | null; + enabled: boolean | null; +} +export interface PublicSignupTokensInput { + secret: string; + name?: string | null; + expires_at: Date; + created_at?: Date; + created_by?: string | null; + role_id: number; + url?: string | null; + enabled?: boolean | null; +} +const public_signup_tokens = { + tableName: 'public_signup_tokens', + columns: ['secret', 'name', 'expires_at', 'created_at', 'created_by', 'role_id', 'url', 'enabled'], + requiredForInsert: ['secret', 'expires_at', 'role_id'], + primaryKey: 'secret', + foreignKeys: { role_id: { table: 'roles', column: 'id', $type: null as unknown as Roles }, }, + $type: null as unknown as PublicSignupTokens, + $input: null as unknown as PublicSignupTokensInput +} as const; + +// Table public_signup_tokens_user +export interface PublicSignupTokensUser { + secret: string; + user_id: number; + created_at: Date; +} +export interface PublicSignupTokensUserInput { + secret: string; + user_id: number; + created_at?: Date; +} +const public_signup_tokens_user = { + tableName: 'public_signup_tokens_user', + columns: ['secret', 'user_id', 'created_at'], + requiredForInsert: ['secret', 'user_id'], + primaryKey: 'secret', + foreignKeys: { + secret: { table: 'public_signup_tokens', column: 'secret', $type: null as unknown as PublicSignupTokens }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as PublicSignupTokensUser, + $input: null as unknown as PublicSignupTokensUserInput +} as const; + +// Table reset_tokens +export interface ResetTokens { + reset_token: string; + user_id: number | null; + expires_at: Date; + used_at: Date | null; + created_at: Date | null; + created_by: string | null; +} +export interface ResetTokensInput { + reset_token: string; + user_id?: number | null; + expires_at: Date; + used_at?: Date | null; + created_at?: Date | null; + created_by?: string | null; +} +const reset_tokens = { + tableName: 'reset_tokens', + columns: ['reset_token', 'user_id', 'expires_at', 'used_at', 'created_at', 'created_by'], + requiredForInsert: ['reset_token', 'expires_at'], + primaryKey: 'reset_token', + foreignKeys: { user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, }, + $type: null as unknown as ResetTokens, + $input: null as unknown as ResetTokensInput +} as const; + +// Table role_permission +export interface RolePermission { + role_id: number; + created_at: Date | null; + permission_id: number | null; + environment: string | null; +} +export interface RolePermissionInput { + role_id: number; + created_at?: Date | null; + permission_id?: number | null; + environment?: string | null; +} +const role_permission = { + tableName: 'role_permission', + columns: ['role_id', 'created_at', 'permission_id', 'environment'], + requiredForInsert: ['role_id'], + primaryKey: null, + foreignKeys: { role_id: { table: 'roles', column: 'id', $type: null as unknown as Roles }, }, + $type: null as unknown as RolePermission, + $input: null as unknown as RolePermissionInput +} as const; + +// Table role_user +export interface RoleUser { + role_id: number; + user_id: number; + created_at: Date | null; + project: string; +} +export interface RoleUserInput { + role_id: number; + user_id: number; + created_at?: Date | null; + project: string; +} +const role_user = { + tableName: 'role_user', + columns: ['role_id', 'user_id', 'created_at', 'project'], + requiredForInsert: ['role_id', 'user_id', 'project'], + primaryKey: 'role_id', + foreignKeys: { + role_id: { table: 'roles', column: 'id', $type: null as unknown as Roles }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as RoleUser, + $input: null as unknown as RoleUserInput +} as const; + +// Table roles +export interface Roles { + id: number; + name: string; + description: string | null; + type: string; + created_at: Date | null; + updated_at: Date | null; +} +export interface RolesInput { + id?: number; + name: string; + description?: string | null; + type?: string; + created_at?: Date | null; + updated_at?: Date | null; +} +const roles = { + tableName: 'roles', + columns: ['id', 'name', 'description', 'type', 'created_at', 'updated_at'], + requiredForInsert: ['name'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Roles, + $input: null as unknown as RolesInput +} as const; + +// Table segments +export interface Segments { + id: number; + name: string; + description: string | null; + created_by: string | null; + created_at: Date; + constraints: Json; +} +export interface SegmentsInput { + id?: number; + name: string; + description?: string | null; + created_by?: string | null; + created_at?: Date; + constraints?: Json; +} +const segments = { + tableName: 'segments', + columns: ['id', 'name', 'description', 'created_by', 'created_at', 'constraints'], + requiredForInsert: ['name'], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Segments, + $input: null as unknown as SegmentsInput +} as const; + +// Table settings +export interface Settings { + name: string; + content: Json | null; +} +export interface SettingsInput { + name: string; + content?: Json | null; +} +const settings = { + tableName: 'settings', + columns: ['name', 'content'], + requiredForInsert: ['name'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as Settings, + $input: null as unknown as SettingsInput +} as const; + +// Table strategies +export interface Strategies { + created_at: Date | null; + name: string; + description: string | null; + parameters: Json | null; + built_in: number | null; + deprecated: boolean | null; + sort_order: number | null; + display_name: string | null; +} +export interface StrategiesInput { + created_at?: Date | null; + name: string; + description?: string | null; + parameters?: Json | null; + built_in?: number | null; + deprecated?: boolean | null; + sort_order?: number | null; + display_name?: string | null; +} +const strategies = { + tableName: 'strategies', + columns: ['created_at', 'name', 'description', 'parameters', 'built_in', 'deprecated', 'sort_order', 'display_name'], + requiredForInsert: ['name'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as Strategies, + $input: null as unknown as StrategiesInput +} as const; + +// Table tag_types +export interface TagTypes { + name: string; + description: string | null; + icon: string | null; + created_at: Date | null; +} +export interface TagTypesInput { + name: string; + description?: string | null; + icon?: string | null; + created_at?: Date | null; +} +const tag_types = { + tableName: 'tag_types', + columns: ['name', 'description', 'icon', 'created_at'], + requiredForInsert: ['name'], + primaryKey: 'name', + foreignKeys: {}, + $type: null as unknown as TagTypes, + $input: null as unknown as TagTypesInput +} as const; + +// Table tags +export interface Tags { + type: string; + value: string; + created_at: Date | null; +} +export interface TagsInput { + type: string; + value: string; + created_at?: Date | null; +} +const tags = { + tableName: 'tags', + columns: ['type', 'value', 'created_at'], + requiredForInsert: ['type', 'value'], + primaryKey: 'type', + foreignKeys: { type: { table: 'tag_types', column: 'name', $type: null as unknown as TagTypes }, }, + $type: null as unknown as Tags, + $input: null as unknown as TagsInput +} as const; + +// Table unleash_session +export interface UnleashSession { + sid: string; + sess: Json; + created_at: Date | null; + expired: Date; +} +export interface UnleashSessionInput { + sid: string; + sess: Json; + created_at?: Date | null; + expired: Date; +} +const unleash_session = { + tableName: 'unleash_session', + columns: ['sid', 'sess', 'created_at', 'expired'], + requiredForInsert: ['sid', 'sess', 'expired'], + primaryKey: 'sid', + foreignKeys: {}, + $type: null as unknown as UnleashSession, + $input: null as unknown as UnleashSessionInput +} as const; + +// Table user_feedback +export interface UserFeedback { + user_id: number; + feedback_id: string; + given: Date | null; + nevershow: boolean; +} +export interface UserFeedbackInput { + user_id: number; + feedback_id: string; + given?: Date | null; + nevershow?: boolean; +} +const user_feedback = { + tableName: 'user_feedback', + columns: ['user_id', 'feedback_id', 'given', 'nevershow'], + requiredForInsert: ['user_id', 'feedback_id'], + primaryKey: 'user_id', + foreignKeys: { user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, }, + $type: null as unknown as UserFeedback, + $input: null as unknown as UserFeedbackInput +} as const; + +// Table user_notifications +export interface UserNotifications { + notification_id: number; + user_id: number; + read_at: Date | null; +} +export interface UserNotificationsInput { + notification_id: number; + user_id: number; + read_at?: Date | null; +} +const user_notifications = { + tableName: 'user_notifications', + columns: ['notification_id', 'user_id', 'read_at'], + requiredForInsert: ['notification_id', 'user_id'], + primaryKey: 'notification_id', + foreignKeys: { + notification_id: { table: 'notifications', column: 'id', $type: null as unknown as Notifications }, + user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, + }, + $type: null as unknown as UserNotifications, + $input: null as unknown as UserNotificationsInput +} as const; + +// Table user_splash +export interface UserSplash { + user_id: number; + splash_id: string; + seen: boolean; +} +export interface UserSplashInput { + user_id: number; + splash_id: string; + seen?: boolean; +} +const user_splash = { + tableName: 'user_splash', + columns: ['user_id', 'splash_id', 'seen'], + requiredForInsert: ['user_id', 'splash_id'], + primaryKey: 'user_id', + foreignKeys: { user_id: { table: 'users', column: 'id', $type: null as unknown as Users }, }, + $type: null as unknown as UserSplash, + $input: null as unknown as UserSplashInput +} as const; + +// Table users +export interface Users { + id: number; + name: string | null; + username: string | null; + email: string | null; + image_url: string | null; + password_hash: string | null; + login_attempts: number | null; + created_at: Date | null; + seen_at: Date | null; + settings: Json | null; + permissions: Json | null; + deleted_at: Date | null; + is_service: boolean | null; +} +export interface UsersInput { + id?: number; + name?: string | null; + username?: string | null; + email?: string | null; + image_url?: string | null; + password_hash?: string | null; + login_attempts?: number | null; + created_at?: Date | null; + seen_at?: Date | null; + settings?: Json | null; + permissions?: Json | null; + deleted_at?: Date | null; + is_service?: boolean | null; +} +const users = { + tableName: 'users', + columns: ['id', 'name', 'username', 'email', 'image_url', 'password_hash', 'login_attempts', 'created_at', 'seen_at', 'settings', 'permissions', 'deleted_at', 'is_service'], + requiredForInsert: [], + primaryKey: 'id', + foreignKeys: {}, + $type: null as unknown as Users, + $input: null as unknown as UsersInput +} as const; + + +export interface TableTypes { + addons: { + select: Addons; + input: AddonsInput; + }; + api_token_project: { + select: ApiTokenProject; + input: ApiTokenProjectInput; + }; + api_tokens: { + select: ApiTokens; + input: ApiTokensInput; + }; + change_request_approvals: { + select: ChangeRequestApprovals; + input: ChangeRequestApprovalsInput; + }; + change_request_comments: { + select: ChangeRequestComments; + input: ChangeRequestCommentsInput; + }; + change_request_events: { + select: ChangeRequestEvents; + input: ChangeRequestEventsInput; + }; + change_request_settings: { + select: ChangeRequestSettings; + input: ChangeRequestSettingsInput; + }; + change_requests: { + select: ChangeRequests; + input: ChangeRequestsInput; + }; + client_applications: { + select: ClientApplications; + input: ClientApplicationsInput; + }; + client_instances: { + select: ClientInstances; + input: ClientInstancesInput; + }; + client_metrics_env: { + select: ClientMetricsEnv; + input: ClientMetricsEnvInput; + }; + context_fields: { + select: ContextFields; + input: ContextFieldsInput; + }; + environments: { + select: Environments; + input: EnvironmentsInput; + }; + events: { + select: Events; + input: EventsInput; + }; + favorite_features: { + select: FavoriteFeatures; + input: FavoriteFeaturesInput; + }; + favorite_projects: { + select: FavoriteProjects; + input: FavoriteProjectsInput; + }; + feature_environments: { + select: FeatureEnvironments; + input: FeatureEnvironmentsInput; + }; + feature_strategies: { + select: FeatureStrategies; + input: FeatureStrategiesInput; + }; + feature_strategy_segment: { + select: FeatureStrategySegment; + input: FeatureStrategySegmentInput; + }; + feature_tag: { + select: FeatureTag; + input: FeatureTagInput; + }; + feature_types: { + select: FeatureTypes; + input: FeatureTypesInput; + }; + features: { + select: Features; + input: FeaturesInput; + }; + features_view: { + select: FeaturesView; + input: FeaturesViewInput; + }; + group_role: { + select: GroupRole; + input: GroupRoleInput; + }; + group_user: { + select: GroupUser; + input: GroupUserInput; + }; + groups: { + select: Groups; + input: GroupsInput; + }; + login_history: { + select: LoginHistory; + input: LoginHistoryInput; + }; + migrations: { + select: Migrations; + input: MigrationsInput; + }; + notifications: { + select: Notifications; + input: NotificationsInput; + }; + permissions: { + select: Permissions; + input: PermissionsInput; + }; + personal_access_tokens: { + select: PersonalAccessTokens; + input: PersonalAccessTokensInput; + }; + project_environments: { + select: ProjectEnvironments; + input: ProjectEnvironmentsInput; + }; + project_stats: { + select: ProjectStats; + input: ProjectStatsInput; + }; + projects: { + select: Projects; + input: ProjectsInput; + }; + public_signup_tokens: { + select: PublicSignupTokens; + input: PublicSignupTokensInput; + }; + public_signup_tokens_user: { + select: PublicSignupTokensUser; + input: PublicSignupTokensUserInput; + }; + reset_tokens: { + select: ResetTokens; + input: ResetTokensInput; + }; + role_permission: { + select: RolePermission; + input: RolePermissionInput; + }; + role_user: { + select: RoleUser; + input: RoleUserInput; + }; + roles: { + select: Roles; + input: RolesInput; + }; + segments: { + select: Segments; + input: SegmentsInput; + }; + settings: { + select: Settings; + input: SettingsInput; + }; + strategies: { + select: Strategies; + input: StrategiesInput; + }; + tag_types: { + select: TagTypes; + input: TagTypesInput; + }; + tags: { + select: Tags; + input: TagsInput; + }; + unleash_session: { + select: UnleashSession; + input: UnleashSessionInput; + }; + user_feedback: { + select: UserFeedback; + input: UserFeedbackInput; + }; + user_notifications: { + select: UserNotifications; + input: UserNotificationsInput; + }; + user_splash: { + select: UserSplash; + input: UserSplashInput; + }; + users: { + select: Users; + input: UsersInput; + }; +} + +export const tables = { + addons, + api_token_project, + api_tokens, + change_request_approvals, + change_request_comments, + change_request_events, + change_request_settings, + change_requests, + client_applications, + client_instances, + client_metrics_env, + context_fields, + environments, + events, + favorite_features, + favorite_projects, + feature_environments, + feature_strategies, + feature_strategy_segment, + feature_tag, + feature_types, + features, + features_view, + group_role, + group_user, + groups, + login_history, + migrations, + notifications, + permissions, + personal_access_tokens, + project_environments, + project_stats, + projects, + public_signup_tokens, + public_signup_tokens_user, + reset_tokens, + role_permission, + role_user, + roles, + segments, + settings, + strategies, + tag_types, + tags, + unleash_session, + user_feedback, + user_notifications, + user_splash, + users, +} diff --git a/yarn.lock b/yarn.lock index b6d7075d49..f5f9221ca1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1643,6 +1643,11 @@ asn1@^0.2.4, asn1@~0.2.3: dependencies: safer-buffer "~2.1.0" +assert-options@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/assert-options/-/assert-options-0.8.0.tgz#cf71882534d23d3027945bc7462e20d3d3682380" + integrity sha512-qSELrEaEz4sGwTs4Qh+swQkjiHAysC4rot21+jzXU86dJzNG+FDqBzyS3ohSoTRf4ZLA3FSwxQdiuNl5NXUtvA== + assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" @@ -2098,6 +2103,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^2.19.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" @@ -2113,6 +2123,11 @@ commander@^9.4.1: resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== +commandpost@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/commandpost/-/commandpost-1.4.0.tgz#89218012089dfc9b67a337ba162f15c88e0f1048" + integrity sha512-aE2Y4MTFJ870NuB/+2z1cXBhSBBzRydVVjzhFC4gtenEhpnj15yu0qptWGJsO9YGrcPZ3ezX8AWb1VA391MKpQ== + component-emitter@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -2567,6 +2582,16 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +editorconfig@^0.15.0: + version "0.15.3" + resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" + integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g== + dependencies: + commander "^2.19.0" + lru-cache "^4.1.5" + semver "^5.6.0" + sigmund "^1.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -4812,6 +4837,14 @@ log4js@^6.0.0: rfdc "^1.3.0" streamroller "^3.1.3" +lru-cache@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5566,16 +5599,41 @@ pg-int8@1.0.1: resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== +pg-minify@1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/pg-minify/-/pg-minify-1.6.2.tgz#055acfe862cfca3ca0a529020846b0f308d68e70" + integrity sha512-1KdmFGGTP6jplJoI8MfvRlfvMiyBivMRP7/ffh4a11RUFJ7kC2J0ZHlipoKiH/1hz+DVgceon9U2qbaHpPeyPg== + pg-pool@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.5.2.tgz#ed1bed1fb8d79f1c6fd5fb1c99e990fbf9ddf178" integrity sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w== +pg-promise@^10.11.1: + version "10.15.4" + resolved "https://registry.yarnpkg.com/pg-promise/-/pg-promise-10.15.4.tgz#b8b5055489f375a43e5d3edbff1d41ddb3817b2f" + integrity sha512-BKlHCMCdNUmF6gagVbehRWSEiVcZzPVltEx14OJExR9Iz9/1R6KETDWLLGv2l6yRqYFnEZZy1VDjRhArzeIGrw== + dependencies: + assert-options "0.8.0" + pg "8.8.0" + pg-minify "1.6.2" + spex "3.2.0" + pg-protocol@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.5.0.tgz#b5dd452257314565e2d54ab3c132adc46565a6a0" integrity sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ== +pg-to-ts@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pg-to-ts/-/pg-to-ts-4.1.0.tgz#54007aff65f920bb127e0e4c39fa530d97e9820f" + integrity sha512-MLetxJXYT7dwof8F52U2/Twd5hx7FHzoWqWTnBxENDcSb4flixWbA8vjU2/RaQ1E3rsVQVjx7FOIqukpnfJeAw== + dependencies: + lodash "^4.17.21" + pg-promise "^10.11.1" + typescript-formatter "^7.0.1" + yargs "^17.3.1" + pg-types@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" @@ -5587,7 +5645,7 @@ pg-types@^2.1.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -pg@^8.0.3, pg@^8.7.3: +pg@8.8.0, pg@^8.0.3, pg@^8.7.3: version "8.8.0" resolved "https://registry.yarnpkg.com/pg/-/pg-8.8.0.tgz#a77f41f9d9ede7009abfca54667c775a240da686" integrity sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw== @@ -5769,6 +5827,11 @@ ps-tree@^1.2.0: dependencies: event-stream "=3.3.4" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== + psl@^1.1.28: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -6113,7 +6176,7 @@ safe-regex-test@^1.0.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^5.0.3, semver@^5.3.0: +semver@^5.0.3, semver@^5.3.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -6219,6 +6282,11 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +sigmund@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + integrity sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g== + signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -6334,6 +6402,11 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" integrity sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA== +spex@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/spex/-/spex-3.2.0.tgz#fa4a21922407e112624977b445a6d634578a1127" + integrity sha512-9srjJM7NaymrpwMHvSmpDeIK5GoRMX/Tq0E8aOlDPS54dDnDUIp30DrP9SphMPEETDLzEM9+4qo+KipmbtPecg== + split2@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" @@ -6884,6 +6957,14 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typescript-formatter@^7.0.1: + version "7.2.2" + resolved "https://registry.yarnpkg.com/typescript-formatter/-/typescript-formatter-7.2.2.tgz#a147181839b7bb09c2377b072f20f6336547c00a" + integrity sha512-V7vfI9XArVhriOTYHPzMU2WUnm5IMdu9X/CPxs8mIMGxmTBFpDABlbkBka64PZJ9/xgQeRpK8KzzAG4MPzxBDQ== + dependencies: + commandpost "^1.0.0" + editorconfig "^0.15.0" + typescript@4.8.4: version "4.8.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" @@ -7155,6 +7236,11 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== + yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"