mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
[🔧 ESLint] import sort (#736)
This commit is contained in:
parent
d185e4f24e
commit
7ad5e26c34
355 changed files with 1776 additions and 1782 deletions
|
|
@ -1,6 +1,16 @@
|
|||
/* eslint-env node */
|
||||
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
|
||||
const { builtinModules } = require('module');
|
||||
const guildConfig = require('@theguild/eslint-config/base');
|
||||
|
||||
const rulesToExtends = Object.fromEntries(
|
||||
Object.entries(guildConfig.rules).filter(([key]) =>
|
||||
[
|
||||
'simple-import-sort/imports',
|
||||
'import/first',
|
||||
'no-restricted-globals',
|
||||
'@typescript-eslint/no-unused-vars',
|
||||
].includes(key),
|
||||
),
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
reportUnusedDisableDirectives: true,
|
||||
|
|
@ -22,17 +32,11 @@ module.exports = {
|
|||
project: ['./tsconfig.eslint.json'],
|
||||
},
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint', 'import', 'hive'],
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
plugins: [...guildConfig.plugins, 'hive'],
|
||||
extends: guildConfig.extends,
|
||||
rules: {
|
||||
'no-process-env': 'error',
|
||||
'no-restricted-globals': ['error', 'stop'],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
||||
],
|
||||
'no-empty': ['error', { allowEmptyCatch: true }],
|
||||
|
||||
'import/no-absolute-path': 'error',
|
||||
'import/no-self-import': 'error',
|
||||
'import/no-extraneous-dependencies': [
|
||||
|
|
@ -42,7 +46,6 @@ module.exports = {
|
|||
optionalDependencies: false,
|
||||
},
|
||||
],
|
||||
'import/first': 'error',
|
||||
'hive/enforce-deps-in-dev': [
|
||||
'error',
|
||||
{
|
||||
|
|
@ -51,6 +54,7 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
...rulesToExtends,
|
||||
|
||||
// 🚨 The following rules needs to be fixed and was temporarily disabled to avoid printing warning
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
|
|
@ -72,7 +76,6 @@ module.exports = {
|
|||
'plugin:jsx-a11y/recommended',
|
||||
'plugin:@next/next/recommended',
|
||||
],
|
||||
plugins: ['simple-import-sort'],
|
||||
settings: {
|
||||
tailwindcss: {
|
||||
config: 'packages/app/tailwind.config.js',
|
||||
|
|
@ -109,37 +112,6 @@ module.exports = {
|
|||
'jsx-a11y/alt-text': ['warn', { elements: ['img'], img: ['Image', 'NextImage'] }],
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'no-type-imports' }],
|
||||
'simple-import-sort/exports': 'error',
|
||||
'simple-import-sort/imports': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
[
|
||||
// Node.js builtins
|
||||
`^(node:)?(${builtinModules
|
||||
.filter(mod => !mod.startsWith('_') && !mod.includes('/'))
|
||||
.join('|')})(/.*|$)`,
|
||||
'^react(-dom)?$',
|
||||
'^next(/.*|$)',
|
||||
'^graphql(/.*|$)',
|
||||
// Side effect imports.
|
||||
'^\\u0000',
|
||||
// Packages.
|
||||
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
|
||||
'^@?\\w',
|
||||
],
|
||||
[
|
||||
// Absolute imports and other imports such as Vue-style `@/foo`.
|
||||
// Anything not matched in another group.
|
||||
'^',
|
||||
// Relative imports.
|
||||
// Anything that starts with a dot.
|
||||
'^\\.',
|
||||
// Style imports.
|
||||
'^.+\\.css$',
|
||||
],
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from './types';
|
||||
import { deployDbMigrations } from './services/db-migrations';
|
||||
import { deployTokens } from './services/tokens';
|
||||
import { deployWebhooks } from './services/webhooks';
|
||||
import { deployEmails } from './services/emails';
|
||||
import { deploySchema } from './services/schema';
|
||||
import { deployUsage } from './services/usage';
|
||||
import { deployUsageIngestor } from './services/usage-ingestor';
|
||||
import { deployGraphQL } from './services/graphql';
|
||||
import * as random from '@pulumi/random';
|
||||
import { deployApp } from './services/app';
|
||||
import { deployStripeBilling } from './services/billing';
|
||||
import { deployBotKube } from './services/bot-kube';
|
||||
import { deployCFBroker } from './services/cf-broker';
|
||||
import { deployCFCDN } from './services/cf-cdn';
|
||||
import { deployClickhouse } from './services/clickhouse';
|
||||
import { deployCloudFlareSecurityTransform } from './services/cloudflare-security';
|
||||
import { deployDbMigrations } from './services/db-migrations';
|
||||
import { deployDocs } from './services/docs';
|
||||
import { deployRedis } from './services/redis';
|
||||
import { deployEmails } from './services/emails';
|
||||
import { deployGraphQL } from './services/graphql';
|
||||
import { deployKafka } from './services/kafka';
|
||||
import { deployMetrics } from './services/observability';
|
||||
import { deployCFCDN } from './services/cf-cdn';
|
||||
import { deployCFBroker } from './services/cf-broker';
|
||||
import { deployCloudflarePolice } from './services/police';
|
||||
import { deployBotKube } from './services/bot-kube';
|
||||
import { deployProxy } from './services/proxy';
|
||||
import { deployClickhouse } from './services/clickhouse';
|
||||
import { deployUsageEstimation } from './services/usage-estimation';
|
||||
import { deploySuperTokens } from './services/supertokens';
|
||||
import { optimizeAzureCluster } from './utils/azure-helpers';
|
||||
import { deployRateLimit } from './services/rate-limit';
|
||||
import { deployStripeBilling } from './services/billing';
|
||||
import { deployCloudFlareSecurityTransform } from './services/cloudflare-security';
|
||||
import { deployRedis } from './services/redis';
|
||||
import { deploySchema } from './services/schema';
|
||||
import { deploySuperTokens } from './services/supertokens';
|
||||
import { deployTokens } from './services/tokens';
|
||||
import { deployUsage } from './services/usage';
|
||||
import { deployUsageEstimation } from './services/usage-estimation';
|
||||
import { deployUsageIngestor } from './services/usage-ingestor';
|
||||
import { deployWebhooks } from './services/webhooks';
|
||||
import { DeploymentEnvironment } from './types';
|
||||
import { optimizeAzureCluster } from './utils/azure-helpers';
|
||||
import { createDockerImageFactory } from './utils/docker-images';
|
||||
import * as random from '@pulumi/random';
|
||||
|
||||
optimizeAzureCluster();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { GraphQL } from './graphql';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { Docs } from './docs';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Docs } from './docs';
|
||||
import { GraphQL } from './graphql';
|
||||
|
||||
const appConfig = new pulumi.Config('app');
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { parse } from 'pg-connection-string';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { UsageEstimator } from './usage-estimation';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
|
||||
const billingConfig = new pulumi.Config('billing');
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { serviceLocalHost } from '../utils/local-endpoint';
|
||||
import { Clickhouse as ClickhouseDeployment } from '../utils/clickhouse';
|
||||
import { serviceLocalHost } from '../utils/local-endpoint';
|
||||
|
||||
const clickhouseConfig = new pulumi.Config('clickhouse');
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
|
||||
const cfConfig = new pulumi.Config('cloudflareCustom');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { parse } from 'pg-connection-string';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { Clickhouse } from './clickhouse';
|
||||
import { Kafka } from './kafka';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
const apiConfig = new pulumi.Config('api');
|
||||
|
||||
export type DbMigrations = ReturnType<typeof deployDbMigrations>;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
|
||||
export type Docs = ReturnType<typeof deployDocs>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { Redis } from './redis';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { Redis } from './redis';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { CDN } from './cf-cdn';
|
||||
import { Output } from '@pulumi/pulumi';
|
||||
import { parse } from 'pg-connection-string';
|
||||
import { Tokens } from './tokens';
|
||||
import { Webhooks } from './webhooks';
|
||||
import { Redis } from './redis';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Schema } from './schema';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { StripeBillingService } from './billing';
|
||||
import { CDN } from './cf-cdn';
|
||||
import { Clickhouse } from './clickhouse';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Emails } from './emails';
|
||||
import { RateLimitService } from './rate-limit';
|
||||
import { Redis } from './redis';
|
||||
import { Schema } from './schema';
|
||||
import { Tokens } from './tokens';
|
||||
import { Usage } from './usage';
|
||||
import { UsageEstimator } from './usage-estimation';
|
||||
import { RateLimitService } from './rate-limit';
|
||||
import { Emails } from './emails';
|
||||
import { StripeBillingService } from './billing';
|
||||
import { Output } from '@pulumi/pulumi';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { Webhooks } from './webhooks';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const cloudflareConfig = new pulumi.Config('cloudflare');
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { Proxy } from '../utils/reverse-proxy';
|
||||
import { CertManager } from '../utils/cert-manager';
|
||||
import { GraphQL } from './graphql';
|
||||
import { App } from './app';
|
||||
import { Usage } from './usage';
|
||||
import { Docs } from './docs';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { CertManager } from '../utils/cert-manager';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { Proxy } from '../utils/reverse-proxy';
|
||||
import { App } from './app';
|
||||
import { Docs } from './docs';
|
||||
import { GraphQL } from './graphql';
|
||||
import { Usage } from './usage';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { parse } from 'pg-connection-string';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { UsageEstimator } from './usage-estimation';
|
||||
import { Emails } from './emails';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Emails } from './emails';
|
||||
import { UsageEstimator } from './usage-estimation';
|
||||
|
||||
const rateLimitConfig = new pulumi.Config('rateLimit');
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { serviceLocalHost } from '../utils/local-endpoint';
|
||||
import { Redis as RedisStore } from '../utils/redis';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { serviceLocalHost } from '../utils/local-endpoint';
|
||||
import { Redis as RedisStore } from '../utils/redis';
|
||||
|
||||
const redisConfig = new pulumi.Config('redis');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { Redis } from './redis';
|
||||
import type { Broker } from './cf-broker';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import type { Broker } from './cf-broker';
|
||||
import { Redis } from './redis';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import * as kx from '@pulumi/kubernetesx';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { Output } from '@pulumi/pulumi';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
|
||||
export function deploySuperTokens(
|
||||
{ apiKey }: { apiKey: Output<string> },
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { parse } from 'pg-connection-string';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const apiConfig = new pulumi.Config('api');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { Clickhouse } from './clickhouse';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { Clickhouse } from './clickhouse';
|
||||
import { Kafka } from './kafka';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { Clickhouse } from './clickhouse';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Kafka } from './kafka';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { Tokens } from './tokens';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import { serviceLocalEndpoint } from '../utils/local-endpoint';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DbMigrations } from './db-migrations';
|
||||
import { Kafka } from './kafka';
|
||||
import { RateLimitService } from './rate-limit';
|
||||
import { isProduction } from '../utils/helpers';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { Tokens } from './tokens';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { Redis } from './redis';
|
||||
import type { Broker } from './cf-broker';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { DeploymentEnvironment } from '../types';
|
||||
import { ServiceDeployment } from '../utils/service-deployment';
|
||||
import type { Broker } from './cf-broker';
|
||||
import { Redis } from './redis';
|
||||
|
||||
const commonConfig = new pulumi.Config('common');
|
||||
const commonEnv = commonConfig.requireObject<Record<string, string>>('env');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { PodBuilder } from './pod-builder';
|
||||
import * as kx from '@pulumi/kubernetesx';
|
||||
import { getLocalComposeConfig } from './local-config';
|
||||
import { PodBuilder } from './pod-builder';
|
||||
|
||||
export class Clickhouse {
|
||||
constructor(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
|
||||
export class CloudflareCDN {
|
||||
constructor(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as k8s from '@pulumi/kubernetes';
|
||||
import { Output, interpolate } from '@pulumi/pulumi';
|
||||
import { interpolate, Output } from '@pulumi/pulumi';
|
||||
|
||||
export type ObservabilityConfig = {
|
||||
loki: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
|
||||
export function normalizeEnv(env: kx.types.Container['env']): any[] {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
|
||||
export class HivePolice {
|
||||
constructor(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as kx from '@pulumi/kubernetesx';
|
||||
import { normalizeEnv, PodBuilder } from './pod-builder';
|
||||
|
||||
const DEFAULT_IMAGE = 'bitnami/redis:6.2.6';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as k8s from '@pulumi/kubernetes';
|
||||
import * as kx from '@pulumi/kubernetesx';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
import { PodBuilder, normalizeEnv } from './pod-builder';
|
||||
import { isDefined } from './helpers';
|
||||
import { normalizeEnv, PodBuilder } from './pod-builder';
|
||||
|
||||
export class ServiceDeployment {
|
||||
constructor(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { createTRPCProxyClient, httpLink } from '@trpc/client';
|
||||
import type { InternalApi } from '@hive/server';
|
||||
import { createTRPCProxyClient, httpLink } from '@trpc/client';
|
||||
import { createFetch } from '@whatwg-node/fetch';
|
||||
import { z } from 'zod';
|
||||
import { ensureEnv } from './env';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { resolve } from 'path';
|
||||
import { getServiceHost } from './utils';
|
||||
import { execaCommand } from '@esm2cjs/execa';
|
||||
import { getServiceHost } from './utils';
|
||||
|
||||
const binPath = resolve(__dirname, '../../packages/libraries/cli/bin/dev');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,33 @@
|
|||
import { gql } from '@app/gql';
|
||||
import { fetch } from '@whatwg-node/fetch';
|
||||
|
||||
import type {
|
||||
AnswerOrganizationTransferRequestInput,
|
||||
CreateOrganizationInput,
|
||||
UpdateOrganizationNameInput,
|
||||
SchemaPublishInput,
|
||||
CreateProjectInput,
|
||||
UpdateProjectNameInput,
|
||||
CreateTargetInput,
|
||||
CreateTokenInput,
|
||||
DeleteTokensInput,
|
||||
OrganizationMemberAccessInput,
|
||||
SchemaCheckInput,
|
||||
PublishPersistedOperationInput,
|
||||
SetTargetValidationInput,
|
||||
UpdateTargetValidationSettingsInput,
|
||||
OperationsStatsSelectorInput,
|
||||
UpdateBaseSchemaInput,
|
||||
SchemaVersionsInput,
|
||||
CreateTargetInput,
|
||||
UpdateTargetNameInput,
|
||||
SchemaVersionUpdateInput,
|
||||
TargetSelectorInput,
|
||||
OrganizationSelectorInput,
|
||||
SchemaSyncCdnInput,
|
||||
RateLimitInput,
|
||||
InviteToOrganizationByEmailInput,
|
||||
EnableExternalSchemaCompositionInput,
|
||||
InviteToOrganizationByEmailInput,
|
||||
OperationsStatsSelectorInput,
|
||||
OrganizationMemberAccessInput,
|
||||
OrganizationSelectorInput,
|
||||
OrganizationTransferRequestSelector,
|
||||
PublishPersistedOperationInput,
|
||||
RateLimitInput,
|
||||
RequestOrganizationTransferInput,
|
||||
AnswerOrganizationTransferRequestInput,
|
||||
SchemaCheckInput,
|
||||
SchemaPublishInput,
|
||||
SchemaSyncCdnInput,
|
||||
SchemaVersionsInput,
|
||||
SchemaVersionUpdateInput,
|
||||
SetTargetValidationInput,
|
||||
TargetSelectorInput,
|
||||
UpdateBaseSchemaInput,
|
||||
UpdateOrganizationNameInput,
|
||||
UpdateProjectNameInput,
|
||||
UpdateTargetNameInput,
|
||||
UpdateTargetValidationSettingsInput,
|
||||
} from './gql/graphql';
|
||||
import { execute } from './graphql';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { ExecutionResult, print } from 'graphql';
|
||||
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
||||
import { createFetch } from '@whatwg-node/fetch';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { ExecutionResult, print } from 'graphql';
|
||||
import { getServiceHost } from './utils';
|
||||
|
||||
const { fetch } = createFetch({
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
S3Client,
|
||||
ListObjectsCommand,
|
||||
DeleteObjectsCommand,
|
||||
GetObjectCommand,
|
||||
ListObjectsCommand,
|
||||
S3Client,
|
||||
} from '@aws-sdk/client-s3';
|
||||
import { fetch } from '@whatwg-node/fetch';
|
||||
import { initSeed } from '../../testkit/seed';
|
||||
import { ProjectType, TargetAccessScope } from '../../testkit/gql/graphql';
|
||||
import { initSeed } from '../../testkit/seed';
|
||||
import { getServiceHost } from '../../testkit/utils';
|
||||
|
||||
const s3Client = new S3Client({
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { waitFor } from '../../../testkit/flow';
|
||||
import {
|
||||
TargetAccessScope,
|
||||
ProjectType,
|
||||
ProjectAccessScope,
|
||||
OrganizationAccessScope,
|
||||
ProjectAccessScope,
|
||||
ProjectType,
|
||||
TargetAccessScope,
|
||||
} from '@app/gql/graphql';
|
||||
import { waitFor } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent('freshly created organization has Get Started progress at 0%', async () => {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { initSeed } from '../../../testkit/seed';
|
||||
import {
|
||||
answerOrganizationTransferRequest,
|
||||
getOrganizationTransferRequest,
|
||||
requestOrganizationTransfer,
|
||||
answerOrganizationTransferRequest,
|
||||
} from '../../../testkit/flow';
|
||||
import {
|
||||
OrganizationAccessScope,
|
||||
ProjectAccessScope,
|
||||
TargetAccessScope,
|
||||
} from '../../../testkit/gql/graphql';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent(
|
||||
'accessing non-existing ownership transfer request should result in null',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ProjectType, ProjectAccessScope } from '@app/gql/graphql';
|
||||
import { ProjectAccessScope, ProjectType } from '@app/gql/graphql';
|
||||
import { publishPersistedOperations } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import {
|
||||
TargetAccessScope,
|
||||
ProjectType,
|
||||
ProjectAccessScope,
|
||||
OrganizationAccessScope,
|
||||
ProjectAccessScope,
|
||||
ProjectType,
|
||||
TargetAccessScope,
|
||||
} from '@app/gql/graphql';
|
||||
import { updateOrgRateLimit, waitFor } from '../../../testkit/flow';
|
||||
import * as emails from '../../../testkit/emails';
|
||||
import { updateOrgRateLimit, waitFor } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
function filterEmailsByOrg(orgName: string, emails: emails.Email[]) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { TargetAccessScope, ProjectType } from '@app/gql/graphql';
|
||||
import { ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent('can check a schema with target:registry:read access', async () => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ProjectAccessScope, ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { enableExternalSchemaComposition } from '../../../testkit/flow';
|
||||
import { TargetAccessScope, ProjectType, ProjectAccessScope } from '@app/gql/graphql';
|
||||
import { generateUnique } from '../../../testkit/utils';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
import { generateUnique } from '../../../testkit/utils';
|
||||
|
||||
// We do not resolve this to a host address, because we are calling this through a different flow:
|
||||
// GraphQL API -> Schema service -> Composition service
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { TargetAccessScope, ProjectType, ProjectAccessScope } from '@app/gql/graphql';
|
||||
import { enableExternalSchemaComposition } from '../../../testkit/flow';
|
||||
import { ProjectAccessScope, ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { history, serviceName, servicePort } from '../../../testkit/external-composition';
|
||||
import { generateUnique } from '../../../testkit/utils';
|
||||
import { enableExternalSchemaComposition } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
import { generateUnique } from '../../../testkit/utils';
|
||||
|
||||
test.concurrent('call an external service to compose and validate services', async () => {
|
||||
const { createOrg } = await initSeed().createOwner();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable no-process-env */
|
||||
import { TargetAccessScope, ProjectType } from '@app/gql/graphql';
|
||||
import { createTarget, publishSchema } from '../../../testkit/flow';
|
||||
import { ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { fetch } from '@whatwg-node/fetch';
|
||||
import { createTarget, publishSchema } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent('cannot publish a schema without target:registry:write access', async () => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { TargetAccessScope, ProjectType } from '@app/gql/graphql';
|
||||
import { ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { TargetAccessScope, ProjectType } from '@app/gql/graphql';
|
||||
import { ProjectType, TargetAccessScope } from '@app/gql/graphql';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
|
||||
test.concurrent(
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
import {
|
||||
TargetAccessScope,
|
||||
ProjectType,
|
||||
ProjectAccessScope,
|
||||
OrganizationAccessScope,
|
||||
ProjectAccessScope,
|
||||
ProjectType,
|
||||
TargetAccessScope,
|
||||
} from '@app/gql/graphql';
|
||||
import formatISO from 'date-fns/formatISO';
|
||||
import subHours from 'date-fns/subHours';
|
||||
import { createTarget, updateTargetValidationSettings, waitFor } from '../../../testkit/flow';
|
||||
import { CollectedOperation } from '../../../testkit/usage';
|
||||
import { clickHouseQuery } from '../../../testkit/clickhouse';
|
||||
// eslint-disable-next-line hive/enforce-deps-in-dev
|
||||
import { normalizeOperation } from '@graphql-hive/core';
|
||||
|
||||
import formatISO from 'date-fns/formatISO';
|
||||
import subHours from 'date-fns/subHours';
|
||||
import { parse, print } from 'graphql';
|
||||
import { clickHouseQuery } from '../../../testkit/clickhouse';
|
||||
import { createTarget, updateTargetValidationSettings, waitFor } from '../../../testkit/flow';
|
||||
import { initSeed } from '../../../testkit/seed';
|
||||
import { CollectedOperation } from '../../../testkit/usage';
|
||||
|
||||
function ensureNumber(value: number | string): number {
|
||||
if (typeof value === 'number') {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable no-process-env */
|
||||
import { createHash } from 'node:crypto';
|
||||
import { schemaPublish, schemaCheck } from '../../testkit/cli';
|
||||
import { initSeed } from '../../testkit/seed';
|
||||
import { schemaCheck, schemaPublish } from '../../testkit/cli';
|
||||
import { ProjectType } from '../../testkit/gql/graphql';
|
||||
import { initSeed } from '../../testkit/seed';
|
||||
|
||||
test.concurrent('can publish and check a schema with target:registry:read access', async () => {
|
||||
const { createOrg } = await initSeed().createOwner();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { resolve, dirname } from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
import { dirname, resolve } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { pathsToModuleNameMapper } from 'ts-jest';
|
||||
|
||||
|
|
|
|||
|
|
@ -65,11 +65,10 @@
|
|||
"@graphql-inspector/cli": "3.4.0",
|
||||
"@sentry/cli": "2.11.0",
|
||||
"@swc/core": "1.3.24",
|
||||
"@theguild/eslint-config": "0.4.0",
|
||||
"@theguild/prettier-config": "1.0.0",
|
||||
"@types/jest": "29.2.4",
|
||||
"@types/node": "18.11.18",
|
||||
"@typescript-eslint/eslint-plugin": "5.47.1",
|
||||
"@typescript-eslint/parser": "5.47.1",
|
||||
"babel-jest": "29.3.1",
|
||||
"babel-plugin-parameter-decorator": "1.0.16",
|
||||
"babel-plugin-transform-typescript-metadata": "0.3.2",
|
||||
|
|
@ -80,11 +79,6 @@
|
|||
"eslint": "8.30.0",
|
||||
"eslint-plugin-cypress": "2.12.1",
|
||||
"eslint-plugin-hive": "file:./rules",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "6.6.1",
|
||||
"eslint-plugin-react": "7.31.11",
|
||||
"eslint-plugin-react-hooks": "4.6.0",
|
||||
"eslint-plugin-simple-import-sort": "8.0.0",
|
||||
"eslint-plugin-tailwindcss": "3.7.1",
|
||||
"fs-extra": "11.1.0",
|
||||
"glob": "8.0.3",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Command, Config as OclifConfig, Errors } from '@oclif/core';
|
||||
import colors from 'colors';
|
||||
import { ClientError, GraphQLClient } from 'graphql-request';
|
||||
import symbols from 'log-symbols';
|
||||
import { GraphQLClient, ClientError } from 'graphql-request';
|
||||
import { Config } from './helpers/config';
|
||||
import { getSdk } from './sdk';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { Flags, Errors } from '@oclif/core';
|
||||
import { buildSchema, Source, GraphQLError } from 'graphql';
|
||||
import { validate, InvalidDocument } from '@graphql-inspector/core';
|
||||
import { InvalidDocument, validate } from '@graphql-inspector/core';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import { buildSchema, GraphQLError, Source } from 'graphql';
|
||||
import Command from '../../base-command';
|
||||
import { loadOperations } from '../../helpers/operations';
|
||||
import { graphqlEndpoint } from '../../helpers/config';
|
||||
import { loadOperations } from '../../helpers/operations';
|
||||
|
||||
export default class OperationsCheck extends Command {
|
||||
static description = 'checks operations against a published schema';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Flags, Errors } from '@oclif/core';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import Command from '../../base-command';
|
||||
import { loadOperations } from '../../helpers/operations';
|
||||
import { graphqlEndpoint } from '../../helpers/config';
|
||||
import { loadOperations } from '../../helpers/operations';
|
||||
|
||||
export default class OperationsPublish extends Command {
|
||||
static description = 'saves operations to the store';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { Flags, Errors } from '@oclif/core';
|
||||
import { loadSchema, renderChanges, renderErrors, minifySchema } from '../../helpers/schema';
|
||||
import { invariant } from '../../helpers/validation';
|
||||
import { gitInfo } from '../../helpers/git';
|
||||
import { graphqlEndpoint } from '../../helpers/config';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import Command from '../../base-command';
|
||||
import { graphqlEndpoint } from '../../helpers/config';
|
||||
import { gitInfo } from '../../helpers/git';
|
||||
import { loadSchema, minifySchema, renderChanges, renderErrors } from '../../helpers/schema';
|
||||
import { invariant } from '../../helpers/validation';
|
||||
|
||||
export default class SchemaCheck extends Command {
|
||||
static description = 'checks schema';
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { existsSync, readFileSync } from 'fs';
|
||||
import { transformCommentsToDescriptions } from '@graphql-tools/utils';
|
||||
import { Flags, Errors } from '@oclif/core';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import { GraphQLError, print } from 'graphql';
|
||||
import Command from '../../base-command';
|
||||
import { graphqlEndpoint } from '../../helpers/config';
|
||||
import { gitInfo } from '../../helpers/git';
|
||||
import { invariant } from '../../helpers/validation';
|
||||
import { loadSchema, minifySchema, renderChanges, renderErrors } from '../../helpers/schema';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { invariant } from '../../helpers/validation';
|
||||
|
||||
export default class SchemaPublish extends Command {
|
||||
static description = 'publishes schema';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import fs from 'fs';
|
||||
import mkdirp from 'mkdirp';
|
||||
import path from 'path';
|
||||
import mkdirp from 'mkdirp';
|
||||
|
||||
export const graphqlEndpoint = 'https://app.graphql-hive.com/graphql';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { gitToJs } from 'git-parse';
|
||||
import ci from 'env-ci';
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import ci from 'env-ci';
|
||||
import { gitToJs } from 'git-parse';
|
||||
|
||||
function splitPath(path: string) {
|
||||
const parts = path.split(/(\/|\\)/);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { normalizeOperation } from '@graphql-hive/core';
|
||||
import { promises as fs } from 'fs';
|
||||
import { relative } from 'path';
|
||||
import { parse } from 'graphql';
|
||||
import { loadDocuments } from '@graphql-tools/load';
|
||||
import { normalizeOperation } from '@graphql-hive/core';
|
||||
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
||||
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
||||
import { loadDocuments } from '@graphql-tools/load';
|
||||
import { parse } from 'graphql';
|
||||
|
||||
export async function loadOperations(
|
||||
file: string,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import colors from 'colors';
|
||||
import { print, concatAST } from 'graphql';
|
||||
import { loadTypedefs } from '@graphql-tools/load';
|
||||
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
||||
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
||||
import { JsonFileLoader } from '@graphql-tools/json-file-loader';
|
||||
import { loadTypedefs } from '@graphql-tools/load';
|
||||
import { UrlLoader } from '@graphql-tools/url-loader';
|
||||
import { CriticalityLevel, SchemaChangeConnection, SchemaErrorConnection } from '../sdk';
|
||||
import colors from 'colors';
|
||||
import { concatAST, print } from 'graphql';
|
||||
import baseCommand from '../base-command';
|
||||
import { CriticalityLevel, SchemaChangeConnection, SchemaErrorConnection } from '../sdk';
|
||||
|
||||
const indent = ' ';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { createHash } from 'crypto';
|
||||
import type { ApolloServerPlugin } from 'apollo-server-plugin-base';
|
||||
import axios from 'axios';
|
||||
import type { DocumentNode } from 'graphql';
|
||||
import { createHive } from './client.js';
|
||||
import type {
|
||||
HiveClient,
|
||||
HivePluginOptions,
|
||||
SupergraphSDLFetcherOptions,
|
||||
} from './internal/types.js';
|
||||
import { createHash } from 'crypto';
|
||||
import axios from 'axios';
|
||||
import { createHive } from './client.js';
|
||||
import { isHiveClient } from './internal/utils.js';
|
||||
import { version } from './version.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { GraphQLSchema, ExecutionArgs, ExecutionResult } from 'graphql';
|
||||
import axios from 'axios';
|
||||
import type { HivePluginOptions, HiveClient } from './internal/types.js';
|
||||
import { createUsage } from './internal/usage.js';
|
||||
import { createReporting } from './internal/reporting.js';
|
||||
import { ExecutionArgs, ExecutionResult, GraphQLSchema } from 'graphql';
|
||||
import { createOperationsStore } from './internal/operations-store.js';
|
||||
import { createReporting } from './internal/reporting.js';
|
||||
import type { HiveClient, HivePluginOptions } from './internal/types.js';
|
||||
import { createUsage } from './internal/usage.js';
|
||||
import { logIf } from './internal/utils.js';
|
||||
import { version } from './version.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { Plugin } from '@envelop/types';
|
||||
import type { HiveClient, HivePluginOptions } from './internal/types.js';
|
||||
import { createHive } from './client.js';
|
||||
import type { HiveClient, HivePluginOptions } from './internal/types.js';
|
||||
import { isHiveClient } from './internal/utils.js';
|
||||
|
||||
export function useHive(clientOrOptions: HiveClient): Plugin;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import axios from 'axios';
|
||||
import { createHash } from 'crypto';
|
||||
import axios from 'axios';
|
||||
import type { SchemaFetcherOptions, ServicesFetcherOptions } from './internal/types.js';
|
||||
import { version } from './version.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { DocumentNode } from 'graphql';
|
||||
import { stripIgnoredCharacters, parse } from 'graphql';
|
||||
import axios from 'axios';
|
||||
import type { DocumentNode } from 'graphql';
|
||||
import { parse, stripIgnoredCharacters } from 'graphql';
|
||||
import type { HivePluginOptions } from './types.js';
|
||||
|
||||
export interface OperationsStore {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { GraphQLSchema, stripIgnoredCharacters, print, Kind, ExecutionResult } from 'graphql';
|
||||
import { getDocumentNodeFromSchema } from '@graphql-tools/utils';
|
||||
import { createAgent } from './agent.js';
|
||||
import { version } from '../version.js';
|
||||
import type { HivePluginOptions } from './types.js';
|
||||
import { ExecutionResult, GraphQLSchema, Kind, print, stripIgnoredCharacters } from 'graphql';
|
||||
import type { SchemaPublishMutation } from '../__generated__/types.js';
|
||||
import { version } from '../version.js';
|
||||
import { createAgent } from './agent.js';
|
||||
import type { HivePluginOptions } from './types.js';
|
||||
import { logIf } from './utils.js';
|
||||
|
||||
export interface SchemaReporter {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ExecutionArgs } from 'graphql';
|
||||
import type { AgentOptions } from './agent.js';
|
||||
import type { SchemaReporter } from './reporting.js';
|
||||
import type { OperationsStore } from './operations-store.js';
|
||||
import type { SchemaReporter } from './reporting.js';
|
||||
|
||||
export interface HiveClient {
|
||||
info(): Promise<void>;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { normalizeOperation } from '@graphql-hive/core';
|
||||
import {
|
||||
ArgumentNode,
|
||||
DocumentNode,
|
||||
|
|
@ -24,24 +25,23 @@ import {
|
|||
visitWithTypeInfo,
|
||||
} from 'graphql';
|
||||
import LRU from 'tiny-lru';
|
||||
import { normalizeOperation } from '@graphql-hive/core';
|
||||
import { version } from '../version.js';
|
||||
import { createAgent } from './agent.js';
|
||||
import { randomSampling } from './sampling.js';
|
||||
import { version } from '../version.js';
|
||||
import type {
|
||||
ClientInfo,
|
||||
CollectUsageCallback,
|
||||
HivePluginOptions,
|
||||
HiveUsagePluginOptions,
|
||||
} from './types.js';
|
||||
import {
|
||||
cache,
|
||||
cacheDocumentKey,
|
||||
measureDuration,
|
||||
memo,
|
||||
isAsyncIterableIterator,
|
||||
logIf,
|
||||
measureDuration,
|
||||
memo,
|
||||
} from './utils.js';
|
||||
import type {
|
||||
HivePluginOptions,
|
||||
HiveUsagePluginOptions,
|
||||
CollectUsageCallback,
|
||||
ClientInfo,
|
||||
} from './types.js';
|
||||
|
||||
interface UsageCollector {
|
||||
collect(args: ExecutionArgs): CollectUsageCallback;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { createHash } from 'crypto';
|
||||
import type { HiveClient, HivePluginOptions, AsyncIterableIteratorOrValue } from './types.js';
|
||||
import type { AsyncIterableIteratorOrValue, HiveClient, HivePluginOptions } from './types.js';
|
||||
|
||||
export function isAsyncIterableIterator<T>(
|
||||
value: AsyncIterableIteratorOrValue<T>,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import nock from 'nock';
|
||||
import { createServicesFetcher, createSchemaFetcher } from '../src/gateways';
|
||||
import { createSchemaFetcher, createServicesFetcher } from '../src/gateways';
|
||||
|
||||
afterEach(() => {
|
||||
nock.cleanAll();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createHive } from '../src/client';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import nock from 'nock';
|
||||
import { createHive } from '../src/client';
|
||||
|
||||
test('should not leak the exception', async () => {
|
||||
const logger = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
||||
import { createSchema, createYoga } from 'graphql-yoga';
|
||||
import { createServer } from 'node:http';
|
||||
import { AddressInfo } from 'node:net';
|
||||
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
||||
import { ApolloServerBase } from 'apollo-server-core';
|
||||
import axios from 'axios';
|
||||
import { createServer } from 'node:http';
|
||||
import { AddressInfo } from 'node:net';
|
||||
import { createHive, useHive, hiveApollo } from '../src';
|
||||
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
||||
import { createSchema, createYoga } from 'graphql-yoga';
|
||||
import { createHive, hiveApollo, useHive } from '../src';
|
||||
import { waitFor } from './test-utils';
|
||||
|
||||
const typeDefs = /* GraphQL */ `
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { buildSubgraphSchema } from '@apollo/federation';
|
||||
import { buildSchema, parse } from 'graphql';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import nock from 'nock';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { buildSubgraphSchema } from '@apollo/federation';
|
||||
import { createHive } from '../src/client';
|
||||
import { version } from '../src/version';
|
||||
import { waitFor } from './test-utils';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { parse, buildSchema } from 'graphql';
|
||||
import { buildSchema, parse } from 'graphql';
|
||||
import { createCollector } from '../src/internal/usage';
|
||||
|
||||
const schema = buildSchema(/* GraphQL */ `
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { parse, buildSchema } from 'graphql';
|
||||
import { buildSchema, parse } from 'graphql';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import nock from 'nock';
|
||||
import { createHive } from '../src/client';
|
||||
import type { Report } from '../src/internal/usage';
|
||||
import { version } from '../src/version';
|
||||
import { waitFor } from './test-utils';
|
||||
import type { Report } from '../src/internal/usage';
|
||||
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import {
|
||||
visit,
|
||||
print,
|
||||
stripIgnoredCharacters,
|
||||
separateOperations,
|
||||
Kind,
|
||||
DocumentNode,
|
||||
DefinitionNode,
|
||||
OperationDefinitionNode,
|
||||
ArgumentNode,
|
||||
VariableDefinitionNode,
|
||||
SelectionNode,
|
||||
DefinitionNode,
|
||||
DirectiveNode,
|
||||
DocumentNode,
|
||||
Kind,
|
||||
OperationDefinitionNode,
|
||||
print,
|
||||
SelectionNode,
|
||||
separateOperations,
|
||||
stripIgnoredCharacters,
|
||||
VariableDefinitionNode,
|
||||
visit,
|
||||
} from 'graphql';
|
||||
import sortBy from 'lodash.sortby';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,59 +1,59 @@
|
|||
import type { S3Client } from '@aws-sdk/client-s3';
|
||||
import { createApplication, Scope } from 'graphql-modules';
|
||||
import { activityModule } from './modules/activity';
|
||||
import { adminModule } from './modules/admin';
|
||||
import { alertsModule } from './modules/alerts';
|
||||
import { WEBHOOKS_CONFIG, WebhooksConfig } from './modules/alerts/providers/tokens';
|
||||
import { authModule } from './modules/auth';
|
||||
import { labModule } from './modules/lab';
|
||||
import { operationsModule } from './modules/operations';
|
||||
import { ClickHouseConfig, CLICKHOUSE_CONFIG } from './modules/operations/providers/tokens';
|
||||
import { organizationModule } from './modules/organization';
|
||||
import { persistedOperationModule } from './modules/persisted-operations';
|
||||
import { projectModule } from './modules/project';
|
||||
import { schemaModule } from './modules/schema';
|
||||
import { sharedModule } from './modules/shared';
|
||||
import { HttpClient } from './modules/shared/providers/http-client';
|
||||
import { IdTranslator } from './modules/shared/providers/id-translator';
|
||||
import { IdempotentRunner } from './modules/shared/providers/idempotent-runner';
|
||||
import { Logger } from './modules/shared/providers/logger';
|
||||
import { CryptoProvider, encryptionSecretProvider } from './modules/shared/providers/crypto';
|
||||
import { RedisConfig, REDIS_CONFIG, RedisProvider } from './modules/shared/providers/redis';
|
||||
import { Storage } from './modules/shared/providers/storage';
|
||||
import { EMAILS_ENDPOINT, Emails } from './modules/shared/providers/emails';
|
||||
import { targetModule } from './modules/target';
|
||||
import { billingModule } from './modules/billing';
|
||||
import { BILLING_CONFIG, BillingConfig } from './modules/billing/providers/tokens';
|
||||
import { cdnModule } from './modules/cdn';
|
||||
import { CDN_CONFIG, CDNConfig } from './modules/cdn/providers/tokens';
|
||||
import { feedbackModule } from './modules/feedback';
|
||||
import { FEEDBACK_SLACK_CHANNEL, FEEDBACK_SLACK_TOKEN } from './modules/feedback/providers/tokens';
|
||||
import { integrationsModule } from './modules/integrations';
|
||||
import {
|
||||
GITHUB_APP_CONFIG,
|
||||
GitHubApplicationConfig,
|
||||
} from './modules/integrations/providers/github-integration-manager';
|
||||
import { alertsModule } from './modules/alerts';
|
||||
import { tokenModule } from './modules/token';
|
||||
import { feedbackModule } from './modules/feedback';
|
||||
import { TokensConfig, TOKENS_CONFIG } from './modules/token/providers/tokens';
|
||||
import { WebhooksConfig, WEBHOOKS_CONFIG } from './modules/alerts/providers/tokens';
|
||||
import {
|
||||
SchemaServiceConfig,
|
||||
SCHEMA_SERVICE_CONFIG,
|
||||
} from './modules/schema/providers/orchestrators/tokens';
|
||||
import { provideSchemaModuleConfig, SchemaModuleConfig } from './modules/schema/providers/config';
|
||||
import { CDN_CONFIG, CDNConfig } from './modules/cdn/providers/tokens';
|
||||
import { cdnModule } from './modules/cdn';
|
||||
import { adminModule } from './modules/admin';
|
||||
import { FEEDBACK_SLACK_CHANNEL, FEEDBACK_SLACK_TOKEN } from './modules/feedback/providers/tokens';
|
||||
import { usageEstimationModule } from './modules/usage-estimation';
|
||||
import {
|
||||
UsageEstimationServiceConfig,
|
||||
USAGE_ESTIMATION_SERVICE_CONFIG,
|
||||
} from './modules/usage-estimation/providers/tokens';
|
||||
import { labModule } from './modules/lab';
|
||||
import { oidcIntegrationsModule } from './modules/oidc-integrations';
|
||||
import { OIDC_INTEGRATIONS_ENABLED } from './modules/oidc-integrations/providers/tokens';
|
||||
import { operationsModule } from './modules/operations';
|
||||
import { CLICKHOUSE_CONFIG, ClickHouseConfig } from './modules/operations/providers/tokens';
|
||||
import { organizationModule } from './modules/organization';
|
||||
import { persistedOperationModule } from './modules/persisted-operations';
|
||||
import { projectModule } from './modules/project';
|
||||
import { rateLimitModule } from './modules/rate-limit';
|
||||
import {
|
||||
RateLimitServiceConfig,
|
||||
RATE_LIMIT_SERVICE_CONFIG,
|
||||
RateLimitServiceConfig,
|
||||
} from './modules/rate-limit/providers/tokens';
|
||||
import { BillingConfig, BILLING_CONFIG } from './modules/billing/providers/tokens';
|
||||
import { billingModule } from './modules/billing';
|
||||
import { OIDC_INTEGRATIONS_ENABLED } from './modules/oidc-integrations/providers/tokens';
|
||||
import { oidcIntegrationsModule } from './modules/oidc-integrations';
|
||||
import { schemaModule } from './modules/schema';
|
||||
import { ArtifactStorageWriter } from './modules/schema/providers/artifact-storage-writer';
|
||||
import { provideSchemaModuleConfig, SchemaModuleConfig } from './modules/schema/providers/config';
|
||||
import {
|
||||
SCHEMA_SERVICE_CONFIG,
|
||||
SchemaServiceConfig,
|
||||
} from './modules/schema/providers/orchestrators/tokens';
|
||||
import { sharedModule } from './modules/shared';
|
||||
import { CryptoProvider, encryptionSecretProvider } from './modules/shared/providers/crypto';
|
||||
import { Emails, EMAILS_ENDPOINT } from './modules/shared/providers/emails';
|
||||
import { HttpClient } from './modules/shared/providers/http-client';
|
||||
import { IdTranslator } from './modules/shared/providers/id-translator';
|
||||
import { IdempotentRunner } from './modules/shared/providers/idempotent-runner';
|
||||
import { Logger } from './modules/shared/providers/logger';
|
||||
import { REDIS_CONFIG, RedisConfig, RedisProvider } from './modules/shared/providers/redis';
|
||||
import { Storage } from './modules/shared/providers/storage';
|
||||
import { WEB_APP_URL } from './modules/shared/providers/tokens';
|
||||
import type { S3Client } from '@aws-sdk/client-s3';
|
||||
import { targetModule } from './modules/target';
|
||||
import { tokenModule } from './modules/token';
|
||||
import { TOKENS_CONFIG, TokensConfig } from './modules/token/providers/tokens';
|
||||
import { usageEstimationModule } from './modules/usage-estimation';
|
||||
import {
|
||||
USAGE_ESTIMATION_SERVICE_CONFIG,
|
||||
UsageEstimationServiceConfig,
|
||||
} from './modules/usage-estimation/providers/tokens';
|
||||
|
||||
const modules = [
|
||||
sharedModule,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { resolvers } from './resolvers';
|
||||
import { ActivityManager } from './providers/activity-manager';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
|
||||
export const activityModule = createModule({
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import { OrganizationAccessScope } from '../../auth/providers/organization-acces
|
|||
import { ProjectAccessScope } from '../../auth/providers/project-access';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import {
|
||||
Storage,
|
||||
OrganizationSelector,
|
||||
ProjectSelector,
|
||||
Storage,
|
||||
TargetSelector,
|
||||
} from '../../shared/providers/storage';
|
||||
import { Activity } from './activities';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { ActivityModule } from './__generated__/types';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { ActivityManager } from './providers/activity-manager';
|
||||
import { ActivityObject } from '../../shared/entities';
|
||||
import { createConnection } from '../../shared/schema';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { ActivityModule } from './__generated__/types';
|
||||
import { ActivityManager } from './providers/activity-manager';
|
||||
|
||||
export const resolvers: ActivityModule.Resolvers = {
|
||||
Query: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { resolvers } from './resolvers';
|
||||
import { AdminManager } from './providers/admin-manager';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
|
||||
export const adminModule = createModule({
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import { GraphQLError } from 'graphql';
|
||||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import { atomic } from '../../../shared/helpers';
|
||||
import { AuthManager } from '../../auth/providers/auth-manager';
|
||||
import { OperationsReader } from '../../operations/providers/operations-reader';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import { atomic } from '../../../shared/helpers';
|
||||
import { OperationsReader } from '../../operations/providers/operations-reader';
|
||||
|
||||
/**
|
||||
* Responsible for auth checks.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { AdminManager } from './providers/admin-manager';
|
||||
import { AdminModule } from './__generated__/types';
|
||||
import { AdminManager } from './providers/admin-manager';
|
||||
|
||||
export const resolvers: AdminModule.Resolvers = {
|
||||
Query: {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
import { AlertsManager } from './providers/alerts-manager';
|
||||
import { SlackCommunicationAdapter } from './providers/adapters/slack';
|
||||
import { WebhookCommunicationAdapter } from './providers/adapters/webhook';
|
||||
import { AlertsManager } from './providers/alerts-manager';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
|
||||
export const alertsModule = createModule({
|
||||
id: 'alerts',
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import {
|
|||
AlertChannel,
|
||||
Organization,
|
||||
Project,
|
||||
Target,
|
||||
SchemaVersion,
|
||||
Target,
|
||||
} from '../../../../shared/entities';
|
||||
|
||||
export interface SchemaChangeNotificationInput {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { MessageAttachment, WebClient } from '@slack/web-api';
|
||||
import { Inject, Injectable } from 'graphql-modules';
|
||||
import { WebClient, MessageAttachment } from '@slack/web-api';
|
||||
import {
|
||||
CommunicationAdapter,
|
||||
SchemaChangeNotificationInput,
|
||||
filterChangesByLevel,
|
||||
slackCoderize,
|
||||
ChannelConfirmationInput,
|
||||
} from './common';
|
||||
import type * as Types from '../../../../__generated__/types';
|
||||
import { Logger } from '../../../shared/providers/logger';
|
||||
import { WEB_APP_URL } from '../../../shared/providers/tokens';
|
||||
import {
|
||||
ChannelConfirmationInput,
|
||||
CommunicationAdapter,
|
||||
filterChangesByLevel,
|
||||
SchemaChangeNotificationInput,
|
||||
slackCoderize,
|
||||
} from './common';
|
||||
|
||||
@Injectable()
|
||||
export class SlackCommunicationAdapter implements CommunicationAdapter {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { Injectable, Inject, Scope, CONTEXT } from 'graphql-modules';
|
||||
import type { WebhooksApi } from '@hive/webhooks';
|
||||
import { createTRPCProxyClient, httpLink } from '@trpc/client';
|
||||
import { fetch } from '@whatwg-node/fetch';
|
||||
import type { CommunicationAdapter, SchemaChangeNotificationInput } from './common';
|
||||
import { Logger } from '../../../shared/providers/logger';
|
||||
import { CONTEXT, Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { HttpClient } from '../../../shared/providers/http-client';
|
||||
import { WEBHOOKS_CONFIG } from '../tokens';
|
||||
import { Logger } from '../../../shared/providers/logger';
|
||||
import type { WebhooksConfig } from '../tokens';
|
||||
import { WEBHOOKS_CONFIG } from '../tokens';
|
||||
import type { CommunicationAdapter, SchemaChangeNotificationInput } from './common';
|
||||
|
||||
@Injectable({
|
||||
scope: Scope.Operation,
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import type { AlertsModule } from '../__generated__/types';
|
||||
import type { AlertChannel, Alert } from '../../../shared/entities';
|
||||
import type { Alert, AlertChannel } from '../../../shared/entities';
|
||||
import { cache } from '../../../shared/helpers';
|
||||
import { AuthManager } from '../../auth/providers/auth-manager';
|
||||
import { ProjectAccessScope } from '../../auth/providers/project-access';
|
||||
import { TargetAccessScope } from '../../auth/providers/target-access';
|
||||
import { IntegrationsAccessContext } from '../../integrations/providers/integrations-access-context';
|
||||
import { SlackIntegrationManager } from '../../integrations/providers/slack-integration-manager';
|
||||
import { OrganizationManager } from '../../organization/providers/organization-manager';
|
||||
import { ProjectManager } from '../../project/providers/project-manager';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import type { ProjectSelector } from '../../shared/providers/storage';
|
||||
import { SlackIntegrationManager } from '../../integrations/providers/slack-integration-manager';
|
||||
import { IntegrationsAccessContext } from '../../integrations/providers/integrations-access-context';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import type { AlertsModule } from '../__generated__/types';
|
||||
import { SchemaChangeNotificationInput } from './adapters/common';
|
||||
import { SlackCommunicationAdapter } from './adapters/slack';
|
||||
import { WebhookCommunicationAdapter } from './adapters/webhook';
|
||||
import { ProjectAccessScope } from '../../auth/providers/project-access';
|
||||
import { TargetAccessScope } from '../../auth/providers/target-access';
|
||||
|
||||
@Injectable({
|
||||
scope: Scope.Operation,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { AlertsModule } from './__generated__/types';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { AlertsManager } from './providers/alerts-manager';
|
||||
import { TargetManager } from '../target/providers/target-manager';
|
||||
import { z } from 'zod';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { TargetManager } from '../target/providers/target-manager';
|
||||
import type { AlertsModule } from './__generated__/types';
|
||||
import { AlertsManager } from './providers/alerts-manager';
|
||||
|
||||
const AlertChannelNameModel = z.string().min(1).max(100);
|
||||
const SlackChannelNameModel = z.string().min(1).max(80);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { resolvers } from './resolvers';
|
||||
import { AuthManager } from './providers/auth-manager';
|
||||
import { ApiTokenProvider } from './providers/tokens';
|
||||
import { OrganizationAccess } from './providers/organization-access';
|
||||
import { ProjectAccess } from './providers/project-access';
|
||||
import { TargetAccess } from './providers/target-access';
|
||||
import { ApiTokenProvider } from './providers/tokens';
|
||||
import { UserManager } from './providers/user-manager';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
|
||||
export const authModule = createModule({
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { Injectable, Inject, Scope, CONTEXT } from 'graphql-modules';
|
||||
import { CONTEXT, Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import type { User } from '../../../shared/entities';
|
||||
import type { Listify, MapToArray } from '../../../shared/helpers';
|
||||
import { AccessError } from '../../../shared/errors';
|
||||
import type { Listify, MapToArray } from '../../../shared/helpers';
|
||||
import { share } from '../../../shared/helpers';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import { TokenStorage } from '../../token/providers/token-storage';
|
||||
import { ApiToken } from './tokens';
|
||||
import {
|
||||
OrganizationAccess,
|
||||
OrganizationAccessScope,
|
||||
|
|
@ -13,6 +12,7 @@ import {
|
|||
} from './organization-access';
|
||||
import { ProjectAccess, ProjectAccessScope, ProjectUserScopesSelector } from './project-access';
|
||||
import { TargetAccess, TargetAccessScope, TargetUserScopesSelector } from './target-access';
|
||||
import { ApiToken } from './tokens';
|
||||
import { UserManager } from './user-manager';
|
||||
|
||||
export interface OrganizationAccessSelector {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
import { Injectable, Scope, Inject, forwardRef } from 'graphql-modules';
|
||||
import Dataloader from 'dataloader';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import DataLoader from 'dataloader';
|
||||
import { forwardRef, Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { Token } from '../../../shared/entities';
|
||||
import { AccessError } from '../../../shared/errors';
|
||||
import DataLoader from 'dataloader';
|
||||
import { TokenStorage, TokenSelector } from '../../token/providers/token-storage';
|
||||
import { OrganizationAccessScope } from './scopes';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import { TokenSelector, TokenStorage } from '../../token/providers/token-storage';
|
||||
import type { ProjectAccessScope } from './project-access';
|
||||
import { OrganizationAccessScope } from './scopes';
|
||||
import type { TargetAccessScope } from './target-access';
|
||||
|
||||
export { OrganizationAccessScope } from './scopes';
|
||||
|
||||
export interface OrganizationOwnershipSelector {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import Dataloader from 'dataloader';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import { AccessError } from '../../../shared/errors';
|
||||
import { ProjectAccessScope } from './scopes';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { OrganizationAccess } from './organization-access';
|
||||
import { ProjectAccessScope } from './scopes';
|
||||
|
||||
export { ProjectAccessScope } from './scopes';
|
||||
|
||||
export interface ProjectUserAccessSelector {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import Dataloader from 'dataloader';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Injectable, Scope } from 'graphql-modules';
|
||||
import { AccessError } from '../../../shared/errors';
|
||||
import { TargetAccessScope } from './scopes';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { OrganizationAccess } from './organization-access';
|
||||
import { TargetAccessScope } from './scopes';
|
||||
|
||||
export { TargetAccessScope } from './scopes';
|
||||
|
||||
export interface TargetUserAccessSelector {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { InjectionToken, FactoryProvider, Scope, CONTEXT } from 'graphql-modules';
|
||||
import { CONTEXT, FactoryProvider, InjectionToken, Scope } from 'graphql-modules';
|
||||
|
||||
export const ApiToken = new InjectionToken<string>('x-api-token');
|
||||
export const ApiTokenProvider: FactoryProvider<string | undefined> = {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { z } from 'zod';
|
||||
import { createConnection } from '../../shared/schema';
|
||||
import { AuthModule } from './__generated__/types';
|
||||
import { AuthManager } from './providers/auth-manager';
|
||||
import { createConnection } from '../../shared/schema';
|
||||
import { OrganizationAccessScope } from './providers/organization-access';
|
||||
import { ProjectAccessScope } from './providers/project-access';
|
||||
import { TargetAccessScope } from './providers/target-access';
|
||||
import { z } from 'zod';
|
||||
import { displayNameLengthBoundaries, fullNameLengthBoundaries } from './providers/user-manager';
|
||||
|
||||
export const resolvers: AuthModule.Resolvers & {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { BillingProvider } from './providers/billing.provider';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
import { BillingProvider } from './providers/billing.provider';
|
||||
|
||||
export const billingModule = createModule({
|
||||
id: 'billing',
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { BILLING_CONFIG } from './tokens';
|
||||
import type { BillingConfig } from './tokens';
|
||||
import type { StripeBillingApi, StripeBillingApiInput } from '@hive/stripe-billing';
|
||||
import { createTRPCProxyClient, httpLink } from '@trpc/client';
|
||||
import { fetch } from '@whatwg-node/fetch';
|
||||
import { Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { OrganizationSelector } from '../../../__generated__/types';
|
||||
import { OrganizationBilling } from '../../../shared/entities';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import type { BillingConfig } from './tokens';
|
||||
import { BILLING_CONFIG } from './tokens';
|
||||
|
||||
@Injectable({
|
||||
global: true,
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import { AuthManager } from '../auth/providers/auth-manager';
|
|||
import { OrganizationAccessScope } from '../auth/providers/organization-access';
|
||||
import { OrganizationManager } from '../organization/providers/organization-manager';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { BillingProvider } from './providers/billing.provider';
|
||||
import { BillingModule } from './__generated__/types';
|
||||
import { BillingProvider } from './providers/billing.provider';
|
||||
|
||||
const USAGE_DEFAULT_LIMITATIONS: Record<
|
||||
'HOBBY' | 'PRO' | 'ENTERPRISE',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { CdnProvider } from './providers/cdn.provider';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
import { CdnProvider } from './providers/cdn.provider';
|
||||
|
||||
export const cdnModule = createModule({
|
||||
id: 'cdn',
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { Injectable, Inject, Scope } from 'graphql-modules';
|
||||
import { createHmac } from 'crypto';
|
||||
import type { Span } from '@sentry/types';
|
||||
import { Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { HiveError } from '../../../shared/errors';
|
||||
import { sentry } from '../../../shared/sentry';
|
||||
import { HttpClient } from '../../shared/providers/http-client';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { sentry } from '../../../shared/sentry';
|
||||
import { CDN_CONFIG } from './tokens';
|
||||
import type { CDNConfig } from './tokens';
|
||||
import { CDN_CONFIG } from './tokens';
|
||||
|
||||
type CdnResourceType = 'schema' | 'supergraph' | 'metadata';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { CdnModule } from './__generated__/types';
|
||||
import { CdnProvider } from './providers/cdn.provider';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { HiveError } from '../../shared/errors';
|
||||
import { AuthManager } from '../auth/providers/auth-manager';
|
||||
import { TargetAccessScope } from '../auth/providers/target-access';
|
||||
import { HiveError } from '../../shared/errors';
|
||||
import { IdTranslator } from '../shared/providers/id-translator';
|
||||
import { CdnModule } from './__generated__/types';
|
||||
import { CdnProvider } from './providers/cdn.provider';
|
||||
|
||||
export const resolvers: CdnModule.Resolvers = {
|
||||
Mutation: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import typeDefs from './module.graphql';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
|
||||
export const feedbackModule = createModule({
|
||||
id: 'feedback',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { FeedbackModule } from './__generated__/types';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import { WebClient } from '@slack/web-api';
|
||||
import { AuthManager } from '../auth/providers/auth-manager';
|
||||
import type { FeedbackModule } from './__generated__/types';
|
||||
import { FEEDBACK_SLACK_CHANNEL, FEEDBACK_SLACK_TOKEN } from './providers/tokens';
|
||||
|
||||
export const resolvers: FeedbackModule.Resolvers = {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { createModule } from 'graphql-modules';
|
||||
import { GitHubIntegrationManager } from './providers/github-integration-manager';
|
||||
import { SlackIntegrationManager } from './providers/slack-integration-manager';
|
||||
import { resolvers } from './resolvers';
|
||||
import typeDefs from './module.graphql';
|
||||
import { SlackIntegrationManager } from './providers/slack-integration-manager';
|
||||
import { GitHubIntegrationManager } from './providers/github-integration-manager';
|
||||
|
||||
export const integrationsModule = createModule({
|
||||
id: 'integrations',
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue