Skip to content

Commit

Permalink
Merge branch 'cm/fix-browser-plugin-indicators' of github.com:hashint…
Browse files Browse the repository at this point in the history
…el/hash into cm/fix-browser-plugin-indicators
  • Loading branch information
CiaranMn committed Mar 14, 2024
2 parents a16e59e + 67eee0b commit 67e8767
Show file tree
Hide file tree
Showing 1,446 changed files with 4,752 additions and 4,652 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-docker-images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ runs:
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0

- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hash-backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ jobs:
if: ${{ failure() }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@68c1f353baff8aeb637650eb6b01d9c8c95f383a
uses: rtCamp/action-slack-notify@df21811e2c616364d99fc0211db875993489a4ea
env:
SLACK_LINK_NAMES: true
SLACK_MESSAGE: "Error deploying the HASH backend <@U0143NL4GMP> <@U027NPY8Y3X> <@U02NLJY0FGX>"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@68c1f353baff8aeb637650eb6b01d9c8c95f383a
uses: rtCamp/action-slack-notify@df21811e2c616364d99fc0211db875993489a4ea
if: ${{ failure() }}
env:
SLACK_LINK_NAMES: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tf-apply-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
env: ${{ matrix.env }}

- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@68c1f353baff8aeb637650eb6b01d9c8c95f383a
uses: rtCamp/action-slack-notify@df21811e2c616364d99fc0211db875993489a4ea
if: ${{ failure() }}
env:
SLACK_LINK_NAMES: true
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/codegen.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodegenConfig } from "@graphql-codegen/cli";
import type { CodegenConfig } from "@graphql-codegen/cli";
import { scalars } from "@local/hash-isomorphic-utils/graphql/scalar-mapping";

const config: CodegenConfig = {
Expand Down
5 changes: 3 additions & 2 deletions apps/hash-api/src/ai/gpt/gpt-get-user-webs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { RequestHandler } from "express";
import type { RequestHandler } from "express";

import { getUserSimpleWebs, SimpleWeb } from "./shared/webs";
import type { SimpleWeb } from "./shared/webs";
import { getUserSimpleWebs } from "./shared/webs";

export type GptGetUserWebsResponseBody =
| { error: string }
Expand Down
15 changes: 9 additions & 6 deletions apps/hash-api/src/ai/gpt/gpt-query-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ import { typedEntries, typedKeys } from "@local/advanced-types/typed-entries";
import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries";
import { systemPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids";
import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value";
import {
import type {
OrganizationProperties,
UserProperties,
} from "@local/hash-isomorphic-utils/system-types/shared";
import {
import type {
Entity,
EntityId,
entityIdFromOwnedByIdAndEntityUuid,
EntityUuid,
Subgraph,
} from "@local/hash-subgraph";
import {
entityIdFromOwnedByIdAndEntityUuid,
extractDraftIdFromEntityId,
extractEntityUuidFromEntityId,
extractOwnedByIdFromEntityId,
Subgraph,
} from "@local/hash-subgraph";
import {
getEntityTypeById,
Expand All @@ -23,10 +25,11 @@ import {
getPropertyTypeForEntity,
mapGraphApiSubgraphToSubgraph,
} from "@local/hash-subgraph/stdlib";
import { RequestHandler } from "express";
import type { RequestHandler } from "express";

import { getLatestEntityById } from "../../graph/knowledge/primitive/entity";
import { getUserSimpleWebs, SimpleWeb } from "./shared/webs";
import type { SimpleWeb } from "./shared/webs";
import { getUserSimpleWebs } from "./shared/webs";

const stringifyResults = (
items: SimpleWeb[] | SimpleEntityType[] | SimpleEntity[],
Expand Down
10 changes: 4 additions & 6 deletions apps/hash-api/src/ai/gpt/shared/webs.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { AccountId } from "@local/hash-subgraph";
import type { AccountId } from "@local/hash-subgraph";

import { ImpureGraphContext } from "../../../graph/context-types";
import type { ImpureGraphContext } from "../../../graph/context-types";
import { getOrgMembershipOrg } from "../../../graph/knowledge/system-types/org-membership";
import {
getUserOrgMemberships,
User,
} from "../../../graph/knowledge/system-types/user";
import type { User } from "../../../graph/knowledge/system-types/user";
import { getUserOrgMemberships } from "../../../graph/knowledge/system-types/user";

export type SimpleWeb = {
uuid: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/ai/gpt/upsert-gpt-oauth-client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isUserHashInstanceAdmin } from "@local/hash-backend-utils/hash-instance";
import { RequestHandler } from "express";
import type { RequestHandler } from "express";

import { hydraAdmin } from "../../auth/ory-hydra";

Expand Down
17 changes: 9 additions & 8 deletions apps/hash-api/src/ai/infer-entities-websocket.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import http from "node:http";
import type http from "node:http";

import { DistributiveOmit } from "@local/advanced-types/distribute";
import { Logger } from "@local/hash-backend-utils/logger";
import {
import type { DistributiveOmit } from "@local/advanced-types/distribute";
import type { Logger } from "@local/hash-backend-utils/logger";
import type {
InferenceWebsocketRequestMessage,
InferEntitiesRequestMessage,
} from "@local/hash-isomorphic-utils/ai-inference-types";
import { Client } from "@temporalio/client";
import { WebSocket, WebSocketServer } from "ws";
import type { Client } from "@temporalio/client";
import type { WebSocket } from "ws";
import { WebSocketServer } from "ws";

import { getUserAndSession } from "../auth/create-auth-handlers";
import { ImpureGraphContext } from "../graph/context-types";
import { User } from "../graph/knowledge/system-types/user";
import type { ImpureGraphContext } from "../graph/context-types";
import type { User } from "../graph/knowledge/system-types/user";
import { handleCancelInferEntitiesRequest } from "./infer-entities-websocket/handle-cancel-infer-entities-request";
import { handleInferEntitiesRequest } from "./infer-entities-websocket/handle-infer-entities-request";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
import type {
CancelInferEntitiesRequestMessage,
InferEntitiesResponseMessage,
} from "@local/hash-isomorphic-utils/ai-inference-types";
import { StatusCode } from "@local/status";
import type { Client } from "@temporalio/client";
import type { WebSocket } from "ws";

import { User } from "../../graph/knowledge/system-types/user";
import type { User } from "../../graph/knowledge/system-types/user";

export const handleCancelInferEntitiesRequest = async ({
socket,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import {
import type {
GetResultsFromCancelledInferenceRequestQuery,
inferenceModelNames,
InferEntitiesCallerParams,
InferEntitiesRequestMessage,
InferEntitiesResponseMessage,
InferEntitiesReturn,
} from "@local/hash-isomorphic-utils/ai-inference-types";
import {
inferenceModelNames,
inferEntitiesUserArgumentKeys,
} from "@local/hash-isomorphic-utils/ai-inference-types";
import { StatusCode } from "@local/status";
Expand All @@ -15,7 +17,7 @@ import type {
} from "@temporalio/client";
import type { WebSocket } from "ws";

import { User } from "../../graph/knowledge/system-types/user";
import type { User } from "../../graph/knowledge/system-types/user";
import { logger } from "../../logger";

export const handleInferEntitiesRequest = async ({
Expand Down
15 changes: 8 additions & 7 deletions apps/hash-api/src/auth/create-auth-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { getRequiredEnv } from "@local/hash-backend-utils/environment";
import { getHashInstance } from "@local/hash-backend-utils/hash-instance";
import { Logger } from "@local/hash-backend-utils/logger";
import { Session } from "@ory/client";
import { AxiosError } from "axios";
import { Express, Request, RequestHandler } from "express";
import type { Logger } from "@local/hash-backend-utils/logger";
import type { Session } from "@ory/client";
import type { AxiosError } from "axios";
import type { Express, Request, RequestHandler } from "express";

import { ImpureGraphContext } from "../graph/context-types";
import type { ImpureGraphContext } from "../graph/context-types";
import type { User } from "../graph/knowledge/system-types/user";
import {
createUser,
getUserByKratosIdentityId,
User,
} from "../graph/knowledge/system-types/user";
import { systemAccountId } from "../graph/system-account";
import { hydraAdmin } from "./ory-hydra";
import { kratosFrontendApi, KratosUserIdentity } from "./ory-kratos";
import type { KratosUserIdentity } from "./ory-kratos";
import { kratosFrontendApi } from "./ory-kratos";
import { publicUserAccountId } from "./public-user-account-id";

const KRATOS_API_KEY = getRequiredEnv("KRATOS_API_KEY");
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/auth/get-actor-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request } from "express";
import type { Request } from "express";

import { publicUserAccountId } from "./public-user-account-id";

Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/auth/oauth-consent-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestHandler } from "express";
import type { RequestHandler } from "express";

import { hydraAdmin } from "./ory-hydra";

Expand Down
10 changes: 4 additions & 6 deletions apps/hash-api/src/auth/ory-kratos.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Configuration, Identity } from "@ory/client";
import {
CreateIdentityBody,
FrontendApi,
IdentityApi,
} from "@ory/kratos-client";
import type { Identity } from "@ory/client";
import { Configuration } from "@ory/client";
import type { CreateIdentityBody } from "@ory/kratos-client";
import { FrontendApi, IdentityApi } from "@ory/kratos-client";

import { getRequiredEnv } from "../util";

Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/auth/public-user-account-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountId } from "@local/hash-subgraph";
import type { AccountId } from "@local/hash-subgraph";

export const publicUserAccountId: AccountId =
"00000000-0000-0000-0000-000000000000" as AccountId;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { blockProtocolHubOrigin } from "@local/hash-isomorphic-utils/blocks";
import { Express } from "express";
import type { Express } from "express";
import proxy from "express-http-proxy";

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/cache/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataSource } from "apollo-datasource";
import type { DataSource } from "apollo-datasource";

export interface CacheAdapter extends DataSource {
/**
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CacheAdapter } from "./adapter";
import type { CacheAdapter } from "./adapter";

export type { CacheAdapter };

Expand Down
10 changes: 4 additions & 6 deletions apps/hash-api/src/cache/redis.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Logger } from "@local/hash-backend-utils/logger";
import {
AsyncRedisClient,
RedisSocketConfig,
} from "@local/hash-backend-utils/redis";
import type { Logger } from "@local/hash-backend-utils/logger";
import type { RedisSocketConfig } from "@local/hash-backend-utils/redis";
import { AsyncRedisClient } from "@local/hash-backend-utils/redis";
import { DataSource } from "apollo-datasource";

import { CacheAdapter } from "./adapter";
import type { CacheAdapter } from "./adapter";

export class RedisCache extends DataSource implements CacheAdapter {
private client: AsyncRedisClient;
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/src/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { URLSearchParams } from "node:url";
import { frontendUrl } from "@local/hash-isomorphic-utils/environment";
import dedent from "dedent";

import { EmailTransporter } from "./transporters";
import type { EmailTransporter } from "./transporters";

export const sendOrgEmailInvitationToEmailAddress =
(emailTransporter: EmailTransporter) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import * as aws from "@aws-sdk/client-ses";
import { defaultProvider } from "@aws-sdk/credential-provider-node";
import { convert } from "html-to-text";
import nodemailer from "nodemailer";
import SESTransport from "nodemailer/lib/ses-transport";
import type SESTransport from "nodemailer/lib/ses-transport";

import { logger } from "../../logger";
import { EmailTransporter, EmailTransporterSendMailOptions } from "./types";
import type {
EmailTransporter,
EmailTransporterSendMailOptions,
} from "./types";

export interface AwsSesEmailTransporterConfig {
from: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { convert } from "html-to-text";
import { dump } from "js-yaml";

import { logger } from "../../logger";
import { EmailTransporter, EmailTransporterSendMailOptions } from "./types";
import type {
EmailTransporter,
EmailTransporterSendMailOptions,
} from "./types";

interface PlainEmailDump {
date: string;
Expand Down
8 changes: 4 additions & 4 deletions apps/hash-api/src/express.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Session } from "@ory/client";
import type { Session } from "@ory/client";

import { ImpureGraphContext } from "./graph/context-types";
import { User } from "./graph/knowledge/system-types/user";
import { VaultClient } from "./vault";
import type { ImpureGraphContext } from "./graph/context-types";
import type { User } from "./graph/knowledge/system-types/user";
import type { VaultClient } from "./vault";

declare global {
namespace Express {
Expand Down
10 changes: 7 additions & 3 deletions apps/hash-api/src/generate-ontology-type-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
currentTimeInstantTemporalAxes,
zeroedGraphResolveDepths,
} from "@local/hash-isomorphic-utils/graph-queries";
import {
import type {
DataTypeWithMetadata,
EntityTypeWithMetadata,
PropertyTypeWithMetadata,
Expand All @@ -18,8 +18,12 @@ import { getRoots } from "@local/hash-subgraph/stdlib";
import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch";

import { publicUserAccountId } from "./auth/public-user-account-id";
import { ImpureGraphContext, ImpureGraphFunction } from "./graph/context-types";
import { getOrgByShortname, Org } from "./graph/knowledge/system-types/org";
import type {
ImpureGraphContext,
ImpureGraphFunction,
} from "./graph/context-types";
import type { Org } from "./graph/knowledge/system-types/org";
import { getOrgByShortname } from "./graph/knowledge/system-types/org";
import { getDataTypes } from "./graph/ontology/primitive/data-type";
import {
getEntityTypes,
Expand Down
10 changes: 7 additions & 3 deletions apps/hash-api/src/graph/account-permission-management.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {
import type {
InsertAccountGroupIdParams,
InsertAccountIdParams,
WebOwnerSubject,
} from "@local/hash-graph-client";
import { AccountGroupId, AccountId, OwnedById } from "@local/hash-subgraph";
import type {
AccountGroupId,
AccountId,
OwnedById,
} from "@local/hash-subgraph";

import { ImpureGraphFunction } from "./context-types";
import type { ImpureGraphFunction } from "./context-types";

export const addAccountGroupMember: ImpureGraphFunction<
{ accountId: AccountId; accountGroupId: AccountGroupId },
Expand Down
10 changes: 5 additions & 5 deletions apps/hash-api/src/graph/context-types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GraphApi as GraphApiClient } from "@local/hash-graph-client";
import { DataSource } from "apollo-datasource";
import type { GraphApi as GraphApiClient } from "@local/hash-graph-client";
import type { DataSource } from "apollo-datasource";

import { AuthenticationContext } from "../graphql/authentication-context";
import { UploadableStorageProvider } from "../storage/storage-provider";
import { TemporalClient } from "../temporal";
import type { AuthenticationContext } from "../graphql/authentication-context";
import type { UploadableStorageProvider } from "../storage/storage-provider";
import type { TemporalClient } from "../temporal";

export type GraphApi = GraphApiClient & DataSource;

Expand Down
4 changes: 2 additions & 2 deletions apps/hash-api/src/graph/ensure-system-graph-is-initialized.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from "@local/hash-backend-utils/logger";
import type { Logger } from "@local/hash-backend-utils/logger";

import { ImpureGraphContext } from "./context-types";
import type { ImpureGraphContext } from "./context-types";
import { migrateOntologyTypes } from "./ensure-system-graph-is-initialized/migrate-ontology-types";
import { ensureSystemEntitiesExist } from "./ensure-system-graph-is-initialized/system-webs-and-entities";
import { ensureHashSystemAccountExists } from "./system-account";
Expand Down
Loading

0 comments on commit 67e8767

Please sign in to comment.